Identified constant variable (byte*) main::SCREEN
Culled Empty Block (label) main::@2

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  (byte[]) screencode_mixed1#0 ← (const string) $0
  (byte[]) petscii_mixed1#0 ← (const string) $1
  (byte[]) petscii_mixed2#0 ← (const string) $2
  (byte[]) screencode_mixed2#0 ← (const string) $3
  (byte[]) screencode_upper#0 ← (const string) $4
  (byte[]) screencode_mixed3#0 ← (const string) $5
  to:@1
main: scope:[main]  from @1
  (byte*) main::SCREEN#0 ← ((byte*)) (number) $400
  (byte) main::i#0 ← (byte) 0
  to:main::@1
main::@1: scope:[main]  from main main::@1
  (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 )
  (byte*~) main::$0 ← (byte*) main::SCREEN#0 + (number) $28*(number) 2
  *((byte*~) main::$0 + (byte) main::i#2) ← *((byte[]) screencode_mixed1#0 + (byte) main::i#2)
  (byte*~) main::$1 ← (byte*) main::SCREEN#0 + (number) $28*(number) 0
  *((byte*~) main::$1 + (byte) main::i#2) ← *((byte[]) petscii_mixed1#0 + (byte) main::i#2)
  (byte*~) main::$2 ← (byte*) main::SCREEN#0 + (number) $28*(number) 1
  *((byte*~) main::$2 + (byte) main::i#2) ← *((byte[]) petscii_mixed2#0 + (byte) main::i#2)
  (byte*~) main::$3 ← (byte*) main::SCREEN#0 + (number) $28*(number) 2
  *((byte*~) main::$3 + (byte) main::i#2) ← *((byte[]) screencode_mixed2#0 + (byte) main::i#2)
  (byte*~) main::$4 ← (byte*) main::SCREEN#0 + (number) $28*(number) 4
  *((byte*~) main::$4 + (byte) main::i#2) ← *((byte[]) screencode_upper#0 + (byte) main::i#2)
  (byte*~) main::$5 ← (byte*) main::SCREEN#0 + (number) $28*(number) 3
  *((byte*~) main::$5 + (byte) main::i#2) ← *((byte[]) screencode_mixed3#0 + (byte) main::i#2)
  (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,5)
  (bool~) main::$6 ← (byte) main::i#1 != rangelast(0,5)
  if((bool~) main::$6) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@1
  return 
  to:@return
@1: scope:[]  from @begin
  call main 
  to:@2
@2: scope:[]  from @1
  to:@end
@end: scope:[]  from @2

SYMBOL TABLE SSA
(const string) $0 = (string) "abcABC1"
(const string) $1 = (string) "abcABC2"pm
(const string) $2 = (string) "abcABC3"pm
(const string) $3 = (string) "abcABC4"
(const string) $4 = (string) "abcABC5"su
(const string) $5 = (string) "abcABC6"
(label) @1
(label) @2
(label) @begin
(label) @end
(void()) main()
(byte*~) main::$0
(byte*~) main::$1
(byte*~) main::$2
(byte*~) main::$3
(byte*~) main::$4
(byte*~) main::$5
(bool~) main::$6
(label) main::@1
(label) main::@return
(byte*) main::SCREEN
(byte*) main::SCREEN#0
(byte) main::i
(byte) main::i#0
(byte) main::i#1
(byte) main::i#2
(byte[]) petscii_mixed1
(byte[]) petscii_mixed1#0
(byte[]) petscii_mixed2
(byte[]) petscii_mixed2#0
(byte[]) screencode_mixed1
(byte[]) screencode_mixed1#0
(byte[]) screencode_mixed2
(byte[]) screencode_mixed2#0
(byte[]) screencode_mixed3
(byte[]) screencode_mixed3#0
(byte[]) screencode_upper
(byte[]) screencode_upper#0

Adding number conversion cast (unumber) $28*2 in (byte*~) main::$0 ← (byte*) main::SCREEN#0 + (number) $28*(number) 2
Adding number conversion cast (unumber) $28*0 in (byte*~) main::$1 ← (byte*) main::SCREEN#0 + (number) $28*(number) 0
Adding number conversion cast (unumber) $28*1 in (byte*~) main::$2 ← (byte*) main::SCREEN#0 + (number) $28*(number) 1
Adding number conversion cast (unumber) $28*2 in (byte*~) main::$3 ← (byte*) main::SCREEN#0 + (number) $28*(number) 2
Adding number conversion cast (unumber) $28*4 in (byte*~) main::$4 ← (byte*) main::SCREEN#0 + (number) $28*(number) 4
Adding number conversion cast (unumber) $28*3 in (byte*~) main::$5 ← (byte*) main::SCREEN#0 + (number) $28*(number) 3
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Successful SSA optimization PassNCastSimplification
Simple Condition (bool~) main::$6 [23] if((byte) main::i#1!=rangelast(0,5)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte[]) screencode_mixed1#0 = $0
Constant (const byte[]) petscii_mixed1#0 = $1
Constant (const byte[]) petscii_mixed2#0 = $2
Constant (const byte[]) screencode_mixed2#0 = $3
Constant (const byte[]) screencode_upper#0 = $4
Constant (const byte[]) screencode_mixed3#0 = $5
Constant (const byte*) main::SCREEN#0 = (byte*) 1024
Constant (const byte) main::i#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [21] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [23] if(main::i#1!=rangelast(0,5)) goto main::@1 to (number) 6
Simplifying constant evaluating to zero (byte)(number) $28*(number) 0 in [11] (byte*~) main::$1 ← (const byte*) main::SCREEN#0 + (byte)(number) $28*(number) 0
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero main::SCREEN#0 in [11] (byte*~) main::$1 ← (const byte*) main::SCREEN#0 + (byte) 0
Successful SSA optimization PassNSimplifyExpressionWithZero
Adding number conversion cast (unumber) 6 in if((byte) main::i#1!=(number) 6) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 6
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 6
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [1] (byte*~) main::$0 ← (const byte*) main::SCREEN#0 + (byte)(number) $28*(number) 2
Constant right-side identified [5] (byte*~) main::$2 ← (const byte*) main::SCREEN#0 + (byte)(number) $28*(number) 1
Constant right-side identified [7] (byte*~) main::$3 ← (const byte*) main::SCREEN#0 + (byte)(number) $28*(number) 2
Constant right-side identified [9] (byte*~) main::$4 ← (const byte*) main::SCREEN#0 + (byte)(number) $28*(number) 4
Constant right-side identified [11] (byte*~) main::$5 ← (const byte*) main::SCREEN#0 + (byte)(number) $28*(number) 3
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::$0 = main::SCREEN#0+(byte)$28*2
Constant (const byte*) main::$1 = main::SCREEN#0
Constant (const byte*) main::$2 = main::SCREEN#0+(byte)$28*1
Constant (const byte*) main::$3 = main::SCREEN#0+(byte)$28*2
Constant (const byte*) main::$4 = main::SCREEN#0+(byte)$28*4
Constant (const byte*) main::$5 = main::SCREEN#0+(byte)$28*3
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with var siblings (const byte) main::i#0
Constant inlined $0 = (const byte[]) screencode_mixed1#0
Constant inlined $1 = (const byte[]) petscii_mixed1#0
Constant inlined $2 = (const byte[]) petscii_mixed2#0
Constant inlined $3 = (const byte[]) screencode_mixed2#0
Constant inlined $4 = (const byte[]) screencode_upper#0
Constant inlined $5 = (const byte[]) screencode_mixed3#0
Constant inlined main::$1 = (const byte*) main::SCREEN#0
Constant inlined main::$2 = (const byte*) main::SCREEN#0+(byte)(number) $28*(number) 1
Constant inlined main::$0 = (const byte*) main::SCREEN#0+(byte)(number) $28*(number) 2
Constant inlined main::$5 = (const byte*) main::SCREEN#0+(byte)(number) $28*(number) 3
Constant inlined main::i#0 = (byte) 0
Constant inlined main::$3 = (const byte*) main::SCREEN#0+(byte)(number) $28*(number) 2
Constant inlined main::$4 = (const byte*) main::SCREEN#0+(byte)(number) $28*(number) 4
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@3(between main::@1 and main::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:2 

Created 1 initial phi equivalence classes
Coalesced [16] main::i#3 ← main::i#1
Coalesced down to 1 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) main::@3
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  [1] phi()
  [2] call main 
  to:@end
@end: scope:[]  from @1
  [3] phi()
main: scope:[main]  from @1
  [4] phi()
  to:main::@1
main::@1: scope:[main]  from main main::@1
  [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
  [6] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 2 + (byte) main::i#2) ← *((const byte[]) screencode_mixed1#0 + (byte) main::i#2)
  [7] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) petscii_mixed1#0 + (byte) main::i#2)
  [8] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 1 + (byte) main::i#2) ← *((const byte[]) petscii_mixed2#0 + (byte) main::i#2)
  [9] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 2 + (byte) main::i#2) ← *((const byte[]) screencode_mixed2#0 + (byte) main::i#2)
  [10] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 4 + (byte) main::i#2) ← *((const byte[]) screencode_upper#0 + (byte) main::i#2)
  [11] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 3 + (byte) main::i#2) ← *((const byte[]) screencode_mixed3#0 + (byte) main::i#2)
  [12] (byte) main::i#1 ← ++ (byte) main::i#2
  [13] if((byte) main::i#1!=(byte) 6) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@1
  [14] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(void()) main()
(byte*) main::SCREEN
(byte) main::i
(byte) main::i#1 16.5
(byte) main::i#2 22.000000000000004
(byte[]) petscii_mixed1
(byte[]) petscii_mixed2
(byte[]) screencode_mixed1
(byte[]) screencode_mixed2
(byte[]) screencode_mixed3
(byte[]) screencode_upper

Initial phi equivalence classes
[ main::i#2 main::i#1 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]

INITIAL ASM
Target platform is c64basic
  // File Comments
// Test string encoding via literals
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from_b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    .label SCREEN = $400
    .label i = 2
    // [5] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z i
    jmp b1
    // [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
  b1_from_b1:
    // [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy 
    jmp b1
    // main::@1
  b1:
    // [6] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 2 + (byte) main::i#2) ← *((const byte[]) screencode_mixed1#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 
    ldy.z i
    lda screencode_mixed1,y
    sta SCREEN+$28*2,y
    // [7] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) petscii_mixed1#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 
    ldy.z i
    lda petscii_mixed1,y
    sta SCREEN,y
    // [8] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 1 + (byte) main::i#2) ← *((const byte[]) petscii_mixed2#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 
    ldy.z i
    lda petscii_mixed2,y
    sta SCREEN+$28*1,y
    // [9] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 2 + (byte) main::i#2) ← *((const byte[]) screencode_mixed2#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 
    ldy.z i
    lda screencode_mixed2,y
    sta SCREEN+$28*2,y
    // [10] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 4 + (byte) main::i#2) ← *((const byte[]) screencode_upper#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 
    ldy.z i
    lda screencode_upper,y
    sta SCREEN+$28*4,y
    // [11] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 3 + (byte) main::i#2) ← *((const byte[]) screencode_mixed3#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 
    ldy.z i
    lda screencode_mixed3,y
    sta SCREEN+$28*3,y
    // [12] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [13] if((byte) main::i#1!=(byte) 6) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #6
    cmp.z i
    bne b1_from_b1
    jmp breturn
    // main::@return
  breturn:
    // [14] return 
    rts
}
  // File Data
  // Default encoding (screencode_mixed)
  screencode_mixed1: .text "abcABC1"
  .byte 0
.encoding "petscii_mixed"
  petscii_mixed1: .text "abcABC2"
  .byte 0
  petscii_mixed2: .text "abcABC3"
  .byte 0
.encoding "screencode_mixed"
  screencode_mixed2: .text "abcABC4"
  .byte 0
  // Override default encoding using suffix
.encoding "screencode_upper"
  screencode_upper: .text "abcABC5"
  .byte 0
.encoding "screencode_mixed"
  screencode_mixed3: .text "abcABC6"
  .byte 0

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [6] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 2 + (byte) main::i#2) ← *((const byte[]) screencode_mixed1#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Statement [7] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) petscii_mixed1#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Statement [8] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 1 + (byte) main::i#2) ← *((const byte[]) petscii_mixed2#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Statement [9] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 2 + (byte) main::i#2) ← *((const byte[]) screencode_mixed2#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Statement [10] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 4 + (byte) main::i#2) ← *((const byte[]) screencode_upper#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Statement [11] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 3 + (byte) main::i#2) ← *((const byte[]) screencode_mixed3#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Statement [6] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 2 + (byte) main::i#2) ← *((const byte[]) screencode_mixed1#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Statement [7] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) petscii_mixed1#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Statement [8] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 1 + (byte) main::i#2) ← *((const byte[]) petscii_mixed2#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Statement [9] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 2 + (byte) main::i#2) ← *((const byte[]) screencode_mixed2#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Statement [10] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 4 + (byte) main::i#2) ← *((const byte[]) screencode_upper#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Statement [11] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 3 + (byte) main::i#2) ← *((const byte[]) screencode_mixed3#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 38.5: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 
Uplift Scope [] 

Uplifting [main] best 763 combination reg byte x [ main::i#2 main::i#1 ] 
Uplifting [] best 763 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Test string encoding via literals
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from_b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    .label SCREEN = $400
    // [5] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 
    ldx #0
    jmp b1
    // [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
  b1_from_b1:
    // [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy 
    jmp b1
    // main::@1
  b1:
    // [6] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 2 + (byte) main::i#2) ← *((const byte[]) screencode_mixed1#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda screencode_mixed1,x
    sta SCREEN+$28*2,x
    // [7] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) petscii_mixed1#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda petscii_mixed1,x
    sta SCREEN,x
    // [8] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 1 + (byte) main::i#2) ← *((const byte[]) petscii_mixed2#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda petscii_mixed2,x
    sta SCREEN+$28*1,x
    // [9] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 2 + (byte) main::i#2) ← *((const byte[]) screencode_mixed2#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda screencode_mixed2,x
    sta SCREEN+$28*2,x
    // [10] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 4 + (byte) main::i#2) ← *((const byte[]) screencode_upper#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda screencode_upper,x
    sta SCREEN+$28*4,x
    // [11] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 3 + (byte) main::i#2) ← *((const byte[]) screencode_mixed3#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda screencode_mixed3,x
    sta SCREEN+$28*3,x
    // [12] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [13] if((byte) main::i#1!=(byte) 6) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #6
    bne b1_from_b1
    jmp breturn
    // main::@return
  breturn:
    // [14] return 
    rts
}
  // File Data
  // Default encoding (screencode_mixed)
  screencode_mixed1: .text "abcABC1"
  .byte 0
.encoding "petscii_mixed"
  petscii_mixed1: .text "abcABC2"
  .byte 0
  petscii_mixed2: .text "abcABC3"
  .byte 0
.encoding "screencode_mixed"
  screencode_mixed2: .text "abcABC4"
  .byte 0
  // Override default encoding using suffix
.encoding "screencode_upper"
  screencode_upper: .text "abcABC5"
  .byte 0
.encoding "screencode_mixed"
  screencode_mixed3: .text "abcABC6"
  .byte 0

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label b1_from_b1 with b1
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Removing instruction b1_from_b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction b1_from_main:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(void()) main()
(label) main::@1
(label) main::@return
(byte*) main::SCREEN
(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024
(byte) main::i
(byte) main::i#1 reg byte x 16.5
(byte) main::i#2 reg byte x 22.000000000000004
(byte[]) petscii_mixed1
(const byte[]) petscii_mixed1#0 petscii_mixed1 = (string) "abcABC2"pm
(byte[]) petscii_mixed2
(const byte[]) petscii_mixed2#0 petscii_mixed2 = (string) "abcABC3"pm
(byte[]) screencode_mixed1
(const byte[]) screencode_mixed1#0 screencode_mixed1 = (string) "abcABC1"
(byte[]) screencode_mixed2
(const byte[]) screencode_mixed2#0 screencode_mixed2 = (string) "abcABC4"
(byte[]) screencode_mixed3
(const byte[]) screencode_mixed3#0 screencode_mixed3 = (string) "abcABC6"
(byte[]) screencode_upper
(const byte[]) screencode_upper#0 screencode_upper = (string) "abcABC5"su

reg byte x [ main::i#2 main::i#1 ]


FINAL ASSEMBLER
Score: 661

  // File Comments
// Test string encoding via literals
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  // @begin
  // [1] phi from @begin to @1 [phi:@begin->@1]
  // @1
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
  // [3] phi from @1 to @end [phi:@1->@end]
  // @end
  // main
main: {
    .label SCREEN = $400
    // [5] phi from main to main::@1 [phi:main->main::@1]
    // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 
    ldx #0
    // [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
    // [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy 
    // main::@1
  b1:
    // (SCREEN+40*2)[i] = screencode_mixed1[i]
    // [6] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 2 + (byte) main::i#2) ← *((const byte[]) screencode_mixed1#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda screencode_mixed1,x
    sta SCREEN+$28*2,x
    // (SCREEN+40*0)[i] = petscii_mixed1[i]
    // [7] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) petscii_mixed1#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda petscii_mixed1,x
    sta SCREEN,x
    // (SCREEN+40*1)[i] = petscii_mixed2[i]
    // [8] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 1 + (byte) main::i#2) ← *((const byte[]) petscii_mixed2#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda petscii_mixed2,x
    sta SCREEN+$28*1,x
    // (SCREEN+40*2)[i] = screencode_mixed2[i]
    // [9] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 2 + (byte) main::i#2) ← *((const byte[]) screencode_mixed2#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda screencode_mixed2,x
    sta SCREEN+$28*2,x
    // (SCREEN+40*4)[i] = screencode_upper[i]
    // [10] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 4 + (byte) main::i#2) ← *((const byte[]) screencode_upper#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda screencode_upper,x
    sta SCREEN+$28*4,x
    // (SCREEN+40*3)[i] = screencode_mixed3[i]
    // [11] *((const byte*) main::SCREEN#0+(byte)(number) $28*(number) 3 + (byte) main::i#2) ← *((const byte[]) screencode_mixed3#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda screencode_mixed3,x
    sta SCREEN+$28*3,x
    // for( char i: 0..5 )
    // [12] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [13] if((byte) main::i#1!=(byte) 6) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #6
    bne b1
    // main::@return
    // }
    // [14] return 
    rts
}
  // File Data
  // Default encoding (screencode_mixed)
  screencode_mixed1: .text "abcABC1"
  .byte 0
.encoding "petscii_mixed"
  petscii_mixed1: .text "abcABC2"
  .byte 0
  petscii_mixed2: .text "abcABC3"
  .byte 0
.encoding "screencode_mixed"
  screencode_mixed2: .text "abcABC4"
  .byte 0
  // Override default encoding using suffix
.encoding "screencode_upper"
  screencode_upper: .text "abcABC5"
  .byte 0
.encoding "screencode_mixed"
  screencode_mixed3: .text "abcABC6"
  .byte 0

