Culled Empty Block (label) main::@2

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

(void()) main()
main: scope:[main]  from @1
  (byte*) main::screen#0 ← (byte*)(number) $400
  (byte) main::i#0 ← (byte) 0
  to:main::@1
main::@1: scope:[main]  from main main::@1
  (byte*) main::screen#3 ← phi( main/(byte*) main::screen#0 main::@1/(byte*) main::screen#2 )
  (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 )
  (number~) main::$0 ← (byte) main::i#2 + (number) 1
  (number~) main::$1 ← (number~) main::$0 * (number) 2
  *((byte*) main::screen#3) ← (number~) main::$1
  (byte*) main::screen#1 ← ++ (byte*) main::screen#3
  (number~) main::$2 ← (byte) main::i#2 + (number) 1
  (number~) main::$3 ← (number~) main::$2 * (number) 2
  *((byte*) main::screen#1) ← (number~) main::$3
  (byte*) main::screen#2 ← ++ (byte*) main::screen#1
  (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,2)
  (bool~) main::$4 ← (byte) main::i#1 != rangelast(0,2)
  if((bool~) main::$4) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@1
  return 
  to:@return
@1: scope:[]  from @begin
  call main 
  to:@2
@2: scope:[]  from @1
  to:@end
@end: scope:[]  from @2

SYMBOL TABLE SSA
(label) @1
(label) @2
(label) @begin
(label) @end
(void()) main()
(number~) main::$0
(number~) main::$1
(number~) main::$2
(number~) main::$3
(bool~) main::$4
(label) main::@1
(label) main::@return
(byte) main::i
(byte) main::i#0
(byte) main::i#1
(byte) main::i#2
(byte*) main::screen
(byte*) main::screen#0
(byte*) main::screen#1
(byte*) main::screen#2
(byte*) main::screen#3

Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) main::i#2 + (number) 1
Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::i#2 + (unumber)(number) 1
Adding number conversion cast (unumber) 2 in (number~) main::$1 ← (unumber~) main::$0 * (number) 2
Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (unumber~) main::$0 * (unumber)(number) 2
Adding number conversion cast (unumber) 1 in (number~) main::$2 ← (byte) main::i#2 + (number) 1
Adding number conversion cast (unumber) main::$2 in (number~) main::$2 ← (byte) main::i#2 + (unumber)(number) 1
Adding number conversion cast (unumber) 2 in (number~) main::$3 ← (unumber~) main::$2 * (number) 2
Adding number conversion cast (unumber) main::$3 in (number~) main::$3 ← (unumber~) main::$2 * (unumber)(number) 2
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$0 ← (byte) main::i#2 + (byte) 1
Inferred type updated to byte in (unumber~) main::$1 ← (byte~) main::$0 * (byte) 2
Inferred type updated to byte in (unumber~) main::$2 ← (byte) main::i#2 + (byte) 1
Inferred type updated to byte in (unumber~) main::$3 ← (byte~) main::$2 * (byte) 2
Simple Condition (bool~) main::$4 [13] if((byte) main::i#1!=rangelast(0,2)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) main::screen#0 = (byte*) 1024
Constant (const byte) main::i#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [11] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [13] if(main::i#1!=rangelast(0,2)) goto main::@1 to (number) 3
Adding number conversion cast (unumber) 3 in if((byte) main::i#1!=(number) 3) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 3
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 3
Successful SSA optimization PassNFinalizeNumberTypeConversions
Rewriting multiplication to use shift [2] (byte~) main::$1 ← (byte~) main::$0 * (byte) 2
Rewriting multiplication to use shift [6] (byte~) main::$3 ← (byte~) main::$2 * (byte) 2
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const byte*) main::screen#0
Inlining constant with var siblings (const byte) main::i#0
Constant inlined main::screen#0 = (byte*) 1024
Constant inlined main::i#0 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@3(between main::@1 and main::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:2 

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

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  [1] phi()
  [2] call main 
  to:@end
@end: scope:[]  from @1
  [3] phi()

(void()) main()
main: scope:[main]  from @1
  [4] phi()
  to:main::@1
main::@1: scope:[main]  from main main::@1
  [5] (byte*) main::screen#3 ← phi( main/(byte*) 1024 main::@1/(byte*) main::screen#2 )
  [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
  [6] (byte~) main::$0 ← (byte) main::i#2 + (byte) 1
  [7] (byte~) main::$1 ← (byte~) main::$0 << (byte) 1
  [8] *((byte*) main::screen#3) ← (byte~) main::$1
  [9] (byte*) main::screen#1 ← ++ (byte*) main::screen#3
  [10] (byte~) main::$2 ← (byte) main::i#2 + (byte) 1
  [11] (byte~) main::$3 ← (byte~) main::$2 << (byte) 1
  [12] *((byte*) main::screen#1) ← (byte~) main::$3
  [13] (byte*) main::screen#2 ← ++ (byte*) main::screen#1
  [14] (byte) main::i#1 ← ++ (byte) main::i#2
  [15] if((byte) main::i#1!=(byte) 3) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@1
  [16] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(void()) main()
(byte~) main::$0 22.0
(byte~) main::$1 22.0
(byte~) main::$2 22.0
(byte~) main::$3 22.0
(byte) main::i
(byte) main::i#1 16.5
(byte) main::i#2 4.888888888888889
(byte*) main::screen
(byte*) main::screen#1 8.25
(byte*) main::screen#2 7.333333333333333
(byte*) main::screen#3 8.25

Initial phi equivalence classes
[ main::i#2 main::i#1 ]
[ main::screen#3 main::screen#2 ]
Added variable main::$0 to live range equivalence class [ main::$0 ]
Added variable main::$1 to live range equivalence class [ main::$1 ]
Added variable main::screen#1 to live range equivalence class [ main::screen#1 ]
Added variable main::$2 to live range equivalence class [ main::$2 ]
Added variable main::$3 to live range equivalence class [ main::$3 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ main::screen#3 main::screen#2 ]
[ main::$0 ]
[ main::$1 ]
[ main::screen#1 ]
[ main::$2 ]
[ main::$3 ]
Allocated zp[1]:2 [ main::i#2 main::i#1 ]
Allocated zp[2]:3 [ main::screen#3 main::screen#2 ]
Allocated zp[1]:5 [ main::$0 ]
Allocated zp[1]:6 [ main::$1 ]
Allocated zp[2]:7 [ main::screen#1 ]
Allocated zp[1]:9 [ main::$2 ]
Allocated zp[1]:10 [ main::$3 ]

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
// Tests optimization of identical sub-expressions
  // 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 __0 = 5
    .label __1 = 6
    .label __2 = 9
    .label __3 = $a
    .label screen = 7
    .label screen_1 = 3
    .label i = 2
    // [5] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [5] phi (byte*) main::screen#3 = (byte*) 1024 [phi:main->main::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z screen_1
    lda #>$400
    sta.z screen_1+1
    // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#1] -- vbuz1=vbuc1 
    lda #0
    sta.z i
    jmp __b1
    // [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
  __b1_from___b1:
    // [5] phi (byte*) main::screen#3 = (byte*) main::screen#2 [phi:main::@1->main::@1#0] -- register_copy 
    // [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#1] -- register_copy 
    jmp __b1
    // main::@1
  __b1:
    // [6] (byte~) main::$0 ← (byte) main::i#2 + (byte) 1 -- vbuz1=vbuz2_plus_1 
    ldy.z i
    iny
    sty.z __0
    // [7] (byte~) main::$1 ← (byte~) main::$0 << (byte) 1 -- vbuz1=vbuz2_rol_1 
    lda.z __0
    asl
    sta.z __1
    // [8] *((byte*) main::screen#3) ← (byte~) main::$1 -- _deref_pbuz1=vbuz2 
    lda.z __1
    ldy #0
    sta (screen_1),y
    // [9] (byte*) main::screen#1 ← ++ (byte*) main::screen#3 -- pbuz1=_inc_pbuz2 
    lda.z screen_1
    clc
    adc #1
    sta.z screen
    lda.z screen_1+1
    adc #0
    sta.z screen+1
    // [10] (byte~) main::$2 ← (byte) main::i#2 + (byte) 1 -- vbuz1=vbuz2_plus_1 
    ldy.z i
    iny
    sty.z __2
    // [11] (byte~) main::$3 ← (byte~) main::$2 << (byte) 1 -- vbuz1=vbuz2_rol_1 
    lda.z __2
    asl
    sta.z __3
    // [12] *((byte*) main::screen#1) ← (byte~) main::$3 -- _deref_pbuz1=vbuz2 
    lda.z __3
    ldy #0
    sta (screen),y
    // [13] (byte*) main::screen#2 ← ++ (byte*) main::screen#1 -- pbuz1=_inc_pbuz2 
    lda.z screen
    clc
    adc #1
    sta.z screen_1
    lda.z screen+1
    adc #0
    sta.z screen_1+1
    // [14] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [15] if((byte) main::i#1!=(byte) 3) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #3
    cmp.z i
    bne __b1_from___b1
    jmp __breturn
    // main::@return
  __breturn:
    // [16] return 
    rts
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] (byte~) main::$1 ← (byte~) main::$0 << (byte) 1 [ main::i#2 main::screen#3 main::$1 ] ( main:2 [ main::i#2 main::screen#3 main::$1 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::i#2 main::i#1 ]
Statement [8] *((byte*) main::screen#3) ← (byte~) main::$1 [ main::i#2 main::screen#3 ] ( main:2 [ main::i#2 main::screen#3 ] ) always clobbers reg byte y 
Removing always clobbered register reg byte y as potential for zp[1]:2 [ main::i#2 main::i#1 ]
Statement [9] (byte*) main::screen#1 ← ++ (byte*) main::screen#3 [ main::i#2 main::screen#1 ] ( main:2 [ main::i#2 main::screen#1 ] ) always clobbers reg byte a 
Statement [11] (byte~) main::$3 ← (byte~) main::$2 << (byte) 1 [ main::i#2 main::screen#1 main::$3 ] ( main:2 [ main::i#2 main::screen#1 main::$3 ] ) always clobbers reg byte a 
Statement [12] *((byte*) main::screen#1) ← (byte~) main::$3 [ main::i#2 main::screen#1 ] ( main:2 [ main::i#2 main::screen#1 ] ) always clobbers reg byte y 
Statement [13] (byte*) main::screen#2 ← ++ (byte*) main::screen#1 [ main::i#2 main::screen#2 ] ( main:2 [ main::i#2 main::screen#2 ] ) always clobbers reg byte a 
Statement [7] (byte~) main::$1 ← (byte~) main::$0 << (byte) 1 [ main::i#2 main::screen#3 main::$1 ] ( main:2 [ main::i#2 main::screen#3 main::$1 ] ) always clobbers reg byte a 
Statement [8] *((byte*) main::screen#3) ← (byte~) main::$1 [ main::i#2 main::screen#3 ] ( main:2 [ main::i#2 main::screen#3 ] ) always clobbers reg byte y 
Statement [9] (byte*) main::screen#1 ← ++ (byte*) main::screen#3 [ main::i#2 main::screen#1 ] ( main:2 [ main::i#2 main::screen#1 ] ) always clobbers reg byte a 
Statement [11] (byte~) main::$3 ← (byte~) main::$2 << (byte) 1 [ main::i#2 main::screen#1 main::$3 ] ( main:2 [ main::i#2 main::screen#1 main::$3 ] ) always clobbers reg byte a 
Statement [12] *((byte*) main::screen#1) ← (byte~) main::$3 [ main::i#2 main::screen#1 ] ( main:2 [ main::i#2 main::screen#1 ] ) always clobbers reg byte y 
Statement [13] (byte*) main::screen#2 ← ++ (byte*) main::screen#1 [ main::i#2 main::screen#2 ] ( main:2 [ main::i#2 main::screen#2 ] ) always clobbers reg byte a 
Potential registers zp[1]:2 [ main::i#2 main::i#1 ] : zp[1]:2 , reg byte x , 
Potential registers zp[2]:3 [ main::screen#3 main::screen#2 ] : zp[2]:3 , 
Potential registers zp[1]:5 [ main::$0 ] : zp[1]:5 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:6 [ main::$1 ] : zp[1]:6 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:7 [ main::screen#1 ] : zp[2]:7 , 
Potential registers zp[1]:9 [ main::$2 ] : zp[1]:9 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:10 [ main::$3 ] : zp[1]:10 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 22: zp[1]:5 [ main::$0 ] 22: zp[1]:6 [ main::$1 ] 22: zp[1]:9 [ main::$2 ] 22: zp[1]:10 [ main::$3 ] 21.39: zp[1]:2 [ main::i#2 main::i#1 ] 15.58: zp[2]:3 [ main::screen#3 main::screen#2 ] 8.25: zp[2]:7 [ main::screen#1 ] 
Uplift Scope [] 

Uplifting [main] best 1083 combination reg byte a [ main::$0 ] reg byte a [ main::$1 ] reg byte a [ main::$2 ] reg byte a [ main::$3 ] zp[1]:2 [ main::i#2 main::i#1 ] zp[2]:3 [ main::screen#3 main::screen#2 ] zp[2]:7 [ main::screen#1 ] 
Limited combination testing to 100 combinations of 512 possible.
Uplifting [] best 1083 combination 
Attempting to uplift remaining variables inzp[1]:2 [ main::i#2 main::i#1 ]
Uplifting [main] best 1083 combination zp[1]:2 [ main::i#2 main::i#1 ] 
Coalescing zero page register [ zp[2]:3 [ main::screen#3 main::screen#2 ] ] with [ zp[2]:7 [ main::screen#1 ] ] - score: 2

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Tests optimization of identical sub-expressions
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  // @begin
__bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
__b1_from___bbegin:
  jmp __b1
  // @1
__b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from___b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
__bend_from___b1:
  jmp __bend
  // @end
__bend:
  // main
main: {
    .label screen = 3
    .label i = 2
    // [5] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [5] phi (byte*) main::screen#3 = (byte*) 1024 [phi:main->main::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z screen
    lda #>$400
    sta.z screen+1
    // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#1] -- vbuz1=vbuc1 
    lda #0
    sta.z i
    jmp __b1
    // [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
  __b1_from___b1:
    // [5] phi (byte*) main::screen#3 = (byte*) main::screen#2 [phi:main::@1->main::@1#0] -- register_copy 
    // [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#1] -- register_copy 
    jmp __b1
    // main::@1
  __b1:
    // [6] (byte~) main::$0 ← (byte) main::i#2 + (byte) 1 -- vbuaa=vbuz1_plus_1 
    lda.z i
    clc
    adc #1
    // [7] (byte~) main::$1 ← (byte~) main::$0 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // [8] *((byte*) main::screen#3) ← (byte~) main::$1 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (screen),y
    // [9] (byte*) main::screen#1 ← ++ (byte*) main::screen#3 -- pbuz1=_inc_pbuz1 
    inc.z screen
    bne !+
    inc.z screen+1
  !:
    // [10] (byte~) main::$2 ← (byte) main::i#2 + (byte) 1 -- vbuaa=vbuz1_plus_1 
    lda.z i
    clc
    adc #1
    // [11] (byte~) main::$3 ← (byte~) main::$2 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // [12] *((byte*) main::screen#1) ← (byte~) main::$3 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (screen),y
    // [13] (byte*) main::screen#2 ← ++ (byte*) main::screen#1 -- pbuz1=_inc_pbuz1 
    inc.z screen
    bne !+
    inc.z screen+1
  !:
    // [14] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [15] if((byte) main::i#1!=(byte) 3) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #3
    cmp.z i
    bne __b1_from___b1
    jmp __breturn
    // main::@return
  __breturn:
    // [16] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __bend
Removing instruction jmp __b1
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __bbegin with __b1
Replacing label __b1_from___b1 with __b1
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Removing instruction __b1_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __b1:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(void()) main()
(byte~) main::$0 reg byte a 22.0
(byte~) main::$1 reg byte a 22.0
(byte~) main::$2 reg byte a 22.0
(byte~) main::$3 reg byte a 22.0
(label) main::@1
(label) main::@return
(byte) main::i
(byte) main::i#1 i zp[1]:2 16.5
(byte) main::i#2 i zp[1]:2 4.888888888888889
(byte*) main::screen
(byte*) main::screen#1 screen zp[2]:3 8.25
(byte*) main::screen#2 screen zp[2]:3 7.333333333333333
(byte*) main::screen#3 screen zp[2]:3 8.25

zp[1]:2 [ main::i#2 main::i#1 ]
zp[2]:3 [ main::screen#3 main::screen#2 main::screen#1 ]
reg byte a [ main::$0 ]
reg byte a [ main::$1 ]
reg byte a [ main::$2 ]
reg byte a [ main::$3 ]


FINAL ASSEMBLER
Score: 871

  // File Comments
// Tests optimization of identical sub-expressions
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  // @begin
  // [1] phi from @begin to @1 [phi:@begin->@1]
  // @1
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
  // [3] phi from @1 to @end [phi:@1->@end]
  // @end
  // main
main: {
    .label screen = 3
    .label i = 2
    // [5] phi from main to main::@1 [phi:main->main::@1]
    // [5] phi (byte*) main::screen#3 = (byte*) 1024 [phi:main->main::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z screen
    lda #>$400
    sta.z screen+1
    // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#1] -- vbuz1=vbuc1 
    lda #0
    sta.z i
    // [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
    // [5] phi (byte*) main::screen#3 = (byte*) main::screen#2 [phi:main::@1->main::@1#0] -- register_copy 
    // [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#1] -- register_copy 
    // main::@1
  __b1:
    // i+1
    // [6] (byte~) main::$0 ← (byte) main::i#2 + (byte) 1 -- vbuaa=vbuz1_plus_1 
    lda.z i
    clc
    adc #1
    // (i+1)*2
    // [7] (byte~) main::$1 ← (byte~) main::$0 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // *screen++ = (i+1)*2
    // [8] *((byte*) main::screen#3) ← (byte~) main::$1 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (screen),y
    // *screen++ = (i+1)*2;
    // [9] (byte*) main::screen#1 ← ++ (byte*) main::screen#3 -- pbuz1=_inc_pbuz1 
    inc.z screen
    bne !+
    inc.z screen+1
  !:
    // i+1
    // [10] (byte~) main::$2 ← (byte) main::i#2 + (byte) 1 -- vbuaa=vbuz1_plus_1 
    lda.z i
    clc
    adc #1
    // (i+1)*2
    // [11] (byte~) main::$3 ← (byte~) main::$2 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // *screen++ = (i+1)*2
    // [12] *((byte*) main::screen#1) ← (byte~) main::$3 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (screen),y
    // *screen++ = (i+1)*2;
    // [13] (byte*) main::screen#2 ← ++ (byte*) main::screen#1 -- pbuz1=_inc_pbuz1 
    inc.z screen
    bne !+
    inc.z screen+1
  !:
    // for( byte i: 0..2)
    // [14] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [15] if((byte) main::i#1!=(byte) 3) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #3
    cmp.z i
    bne __b1
    // main::@return
    // }
    // [16] return 
    rts
}
  // File Data

