Culled Empty Block (label) @1
Culled Empty Block (label) inccnt::@1

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  (byte) cnt#0 ← (number) 0
  (byte) cnt2#0 ← (number) 0
  (byte) cnt3#0 ← (number) 0
  (byte[$100]) SCREEN#0 ← ((byte[$100])) (number) $400
  to:@2
main: scope:[main]  from @2
  (byte) cnt3#13 ← phi( @2/(byte) cnt3#14 )
  (byte) cnt2#13 ← phi( @2/(byte) cnt2#14 )
  (byte) cnt#14 ← phi( @2/(byte) cnt#15 )
  call inccnt 
  (byte) inccnt::return#0 ← (byte) inccnt::return#3
  to:main::@1
main::@1: scope:[main]  from main
  (byte) cnt3#7 ← phi( main/(byte) cnt3#5 )
  (byte) cnt2#7 ← phi( main/(byte) cnt2#5 )
  (byte) cnt#8 ← phi( main/(byte) cnt#6 )
  (byte) inccnt::return#4 ← phi( main/(byte) inccnt::return#0 )
  (byte~) main::$0 ← (byte) inccnt::return#4
  (byte) cnt#1 ← (byte) cnt#8
  (byte) cnt2#1 ← (byte) cnt2#7
  (byte) cnt3#1 ← (byte) cnt3#7
  *((byte[$100]) SCREEN#0 + (number) 0) ← (byte~) main::$0
  (byte) cnt#2 ← ++ (byte) cnt#1
  call inccnt 
  (byte) inccnt::return#1 ← (byte) inccnt::return#3
  to:main::@2
main::@2: scope:[main]  from main::@1
  (byte) cnt3#8 ← phi( main::@1/(byte) cnt3#5 )
  (byte) cnt2#8 ← phi( main::@1/(byte) cnt2#5 )
  (byte) cnt#9 ← phi( main::@1/(byte) cnt#6 )
  (byte) inccnt::return#5 ← phi( main::@1/(byte) inccnt::return#1 )
  (byte~) main::$1 ← (byte) inccnt::return#5
  (byte) cnt#3 ← (byte) cnt#9
  (byte) cnt2#2 ← (byte) cnt2#8
  (byte) cnt3#2 ← (byte) cnt3#8
  *((byte[$100]) SCREEN#0 + (number) 1) ← (byte~) main::$1
  *((byte[$100]) SCREEN#0 + (number) 2) ← (byte) cnt2#2
  *((byte[$100]) SCREEN#0 + (number) 3) ← (byte) cnt3#2
  to:main::@return
main::@return: scope:[main]  from main::@2
  (byte) cnt3#9 ← phi( main::@2/(byte) cnt3#2 )
  (byte) cnt2#9 ← phi( main::@2/(byte) cnt2#2 )
  (byte) cnt#10 ← phi( main::@2/(byte) cnt#3 )
  (byte) cnt#4 ← (byte) cnt#10
  (byte) cnt2#3 ← (byte) cnt2#9
  (byte) cnt3#3 ← (byte) cnt3#9
  return 
  to:@return
inccnt: scope:[inccnt]  from main main::@1
  (byte) cnt3#10 ← phi( main/(byte) cnt3#13 main::@1/(byte) cnt3#1 )
  (byte) cnt2#10 ← phi( main/(byte) cnt2#13 main::@1/(byte) cnt2#1 )
  (byte) cnt#11 ← phi( main/(byte) cnt#14 main::@1/(byte) cnt#2 )
  (byte) cnt#5 ← ++ (byte) cnt#11
  (byte) cnt2#4 ← ++ (byte) cnt2#10
  (byte) cnt3#4 ← ++ (byte) cnt3#10
  (byte) inccnt::return#2 ← (byte) cnt#5
  to:inccnt::@return
inccnt::@return: scope:[inccnt]  from inccnt
  (byte) cnt3#11 ← phi( inccnt/(byte) cnt3#4 )
  (byte) cnt2#11 ← phi( inccnt/(byte) cnt2#4 )
  (byte) cnt#12 ← phi( inccnt/(byte) cnt#5 )
  (byte) inccnt::return#6 ← phi( inccnt/(byte) inccnt::return#2 )
  (byte) inccnt::return#3 ← (byte) inccnt::return#6
  (byte) cnt#6 ← (byte) cnt#12
  (byte) cnt2#5 ← (byte) cnt2#11
  (byte) cnt3#5 ← (byte) cnt3#11
  return 
  to:@return
@2: scope:[]  from @begin
  (byte) cnt3#14 ← phi( @begin/(byte) cnt3#0 )
  (byte) cnt2#14 ← phi( @begin/(byte) cnt2#0 )
  (byte) cnt#15 ← phi( @begin/(byte) cnt#0 )
  call main 
  to:@3
@3: scope:[]  from @2
  (byte) cnt3#12 ← phi( @2/(byte) cnt3#3 )
  (byte) cnt2#12 ← phi( @2/(byte) cnt2#3 )
  (byte) cnt#13 ← phi( @2/(byte) cnt#4 )
  (byte) cnt#7 ← (byte) cnt#13
  (byte) cnt2#6 ← (byte) cnt2#12
  (byte) cnt3#6 ← (byte) cnt3#12
  to:@end
@end: scope:[]  from @3

SYMBOL TABLE SSA
(label) @2
(label) @3
(label) @begin
(label) @end
(byte[$100]) SCREEN
(byte[$100]) SCREEN#0
(byte) cnt
(byte) cnt#0
(byte) cnt#1
(byte) cnt#10
(byte) cnt#11
(byte) cnt#12
(byte) cnt#13
(byte) cnt#14
(byte) cnt#15
(byte) cnt#2
(byte) cnt#3
(byte) cnt#4
(byte) cnt#5
(byte) cnt#6
(byte) cnt#7
(byte) cnt#8
(byte) cnt#9
(byte) cnt2
(byte) cnt2#0
(byte) cnt2#1
(byte) cnt2#10
(byte) cnt2#11
(byte) cnt2#12
(byte) cnt2#13
(byte) cnt2#14
(byte) cnt2#2
(byte) cnt2#3
(byte) cnt2#4
(byte) cnt2#5
(byte) cnt2#6
(byte) cnt2#7
(byte) cnt2#8
(byte) cnt2#9
(byte) cnt3
(byte) cnt3#0
(byte) cnt3#1
(byte) cnt3#10
(byte) cnt3#11
(byte) cnt3#12
(byte) cnt3#13
(byte) cnt3#14
(byte) cnt3#2
(byte) cnt3#3
(byte) cnt3#4
(byte) cnt3#5
(byte) cnt3#6
(byte) cnt3#7
(byte) cnt3#8
(byte) cnt3#9
(byte()) inccnt()
(label) inccnt::@return
(byte) inccnt::return
(byte) inccnt::return#0
(byte) inccnt::return#1
(byte) inccnt::return#2
(byte) inccnt::return#3
(byte) inccnt::return#4
(byte) inccnt::return#5
(byte) inccnt::return#6
(void()) main()
(byte~) main::$0
(byte~) main::$1
(label) main::@1
(label) main::@2
(label) main::@return

Adding number conversion cast (unumber) 0 in (byte) cnt#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) cnt2#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) cnt3#0 ← (number) 0
Adding number conversion cast (unumber) 0 in *((byte[$100]) SCREEN#0 + (number) 0) ← (byte~) main::$0
Adding number conversion cast (unumber) 1 in *((byte[$100]) SCREEN#0 + (number) 1) ← (byte~) main::$1
Adding number conversion cast (unumber) 2 in *((byte[$100]) SCREEN#0 + (number) 2) ← (byte) cnt2#2
Adding number conversion cast (unumber) 3 in *((byte[$100]) SCREEN#0 + (number) 3) ← (byte) cnt3#2
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte) cnt#0 ← (unumber)(number) 0
Inlining cast (byte) cnt2#0 ← (unumber)(number) 0
Inlining cast (byte) cnt3#0 ← (unumber)(number) 0
Inlining cast (byte[$100]) SCREEN#0 ← (byte[$100])(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 3
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 3
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte) inccnt::return#0 = (byte) inccnt::return#4 
Alias (byte) cnt#1 = (byte) cnt#8 
Alias (byte) cnt2#1 = (byte) cnt2#7 
Alias (byte) cnt3#1 = (byte) cnt3#7 
Alias (byte) inccnt::return#1 = (byte) inccnt::return#5 
Alias (byte) cnt#10 = (byte) cnt#3 (byte) cnt#9 (byte) cnt#4 
Alias (byte) cnt2#2 = (byte) cnt2#8 (byte) cnt2#9 (byte) cnt2#3 
Alias (byte) cnt3#2 = (byte) cnt3#8 (byte) cnt3#9 (byte) cnt3#3 
Alias (byte) inccnt::return#2 = (byte) inccnt::return#6 (byte) inccnt::return#3 
Alias (byte) cnt#12 = (byte) cnt#5 (byte) cnt#6 
Alias (byte) cnt2#11 = (byte) cnt2#4 (byte) cnt2#5 
Alias (byte) cnt3#11 = (byte) cnt3#4 (byte) cnt3#5 
Alias (byte) cnt#0 = (byte) cnt#15 
Alias (byte) cnt2#0 = (byte) cnt2#14 
Alias (byte) cnt3#0 = (byte) cnt3#14 
Alias (byte) cnt#13 = (byte) cnt#7 
Alias (byte) cnt2#12 = (byte) cnt2#6 
Alias (byte) cnt3#12 = (byte) cnt3#6 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte) cnt#14 (byte) cnt#0
Identical Phi Values (byte) cnt2#13 (byte) cnt2#0
Identical Phi Values (byte) cnt3#13 (byte) cnt3#0
Identical Phi Values (byte) cnt#1 (byte) cnt#12
Identical Phi Values (byte) cnt2#1 (byte) cnt2#11
Identical Phi Values (byte) cnt3#1 (byte) cnt3#11
Identical Phi Values (byte) cnt#10 (byte) cnt#12
Identical Phi Values (byte) cnt2#2 (byte) cnt2#11
Identical Phi Values (byte) cnt3#2 (byte) cnt3#11
Identical Phi Values (byte) cnt#13 (byte) cnt#10
Identical Phi Values (byte) cnt2#12 (byte) cnt2#2
Identical Phi Values (byte) cnt3#12 (byte) cnt3#2
Successful SSA optimization Pass2IdenticalPhiElimination
Constant (const byte) cnt#0 = 0
Constant (const byte) cnt2#0 = 0
Constant (const byte) cnt3#0 = 0
Constant (const byte[$100]) SCREEN#0 = (byte*) 1024
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero SCREEN#0 in [12] *((const byte[$100]) SCREEN#0 + (byte) 0) ← (byte~) main::$0
Successful SSA optimization PassNSimplifyExpressionWithZero
Inlining constant with var siblings (const byte) cnt#0
Inlining constant with var siblings (const byte) cnt2#0
Inlining constant with var siblings (const byte) cnt3#0
Constant inlined cnt#0 = (byte) 0
Constant inlined cnt3#0 = (byte) 0
Constant inlined cnt2#0 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(SCREEN#0+1)
Consolidated array index constant in *(SCREEN#0+2)
Consolidated array index constant in *(SCREEN#0+3)
Successful SSA optimization Pass2ConstantAdditionElimination
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
CALL GRAPH
Calls in [] to main:2 
Calls in [main] to inccnt:6 inccnt:14 

Created 3 initial phi equivalence classes
Coalesced [11] cnt#16 ← cnt#2
Coalesced [12] cnt2#15 ← cnt2#11
Coalesced [13] cnt3#15 ← cnt3#11
Coalesced down to 3 phi equivalence classes
Culled Empty Block (label) @3
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

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()
  [5] call inccnt 
  [6] (byte) inccnt::return#0 ← (byte) inccnt::return#2
  to:main::@1
main::@1: scope:[main]  from main
  [7] (byte~) main::$0 ← (byte) inccnt::return#0
  [8] *((const byte[$100]) SCREEN#0) ← (byte~) main::$0
  [9] (byte) cnt#2 ← ++ (byte) cnt#12
  [10] call inccnt 
  [11] (byte) inccnt::return#1 ← (byte) inccnt::return#2
  to:main::@2
main::@2: scope:[main]  from main::@1
  [12] (byte~) main::$1 ← (byte) inccnt::return#1
  [13] *((const byte[$100]) SCREEN#0+(byte) 1) ← (byte~) main::$1
  [14] *((const byte[$100]) SCREEN#0+(byte) 2) ← (byte) cnt2#11
  [15] *((const byte[$100]) SCREEN#0+(byte) 3) ← (byte) cnt3#11
  to:main::@return
main::@return: scope:[main]  from main::@2
  [16] return 
  to:@return
inccnt: scope:[inccnt]  from main main::@1
  [17] (byte) cnt3#10 ← phi( main/(byte) 0 main::@1/(byte) cnt3#11 )
  [17] (byte) cnt2#10 ← phi( main/(byte) 0 main::@1/(byte) cnt2#11 )
  [17] (byte) cnt#11 ← phi( main/(byte) 0 main::@1/(byte) cnt#2 )
  [18] (byte) cnt#12 ← ++ (byte) cnt#11
  [19] (byte) cnt2#11 ← ++ (byte) cnt2#10
  [20] (byte) cnt3#11 ← ++ (byte) cnt3#10
  [21] (byte) inccnt::return#2 ← (byte) cnt#12
  to:inccnt::@return
inccnt::@return: scope:[inccnt]  from inccnt
  [22] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(byte[$100]) SCREEN
(byte) cnt
(byte) cnt#11 4.0
(byte) cnt#12 0.6666666666666666
(byte) cnt#2 4.0
(byte) cnt2
(byte) cnt2#10 2.0
(byte) cnt2#11 0.46153846153846156
(byte) cnt3
(byte) cnt3#10 1.3333333333333333
(byte) cnt3#11 0.46153846153846156
(byte()) inccnt()
(byte) inccnt::return
(byte) inccnt::return#0 4.0
(byte) inccnt::return#1 4.0
(byte) inccnt::return#2 1.5
(void()) main()
(byte~) main::$0 4.0
(byte~) main::$1 4.0

Initial phi equivalence classes
[ cnt#11 cnt#2 ]
[ cnt2#10 cnt2#11 ]
[ cnt3#10 cnt3#11 ]
Added variable inccnt::return#0 to zero page equivalence class [ inccnt::return#0 ]
Added variable main::$0 to zero page equivalence class [ main::$0 ]
Added variable inccnt::return#1 to zero page equivalence class [ inccnt::return#1 ]
Added variable main::$1 to zero page equivalence class [ main::$1 ]
Added variable cnt#12 to zero page equivalence class [ cnt#12 ]
Added variable inccnt::return#2 to zero page equivalence class [ inccnt::return#2 ]
Complete equivalence classes
[ cnt#11 cnt#2 ]
[ cnt2#10 cnt2#11 ]
[ cnt3#10 cnt3#11 ]
[ inccnt::return#0 ]
[ main::$0 ]
[ inccnt::return#1 ]
[ main::$1 ]
[ cnt#12 ]
[ inccnt::return#2 ]
Allocated zp ZP_BYTE:2 [ cnt#11 cnt#2 ]
Allocated zp ZP_BYTE:3 [ cnt2#10 cnt2#11 ]
Allocated zp ZP_BYTE:4 [ cnt3#10 cnt3#11 ]
Allocated zp ZP_BYTE:5 [ inccnt::return#0 ]
Allocated zp ZP_BYTE:6 [ main::$0 ]
Allocated zp ZP_BYTE:7 [ inccnt::return#1 ]
Allocated zp ZP_BYTE:8 [ main::$1 ]
Allocated zp ZP_BYTE:9 [ cnt#12 ]
Allocated zp ZP_BYTE:10 [ inccnt::return#2 ]

INITIAL ASM
Target platform is c64basic
  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label SCREEN = $400
  .label cnt = 2
  .label cnt2 = 3
  .label cnt3 = 4
  .label cnt_12 = 9
  // @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 _0 = 6
    .label _1 = 8
    // [5] call inccnt 
    // [17] phi from main to inccnt [phi:main->inccnt]
  inccnt_from_main:
    // [17] phi (byte) cnt3#10 = (byte) 0 [phi:main->inccnt#0] -- vbuz1=vbuc1 
    lda #0
    sta.z cnt3
    // [17] phi (byte) cnt2#10 = (byte) 0 [phi:main->inccnt#1] -- vbuz1=vbuc1 
    lda #0
    sta.z cnt2
    // [17] phi (byte) cnt#11 = (byte) 0 [phi:main->inccnt#2] -- vbuz1=vbuc1 
    lda #0
    sta.z cnt
    jsr inccnt
    // [6] (byte) inccnt::return#0 ← (byte) inccnt::return#2 -- vbuz1=vbuz2 
    lda.z inccnt.return_2
    sta.z inccnt.return
    jmp b1
    // main::@1
  b1:
    // [7] (byte~) main::$0 ← (byte) inccnt::return#0 -- vbuz1=vbuz2 
    lda.z inccnt.return
    sta.z _0
    // [8] *((const byte[$100]) SCREEN#0) ← (byte~) main::$0 -- _deref_pbuc1=vbuz1 
    lda.z _0
    sta SCREEN
    // [9] (byte) cnt#2 ← ++ (byte) cnt#12 -- vbuz1=_inc_vbuz2 
    ldy.z cnt_12
    iny
    sty.z cnt
    // [10] call inccnt 
    // [17] phi from main::@1 to inccnt [phi:main::@1->inccnt]
  inccnt_from_b1:
    // [17] phi (byte) cnt3#10 = (byte) cnt3#11 [phi:main::@1->inccnt#0] -- register_copy 
    // [17] phi (byte) cnt2#10 = (byte) cnt2#11 [phi:main::@1->inccnt#1] -- register_copy 
    // [17] phi (byte) cnt#11 = (byte) cnt#2 [phi:main::@1->inccnt#2] -- register_copy 
    jsr inccnt
    // [11] (byte) inccnt::return#1 ← (byte) inccnt::return#2 -- vbuz1=vbuz2 
    lda.z inccnt.return_2
    sta.z inccnt.return_1
    jmp b2
    // main::@2
  b2:
    // [12] (byte~) main::$1 ← (byte) inccnt::return#1 -- vbuz1=vbuz2 
    lda.z inccnt.return_1
    sta.z _1
    // [13] *((const byte[$100]) SCREEN#0+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuz1 
    lda.z _1
    sta SCREEN+1
    // [14] *((const byte[$100]) SCREEN#0+(byte) 2) ← (byte) cnt2#11 -- _deref_pbuc1=vbuz1 
    lda.z cnt2
    sta SCREEN+2
    // [15] *((const byte[$100]) SCREEN#0+(byte) 3) ← (byte) cnt3#11 -- _deref_pbuc1=vbuz1 
    lda.z cnt3
    sta SCREEN+3
    jmp breturn
    // main::@return
  breturn:
    // [16] return 
    rts
}
  // inccnt
inccnt: {
    .label return = 5
    .label return_1 = 7
    .label return_2 = $a
    // [18] (byte) cnt#12 ← ++ (byte) cnt#11 -- vbuz1=_inc_vbuz2 
    ldy.z cnt
    iny
    sty.z cnt_12
    // [19] (byte) cnt2#11 ← ++ (byte) cnt2#10 -- vbuz1=_inc_vbuz1 
    inc.z cnt2
    // [20] (byte) cnt3#11 ← ++ (byte) cnt3#10 -- vbuz1=_inc_vbuz1 
    inc.z cnt3
    // [21] (byte) inccnt::return#2 ← (byte) cnt#12 -- vbuz1=vbuz2 
    lda.z cnt_12
    sta.z return_2
    jmp breturn
    // inccnt::@return
  breturn:
    // [22] return 
    rts
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp ZP_BYTE:2 [ cnt#11 cnt#2 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:3 [ cnt2#10 cnt2#11 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:4 [ cnt3#10 cnt3#11 ] : zp ZP_BYTE:4 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:5 [ inccnt::return#0 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:6 [ main::$0 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:7 [ inccnt::return#1 ] : zp ZP_BYTE:7 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:8 [ main::$1 ] : zp ZP_BYTE:8 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:9 [ cnt#12 ] : zp ZP_BYTE:9 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:10 [ inccnt::return#2 ] : zp ZP_BYTE:10 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [] 8: zp ZP_BYTE:2 [ cnt#11 cnt#2 ] 2.46: zp ZP_BYTE:3 [ cnt2#10 cnt2#11 ] 1.79: zp ZP_BYTE:4 [ cnt3#10 cnt3#11 ] 0.67: zp ZP_BYTE:9 [ cnt#12 ] 
Uplift Scope [inccnt] 4: zp ZP_BYTE:5 [ inccnt::return#0 ] 4: zp ZP_BYTE:7 [ inccnt::return#1 ] 1.5: zp ZP_BYTE:10 [ inccnt::return#2 ] 
Uplift Scope [main] 4: zp ZP_BYTE:6 [ main::$0 ] 4: zp ZP_BYTE:8 [ main::$1 ] 

Uplifting [] best 124 combination reg byte a [ cnt#11 cnt#2 ] reg byte y [ cnt2#10 cnt2#11 ] reg byte x [ cnt3#10 cnt3#11 ] zp ZP_BYTE:9 [ cnt#12 ] 
Limited combination testing to 100 combinations of 256 possible.
Uplifting [inccnt] best 103 combination reg byte a [ inccnt::return#0 ] reg byte a [ inccnt::return#1 ] reg byte a [ inccnt::return#2 ] 
Uplifting [main] best 91 combination reg byte a [ main::$0 ] reg byte a [ main::$1 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:9 [ cnt#12 ]
Uplifting [] best 91 combination zp ZP_BYTE:9 [ cnt#12 ] 
Allocated (was zp ZP_BYTE:9) zp ZP_BYTE:2 [ cnt#12 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label SCREEN = $400
  .label cnt = 2
  // @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: {
    // [5] call inccnt 
    // [17] phi from main to inccnt [phi:main->inccnt]
  inccnt_from_main:
    // [17] phi (byte) cnt3#10 = (byte) 0 [phi:main->inccnt#0] -- vbuxx=vbuc1 
    ldx #0
    // [17] phi (byte) cnt2#10 = (byte) 0 [phi:main->inccnt#1] -- vbuyy=vbuc1 
    ldy #0
    // [17] phi (byte) cnt#11 = (byte) 0 [phi:main->inccnt#2] -- vbuaa=vbuc1 
    lda #0
    jsr inccnt
    // [6] (byte) inccnt::return#0 ← (byte) inccnt::return#2
    jmp b1
    // main::@1
  b1:
    // [7] (byte~) main::$0 ← (byte) inccnt::return#0
    // [8] *((const byte[$100]) SCREEN#0) ← (byte~) main::$0 -- _deref_pbuc1=vbuaa 
    sta SCREEN
    // [9] (byte) cnt#2 ← ++ (byte) cnt#12 -- vbuaa=_inc_vbuz1 
    lda.z cnt
    clc
    adc #1
    // [10] call inccnt 
    // [17] phi from main::@1 to inccnt [phi:main::@1->inccnt]
  inccnt_from_b1:
    // [17] phi (byte) cnt3#10 = (byte) cnt3#11 [phi:main::@1->inccnt#0] -- register_copy 
    // [17] phi (byte) cnt2#10 = (byte) cnt2#11 [phi:main::@1->inccnt#1] -- register_copy 
    // [17] phi (byte) cnt#11 = (byte) cnt#2 [phi:main::@1->inccnt#2] -- register_copy 
    jsr inccnt
    // [11] (byte) inccnt::return#1 ← (byte) inccnt::return#2
    jmp b2
    // main::@2
  b2:
    // [12] (byte~) main::$1 ← (byte) inccnt::return#1
    // [13] *((const byte[$100]) SCREEN#0+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa 
    sta SCREEN+1
    // [14] *((const byte[$100]) SCREEN#0+(byte) 2) ← (byte) cnt2#11 -- _deref_pbuc1=vbuyy 
    sty SCREEN+2
    // [15] *((const byte[$100]) SCREEN#0+(byte) 3) ← (byte) cnt3#11 -- _deref_pbuc1=vbuxx 
    stx SCREEN+3
    jmp breturn
    // main::@return
  breturn:
    // [16] return 
    rts
}
  // inccnt
inccnt: {
    // [18] (byte) cnt#12 ← ++ (byte) cnt#11 -- vbuz1=_inc_vbuaa 
    clc
    adc #1
    sta.z cnt
    // [19] (byte) cnt2#11 ← ++ (byte) cnt2#10 -- vbuyy=_inc_vbuyy 
    iny
    // [20] (byte) cnt3#11 ← ++ (byte) cnt3#10 -- vbuxx=_inc_vbuxx 
    inx
    // [21] (byte) inccnt::return#2 ← (byte) cnt#12 -- vbuaa=vbuz1 
    lda.z cnt
    jmp breturn
    // inccnt::@return
  breturn:
    // [22] 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 breturn
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing instruction lda #0 with TXA
Removing instruction lda.z cnt
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction inccnt_from_main:
Removing instruction b1:
Removing instruction inccnt_from_b1:
Removing instruction b2:
Removing instruction breturn:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(byte[$100]) SCREEN
(const byte[$100]) SCREEN#0 SCREEN = (byte*) 1024
(byte) cnt
(byte) cnt#11 reg byte a 4.0
(byte) cnt#12 cnt zp ZP_BYTE:2 0.6666666666666666
(byte) cnt#2 reg byte a 4.0
(byte) cnt2
(byte) cnt2#10 reg byte y 2.0
(byte) cnt2#11 reg byte y 0.46153846153846156
(byte) cnt3
(byte) cnt3#10 reg byte x 1.3333333333333333
(byte) cnt3#11 reg byte x 0.46153846153846156
(byte()) inccnt()
(label) inccnt::@return
(byte) inccnt::return
(byte) inccnt::return#0 reg byte a 4.0
(byte) inccnt::return#1 reg byte a 4.0
(byte) inccnt::return#2 reg byte a 1.5
(void()) main()
(byte~) main::$0 reg byte a 4.0
(byte~) main::$1 reg byte a 4.0
(label) main::@1
(label) main::@2
(label) main::@return

reg byte a [ cnt#11 cnt#2 ]
reg byte y [ cnt2#10 cnt2#11 ]
reg byte x [ cnt3#10 cnt3#11 ]
reg byte a [ inccnt::return#0 ]
reg byte a [ main::$0 ]
reg byte a [ inccnt::return#1 ]
reg byte a [ main::$1 ]
zp ZP_BYTE:2 [ cnt#12 ]
reg byte a [ inccnt::return#2 ]


FINAL ASSEMBLER
Score: 64

  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .label SCREEN = $400
  .label cnt = 2
  // @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: {
    // inccnt()
    // [5] call inccnt 
    // [17] phi from main to inccnt [phi:main->inccnt]
    // [17] phi (byte) cnt3#10 = (byte) 0 [phi:main->inccnt#0] -- vbuxx=vbuc1 
    ldx #0
    // [17] phi (byte) cnt2#10 = (byte) 0 [phi:main->inccnt#1] -- vbuyy=vbuc1 
    ldy #0
    // [17] phi (byte) cnt#11 = (byte) 0 [phi:main->inccnt#2] -- vbuaa=vbuc1 
    txa
    jsr inccnt
    // inccnt()
    // [6] (byte) inccnt::return#0 ← (byte) inccnt::return#2
    // main::@1
    // [7] (byte~) main::$0 ← (byte) inccnt::return#0
    // SCREEN[0]=inccnt()
    // [8] *((const byte[$100]) SCREEN#0) ← (byte~) main::$0 -- _deref_pbuc1=vbuaa 
    sta SCREEN
    // cnt++;
    // [9] (byte) cnt#2 ← ++ (byte) cnt#12 -- vbuaa=_inc_vbuz1 
    lda.z cnt
    clc
    adc #1
    // inccnt()
    // [10] call inccnt 
    // [17] phi from main::@1 to inccnt [phi:main::@1->inccnt]
    // [17] phi (byte) cnt3#10 = (byte) cnt3#11 [phi:main::@1->inccnt#0] -- register_copy 
    // [17] phi (byte) cnt2#10 = (byte) cnt2#11 [phi:main::@1->inccnt#1] -- register_copy 
    // [17] phi (byte) cnt#11 = (byte) cnt#2 [phi:main::@1->inccnt#2] -- register_copy 
    jsr inccnt
    // inccnt()
    // [11] (byte) inccnt::return#1 ← (byte) inccnt::return#2
    // main::@2
    // [12] (byte~) main::$1 ← (byte) inccnt::return#1
    // SCREEN[1]=inccnt()
    // [13] *((const byte[$100]) SCREEN#0+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa 
    sta SCREEN+1
    // SCREEN[2]=cnt2
    // [14] *((const byte[$100]) SCREEN#0+(byte) 2) ← (byte) cnt2#11 -- _deref_pbuc1=vbuyy 
    sty SCREEN+2
    // SCREEN[3]=cnt3
    // [15] *((const byte[$100]) SCREEN#0+(byte) 3) ← (byte) cnt3#11 -- _deref_pbuc1=vbuxx 
    stx SCREEN+3
    // main::@return
    // }
    // [16] return 
    rts
}
  // inccnt
inccnt: {
    // ++cnt;
    // [18] (byte) cnt#12 ← ++ (byte) cnt#11 -- vbuz1=_inc_vbuaa 
    clc
    adc #1
    sta.z cnt
    // ++cnt2;
    // [19] (byte) cnt2#11 ← ++ (byte) cnt2#10 -- vbuyy=_inc_vbuyy 
    iny
    // ++cnt3;
    // [20] (byte) cnt3#11 ← ++ (byte) cnt3#10 -- vbuxx=_inc_vbuxx 
    inx
    // return cnt;
    // [21] (byte) inccnt::return#2 ← (byte) cnt#12 -- vbuaa=vbuz1 
    // inccnt::@return
    // }
    // [22] return 
    rts
}
  // File Data

