PARSING src/test/java/dk/camelot64/kickc/test/kc/overlap-allocation-2.kc
// Two levels of functions to test that register allocation handles live ranges and call-ranges optimally to allocate the fewest possible ZP-variables
byte* SCREEN = $0400;

void main() {
    for(byte i : 0..8) {
       line(i);
    }
   for(byte j : 10..18) {
       line(j);
    }
}

void line(byte l) {
    plot(l);
    plot(l+20);
}

void plot(byte x) {
    SCREEN[x] = '*';
}


STATEMENTS
  (byte*) SCREEN ← (word/signed word/dword/signed dword) 1024
proc (void()) main()
  (byte) main::i ← (byte/signed byte/word/signed word/dword/signed dword) 0
main::@1:
  (void~) main::$0 ← call line (byte) main::i 
  (byte) main::i ← ++ (byte) main::i
  (boolean~) main::$1 ← (byte) main::i != (byte/signed byte/word/signed word/dword/signed dword) 9
  if((boolean~) main::$1) goto main::@1
  (byte) main::j ← (byte/signed byte/word/signed word/dword/signed dword) 10
main::@2:
  (void~) main::$2 ← call line (byte) main::j 
  (byte) main::j ← ++ (byte) main::j
  (boolean~) main::$3 ← (byte) main::j != (byte/signed byte/word/signed word/dword/signed dword) 19
  if((boolean~) main::$3) goto main::@2
main::@return:
  return 
endproc // main()
proc (void()) line((byte) line::l)
  (void~) line::$0 ← call plot (byte) line::l 
  (byte/word~) line::$1 ← (byte) line::l + (byte/signed byte/word/signed word/dword/signed dword) 20
  (void~) line::$2 ← call plot (byte/word~) line::$1 
line::@return:
  return 
endproc // line()
proc (void()) plot((byte) plot::x)
  *((byte*) SCREEN + (byte) plot::x) ← (byte) '*'
plot::@return:
  return 
endproc // plot()
  call main 

SYMBOLS
(byte*) SCREEN
(void()) line((byte) line::l)
(void~) line::$0
(byte/word~) line::$1
(void~) line::$2
(label) line::@return
(byte) line::l
(void()) main()
(void~) main::$0
(boolean~) main::$1
(void~) main::$2
(boolean~) main::$3
(label) main::@1
(label) main::@2
(label) main::@return
(byte) main::i
(byte) main::j
(void()) plot((byte) plot::x)
(label) plot::@return
(byte) plot::x

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
  to:@1
main: scope:[main]  from
  (byte) main::i ← (byte/signed byte/word/signed word/dword/signed dword) 0
  to:main::@1
main::@1: scope:[main]  from main main::@1
  (void~) main::$0 ← call line (byte) main::i 
  (byte) main::i ← ++ (byte) main::i
  (boolean~) main::$1 ← (byte) main::i != (byte/signed byte/word/signed word/dword/signed dword) 9
  if((boolean~) main::$1) goto main::@1
  to:main::@3
main::@3: scope:[main]  from main::@1
  (byte) main::j ← (byte/signed byte/word/signed word/dword/signed dword) 10
  to:main::@2
main::@2: scope:[main]  from main::@2 main::@3
  (void~) main::$2 ← call line (byte) main::j 
  (byte) main::j ← ++ (byte) main::j
  (boolean~) main::$3 ← (byte) main::j != (byte/signed byte/word/signed word/dword/signed dword) 19
  if((boolean~) main::$3) goto main::@2
  to:main::@4
main::@4: scope:[main]  from main::@2
  to:main::@return
main::@return: scope:[main]  from main::@4
  return 
  to:@return
@1: scope:[]  from @begin
  to:@2
line: scope:[line]  from
  (void~) line::$0 ← call plot (byte) line::l 
  (byte/word~) line::$1 ← (byte) line::l + (byte/signed byte/word/signed word/dword/signed dword) 20
  (void~) line::$2 ← call plot (byte/word~) line::$1 
  to:line::@return
line::@return: scope:[line]  from line
  return 
  to:@return
@2: scope:[]  from @1
  to:@3
plot: scope:[plot]  from
  *((byte*) SCREEN + (byte) plot::x) ← (byte) '*'
  to:plot::@return
plot::@return: scope:[plot]  from plot
  return 
  to:@return
@3: scope:[]  from @2
  call main 
  to:@end
@end: scope:[]  from @3

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

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
  to:@3
