Identified constant variable (byte*) main::zpptr
Culled Empty Block (label) main::@6

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

(void()) main()
main: scope:[main]  from @1
  (byte) main::j#0 ← (byte) 0
  to:main::@1
main::@1: scope:[main]  from main main::@5
  (byte) main::j#6 ← phi( main/(byte) main::j#0 main::@5/(byte) main::j#1 )
  (byte) main::i#0 ← (byte) 0
  to:main::@2
main::@2: scope:[main]  from main::@1 main::@4
  (byte) main::j#4 ← phi( main::@1/(byte) main::j#6 main::@4/(byte) main::j#5 )
  (byte) main::i#4 ← phi( main::@1/(byte) main::i#0 main::@4/(byte) main::i#1 )
  (byte) main::k#0 ← (byte) 0
  to:main::@3
main::@3: scope:[main]  from main::@2 main::@3
  (byte) main::k#2 ← phi( main::@2/(byte) main::k#0 main::@3/(byte) main::k#1 )
  (byte) main::j#2 ← phi( main::@2/(byte) main::j#4 main::@3/(byte) main::j#2 )
  (byte) main::i#2 ← phi( main::@2/(byte) main::i#4 main::@3/(byte) main::i#2 )
  (byte*~) main::$0 ← (const byte*) main::zpptr + (byte) main::i#2
  (byte*) main::zpptr2#0 ← (byte*~) main::$0
  (word~) main::$1 ← ((word)) (byte) main::j#2
  (word) main::w#0 ← (word~) main::$1
  (byte*~) main::$2 ← (byte*) main::zpptr2#0 + (word) main::w#0
  (byte*) main::zpptr2#1 ← (byte*~) main::$2
  *((byte*) main::zpptr2#1) ← (byte) main::k#2
  (byte) main::k#1 ← (byte) main::k#2 + rangenext(0,$a)
  (bool~) main::$3 ← (byte) main::k#1 != rangelast(0,$a)
  if((bool~) main::$3) goto main::@3
  to:main::@4
main::@4: scope:[main]  from main::@3
  (byte) main::j#5 ← phi( main::@3/(byte) main::j#2 )
  (byte) main::i#3 ← phi( main::@3/(byte) main::i#2 )
  (byte) main::i#1 ← (byte) main::i#3 + rangenext(0,$a)
  (bool~) main::$4 ← (byte) main::i#1 != rangelast(0,$a)
  if((bool~) main::$4) goto main::@2
  to:main::@5
main::@5: scope:[main]  from main::@4
  (byte) main::j#3 ← phi( main::@4/(byte) main::j#5 )
  (byte) main::j#1 ← (byte) main::j#3 + rangenext(0,$a)
  (bool~) main::$5 ← (byte) main::j#1 != rangelast(0,$a)
  if((bool~) main::$5) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@5
  return 
  to:@return
@1: scope:[]  from @begin
  call main 
  to:@2
@2: scope:[]  from @1
  to:@end
@end: scope:[]  from @2

SYMBOL TABLE SSA
(label) @1
(label) @2
(label) @begin
(label) @end
(void()) main()
(byte*~) main::$0
(word~) main::$1
(byte*~) main::$2
(bool~) main::$3
(bool~) main::$4
(bool~) main::$5
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@return
(byte) main::i
(byte) main::i#0
(byte) main::i#1
(byte) main::i#2
(byte) main::i#3
(byte) main::i#4
(byte) main::j
(byte) main::j#0
(byte) main::j#1
(byte) main::j#2
(byte) main::j#3
(byte) main::j#4
(byte) main::j#5
(byte) main::j#6
(byte) main::k
(byte) main::k#0
(byte) main::k#1
(byte) main::k#2
(word) main::w
(word) main::w#0
(const byte*) main::zpptr = (byte*)(number) $1000
(byte*) main::zpptr2
(byte*) main::zpptr2#0
(byte*) main::zpptr2#1

Inlining cast (word~) main::$1 ← (word)(byte) main::j#2
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 4096
Successful SSA optimization PassNCastSimplification
Alias (byte*) main::zpptr2#0 = (byte*~) main::$0 
Alias (word) main::w#0 = (word~) main::$1 
Alias (byte*) main::zpptr2#1 = (byte*~) main::$2 
Alias (byte) main::i#2 = (byte) main::i#3 
Alias (byte) main::j#2 = (byte) main::j#5 (byte) main::j#3 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte) main::i#2 (byte) main::i#4
Identical Phi Values (byte) main::j#2 (byte) main::j#4
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values (byte) main::j#4 (byte) main::j#6
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::$3 [12] if((byte) main::k#1!=rangelast(0,$a)) goto main::@3
Simple Condition (bool~) main::$4 [15] if((byte) main::i#1!=rangelast(0,$a)) goto main::@2
Simple Condition (bool~) main::$5 [18] if((byte) main::j#1!=rangelast(0,$a)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte) main::j#0 = 0
Constant (const byte) main::i#0 = 0
Constant (const byte) main::k#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [10] main::k#1 ← ++ main::k#2 to ++
Resolved ranged comparison value [12] if(main::k#1!=rangelast(0,$a)) goto main::@3 to (number) $b
Resolved ranged next value [13] main::i#1 ← ++ main::i#4 to ++
Resolved ranged comparison value [15] if(main::i#1!=rangelast(0,$a)) goto main::@2 to (number) $b
Resolved ranged next value [16] main::j#1 ← ++ main::j#6 to ++
Resolved ranged comparison value [18] if(main::j#1!=rangelast(0,$a)) goto main::@1 to (number) $b
Adding number conversion cast (unumber) $b in if((byte) main::k#1!=(number) $b) goto main::@3
Adding number conversion cast (unumber) $b in if((byte) main::i#1!=(number) $b) goto main::@2
Adding number conversion cast (unumber) $b in if((byte) main::j#1!=(number) $b) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast $b
Simplifying constant integer cast $b
Simplifying constant integer cast $b
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $b
Finalized unsigned number type (byte) $b
Finalized unsigned number type (byte) $b
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inlining constant with var siblings (const byte) main::j#0
Inlining constant with var siblings (const byte) main::i#0
Inlining constant with var siblings (const byte) main::k#0
Constant inlined main::i#0 = (byte) 0
Constant inlined main::k#0 = (byte) 0
Constant inlined main::j#0 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@7(between main::@5 and main::@1)
Added new block during phi lifting main::@8(between main::@4 and main::@2)
Added new block during phi lifting main::@9(between main::@3 and main::@3)
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 3 initial phi equivalence classes
Coalesced [20] main::j#7 ← main::j#1
Coalesced [21] main::i#5 ← main::i#1
Coalesced [22] main::k#3 ← main::k#1
Coalesced down to 3 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) main::@7
Culled Empty Block (label) main::@8
Culled Empty Block (label) main::@9
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()

(void()) main()
main: scope:[main]  from @1
  [4] phi()
  to:main::@1
main::@1: scope:[main]  from main main::@5
  [5] (byte) main::j#6 ← phi( main/(byte) 0 main::@5/(byte) main::j#1 )
  to:main::@2
main::@2: scope:[main]  from main::@1 main::@4
  [6] (byte) main::i#4 ← phi( main::@1/(byte) 0 main::@4/(byte) main::i#1 )
  to:main::@3
main::@3: scope:[main]  from main::@2 main::@3
  [7] (byte) main::k#2 ← phi( main::@2/(byte) 0 main::@3/(byte) main::k#1 )
  [8] (byte*) main::zpptr2#0 ← (const byte*) main::zpptr + (byte) main::i#4
  [9] (word) main::w#0 ← (word)(byte) main::j#6
  [10] (byte*) main::zpptr2#1 ← (byte*) main::zpptr2#0 + (word) main::w#0
  [11] *((byte*) main::zpptr2#1) ← (byte) main::k#2
  [12] (byte) main::k#1 ← ++ (byte) main::k#2
  [13] if((byte) main::k#1!=(byte) $b) goto main::@3
  to:main::@4
main::@4: scope:[main]  from main::@3
  [14] (byte) main::i#1 ← ++ (byte) main::i#4
  [15] if((byte) main::i#1!=(byte) $b) goto main::@2
  to:main::@5
main::@5: scope:[main]  from main::@4
  [16] (byte) main::j#1 ← ++ (byte) main::j#6
  [17] if((byte) main::j#1!=(byte) $b) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@5
  [18] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(void()) main()
(byte) main::i
(byte) main::i#1 151.5
(byte) main::i#4 150.375
(byte) main::j
(byte) main::j#1 16.5
(byte) main::j#6 2.0
(byte) main::k
(byte) main::k#1 1501.5
(byte) main::k#2 600.5999999999999
(word) main::w
(word) main::w#0 2002.0
(byte*) main::zpptr2
(byte*) main::zpptr2#0 1001.0
(byte*) main::zpptr2#1 2002.0

Initial phi equivalence classes
[ main::j#6 main::j#1 ]
[ main::i#4 main::i#1 ]
[ main::k#2 main::k#1 ]
Added variable main::zpptr2#0 to live range equivalence class [ main::zpptr2#0 ]
Added variable main::w#0 to live range equivalence class [ main::w#0 ]
Added variable main::zpptr2#1 to live range equivalence class [ main::zpptr2#1 ]
Complete equivalence classes
[ main::j#6 main::j#1 ]
[ main::i#4 main::i#1 ]
[ main::k#2 main::k#1 ]
[ main::zpptr2#0 ]
[ main::w#0 ]
[ main::zpptr2#1 ]
Allocated zp[1]:2 [ main::j#6 main::j#1 ]
Allocated zp[1]:3 [ main::i#4 main::i#1 ]
Allocated zp[1]:4 [ main::k#2 main::k#1 ]
Allocated zp[2]:5 [ main::zpptr2#0 ]
Allocated zp[2]:7 [ main::w#0 ]
Allocated zp[2]:9 [ main::zpptr2#1 ]

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
  // 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 zpptr = $1000
    .label zpptr2 = 5
    .label w = 7
    .label zpptr2_1 = 9
    .label k = 4
    .label i = 3
    .label j = 2
    // [5] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [5] phi (byte) main::j#6 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z j
    jmp __b1
    // [5] phi from main::@5 to main::@1 [phi:main::@5->main::@1]
  __b1_from___b5:
    // [5] phi (byte) main::j#6 = (byte) main::j#1 [phi:main::@5->main::@1#0] -- register_copy 
    jmp __b1
    // main::@1
  __b1:
    // [6] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  __b2_from___b1:
    // [6] phi (byte) main::i#4 = (byte) 0 [phi:main::@1->main::@2#0] -- vbuz1=vbuc1 
    lda #0
    sta.z i
    jmp __b2
    // [6] phi from main::@4 to main::@2 [phi:main::@4->main::@2]
  __b2_from___b4:
    // [6] phi (byte) main::i#4 = (byte) main::i#1 [phi:main::@4->main::@2#0] -- register_copy 
    jmp __b2
    // main::@2
  __b2:
    // [7] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
  __b3_from___b2:
    // [7] phi (byte) main::k#2 = (byte) 0 [phi:main::@2->main::@3#0] -- vbuz1=vbuc1 
    lda #0
    sta.z k
    jmp __b3
    // [7] phi from main::@3 to main::@3 [phi:main::@3->main::@3]
  __b3_from___b3:
    // [7] phi (byte) main::k#2 = (byte) main::k#1 [phi:main::@3->main::@3#0] -- register_copy 
    jmp __b3
    // main::@3
  __b3:
    // [8] (byte*) main::zpptr2#0 ← (const byte*) main::zpptr + (byte) main::i#4 -- pbuz1=pbuc1_plus_vbuz2 
    lda.z i
    clc
    adc #<zpptr
    sta.z zpptr2
    lda #>zpptr
    adc #0
    sta.z zpptr2+1
    // [9] (word) main::w#0 ← (word)(byte) main::j#6 -- vwuz1=_word_vbuz2 
    lda.z j
    sta.z w
    lda #0
    sta.z w+1
    // [10] (byte*) main::zpptr2#1 ← (byte*) main::zpptr2#0 + (word) main::w#0 -- pbuz1=pbuz2_plus_vwuz3 
    lda.z zpptr2
    clc
    adc.z w
    sta.z zpptr2_1
    lda.z zpptr2+1
    adc.z w+1
    sta.z zpptr2_1+1
    // [11] *((byte*) main::zpptr2#1) ← (byte) main::k#2 -- _deref_pbuz1=vbuz2 
    lda.z k
    ldy #0
    sta (zpptr2_1),y
    // [12] (byte) main::k#1 ← ++ (byte) main::k#2 -- vbuz1=_inc_vbuz1 
    inc.z k
    // [13] if((byte) main::k#1!=(byte) $b) goto main::@3 -- vbuz1_neq_vbuc1_then_la1 
    lda #$b
    cmp.z k
    bne __b3_from___b3
    jmp __b4
    // main::@4
  __b4:
    // [14] (byte) main::i#1 ← ++ (byte) main::i#4 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [15] if((byte) main::i#1!=(byte) $b) goto main::@2 -- vbuz1_neq_vbuc1_then_la1 
    lda #$b
    cmp.z i
    bne __b2_from___b4
    jmp __b5
    // main::@5
  __b5:
    // [16] (byte) main::j#1 ← ++ (byte) main::j#6 -- vbuz1=_inc_vbuz1 
    inc.z j
    // [17] if((byte) main::j#1!=(byte) $b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #$b
    cmp.z j
    bne __b1_from___b5
    jmp __breturn
    // main::@return
  __breturn:
    // [18] return 
    rts
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [8] (byte*) main::zpptr2#0 ← (const byte*) main::zpptr + (byte) main::i#4 [ main::j#6 main::i#4 main::k#2 main::zpptr2#0 ] ( main:2 [ main::j#6 main::i#4 main::k#2 main::zpptr2#0 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::j#6 main::j#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:3 [ main::i#4 main::i#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:4 [ main::k#2 main::k#1 ]
Statement [9] (word) main::w#0 ← (word)(byte) main::j#6 [ main::j#6 main::i#4 main::k#2 main::zpptr2#0 main::w#0 ] ( main:2 [ main::j#6 main::i#4 main::k#2 main::zpptr2#0 main::w#0 ] ) always clobbers reg byte a 
Statement [10] (byte*) main::zpptr2#1 ← (byte*) main::zpptr2#0 + (word) main::w#0 [ main::j#6 main::i#4 main::k#2 main::zpptr2#1 ] ( main:2 [ main::j#6 main::i#4 main::k#2 main::zpptr2#1 ] ) always clobbers reg byte a 
Statement [11] *((byte*) main::zpptr2#1) ← (byte) main::k#2 [ main::j#6 main::i#4 main::k#2 ] ( main:2 [ main::j#6 main::i#4 main::k#2 ] ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte y as potential for zp[1]:2 [ main::j#6 main::j#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:3 [ main::i#4 main::i#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:4 [ main::k#2 main::k#1 ]
Statement [8] (byte*) main::zpptr2#0 ← (const byte*) main::zpptr + (byte) main::i#4 [ main::j#6 main::i#4 main::k#2 main::zpptr2#0 ] ( main:2 [ main::j#6 main::i#4 main::k#2 main::zpptr2#0 ] ) always clobbers reg byte a 
Statement [9] (word) main::w#0 ← (word)(byte) main::j#6 [ main::j#6 main::i#4 main::k#2 main::zpptr2#0 main::w#0 ] ( main:2 [ main::j#6 main::i#4 main::k#2 main::zpptr2#0 main::w#0 ] ) always clobbers reg byte a 
Statement [10] (byte*) main::zpptr2#1 ← (byte*) main::zpptr2#0 + (word) main::w#0 [ main::j#6 main::i#4 main::k#2 main::zpptr2#1 ] ( main:2 [ main::j#6 main::i#4 main::k#2 main::zpptr2#1 ] ) always clobbers reg byte a 
Statement [11] *((byte*) main::zpptr2#1) ← (byte) main::k#2 [ main::j#6 main::i#4 main::k#2 ] ( main:2 [ main::j#6 main::i#4 main::k#2 ] ) always clobbers reg byte a reg byte y 
Potential registers zp[1]:2 [ main::j#6 main::j#1 ] : zp[1]:2 , reg byte x , 
Potential registers zp[1]:3 [ main::i#4 main::i#1 ] : zp[1]:3 , reg byte x , 
Potential registers zp[1]:4 [ main::k#2 main::k#1 ] : zp[1]:4 , reg byte x , 
Potential registers zp[2]:5 [ main::zpptr2#0 ] : zp[2]:5 , 
Potential registers zp[2]:7 [ main::w#0 ] : zp[2]:7 , 
Potential registers zp[2]:9 [ main::zpptr2#1 ] : zp[2]:9 , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 2,102.1: zp[1]:4 [ main::k#2 main::k#1 ] 2,002: zp[2]:7 [ main::w#0 ] 2,002: zp[2]:9 [ main::zpptr2#1 ] 1,001: zp[2]:5 [ main::zpptr2#0 ] 301.88: zp[1]:3 [ main::i#4 main::i#1 ] 18.5: zp[1]:2 [ main::j#6 main::j#1 ] 
Uplift Scope [] 

Uplifting [main] best 78433 combination reg byte x [ main::k#2 main::k#1 ] zp[2]:7 [ main::w#0 ] zp[2]:9 [ main::zpptr2#1 ] zp[2]:5 [ main::zpptr2#0 ] zp[1]:3 [ main::i#4 main::i#1 ] zp[1]:2 [ main::j#6 main::j#1 ] 
Uplifting [] best 78433 combination 
Attempting to uplift remaining variables inzp[1]:3 [ main::i#4 main::i#1 ]
Uplifting [main] best 78433 combination zp[1]:3 [ main::i#4 main::i#1 ] 
Attempting to uplift remaining variables inzp[1]:2 [ main::j#6 main::j#1 ]
Uplifting [main] best 78433 combination zp[1]:2 [ main::j#6 main::j#1 ] 
Coalescing zero page register [ zp[2]:5 [ main::zpptr2#0 ] ] with [ zp[2]:9 [ main::zpptr2#1 ] ] - score: 1
Allocated (was zp[2]:5) zp[2]:4 [ main::zpptr2#0 main::zpptr2#1 ]
Allocated (was zp[2]:7) zp[2]:6 [ main::w#0 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
  // 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 zpptr = $1000
    .label zpptr2 = 4
    .label w = 6
    .label i = 3
    .label j = 2
    // [5] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [5] phi (byte) main::j#6 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z j
    jmp __b1
    // [5] phi from main::@5 to main::@1 [phi:main::@5->main::@1]
  __b1_from___b5:
    // [5] phi (byte) main::j#6 = (byte) main::j#1 [phi:main::@5->main::@1#0] -- register_copy 
    jmp __b1
    // main::@1
  __b1:
    // [6] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  __b2_from___b1:
    // [6] phi (byte) main::i#4 = (byte) 0 [phi:main::@1->main::@2#0] -- vbuz1=vbuc1 
    lda #0
    sta.z i
    jmp __b2
    // [6] phi from main::@4 to main::@2 [phi:main::@4->main::@2]
  __b2_from___b4:
    // [6] phi (byte) main::i#4 = (byte) main::i#1 [phi:main::@4->main::@2#0] -- register_copy 
    jmp __b2
    // main::@2
  __b2:
    // [7] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
  __b3_from___b2:
    // [7] phi (byte) main::k#2 = (byte) 0 [phi:main::@2->main::@3#0] -- vbuxx=vbuc1 
    ldx #0
    jmp __b3
    // [7] phi from main::@3 to main::@3 [phi:main::@3->main::@3]
  __b3_from___b3:
    // [7] phi (byte) main::k#2 = (byte) main::k#1 [phi:main::@3->main::@3#0] -- register_copy 
    jmp __b3
    // main::@3
  __b3:
    // [8] (byte*) main::zpptr2#0 ← (const byte*) main::zpptr + (byte) main::i#4 -- pbuz1=pbuc1_plus_vbuz2 
    lda.z i
    clc
    adc #<zpptr
    sta.z zpptr2
    lda #>zpptr
    adc #0
    sta.z zpptr2+1
    // [9] (word) main::w#0 ← (word)(byte) main::j#6 -- vwuz1=_word_vbuz2 
    lda.z j
    sta.z w
    lda #0
    sta.z w+1
    // [10] (byte*) main::zpptr2#1 ← (byte*) main::zpptr2#0 + (word) main::w#0 -- pbuz1=pbuz1_plus_vwuz2 
    lda.z zpptr2
    clc
    adc.z w
    sta.z zpptr2
    lda.z zpptr2+1
    adc.z w+1
    sta.z zpptr2+1
    // [11] *((byte*) main::zpptr2#1) ← (byte) main::k#2 -- _deref_pbuz1=vbuxx 
    txa
    ldy #0
    sta (zpptr2),y
    // [12] (byte) main::k#1 ← ++ (byte) main::k#2 -- vbuxx=_inc_vbuxx 
    inx
    // [13] if((byte) main::k#1!=(byte) $b) goto main::@3 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$b
    bne __b3_from___b3
    jmp __b4
    // main::@4
  __b4:
    // [14] (byte) main::i#1 ← ++ (byte) main::i#4 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [15] if((byte) main::i#1!=(byte) $b) goto main::@2 -- vbuz1_neq_vbuc1_then_la1 
    lda #$b
    cmp.z i
    bne __b2_from___b4
    jmp __b5
    // main::@5
  __b5:
    // [16] (byte) main::j#1 ← ++ (byte) main::j#6 -- vbuz1=_inc_vbuz1 
    inc.z j
    // [17] if((byte) main::j#1!=(byte) $b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #$b
    cmp.z j
    bne __b1_from___b5
    jmp __breturn
    // main::@return
  __breturn:
    // [18] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __bend
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b3
Removing instruction jmp __b4
Removing instruction jmp __b5
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __bbegin with __b1
Replacing label __b3_from___b3 with __b3
Replacing label __b2_from___b4 with __b2
Replacing label __b1_from___b5 with __b1
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Removing instruction __b1_from___b5:
Removing instruction __b2_from___b1:
Removing instruction __b2_from___b4:
Removing instruction __b3_from___b2:
Removing instruction __b3_from___b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b4:
Removing instruction __b5:
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
Removing instruction jmp __b2
Removing instruction jmp __b3
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #$b
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction __b1:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@return
(byte) main::i
(byte) main::i#1 i zp[1]:3 151.5
(byte) main::i#4 i zp[1]:3 150.375
(byte) main::j
(byte) main::j#1 j zp[1]:2 16.5
(byte) main::j#6 j zp[1]:2 2.0
(byte) main::k
(byte) main::k#1 reg byte x 1501.5
(byte) main::k#2 reg byte x 600.5999999999999
(word) main::w
(word) main::w#0 w zp[2]:6 2002.0
(const byte*) main::zpptr = (byte*) 4096
(byte*) main::zpptr2
(byte*) main::zpptr2#0 zpptr2 zp[2]:4 1001.0
(byte*) main::zpptr2#1 zpptr2 zp[2]:4 2002.0

zp[1]:2 [ main::j#6 main::j#1 ]
zp[1]:3 [ main::i#4 main::i#1 ]
reg byte x [ main::k#2 main::k#1 ]
zp[2]:4 [ main::zpptr2#0 main::zpptr2#1 ]
zp[2]:6 [ main::w#0 ]


FINAL ASSEMBLER
Score: 68411

  // File Comments
  // 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 zpptr = $1000
    .label zpptr2 = 4
    .label w = 6
    .label i = 3
    .label j = 2
    // [5] phi from main to main::@1 [phi:main->main::@1]
    // [5] phi (byte) main::j#6 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z j
    // [5] phi from main::@5 to main::@1 [phi:main::@5->main::@1]
    // [5] phi (byte) main::j#6 = (byte) main::j#1 [phi:main::@5->main::@1#0] -- register_copy 
    // main::@1
  __b1:
    // [6] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
    // [6] phi (byte) main::i#4 = (byte) 0 [phi:main::@1->main::@2#0] -- vbuz1=vbuc1 
    lda #0
    sta.z i
    // [6] phi from main::@4 to main::@2 [phi:main::@4->main::@2]
    // [6] phi (byte) main::i#4 = (byte) main::i#1 [phi:main::@4->main::@2#0] -- register_copy 
    // main::@2
  __b2:
    // [7] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
    // [7] phi (byte) main::k#2 = (byte) 0 [phi:main::@2->main::@3#0] -- vbuxx=vbuc1 
    ldx #0
    // [7] phi from main::@3 to main::@3 [phi:main::@3->main::@3]
    // [7] phi (byte) main::k#2 = (byte) main::k#1 [phi:main::@3->main::@3#0] -- register_copy 
    // main::@3
  __b3:
    // zpptr2 = zpptr+i
    // [8] (byte*) main::zpptr2#0 ← (const byte*) main::zpptr + (byte) main::i#4 -- pbuz1=pbuc1_plus_vbuz2 
    lda.z i
    clc
    adc #<zpptr
    sta.z zpptr2
    lda #>zpptr
    adc #0
    sta.z zpptr2+1
    // w = (word)j
    // [9] (word) main::w#0 ← (word)(byte) main::j#6 -- vwuz1=_word_vbuz2 
    lda.z j
    sta.z w
    lda #0
    sta.z w+1
    // zpptr2 = zpptr2 + w
    // [10] (byte*) main::zpptr2#1 ← (byte*) main::zpptr2#0 + (word) main::w#0 -- pbuz1=pbuz1_plus_vwuz2 
    lda.z zpptr2
    clc
    adc.z w
    sta.z zpptr2
    lda.z zpptr2+1
    adc.z w+1
    sta.z zpptr2+1
    // *zpptr2 = k
    // [11] *((byte*) main::zpptr2#1) ← (byte) main::k#2 -- _deref_pbuz1=vbuxx 
    txa
    ldy #0
    sta (zpptr2),y
    // for(byte k : 0..10)
    // [12] (byte) main::k#1 ← ++ (byte) main::k#2 -- vbuxx=_inc_vbuxx 
    inx
    // [13] if((byte) main::k#1!=(byte) $b) goto main::@3 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$b
    bne __b3
    // main::@4
    // for(byte i : 0..10)
    // [14] (byte) main::i#1 ← ++ (byte) main::i#4 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [15] if((byte) main::i#1!=(byte) $b) goto main::@2 -- vbuz1_neq_vbuc1_then_la1 
    lda #$b
    cmp.z i
    bne __b2
    // main::@5
    // for(byte j : 0..10)
    // [16] (byte) main::j#1 ← ++ (byte) main::j#6 -- vbuz1=_inc_vbuz1 
    inc.z j
    // [17] if((byte) main::j#1!=(byte) $b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 
    cmp.z j
    bne __b1
    // main::@return
    // }
    // [18] return 
    rts
}
  // File Data

