Warning! Adding boolean cast to non-boolean condition *((byte*) print2::msg + (byte) print2::i)
Identified constant variable (byte*) screen
Identified constant variable (byte*) main::hello
Inlined call call print2 (const byte*) screen (const byte*) main::hello 
Inlined call call print2 (byte*~) main::$1 (const byte*) main::hello 
Culled Empty Block (label) main::print21_@4
Culled Empty Block (label) main::print21_@3
Culled Empty Block (label) main::print21_@5
Culled Empty Block (label) main::print21_@6
Culled Empty Block (label) main::print21_@return
Culled Empty Block (label) main::print22_@4
Culled Empty Block (label) main::print22_@3
Culled Empty Block (label) main::print22_@5
Culled Empty Block (label) main::print22_@6
Culled Empty Block (label) main::print22_@return
Culled Empty Block (label) main::@2
Culled Empty Block (label) @1

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@2

(void()) main()
main: scope:[main]  from @2
  (byte*) main::print21_at#0 ← (const byte*) screen
  (byte*) main::print21_msg#0 ← (const byte*) main::hello
  to:main::print21
main::print21: scope:[main]  from main
  (byte*) main::print21_at#3 ← phi( main/(byte*) main::print21_at#0 )
  (byte*) main::print21_msg#3 ← phi( main/(byte*) main::print21_msg#0 )
  (byte) main::print21_j#0 ← (byte) 0
  (byte) main::print21_i#0 ← (byte) 0
  to:main::print21_@1