main: scope:[main]  from @3
  (byte*) SCREEN#6 ← phi( @3/(byte*) SCREEN#10 )
  (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
  to:main::@1
main::@1: scope:[main]  from main main::@5
  (byte*) SCREEN#4 ← phi( main/(byte*) SCREEN#6 main::@5/(byte*) SCREEN#7 )
  (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@5/(byte) main::i#1 )
  (byte) line::l#0 ← (byte) main::i#2
  call line param-assignment
  to:main::@5
main::@5: scope:[main]  from main::@1
  (byte*) SCREEN#7 ← phi( main::@1/(byte*) SCREEN#4 )
  (byte) main::i#3 ← phi( main::@1/(byte) main::i#2 )
  (byte) main::i#1 ← ++ (byte) main::i#3
  (boolean~) main::$1 ← (byte) main::i#1 != (byte/signed byte/word/signed word/dword/signed dword) 9
  if((boolean~) main::$1) goto main::@1
  to:main::@3
main::@3: scope:[main]  from main::@5
  (byte*) SCREEN#8 ← phi( main::@5/(byte*) SCREEN#7 )
  (byte) main::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) 10
  to:main::@2
main::@2: scope:[main]  from main::@3 main::@6
  (byte*) SCREEN#5 ← phi( main::@3/(byte*) SCREEN#8 main::@6/(byte*) SCREEN#9 )
  (byte) main::j#2 ← phi( main::@3/(byte) main::j#0 main::@6/(byte) main::j#1 )
  (byte) line::l#1 ← (byte) main::j#2
  call line param-assignment
  to:main::@6
main::@6: scope:[main]  from main::@2
  (byte*) SCREEN#9 ← phi( main::@2/(byte*) SCREEN#5 )
  (byte) main::j#3 ← phi( main::@2/(byte) main::j#2 )
  (byte) main::j#1 ← ++ (byte) main::j#3
  (boolean~) main::$3 ← (byte) main::j#1 != (byte/signed byte/word/signed word/dword/signed dword) 19
  if((boolean~) main::$3) goto main::@2
  to:main::@return
main::@return: scope:[main]  from main::@6
  return 
  to:@return
line: scope:[line]  from main::@1 main::@2
  (byte*) SCREEN#2 ← phi( main::@1/(byte*) SCREEN#4 main::@2/(byte*) SCREEN#5 )
  (byte) line::l#2 ← phi( main::@1/(byte) line::l#0 main::@2/(byte) line::l#1 )
  (byte) plot::x#0 ← (byte) line::l#2
  call plot param-assignment
  to:line::@1
line::@1: scope:[line]  from line
  (byte*) SCREEN#3 ← phi( line/(byte*) SCREEN#2 )
  (byte) line::l#3 ← phi( line/(byte) line::l#2 )
  (byte/word~) line::$1 ← (byte) line::l#3 + (byte/signed byte/word/signed word/dword/signed dword) 20
  (byte) plot::x#1 ← (byte/word~) line::$1
  call plot param-assignment
  to:line::@2
line::@2: scope:[line]  from line::@1
  to:line::@return
line::@return: scope:[line]  from line::@2
  return 
  to:@return
plot: scope:[plot]  from line line::@1
  (byte) plot::x#2 ← phi( line/(byte) plot::x#0 line::@1/(byte) plot::x#1 )
  (byte*) SCREEN#1 ← phi( line/(byte*) SCREEN#2 line::@1/(byte*) SCREEN#3 )
  *((byte*) SCREEN#1 + (byte) plot::x#2) ← (byte) '*'
  to:plot::@return
plot::@return: scope:[plot]  from plot
  return 
  to:@return
@3: scope:[]  from @begin
  (byte*) SCREEN#10 ← phi( @begin/(byte*) SCREEN#0 )
  call main param-assignment
  to:@4
@4: scope:[]  from @3
  to:@end
@end: scope:[]  from @4

SYMBOL TABLE SSA
(label) @3
(label) @4
(label) @begin
(label) @end
(byte*) SCREEN
(byte*) SCREEN#0
(byte*) SCREEN#1
(byte*) SCREEN#10
(byte*) SCREEN#2
(byte*) SCREEN#3
(byte*) SCREEN#4
(byte*) SCREEN#5
(byte*) SCREEN#6
(byte*) SCREEN#7
(byte*) SCREEN#8
(byte*) SCREEN#9
(void()) line((byte) line::l)
(byte/word~) line::$1
(label) line::@1
(label) line::@2
(label) line::@return
(byte) line::l
(byte) line::l#0
(byte) line::l#1
(byte) line::l#2
(byte) line::l#3
(void()) main()
(boolean~) main::$1
(boolean~) main::$3
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@5
(label) main::@6
(label) main::@return
(byte) main::i
(byte) main::i#0
(byte) main::i#1
(byte) main::i#2
(byte) main::i#3
(byte) main::j
(byte) main::j#0
(byte) main::j#1
(byte) main::j#2
(byte) main::j#3
(void()) plot((byte) plot::x)
(label) plot::@return
(byte) plot::x
(byte) plot::x#0
(byte) plot::x#1
(byte) plot::x#2

OPTIMIZING CONTROL FLOW GRAPH
Culled Empty Block (label) line::@2
Culled Empty Block (label) @4
Succesful SSA optimization Pass2CullEmptyBlocks
Not aliassing across scopes: SCREEN#6 SCREEN#10
Not aliassing across scopes: line::l#0 main::i#2
Not aliassing across scopes: line::l#1 main::j#2
Not aliassing across scopes: line::l#2 line::l#0
Not aliassing across scopes: SCREEN#2 SCREEN#4
Not aliassing across scopes: plot::x#0 line::l#2
Not aliassing across scopes: SCREEN#1 SCREEN#2
Not aliassing across scopes: plot::x#2 plot::x#0
Alias (byte) main::i#2 = (byte) main::i#3 
Alias (byte*) SCREEN#4 = (byte*) SCREEN#7 (byte*) SCREEN#8 
Alias (byte) main::j#2 = (byte) main::j#3 
Alias (byte*) SCREEN#5 = (byte*) SCREEN#9 
Alias (byte) line::l#2 = (byte) line::l#3 
Alias (byte*) SCREEN#2 = (byte*) SCREEN#3 
Alias (byte) plot::x#1 = (byte/word~) line::$1 
Alias (byte*) SCREEN#0 = (byte*) SCREEN#10 
Succesful SSA optimization Pass2AliasElimination
Not aliassing across scopes: SCREEN#6 SCREEN#0
Not aliassing across scopes: line::l#0 main::i#2
Not aliassing across scopes: line::l#1 main::j#2
Not aliassing across scopes: line::l#2 line::l#0
Not aliassing across scopes: SCREEN#2 SCREEN#4
Not aliassing across scopes: plot::x#0 line::l#2
Not aliassing across scopes: SCREEN#1 SCREEN#2
Not aliassing across scopes: plot::x#2 plot::x#0
Self Phi Eliminated (byte*) SCREEN#4
Self Phi Eliminated (byte*) SCREEN#5
Succesful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte*) SCREEN#6 (byte*) SCREEN#0
Redundant Phi (byte*) SCREEN#4 (byte*) SCREEN#6
Redundant Phi (byte*) SCREEN#5 (byte*) SCREEN#4
Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#2
Succesful SSA optimization Pass2RedundantPhiElimination
Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#0
Succesful SSA optimization Pass2RedundantPhiElimination
Simple Condition (boolean~) main::$1 if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 9) goto main::@1
Simple Condition (boolean~) main::$3 if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) 19) goto main::@2
Succesful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) SCREEN#0 = ((byte*))1024
Constant (const byte) main::i#0 = 0
Constant (const byte) main::j#0 = 10
Succesful SSA optimization Pass2ConstantIdentification
Multiple usages for variable. Not optimizing sub-constant (byte) line::l#2
Culled Empty Block (label) main::@3
Succesful SSA optimization Pass2CullEmptyBlocks
Not aliassing across scopes: line::l#0 main::i#2
Not aliassing across scopes: line::l#1 main::j#2
Not aliassing across scopes: line::l#2 line::l#0
Not aliassing across scopes: plot::x#0 line::l#2
Not aliassing across scopes: plot::x#2 plot::x#0
Multiple usages for variable. Not optimizing sub-constant (byte) line::l#2
Not aliassing across scopes: line::l#0 main::i#2
Not aliassing across scopes: line::l#1 main::j#2
Not aliassing across scopes: line::l#2 line::l#0
Not aliassing across scopes: plot::x#0 line::l#2
Not aliassing across scopes: plot::x#2 plot::x#0
Multiple usages for variable. Not optimizing sub-constant (byte) line::l#2
OPTIMIZING CONTROL FLOW GRAPH
Inlining constant with var siblings (const byte) main::i#0
Inlining constant with var siblings (const byte) main::i#0
Inlining constant with var siblings (const byte) main::j#0
Inlining constant with var siblings (const byte) main::j#0
Constant inlined main::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::j#0 = (byte/signed byte/word/signed word/dword/signed dword) 10
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @3 @end main main::@1 main::@5 main::@2 main::@6 main::@return line line::@1 line::@return plot plot::@return 
Added new block during phi lifting main::@7(between main::@5 and main::@1)
Added new block during phi lifting main::@8(between main::@6 and main::@2)
Block Sequence Planned @begin @3 @end main main::@1 main::@5 main::@2 main::@6 main::@return main::@8 main::@7 line line::@1 line::@return plot plot::@return 
Adding NOP phi() at start of @begin
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 line:8 line:14 
Calls in [line] to plot:23 plot:26 

Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Created 4 initial phi equivalence classes
Coalesced [7] line::l#4 ← line::l#0
Coalesced [13] line::l#5 ← line::l#1
Coalesced [18] main::j#4 ← main::j#1
Coalesced [19] main::i#4 ← main::i#1
Coalesced [22] plot::x#3 ← plot::x#0
Coalesced [25] plot::x#4 ← plot::x#1
Coalesced down to 4 phi equivalence classes
Culled Empty Block (label) main::@8
Culled Empty Block (label) main::@7
Block Sequence Planned @begin @3 @end main main::@1 main::@5 main::@2 main::@6 main::@return line line::@1 line::@return plot plot::@return 
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi() [ ] ( )
  to:@3
