PARSING src/test/java/dk/camelot64/kickc/test/kc/print-problem.kc
byte* SCREEN= $400;
byte line = $40;
byte char = line;

void main() {
    ln();
    char++;
    ln();
    char++;
    ln();
    *SCREEN = char;
}

void ln() {
    line = line + $2;
    char = line;
}






Adding pre/post-modifier (byte) char ← ++ (byte) char
Adding pre/post-modifier (byte) char ← ++ (byte) char

STATEMENTS
  (byte*) SCREEN ← (word/signed word/dword/signed dword) 1024
  (byte) line ← (byte/signed byte/word/signed word/dword/signed dword) 64
  (byte) char ← (byte) line
proc (void()) main()
  (void~) main::$0 ← call ln 
  (byte) char ← ++ (byte) char
  (void~) main::$1 ← call ln 
  (byte) char ← ++ (byte) char
  (void~) main::$2 ← call ln 
  *((byte*) SCREEN) ← (byte) char
main::@return:
  return 
endproc // main()
proc (void()) ln()
  (byte/word~) ln::$0 ← (byte) line + (byte/signed byte/word/signed word/dword/signed dword) 2
  (byte) line ← (byte/word~) ln::$0
  (byte) char ← (byte) line
ln::@return:
  return 
endproc // ln()
  call main 

SYMBOLS
(byte*) SCREEN
(byte) char
(byte) line
(void()) ln()
(byte/word~) ln::$0
(label) ln::@return
(void()) main()
(void~) main::$0
(void~) main::$1
(void~) main::$2
(label) main::@return

Promoting word/signed word/dword/signed dword to byte* in SCREEN ← ((byte*)) 1024
INITIAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  (byte*) SCREEN ← ((byte*)) (word/signed word/dword/signed dword) 1024
  (byte) line ← (byte/signed byte/word/signed word/dword/signed dword) 64
  (byte) char ← (byte) line
  to:@1
main: scope:[main]  from
  (void~) main::$0 ← call ln 
  (byte) char ← ++ (byte) char
  (void~) main::$1 ← call ln 
  (byte) char ← ++ (byte) char
  (void~) main::$2 ← call ln 
  *((byte*) SCREEN) ← (byte) char
  to:main::@return
main::@return: scope:[main]  from main
  return 
  to:@return
@1: scope:[]  from @begin
  to:@2
ln: scope:[ln]  from
  (byte/word~) ln::$0 ← (byte) line + (byte/signed byte/word/signed word/dword/signed dword) 2
  (byte) line ← (byte/word~) ln::$0
  (byte) char ← (byte) line
  to:ln::@return
ln::@return: scope:[ln]  from ln
  return 
  to:@return
@2: scope:[]  from @1
  call main 
  to:@end
@end: scope:[]  from @2

Eliminating unused variable - keeping the call (void~) main::$0
Eliminating unused variable - keeping the call (void~) main::$1
Eliminating unused variable - keeping the call (void~) main::$2
Removing empty block @1
PROCEDURE MODIFY VARIABLE ANALYSIS
main modifies line
main modifies char
ln modifies line
ln modifies char

Completing Phi functions...
Completing Phi functions...
Completing Phi functions...
Completing Phi functions...
Completing Phi functions...

CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
@begin: scope:[]  from
  (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
  (byte) line#0 ← (byte/signed byte/word/signed word/dword/signed dword) 64
  (byte) char#0 ← (byte) line#0
  to:@2
main: scope:[main]  from @2
  (byte*) SCREEN#4 ← phi( @2/(byte*) SCREEN#5 )
  (byte) char#16 ← phi( @2/(byte) char#17 )
  (byte) line#15 ← phi( @2/(byte) line#16 )
  call ln param-assignment
  to:main::@1
main::@1: scope:[main]  from main
  (byte*) SCREEN#3 ← phi( main/(byte*) SCREEN#4 )
  (byte) char#10 ← phi( main/(byte) char#8 )
  (byte) line#8 ← phi( main/(byte) line#6 )
  (byte) line#1 ← (byte) line#8
  (byte) char#1 ← (byte) char#10
  (byte) char#2 ← ++ (byte) char#1
  call ln param-assignment
  to:main::@2
main::@2: scope:[main]  from main::@1
  (byte*) SCREEN#2 ← phi( main::@1/(byte*) SCREEN#3 )
  (byte) char#11 ← phi( main::@1/(byte) char#8 )
  (byte) line#9 ← phi( main::@1/(byte) line#6 )
  (byte) line#2 ← (byte) line#9
  (byte) char#3 ← (byte) char#11
  (byte) char#4 ← ++ (byte) char#3
  call ln param-assignment
  to:main::@3
main::@3: scope:[main]  from main::@2
  (byte*) SCREEN#1 ← phi( main::@2/(byte*) SCREEN#2 )
  (byte) char#12 ← phi( main::@2/(byte) char#8 )
  (byte) line#10 ← phi( main::@2/(byte) line#6 )
  (byte) line#3 ← (byte) line#10
  (byte) char#5 ← (byte) char#12
  *((byte*) SCREEN#1) ← (byte) char#5
  to:main::@return
main::@return: scope:[main]  from main::@3
  (byte) char#13 ← phi( main::@3/(byte) char#5 )
  (byte) line#11 ← phi( main::@3/(byte) line#3 )
  (byte) line#4 ← (byte) line#11
  (byte) char#6 ← (byte) char#13
  return 
  to:@return
ln: scope:[ln]  from main main::@1 main::@2
  (byte) line#12 ← phi( main/(byte) line#15 main::@1/(byte) line#1 main::@2/(byte) line#2 )
  (byte/word~) ln::$0 ← (byte) line#12 + (byte/signed byte/word/signed word/dword/signed dword) 2
  (byte) line#5 ← (byte/word~) ln::$0
  (byte) char#7 ← (byte) line#5
  to:ln::@return
ln::@return: scope:[ln]  from ln
  (byte) char#14 ← phi( ln/(byte) char#7 )
  (byte) line#13 ← phi( ln/(byte) line#5 )
  (byte) line#6 ← (byte) line#13
  (byte) char#8 ← (byte) char#14
  return 
  to:@return
@2: scope:[]  from @begin
  (byte*) SCREEN#5 ← phi( @begin/(byte*) SCREEN#0 )
  (byte) char#17 ← phi( @begin/(byte) char#0 )
  (byte) line#16 ← phi( @begin/(byte) line#0 )
  call main param-assignment
  to:@3
@3: scope:[]  from @2
  (byte) char#15 ← phi( @2/(byte) char#6 )
  (byte) line#14 ← phi( @2/(byte) line#4 )
  (byte) line#7 ← (byte) line#14
  (byte) char#9 ← (byte) char#15
  to:@end
@end: scope:[]  from @3

SYMBOL TABLE SSA
(label) @2
(label) @3
(label) @begin
(label) @end
(byte*) SCREEN
(byte*) SCREEN#0
(byte*) SCREEN#1
(byte*) SCREEN#2
(byte*) SCREEN#3
(byte*) SCREEN#4
(byte*) SCREEN#5
(byte) char
(byte) char#0
(byte) char#1
(byte) char#10
(byte) char#11
(byte) char#12
(byte) char#13
(byte) char#14
(byte) char#15
(byte) char#16
(byte) char#17
(byte) char#2
(byte) char#3
(byte) char#4
(byte) char#5
(byte) char#6
(byte) char#7
(byte) char#8
(byte) char#9
(byte) line
(byte) line#0
(byte) line#1
(byte) line#10
(byte) line#11
(byte) line#12
(byte) line#13
(byte) line#14
(byte) line#15
(byte) line#16
(byte) line#2
(byte) line#3
(byte) line#4
(byte) line#5
(byte) line#6
(byte) line#7
(byte) line#8
(byte) line#9
(void()) ln()
(byte/word~) ln::$0
(label) ln::@return
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return

OPTIMIZING CONTROL FLOW GRAPH
Not aliassing across scopes: line#15 line#16
Not aliassing across scopes: char#16 char#17
Not aliassing across scopes: SCREEN#4 SCREEN#5
Not aliassing across scopes: line#8 line#6
Not aliassing across scopes: char#10 char#8
Not aliassing across scopes: line#9 line#6
Not aliassing across scopes: char#11 char#8
Not aliassing across scopes: line#10 line#6
Not aliassing across scopes: char#12 char#8
Not aliassing across scopes: line#12 line#15
Not aliassing across scopes: line#14 line#4
Not aliassing across scopes: char#15 char#6
Alias (byte) line#0 = (byte) char#0 (byte) line#16 (byte) char#17 
Alias (byte*) SCREEN#1 = (byte*) SCREEN#3 (byte*) SCREEN#4 (byte*) SCREEN#2 
Alias (byte) line#1 = (byte) line#8 
Alias (byte) char#1 = (byte) char#10 
Alias (byte) line#2 = (byte) line#9 
Alias (byte) char#11 = (byte) char#3 
Alias (byte) line#10 = (byte) line#3 (byte) line#11 (byte) line#4 
Alias (byte) char#12 = (byte) char#5 (byte) char#13 (byte) char#6 
Alias (byte) line#13 = (byte) line#5 (byte/word~) ln::$0 (byte) char#7 (byte) char#14 (byte) line#6 (byte) char#8 
Alias (byte*) SCREEN#0 = (byte*) SCREEN#5 
Alias (byte) line#14 = (byte) line#7 
Alias (byte) char#15 = (byte) char#9 
Succesful SSA optimization Pass2AliasElimination
Not aliassing across scopes: line#15 line#0
Not aliassing across scopes: char#16 line#0
Not aliassing across scopes: SCREEN#1 SCREEN#0
Not aliassing across scopes: line#1 line#13
Not aliassing across scopes: char#1 line#13
Not aliassing across scopes: line#2 line#13
Not aliassing across scopes: char#11 line#13
Not aliassing across scopes: line#10 line#13
Not aliassing across scopes: char#12 line#13
Not aliassing across scopes: line#12 line#15
Not aliassing across scopes: line#14 line#10
Not aliassing across scopes: char#15 char#12
Redundant Phi (byte) line#15 (byte) line#0
Redundant Phi (byte) char#16 (byte) line#0
Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0
Redundant Phi (byte) line#1 (byte) line#13
Redundant Phi (byte) char#1 (byte) line#13
Redundant Phi (byte) line#2 (byte) line#13
Redundant Phi (byte) char#11 (byte) line#13
Redundant Phi (byte) line#10 (byte) line#13
Redundant Phi (byte) char#12 (byte) line#13
Redundant Phi (byte) line#14 (byte) line#10
Redundant Phi (byte) char#15 (byte) char#12
Succesful SSA optimization Pass2RedundantPhiElimination
Constant (const byte*) SCREEN#0 = ((byte*))1024
Constant (const byte) line#0 = 64
Succesful SSA optimization Pass2ConstantIdentification
Eliminating unused variable (byte) char#2 and assignment [1] (byte) char#2 ← ++ (byte) line#13
Eliminating unused variable (byte) char#4 and assignment [3] (byte) char#4 ← ++ (byte) line#13
Succesful SSA optimization PassNEliminateUnusedVars
Culled Empty Block (label) @3
Succesful SSA optimization Pass2CullEmptyBlocks
OPTIMIZING CONTROL FLOW GRAPH
Inlining constant with var siblings (const byte) line#0
Inlining constant with var siblings (const byte) line#0
Constant inlined line#0 = (byte/signed byte/word/signed word/dword/signed dword) 64
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @2 @end main main::@1 main::@2 main::@3 main::@return ln ln::@return 
Block Sequence Planned @begin @2 @end main main::@1 main::@2 main::@3 main::@return ln ln::@return 
Adding NOP phi() at start of @begin
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 
Calls in [main] to ln:5 ln:7 ln:9 

Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Created 1 initial phi equivalence classes
Coalesced [6] line#17 ← line#13
Coalesced (already) [8] line#18 ← line#13
Coalesced down to 1 phi equivalence classes
Block Sequence Planned @begin @2 @end main main::@1 main::@2 main::@3 main::@return ln ln::@return 
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@2
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi() [ ] ( )
  to:@2
@2: scope:[]  from @begin
  [1] phi() [ ] ( )
  [2] call main param-assignment [ ] ( )
  to:@end
@end: scope:[]  from @2
  [3] phi() [ ] ( )
main: scope:[main]  from @2
  [4] phi() [ ] ( main:2 [ ] )
  [5] call ln param-assignment [ line#13 ] ( main:2 [ line#13 ] )
  to:main::@1
main::@1: scope:[main]  from main
  [6] phi() [ line#13 ] ( main:2 [ line#13 ] )
  [7] call ln param-assignment [ line#13 ] ( main:2 [ line#13 ] )
  to:main::@2
main::@2: scope:[main]  from main::@1
  [8] phi() [ line#13 ] ( main:2 [ line#13 ] )
  [9] call ln param-assignment [ line#13 ] ( main:2 [ line#13 ] )
  to:main::@3
main::@3: scope:[main]  from main::@2
  [10] *((const byte*) SCREEN#0) ← (byte) line#13 [ ] ( main:2 [ ] )
  to:main::@return
main::@return: scope:[main]  from main::@3
  [11] return  [ ] ( main:2 [ ] )
  to:@return
ln: scope:[ln]  from main main::@1 main::@2
  [12] (byte) line#12 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 64 main::@1/(byte) line#13 main::@2/(byte) line#13 ) [ line#12 ] ( main:2::ln:5 [ line#12 ] main:2::ln:7 [ line#12 ] main:2::ln:9 [ line#12 ] )
  [13] (byte) line#13 ← (byte) line#12 + (byte/signed byte/word/signed word/dword/signed dword) 2 [ line#13 ] ( main:2::ln:5 [ line#13 ] main:2::ln:7 [ line#13 ] main:2::ln:9 [ line#13 ] )
  to:ln::@return
ln::@return: scope:[ln]  from ln
  [14] return  [ line#13 ] ( main:2::ln:5 [ line#13 ] main:2::ln:7 [ line#13 ] main:2::ln:9 [ line#13 ] )
  to:@return

DOMINATORS
@begin dominated by  @begin 
@2 dominated by  @2 @begin 
@end dominated by  @2 @begin @end 
main dominated by  @2 @begin main 
main::@1 dominated by  @2 @begin main::@1 main 
main::@2 dominated by  @2 @begin main::@1 main::@2 main 
main::@3 dominated by  @2 @begin main::@1 main::@2 main main::@3 
main::@return dominated by  main::@return @2 @begin main::@1 main::@2 main main::@3 
ln dominated by  @2 ln @begin main 
ln::@return dominated by  @2 ln ln::@return @begin main 

NATURAL LOOPS

NATURAL LOOPS WITH DEPTH
Found 0 loops in scope []
Found 0 loops in scope [main]
Found 0 loops in scope [ln]


VARIABLE REGISTER WEIGHTS
(byte*) SCREEN
(byte) char
(byte) line
(byte) line#12 6.0
(byte) line#13 1.1428571428571428
(void()) ln()
(void()) main()

Initial phi equivalence classes
[ line#12 line#13 ]
Complete equivalence classes
[ line#12 line#13 ]
Allocated zp ZP_BYTE:2 [ line#12 line#13 ]

INITIAL ASM
//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
  .label SCREEN = $400
  .label line = 2
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
  jmp b2
//SEG4 @2
b2:
//SEG5 [2] call main param-assignment [ ] ( )
//SEG6 [4] phi from @2 to main [phi:@2->main]
main_from_b2:
  jsr main
//SEG7 [3] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
  jmp bend
//SEG8 @end
bend:
//SEG9 main
main: {
  //SEG10 [5] call ln param-assignment [ line#13 ] ( main:2 [ line#13 ] )
  //SEG11 [12] phi from main to ln [phi:main->ln]
  ln_from_main:
  //SEG12 [12] phi (byte) line#12 = (byte/signed byte/word/signed word/dword/signed dword) 64 [phi:main->ln#0] -- vbuz1=vbuc1 
    lda #$40
    sta line
    jsr ln
  //SEG13 [6] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    jmp b1
  //SEG14 main::@1
  b1:
  //SEG15 [7] call ln param-assignment [ line#13 ] ( main:2 [ line#13 ] )
  //SEG16 [12] phi from main::@1 to ln [phi:main::@1->ln]
  ln_from_b1:
  //SEG17 [12] phi (byte) line#12 = (byte) line#13 [phi:main::@1->ln#0] -- register_copy 
    jsr ln
  //SEG18 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  b2_from_b1:
    jmp b2
  //SEG19 main::@2
  b2:
  //SEG20 [9] call ln param-assignment [ line#13 ] ( main:2 [ line#13 ] )
  //SEG21 [12] phi from main::@2 to ln [phi:main::@2->ln]
  ln_from_b2:
  //SEG22 [12] phi (byte) line#12 = (byte) line#13 [phi:main::@2->ln#0] -- register_copy 
    jsr ln
    jmp b3
  //SEG23 main::@3
  b3:
  //SEG24 [10] *((const byte*) SCREEN#0) ← (byte) line#13 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuz1 
    lda line
    sta SCREEN
    jmp breturn
  //SEG25 main::@return
  breturn:
  //SEG26 [11] return  [ ] ( main:2 [ ] )
    rts
}
//SEG27 ln
ln: {
  //SEG28 [13] (byte) line#13 ← (byte) line#12 + (byte/signed byte/word/signed word/dword/signed dword) 2 [ line#13 ] ( main:2::ln:5 [ line#13 ] main:2::ln:7 [ line#13 ] main:2::ln:9 [ line#13 ] ) -- vbuz1=vbuz1_plus_vbuc1 
    lda #2
    clc
    adc line
    sta line
    jmp breturn
  //SEG29 ln::@return
  breturn:
  //SEG30 [14] return  [ line#13 ] ( main:2::ln:5 [ line#13 ] main:2::ln:7 [ line#13 ] main:2::ln:9 [ line#13 ] )
    rts
}

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [13] (byte) line#13 ← (byte) line#12 + (byte/signed byte/word/signed word/dword/signed dword) 2 [ line#13 ] ( main:2::ln:5 [ line#13 ] main:2::ln:7 [ line#13 ] main:2::ln:9 [ line#13 ] ) always clobbers reg byte a 
Potential registers zp ZP_BYTE:2 [ line#12 line#13 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [] 7.14: zp ZP_BYTE:2 [ line#12 line#13 ] 
Uplift Scope [main] 
Uplift Scope [ln] 

Uplifting [] best 67 combination reg byte a [ line#12 line#13 ] 
Uplifting [main] best 67 combination 
Uplifting [ln] best 67 combination 

ASSEMBLER BEFORE OPTIMIZATION
//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
  .label SCREEN = $400
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
  jmp b2
//SEG4 @2
b2:
//SEG5 [2] call main param-assignment [ ] ( )
//SEG6 [4] phi from @2 to main [phi:@2->main]
main_from_b2:
  jsr main
//SEG7 [3] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
  jmp bend
//SEG8 @end
bend:
//SEG9 main
main: {
  //SEG10 [5] call ln param-assignment [ line#13 ] ( main:2 [ line#13 ] )
  //SEG11 [12] phi from main to ln [phi:main->ln]
  ln_from_main:
  //SEG12 [12] phi (byte) line#12 = (byte/signed byte/word/signed word/dword/signed dword) 64 [phi:main->ln#0] -- vbuaa=vbuc1 
    lda #$40
    jsr ln
  //SEG13 [6] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    jmp b1
  //SEG14 main::@1
  b1:
  //SEG15 [7] call ln param-assignment [ line#13 ] ( main:2 [ line#13 ] )
  //SEG16 [12] phi from main::@1 to ln [phi:main::@1->ln]
  ln_from_b1:
  //SEG17 [12] phi (byte) line#12 = (byte) line#13 [phi:main::@1->ln#0] -- register_copy 
    jsr ln
  //SEG18 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  b2_from_b1:
    jmp b2
  //SEG19 main::@2
  b2:
  //SEG20 [9] call ln param-assignment [ line#13 ] ( main:2 [ line#13 ] )
  //SEG21 [12] phi from main::@2 to ln [phi:main::@2->ln]
  ln_from_b2:
  //SEG22 [12] phi (byte) line#12 = (byte) line#13 [phi:main::@2->ln#0] -- register_copy 
    jsr ln
    jmp b3
  //SEG23 main::@3
  b3:
  //SEG24 [10] *((const byte*) SCREEN#0) ← (byte) line#13 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuaa 
    sta SCREEN
    jmp breturn
  //SEG25 main::@return
  breturn:
  //SEG26 [11] return  [ ] ( main:2 [ ] )
    rts
}
//SEG27 ln
ln: {
  //SEG28 [13] (byte) line#13 ← (byte) line#12 + (byte/signed byte/word/signed word/dword/signed dword) 2 [ line#13 ] ( main:2::ln:5 [ line#13 ] main:2::ln:7 [ line#13 ] main:2::ln:9 [ line#13 ] ) -- vbuaa=vbuaa_plus_vbuc1 
    clc
    adc #2
    jmp breturn
  //SEG29 ln::@return
  breturn:
  //SEG30 [14] return  [ line#13 ] ( main:2::ln:5 [ line#13 ] main:2::ln:7 [ line#13 ] main:2::ln:9 [ line#13 ] )
    rts
}

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b2
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp breturn
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Removing instruction b2_from_bbegin:
Removing instruction main_from_b2:
Removing instruction bend_from_b2:
Removing instruction b1_from_main:
Removing instruction ln_from_b1:
Removing instruction b2_from_b1:
Removing instruction ln_from_b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b2:
Removing instruction bend:
Removing instruction ln_from_main:
Removing instruction b1:
Removing instruction b2:
Removing instruction b3:
Removing instruction breturn:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @2
(label) @begin
(label) @end
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024
(byte) char
(byte) line
(byte) line#12 reg byte a 6.0
(byte) line#13 reg byte a 1.1428571428571428
(void()) ln()
(label) ln::@return
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return

reg byte a [ line#12 line#13 ]


FINAL ASSEMBLER
Score: 46

//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
  .label SCREEN = $400
//SEG2 @begin
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
//SEG4 @2
//SEG5 [2] call main param-assignment [ ] ( )
//SEG6 [4] phi from @2 to main [phi:@2->main]
  jsr main
//SEG7 [3] phi from @2 to @end [phi:@2->@end]
//SEG8 @end
//SEG9 main
main: {
  //SEG10 [5] call ln param-assignment [ line#13 ] ( main:2 [ line#13 ] )
  //SEG11 [12] phi from main to ln [phi:main->ln]
  //SEG12 [12] phi (byte) line#12 = (byte/signed byte/word/signed word/dword/signed dword) 64 [phi:main->ln#0] -- vbuaa=vbuc1 
    lda #$40
    jsr ln
  //SEG13 [6] phi from main to main::@1 [phi:main->main::@1]
  //SEG14 main::@1
  //SEG15 [7] call ln param-assignment [ line#13 ] ( main:2 [ line#13 ] )
  //SEG16 [12] phi from main::@1 to ln [phi:main::@1->ln]
  //SEG17 [12] phi (byte) line#12 = (byte) line#13 [phi:main::@1->ln#0] -- register_copy 
    jsr ln
  //SEG18 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  //SEG19 main::@2
  //SEG20 [9] call ln param-assignment [ line#13 ] ( main:2 [ line#13 ] )
  //SEG21 [12] phi from main::@2 to ln [phi:main::@2->ln]
  //SEG22 [12] phi (byte) line#12 = (byte) line#13 [phi:main::@2->ln#0] -- register_copy 
    jsr ln
  //SEG23 main::@3
  //SEG24 [10] *((const byte*) SCREEN#0) ← (byte) line#13 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuaa 
    sta SCREEN
  //SEG25 main::@return
  //SEG26 [11] return  [ ] ( main:2 [ ] )
    rts
}
//SEG27 ln
ln: {
  //SEG28 [13] (byte) line#13 ← (byte) line#12 + (byte/signed byte/word/signed word/dword/signed dword) 2 [ line#13 ] ( main:2::ln:5 [ line#13 ] main:2::ln:7 [ line#13 ] main:2::ln:9 [ line#13 ] ) -- vbuaa=vbuaa_plus_vbuc1 
    clc
    adc #2
  //SEG29 ln::@return
  //SEG30 [14] return  [ line#13 ] ( main:2::ln:5 [ line#13 ] main:2::ln:7 [ line#13 ] main:2::ln:9 [ line#13 ] )
    rts
}