main::print21_@1: scope:[main]  from main::print21 main::print21_@2
  (byte) main::print21_j#3 ← phi( main::print21/(byte) main::print21_j#0 main::print21_@2/(byte) main::print21_j#1 )
  (byte*) main::print21_at#2 ← phi( main::print21/(byte*) main::print21_at#3 main::print21_@2/(byte*) main::print21_at#1 )
  (byte) main::print21_i#2 ← phi( main::print21/(byte) main::print21_i#0 main::print21_@2/(byte) main::print21_i#1 )
  (byte*) main::print21_msg#1 ← phi( main::print21/(byte*) main::print21_msg#3 main::print21_@2/(byte*) main::print21_msg#2 )
  (bool~) main::print21_$0 ← (number) 0 != *((byte*) main::print21_msg#1 + (byte) main::print21_i#2)
  if((bool~) main::print21_$0) goto main::print21_@2
  to:main::@1
main::print21_@2: scope:[main]  from main::print21_@1
  (byte) main::print21_j#2 ← phi( main::print21_@1/(byte) main::print21_j#3 )
  (byte*) main::print21_at#1 ← phi( main::print21_@1/(byte*) main::print21_at#2 )
  (byte) main::print21_i#3 ← phi( main::print21_@1/(byte) main::print21_i#2 )
  (byte*) main::print21_msg#2 ← phi( main::print21_@1/(byte*) main::print21_msg#1 )
  *((byte*) main::print21_at#1 + (byte) main::print21_j#2) ← *((byte*) main::print21_msg#2 + (byte) main::print21_i#3)
  (byte) main::print21_j#1 ← (byte) main::print21_j#2 + (number) 2
  (byte) main::print21_i#1 ← ++ (byte) main::print21_i#3
  to:main::print21_@1
main::@1: scope:[main]  from main::print21_@1
  (byte*~) main::$1 ← (const byte*) screen + (number) $50
  (byte*) main::print22_at#0 ← (byte*~) main::$1
  (byte*) main::print22_msg#0 ← (const byte*) main::hello
  to:main::print22
main::print22: scope:[main]  from main::@1
  (byte*) main::print22_at#3 ← phi( main::@1/(byte*) main::print22_at#0 )
  (byte*) main::print22_msg#3 ← phi( main::@1/(byte*) main::print22_msg#0 )
  (byte) main::print22_j#0 ← (byte) 0
  (byte) main::print22_i#0 ← (byte) 0
  to:main::print22_@1
main::print22_@1: scope:[main]  from main::print22 main::print22_@2
  (byte) main::print22_j#3 ← phi( main::print22/(byte) main::print22_j#0 main::print22_@2/(byte) main::print22_j#1 )
  (byte*) main::print22_at#2 ← phi( main::print22/(byte*) main::print22_at#3 main::print22_@2/(byte*) main::print22_at#1 )
  (byte) main::print22_i#2 ← phi( main::print22/(byte) main::print22_i#0 main::print22_@2/(byte) main::print22_i#1 )
  (byte*) main::print22_msg#1 ← phi( main::print22/(byte*) main::print22_msg#3 main::print22_@2/(byte*) main::print22_msg#2 )
  (bool~) main::print22_$0 ← (number) 0 != *((byte*) main::print22_msg#1 + (byte) main::print22_i#2)
  if((bool~) main::print22_$0) goto main::print22_@2
  to:main::@return
main::print22_@2: scope:[main]  from main::print22_@1
  (byte) main::print22_j#2 ← phi( main::print22_@1/(byte) main::print22_j#3 )
  (byte*) main::print22_at#1 ← phi( main::print22_@1/(byte*) main::print22_at#2 )
  (byte) main::print22_i#3 ← phi( main::print22_@1/(byte) main::print22_i#2 )
  (byte*) main::print22_msg#2 ← phi( main::print22_@1/(byte*) main::print22_msg#1 )
  *((byte*) main::print22_at#1 + (byte) main::print22_j#2) ← *((byte*) main::print22_msg#2 + (byte) main::print22_i#3)
  (byte) main::print22_j#1 ← (byte) main::print22_j#2 + (number) 2
  (byte) main::print22_i#1 ← ++ (byte) main::print22_i#3
  to:main::print22_@1
main::@return: scope:[main]  from main::print22_@1
  return 
  to:@return
@2: scope:[]  from @begin
  call main 
  to:@3
@3: scope:[]  from @2
  to:@end
@end: scope:[]  from @3

SYMBOL TABLE SSA
(label) @2
(label) @3
(label) @begin
(label) @end
(void()) main()
(byte*~) main::$1
(label) main::@1
(label) main::@return
(const byte*) main::hello = (string) "hello world!"
(label) main::print21
(bool~) main::print21_$0
(label) main::print21_@1
(label) main::print21_@2
(byte*) main::print21_at
(byte*) main::print21_at#0
(byte*) main::print21_at#1
(byte*) main::print21_at#2
(byte*) main::print21_at#3
(byte) main::print21_i
(byte) main::print21_i#0
(byte) main::print21_i#1
(byte) main::print21_i#2
(byte) main::print21_i#3
(byte) main::print21_j
(byte) main::print21_j#0
(byte) main::print21_j#1
(byte) main::print21_j#2
(byte) main::print21_j#3
(byte*) main::print21_msg
(byte*) main::print21_msg#0
(byte*) main::print21_msg#1
(byte*) main::print21_msg#2
(byte*) main::print21_msg#3
(label) main::print22
(bool~) main::print22_$0
(label) main::print22_@1
(label) main::print22_@2
(byte*) main::print22_at
(byte*) main::print22_at#0
(byte*) main::print22_at#1
(byte*) main::print22_at#2
(byte*) main::print22_at#3
(byte) main::print22_i
(byte) main::print22_i#0
(byte) main::print22_i#1
(byte) main::print22_i#2
(byte) main::print22_i#3
(byte) main::print22_j
(byte) main::print22_j#0
(byte) main::print22_j#1
(byte) main::print22_j#2
(byte) main::print22_j#3
(byte*) main::print22_msg
(byte*) main::print22_msg#0
(byte*) main::print22_msg#1
(byte*) main::print22_msg#2
(byte*) main::print22_msg#3
(const byte*) screen = (byte*)(number) $400

Adding number conversion cast (unumber) 0 in (bool~) main::print21_$0 ← (number) 0 != *((byte*) main::print21_msg#1 + (byte) main::print21_i#2)
Adding number conversion cast (unumber) 2 in (byte) main::print21_j#1 ← (byte) main::print21_j#2 + (number) 2
Adding number conversion cast (unumber) $50 in (byte*~) main::$1 ← (const byte*) screen + (number) $50
Adding number conversion cast (unumber) 0 in (bool~) main::print22_$0 ← (number) 0 != *((byte*) main::print22_msg#1 + (byte) main::print22_i#2)
Adding number conversion cast (unumber) 2 in (byte) main::print22_j#1 ← (byte) main::print22_j#2 + (number) 2
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 2
Simplifying constant integer cast $50
Simplifying constant integer cast 0
Simplifying constant integer cast 2
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) $50
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 2
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte*) main::print21_msg#0 = (byte*) main::print21_msg#3 
Alias (byte*) main::print21_at#0 = (byte*) main::print21_at#3 
Alias (byte*) main::print21_msg#1 = (byte*) main::print21_msg#2 
Alias (byte) main::print21_i#2 = (byte) main::print21_i#3 
Alias (byte*) main::print21_at#1 = (byte*) main::print21_at#2 
Alias (byte) main::print21_j#2 = (byte) main::print21_j#3 
Alias (byte*) main::print22_at#0 = (byte*~) main::$1 (byte*) main::print22_at#3 
Alias (byte*) main::print22_msg#0 = (byte*) main::print22_msg#3 
Alias (byte*) main::print22_msg#1 = (byte*) main::print22_msg#2 
Alias (byte) main::print22_i#2 = (byte) main::print22_i#3 
Alias (byte*) main::print22_at#1 = (byte*) main::print22_at#2 
Alias (byte) main::print22_j#2 = (byte) main::print22_j#3 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte*) main::print21_msg#1 (byte*) main::print21_msg#0
Identical Phi Values (byte*) main::print21_at#1 (byte*) main::print21_at#0
Identical Phi Values (byte*) main::print22_msg#1 (byte*) main::print22_msg#0
Identical Phi Values (byte*) main::print22_at#1 (byte*) main::print22_at#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::print21_$0 [7] if((byte) 0!=*((byte*) main::print21_msg#0 + (byte) main::print21_i#2)) goto main::print21_@2
Simple Condition (bool~) main::print22_$0 [20] if((byte) 0!=*((byte*) main::print22_msg#0 + (byte) main::print22_i#2)) goto main::print22_@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [12] (byte*) main::print22_at#0 ← (const byte*) screen + (byte) $50
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::print21_at#0 = screen
Constant (const byte*) main::print21_msg#0 = main::hello
Constant (const byte) main::print21_j#0 = 0
Constant (const byte) main::print21_i#0 = 0
Constant (const byte*) main::print22_at#0 = screen+$50
Constant (const byte*) main::print22_msg#0 = main::hello
Constant (const byte) main::print22_j#0 = 0
Constant (const byte) main::print22_i#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with var siblings (const byte) main::print21_j#0
Inlining constant with var siblings (const byte) main::print21_i#0
Inlining constant with var siblings (const byte) main::print22_j#0
Inlining constant with var siblings (const byte) main::print22_i#0
Constant inlined main::print22_msg#0 = (const byte*) main::hello
Constant inlined main::print22_i#0 = (byte) 0
Constant inlined main::print21_i#0 = (byte) 0
Constant inlined main::print22_j#0 = (byte) 0
Constant inlined main::print21_j#0 = (byte) 0
Constant inlined main::print21_at#0 = (const byte*) screen
Constant inlined main::print21_msg#0 = (const byte*) main::hello
Successful SSA optimization Pass2ConstantInlining
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @3
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::print21
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::print22
CALL GRAPH
Calls in [] to main:2 

Created 4 initial phi equivalence classes
Coalesced [17] main::print22_i#4 ← main::print22_i#1
Coalesced [18] main::print22_j#4 ← main::print22_j#1
Coalesced [22] main::print21_i#4 ← main::print21_i#1
Coalesced [23] main::print21_j#4 ← main::print21_j#1
Coalesced down to 4 phi equivalence classes
Culled Empty Block (label) @3
Culled Empty Block (label) main::@1
Renumbering block @2 to @1
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
Adding NOP phi() at start of main::print21
Adding NOP phi() at start of main::print22

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()

(void()) main()
main: scope:[main]  from @1
  [4] phi()
  to:main::print21
main::print21: scope:[main]  from main
  [5] phi()
  to:main::print21_@1
main::print21_@1: scope:[main]  from main::print21 main::print21_@2
  [6] (byte) main::print21_j#2 ← phi( main::print21/(byte) 0 main::print21_@2/(byte) main::print21_j#1 )
  [6] (byte) main::print21_i#2 ← phi( main::print21/(byte) 0 main::print21_@2/(byte) main::print21_i#1 )
  [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print21_i#2)) goto main::print21_@2
  to:main::print22
main::print22: scope:[main]  from main::print21_@1
  [8] phi()
  to:main::print22_@1
main::print22_@1: scope:[main]  from main::print22 main::print22_@2
  [9] (byte) main::print22_j#2 ← phi( main::print22/(byte) 0 main::print22_@2/(byte) main::print22_j#1 )
  [9] (byte) main::print22_i#2 ← phi( main::print22/(byte) 0 main::print22_@2/(byte) main::print22_i#1 )
  [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print22_i#2)) goto main::print22_@2
  to:main::@return
main::@return: scope:[main]  from main::print22_@1
  [11] return 
  to:@return
main::print22_@2: scope:[main]  from main::print22_@1
  [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello + (byte) main::print22_i#2)
  [13] (byte) main::print22_j#1 ← (byte) main::print22_j#2 + (byte) 2
  [14] (byte) main::print22_i#1 ← ++ (byte) main::print22_i#2
  to:main::print22_@1
main::print21_@2: scope:[main]  from main::print21_@1
  [15] *((const byte*) screen + (byte) main::print21_j#2) ← *((const byte*) main::hello + (byte) main::print21_i#2)
  [16] (byte) main::print21_j#1 ← (byte) main::print21_j#2 + (byte) 2
  [17] (byte) main::print21_i#1 ← ++ (byte) main::print21_i#2
  to:main::print21_@1


VARIABLE REGISTER WEIGHTS
(void()) main()
(byte*) main::print21_at
(byte) main::print21_i
(byte) main::print21_i#1 22.0
(byte) main::print21_i#2 11.0
(byte) main::print21_j
(byte) main::print21_j#1 11.0
(byte) main::print21_j#2 11.0
(byte*) main::print21_msg
(byte*) main::print22_at
(byte) main::print22_i
(byte) main::print22_i#1 22.0
(byte) main::print22_i#2 11.0
(byte) main::print22_j
(byte) main::print22_j#1 11.0
(byte) main::print22_j#2 11.0
(byte*) main::print22_msg

Initial phi equivalence classes
[ main::print21_i#2 main::print21_i#1 ]
[ main::print21_j#2 main::print21_j#1 ]
[ main::print22_i#2 main::print22_i#1 ]
[ main::print22_j#2 main::print22_j#1 ]
Complete equivalence classes
[ main::print21_i#2 main::print21_i#1 ]
[ main::print21_j#2 main::print21_j#1 ]
[ main::print22_i#2 main::print22_i#1 ]
[ main::print22_j#2 main::print22_j#1 ]
Allocated zp[1]:2 [ main::print21_i#2 main::print21_i#1 ]
Allocated zp[1]:3 [ main::print21_j#2 main::print21_j#1 ]
Allocated zp[1]:4 [ main::print22_i#2 main::print22_i#1 ]
Allocated zp[1]:5 [ main::print22_j#2 main::print22_j#1 ]

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label screen = $400
  // @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 print22_at = screen+$50
    .label print21_j = 3
    .label print21_i = 2
    .label print22_j = 5
    .label print22_i = 4
    // [5] phi from main to main::print21 [phi:main->main::print21]
  print21_from_main:
    jmp print21
    // main::print21
  print21:
    // [6] phi from main::print21 to main::print21_@1 [phi:main::print21->main::print21_@1]
  print21___b1_from_print21:
    // [6] phi (byte) main::print21_j#2 = (byte) 0 [phi:main::print21->main::print21_@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z print21_j
    // [6] phi (byte) main::print21_i#2 = (byte) 0 [phi:main::print21->main::print21_@1#1] -- vbuz1=vbuc1 
    lda #0
    sta.z print21_i
    jmp print21___b1
    // main::print21_@1
  print21___b1:
    // [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print21_i#2)) goto main::print21_@2 -- vbuc1_neq_pbuc2_derefidx_vbuz1_then_la1 
    lda #0
    ldy.z print21_i
    cmp hello,y
    bne print21___b2
    // [8] phi from main::print21_@1 to main::print22 [phi:main::print21_@1->main::print22]
  print22_from_print21___b1:
    jmp print22
    // main::print22
  print22:
    // [9] phi from main::print22 to main::print22_@1 [phi:main::print22->main::print22_@1]
  print22___b1_from_print22:
    // [9] phi (byte) main::print22_j#2 = (byte) 0 [phi:main::print22->main::print22_@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z print22_j
    // [9] phi (byte) main::print22_i#2 = (byte) 0 [phi:main::print22->main::print22_@1#1] -- vbuz1=vbuc1 
    lda #0
    sta.z print22_i
    jmp print22___b1
    // main::print22_@1
  print22___b1:
    // [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print22_i#2)) goto main::print22_@2 -- vbuc1_neq_pbuc2_derefidx_vbuz1_then_la1 
    lda #0
    ldy.z print22_i
    cmp hello,y
    bne print22___b2
    jmp __breturn
    // main::@return
  __breturn:
    // [11] return 
    rts
    // main::print22_@2
  print22___b2:
    // [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello + (byte) main::print22_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 
    ldy.z print22_i
    lda hello,y
    ldy.z print22_j
    sta print22_at,y
    // [13] (byte) main::print22_j#1 ← (byte) main::print22_j#2 + (byte) 2 -- vbuz1=vbuz1_plus_2 
    lda.z print22_j
    clc
    adc #2
    sta.z print22_j
    // [14] (byte) main::print22_i#1 ← ++ (byte) main::print22_i#2 -- vbuz1=_inc_vbuz1 
    inc.z print22_i
    // [9] phi from main::print22_@2 to main::print22_@1 [phi:main::print22_@2->main::print22_@1]
  print22___b1_from_print22___b2:
    // [9] phi (byte) main::print22_j#2 = (byte) main::print22_j#1 [phi:main::print22_@2->main::print22_@1#0] -- register_copy 
    // [9] phi (byte) main::print22_i#2 = (byte) main::print22_i#1 [phi:main::print22_@2->main::print22_@1#1] -- register_copy 
    jmp print22___b1
    // main::print21_@2
  print21___b2:
    // [15] *((const byte*) screen + (byte) main::print21_j#2) ← *((const byte*) main::hello + (byte) main::print21_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 
    ldy.z print21_i
    lda hello,y
    ldy.z print21_j
    sta screen,y
    // [16] (byte) main::print21_j#1 ← (byte) main::print21_j#2 + (byte) 2 -- vbuz1=vbuz1_plus_2 
    lda.z print21_j
    clc
    adc #2
    sta.z print21_j
    // [17] (byte) main::print21_i#1 ← ++ (byte) main::print21_i#2 -- vbuz1=_inc_vbuz1 
    inc.z print21_i
    // [6] phi from main::print21_@2 to main::print21_@1 [phi:main::print21_@2->main::print21_@1]
  print21___b1_from_print21___b2:
    // [6] phi (byte) main::print21_j#2 = (byte) main::print21_j#1 [phi:main::print21_@2->main::print21_@1#0] -- register_copy 
    // [6] phi (byte) main::print21_i#2 = (byte) main::print21_i#1 [phi:main::print21_@2->main::print21_@1#1] -- register_copy 
    jmp print21___b1
    hello: .text "hello world!"
    .byte 0
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print21_i#2)) goto main::print21_@2 [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::print21_i#2 main::print21_i#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:3 [ main::print21_j#2 main::print21_j#1 ]
Statement [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print22_i#2)) goto main::print22_@2 [ main::print22_i#2 main::print22_j#2 ] ( main:2 [ main::print22_i#2 main::print22_j#2 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:4 [ main::print22_i#2 main::print22_i#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:5 [ main::print22_j#2 main::print22_j#1 ]
Statement [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello + (byte) main::print22_i#2) [ main::print22_i#2 main::print22_j#2 ] ( main:2 [ main::print22_i#2 main::print22_j#2 ] ) always clobbers reg byte a 
Statement [15] *((const byte*) screen + (byte) main::print21_j#2) ← *((const byte*) main::hello + (byte) main::print21_i#2) [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a 
Statement [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print21_i#2)) goto main::print21_@2 [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a 
Statement [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print22_i#2)) goto main::print22_@2 [ main::print22_i#2 main::print22_j#2 ] ( main:2 [ main::print22_i#2 main::print22_j#2 ] ) always clobbers reg byte a 
Statement [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello + (byte) main::print22_i#2) [ main::print22_i#2 main::print22_j#2 ] ( main:2 [ main::print22_i#2 main::print22_j#2 ] ) always clobbers reg byte a 
Statement [15] *((const byte*) screen + (byte) main::print21_j#2) ← *((const byte*) main::hello + (byte) main::print21_i#2) [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a 
Potential registers zp[1]:2 [ main::print21_i#2 main::print21_i#1 ] : zp[1]:2 , reg byte x , reg byte y , 
Potential registers zp[1]:3 [ main::print21_j#2 main::print21_j#1 ] : zp[1]:3 , reg byte x , reg byte y , 
Potential registers zp[1]:4 [ main::print22_i#2 main::print22_i#1 ] : zp[1]:4 , reg byte x , reg byte y , 
Potential registers zp[1]:5 [ main::print22_j#2 main::print22_j#1 ] : zp[1]:5 , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 33: zp[1]:2 [ main::print21_i#2 main::print21_i#1 ] 33: zp[1]:4 [ main::print22_i#2 main::print22_i#1 ] 22: zp[1]:3 [ main::print21_j#2 main::print21_j#1 ] 22: zp[1]:5 [ main::print22_j#2 main::print22_j#1 ] 
Uplift Scope [] 

Uplifting [main] best 744 combination reg byte y [ main::print21_i#2 main::print21_i#1 ] reg byte y [ main::print22_i#2 main::print22_i#1 ] reg byte x [ main::print21_j#2 main::print21_j#1 ] reg byte x [ main::print22_j#2 main::print22_j#1 ] 
Uplifting [] best 744 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label screen = $400
  // @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 print22_at = screen+$50
    // [5] phi from main to main::print21 [phi:main->main::print21]
  print21_from_main:
    jmp print21
    // main::print21
  print21:
    // [6] phi from main::print21 to main::print21_@1 [phi:main::print21->main::print21_@1]
  print21___b1_from_print21:
    // [6] phi (byte) main::print21_j#2 = (byte) 0 [phi:main::print21->main::print21_@1#0] -- vbuxx=vbuc1 
    ldx #0
    // [6] phi (byte) main::print21_i#2 = (byte) 0 [phi:main::print21->main::print21_@1#1] -- vbuyy=vbuc1 
    ldy #0
    jmp print21___b1
    // main::print21_@1
  print21___b1:
    // [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print21_i#2)) goto main::print21_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 
    lda #0
    cmp hello,y
    bne print21___b2
    // [8] phi from main::print21_@1 to main::print22 [phi:main::print21_@1->main::print22]
  print22_from_print21___b1:
    jmp print22
    // main::print22
  print22:
    // [9] phi from main::print22 to main::print22_@1 [phi:main::print22->main::print22_@1]
  print22___b1_from_print22:
    // [9] phi (byte) main::print22_j#2 = (byte) 0 [phi:main::print22->main::print22_@1#0] -- vbuxx=vbuc1 
    ldx #0
    // [9] phi (byte) main::print22_i#2 = (byte) 0 [phi:main::print22->main::print22_@1#1] -- vbuyy=vbuc1 
    ldy #0
    jmp print22___b1
    // main::print22_@1
  print22___b1:
    // [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print22_i#2)) goto main::print22_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 
    lda #0
    cmp hello,y
    bne print22___b2
    jmp __breturn
    // main::@return
  __breturn:
    // [11] return 
    rts
    // main::print22_@2
  print22___b2:
    // [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello + (byte) main::print22_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy 
    lda hello,y
    sta print22_at,x
    // [13] (byte) main::print22_j#1 ← (byte) main::print22_j#2 + (byte) 2 -- vbuxx=vbuxx_plus_2 
    inx
    inx
    // [14] (byte) main::print22_i#1 ← ++ (byte) main::print22_i#2 -- vbuyy=_inc_vbuyy 
    iny
    // [9] phi from main::print22_@2 to main::print22_@1 [phi:main::print22_@2->main::print22_@1]
  print22___b1_from_print22___b2:
    // [9] phi (byte) main::print22_j#2 = (byte) main::print22_j#1 [phi:main::print22_@2->main::print22_@1#0] -- register_copy 
    // [9] phi (byte) main::print22_i#2 = (byte) main::print22_i#1 [phi:main::print22_@2->main::print22_@1#1] -- register_copy 
    jmp print22___b1
    // main::print21_@2
  print21___b2:
    // [15] *((const byte*) screen + (byte) main::print21_j#2) ← *((const byte*) main::hello + (byte) main::print21_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy 
    lda hello,y
    sta screen,x
    // [16] (byte) main::print21_j#1 ← (byte) main::print21_j#2 + (byte) 2 -- vbuxx=vbuxx_plus_2 
    inx
    inx
    // [17] (byte) main::print21_i#1 ← ++ (byte) main::print21_i#2 -- vbuyy=_inc_vbuyy 
    iny
    // [6] phi from main::print21_@2 to main::print21_@1 [phi:main::print21_@2->main::print21_@1]
  print21___b1_from_print21___b2:
    // [6] phi (byte) main::print21_j#2 = (byte) main::print21_j#1 [phi:main::print21_@2->main::print21_@1#0] -- register_copy 
    // [6] phi (byte) main::print21_i#2 = (byte) main::print21_i#1 [phi:main::print21_@2->main::print21_@1#1] -- register_copy 
    jmp print21___b1
    hello: .text "hello world!"
    .byte 0
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __bend
Removing instruction jmp print21
Removing instruction jmp print21___b1
Removing instruction jmp print22
Removing instruction jmp print22___b1
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __bbegin with __b1
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Removing instruction print21_from_main:
Removing instruction print21___b1_from_print21:
Removing instruction print22_from_print21___b1:
Removing instruction print22___b1_from_print22:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bend:
Removing instruction print21:
Removing instruction print22:
Removing instruction __breturn:
Removing instruction print22___b1_from_print22___b2:
Removing instruction print21___b1_from_print21___b2:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Replacing instruction ldx #0 with TAX
Replacing instruction ldy #0 with TAY
Removing instruction __b1:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(void()) main()
(label) main::@return
(const byte*) main::hello = (string) "hello world!"
(label) main::print21
(label) main::print21_@1
(label) main::print21_@2
(byte*) main::print21_at
(byte) main::print21_i
(byte) main::print21_i#1 reg byte y 22.0
(byte) main::print21_i#2 reg byte y 11.0
(byte) main::print21_j
(byte) main::print21_j#1 reg byte x 11.0
(byte) main::print21_j#2 reg byte x 11.0
(byte*) main::print21_msg
(label) main::print22
(label) main::print22_@1
(label) main::print22_@2
(byte*) main::print22_at
(const byte*) main::print22_at#0 print22_at = (const byte*) screen+(byte) $50
(byte) main::print22_i
(byte) main::print22_i#1 reg byte y 22.0
(byte) main::print22_i#2 reg byte y 11.0
(byte) main::print22_j
(byte) main::print22_j#1 reg byte x 11.0
(byte) main::print22_j#2 reg byte x 11.0
(byte*) main::print22_msg
(const byte*) screen = (byte*) 1024

reg byte y [ main::print21_i#2 main::print21_i#1 ]
reg byte x [ main::print21_j#2 main::print21_j#1 ]
reg byte y [ main::print22_i#2 main::print22_i#1 ]
reg byte x [ main::print22_j#2 main::print22_j#1 ]


FINAL ASSEMBLER
Score: 636

  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .label screen = $400
  // @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 print22_at = screen+$50
    // [5] phi from main to main::print21 [phi:main->main::print21]
    // main::print21
    // [6] phi from main::print21 to main::print21_@1 [phi:main::print21->main::print21_@1]
    // [6] phi (byte) main::print21_j#2 = (byte) 0 [phi:main::print21->main::print21_@1#0] -- vbuxx=vbuc1 
    ldx #0
    // [6] phi (byte) main::print21_i#2 = (byte) 0 [phi:main::print21->main::print21_@1#1] -- vbuyy=vbuc1 
    ldy #0
    // main::print21_@1
  print21___b1:
    // for(byte i=0; msg[i]; i++)
    // [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print21_i#2)) goto main::print21_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 
    lda #0
    cmp hello,y
    bne print21___b2
    // [8] phi from main::print21_@1 to main::print22 [phi:main::print21_@1->main::print22]
    // main::print22
    // [9] phi from main::print22 to main::print22_@1 [phi:main::print22->main::print22_@1]
    // [9] phi (byte) main::print22_j#2 = (byte) 0 [phi:main::print22->main::print22_@1#0] -- vbuxx=vbuc1 
    tax
    // [9] phi (byte) main::print22_i#2 = (byte) 0 [phi:main::print22->main::print22_@1#1] -- vbuyy=vbuc1 
    tay
    // main::print22_@1
  print22___b1:
    // for(byte i=0; msg[i]; i++)
    // [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print22_i#2)) goto main::print22_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 
    lda #0
    cmp hello,y
    bne print22___b2
    // main::@return
    // }
    // [11] return 
    rts
    // main::print22_@2
  print22___b2:
    // at[j] = msg[i]
    // [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello + (byte) main::print22_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy 
    lda hello,y
    sta print22_at,x
    // j += 2
    // [13] (byte) main::print22_j#1 ← (byte) main::print22_j#2 + (byte) 2 -- vbuxx=vbuxx_plus_2 
    inx
    inx
    // for(byte i=0; msg[i]; i++)
    // [14] (byte) main::print22_i#1 ← ++ (byte) main::print22_i#2 -- vbuyy=_inc_vbuyy 
    iny
    // [9] phi from main::print22_@2 to main::print22_@1 [phi:main::print22_@2->main::print22_@1]
    // [9] phi (byte) main::print22_j#2 = (byte) main::print22_j#1 [phi:main::print22_@2->main::print22_@1#0] -- register_copy 
    // [9] phi (byte) main::print22_i#2 = (byte) main::print22_i#1 [phi:main::print22_@2->main::print22_@1#1] -- register_copy 
    jmp print22___b1
    // main::print21_@2
  print21___b2:
    // at[j] = msg[i]
    // [15] *((const byte*) screen + (byte) main::print21_j#2) ← *((const byte*) main::hello + (byte) main::print21_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy 
    lda hello,y
    sta screen,x
    // j += 2
    // [16] (byte) main::print21_j#1 ← (byte) main::print21_j#2 + (byte) 2 -- vbuxx=vbuxx_plus_2 
    inx
    inx
    // for(byte i=0; msg[i]; i++)
    // [17] (byte) main::print21_i#1 ← ++ (byte) main::print21_i#2 -- vbuyy=_inc_vbuyy 
    iny
    // [6] phi from main::print21_@2 to main::print21_@1 [phi:main::print21_@2->main::print21_@1]
    // [6] phi (byte) main::print21_j#2 = (byte) main::print21_j#1 [phi:main::print21_@2->main::print21_@1#0] -- register_copy 
    // [6] phi (byte) main::print21_i#2 = (byte) main::print21_i#1 [phi:main::print21_@2->main::print21_@1#1] -- register_copy 
    jmp print21___b1
    hello: .text "hello world!"
    .byte 0
}
  // File Data

