Converting variable modified inside __stackcall procedure plus() to load/store i
Adding parameter assignment in __stackcall procedure plus::b = param(plus::b)
Adding parameter assignment in __stackcall procedure plus::a = param(plus::a)
Inlined call call __init
Eliminating unused variable with no statement main::$0
Eliminating unused variable with no statement main::$1
Calling convention __stackcall adding prepare/execute/finalize for main::w = call plus('0', main::v)
Calling convention STACK_CALL replacing param(plus::a) with stackidx(char,plus::OFFSET_STACK_A)
Calling convention STACK_CALL replacing param(plus::b) with stackidx(char,plus::OFFSET_STACK_B)
Calling convention STACK_CALL adding stack return stackidx(char,plus::OFFSET_STACK_RETURN_1) = plus::return
Calling convention STACK_CALL adding stack pull main::w = stackpull(char)
Calling convention STACK_CALL adding stack push stackpush(char) = '0'
Calling convention STACK_CALL adding stack push stackpush(char) = main::v

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start::@1
  main::a#0 = 0
  to:main::@1
main::@1: scope:[main]  from main main::@1
  main::a#2 = phi( main/main::a#0, main::@1/main::a#1 )
  main::v#0 = main::a#2 + 1
  stackpush(char) = '0'
  stackpush(char) = main::v#0
  callexecute plus 
  sideeffect stackpullbytes(1)
  main::w#0 = stackpull(char)
  main::$2 = main::w#0 + main::a#2
  SCREEN[i] = main::$2
  main::a#1 = main::a#2 + rangenext(0,1)
  main::$3 = main::a#1 != rangelast(0,1)
  if(main::$3) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@1
  return 
  to:@return

__stackcall char plus(char a , char b)
plus: scope:[plus]  from
  plus::a#0 = stackidx(char,plus::OFFSET_STACK_A)
  plus::b#0 = stackidx(char,plus::OFFSET_STACK_B)
  i = ++ i
  plus::$0 = plus::a#0 + plus::b#0
  plus::return#0 = plus::$0
  to:plus::@return
plus::@return: scope:[plus]  from plus
  plus::return#1 = phi( plus/plus::return#0 )
  stackidx(char,plus::OFFSET_STACK_RETURN_1) = plus::return#1
  return 
  to:@return

void __start()
__start: scope:[__start]  from
  to:__start::__init1
__start::__init1: scope:[__start]  from __start
  i = 0
  to:__start::@1
__start::@1: scope:[__start]  from __start::__init1
  call main
  to:__start::@2
__start::@2: scope:[__start]  from __start::@1
  to:__start::@return
__start::@return: scope:[__start]  from __start::@2
  return 
  to:@return

SYMBOL TABLE SSA
__constant char * const SCREEN = (char *)$400
__constant unsigned int STACK_BASE = $103
void __start()
__loadstore char i
void main()
char main::$2
bool main::$3
char main::a
char main::a#0
char main::a#1
char main::a#2
char main::v
char main::v#0
char main::w
char main::w#0
__stackcall char plus(char a , char b)
char plus::$0
__constant char plus::OFFSET_STACK_A = 1
__constant char plus::OFFSET_STACK_B = 0
__constant char plus::OFFSET_STACK_RETURN_1 = 1
char plus::a
char plus::a#0
char plus::b
char plus::b#0
char plus::return
char plus::return#0
char plus::return#1

