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

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@1
main: scope:[main]  from @1
  (byte*) main::zpptr#0 ← ((byte*)) (number) $1000
  (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 ← (byte*) main::zpptr#0 + (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
(byte*) main::zpptr
(byte*) main::zpptr#0
(byte*) main::zpptr2
(byte*) main::zpptr2#0
(byte*) main::zpptr2#1

Inlining cast (byte*) main::zpptr#0 ← (byte*)(number) $1000
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 [16] if((byte) main::k#1!=rangelast(0,$a)) goto main::@3
Simple Condition (bool~) main::$4 [20] if((byte) main::i#1!=rangelast(0,$a)) goto main::@2
Simple Condition (bool~) main::$5 [24] if((byte) main::j#1!=rangelast(0,$a)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) main::zpptr#0 = (byte*) 4096
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 [14] main::k#1 ← ++ main::k#2 to ++
Resolved ranged comparison value [16] if(main::k#1!=rangelast(0,$a)) goto main::@3 to (number) $b
Resolved ranged next value [18] main::i#1 ← ++ main::i#4 to ++
Resolved ranged comparison value [20] if(main::i#1!=rangelast(0,$a)) goto main::@2 to (number) $b
Resolved ranged next value [22] main::j#1 ← ++ main::j#6 to ++
Resolved ranged comparison value [24] 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()
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#0 + (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::zpptr
(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 zero page equivalence class [ main::zpptr2#0 ]
Added variable main::w#0 to zero page equivalence class [ main::w#0 ]
Added variable main::zpptr2#1 to zero page 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 ZP_BYTE:2 [ main::j#6 main::j#1 ]
Allocated zp ZP_BYTE:3 [ main::i#4 main::i#1 ]
Allocated zp ZP_BYTE:4 [ main::k#2 main::k#1 ]
Allocated zp ZP_WORD:5 [ main::zpptr2#0 ]
Allocated zp ZP_WORD:7 [ main::w#0 ]
Allocated zp ZP_WORD:9 [ main::zpptr2#1 ]

INITIAL ASM
Target platform is c64basic
  // 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#0 + (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#0 + (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 ZP_BYTE:2 [ main::j#6 main::j#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::i#4 main::i#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE: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 ZP_BYTE:2 [ main::j#6 main::j#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:3 [ main::i#4 main::i#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:4 [ main::k#2 main::k#1 ]
Statement [8] (byte*) main::zpptr2#0 ← (const byte*) main::zpptr#0 + (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 ZP_BYTE:2 [ main::j#6 main::j#1 ] : zp ZP_BYTE:2 , reg byte x , 
Potential registers zp ZP_BYTE:3 [ main::i#4 main::i#1 ] : zp ZP_BYTE:3 , reg byte x , 
Potential registers zp ZP_BYTE:4 [ main::k#2 main::k#1 ] : zp ZP_BYTE:4 , reg byte x , 
Potential registers zp ZP_WORD:5 [ main::zpptr2#0 ] : zp ZP_WORD:5 , 
Potential registers zp ZP_WORD:7 [ main::w#0 ] : zp ZP_WORD:7 , 
Potential registers zp ZP_WORD:9 [ main::zpptr2#1 ] : zp ZP_WORD:9 , 

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

Uplifting [main] best 78433 combination reg byte x [ main::k#2 main::k#1 ] zp ZP_WORD:7 [ main::w#0 ] zp ZP_WORD:9 [ main::zpptr2#1 ] zp ZP_WORD:5 [ main::zpptr2#0 ] zp ZP_BYTE:3 [ main::i#4 main::i#1 ] zp ZP_BYTE:2 [ main::j#6 main::j#1 ] 
Uplifting [] best 78433 combination 
Attempting to uplift remaining variables inzp ZP_BYTE:3 [ main::i#4 main::i#1 ]
Uplifting [main] best 78433 combination zp ZP_BYTE:3 [ main::i#4 main::i#1 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:2 [ main::j#6 main::j#1 ]
Uplifting [main] best 78433 combination zp ZP_BYTE:2 [ main::j#6 main::j#1 ] 
Coalescing zero page register [ zp ZP_WORD:5 [ main::zpptr2#0 ] ] with [ zp ZP_WORD:9 [ main::zpptr2#1 ] ] - score: 1
Allocated (was zp ZP_WORD:5) zp ZP_WORD:4 [ main::zpptr2#0 main::zpptr2#1 ]
Allocated (was zp ZP_WORD:7) zp ZP_WORD: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#0 + (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 b3_from_b3 with b3
Replacing label b2_from_b4 with b2
Replacing label b1_from_b5 with b1
Removing instruction b1_from_bbegin:
Removing instruction b1:
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 bbegin:
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 ZP_BYTE:3 151.5
(byte) main::i#4 i zp ZP_BYTE:3 150.375
(byte) main::j
(byte) main::j#1 j zp ZP_BYTE:2 16.5
(byte) main::j#6 j zp ZP_BYTE: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 ZP_WORD:6 2002.0
(byte*) main::zpptr
(const byte*) main::zpptr#0 zpptr = (byte*) 4096
(byte*) main::zpptr2
(byte*) main::zpptr2#0 zpptr2 zp ZP_WORD:4 1001.0
(byte*) main::zpptr2#1 zpptr2 zp ZP_WORD:4 2002.0

zp ZP_BYTE:2 [ main::j#6 main::j#1 ]
zp ZP_BYTE:3 [ main::i#4 main::i#1 ]
reg byte x [ main::k#2 main::k#1 ]
zp ZP_WORD:4 [ main::zpptr2#0 main::zpptr2#1 ]
zp ZP_WORD: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#0 + (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