@3: scope:[]  from @begin
  [1] phi() [ ] ( )
  [2] call main param-assignment [ ] ( )
  to:@end
@end: scope:[]  from @3
  [3] phi() [ ] ( )
main: scope:[main]  from @3
  [4] phi() [ ] ( main:2 [ ] )
  to:main::@1
main::@1: scope:[main]  from main main::@5
  [5] (byte) main::i#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@5/(byte) main::i#1 ) [ main::i#2 ] ( main:2 [ main::i#2 ] )
  [6] (byte) line::l#0 ← (byte) main::i#2 [ main::i#2 line::l#0 ] ( main:2 [ main::i#2 line::l#0 ] )
  [7] call line param-assignment [ main::i#2 ] ( main:2 [ main::i#2 ] )
  to:main::@5
main::@5: scope:[main]  from main::@1
  [8] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] ( main:2 [ main::i#1 ] )
  [9] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 9) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] )
  to:main::@2
main::@2: scope:[main]  from main::@5 main::@6
  [10] (byte) main::j#2 ← phi( main::@5/(byte/signed byte/word/signed word/dword/signed dword) 10 main::@6/(byte) main::j#1 ) [ main::j#2 ] ( main:2 [ main::j#2 ] )
  [11] (byte) line::l#1 ← (byte) main::j#2 [ main::j#2 line::l#1 ] ( main:2 [ main::j#2 line::l#1 ] )
  [12] call line param-assignment [ main::j#2 ] ( main:2 [ main::j#2 ] )
  to:main::@6
main::@6: scope:[main]  from main::@2
  [13] (byte) main::j#1 ← ++ (byte) main::j#2 [ main::j#1 ] ( main:2 [ main::j#1 ] )
  [14] if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) 19) goto main::@2 [ main::j#1 ] ( main:2 [ main::j#1 ] )
  to:main::@return
main::@return: scope:[main]  from main::@6
  [15] return  [ ] ( main:2 [ ] )
  to:@return
line: scope:[line]  from main::@1 main::@2
  [16] (byte) line::l#2 ← phi( main::@1/(byte) line::l#0 main::@2/(byte) line::l#1 ) [ line::l#2 ] ( main:2::line:7 [ main::i#2 line::l#2 ] main:2::line:12 [ main::j#2 line::l#2 ] )
  [17] (byte) plot::x#0 ← (byte) line::l#2 [ line::l#2 plot::x#0 ] ( main:2::line:7 [ main::i#2 line::l#2 plot::x#0 ] main:2::line:12 [ main::j#2 line::l#2 plot::x#0 ] )
  [18] call plot param-assignment [ line::l#2 ] ( main:2::line:7 [ main::i#2 line::l#2 ] main:2::line:12 [ main::j#2 line::l#2 ] )
  to:line::@1
line::@1: scope:[line]  from line
  [19] (byte) plot::x#1 ← (byte) line::l#2 + (byte/signed byte/word/signed word/dword/signed dword) 20 [ plot::x#1 ] ( main:2::line:7 [ main::i#2 plot::x#1 ] main:2::line:12 [ main::j#2 plot::x#1 ] )
  [20] call plot param-assignment [ ] ( main:2::line:7 [ main::i#2 ] main:2::line:12 [ main::j#2 ] )
  to:line::@return
line::@return: scope:[line]  from line::@1
  [21] return  [ ] ( main:2::line:7 [ main::i#2 ] main:2::line:12 [ main::j#2 ] )
  to:@return
plot: scope:[plot]  from line line::@1
  [22] (byte) plot::x#2 ← phi( line/(byte) plot::x#0 line::@1/(byte) plot::x#1 ) [ plot::x#2 ] ( main:2::line:7::plot:18 [ main::i#2 line::l#2 plot::x#2 ] main:2::line:12::plot:18 [ main::j#2 line::l#2 plot::x#2 ] main:2::line:7::plot:20 [ main::i#2 plot::x#2 ] main:2::line:12::plot:20 [ main::j#2 plot::x#2 ] )
  [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' [ ] ( main:2::line:7::plot:18 [ main::i#2 line::l#2 ] main:2::line:12::plot:18 [ main::j#2 line::l#2 ] main:2::line:7::plot:20 [ main::i#2 ] main:2::line:12::plot:20 [ main::j#2 ] )
  to:plot::@return
plot::@return: scope:[plot]  from plot
  [24] return  [ ] ( main:2::line:7::plot:18 [ main::i#2 line::l#2 ] main:2::line:12::plot:18 [ main::j#2 line::l#2 ] main:2::line:7::plot:20 [ main::i#2 ] main:2::line:12::plot:20 [ main::j#2 ] )
  to:@return

DOMINATORS
@begin dominated by  @begin 
@3 dominated by  @begin @3 
@end dominated by  @begin @end @3 
main dominated by  @begin main @3 
main::@1 dominated by  @begin main @3 main::@1 
main::@5 dominated by  @begin main @3 main::@1 main::@5 
main::@2 dominated by  @begin main @3 main::@1 main::@2 main::@5 
main::@6 dominated by  @begin main @3 main::@1 main::@2 main::@5 main::@6 
main::@return dominated by  main::@return @begin main @3 main::@1 main::@2 main::@5 main::@6 
line dominated by  @begin line main @3 main::@1 
line::@1 dominated by  @begin line line::@1 main @3 main::@1 
line::@return dominated by  @begin line line::@1 main @3 main::@1 line::@return 
plot dominated by  @begin line main @3 plot main::@1 
plot::@return dominated by  @begin line main @3 plot main::@1 plot::@return 

NATURAL LOOPS
Found back edge: Loop head: main::@1 tails: main::@5 blocks: null
Found back edge: Loop head: main::@2 tails: main::@6 blocks: null
Populated: Loop head: main::@1 tails: main::@5 blocks: main::@5 main::@1 
Populated: Loop head: main::@2 tails: main::@6 blocks: main::@6 main::@2 
Loop head: main::@1 tails: main::@5 blocks: main::@5 main::@1 
Loop head: main::@2 tails: main::@6 blocks: main::@6 main::@2 

NATURAL LOOPS WITH DEPTH
Found 0 loops in scope []
Found 2 loops in scope [main]
  Loop head: main::@1 tails: main::@5 blocks: main::@5 main::@1 
  Loop head: main::@2 tails: main::@6 blocks: main::@6 main::@2 
Found 0 loops in scope [line]
Found 0 loops in scope [plot]
Loop head: main::@1 tails: main::@5 blocks: main::@5 main::@1  depth: 1
Loop head: main::@2 tails: main::@6 blocks: main::@6 main::@2  depth: 1


VARIABLE REGISTER WEIGHTS
(byte*) SCREEN
(void()) line((byte) line::l)
(byte) line::l
(byte) line::l#0 22.0
(byte) line::l#1 22.0
(byte) line::l#2 8.666666666666666
(void()) main()
(byte) main::i
(byte) main::i#1 16.5
(byte) main::i#2 11.0
(byte) main::j
(byte) main::j#1 16.5
(byte) main::j#2 11.0
(void()) plot((byte) plot::x)
(byte) plot::x
(byte) plot::x#0 4.0
(byte) plot::x#1 4.0
(byte) plot::x#2 6.0

Initial phi equivalence classes
[ main::i#2 main::i#1 ]
[ main::j#2 main::j#1 ]
[ line::l#2 line::l#0 line::l#1 ]
[ plot::x#2 plot::x#0 plot::x#1 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ main::j#2 main::j#1 ]
[ line::l#2 line::l#0 line::l#1 ]
[ plot::x#2 plot::x#0 plot::x#1 ]
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 [ main::j#2 main::j#1 ]
Allocated zp ZP_BYTE:4 [ line::l#2 line::l#0 line::l#1 ]
Allocated zp ZP_BYTE:5 [ plot::x#2 plot::x#0 plot::x#1 ]

INITIAL ASM
//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 @3 [phi:@begin->@3]
b3_from_bbegin:
  jmp b3
//SEG4 @3
b3:
//SEG5 [2] call main param-assignment [ ] ( )
//SEG6 [4] phi from @3 to main [phi:@3->main]
main_from_b3:
  jsr main
//SEG7 [3] phi from @3 to @end [phi:@3->@end]
bend_from_b3:
  jmp bend
//SEG8 @end
bend:
//SEG9 main
main: {
    .label i = 2
    .label j = 3
  //SEG10 [5] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
  //SEG11 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta i
    jmp b1
  //SEG12 [5] phi from main::@5 to main::@1 [phi:main::@5->main::@1]
  b1_from_b5:
  //SEG13 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@5->main::@1#0] -- register_copy 
    jmp b1
  //SEG14 main::@1
  b1:
  //SEG15 [6] (byte) line::l#0 ← (byte) main::i#2 [ main::i#2 line::l#0 ] ( main:2 [ main::i#2 line::l#0 ] ) -- vbuz1=vbuz2 
    lda i
    sta line.l
  //SEG16 [7] call line param-assignment [ main::i#2 ] ( main:2 [ main::i#2 ] )
  //SEG17 [16] phi from main::@1 to line [phi:main::@1->line]
  line_from_b1:
  //SEG18 [16] phi (byte) line::l#2 = (byte) line::l#0 [phi:main::@1->line#0] -- register_copy 
    jsr line
    jmp b5
  //SEG19 main::@5
  b5:
  //SEG20 [8] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuz1=_inc_vbuz1 
    inc i
  //SEG21 [9] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 9) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuz1_neq_vbuc1_then_la1 
    lda i
    cmp #9
    bne b1_from_b5
  //SEG22 [10] phi from main::@5 to main::@2 [phi:main::@5->main::@2]
  b2_from_b5:
  //SEG23 [10] phi (byte) main::j#2 = (byte/signed byte/word/signed word/dword/signed dword) 10 [phi:main::@5->main::@2#0] -- vbuz1=vbuc1 
    lda #$a
    sta j
    jmp b2
  //SEG24 [10] phi from main::@6 to main::@2 [phi:main::@6->main::@2]
  b2_from_b6:
  //SEG25 [10] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@6->main::@2#0] -- register_copy 
    jmp b2
  //SEG26 main::@2
  b2:
  //SEG27 [11] (byte) line::l#1 ← (byte) main::j#2 [ main::j#2 line::l#1 ] ( main:2 [ main::j#2 line::l#1 ] ) -- vbuz1=vbuz2 
    lda j
    sta line.l
  //SEG28 [12] call line param-assignment [ main::j#2 ] ( main:2 [ main::j#2 ] )
  //SEG29 [16] phi from main::@2 to line [phi:main::@2->line]
  line_from_b2:
  //SEG30 [16] phi (byte) line::l#2 = (byte) line::l#1 [phi:main::@2->line#0] -- register_copy 
    jsr line
    jmp b6
  //SEG31 main::@6
  b6:
  //SEG32 [13] (byte) main::j#1 ← ++ (byte) main::j#2 [ main::j#1 ] ( main:2 [ main::j#1 ] ) -- vbuz1=_inc_vbuz1 
    inc j
  //SEG33 [14] if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) 19) goto main::@2 [ main::j#1 ] ( main:2 [ main::j#1 ] ) -- vbuz1_neq_vbuc1_then_la1 
    lda j
    cmp #$13
    bne b2_from_b6
    jmp breturn
  //SEG34 main::@return
  breturn:
  //SEG35 [15] return  [ ] ( main:2 [ ] )
    rts
}
//SEG36 line
line: {
    .label l = 4
  //SEG37 [17] (byte) plot::x#0 ← (byte) line::l#2 [ line::l#2 plot::x#0 ] ( main:2::line:7 [ main::i#2 line::l#2 plot::x#0 ] main:2::line:12 [ main::j#2 line::l#2 plot::x#0 ] ) -- vbuz1=vbuz2 
    lda l
    sta plot.x
  //SEG38 [18] call plot param-assignment [ line::l#2 ] ( main:2::line:7 [ main::i#2 line::l#2 ] main:2::line:12 [ main::j#2 line::l#2 ] )
  //SEG39 [22] phi from line to plot [phi:line->plot]
  plot_from_line:
  //SEG40 [22] phi (byte) plot::x#2 = (byte) plot::x#0 [phi:line->plot#0] -- register_copy 
    jsr plot
    jmp b1
  //SEG41 line::@1
  b1:
  //SEG42 [19] (byte) plot::x#1 ← (byte) line::l#2 + (byte/signed byte/word/signed word/dword/signed dword) 20 [ plot::x#1 ] ( main:2::line:7 [ main::i#2 plot::x#1 ] main:2::line:12 [ main::j#2 plot::x#1 ] ) -- vbuz1=vbuz2_plus_vbuc1 
    lda #$14
    clc
    adc l
    sta plot.x
  //SEG43 [20] call plot param-assignment [ ] ( main:2::line:7 [ main::i#2 ] main:2::line:12 [ main::j#2 ] )
  //SEG44 [22] phi from line::@1 to plot [phi:line::@1->plot]
  plot_from_b1:
  //SEG45 [22] phi (byte) plot::x#2 = (byte) plot::x#1 [phi:line::@1->plot#0] -- register_copy 
    jsr plot
    jmp breturn
  //SEG46 line::@return
  breturn:
  //SEG47 [21] return  [ ] ( main:2::line:7 [ main::i#2 ] main:2::line:12 [ main::j#2 ] )
    rts
}
//SEG48 plot
plot: {
    .label x = 5
  //SEG49 [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' [ ] ( main:2::line:7::plot:18 [ main::i#2 line::l#2 ] main:2::line:12::plot:18 [ main::j#2 line::l#2 ] main:2::line:7::plot:20 [ main::i#2 ] main:2::line:12::plot:20 [ main::j#2 ] ) -- pbuc1_derefidx_vbuz1=vbuc2 
    ldy x
    lda #'*'
    sta SCREEN,y
    jmp breturn
  //SEG50 plot::@return
  breturn:
  //SEG51 [24] return  [ ] ( main:2::line:7::plot:18 [ main::i#2 line::l#2 ] main:2::line:12::plot:18 [ main::j#2 line::l#2 ] main:2::line:7::plot:20 [ main::i#2 ] main:2::line:12::plot:20 [ main::j#2 ] )
    rts
}

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [19] (byte) plot::x#1 ← (byte) line::l#2 + (byte/signed byte/word/signed word/dword/signed dword) 20 [ plot::x#1 ] ( main:2::line:7 [ main::i#2 plot::x#1 ] main:2::line:12 [ main::j#2 plot::x#1 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::j#2 main::j#1 ]
Statement [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' [ ] ( main:2::line:7::plot:18 [ main::i#2 line::l#2 ] main:2::line:12::plot:18 [ main::j#2 line::l#2 ] main:2::line:7::plot:20 [ main::i#2 ] main:2::line:12::plot:20 [ main::j#2 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ line::l#2 line::l#0 line::l#1 ]
Statement [19] (byte) plot::x#1 ← (byte) line::l#2 + (byte/signed byte/word/signed word/dword/signed dword) 20 [ plot::x#1 ] ( main:2::line:7 [ main::i#2 plot::x#1 ] main:2::line:12 [ main::j#2 plot::x#1 ] ) always clobbers reg byte a 
Statement [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' [ ] ( main:2::line:7::plot:18 [ main::i#2 line::l#2 ] main:2::line:12::plot:18 [ main::j#2 line::l#2 ] main:2::line:7::plot:20 [ main::i#2 ] main:2::line:12::plot:20 [ main::j#2 ] ) always clobbers reg byte a 
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:3 [ main::j#2 main::j#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:4 [ line::l#2 line::l#0 line::l#1 ] : zp ZP_BYTE:4 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:5 [ plot::x#2 plot::x#0 plot::x#1 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 27.5: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 27.5: zp ZP_BYTE:3 [ main::j#2 main::j#1 ] 
Uplift Scope [line] 52.67: zp ZP_BYTE:4 [ line::l#2 line::l#0 line::l#1 ] 
Uplift Scope [plot] 14: zp ZP_BYTE:5 [ plot::x#2 plot::x#0 plot::x#1 ] 
Uplift Scope [] 

Uplifting [main] best 475 combination reg byte x [ main::i#2 main::i#1 ] reg byte x [ main::j#2 main::j#1 ] 
Uplifting [line] best 411 combination reg byte x [ line::l#2 line::l#0 line::l#1 ] 
Uplifting [plot] best 406 combination reg byte a [ plot::x#2 plot::x#0 plot::x#1 ] 
Uplifting [] best 406 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 @3 [phi:@begin->@3]
b3_from_bbegin:
  jmp b3
//SEG4 @3
b3:
//SEG5 [2] call main param-assignment [ ] ( )
//SEG6 [4] phi from @3 to main [phi:@3->main]
main_from_b3:
  jsr main
//SEG7 [3] phi from @3 to @end [phi:@3->@end]
bend_from_b3:
  jmp bend
//SEG8 @end
bend:
//SEG9 main
main: {
  //SEG10 [5] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
  //SEG11 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 
    ldx #0
    jmp b1
  //SEG12 [5] phi from main::@5 to main::@1 [phi:main::@5->main::@1]
  b1_from_b5:
  //SEG13 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@5->main::@1#0] -- register_copy 
    jmp b1
  //SEG14 main::@1
  b1:
  //SEG15 [6] (byte) line::l#0 ← (byte) main::i#2 [ main::i#2 line::l#0 ] ( main:2 [ main::i#2 line::l#0 ] )
    // (byte) line::l#0 = (byte) main::i#2  // register copy reg byte x
  //SEG16 [7] call line param-assignment [ main::i#2 ] ( main:2 [ main::i#2 ] )
  //SEG17 [16] phi from main::@1 to line [phi:main::@1->line]
  line_from_b1:
  //SEG18 [16] phi (byte) line::l#2 = (byte) line::l#0 [phi:main::@1->line#0] -- register_copy 
    jsr line
    jmp b5
  //SEG19 main::@5
  b5:
  //SEG20 [8] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuxx=_inc_vbuxx 
    inx
  //SEG21 [9] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 9) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuxx_neq_vbuc1_then_la1 
    cpx #9
    bne b1_from_b5
  //SEG22 [10] phi from main::@5 to main::@2 [phi:main::@5->main::@2]
  b2_from_b5:
  //SEG23 [10] phi (byte) main::j#2 = (byte/signed byte/word/signed word/dword/signed dword) 10 [phi:main::@5->main::@2#0] -- vbuxx=vbuc1 
    ldx #$a
    jmp b2
  //SEG24 [10] phi from main::@6 to main::@2 [phi:main::@6->main::@2]
  b2_from_b6:
  //SEG25 [10] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@6->main::@2#0] -- register_copy 
    jmp b2
  //SEG26 main::@2
  b2:
  //SEG27 [11] (byte) line::l#1 ← (byte) main::j#2 [ main::j#2 line::l#1 ] ( main:2 [ main::j#2 line::l#1 ] )
    // (byte) line::l#1 = (byte) main::j#2  // register copy reg byte x
  //SEG28 [12] call line param-assignment [ main::j#2 ] ( main:2 [ main::j#2 ] )
  //SEG29 [16] phi from main::@2 to line [phi:main::@2->line]
  line_from_b2:
  //SEG30 [16] phi (byte) line::l#2 = (byte) line::l#1 [phi:main::@2->line#0] -- register_copy 
    jsr line
    jmp b6
  //SEG31 main::@6
  b6:
  //SEG32 [13] (byte) main::j#1 ← ++ (byte) main::j#2 [ main::j#1 ] ( main:2 [ main::j#1 ] ) -- vbuxx=_inc_vbuxx 
    inx
  //SEG33 [14] if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) 19) goto main::@2 [ main::j#1 ] ( main:2 [ main::j#1 ] ) -- vbuxx_neq_vbuc1_then_la1 
    cpx #$13
    bne b2_from_b6
    jmp breturn
  //SEG34 main::@return
  breturn:
  //SEG35 [15] return  [ ] ( main:2 [ ] )
    rts
}
//SEG36 line
line: {
  //SEG37 [17] (byte) plot::x#0 ← (byte) line::l#2 [ line::l#2 plot::x#0 ] ( main:2::line:7 [ main::i#2 line::l#2 plot::x#0 ] main:2::line:12 [ main::j#2 line::l#2 plot::x#0 ] ) -- vbuaa=vbuxx 
    txa
  //SEG38 [18] call plot param-assignment [ line::l#2 ] ( main:2::line:7 [ main::i#2 line::l#2 ] main:2::line:12 [ main::j#2 line::l#2 ] )
  //SEG39 [22] phi from line to plot [phi:line->plot]
  plot_from_line:
  //SEG40 [22] phi (byte) plot::x#2 = (byte) plot::x#0 [phi:line->plot#0] -- register_copy 
    jsr plot
    jmp b1
  //SEG41 line::@1
  b1:
  //SEG42 [19] (byte) plot::x#1 ← (byte) line::l#2 + (byte/signed byte/word/signed word/dword/signed dword) 20 [ plot::x#1 ] ( main:2::line:7 [ main::i#2 plot::x#1 ] main:2::line:12 [ main::j#2 plot::x#1 ] ) -- vbuaa=vbuxx_plus_vbuc1 
    txa
    clc
    adc #$14
  //SEG43 [20] call plot param-assignment [ ] ( main:2::line:7 [ main::i#2 ] main:2::line:12 [ main::j#2 ] )
  //SEG44 [22] phi from line::@1 to plot [phi:line::@1->plot]
  plot_from_b1:
  //SEG45 [22] phi (byte) plot::x#2 = (byte) plot::x#1 [phi:line::@1->plot#0] -- register_copy 
    jsr plot
    jmp breturn
  //SEG46 line::@return
  breturn:
  //SEG47 [21] return  [ ] ( main:2::line:7 [ main::i#2 ] main:2::line:12 [ main::j#2 ] )
    rts
}
//SEG48 plot
plot: {
  //SEG49 [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' [ ] ( main:2::line:7::plot:18 [ main::i#2 line::l#2 ] main:2::line:12::plot:18 [ main::j#2 line::l#2 ] main:2::line:7::plot:20 [ main::i#2 ] main:2::line:12::plot:20 [ main::j#2 ] ) -- pbuc1_derefidx_vbuaa=vbuc2 
    tay
    lda #'*'
    sta SCREEN,y
    jmp breturn
  //SEG50 plot::@return
  breturn:
  //SEG51 [24] return  [ ] ( main:2::line:7::plot:18 [ main::i#2 line::l#2 ] main:2::line:12::plot:18 [ main::j#2 line::l#2 ] main:2::line:7::plot:20 [ main::i#2 ] main:2::line:12::plot:20 [ main::j#2 ] )
    rts
}

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b3
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b5
Removing instruction jmp b2
Removing instruction jmp b6
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp breturn
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label b1_from_b5 with b1
Replacing label b2_from_b6 with b2
Removing instruction bbegin:
Removing instruction b3_from_bbegin:
Removing instruction main_from_b3:
Removing instruction bend_from_b3:
Removing instruction b1_from_b5:
Removing instruction b2_from_b6:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b3:
Removing instruction bend:
Removing instruction b1_from_main:
Removing instruction line_from_b1:
Removing instruction b5:
Removing instruction b2_from_b5:
Removing instruction line_from_b2:
Removing instruction b6:
Removing instruction breturn:
Removing instruction plot_from_line:
Removing instruction b1:
Removing instruction plot_from_b1:
Removing instruction breturn:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing instruction jmp b1
Removing instruction jmp b2
Succesful ASM optimization Pass5NextJumpElimination

FINAL SYMBOL TABLE
(label) @3
(label) @begin
(label) @end
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024
(void()) line((byte) line::l)
(label) line::@1
(label) line::@return
(byte) line::l
(byte) line::l#0 reg byte x 22.0
(byte) line::l#1 reg byte x 22.0
(byte) line::l#2 reg byte x 8.666666666666666
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@5
(label) main::@6
(label) main::@return
(byte) main::i
(byte) main::i#1 reg byte x 16.5
(byte) main::i#2 reg byte x 11.0
(byte) main::j
(byte) main::j#1 reg byte x 16.5
(byte) main::j#2 reg byte x 11.0
(void()) plot((byte) plot::x)
(label) plot::@return
(byte) plot::x
(byte) plot::x#0 reg byte a 4.0
(byte) plot::x#1 reg byte a 4.0
(byte) plot::x#2 reg byte a 6.0

reg byte x [ main::i#2 main::i#1 ]
reg byte x [ main::j#2 main::j#1 ]
reg byte x [ line::l#2 line::l#0 line::l#1 ]
reg byte a [ plot::x#2 plot::x#0 plot::x#1 ]


FINAL ASSEMBLER
Score: 235

//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 @3 [phi:@begin->@3]
//SEG4 @3
//SEG5 [2] call main param-assignment [ ] ( )
//SEG6 [4] phi from @3 to main [phi:@3->main]
  jsr main
//SEG7 [3] phi from @3 to @end [phi:@3->@end]
//SEG8 @end
//SEG9 main
main: {
  //SEG10 [5] phi from main to main::@1 [phi:main->main::@1]
  //SEG11 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 
    ldx #0
  //SEG12 [5] phi from main::@5 to main::@1 [phi:main::@5->main::@1]
  //SEG13 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@5->main::@1#0] -- register_copy 
  //SEG14 main::@1
  b1:
  //SEG15 [6] (byte) line::l#0 ← (byte) main::i#2 [ main::i#2 line::l#0 ] ( main:2 [ main::i#2 line::l#0 ] )
    // (byte) line::l#0 = (byte) main::i#2  // register copy reg byte x
  //SEG16 [7] call line param-assignment [ main::i#2 ] ( main:2 [ main::i#2 ] )
  //SEG17 [16] phi from main::@1 to line [phi:main::@1->line]
  //SEG18 [16] phi (byte) line::l#2 = (byte) line::l#0 [phi:main::@1->line#0] -- register_copy 
    jsr line
  //SEG19 main::@5
  //SEG20 [8] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuxx=_inc_vbuxx 
    inx
  //SEG21 [9] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 9) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuxx_neq_vbuc1_then_la1 
    cpx #9
    bne b1
  //SEG22 [10] phi from main::@5 to main::@2 [phi:main::@5->main::@2]
  //SEG23 [10] phi (byte) main::j#2 = (byte/signed byte/word/signed word/dword/signed dword) 10 [phi:main::@5->main::@2#0] -- vbuxx=vbuc1 
    ldx #$a
  //SEG24 [10] phi from main::@6 to main::@2 [phi:main::@6->main::@2]
  //SEG25 [10] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@6->main::@2#0] -- register_copy 
  //SEG26 main::@2
  b2:
  //SEG27 [11] (byte) line::l#1 ← (byte) main::j#2 [ main::j#2 line::l#1 ] ( main:2 [ main::j#2 line::l#1 ] )
    // (byte) line::l#1 = (byte) main::j#2  // register copy reg byte x
  //SEG28 [12] call line param-assignment [ main::j#2 ] ( main:2 [ main::j#2 ] )
  //SEG29 [16] phi from main::@2 to line [phi:main::@2->line]
  //SEG30 [16] phi (byte) line::l#2 = (byte) line::l#1 [phi:main::@2->line#0] -- register_copy 
    jsr line
  //SEG31 main::@6
  //SEG32 [13] (byte) main::j#1 ← ++ (byte) main::j#2 [ main::j#1 ] ( main:2 [ main::j#1 ] ) -- vbuxx=_inc_vbuxx 
    inx
  //SEG33 [14] if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) 19) goto main::@2 [ main::j#1 ] ( main:2 [ main::j#1 ] ) -- vbuxx_neq_vbuc1_then_la1 
    cpx #$13
    bne b2
  //SEG34 main::@return
  //SEG35 [15] return  [ ] ( main:2 [ ] )
    rts
}
//SEG36 line
line: {
  //SEG37 [17] (byte) plot::x#0 ← (byte) line::l#2 [ line::l#2 plot::x#0 ] ( main:2::line:7 [ main::i#2 line::l#2 plot::x#0 ] main:2::line:12 [ main::j#2 line::l#2 plot::x#0 ] ) -- vbuaa=vbuxx 
    txa
  //SEG38 [18] call plot param-assignment [ line::l#2 ] ( main:2::line:7 [ main::i#2 line::l#2 ] main:2::line:12 [ main::j#2 line::l#2 ] )
  //SEG39 [22] phi from line to plot [phi:line->plot]
  //SEG40 [22] phi (byte) plot::x#2 = (byte) plot::x#0 [phi:line->plot#0] -- register_copy 
    jsr plot
  //SEG41 line::@1
  //SEG42 [19] (byte) plot::x#1 ← (byte) line::l#2 + (byte/signed byte/word/signed word/dword/signed dword) 20 [ plot::x#1 ] ( main:2::line:7 [ main::i#2 plot::x#1 ] main:2::line:12 [ main::j#2 plot::x#1 ] ) -- vbuaa=vbuxx_plus_vbuc1 
    txa
    clc
    adc #$14
  //SEG43 [20] call plot param-assignment [ ] ( main:2::line:7 [ main::i#2 ] main:2::line:12 [ main::j#2 ] )
  //SEG44 [22] phi from line::@1 to plot [phi:line::@1->plot]
  //SEG45 [22] phi (byte) plot::x#2 = (byte) plot::x#1 [phi:line::@1->plot#0] -- register_copy 
    jsr plot
  //SEG46 line::@return
  //SEG47 [21] return  [ ] ( main:2::line:7 [ main::i#2 ] main:2::line:12 [ main::j#2 ] )
    rts
}
//SEG48 plot
plot: {
  //SEG49 [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' [ ] ( main:2::line:7::plot:18 [ main::i#2 line::l#2 ] main:2::line:12::plot:18 [ main::j#2 line::l#2 ] main:2::line:7::plot:20 [ main::i#2 ] main:2::line:12::plot:20 [ main::j#2 ] ) -- pbuc1_derefidx_vbuaa=vbuc2 
    tay
    lda #'*'
    sta SCREEN,y
  //SEG50 plot::@return
  //SEG51 [24] return  [ ] ( main:2::line:7::plot:18 [ main::i#2 line::l#2 ] main:2::line:12::plot:18 [ main::j#2 line::l#2 ] main:2::line:7::plot:20 [ main::i#2 ] main:2::line:12::plot:20 [ main::j#2 ] )
    rts
}

