Inlined call call __init
Eliminating unused variable with no statement main::$2
Eliminating unused variable with no statement main::$3

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start::@1
  idx#14 = phi( __start::@1/idx#13 )
  main::i#0 = 0
  to:main::@1
main::@1: scope:[main]  from main main::@5
  idx#12 = phi( main/idx#14, main::@5/idx#15 )
  main::i#2 = phi( main/main::i#0, main::@5/main::i#1 )
  main::$0 = main::i#2 < 5
  if(main::$0) goto main::@2
  to:main::@return
main::@2: scope:[main]  from main::@1
  idx#16 = phi( main::@1/idx#12 )
  main::i#6 = phi( main::@1/main::i#2 )
  main::j#0 = 0
  to:main::@3
main::@3: scope:[main]  from main::@2 main::@6
  idx#11 = phi( main::@2/idx#16, main::@6/idx#1 )
  main::i#5 = phi( main::@2/main::i#6, main::@6/main::i#7 )
  main::j#2 = phi( main::@2/main::j#0, main::@6/main::j#1 )
  main::$1 = main::j#2 < 5
  if(main::$1) goto main::@4
  to:main::@5
main::@4: scope:[main]  from main::@3
  idx#6 = phi( main::@3/idx#11 )
  main::j#3 = phi( main::@3/main::j#2 )
  main::i#3 = phi( main::@3/main::i#5 )
  main::x#0 = main::i#3 + main::j#3
  SCREEN[idx#6] = main::x#0
  idx#0 = ++ idx#6
  sum::a#0 = main::i#3
  sum::b#0 = main::j#3
  call sum
  sum::return#0 = sum::return#2
  to:main::@6
main::@6: scope:[main]  from main::@4
  main::i#7 = phi( main::@4/main::i#3 )
  main::j#4 = phi( main::@4/main::j#3 )
  idx#7 = phi( main::@4/idx#0 )
  sum::return#3 = phi( main::@4/sum::return#0 )
  main::y#0 = sum::return#3
  SCREEN[idx#7] = main::y#0
  idx#1 = ++ idx#7
  main::j#1 = ++ main::j#4
  to:main::@3
main::@5: scope:[main]  from main::@3
  idx#15 = phi( main::@3/idx#11 )
  main::i#4 = phi( main::@3/main::i#5 )
  main::i#1 = ++ main::i#4
  to:main::@1
main::@return: scope:[main]  from main::@1
  idx#8 = phi( main::@1/idx#12 )
  idx#2 = idx#8
  return 
  to:@return

char sum(char a , char b)
sum: scope:[sum]  from main::@4
  sum::b#1 = phi( main::@4/sum::b#0 )
  sum::a#1 = phi( main::@4/sum::a#0 )
  sum::$0 = sum::a#1 + sum::b#1
  sum::return#1 = sum::$0
  to:sum::@return
sum::@return: scope:[sum]  from sum
  sum::return#4 = phi( sum/sum::return#1 )
  sum::return#2 = sum::return#4
  return 
  to:@return

void __start()
__start: scope:[__start]  from
  to:__start::__init1
__start::__init1: scope:[__start]  from __start
  idx#3 = 0
  to:__start::@1
__start::@1: scope:[__start]  from __start::__init1
  idx#13 = phi( __start::__init1/idx#3 )
  call main
  to:__start::@2
__start::@2: scope:[__start]  from __start::@1
  idx#9 = phi( __start::@1/idx#2 )
  idx#4 = idx#9
  to:__start::@return
__start::@return: scope:[__start]  from __start::@2
  idx#10 = phi( __start::@2/idx#4 )
  idx#5 = idx#10
  return 
  to:@return

SYMBOL TABLE SSA
__constant char * const SCREEN = (char *)$400
void __start()
char idx
char idx#0
char idx#1
char idx#10
char idx#11
char idx#12
char idx#13
char idx#14
char idx#15
char idx#16
char idx#2
char idx#3
char idx#4
char idx#5
char idx#6
char idx#7
char idx#8
char idx#9
void main()
bool main::$0
bool main::$1
char main::i
char main::i#0
char main::i#1
char main::i#2
char main::i#3
char main::i#4
char main::i#5
char main::i#6
char main::i#7
char main::j
char main::j#0
char main::j#1
char main::j#2
char main::j#3
char main::j#4
char main::x
char main::x#0
char main::y
char main::y#0
char sum(char a , char b)
char sum::$0
char sum::a
char sum::a#0
char sum::a#1
char sum::b
char sum::b#0
char sum::b#1
char sum::return
char sum::return#0
char sum::return#1
char sum::return#2
char sum::return#3
char sum::return#4

Adding number conversion cast (unumber) 5 in main::$0 = main::i#2 < 5
Adding number conversion cast (unumber) 5 in main::$1 = main::j#2 < 5
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (char *) 1024
Simplifying constant integer cast 5
Simplifying constant integer cast 5
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 5
Finalized unsigned number type (char) 5
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias main::i#2 = main::i#6 
Alias idx#12 = idx#16 idx#8 idx#2 
Alias main::i#3 = main::i#5 main::i#7 main::i#4 
Alias main::j#2 = main::j#3 main::j#4 
Alias idx#11 = idx#6 idx#15 
Alias sum::return#0 = sum::return#3 
Alias idx#0 = idx#7 
Alias sum::return#1 = sum::$0 sum::return#4 sum::return#2 
Alias idx#13 = idx#3 
Alias idx#10 = idx#4 idx#9 idx#5 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values idx#14 idx#13
Identical Phi Values main::i#3 main::i#2
Identical Phi Values sum::a#1 sum::a#0
Identical Phi Values sum::b#1 sum::b#0
Identical Phi Values idx#10 idx#12
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition main::$0 [4] if(main::i#2<5) goto main::@2
Simple Condition main::$1 [8] if(main::j#2<5) goto main::@4
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant main::i#0 = 0
Constant main::j#0 = 0
Constant idx#13 = 0
Successful SSA optimization Pass2ConstantIdentification
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::__init1
Removing unused procedure block __start::@1
Removing unused procedure block __start::@2
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Inlining constant with var siblings main::i#0
Inlining constant with var siblings main::j#0
Inlining constant with var siblings idx#13
Constant inlined main::i#0 = 0
Constant inlined main::j#0 = 0
Constant inlined idx#13 = 0
Successful SSA optimization Pass2ConstantInlining
Adding NOP phi() at start of main
CALL GRAPH
Calls in [main] to sum:15 

Created 4 initial phi equivalence classes
Coalesced [4] idx#18 = idx#12
Coalesced [8] main::i#8 = main::i#1
Coalesced (already) [9] idx#17 = idx#11
Coalesced [21] main::j#5 = main::j#1
Coalesced [22] idx#19 = idx#1
Coalesced down to 3 phi equivalence classes
Culled Empty Block label main::@2
Renumbering block main::@3 to main::@2
Renumbering block main::@4 to main::@3
Renumbering block main::@5 to main::@4
Renumbering block main::@6 to main::@5
Adding NOP phi() at start of main

FINAL CONTROL FLOW GRAPH

void main()
main: scope:[main]  from
  [0] phi()
  to:main::@1
main::@1: scope:[main]  from main main::@4
  [1] idx#12 = phi( main/0, main::@4/idx#11 )
  [1] main::i#2 = phi( main/0, main::@4/main::i#1 )
  [2] if(main::i#2<5) goto main::@2
  to:main::@return
main::@return: scope:[main]  from main::@1
  [3] return 
  to:@return
main::@2: scope:[main]  from main::@1 main::@5
  [4] idx#11 = phi( main::@1/idx#12, main::@5/idx#1 )
  [4] main::j#2 = phi( main::@1/0, main::@5/main::j#1 )
  [5] if(main::j#2<5) goto main::@3
  to:main::@4
main::@4: scope:[main]  from main::@2
  [6] main::i#1 = ++ main::i#2
  to:main::@1
main::@3: scope:[main]  from main::@2
  [7] main::x#0 = main::i#2 + main::j#2
  [8] SCREEN[idx#11] = main::x#0
  [9] idx#0 = ++ idx#11
  [10] sum::a#0 = main::i#2
  [11] sum::b#0 = main::j#2
  [12] call sum
  [13] sum::return#0 = sum::return#1
  to:main::@5
main::@5: scope:[main]  from main::@3
  [14] main::y#0 = sum::return#0
  [15] SCREEN[idx#0] = main::y#0
  [16] idx#1 = ++ idx#0
  [17] main::j#1 = ++ main::j#2
  to:main::@2

char sum(char a , char b)
sum: scope:[sum]  from main::@3
  [18] sum::return#1 = sum::a#0 + sum::b#0
  to:sum::@return
sum::@return: scope:[sum]  from sum
  [19] return 
  to:@return


VARIABLE REGISTER WEIGHTS
char idx
char idx#0 // 43.285714285714285
char idx#1 // 101.0
char idx#11 // 65.0
char idx#12 // 11.0
void main()
char main::i
char main::i#1 // 22.0
char main::i#2 // 15.666666666666668
char main::j
char main::j#1 // 202.0
char main::j#2 // 42.08333333333333
char main::x
char main::x#0 // 202.0
char main::y
char main::y#0 // 202.0
char sum(char a , char b)
char sum::a
char sum::a#0 // 551.0
char sum::b
char sum::b#0 // 1102.0
char sum::return
char sum::return#0 // 202.0
char sum::return#1 // 367.33333333333337

Initial phi equivalence classes
[ main::i#2 main::i#1 ]
[ idx#12 idx#11 idx#1 ]
[ main::j#2 main::j#1 ]
Added variable main::x#0 to live range equivalence class [ main::x#0 ]
Added variable idx#0 to live range equivalence class [ idx#0 ]
Added variable sum::a#0 to live range equivalence class [ sum::a#0 ]
Added variable sum::b#0 to live range equivalence class [ sum::b#0 ]
Added variable sum::return#0 to live range equivalence class [ sum::return#0 ]
Added variable main::y#0 to live range equivalence class [ main::y#0 ]
Added variable sum::return#1 to live range equivalence class [ sum::return#1 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ idx#12 idx#11 idx#1 ]
[ main::j#2 main::j#1 ]
[ main::x#0 ]
[ idx#0 ]
[ sum::a#0 ]
[ sum::b#0 ]
[ sum::return#0 ]
[ main::y#0 ]
[ sum::return#1 ]
Allocated zp[1]:2 [ sum::b#0 ]
Allocated zp[1]:3 [ sum::a#0 ]
Allocated zp[1]:4 [ sum::return#1 ]
Allocated zp[1]:5 [ main::j#2 main::j#1 ]
Allocated zp[1]:6 [ main::x#0 ]
Allocated zp[1]:7 [ sum::return#0 ]
Allocated zp[1]:8 [ main::y#0 ]
Allocated zp[1]:9 [ idx#12 idx#11 idx#1 ]
Allocated zp[1]:10 [ idx#0 ]
Allocated zp[1]:11 [ main::i#2 main::i#1 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] main::x#0 = main::i#2 + main::j#2 [ main::i#2 idx#11 main::j#2 main::x#0 ] (  [ main::i#2 idx#11 main::j#2 main::x#0 ] { { sum::a#0 = main::i#2 } { sum::b#0 = main::j#2 } { sum::return#0 = sum::return#1 } }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:11 [ main::i#2 main::i#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:9 [ idx#12 idx#11 idx#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:5 [ main::j#2 main::j#1 ]
Statement [18] sum::return#1 = sum::a#0 + sum::b#0 [ sum::return#1 ] ( sum:12 [ main::i#2 main::j#2 idx#0 sum::return#1 ] { { sum::a#0 = main::i#2 } { sum::b#0 = main::j#2 } { sum::return#0 = sum::return#1 } }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:10 [ idx#0 ]
Statement [7] main::x#0 = main::i#2 + main::j#2 [ main::i#2 idx#11 main::j#2 main::x#0 ] (  [ main::i#2 idx#11 main::j#2 main::x#0 ] { { sum::a#0 = main::i#2 } { sum::b#0 = main::j#2 } { sum::return#0 = sum::return#1 } }  ) always clobbers reg byte a 
Statement [18] sum::return#1 = sum::a#0 + sum::b#0 [ sum::return#1 ] ( sum:12 [ main::i#2 main::j#2 idx#0 sum::return#1 ] { { sum::a#0 = main::i#2 } { sum::b#0 = main::j#2 } { sum::return#0 = sum::return#1 } }  ) always clobbers reg byte a 
Potential registers zp[1]:11 [ main::i#2 main::i#1 ] : zp[1]:11 , reg byte x , reg byte y , 
Potential registers zp[1]:9 [ idx#12 idx#11 idx#1 ] : zp[1]:9 , reg byte x , reg byte y , 
Potential registers zp[1]:5 [ main::j#2 main::j#1 ] : zp[1]:5 , reg byte x , reg byte y , 
Potential registers zp[1]:6 [ main::x#0 ] : zp[1]:6 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:10 [ idx#0 ] : zp[1]:10 , reg byte x , reg byte y , 
Potential registers zp[1]:3 [ sum::a#0 ] : zp[1]:3 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:2 [ sum::b#0 ] : zp[1]:2 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:7 [ sum::return#0 ] : zp[1]:7 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:8 [ main::y#0 ] : zp[1]:8 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:4 [ sum::return#1 ] : zp[1]:4 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [sum] 1,102: zp[1]:2 [ sum::b#0 ] 551: zp[1]:3 [ sum::a#0 ] 367.33: zp[1]:4 [ sum::return#1 ] 202: zp[1]:7 [ sum::return#0 ] 
Uplift Scope [main] 244.08: zp[1]:5 [ main::j#2 main::j#1 ] 202: zp[1]:6 [ main::x#0 ] 202: zp[1]:8 [ main::y#0 ] 37.67: zp[1]:11 [ main::i#2 main::i#1 ] 
Uplift Scope [] 177: zp[1]:9 [ idx#12 idx#11 idx#1 ] 43.29: zp[1]:10 [ idx#0 ] 

Uplifting [sum] best 9688 combination reg byte x [ sum::b#0 ] reg byte a [ sum::a#0 ] reg byte a [ sum::return#1 ] reg byte a [ sum::return#0 ] 
Limited combination testing to 100 combinations of 256 possible.
Uplifting [main] best 7188 combination reg byte x [ main::j#2 main::j#1 ] reg byte a [ main::x#0 ] reg byte a [ main::y#0 ] zp[1]:11 [ main::i#2 main::i#1 ] 
Limited combination testing to 100 combinations of 144 possible.
Uplifting [] best 5358 combination reg byte y [ idx#12 idx#11 idx#1 ] reg byte y [ idx#0 ] 
Attempting to uplift remaining variables inzp[1]:11 [ main::i#2 main::i#1 ]
Uplifting [main] best 5358 combination zp[1]:11 [ main::i#2 main::i#1 ] 
Allocated (was zp[1]:11) zp[1]:2 [ main::i#2 main::i#1 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Test intermediate vars
  // Upstart
  // Commodore 64 PRG executable file
.file [name="intermediates-simple.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
  // Global Constants & labels
  .label SCREEN = $400
.segment Code
  // main
main: {
    .label i = 2
    // [1] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [1] phi idx#12 = 0 [phi:main->main::@1#0] -- vbuyy=vbuc1 
    ldy #0
    // [1] phi main::i#2 = 0 [phi:main->main::@1#1] -- vbuz1=vbuc1 
    lda #0
    sta.z i
    jmp __b1
    // main::@1
  __b1:
    // [2] if(main::i#2<5) goto main::@2 -- vbuz1_lt_vbuc1_then_la1 
    lda.z i
    cmp #5
    bcc __b2_from___b1
    jmp __breturn
    // main::@return
  __breturn:
    // [3] return 
    rts
    // [4] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  __b2_from___b1:
    // [4] phi idx#11 = idx#12 [phi:main::@1->main::@2#0] -- register_copy 
    // [4] phi main::j#2 = 0 [phi:main::@1->main::@2#1] -- vbuxx=vbuc1 
    ldx #0
    jmp __b2
    // main::@2
  __b2:
    // [5] if(main::j#2<5) goto main::@3 -- vbuxx_lt_vbuc1_then_la1 
    cpx #5
    bcc __b3
    jmp __b4
    // main::@4
  __b4:
    // [6] main::i#1 = ++ main::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [1] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
  __b1_from___b4:
    // [1] phi idx#12 = idx#11 [phi:main::@4->main::@1#0] -- register_copy 
    // [1] phi main::i#2 = main::i#1 [phi:main::@4->main::@1#1] -- register_copy 
    jmp __b1
    // main::@3
  __b3:
    // [7] main::x#0 = main::i#2 + main::j#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z i
    // [8] SCREEN[idx#11] = main::x#0 -- pbuc1_derefidx_vbuyy=vbuaa 
    sta SCREEN,y
    // [9] idx#0 = ++ idx#11 -- vbuyy=_inc_vbuyy 
    iny
    // [10] sum::a#0 = main::i#2 -- vbuaa=vbuz1 
    lda.z i
    // [11] sum::b#0 = main::j#2
    // [12] call sum
    jsr sum
    // [13] sum::return#0 = sum::return#1
    jmp __b5
    // main::@5
  __b5:
    // [14] main::y#0 = sum::return#0
    // [15] SCREEN[idx#0] = main::y#0 -- pbuc1_derefidx_vbuyy=vbuaa 
    sta SCREEN,y
    // [16] idx#1 = ++ idx#0 -- vbuyy=_inc_vbuyy 
    iny
    // [17] main::j#1 = ++ main::j#2 -- vbuxx=_inc_vbuxx 
    inx
    // [4] phi from main::@5 to main::@2 [phi:main::@5->main::@2]
  __b2_from___b5:
    // [4] phi idx#11 = idx#1 [phi:main::@5->main::@2#0] -- register_copy 
    // [4] phi main::j#2 = main::j#1 [phi:main::@5->main::@2#1] -- register_copy 
    jmp __b2
}
  // sum
// __register(A) char sum(__register(A) char a, __register(X) char b)
sum: {
    // [18] sum::return#1 = sum::a#0 + sum::b#0 -- vbuaa=vbuaa_plus_vbuxx 
    stx.z $ff
    clc
    adc.z $ff
    jmp __breturn
    // sum::@return
  __breturn:
    // [19] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b2
Removing instruction jmp __b4
Removing instruction jmp __b5
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing instruction lda #0 with TYA
Removing instruction __b1_from_main:
Removing instruction __breturn:
Removing instruction __b4:
Removing instruction __b1_from___b4:
Removing instruction __b5:
Removing instruction __b2_from___b5:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Relabelling long label __b2_from___b1 to __b4
Succesful ASM optimization Pass5RelabelLongLabels

FINAL SYMBOL TABLE
__constant char * const SCREEN = (char *) 1024
char idx
char idx#0 // reg byte y 43.285714285714285
char idx#1 // reg byte y 101.0
char idx#11 // reg byte y 65.0
char idx#12 // reg byte y 11.0
void main()
char main::i
char main::i#1 // i zp[1]:2 22.0
char main::i#2 // i zp[1]:2 15.666666666666668
char main::j
char main::j#1 // reg byte x 202.0
char main::j#2 // reg byte x 42.08333333333333
char main::x
char main::x#0 // reg byte a 202.0
char main::y
char main::y#0 // reg byte a 202.0
char sum(char a , char b)
char sum::a
char sum::a#0 // reg byte a 551.0
char sum::b
char sum::b#0 // reg byte x 1102.0
char sum::return
char sum::return#0 // reg byte a 202.0
char sum::return#1 // reg byte a 367.33333333333337

zp[1]:2 [ main::i#2 main::i#1 ]
reg byte y [ idx#12 idx#11 idx#1 ]
reg byte x [ main::j#2 main::j#1 ]
reg byte a [ main::x#0 ]
reg byte y [ idx#0 ]
reg byte a [ sum::a#0 ]
reg byte x [ sum::b#0 ]
reg byte a [ sum::return#0 ]
reg byte a [ main::y#0 ]
reg byte a [ sum::return#1 ]


FINAL ASSEMBLER
Score: 4395

  // File Comments
// Test intermediate vars
  // Upstart
  // Commodore 64 PRG executable file
.file [name="intermediates-simple.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
  // Global Constants & labels
  .label SCREEN = $400
.segment Code
  // main
main: {
    .label i = 2
    // [1] phi from main to main::@1 [phi:main->main::@1]
    // [1] phi idx#12 = 0 [phi:main->main::@1#0] -- vbuyy=vbuc1 
    ldy #0
    // [1] phi main::i#2 = 0 [phi:main->main::@1#1] -- vbuz1=vbuc1 
    tya
    sta.z i
    // main::@1
  __b1:
    // for(char i=0;i<5;i++)
    // [2] if(main::i#2<5) goto main::@2 -- vbuz1_lt_vbuc1_then_la1 
    lda.z i
    cmp #5
    bcc __b4
    // main::@return
    // }
    // [3] return 
    rts
    // [4] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  __b4:
    // [4] phi idx#11 = idx#12 [phi:main::@1->main::@2#0] -- register_copy 
    // [4] phi main::j#2 = 0 [phi:main::@1->main::@2#1] -- vbuxx=vbuc1 
    ldx #0
    // main::@2
  __b2:
    // for(char j=0;j<5;j++)
    // [5] if(main::j#2<5) goto main::@3 -- vbuxx_lt_vbuc1_then_la1 
    cpx #5
    bcc __b3
    // main::@4
    // for(char i=0;i<5;i++)
    // [6] main::i#1 = ++ main::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [1] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
    // [1] phi idx#12 = idx#11 [phi:main::@4->main::@1#0] -- register_copy 
    // [1] phi main::i#2 = main::i#1 [phi:main::@4->main::@1#1] -- register_copy 
    jmp __b1
    // main::@3
  __b3:
    // char x = i+j
    // [7] main::x#0 = main::i#2 + main::j#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z i
    // SCREEN[idx++] = x
    // [8] SCREEN[idx#11] = main::x#0 -- pbuc1_derefidx_vbuyy=vbuaa 
    sta SCREEN,y
    // SCREEN[idx++] = x;
    // [9] idx#0 = ++ idx#11 -- vbuyy=_inc_vbuyy 
    iny
    // char y = sum(i,j)
    // [10] sum::a#0 = main::i#2 -- vbuaa=vbuz1 
    lda.z i
    // [11] sum::b#0 = main::j#2
    // [12] call sum
    jsr sum
    // [13] sum::return#0 = sum::return#1
    // main::@5
    // [14] main::y#0 = sum::return#0
    // SCREEN[idx++] = y
    // [15] SCREEN[idx#0] = main::y#0 -- pbuc1_derefidx_vbuyy=vbuaa 
    sta SCREEN,y
    // SCREEN[idx++] = y;
    // [16] idx#1 = ++ idx#0 -- vbuyy=_inc_vbuyy 
    iny
    // for(char j=0;j<5;j++)
    // [17] main::j#1 = ++ main::j#2 -- vbuxx=_inc_vbuxx 
    inx
    // [4] phi from main::@5 to main::@2 [phi:main::@5->main::@2]
    // [4] phi idx#11 = idx#1 [phi:main::@5->main::@2#0] -- register_copy 
    // [4] phi main::j#2 = main::j#1 [phi:main::@5->main::@2#1] -- register_copy 
    jmp __b2
}
  // sum
// __register(A) char sum(__register(A) char a, __register(X) char b)
sum: {
    // a+b
    // [18] sum::return#1 = sum::a#0 + sum::b#0 -- vbuaa=vbuaa_plus_vbuxx 
    stx.z $ff
    clc
    adc.z $ff
    // sum::@return
    // }
    // [19] return 
    rts
}
  // File Data