Adding number conversion cast (unumber) 1 in main::v#0 = main::a#2 + 1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (char *) 1024
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias plus::return#0 = plus::$0 plus::return#1 
Successful SSA optimization Pass2AliasElimination
Simple Condition main::$3 [12] if(main::a#1!=rangelast(0,1)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant main::a#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [10] main::a#1 = ++ main::a#2 to ++
Resolved ranged comparison value [12] if(main::a#1!=rangelast(0,1)) goto main::@1 to 2
Adding number conversion cast (unumber) 2 in if(main::a#1!=2) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 2
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 2
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inlining constant with var siblings main::a#0
Constant inlined main::a#0 = 0
Successful SSA optimization Pass2ConstantInlining
Finalized unsigned number type (char) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Added new block during phi lifting main::@2(between main::@1 and main::@1)
Adding NOP phi() at start of __start
Adding NOP phi() at start of __start::@1
Adding NOP phi() at start of __start::@2
Adding NOP phi() at start of main
CALL GRAPH
Calls in [__start] to main:3 
Calls in [main] to plus:17 

Created 1 initial phi equivalence classes
Coalesced [25] main::a#3 = main::a#1
Coalesced down to 1 phi equivalence classes
Culled Empty Block label __start::@2
Culled Empty Block label main::@2
Adding NOP phi() at start of __start
Adding NOP phi() at start of __start::@1
Adding NOP phi() at start of main

FINAL CONTROL FLOW GRAPH

void __start()
__start: scope:[__start]  from
  [0] phi()
  to:__start::__init1
__start::__init1: scope:[__start]  from __start
  [1] i = 0
  to:__start::@1
__start::@1: scope:[__start]  from __start::__init1
  [2] phi()
  [3] call main
  to:__start::@return
__start::@return: scope:[__start]  from __start::@1
  [4] return 
  to:@return

__stackcall char plus(char a , char b)
plus: scope:[plus]  from
  [5] plus::a#0 = stackidx(char,plus::OFFSET_STACK_A)
  [6] plus::b#0 = stackidx(char,plus::OFFSET_STACK_B)
  [7] i = ++ i
  [8] plus::return#0 = plus::a#0 + plus::b#0
  to:plus::@return
plus::@return: scope:[plus]  from plus
  [9] stackidx(char,plus::OFFSET_STACK_RETURN_1) = plus::return#0
  [10] return 
  to:@return

void main()
main: scope:[main]  from __start::@1
  [11] phi()
  to:main::@1
main::@1: scope:[main]  from main main::@1
  [12] main::a#2 = phi( main/0, main::@1/main::a#1 )
  [13] main::v#0 = main::a#2 + 1
  [14] stackpush(char) = '0'
  [15] stackpush(char) = main::v#0
  [16] callexecute plus 
  sideeffect stackpullbytes(1)
  [18] main::w#0 = stackpull(char)
  [19] main::$2 = main::w#0 + main::a#2
  [20] SCREEN[i] = main::$2
  [21] main::a#1 = ++ main::a#2
  [22] if(main::a#1!=2) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@1
  [23] return 
  to:@return

null depth in calling loop Loop head: main::@1 tails: main::@1 blocks: main::@1  in scope plus

VARIABLE REGISTER WEIGHTS
void __start()
__loadstore char i // 105.24999999999999
void main()
char main::$2 // 202.0
char main::a
char main::a#1 // 151.5
char main::a#2 // 44.888888888888886
char main::v
char main::v#0 // 101.0
char main::w
char main::w#0 // 202.0
__stackcall char plus(char a , char b)
char plus::a
char plus::a#0 // 667.3333333333334
char plus::b
char plus::b#0 // 1001.0
char plus::return
char plus::return#0 // 2002.0

Initial phi equivalence classes
[ main::a#2 main::a#1 ]
Added variable i to live range equivalence class [ i ]
Added variable plus::a#0 to live range equivalence class [ plus::a#0 ]
Added variable plus::b#0 to live range equivalence class [ plus::b#0 ]
Added variable plus::return#0 to live range equivalence class [ plus::return#0 ]
Added variable main::v#0 to live range equivalence class [ main::v#0 ]
Added variable main::w#0 to live range equivalence class [ main::w#0 ]
Added variable main::$2 to live range equivalence class [ main::$2 ]
Complete equivalence classes
[ main::a#2 main::a#1 ]
[ i ]
[ plus::a#0 ]
[ plus::b#0 ]
[ plus::return#0 ]
[ main::v#0 ]
[ main::w#0 ]
[ main::$2 ]
Allocated zp[1]:2 [ plus::return#0 ]
Allocated zp[1]:3 [ plus::b#0 ]
Allocated zp[1]:4 [ plus::a#0 ]
Allocated zp[1]:5 [ main::w#0 ]
Allocated zp[1]:6 [ main::$2 ]
Allocated zp[1]:7 [ main::a#2 main::a#1 ]
Allocated zp[1]:8 [ i ]
Allocated zp[1]:9 [ main::v#0 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [1] i = 0 [ i ] (  [ i ] { }  ) always clobbers reg byte a 
Statement [5] plus::a#0 = stackidx(char,plus::OFFSET_STACK_A) [ i plus::a#0 ] ( main:3::plus:16 [ main::a#2 i plus::a#0 ] { }  ) always clobbers reg byte a reg byte x 
Removing always clobbered register reg byte a as potential for zp[1]:7 [ main::a#2 main::a#1 ]
Removing always clobbered register reg byte x as potential for zp[1]:7 [ main::a#2 main::a#1 ]
Statement [6] plus::b#0 = stackidx(char,plus::OFFSET_STACK_B) [ i plus::a#0 plus::b#0 ] ( main:3::plus:16 [ main::a#2 i plus::a#0 plus::b#0 ] { }  ) always clobbers reg byte a reg byte x 
Removing always clobbered register reg byte a as potential for zp[1]:4 [ plus::a#0 ]
Removing always clobbered register reg byte x as potential for zp[1]:4 [ plus::a#0 ]
Statement [8] plus::return#0 = plus::a#0 + plus::b#0 [ i plus::return#0 ] ( main:3::plus:16 [ main::a#2 i plus::return#0 ] { }  ) always clobbers reg byte a 
Statement [9] stackidx(char,plus::OFFSET_STACK_RETURN_1) = plus::return#0 [ i ] ( main:3::plus:16 [ main::a#2 i ] { }  ) always clobbers reg byte x 
Statement [14] stackpush(char) = '0' [ i main::a#2 main::v#0 ] ( main:3 [ i main::a#2 main::v#0 ] { }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:9 [ main::v#0 ]
Statement [15] stackpush(char) = main::v#0 [ i main::a#2 ] ( main:3 [ i main::a#2 ] { }  ) always clobbers reg byte a 
Statement sideeffect stackpullbytes(1) always clobbers reg byte a 
Statement [18] main::w#0 = stackpull(char) [ i main::a#2 main::w#0 ] ( main:3 [ i main::a#2 main::w#0 ] { }  ) always clobbers reg byte a 
Statement [19] main::$2 = main::w#0 + main::a#2 [ i main::a#2 main::$2 ] ( main:3 [ i main::a#2 main::$2 ] { }  ) always clobbers reg byte a 
Statement [20] SCREEN[i] = main::$2 [ i main::a#2 ] ( main:3 [ i main::a#2 ] { }  ) always clobbers reg byte y 
Removing always clobbered register reg byte y as potential for zp[1]:7 [ main::a#2 main::a#1 ]
Statement [22] if(main::a#1!=2) goto main::@1 [ i main::a#1 ] ( main:3 [ i main::a#1 ] { }  ) always clobbers reg byte a 
Statement [1] i = 0 [ i ] (  [ i ] { }  ) always clobbers reg byte a 
Statement [5] plus::a#0 = stackidx(char,plus::OFFSET_STACK_A) [ i plus::a#0 ] ( main:3::plus:16 [ main::a#2 i plus::a#0 ] { }  ) always clobbers reg byte a reg byte x 
Statement [6] plus::b#0 = stackidx(char,plus::OFFSET_STACK_B) [ i plus::a#0 plus::b#0 ] ( main:3::plus:16 [ main::a#2 i plus::a#0 plus::b#0 ] { }  ) always clobbers reg byte a reg byte x 
Statement [8] plus::return#0 = plus::a#0 + plus::b#0 [ i plus::return#0 ] ( main:3::plus:16 [ main::a#2 i plus::return#0 ] { }  ) always clobbers reg byte a 
Statement [9] stackidx(char,plus::OFFSET_STACK_RETURN_1) = plus::return#0 [ i ] ( main:3::plus:16 [ main::a#2 i ] { }  ) always clobbers reg byte x 
Statement [14] stackpush(char) = '0' [ i main::a#2 main::v#0 ] ( main:3 [ i main::a#2 main::v#0 ] { }  ) always clobbers reg byte a 
Statement [15] stackpush(char) = main::v#0 [ i main::a#2 ] ( main:3 [ i main::a#2 ] { }  ) always clobbers reg byte a 
Statement sideeffect stackpullbytes(1) always clobbers reg byte a 
Statement [18] main::w#0 = stackpull(char) [ i main::a#2 main::w#0 ] ( main:3 [ i main::a#2 main::w#0 ] { }  ) always clobbers reg byte a 
Statement [19] main::$2 = main::w#0 + main::a#2 [ i main::a#2 main::$2 ] ( main:3 [ i main::a#2 main::$2 ] { }  ) always clobbers reg byte a 
Statement [20] SCREEN[i] = main::$2 [ i main::a#2 ] ( main:3 [ i main::a#2 ] { }  ) always clobbers reg byte y 
Statement [22] if(main::a#1!=2) goto main::@1 [ i main::a#1 ] ( main:3 [ i main::a#1 ] { }  ) always clobbers reg byte a 
Potential registers zp[1]:7 [ main::a#2 main::a#1 ] : zp[1]:7 , 
Potential registers zp[1]:8 [ i ] : zp[1]:8 , 
Potential registers zp[1]:4 [ plus::a#0 ] : zp[1]:4 , reg byte y , 
Potential registers zp[1]:3 [ plus::b#0 ] : zp[1]:3 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:2 [ plus::return#0 ] : zp[1]:2 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:9 [ main::v#0 ] : zp[1]:9 , reg byte x , reg byte y , 
Potential registers zp[1]:5 [ main::w#0 ] : zp[1]:5 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:6 [ main::$2 ] : zp[1]:6 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [plus] 2,002: zp[1]:2 [ plus::return#0 ] 1,001: zp[1]:3 [ plus::b#0 ] 667.33: zp[1]:4 [ plus::a#0 ] 
Uplift Scope [main] 202: zp[1]:5 [ main::w#0 ] 202: zp[1]:6 [ main::$2 ] 196.39: zp[1]:7 [ main::a#2 main::a#1 ] 101: zp[1]:9 [ main::v#0 ] 
Uplift Scope [] 105.25: zp[1]:8 [ i ] 
Uplift Scope [__start] 

Uplifting [plus] best 945 combination reg byte a [ plus::return#0 ] reg byte a [ plus::b#0 ] zp[1]:4 [ plus::a#0 ] 
Uplifting [main] best 785 combination reg byte a [ main::w#0 ] reg byte a [ main::$2 ] zp[1]:7 [ main::a#2 main::a#1 ] reg byte x [ main::v#0 ] 
Uplifting [] best 785 combination zp[1]:8 [ i ] 
Uplifting [__start] best 785 combination 
Attempting to uplift remaining variables inzp[1]:4 [ plus::a#0 ]
Uplifting [plus] best 785 combination zp[1]:4 [ plus::a#0 ] 
Attempting to uplift remaining variables inzp[1]:7 [ main::a#2 main::a#1 ]
Uplifting [main] best 785 combination zp[1]:7 [ main::a#2 main::a#1 ] 
Attempting to uplift remaining variables inzp[1]:8 [ i ]
Uplifting [] best 785 combination zp[1]:8 [ i ] 
Allocated (was zp[1]:4) zp[1]:2 [ plus::a#0 ]
Allocated (was zp[1]:7) zp[1]:3 [ main::a#2 main::a#1 ]
Allocated (was zp[1]:8) zp[1]:4 [ i ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Test a procedure with calling convention stack
// A slightly more complex call
  // Upstart
  // Commodore 64 PRG executable file
.file [name="procedure-callingconvention-stack-4.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(__start)
  // Global Constants & labels
  .const STACK_BASE = $103
  .label SCREEN = $400
  .label i = 4
.segment Code
  // __start
__start: {
    jmp __init1
    // __start::__init1
  __init1:
    // [1] i = 0 -- vbuz1=vbuc1 
    lda #0
    sta.z i
    // [2] phi from __start::__init1 to __start::@1 [phi:__start::__init1->__start::@1]
  __b1_from___init1:
    jmp __b1
    // __start::@1
  __b1:
    // [3] call main
    // [11] phi from __start::@1 to main [phi:__start::@1->main]
  main_from___b1:
    jsr main
    jmp __breturn
    // __start::@return
  __breturn:
    // [4] return 
    rts
}
  // plus
// __register(A) char plus(__zp(2) char a, __register(A) char b)
plus: {
    .const OFFSET_STACK_A = 1
    .const OFFSET_STACK_B = 0
    .const OFFSET_STACK_RETURN_1 = 1
    .label a = 2
    // [5] plus::a#0 = stackidx(char,plus::OFFSET_STACK_A) -- vbuz1=_stackidxbyte_vbuc1 
    tsx
    lda STACK_BASE+OFFSET_STACK_A,x
    sta.z a
    // [6] plus::b#0 = stackidx(char,plus::OFFSET_STACK_B) -- vbuaa=_stackidxbyte_vbuc1 
    tsx
    lda STACK_BASE+OFFSET_STACK_B,x
    // [7] i = ++ i -- vbuz1=_inc_vbuz1 
    inc.z i
    // [8] plus::return#0 = plus::a#0 + plus::b#0 -- vbuaa=vbuz1_plus_vbuaa 
    clc
    adc.z a
    jmp __breturn
    // plus::@return
  __breturn:
    // [9] stackidx(char,plus::OFFSET_STACK_RETURN_1) = plus::return#0 -- _stackidxbyte_vbuc1=vbuaa 
    tsx
    sta STACK_BASE+OFFSET_STACK_RETURN_1,x
    // [10] return 
    rts
}
  // main
main: {
    .label a = 3
    // [12] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [12] phi main::a#2 = 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z a
    jmp __b1
    // [12] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
  __b1_from___b1:
    // [12] phi main::a#2 = main::a#1 [phi:main::@1->main::@1#0] -- register_copy 
    jmp __b1
    // main::@1
  __b1:
    // [13] main::v#0 = main::a#2 + 1 -- vbuxx=vbuz1_plus_1 
    ldx.z a
    inx
    // [14] stackpush(char) = '0' -- _stackpushbyte_=vbuc1 
    lda #'0'
    pha
    // [15] stackpush(char) = main::v#0 -- _stackpushbyte_=vbuxx 
    txa
    pha
    // [16] callexecute plus  -- call_vprc1 
    jsr plus
    // sideeffect stackpullbytes(1) -- _stackpullbyte_1 
    pla
    // [18] main::w#0 = stackpull(char) -- vbuaa=_stackpullbyte_ 
    pla
    // [19] main::$2 = main::w#0 + main::a#2 -- vbuaa=vbuaa_plus_vbuz1 
    clc
    adc.z a
    // [20] SCREEN[i] = main::$2 -- pbuc1_derefidx_vbuz1=vbuaa 
    ldy.z i
    sta SCREEN,y
    // [21] main::a#1 = ++ main::a#2 -- vbuz1=_inc_vbuz1 
    inc.z a
    // [22] if(main::a#1!=2) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #2
    cmp.z a
    bne __b1_from___b1
    jmp __breturn
    // main::@return
  __breturn:
    // [23] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __init1
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __b1_from___b1 with __b1
Removing instruction __b1_from___init1:
Removing instruction main_from___b1:
Removing instruction __b1_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __init1:
Removing instruction __b1:
Removing instruction __breturn:
Removing instruction __breturn:
Removing instruction __b1_from_main:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination

FINAL SYMBOL TABLE
__constant char * const SCREEN = (char *) 1024
__constant unsigned int STACK_BASE = $103
void __start()
__loadstore char i // zp[1]:4 105.24999999999999
void main()
char main::$2 // reg byte a 202.0
char main::a
char main::a#1 // a zp[1]:3 151.5
char main::a#2 // a zp[1]:3 44.888888888888886
char main::v
char main::v#0 // reg byte x 101.0
char main::w
char main::w#0 // reg byte a 202.0
__stackcall char plus(char a , char b)
__constant char plus::OFFSET_STACK_A = 1
__constant char plus::OFFSET_STACK_B = 0
__constant char plus::OFFSET_STACK_RETURN_1 = 1
char plus::a
char plus::a#0 // a zp[1]:2 667.3333333333334
char plus::b
char plus::b#0 // reg byte a 1001.0
char plus::return
char plus::return#0 // reg byte a 2002.0

zp[1]:3 [ main::a#2 main::a#1 ]
zp[1]:4 [ i ]
zp[1]:2 [ plus::a#0 ]
reg byte a [ plus::b#0 ]
reg byte a [ plus::return#0 ]
reg byte x [ main::v#0 ]
reg byte a [ main::w#0 ]
reg byte a [ main::$2 ]


FINAL ASSEMBLER
Score: 656

  // File Comments
// Test a procedure with calling convention stack
// A slightly more complex call
  // Upstart
  // Commodore 64 PRG executable file
.file [name="procedure-callingconvention-stack-4.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(__start)
  // Global Constants & labels
  .const STACK_BASE = $103
  .label SCREEN = $400
  .label i = 4
.segment Code
  // __start
__start: {
    // __start::__init1
    // char i = 0
    // [1] i = 0 -- vbuz1=vbuc1 
    lda #0
    sta.z i
    // [2] phi from __start::__init1 to __start::@1 [phi:__start::__init1->__start::@1]
    // __start::@1
    // [3] call main
    // [11] phi from __start::@1 to main [phi:__start::@1->main]
    jsr main
    // __start::@return
    // [4] return 
    rts
}
  // plus
// __register(A) char plus(__zp(2) char a, __register(A) char b)
plus: {
    .const OFFSET_STACK_A = 1
    .const OFFSET_STACK_B = 0
    .const OFFSET_STACK_RETURN_1 = 1
    .label a = 2
    // [5] plus::a#0 = stackidx(char,plus::OFFSET_STACK_A) -- vbuz1=_stackidxbyte_vbuc1 
    tsx
    lda STACK_BASE+OFFSET_STACK_A,x
    sta.z a
    // [6] plus::b#0 = stackidx(char,plus::OFFSET_STACK_B) -- vbuaa=_stackidxbyte_vbuc1 
    tsx
    lda STACK_BASE+OFFSET_STACK_B,x
    // i++;
    // [7] i = ++ i -- vbuz1=_inc_vbuz1 
    inc.z i
    // return a+b;
    // [8] plus::return#0 = plus::a#0 + plus::b#0 -- vbuaa=vbuz1_plus_vbuaa 
    clc
    adc.z a
    // plus::@return
    // }
    // [9] stackidx(char,plus::OFFSET_STACK_RETURN_1) = plus::return#0 -- _stackidxbyte_vbuc1=vbuaa 
    tsx
    sta STACK_BASE+OFFSET_STACK_RETURN_1,x
    // [10] return 
    rts
}
  // main
main: {
    .label a = 3
    // [12] phi from main to main::@1 [phi:main->main::@1]
    // [12] phi main::a#2 = 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z a
    // [12] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
    // [12] phi main::a#2 = main::a#1 [phi:main::@1->main::@1#0] -- register_copy 
    // main::@1
  __b1:
    // char v = a+1
    // [13] main::v#0 = main::a#2 + 1 -- vbuxx=vbuz1_plus_1 
    ldx.z a
    inx
    // char w = plus('0', v)
    // [14] stackpush(char) = '0' -- _stackpushbyte_=vbuc1 
    lda #'0'
    pha
    // [15] stackpush(char) = main::v#0 -- _stackpushbyte_=vbuxx 
    txa
    pha
    // [16] callexecute plus  -- call_vprc1 
    jsr plus
    // sideeffect stackpullbytes(1) -- _stackpullbyte_1 
    pla
    // [18] main::w#0 = stackpull(char) -- vbuaa=_stackpullbyte_ 
    pla
    // w+a
    // [19] main::$2 = main::w#0 + main::a#2 -- vbuaa=vbuaa_plus_vbuz1 
    clc
    adc.z a
    // SCREEN[i] = w+a
    // [20] SCREEN[i] = main::$2 -- pbuc1_derefidx_vbuz1=vbuaa 
    ldy.z i
    sta SCREEN,y
    // for(char a:0..1)
    // [21] main::a#1 = ++ main::a#2 -- vbuz1=_inc_vbuz1 
    inc.z a
    // [22] if(main::a#1!=2) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #2
    cmp.z a
    bne __b1
    // main::@return
    // }
    // [23] return 
    rts
}
  // File Data

