Culled Empty Block (label) @1
Culled Empty Block (label) scrollup1::@4
Culled Empty Block (label) @2
Culled Empty Block (label) scrollup2::@4
Culled Empty Block (label) @3
Culled Empty Block (label) scrollup3::@4

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  (byte*) screen#0 ← ((byte*)) (number) $400
  to:@4
main: scope:[main]  from @4
  call scrollup1 
  to:main::@1
main::@1: scope:[main]  from main
  call scrollup2 
  to:main::@2
main::@2: scope:[main]  from main::@1
  call scrollup3 
  to:main::@3
main::@3: scope:[main]  from main::@2
  to:main::@return
main::@return: scope:[main]  from main::@3
  return 
  to:@return
scrollup1: scope:[scrollup1]  from main
  (word) scrollup1::line#0 ← (number) 0
  to:scrollup1::@1
scrollup1::@1: scope:[scrollup1]  from scrollup1 scrollup1::@3
  (word) scrollup1::line#4 ← phi( scrollup1/(word) scrollup1::line#0 scrollup1::@3/(word) scrollup1::line#1 )
  (byte) scrollup1::c#0 ← (number) 0
  to:scrollup1::@2
scrollup1::@2: scope:[scrollup1]  from scrollup1::@1 scrollup1::@2
  (byte) scrollup1::c#2 ← phi( scrollup1::@1/(byte) scrollup1::c#0 scrollup1::@2/(byte) scrollup1::c#1 )
  (word) scrollup1::line#2 ← phi( scrollup1::@1/(word) scrollup1::line#4 scrollup1::@2/(word) scrollup1::line#2 )
  (word~) scrollup1::$0 ← (word) scrollup1::line#2 + (byte) scrollup1::c#2
  (word~) scrollup1::$1 ← (word) scrollup1::line#2 + (byte) scrollup1::c#2
  (number~) scrollup1::$2 ← (word~) scrollup1::$1 + (number) $28
  *((byte*) screen#0 + (word~) scrollup1::$0) ← *((byte*) screen#0 + (number~) scrollup1::$2)
  (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#2
  (bool~) scrollup1::$3 ← (byte) scrollup1::c#1 < (number) $28
  if((bool~) scrollup1::$3) goto scrollup1::@2
  to:scrollup1::@3
scrollup1::@3: scope:[scrollup1]  from scrollup1::@2
  (word) scrollup1::line#3 ← phi( scrollup1::@2/(word) scrollup1::line#2 )
  (word) scrollup1::line#1 ← (word) scrollup1::line#3 + (number) $28
  (bool~) scrollup1::$4 ← (word) scrollup1::line#1 < (number) $28*(number) $18
  if((bool~) scrollup1::$4) goto scrollup1::@1
  to:scrollup1::@return
scrollup1::@return: scope:[scrollup1]  from scrollup1::@3
  return 
  to:@return
scrollup2: scope:[scrollup2]  from main::@1
  (byte*) scrollup2::line1#0 ← (byte*) screen#0
  (byte*~) scrollup2::$0 ← (byte*) screen#0 + (number) $28
  (byte*) scrollup2::line2#0 ← (byte*~) scrollup2::$0
  (byte) scrollup2::l#0 ← (byte) 0
  to:scrollup2::@1
scrollup2::@1: scope:[scrollup2]  from scrollup2 scrollup2::@3
  (byte) scrollup2::l#4 ← phi( scrollup2/(byte) scrollup2::l#0 scrollup2::@3/(byte) scrollup2::l#1 )
  (byte*) scrollup2::line1#3 ← phi( scrollup2/(byte*) scrollup2::line1#0 scrollup2::@3/(byte*) scrollup2::line1#4 )
  (byte*) scrollup2::line2#3 ← phi( scrollup2/(byte*) scrollup2::line2#0 scrollup2::@3/(byte*) scrollup2::line2#4 )
  (byte) scrollup2::c#0 ← (byte) 0
  to:scrollup2::@2
scrollup2::@2: scope:[scrollup2]  from scrollup2::@1 scrollup2::@2
  (byte) scrollup2::l#3 ← phi( scrollup2::@1/(byte) scrollup2::l#4 scrollup2::@2/(byte) scrollup2::l#3 )
  (byte) scrollup2::c#2 ← phi( scrollup2::@1/(byte) scrollup2::c#0 scrollup2::@2/(byte) scrollup2::c#1 )
  (byte*) scrollup2::line1#2 ← phi( scrollup2::@1/(byte*) scrollup2::line1#3 scrollup2::@2/(byte*) scrollup2::line1#1 )
  (byte*) scrollup2::line2#2 ← phi( scrollup2::@1/(byte*) scrollup2::line2#3 scrollup2::@2/(byte*) scrollup2::line2#1 )
  *((byte*) scrollup2::line1#2) ← *((byte*) scrollup2::line2#2)
  (byte*) scrollup2::line1#1 ← ++ (byte*) scrollup2::line1#2
  (byte*) scrollup2::line2#1 ← ++ (byte*) scrollup2::line2#2
  (byte) scrollup2::c#1 ← (byte) scrollup2::c#2 + rangenext(0,$27)
  (bool~) scrollup2::$1 ← (byte) scrollup2::c#1 != rangelast(0,$27)
  if((bool~) scrollup2::$1) goto scrollup2::@2
  to:scrollup2::@3
scrollup2::@3: scope:[scrollup2]  from scrollup2::@2
  (byte*) scrollup2::line1#4 ← phi( scrollup2::@2/(byte*) scrollup2::line1#1 )
  (byte*) scrollup2::line2#4 ← phi( scrollup2::@2/(byte*) scrollup2::line2#1 )
  (byte) scrollup2::l#2 ← phi( scrollup2::@2/(byte) scrollup2::l#3 )
  (byte) scrollup2::l#1 ← (byte) scrollup2::l#2 + rangenext(0,$17)
  (bool~) scrollup2::$2 ← (byte) scrollup2::l#1 != rangelast(0,$17)
  if((bool~) scrollup2::$2) goto scrollup2::@1
  to:scrollup2::@return
scrollup2::@return: scope:[scrollup2]  from scrollup2::@3
  return 
  to:@return
scrollup3: scope:[scrollup3]  from main::@2
  (word) scrollup3::line#0 ← (number) 0
  to:scrollup3::@1
scrollup3::@1: scope:[scrollup3]  from scrollup3 scrollup3::@3
  (word) scrollup3::line#2 ← phi( scrollup3/(word) scrollup3::line#0 scrollup3::@3/(word) scrollup3::line#1 )
  (word) scrollup3::l2#0 ← (word) scrollup3::line#2
  (byte) scrollup3::c#0 ← (number) 0
  to:scrollup3::@2
scrollup3::@2: scope:[scrollup3]  from scrollup3::@1 scrollup3::@2
  (word) scrollup3::line#4 ← phi( scrollup3::@1/(word) scrollup3::line#2 scrollup3::@2/(word) scrollup3::line#4 )
  (byte) scrollup3::c#2 ← phi( scrollup3::@1/(byte) scrollup3::c#0 scrollup3::@2/(byte) scrollup3::c#1 )
  (word) scrollup3::l2#2 ← phi( scrollup3::@1/(word) scrollup3::l2#0 scrollup3::@2/(word) scrollup3::l2#1 )
  (number~) scrollup3::$0 ← (word) scrollup3::l2#2 + (number) $28
  *((byte*) screen#0 + (word) scrollup3::l2#2) ← *((byte*) screen#0 + (number~) scrollup3::$0)
  (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2
  (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#2
  (bool~) scrollup3::$1 ← (byte) scrollup3::c#1 < (number) $28
  if((bool~) scrollup3::$1) goto scrollup3::@2
  to:scrollup3::@3
scrollup3::@3: scope:[scrollup3]  from scrollup3::@2
  (word) scrollup3::line#3 ← phi( scrollup3::@2/(word) scrollup3::line#4 )
  (word) scrollup3::line#1 ← (word) scrollup3::line#3 + (number) $28
  (bool~) scrollup3::$2 ← (word) scrollup3::line#1 < (number) $28*(number) $18
  if((bool~) scrollup3::$2) goto scrollup3::@1
  to:scrollup3::@return
scrollup3::@return: scope:[scrollup3]  from scrollup3::@3
  return 
  to:@return
@4: scope:[]  from @begin
  call main 
  to:@5
@5: scope:[]  from @4
  to:@end
@end: scope:[]  from @5

SYMBOL TABLE SSA
(label) @4
(label) @5
(label) @begin
(label) @end
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
(byte*) screen
(byte*) screen#0
(void()) scrollup1()
(word~) scrollup1::$0
(word~) scrollup1::$1
(number~) scrollup1::$2
(bool~) scrollup1::$3
(bool~) scrollup1::$4
(label) scrollup1::@1
(label) scrollup1::@2
(label) scrollup1::@3
(label) scrollup1::@return
(byte) scrollup1::c
(byte) scrollup1::c#0
(byte) scrollup1::c#1
(byte) scrollup1::c#2
(word) scrollup1::line
(word) scrollup1::line#0
(word) scrollup1::line#1
(word) scrollup1::line#2
(word) scrollup1::line#3
(word) scrollup1::line#4
(void()) scrollup2()
(byte*~) scrollup2::$0
(bool~) scrollup2::$1
(bool~) scrollup2::$2
(label) scrollup2::@1
(label) scrollup2::@2
(label) scrollup2::@3
(label) scrollup2::@return
(byte) scrollup2::c
(byte) scrollup2::c#0
(byte) scrollup2::c#1
(byte) scrollup2::c#2
(byte) scrollup2::l
(byte) scrollup2::l#0
(byte) scrollup2::l#1
(byte) scrollup2::l#2
(byte) scrollup2::l#3
(byte) scrollup2::l#4
(byte*) scrollup2::line1
(byte*) scrollup2::line1#0
(byte*) scrollup2::line1#1
(byte*) scrollup2::line1#2
(byte*) scrollup2::line1#3
(byte*) scrollup2::line1#4
(byte*) scrollup2::line2
(byte*) scrollup2::line2#0
(byte*) scrollup2::line2#1
(byte*) scrollup2::line2#2
(byte*) scrollup2::line2#3
(byte*) scrollup2::line2#4
(void()) scrollup3()
(number~) scrollup3::$0
(bool~) scrollup3::$1
(bool~) scrollup3::$2
(label) scrollup3::@1
(label) scrollup3::@2
(label) scrollup3::@3
(label) scrollup3::@return
(byte) scrollup3::c
(byte) scrollup3::c#0
(byte) scrollup3::c#1
(byte) scrollup3::c#2
(word) scrollup3::l2
(word) scrollup3::l2#0
(word) scrollup3::l2#1
(word) scrollup3::l2#2
(word) scrollup3::line
(word) scrollup3::line#0
(word) scrollup3::line#1
(word) scrollup3::line#2
(word) scrollup3::line#3
(word) scrollup3::line#4

Adding number conversion cast (unumber) 0 in (word) scrollup1::line#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) scrollup1::c#0 ← (number) 0
Adding number conversion cast (unumber) $28 in (number~) scrollup1::$2 ← (word~) scrollup1::$1 + (number) $28
Adding number conversion cast (unumber) scrollup1::$2 in (number~) scrollup1::$2 ← (word~) scrollup1::$1 + (unumber)(number) $28
Adding number conversion cast (unumber) $28 in (bool~) scrollup1::$3 ← (byte) scrollup1::c#1 < (number) $28
Adding number conversion cast (unumber) $28 in (word) scrollup1::line#1 ← (word) scrollup1::line#3 + (number) $28
Adding number conversion cast (unumber) $28*$18 in (bool~) scrollup1::$4 ← (word) scrollup1::line#1 < (number) $28*(number) $18
Adding number conversion cast (unumber) $28 in (byte*~) scrollup2::$0 ← (byte*) screen#0 + (number) $28
Adding number conversion cast (unumber) 0 in (word) scrollup3::line#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) scrollup3::c#0 ← (number) 0
Adding number conversion cast (unumber) $28 in (number~) scrollup3::$0 ← (word) scrollup3::l2#2 + (number) $28
Adding number conversion cast (unumber) scrollup3::$0 in (number~) scrollup3::$0 ← (word) scrollup3::l2#2 + (unumber)(number) $28
Adding number conversion cast (unumber) $28 in (bool~) scrollup3::$1 ← (byte) scrollup3::c#1 < (number) $28
Adding number conversion cast (unumber) $28 in (word) scrollup3::line#1 ← (word) scrollup3::line#3 + (number) $28
Adding number conversion cast (unumber) $28*$18 in (bool~) scrollup3::$2 ← (word) scrollup3::line#1 < (number) $28*(number) $18
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) screen#0 ← (byte*)(number) $400
Inlining cast (word) scrollup1::line#0 ← (unumber)(number) 0
Inlining cast (byte) scrollup1::c#0 ← (unumber)(number) 0
Inlining cast (word) scrollup3::line#0 ← (unumber)(number) 0
Inlining cast (byte) scrollup3::c#0 ← (unumber)(number) 0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast $28
Simplifying constant integer cast $28
Simplifying constant integer cast $28
Simplifying constant integer cast $28
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast $28
Simplifying constant integer cast $28
Simplifying constant integer cast $28
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) $28
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to word in (unumber~) scrollup1::$2 ← (word~) scrollup1::$1 + (byte) $28
Inferred type updated to word in (unumber~) scrollup3::$0 ← (word) scrollup3::l2#2 + (byte) $28
Alias (word) scrollup1::line#2 = (word) scrollup1::line#3 
Alias (byte*) scrollup2::line2#0 = (byte*~) scrollup2::$0 
Alias (byte) scrollup2::l#2 = (byte) scrollup2::l#3 
Alias (byte*) scrollup2::line2#1 = (byte*) scrollup2::line2#4 
Alias (byte*) scrollup2::line1#1 = (byte*) scrollup2::line1#4 
Alias (word) scrollup3::l2#0 = (word) scrollup3::line#2 
Alias (word) scrollup3::line#3 = (word) scrollup3::line#4 
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (word) scrollup1::line#2
Self Phi Eliminated (byte) scrollup2::l#2
Self Phi Eliminated (word) scrollup3::line#3
Successful SSA optimization Pass2SelfPhiElimination
Identical Phi Values (word) scrollup1::line#2 (word) scrollup1::line#4
Identical Phi Values (byte) scrollup2::l#2 (byte) scrollup2::l#4
Identical Phi Values (word) scrollup3::line#3 (word) scrollup3::l2#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) scrollup1::$3 [15] if((byte) scrollup1::c#1<(byte) $28) goto scrollup1::@2
Simple Condition (bool~) scrollup1::$4 [19] if((word) scrollup1::line#1<(word)(number) $28*(number) $18) goto scrollup1::@1
Simple Condition (bool~) scrollup2::$1 [33] if((byte) scrollup2::c#1!=rangelast(0,$27)) goto scrollup2::@2
Simple Condition (bool~) scrollup2::$2 [37] if((byte) scrollup2::l#1!=rangelast(0,$17)) goto scrollup2::@1
Simple Condition (bool~) scrollup3::$1 [49] if((byte) scrollup3::c#1<(byte) $28) goto scrollup3::@2
Simple Condition (bool~) scrollup3::$2 [53] if((word) scrollup3::line#1<(word)(number) $28*(number) $18) goto scrollup3::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) screen#0 = (byte*) 1024
Constant (const word) scrollup1::line#0 = 0
Constant (const byte) scrollup1::c#0 = 0
Constant (const byte) scrollup2::l#0 = 0
Constant (const byte) scrollup2::c#0 = 0
Constant (const word) scrollup3::line#0 = 0
Constant (const byte) scrollup3::c#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) scrollup2::line1#0 = screen#0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [31] scrollup2::c#1 ← ++ scrollup2::c#2 to ++
Resolved ranged comparison value [33] if(scrollup2::c#1!=rangelast(0,$27)) goto scrollup2::@2 to (number) $28
Resolved ranged next value [35] scrollup2::l#1 ← ++ scrollup2::l#4 to ++
Resolved ranged comparison value [37] if(scrollup2::l#1!=rangelast(0,$17)) goto scrollup2::@1 to (number) $18
De-inlining pointer[w] to *(pointer+w)   [12] *((const byte*) screen#0 + (word~) scrollup1::$0) ← *((const byte*) screen#0 + (word~) scrollup1::$2)
De-inlining pointer[w] to *(pointer+w)   [12] *((const byte*) screen#0 + (word~) scrollup1::$0) ← *((byte*~) scrollup1::$5)
De-inlining pointer[w] to *(pointer+w)   [45] *((const byte*) screen#0 + (word) scrollup3::l2#2) ← *((const byte*) screen#0 + (word~) scrollup3::$0)
De-inlining pointer[w] to *(pointer+w)   [45] *((const byte*) screen#0 + (word) scrollup3::l2#2) ← *((byte*~) scrollup3::$3)
Successful SSA optimization Pass2DeInlineWordDerefIdx
Adding number conversion cast (unumber) $28 in if((byte) scrollup2::c#1!=(number) $28) goto scrollup2::@2
Adding number conversion cast (unumber) $18 in if((byte) scrollup2::l#1!=(number) $18) goto scrollup2::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast $28
Simplifying constant integer cast $18
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) $18
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [17] (byte*) scrollup2::line2#0 ← (const byte*) screen#0 + (byte) $28
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) scrollup2::line2#0 = screen#0+$28
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with var siblings (const word) scrollup1::line#0
Inlining constant with var siblings (const byte) scrollup1::c#0
Inlining constant with var siblings (const byte) scrollup2::l#0
Inlining constant with var siblings (const byte) scrollup2::c#0
Inlining constant with var siblings (const byte*) scrollup2::line1#0
Inlining constant with var siblings (const byte*) scrollup2::line2#0
Inlining constant with var siblings (const word) scrollup3::line#0
Inlining constant with var siblings (const byte) scrollup3::c#0
Constant inlined scrollup2::l#0 = (byte) 0
Constant inlined scrollup3::line#0 = (byte) 0
Constant inlined scrollup3::c#0 = (byte) 0
Constant inlined scrollup2::c#0 = (byte) 0
Constant inlined scrollup1::c#0 = (byte) 0
Constant inlined scrollup1::line#0 = (byte) 0
Constant inlined scrollup2::line2#0 = (const byte*) screen#0+(byte) $28
Constant inlined scrollup2::line1#0 = (const byte*) screen#0
Successful SSA optimization Pass2ConstantInlining
Consolidated constant in assignment scrollup1::$5
Consolidated constant in assignment scrollup3::$3
Successful SSA optimization Pass2ConstantAdditionElimination
Alias (word~) scrollup1::$2 = (word~) scrollup1::$1 
Alias (word) scrollup3::l2#2 = (word~) scrollup3::$0 
Successful SSA optimization Pass2AliasElimination
Added new block during phi lifting scrollup1::@5(between scrollup1::@3 and scrollup1::@1)
Added new block during phi lifting scrollup1::@6(between scrollup1::@2 and scrollup1::@2)
Added new block during phi lifting scrollup2::@5(between scrollup2::@3 and scrollup2::@1)
Added new block during phi lifting scrollup2::@6(between scrollup2::@2 and scrollup2::@2)
Added new block during phi lifting scrollup3::@5(between scrollup3::@3 and scrollup3::@1)
Added new block during phi lifting scrollup3::@6(between scrollup3::@2 and scrollup3::@2)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @4
Adding NOP phi() at start of @5
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
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of scrollup3
Adding NOP phi() at start of scrollup2
Adding NOP phi() at start of scrollup1
CALL GRAPH
Calls in [] to main:2 
Calls in [main] to scrollup1:6 scrollup2:8 scrollup3:10 

Created 11 initial phi equivalence classes
Not coalescing [15] scrollup3::l2#4 ← scrollup3::l2#0
Coalesced [26] scrollup3::l2#3 ← scrollup3::line#1
Coalesced [27] scrollup3::l2#5 ← scrollup3::l2#1
Coalesced [28] scrollup3::c#3 ← scrollup3::c#1
Coalesced [31] scrollup2::line2#6 ← scrollup2::line2#3
Coalesced [32] scrollup2::line1#6 ← scrollup2::line1#3
Coalesced [42] scrollup2::line2#5 ← scrollup2::line2#1
Coalesced [43] scrollup2::line1#5 ← scrollup2::line1#1
Coalesced [44] scrollup2::l#5 ← scrollup2::l#1
Coalesced (already) [45] scrollup2::line2#7 ← scrollup2::line2#1
Coalesced (already) [46] scrollup2::line1#7 ← scrollup2::line1#1
Coalesced [47] scrollup2::c#3 ← scrollup2::c#1
Coalesced [61] scrollup1::line#5 ← scrollup1::line#1
Coalesced [62] scrollup1::c#3 ← scrollup1::c#1
Coalesced down to 9 phi equivalence classes
Culled Empty Block (label) @5
Culled Empty Block (label) main::@3
Culled Empty Block (label) scrollup3::@5
Culled Empty Block (label) scrollup3::@6
Culled Empty Block (label) scrollup2::@5
Culled Empty Block (label) scrollup2::@6
Culled Empty Block (label) scrollup1::@5
Culled Empty Block (label) scrollup1::@6
Renumbering block @4 to @1
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of scrollup3
Adding NOP phi() at start of scrollup2
Adding NOP phi() at start of scrollup1

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  [1] phi()
  [2] call main 
  to:@end
@end: scope:[]  from @1
  [3] phi()
main: scope:[main]  from @1
  [4] phi()
  [5] call scrollup1 
  to:main::@1
main::@1: scope:[main]  from main
  [6] phi()
  [7] call scrollup2 
  to:main::@2
main::@2: scope:[main]  from main::@1
  [8] phi()
  [9] call scrollup3 
  to:main::@return
main::@return: scope:[main]  from main::@2
  [10] return 
  to:@return
scrollup3: scope:[scrollup3]  from main::@2
  [11] phi()
  to:scrollup3::@1
scrollup3::@1: scope:[scrollup3]  from scrollup3 scrollup3::@3
  [12] (word) scrollup3::l2#0 ← phi( scrollup3/(byte) 0 scrollup3::@3/(word) scrollup3::line#1 )
  [13] (word~) scrollup3::l2#4 ← (word) scrollup3::l2#0
  to:scrollup3::@2
scrollup3::@2: scope:[scrollup3]  from scrollup3::@1 scrollup3::@2
  [14] (byte) scrollup3::c#2 ← phi( scrollup3::@1/(byte) 0 scrollup3::@2/(byte) scrollup3::c#1 )
  [14] (word) scrollup3::l2#2 ← phi( scrollup3::@1/(word~) scrollup3::l2#4 scrollup3::@2/(word) scrollup3::l2#1 )
  [15] (byte*~) scrollup3::$3 ← (const byte*) screen#0+(byte) $28 + (word) scrollup3::l2#2
  [16] (byte*~) scrollup3::$4 ← (const byte*) screen#0 + (word) scrollup3::l2#2
  [17] *((byte*~) scrollup3::$4) ← *((byte*~) scrollup3::$3)
  [18] (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2
  [19] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#2
  [20] if((byte) scrollup3::c#1<(byte) $28) goto scrollup3::@2
  to:scrollup3::@3
scrollup3::@3: scope:[scrollup3]  from scrollup3::@2
  [21] (word) scrollup3::line#1 ← (word) scrollup3::l2#0 + (byte) $28
  [22] if((word) scrollup3::line#1<(word)(number) $28*(number) $18) goto scrollup3::@1
  to:scrollup3::@return
scrollup3::@return: scope:[scrollup3]  from scrollup3::@3
  [23] return 
  to:@return
scrollup2: scope:[scrollup2]  from main::@1
  [24] phi()
  to:scrollup2::@1
scrollup2::@1: scope:[scrollup2]  from scrollup2 scrollup2::@3
  [25] (byte) scrollup2::l#4 ← phi( scrollup2/(byte) 0 scrollup2::@3/(byte) scrollup2::l#1 )
  [25] (byte*) scrollup2::line1#3 ← phi( scrollup2/(const byte*) screen#0 scrollup2::@3/(byte*) scrollup2::line1#1 )
  [25] (byte*) scrollup2::line2#3 ← phi( scrollup2/(const byte*) screen#0+(byte) $28 scrollup2::@3/(byte*) scrollup2::line2#1 )
  to:scrollup2::@2
scrollup2::@2: scope:[scrollup2]  from scrollup2::@1 scrollup2::@2
  [26] (byte) scrollup2::c#2 ← phi( scrollup2::@1/(byte) 0 scrollup2::@2/(byte) scrollup2::c#1 )
  [26] (byte*) scrollup2::line1#2 ← phi( scrollup2::@1/(byte*) scrollup2::line1#3 scrollup2::@2/(byte*) scrollup2::line1#1 )
  [26] (byte*) scrollup2::line2#2 ← phi( scrollup2::@1/(byte*) scrollup2::line2#3 scrollup2::@2/(byte*) scrollup2::line2#1 )
  [27] *((byte*) scrollup2::line1#2) ← *((byte*) scrollup2::line2#2)
  [28] (byte*) scrollup2::line1#1 ← ++ (byte*) scrollup2::line1#2
  [29] (byte*) scrollup2::line2#1 ← ++ (byte*) scrollup2::line2#2
  [30] (byte) scrollup2::c#1 ← ++ (byte) scrollup2::c#2
  [31] if((byte) scrollup2::c#1!=(byte) $28) goto scrollup2::@2
  to:scrollup2::@3
scrollup2::@3: scope:[scrollup2]  from scrollup2::@2
  [32] (byte) scrollup2::l#1 ← ++ (byte) scrollup2::l#4
  [33] if((byte) scrollup2::l#1!=(byte) $18) goto scrollup2::@1
  to:scrollup2::@return
scrollup2::@return: scope:[scrollup2]  from scrollup2::@3
  [34] return 
  to:@return
scrollup1: scope:[scrollup1]  from main
  [35] phi()
  to:scrollup1::@1
scrollup1::@1: scope:[scrollup1]  from scrollup1 scrollup1::@3
  [36] (word) scrollup1::line#4 ← phi( scrollup1/(byte) 0 scrollup1::@3/(word) scrollup1::line#1 )
  to:scrollup1::@2
scrollup1::@2: scope:[scrollup1]  from scrollup1::@1 scrollup1::@2
  [37] (byte) scrollup1::c#2 ← phi( scrollup1::@1/(byte) 0 scrollup1::@2/(byte) scrollup1::c#1 )
  [38] (word~) scrollup1::$0 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2
  [39] (word~) scrollup1::$2 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2
  [40] (byte*~) scrollup1::$5 ← (const byte*) screen#0+(byte) $28 + (word~) scrollup1::$2
  [41] (byte*~) scrollup1::$6 ← (const byte*) screen#0 + (word~) scrollup1::$0
  [42] *((byte*~) scrollup1::$6) ← *((byte*~) scrollup1::$5)
  [43] (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#2
  [44] if((byte) scrollup1::c#1<(byte) $28) goto scrollup1::@2
  to:scrollup1::@3
scrollup1::@3: scope:[scrollup1]  from scrollup1::@2
  [45] (word) scrollup1::line#1 ← (word) scrollup1::line#4 + (byte) $28
  [46] if((word) scrollup1::line#1<(word)(number) $28*(number) $18) goto scrollup1::@1
  to:scrollup1::@return
scrollup1::@return: scope:[scrollup1]  from scrollup1::@3
  [47] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(void()) main()
(byte*) screen
(void()) scrollup1()
(word~) scrollup1::$0 67.33333333333333
(word~) scrollup1::$2 202.0
(byte*~) scrollup1::$5 101.0
(byte*~) scrollup1::$6 202.0
(byte) scrollup1::c
(byte) scrollup1::c#1 151.5
(byte) scrollup1::c#2 67.33333333333333
(word) scrollup1::line
(word) scrollup1::line#1 16.5
(word) scrollup1::line#4 24.888888888888886
(void()) scrollup2()
(byte) scrollup2::c
(byte) scrollup2::c#1 151.5
(byte) scrollup2::c#2 50.5
(byte) scrollup2::l
(byte) scrollup2::l#1 16.5
(byte) scrollup2::l#4 3.142857142857143
(byte*) scrollup2::line1
(byte*) scrollup2::line1#1 35.5
(byte*) scrollup2::line1#2 157.0
(byte*) scrollup2::line1#3 22.0
(byte*) scrollup2::line2
(byte*) scrollup2::line2#1 42.599999999999994
(byte*) scrollup2::line2#2 104.66666666666666
(byte*) scrollup2::line2#3 22.0
(void()) scrollup3()
(byte*~) scrollup3::$3 101.0
(byte*~) scrollup3::$4 202.0
(byte) scrollup3::c
(byte) scrollup3::c#1 151.5
(byte) scrollup3::c#2 40.4
(word) scrollup3::l2
(word) scrollup3::l2#0 3.666666666666667
(word) scrollup3::l2#1 67.33333333333333
(word) scrollup3::l2#2 103.75
(word~) scrollup3::l2#4 22.0
(word) scrollup3::line
(word) scrollup3::line#1 16.5

Initial phi equivalence classes
[ scrollup3::l2#0 scrollup3::line#1 ]
[ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ]
[ scrollup3::c#2 scrollup3::c#1 ]
[ scrollup2::l#4 scrollup2::l#1 ]
[ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ]
[ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ]
[ scrollup2::c#2 scrollup2::c#1 ]
[ scrollup1::line#4 scrollup1::line#1 ]
[ scrollup1::c#2 scrollup1::c#1 ]
Added variable scrollup3::$3 to zero page equivalence class [ scrollup3::$3 ]
Added variable scrollup3::$4 to zero page equivalence class [ scrollup3::$4 ]
Added variable scrollup1::$0 to zero page equivalence class [ scrollup1::$0 ]
Added variable scrollup1::$2 to zero page equivalence class [ scrollup1::$2 ]
Added variable scrollup1::$5 to zero page equivalence class [ scrollup1::$5 ]
Added variable scrollup1::$6 to zero page equivalence class [ scrollup1::$6 ]
Complete equivalence classes
[ scrollup3::l2#0 scrollup3::line#1 ]
[ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ]
[ scrollup3::c#2 scrollup3::c#1 ]
[ scrollup2::l#4 scrollup2::l#1 ]
[ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ]
[ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ]
[ scrollup2::c#2 scrollup2::c#1 ]
[ scrollup1::line#4 scrollup1::line#1 ]
[ scrollup1::c#2 scrollup1::c#1 ]
[ scrollup3::$3 ]
[ scrollup3::$4 ]
[ scrollup1::$0 ]
[ scrollup1::$2 ]
[ scrollup1::$5 ]
[ scrollup1::$6 ]
Allocated zp ZP_WORD:2 [ scrollup3::l2#0 scrollup3::line#1 ]
Allocated zp ZP_WORD:4 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ]
Allocated zp ZP_BYTE:6 [ scrollup3::c#2 scrollup3::c#1 ]
Allocated zp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ]
Allocated zp ZP_WORD:8 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ]
Allocated zp ZP_WORD:10 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ]
Allocated zp ZP_BYTE:12 [ scrollup2::c#2 scrollup2::c#1 ]
Allocated zp ZP_WORD:13 [ scrollup1::line#4 scrollup1::line#1 ]
Allocated zp ZP_BYTE:15 [ scrollup1::c#2 scrollup1::c#1 ]
Allocated zp ZP_WORD:16 [ scrollup3::$3 ]
Allocated zp ZP_WORD:18 [ scrollup3::$4 ]
Allocated zp ZP_WORD:20 [ scrollup1::$0 ]
Allocated zp ZP_WORD:22 [ scrollup1::$2 ]
Allocated zp ZP_WORD:24 [ scrollup1::$5 ]
Allocated zp ZP_WORD:26 [ scrollup1::$6 ]

INITIAL ASM
  // File Comments
// Tests different ways of scrolling up the screen
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label screen = $400
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from_b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    // [5] call scrollup1 
    // [35] phi from main to scrollup1 [phi:main->scrollup1]
  scrollup1_from_main:
    jsr scrollup1
    // [6] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    jmp b1
    // main::@1
  b1:
    // [7] call scrollup2 
    // [24] phi from main::@1 to scrollup2 [phi:main::@1->scrollup2]
  scrollup2_from_b1:
    jsr scrollup2
    // [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  b2_from_b1:
    jmp b2
    // main::@2
  b2:
    // [9] call scrollup3 
    // [11] phi from main::@2 to scrollup3 [phi:main::@2->scrollup3]
  scrollup3_from_b2:
    jsr scrollup3
    jmp breturn
    // main::@return
  breturn:
    // [10] return 
    rts
}
  // scrollup3
scrollup3: {
    .label l2 = 2
    .label l2_1 = 4
    .label c = 6
    .label line = 2
    .label l2_2 = 4
    .label _3 = $10
    .label _4 = $12
    .label l2_4 = 4
    // [12] phi from scrollup3 to scrollup3::@1 [phi:scrollup3->scrollup3::@1]
  b1_from_scrollup3:
    // [12] phi (word) scrollup3::l2#0 = (byte) 0 [phi:scrollup3->scrollup3::@1#0] -- vwuz1=vbuc1 
    lda #<0
    sta l2
    lda #>0
    sta l2+1
    jmp b1
    // [12] phi from scrollup3::@3 to scrollup3::@1 [phi:scrollup3::@3->scrollup3::@1]
  b1_from_b3:
    // [12] phi (word) scrollup3::l2#0 = (word) scrollup3::line#1 [phi:scrollup3::@3->scrollup3::@1#0] -- register_copy 
    jmp b1
    // scrollup3::@1
  b1:
    // [13] (word~) scrollup3::l2#4 ← (word) scrollup3::l2#0 -- vwuz1=vwuz2 
    lda l2
    sta l2_4
    lda l2+1
    sta l2_4+1
    // [14] phi from scrollup3::@1 to scrollup3::@2 [phi:scrollup3::@1->scrollup3::@2]
  b2_from_b1:
    // [14] phi (byte) scrollup3::c#2 = (byte) 0 [phi:scrollup3::@1->scrollup3::@2#0] -- vbuz1=vbuc1 
    lda #0
    sta c
    // [14] phi (word) scrollup3::l2#2 = (word~) scrollup3::l2#4 [phi:scrollup3::@1->scrollup3::@2#1] -- register_copy 
    jmp b2
    // [14] phi from scrollup3::@2 to scrollup3::@2 [phi:scrollup3::@2->scrollup3::@2]
  b2_from_b2:
    // [14] phi (byte) scrollup3::c#2 = (byte) scrollup3::c#1 [phi:scrollup3::@2->scrollup3::@2#0] -- register_copy 
    // [14] phi (word) scrollup3::l2#2 = (word) scrollup3::l2#1 [phi:scrollup3::@2->scrollup3::@2#1] -- register_copy 
    jmp b2
    // scrollup3::@2
  b2:
    // [15] (byte*~) scrollup3::$3 ← (const byte*) screen#0+(byte) $28 + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2 
    lda l2_2
    clc
    adc #<screen+$28
    sta _3
    lda l2_2+1
    adc #>screen+$28
    sta _3+1
    // [16] (byte*~) scrollup3::$4 ← (const byte*) screen#0 + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2 
    lda l2_2
    clc
    adc #<screen
    sta _4
    lda l2_2+1
    adc #>screen
    sta _4+1
    // [17] *((byte*~) scrollup3::$4) ← *((byte*~) scrollup3::$3) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (_3),y
    ldy #0
    sta (_4),y
    // [18] (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2 -- vwuz1=_inc_vwuz1 
    inc l2_1
    bne !+
    inc l2_1+1
  !:
    // [19] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#2 -- vbuz1=_inc_vbuz1 
    inc c
    // [20] if((byte) scrollup3::c#1<(byte) $28) goto scrollup3::@2 -- vbuz1_lt_vbuc1_then_la1 
    lda c
    cmp #$28
    bcc b2_from_b2
    jmp b3
    // scrollup3::@3
  b3:
    // [21] (word) scrollup3::line#1 ← (word) scrollup3::l2#0 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc line
    sta line
    bcc !+
    inc line+1
  !:
    // [22] if((word) scrollup3::line#1<(word)(number) $28*(number) $18) goto scrollup3::@1 -- vwuz1_lt_vwuc1_then_la1 
    lda line+1
    cmp #>$28*$18
    bcc b1_from_b3
    bne !+
    lda line
    cmp #<$28*$18
    bcc b1_from_b3
  !:
    jmp breturn
    // scrollup3::@return
  breturn:
    // [23] return 
    rts
}
  // scrollup2
scrollup2: {
    .label line1 = $a
    .label line2 = 8
    .label c = $c
    .label l = 7
    // [25] phi from scrollup2 to scrollup2::@1 [phi:scrollup2->scrollup2::@1]
  b1_from_scrollup2:
    // [25] phi (byte) scrollup2::l#4 = (byte) 0 [phi:scrollup2->scrollup2::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta l
    // [25] phi (byte*) scrollup2::line1#3 = (const byte*) screen#0 [phi:scrollup2->scrollup2::@1#1] -- pbuz1=pbuc1 
    lda #<screen
    sta line1
    lda #>screen
    sta line1+1
    // [25] phi (byte*) scrollup2::line2#3 = (const byte*) screen#0+(byte) $28 [phi:scrollup2->scrollup2::@1#2] -- pbuz1=pbuc1 
    lda #<screen+$28
    sta line2
    lda #>screen+$28
    sta line2+1
    jmp b1
    // [25] phi from scrollup2::@3 to scrollup2::@1 [phi:scrollup2::@3->scrollup2::@1]
  b1_from_b3:
    // [25] phi (byte) scrollup2::l#4 = (byte) scrollup2::l#1 [phi:scrollup2::@3->scrollup2::@1#0] -- register_copy 
    // [25] phi (byte*) scrollup2::line1#3 = (byte*) scrollup2::line1#1 [phi:scrollup2::@3->scrollup2::@1#1] -- register_copy 
    // [25] phi (byte*) scrollup2::line2#3 = (byte*) scrollup2::line2#1 [phi:scrollup2::@3->scrollup2::@1#2] -- register_copy 
    jmp b1
    // scrollup2::@1
  b1:
    // [26] phi from scrollup2::@1 to scrollup2::@2 [phi:scrollup2::@1->scrollup2::@2]
  b2_from_b1:
    // [26] phi (byte) scrollup2::c#2 = (byte) 0 [phi:scrollup2::@1->scrollup2::@2#0] -- vbuz1=vbuc1 
    lda #0
    sta c
    // [26] phi (byte*) scrollup2::line1#2 = (byte*) scrollup2::line1#3 [phi:scrollup2::@1->scrollup2::@2#1] -- register_copy 
    // [26] phi (byte*) scrollup2::line2#2 = (byte*) scrollup2::line2#3 [phi:scrollup2::@1->scrollup2::@2#2] -- register_copy 
    jmp b2
    // [26] phi from scrollup2::@2 to scrollup2::@2 [phi:scrollup2::@2->scrollup2::@2]
  b2_from_b2:
    // [26] phi (byte) scrollup2::c#2 = (byte) scrollup2::c#1 [phi:scrollup2::@2->scrollup2::@2#0] -- register_copy 
    // [26] phi (byte*) scrollup2::line1#2 = (byte*) scrollup2::line1#1 [phi:scrollup2::@2->scrollup2::@2#1] -- register_copy 
    // [26] phi (byte*) scrollup2::line2#2 = (byte*) scrollup2::line2#1 [phi:scrollup2::@2->scrollup2::@2#2] -- register_copy 
    jmp b2
    // scrollup2::@2
  b2:
    // [27] *((byte*) scrollup2::line1#2) ← *((byte*) scrollup2::line2#2) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (line2),y
    ldy #0
    sta (line1),y
    // [28] (byte*) scrollup2::line1#1 ← ++ (byte*) scrollup2::line1#2 -- pbuz1=_inc_pbuz1 
    inc line1
    bne !+
    inc line1+1
  !:
    // [29] (byte*) scrollup2::line2#1 ← ++ (byte*) scrollup2::line2#2 -- pbuz1=_inc_pbuz1 
    inc line2
    bne !+
    inc line2+1
  !:
    // [30] (byte) scrollup2::c#1 ← ++ (byte) scrollup2::c#2 -- vbuz1=_inc_vbuz1 
    inc c
    // [31] if((byte) scrollup2::c#1!=(byte) $28) goto scrollup2::@2 -- vbuz1_neq_vbuc1_then_la1 
    lda #$28
    cmp c
    bne b2_from_b2
    jmp b3
    // scrollup2::@3
  b3:
    // [32] (byte) scrollup2::l#1 ← ++ (byte) scrollup2::l#4 -- vbuz1=_inc_vbuz1 
    inc l
    // [33] if((byte) scrollup2::l#1!=(byte) $18) goto scrollup2::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #$18
    cmp l
    bne b1_from_b3
    jmp breturn
    // scrollup2::@return
  breturn:
    // [34] return 
    rts
}
  // scrollup1
scrollup1: {
    .label _0 = $14
    .label _2 = $16
    .label c = $f
    .label line = $d
    .label _5 = $18
    .label _6 = $1a
    // [36] phi from scrollup1 to scrollup1::@1 [phi:scrollup1->scrollup1::@1]
  b1_from_scrollup1:
    // [36] phi (word) scrollup1::line#4 = (byte) 0 [phi:scrollup1->scrollup1::@1#0] -- vwuz1=vbuc1 
    lda #<0
    sta line
    lda #>0
    sta line+1
    jmp b1
    // [36] phi from scrollup1::@3 to scrollup1::@1 [phi:scrollup1::@3->scrollup1::@1]
  b1_from_b3:
    // [36] phi (word) scrollup1::line#4 = (word) scrollup1::line#1 [phi:scrollup1::@3->scrollup1::@1#0] -- register_copy 
    jmp b1
    // scrollup1::@1
  b1:
    // [37] phi from scrollup1::@1 to scrollup1::@2 [phi:scrollup1::@1->scrollup1::@2]
  b2_from_b1:
    // [37] phi (byte) scrollup1::c#2 = (byte) 0 [phi:scrollup1::@1->scrollup1::@2#0] -- vbuz1=vbuc1 
    lda #0
    sta c
    jmp b2
    // [37] phi from scrollup1::@2 to scrollup1::@2 [phi:scrollup1::@2->scrollup1::@2]
  b2_from_b2:
    // [37] phi (byte) scrollup1::c#2 = (byte) scrollup1::c#1 [phi:scrollup1::@2->scrollup1::@2#0] -- register_copy 
    jmp b2
    // scrollup1::@2
  b2:
    // [38] (word~) scrollup1::$0 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuz3 
    lda c
    clc
    adc line
    sta _0
    lda #0
    adc line+1
    sta _0+1
    // [39] (word~) scrollup1::$2 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuz3 
    lda c
    clc
    adc line
    sta _2
    lda #0
    adc line+1
    sta _2+1
    // [40] (byte*~) scrollup1::$5 ← (const byte*) screen#0+(byte) $28 + (word~) scrollup1::$2 -- pbuz1=pbuc1_plus_vwuz2 
    lda _2
    clc
    adc #<screen+$28
    sta _5
    lda _2+1
    adc #>screen+$28
    sta _5+1
    // [41] (byte*~) scrollup1::$6 ← (const byte*) screen#0 + (word~) scrollup1::$0 -- pbuz1=pbuc1_plus_vwuz2 
    lda _0
    clc
    adc #<screen
    sta _6
    lda _0+1
    adc #>screen
    sta _6+1
    // [42] *((byte*~) scrollup1::$6) ← *((byte*~) scrollup1::$5) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (_5),y
    ldy #0
    sta (_6),y
    // [43] (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#2 -- vbuz1=_inc_vbuz1 
    inc c
    // [44] if((byte) scrollup1::c#1<(byte) $28) goto scrollup1::@2 -- vbuz1_lt_vbuc1_then_la1 
    lda c
    cmp #$28
    bcc b2_from_b2
    jmp b3
    // scrollup1::@3
  b3:
    // [45] (word) scrollup1::line#1 ← (word) scrollup1::line#4 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc line
    sta line
    bcc !+
    inc line+1
  !:
    // [46] if((word) scrollup1::line#1<(word)(number) $28*(number) $18) goto scrollup1::@1 -- vwuz1_lt_vwuc1_then_la1 
    lda line+1
    cmp #>$28*$18
    bcc b1_from_b3
    bne !+
    lda line
    cmp #<$28*$18
    bcc b1_from_b3
  !:
    jmp breturn
    // scrollup1::@return
  breturn:
    // [47] return 
    rts
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [13] (word~) scrollup3::l2#4 ← (word) scrollup3::l2#0 [ scrollup3::l2#0 scrollup3::l2#4 ] ( main:2::scrollup3:9 [ scrollup3::l2#0 scrollup3::l2#4 ] ) always clobbers reg byte a 
Statement [15] (byte*~) scrollup3::$3 ← (const byte*) screen#0+(byte) $28 + (word) scrollup3::l2#2 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 scrollup3::$3 ] ( main:2::scrollup3:9 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 scrollup3::$3 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ scrollup3::c#2 scrollup3::c#1 ]
Statement [16] (byte*~) scrollup3::$4 ← (const byte*) screen#0 + (word) scrollup3::l2#2 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 scrollup3::$3 scrollup3::$4 ] ( main:2::scrollup3:9 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 scrollup3::$3 scrollup3::$4 ] ) always clobbers reg byte a 
Statement [17] *((byte*~) scrollup3::$4) ← *((byte*~) scrollup3::$3) [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 ] ( main:2::scrollup3:9 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 ] ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ scrollup3::c#2 scrollup3::c#1 ]
Statement [21] (word) scrollup3::line#1 ← (word) scrollup3::l2#0 + (byte) $28 [ scrollup3::line#1 ] ( main:2::scrollup3:9 [ scrollup3::line#1 ] ) always clobbers reg byte a 
Statement [22] if((word) scrollup3::line#1<(word)(number) $28*(number) $18) goto scrollup3::@1 [ scrollup3::line#1 ] ( main:2::scrollup3:9 [ scrollup3::line#1 ] ) always clobbers reg byte a 
Statement [27] *((byte*) scrollup2::line1#2) ← *((byte*) scrollup2::line2#2) [ scrollup2::l#4 scrollup2::line2#2 scrollup2::line1#2 scrollup2::c#2 ] ( main:2::scrollup2:7 [ scrollup2::l#4 scrollup2::line2#2 scrollup2::line1#2 scrollup2::c#2 ] ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:12 [ scrollup2::c#2 scrollup2::c#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:12 [ scrollup2::c#2 scrollup2::c#1 ]
Statement [38] (word~) scrollup1::$0 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:15 [ scrollup1::c#2 scrollup1::c#1 ]
Statement [39] (word~) scrollup1::$2 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 scrollup1::$2 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 scrollup1::$2 ] ) always clobbers reg byte a 
Statement [40] (byte*~) scrollup1::$5 ← (const byte*) screen#0+(byte) $28 + (word~) scrollup1::$2 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 scrollup1::$5 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 scrollup1::$5 ] ) always clobbers reg byte a 
Statement [41] (byte*~) scrollup1::$6 ← (const byte*) screen#0 + (word~) scrollup1::$0 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$5 scrollup1::$6 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$5 scrollup1::$6 ] ) always clobbers reg byte a 
Statement [42] *((byte*~) scrollup1::$6) ← *((byte*~) scrollup1::$5) [ scrollup1::line#4 scrollup1::c#2 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 ] ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:15 [ scrollup1::c#2 scrollup1::c#1 ]
Statement [45] (word) scrollup1::line#1 ← (word) scrollup1::line#4 + (byte) $28 [ scrollup1::line#1 ] ( main:2::scrollup1:5 [ scrollup1::line#1 ] ) always clobbers reg byte a 
Statement [46] if((word) scrollup1::line#1<(word)(number) $28*(number) $18) goto scrollup1::@1 [ scrollup1::line#1 ] ( main:2::scrollup1:5 [ scrollup1::line#1 ] ) always clobbers reg byte a 
Statement [13] (word~) scrollup3::l2#4 ← (word) scrollup3::l2#0 [ scrollup3::l2#0 scrollup3::l2#4 ] ( main:2::scrollup3:9 [ scrollup3::l2#0 scrollup3::l2#4 ] ) always clobbers reg byte a 
Statement [15] (byte*~) scrollup3::$3 ← (const byte*) screen#0+(byte) $28 + (word) scrollup3::l2#2 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 scrollup3::$3 ] ( main:2::scrollup3:9 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 scrollup3::$3 ] ) always clobbers reg byte a 
Statement [16] (byte*~) scrollup3::$4 ← (const byte*) screen#0 + (word) scrollup3::l2#2 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 scrollup3::$3 scrollup3::$4 ] ( main:2::scrollup3:9 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 scrollup3::$3 scrollup3::$4 ] ) always clobbers reg byte a 
Statement [17] *((byte*~) scrollup3::$4) ← *((byte*~) scrollup3::$3) [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 ] ( main:2::scrollup3:9 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 ] ) always clobbers reg byte a reg byte y 
Statement [21] (word) scrollup3::line#1 ← (word) scrollup3::l2#0 + (byte) $28 [ scrollup3::line#1 ] ( main:2::scrollup3:9 [ scrollup3::line#1 ] ) always clobbers reg byte a 
Statement [22] if((word) scrollup3::line#1<(word)(number) $28*(number) $18) goto scrollup3::@1 [ scrollup3::line#1 ] ( main:2::scrollup3:9 [ scrollup3::line#1 ] ) always clobbers reg byte a 
Statement [27] *((byte*) scrollup2::line1#2) ← *((byte*) scrollup2::line2#2) [ scrollup2::l#4 scrollup2::line2#2 scrollup2::line1#2 scrollup2::c#2 ] ( main:2::scrollup2:7 [ scrollup2::l#4 scrollup2::line2#2 scrollup2::line1#2 scrollup2::c#2 ] ) always clobbers reg byte a reg byte y 
Statement [38] (word~) scrollup1::$0 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 ] ) always clobbers reg byte a 
Statement [39] (word~) scrollup1::$2 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 scrollup1::$2 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 scrollup1::$2 ] ) always clobbers reg byte a 
Statement [40] (byte*~) scrollup1::$5 ← (const byte*) screen#0+(byte) $28 + (word~) scrollup1::$2 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 scrollup1::$5 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 scrollup1::$5 ] ) always clobbers reg byte a 
Statement [41] (byte*~) scrollup1::$6 ← (const byte*) screen#0 + (word~) scrollup1::$0 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$5 scrollup1::$6 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$5 scrollup1::$6 ] ) always clobbers reg byte a 
Statement [42] *((byte*~) scrollup1::$6) ← *((byte*~) scrollup1::$5) [ scrollup1::line#4 scrollup1::c#2 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 ] ) always clobbers reg byte a reg byte y 
Statement [45] (word) scrollup1::line#1 ← (word) scrollup1::line#4 + (byte) $28 [ scrollup1::line#1 ] ( main:2::scrollup1:5 [ scrollup1::line#1 ] ) always clobbers reg byte a 
Statement [46] if((word) scrollup1::line#1<(word)(number) $28*(number) $18) goto scrollup1::@1 [ scrollup1::line#1 ] ( main:2::scrollup1:5 [ scrollup1::line#1 ] ) always clobbers reg byte a 
Potential registers zp ZP_WORD:2 [ scrollup3::l2#0 scrollup3::line#1 ] : zp ZP_WORD:2 , 
Potential registers zp ZP_WORD:4 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ] : zp ZP_WORD:4 , 
Potential registers zp ZP_BYTE:6 [ scrollup3::c#2 scrollup3::c#1 ] : zp ZP_BYTE:6 , reg byte x , 
Potential registers zp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ] : zp ZP_BYTE:7 , reg byte x , 
Potential registers zp ZP_WORD:8 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ] : zp ZP_WORD:8 , 
Potential registers zp ZP_WORD:10 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ] : zp ZP_WORD:10 , 
Potential registers zp ZP_BYTE:12 [ scrollup2::c#2 scrollup2::c#1 ] : zp ZP_BYTE:12 , reg byte x , 
Potential registers zp ZP_WORD:13 [ scrollup1::line#4 scrollup1::line#1 ] : zp ZP_WORD:13 , 
Potential registers zp ZP_BYTE:15 [ scrollup1::c#2 scrollup1::c#1 ] : zp ZP_BYTE:15 , reg byte x , 
Potential registers zp ZP_WORD:16 [ scrollup3::$3 ] : zp ZP_WORD:16 , 
Potential registers zp ZP_WORD:18 [ scrollup3::$4 ] : zp ZP_WORD:18 , 
Potential registers zp ZP_WORD:20 [ scrollup1::$0 ] : zp ZP_WORD:20 , 
Potential registers zp ZP_WORD:22 [ scrollup1::$2 ] : zp ZP_WORD:22 , 
Potential registers zp ZP_WORD:24 [ scrollup1::$5 ] : zp ZP_WORD:24 , 
Potential registers zp ZP_WORD:26 [ scrollup1::$6 ] : zp ZP_WORD:26 , 

REGISTER UPLIFT SCOPES
Uplift Scope [scrollup1] 218.83: zp ZP_BYTE:15 [ scrollup1::c#2 scrollup1::c#1 ] 202: zp ZP_WORD:22 [ scrollup1::$2 ] 202: zp ZP_WORD:26 [ scrollup1::$6 ] 101: zp ZP_WORD:24 [ scrollup1::$5 ] 67.33: zp ZP_WORD:20 [ scrollup1::$0 ] 41.39: zp ZP_WORD:13 [ scrollup1::line#4 scrollup1::line#1 ] 
Uplift Scope [scrollup3] 202: zp ZP_WORD:18 [ scrollup3::$4 ] 193.08: zp ZP_WORD:4 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ] 191.9: zp ZP_BYTE:6 [ scrollup3::c#2 scrollup3::c#1 ] 101: zp ZP_WORD:16 [ scrollup3::$3 ] 20.17: zp ZP_WORD:2 [ scrollup3::l2#0 scrollup3::line#1 ] 
Uplift Scope [scrollup2] 214.5: zp ZP_WORD:10 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ] 202: zp ZP_BYTE:12 [ scrollup2::c#2 scrollup2::c#1 ] 169.27: zp ZP_WORD:8 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ] 19.64: zp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ] 
Uplift Scope [main] 
Uplift Scope [] 

Uplifting [scrollup1] best 27978 combination reg byte x [ scrollup1::c#2 scrollup1::c#1 ] zp ZP_WORD:22 [ scrollup1::$2 ] zp ZP_WORD:26 [ scrollup1::$6 ] zp ZP_WORD:24 [ scrollup1::$5 ] zp ZP_WORD:20 [ scrollup1::$0 ] zp ZP_WORD:13 [ scrollup1::line#4 scrollup1::line#1 ] 
Uplifting [scrollup3] best 27078 combination zp ZP_WORD:18 [ scrollup3::$4 ] zp ZP_WORD:4 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ] reg byte x [ scrollup3::c#2 scrollup3::c#1 ] zp ZP_WORD:16 [ scrollup3::$3 ] zp ZP_WORD:2 [ scrollup3::l2#0 scrollup3::line#1 ] 
Uplifting [scrollup2] best 26178 combination zp ZP_WORD:10 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ] reg byte x [ scrollup2::c#2 scrollup2::c#1 ] zp ZP_WORD:8 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ] zp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ] 
Uplifting [main] best 26178 combination 
Uplifting [] best 26178 combination 
Attempting to uplift remaining variables inzp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ]
Uplifting [scrollup2] best 26178 combination zp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ] 
Coalescing zero page register with common assignment [ zp ZP_WORD:20 [ scrollup1::$0 ] ] with [ zp ZP_WORD:26 [ scrollup1::$6 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:22 [ scrollup1::$2 ] ] with [ zp ZP_WORD:24 [ scrollup1::$5 ] ] - score: 1
Allocated (was zp ZP_BYTE:7) zp ZP_BYTE:6 [ scrollup2::l#4 scrollup2::l#1 ]
Allocated (was zp ZP_WORD:8) zp ZP_WORD:7 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ]
Allocated (was zp ZP_WORD:10) zp ZP_WORD:9 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ]
Allocated (was zp ZP_WORD:13) zp ZP_WORD:11 [ scrollup1::line#4 scrollup1::line#1 ]
Allocated (was zp ZP_WORD:16) zp ZP_WORD:13 [ scrollup3::$3 ]
Allocated (was zp ZP_WORD:18) zp ZP_WORD:15 [ scrollup3::$4 ]
Allocated (was zp ZP_WORD:20) zp ZP_WORD:17 [ scrollup1::$0 scrollup1::$6 ]
Allocated (was zp ZP_WORD:22) zp ZP_WORD:19 [ scrollup1::$2 scrollup1::$5 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Tests different ways of scrolling up the screen
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label screen = $400
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from_b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    // [5] call scrollup1 
    // [35] phi from main to scrollup1 [phi:main->scrollup1]
  scrollup1_from_main:
    jsr scrollup1
    // [6] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    jmp b1
    // main::@1
  b1:
    // [7] call scrollup2 
    // [24] phi from main::@1 to scrollup2 [phi:main::@1->scrollup2]
  scrollup2_from_b1:
    jsr scrollup2
    // [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  b2_from_b1:
    jmp b2
    // main::@2
  b2:
    // [9] call scrollup3 
    // [11] phi from main::@2 to scrollup3 [phi:main::@2->scrollup3]
  scrollup3_from_b2:
    jsr scrollup3
    jmp breturn
    // main::@return
  breturn:
    // [10] return 
    rts
}
  // scrollup3
scrollup3: {
    .label l2 = 2
    .label l2_1 = 4
    .label line = 2
    .label l2_2 = 4
    .label _3 = $d
    .label _4 = $f
    .label l2_4 = 4
    // [12] phi from scrollup3 to scrollup3::@1 [phi:scrollup3->scrollup3::@1]
  b1_from_scrollup3:
    // [12] phi (word) scrollup3::l2#0 = (byte) 0 [phi:scrollup3->scrollup3::@1#0] -- vwuz1=vbuc1 
    lda #<0
    sta l2
    lda #>0
    sta l2+1
    jmp b1
    // [12] phi from scrollup3::@3 to scrollup3::@1 [phi:scrollup3::@3->scrollup3::@1]
  b1_from_b3:
    // [12] phi (word) scrollup3::l2#0 = (word) scrollup3::line#1 [phi:scrollup3::@3->scrollup3::@1#0] -- register_copy 
    jmp b1
    // scrollup3::@1
  b1:
    // [13] (word~) scrollup3::l2#4 ← (word) scrollup3::l2#0 -- vwuz1=vwuz2 
    lda l2
    sta l2_4
    lda l2+1
    sta l2_4+1
    // [14] phi from scrollup3::@1 to scrollup3::@2 [phi:scrollup3::@1->scrollup3::@2]
  b2_from_b1:
    // [14] phi (byte) scrollup3::c#2 = (byte) 0 [phi:scrollup3::@1->scrollup3::@2#0] -- vbuxx=vbuc1 
    ldx #0
    // [14] phi (word) scrollup3::l2#2 = (word~) scrollup3::l2#4 [phi:scrollup3::@1->scrollup3::@2#1] -- register_copy 
    jmp b2
    // [14] phi from scrollup3::@2 to scrollup3::@2 [phi:scrollup3::@2->scrollup3::@2]
  b2_from_b2:
    // [14] phi (byte) scrollup3::c#2 = (byte) scrollup3::c#1 [phi:scrollup3::@2->scrollup3::@2#0] -- register_copy 
    // [14] phi (word) scrollup3::l2#2 = (word) scrollup3::l2#1 [phi:scrollup3::@2->scrollup3::@2#1] -- register_copy 
    jmp b2
    // scrollup3::@2
  b2:
    // [15] (byte*~) scrollup3::$3 ← (const byte*) screen#0+(byte) $28 + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2 
    lda l2_2
    clc
    adc #<screen+$28
    sta _3
    lda l2_2+1
    adc #>screen+$28
    sta _3+1
    // [16] (byte*~) scrollup3::$4 ← (const byte*) screen#0 + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2 
    lda l2_2
    clc
    adc #<screen
    sta _4
    lda l2_2+1
    adc #>screen
    sta _4+1
    // [17] *((byte*~) scrollup3::$4) ← *((byte*~) scrollup3::$3) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (_3),y
    ldy #0
    sta (_4),y
    // [18] (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2 -- vwuz1=_inc_vwuz1 
    inc l2_1
    bne !+
    inc l2_1+1
  !:
    // [19] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#2 -- vbuxx=_inc_vbuxx 
    inx
    // [20] if((byte) scrollup3::c#1<(byte) $28) goto scrollup3::@2 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$28
    bcc b2_from_b2
    jmp b3
    // scrollup3::@3
  b3:
    // [21] (word) scrollup3::line#1 ← (word) scrollup3::l2#0 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc line
    sta line
    bcc !+
    inc line+1
  !:
    // [22] if((word) scrollup3::line#1<(word)(number) $28*(number) $18) goto scrollup3::@1 -- vwuz1_lt_vwuc1_then_la1 
    lda line+1
    cmp #>$28*$18
    bcc b1_from_b3
    bne !+
    lda line
    cmp #<$28*$18
    bcc b1_from_b3
  !:
    jmp breturn
    // scrollup3::@return
  breturn:
    // [23] return 
    rts
}
  // scrollup2
scrollup2: {
    .label line1 = 9
    .label line2 = 7
    .label l = 6
    // [25] phi from scrollup2 to scrollup2::@1 [phi:scrollup2->scrollup2::@1]
  b1_from_scrollup2:
    // [25] phi (byte) scrollup2::l#4 = (byte) 0 [phi:scrollup2->scrollup2::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta l
    // [25] phi (byte*) scrollup2::line1#3 = (const byte*) screen#0 [phi:scrollup2->scrollup2::@1#1] -- pbuz1=pbuc1 
    lda #<screen
    sta line1
    lda #>screen
    sta line1+1
    // [25] phi (byte*) scrollup2::line2#3 = (const byte*) screen#0+(byte) $28 [phi:scrollup2->scrollup2::@1#2] -- pbuz1=pbuc1 
    lda #<screen+$28
    sta line2
    lda #>screen+$28
    sta line2+1
    jmp b1
    // [25] phi from scrollup2::@3 to scrollup2::@1 [phi:scrollup2::@3->scrollup2::@1]
  b1_from_b3:
    // [25] phi (byte) scrollup2::l#4 = (byte) scrollup2::l#1 [phi:scrollup2::@3->scrollup2::@1#0] -- register_copy 
    // [25] phi (byte*) scrollup2::line1#3 = (byte*) scrollup2::line1#1 [phi:scrollup2::@3->scrollup2::@1#1] -- register_copy 
    // [25] phi (byte*) scrollup2::line2#3 = (byte*) scrollup2::line2#1 [phi:scrollup2::@3->scrollup2::@1#2] -- register_copy 
    jmp b1
    // scrollup2::@1
  b1:
    // [26] phi from scrollup2::@1 to scrollup2::@2 [phi:scrollup2::@1->scrollup2::@2]
  b2_from_b1:
    // [26] phi (byte) scrollup2::c#2 = (byte) 0 [phi:scrollup2::@1->scrollup2::@2#0] -- vbuxx=vbuc1 
    ldx #0
    // [26] phi (byte*) scrollup2::line1#2 = (byte*) scrollup2::line1#3 [phi:scrollup2::@1->scrollup2::@2#1] -- register_copy 
    // [26] phi (byte*) scrollup2::line2#2 = (byte*) scrollup2::line2#3 [phi:scrollup2::@1->scrollup2::@2#2] -- register_copy 
    jmp b2
    // [26] phi from scrollup2::@2 to scrollup2::@2 [phi:scrollup2::@2->scrollup2::@2]
  b2_from_b2:
    // [26] phi (byte) scrollup2::c#2 = (byte) scrollup2::c#1 [phi:scrollup2::@2->scrollup2::@2#0] -- register_copy 
    // [26] phi (byte*) scrollup2::line1#2 = (byte*) scrollup2::line1#1 [phi:scrollup2::@2->scrollup2::@2#1] -- register_copy 
    // [26] phi (byte*) scrollup2::line2#2 = (byte*) scrollup2::line2#1 [phi:scrollup2::@2->scrollup2::@2#2] -- register_copy 
    jmp b2
    // scrollup2::@2
  b2:
    // [27] *((byte*) scrollup2::line1#2) ← *((byte*) scrollup2::line2#2) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (line2),y
    ldy #0
    sta (line1),y
    // [28] (byte*) scrollup2::line1#1 ← ++ (byte*) scrollup2::line1#2 -- pbuz1=_inc_pbuz1 
    inc line1
    bne !+
    inc line1+1
  !:
    // [29] (byte*) scrollup2::line2#1 ← ++ (byte*) scrollup2::line2#2 -- pbuz1=_inc_pbuz1 
    inc line2
    bne !+
    inc line2+1
  !:
    // [30] (byte) scrollup2::c#1 ← ++ (byte) scrollup2::c#2 -- vbuxx=_inc_vbuxx 
    inx
    // [31] if((byte) scrollup2::c#1!=(byte) $28) goto scrollup2::@2 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$28
    bne b2_from_b2
    jmp b3
    // scrollup2::@3
  b3:
    // [32] (byte) scrollup2::l#1 ← ++ (byte) scrollup2::l#4 -- vbuz1=_inc_vbuz1 
    inc l
    // [33] if((byte) scrollup2::l#1!=(byte) $18) goto scrollup2::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #$18
    cmp l
    bne b1_from_b3
    jmp breturn
    // scrollup2::@return
  breturn:
    // [34] return 
    rts
}
  // scrollup1
scrollup1: {
    .label _0 = $11
    .label _2 = $13
    .label line = $b
    .label _5 = $13
    .label _6 = $11
    // [36] phi from scrollup1 to scrollup1::@1 [phi:scrollup1->scrollup1::@1]
  b1_from_scrollup1:
    // [36] phi (word) scrollup1::line#4 = (byte) 0 [phi:scrollup1->scrollup1::@1#0] -- vwuz1=vbuc1 
    lda #<0
    sta line
    lda #>0
    sta line+1
    jmp b1
    // [36] phi from scrollup1::@3 to scrollup1::@1 [phi:scrollup1::@3->scrollup1::@1]
  b1_from_b3:
    // [36] phi (word) scrollup1::line#4 = (word) scrollup1::line#1 [phi:scrollup1::@3->scrollup1::@1#0] -- register_copy 
    jmp b1
    // scrollup1::@1
  b1:
    // [37] phi from scrollup1::@1 to scrollup1::@2 [phi:scrollup1::@1->scrollup1::@2]
  b2_from_b1:
    // [37] phi (byte) scrollup1::c#2 = (byte) 0 [phi:scrollup1::@1->scrollup1::@2#0] -- vbuxx=vbuc1 
    ldx #0
    jmp b2
    // [37] phi from scrollup1::@2 to scrollup1::@2 [phi:scrollup1::@2->scrollup1::@2]
  b2_from_b2:
    // [37] phi (byte) scrollup1::c#2 = (byte) scrollup1::c#1 [phi:scrollup1::@2->scrollup1::@2#0] -- register_copy 
    jmp b2
    // scrollup1::@2
  b2:
    // [38] (word~) scrollup1::$0 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuxx 
    txa
    clc
    adc line
    sta _0
    lda #0
    adc line+1
    sta _0+1
    // [39] (word~) scrollup1::$2 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuxx 
    txa
    clc
    adc line
    sta _2
    lda #0
    adc line+1
    sta _2+1
    // [40] (byte*~) scrollup1::$5 ← (const byte*) screen#0+(byte) $28 + (word~) scrollup1::$2 -- pbuz1=pbuc1_plus_vwuz1 
    clc
    lda _5
    adc #<screen+$28
    sta _5
    lda _5+1
    adc #>screen+$28
    sta _5+1
    // [41] (byte*~) scrollup1::$6 ← (const byte*) screen#0 + (word~) scrollup1::$0 -- pbuz1=pbuc1_plus_vwuz1 
    clc
    lda _6
    adc #<screen
    sta _6
    lda _6+1
    adc #>screen
    sta _6+1
    // [42] *((byte*~) scrollup1::$6) ← *((byte*~) scrollup1::$5) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (_5),y
    ldy #0
    sta (_6),y
    // [43] (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#2 -- vbuxx=_inc_vbuxx 
    inx
    // [44] if((byte) scrollup1::c#1<(byte) $28) goto scrollup1::@2 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$28
    bcc b2_from_b2
    jmp b3
    // scrollup1::@3
  b3:
    // [45] (word) scrollup1::line#1 ← (word) scrollup1::line#4 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc line
    sta line
    bcc !+
    inc line+1
  !:
    // [46] if((word) scrollup1::line#1<(word)(number) $28*(number) $18) goto scrollup1::@1 -- vwuz1_lt_vwuc1_then_la1 
    lda line+1
    cmp #>$28*$18
    bcc b1_from_b3
    bne !+
    lda line
    cmp #<$28*$18
    bcc b1_from_b3
  !:
    jmp breturn
    // scrollup1::@return
  breturn:
    // [47] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #>0
Removing instruction ldy #0
Removing instruction ldy #0
Removing instruction lda #>0
Removing instruction ldy #0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label b2_from_b2 with b2
Replacing label b1_from_b3 with b1
Replacing label b1_from_b3 with b1
Replacing label b2_from_b2 with b2
Replacing label b1_from_b3 with b1
Replacing label b2_from_b2 with b2
Replacing label b1_from_b3 with b1
Replacing label b1_from_b3 with b1
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Removing instruction b1_from_main:
Removing instruction scrollup2_from_b1:
Removing instruction b2_from_b1:
Removing instruction scrollup3_from_b2:
Removing instruction b1_from_b3:
Removing instruction b2_from_b2:
Removing instruction b1_from_b3:
Removing instruction b2_from_b1:
Removing instruction b2_from_b2:
Removing instruction b1_from_b3:
Removing instruction b2_from_b1:
Removing instruction b2_from_b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction scrollup1_from_main:
Removing instruction b1:
Removing instruction b2:
Removing instruction breturn:
Removing instruction b1_from_scrollup3:
Removing instruction b2_from_b1:
Removing instruction b3:
Removing instruction breturn:
Removing instruction b1_from_scrollup2:
Removing instruction b3:
Removing instruction breturn:
Removing instruction b1_from_scrollup1:
Removing instruction b3:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b1
Removing instruction jmp b2
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@return
(byte*) screen
(const byte*) screen#0 screen = (byte*) 1024
(void()) scrollup1()
(word~) scrollup1::$0 $0 zp ZP_WORD:17 67.33333333333333
(word~) scrollup1::$2 $2 zp ZP_WORD:19 202.0
(byte*~) scrollup1::$5 $5 zp ZP_WORD:19 101.0
(byte*~) scrollup1::$6 $6 zp ZP_WORD:17 202.0
(label) scrollup1::@1
(label) scrollup1::@2
(label) scrollup1::@3
(label) scrollup1::@return
(byte) scrollup1::c
(byte) scrollup1::c#1 reg byte x 151.5
(byte) scrollup1::c#2 reg byte x 67.33333333333333
(word) scrollup1::line
(word) scrollup1::line#1 line zp ZP_WORD:11 16.5
(word) scrollup1::line#4 line zp ZP_WORD:11 24.888888888888886
(void()) scrollup2()
(label) scrollup2::@1
(label) scrollup2::@2
(label) scrollup2::@3
(label) scrollup2::@return
(byte) scrollup2::c
(byte) scrollup2::c#1 reg byte x 151.5
(byte) scrollup2::c#2 reg byte x 50.5
(byte) scrollup2::l
(byte) scrollup2::l#1 l zp ZP_BYTE:6 16.5
(byte) scrollup2::l#4 l zp ZP_BYTE:6 3.142857142857143
(byte*) scrollup2::line1
(byte*) scrollup2::line1#1 line1 zp ZP_WORD:9 35.5
(byte*) scrollup2::line1#2 line1 zp ZP_WORD:9 157.0
(byte*) scrollup2::line1#3 line1 zp ZP_WORD:9 22.0
(byte*) scrollup2::line2
(byte*) scrollup2::line2#1 line2 zp ZP_WORD:7 42.599999999999994
(byte*) scrollup2::line2#2 line2 zp ZP_WORD:7 104.66666666666666
(byte*) scrollup2::line2#3 line2 zp ZP_WORD:7 22.0
(void()) scrollup3()
(byte*~) scrollup3::$3 $3 zp ZP_WORD:13 101.0
(byte*~) scrollup3::$4 $4 zp ZP_WORD:15 202.0
(label) scrollup3::@1
(label) scrollup3::@2
(label) scrollup3::@3
(label) scrollup3::@return
(byte) scrollup3::c
(byte) scrollup3::c#1 reg byte x 151.5
(byte) scrollup3::c#2 reg byte x 40.4
(word) scrollup3::l2
(word) scrollup3::l2#0 l2 zp ZP_WORD:2 3.666666666666667
(word) scrollup3::l2#1 l2#1 zp ZP_WORD:4 67.33333333333333
(word) scrollup3::l2#2 l2#2 zp ZP_WORD:4 103.75
(word~) scrollup3::l2#4 l2#4 zp ZP_WORD:4 22.0
(word) scrollup3::line
(word) scrollup3::line#1 line zp ZP_WORD:2 16.5

zp ZP_WORD:2 [ scrollup3::l2#0 scrollup3::line#1 ]
zp ZP_WORD:4 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ]
reg byte x [ scrollup3::c#2 scrollup3::c#1 ]
zp ZP_BYTE:6 [ scrollup2::l#4 scrollup2::l#1 ]
zp ZP_WORD:7 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ]
zp ZP_WORD:9 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ]
reg byte x [ scrollup2::c#2 scrollup2::c#1 ]
zp ZP_WORD:11 [ scrollup1::line#4 scrollup1::line#1 ]
reg byte x [ scrollup1::c#2 scrollup1::c#1 ]
zp ZP_WORD:13 [ scrollup3::$3 ]
zp ZP_WORD:15 [ scrollup3::$4 ]
zp ZP_WORD:17 [ scrollup1::$0 scrollup1::$6 ]
zp ZP_WORD:19 [ scrollup1::$2 scrollup1::$5 ]


FINAL ASSEMBLER
Score: 22547

  // File Comments
// Tests different ways of scrolling up the screen
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .label screen = $400
  // @begin
  // [1] phi from @begin to @1 [phi:@begin->@1]
  // @1
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
  // [3] phi from @1 to @end [phi:@1->@end]
  // @end
  // main
main: {
    // scrollup1()
    // [5] call scrollup1 
    // [35] phi from main to scrollup1 [phi:main->scrollup1]
    jsr scrollup1
    // [6] phi from main to main::@1 [phi:main->main::@1]
    // main::@1
    // scrollup2()
    // [7] call scrollup2 
    // [24] phi from main::@1 to scrollup2 [phi:main::@1->scrollup2]
    jsr scrollup2
    // [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
    // main::@2
    // scrollup3()
    // [9] call scrollup3 
    // [11] phi from main::@2 to scrollup3 [phi:main::@2->scrollup3]
    jsr scrollup3
    // main::@return
    // }
    // [10] return 
    rts
}
  // scrollup3
scrollup3: {
    .label l2 = 2
    .label l2_1 = 4
    .label line = 2
    .label l2_2 = 4
    .label _3 = $d
    .label _4 = $f
    .label l2_4 = 4
    // [12] phi from scrollup3 to scrollup3::@1 [phi:scrollup3->scrollup3::@1]
    // [12] phi (word) scrollup3::l2#0 = (byte) 0 [phi:scrollup3->scrollup3::@1#0] -- vwuz1=vbuc1 
    lda #<0
    sta l2
    sta l2+1
    // [12] phi from scrollup3::@3 to scrollup3::@1 [phi:scrollup3::@3->scrollup3::@1]
    // [12] phi (word) scrollup3::l2#0 = (word) scrollup3::line#1 [phi:scrollup3::@3->scrollup3::@1#0] -- register_copy 
    // scrollup3::@1
  b1:
    // [13] (word~) scrollup3::l2#4 ← (word) scrollup3::l2#0 -- vwuz1=vwuz2 
    lda l2
    sta l2_4
    lda l2+1
    sta l2_4+1
    // [14] phi from scrollup3::@1 to scrollup3::@2 [phi:scrollup3::@1->scrollup3::@2]
    // [14] phi (byte) scrollup3::c#2 = (byte) 0 [phi:scrollup3::@1->scrollup3::@2#0] -- vbuxx=vbuc1 
    ldx #0
    // [14] phi (word) scrollup3::l2#2 = (word~) scrollup3::l2#4 [phi:scrollup3::@1->scrollup3::@2#1] -- register_copy 
    // [14] phi from scrollup3::@2 to scrollup3::@2 [phi:scrollup3::@2->scrollup3::@2]
    // [14] phi (byte) scrollup3::c#2 = (byte) scrollup3::c#1 [phi:scrollup3::@2->scrollup3::@2#0] -- register_copy 
    // [14] phi (word) scrollup3::l2#2 = (word) scrollup3::l2#1 [phi:scrollup3::@2->scrollup3::@2#1] -- register_copy 
    // scrollup3::@2
  b2:
    // screen[l2++] = screen[l2+40]
    // [15] (byte*~) scrollup3::$3 ← (const byte*) screen#0+(byte) $28 + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2 
    lda l2_2
    clc
    adc #<screen+$28
    sta _3
    lda l2_2+1
    adc #>screen+$28
    sta _3+1
    // [16] (byte*~) scrollup3::$4 ← (const byte*) screen#0 + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2 
    lda l2_2
    clc
    adc #<screen
    sta _4
    lda l2_2+1
    adc #>screen
    sta _4+1
    // [17] *((byte*~) scrollup3::$4) ← *((byte*~) scrollup3::$3) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (_3),y
    sta (_4),y
    // screen[l2++] = screen[l2+40];
    // [18] (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2 -- vwuz1=_inc_vwuz1 
    inc l2_1
    bne !+
    inc l2_1+1
  !:
    // for (byte c=0; c<40; ++c)
    // [19] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#2 -- vbuxx=_inc_vbuxx 
    inx
    // [20] if((byte) scrollup3::c#1<(byte) $28) goto scrollup3::@2 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$28
    bcc b2
    // scrollup3::@3
    // line += 40
    // [21] (word) scrollup3::line#1 ← (word) scrollup3::l2#0 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc line
    sta line
    bcc !+
    inc line+1
  !:
    // for (word line = 0; line < 40*24; line += 40)
    // [22] if((word) scrollup3::line#1<(word)(number) $28*(number) $18) goto scrollup3::@1 -- vwuz1_lt_vwuc1_then_la1 
    lda line+1
    cmp #>$28*$18
    bcc b1
    bne !+
    lda line
    cmp #<$28*$18
    bcc b1
  !:
    // scrollup3::@return
    // }
    // [23] return 
    rts
}
  // scrollup2
scrollup2: {
    .label line1 = 9
    .label line2 = 7
    .label l = 6
    // [25] phi from scrollup2 to scrollup2::@1 [phi:scrollup2->scrollup2::@1]
    // [25] phi (byte) scrollup2::l#4 = (byte) 0 [phi:scrollup2->scrollup2::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta l
    // [25] phi (byte*) scrollup2::line1#3 = (const byte*) screen#0 [phi:scrollup2->scrollup2::@1#1] -- pbuz1=pbuc1 
    lda #<screen
    sta line1
    lda #>screen
    sta line1+1
    // [25] phi (byte*) scrollup2::line2#3 = (const byte*) screen#0+(byte) $28 [phi:scrollup2->scrollup2::@1#2] -- pbuz1=pbuc1 
    lda #<screen+$28
    sta line2
    lda #>screen+$28
    sta line2+1
    // [25] phi from scrollup2::@3 to scrollup2::@1 [phi:scrollup2::@3->scrollup2::@1]
    // [25] phi (byte) scrollup2::l#4 = (byte) scrollup2::l#1 [phi:scrollup2::@3->scrollup2::@1#0] -- register_copy 
    // [25] phi (byte*) scrollup2::line1#3 = (byte*) scrollup2::line1#1 [phi:scrollup2::@3->scrollup2::@1#1] -- register_copy 
    // [25] phi (byte*) scrollup2::line2#3 = (byte*) scrollup2::line2#1 [phi:scrollup2::@3->scrollup2::@1#2] -- register_copy 
    // scrollup2::@1
  b1:
    // [26] phi from scrollup2::@1 to scrollup2::@2 [phi:scrollup2::@1->scrollup2::@2]
    // [26] phi (byte) scrollup2::c#2 = (byte) 0 [phi:scrollup2::@1->scrollup2::@2#0] -- vbuxx=vbuc1 
    ldx #0
    // [26] phi (byte*) scrollup2::line1#2 = (byte*) scrollup2::line1#3 [phi:scrollup2::@1->scrollup2::@2#1] -- register_copy 
    // [26] phi (byte*) scrollup2::line2#2 = (byte*) scrollup2::line2#3 [phi:scrollup2::@1->scrollup2::@2#2] -- register_copy 
    // [26] phi from scrollup2::@2 to scrollup2::@2 [phi:scrollup2::@2->scrollup2::@2]
    // [26] phi (byte) scrollup2::c#2 = (byte) scrollup2::c#1 [phi:scrollup2::@2->scrollup2::@2#0] -- register_copy 
    // [26] phi (byte*) scrollup2::line1#2 = (byte*) scrollup2::line1#1 [phi:scrollup2::@2->scrollup2::@2#1] -- register_copy 
    // [26] phi (byte*) scrollup2::line2#2 = (byte*) scrollup2::line2#1 [phi:scrollup2::@2->scrollup2::@2#2] -- register_copy 
    // scrollup2::@2
  b2:
    // *line1++ = *line2++
    // [27] *((byte*) scrollup2::line1#2) ← *((byte*) scrollup2::line2#2) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (line2),y
    sta (line1),y
    // *line1++ = *line2++;
    // [28] (byte*) scrollup2::line1#1 ← ++ (byte*) scrollup2::line1#2 -- pbuz1=_inc_pbuz1 
    inc line1
    bne !+
    inc line1+1
  !:
    // [29] (byte*) scrollup2::line2#1 ← ++ (byte*) scrollup2::line2#2 -- pbuz1=_inc_pbuz1 
    inc line2
    bne !+
    inc line2+1
  !:
    // for (byte c: 0..39)
    // [30] (byte) scrollup2::c#1 ← ++ (byte) scrollup2::c#2 -- vbuxx=_inc_vbuxx 
    inx
    // [31] if((byte) scrollup2::c#1!=(byte) $28) goto scrollup2::@2 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$28
    bne b2
    // scrollup2::@3
    // for( byte l: 0..23 )
    // [32] (byte) scrollup2::l#1 ← ++ (byte) scrollup2::l#4 -- vbuz1=_inc_vbuz1 
    inc l
    // [33] if((byte) scrollup2::l#1!=(byte) $18) goto scrollup2::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #$18
    cmp l
    bne b1
    // scrollup2::@return
    // }
    // [34] return 
    rts
}
  // scrollup1
scrollup1: {
    .label _0 = $11
    .label _2 = $13
    .label line = $b
    .label _5 = $13
    .label _6 = $11
    // [36] phi from scrollup1 to scrollup1::@1 [phi:scrollup1->scrollup1::@1]
    // [36] phi (word) scrollup1::line#4 = (byte) 0 [phi:scrollup1->scrollup1::@1#0] -- vwuz1=vbuc1 
    lda #<0
    sta line
    sta line+1
    // [36] phi from scrollup1::@3 to scrollup1::@1 [phi:scrollup1::@3->scrollup1::@1]
    // [36] phi (word) scrollup1::line#4 = (word) scrollup1::line#1 [phi:scrollup1::@3->scrollup1::@1#0] -- register_copy 
    // scrollup1::@1
  b1:
    // [37] phi from scrollup1::@1 to scrollup1::@2 [phi:scrollup1::@1->scrollup1::@2]
    // [37] phi (byte) scrollup1::c#2 = (byte) 0 [phi:scrollup1::@1->scrollup1::@2#0] -- vbuxx=vbuc1 
    ldx #0
    // [37] phi from scrollup1::@2 to scrollup1::@2 [phi:scrollup1::@2->scrollup1::@2]
    // [37] phi (byte) scrollup1::c#2 = (byte) scrollup1::c#1 [phi:scrollup1::@2->scrollup1::@2#0] -- register_copy 
    // scrollup1::@2
  b2:
    // line+c
    // [38] (word~) scrollup1::$0 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuxx 
    txa
    clc
    adc line
    sta _0
    lda #0
    adc line+1
    sta _0+1
    // line+c+40
    // [39] (word~) scrollup1::$2 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuxx 
    txa
    clc
    adc line
    sta _2
    lda #0
    adc line+1
    sta _2+1
    // screen[line+c] = screen[line+c+40]
    // [40] (byte*~) scrollup1::$5 ← (const byte*) screen#0+(byte) $28 + (word~) scrollup1::$2 -- pbuz1=pbuc1_plus_vwuz1 
    clc
    lda _5
    adc #<screen+$28
    sta _5
    lda _5+1
    adc #>screen+$28
    sta _5+1
    // [41] (byte*~) scrollup1::$6 ← (const byte*) screen#0 + (word~) scrollup1::$0 -- pbuz1=pbuc1_plus_vwuz1 
    clc
    lda _6
    adc #<screen
    sta _6
    lda _6+1
    adc #>screen
    sta _6+1
    // [42] *((byte*~) scrollup1::$6) ← *((byte*~) scrollup1::$5) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (_5),y
    sta (_6),y
    // for (byte c=0; c<40; ++c)
    // [43] (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#2 -- vbuxx=_inc_vbuxx 
    inx
    // [44] if((byte) scrollup1::c#1<(byte) $28) goto scrollup1::@2 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$28
    bcc b2
    // scrollup1::@3
    // line += 40
    // [45] (word) scrollup1::line#1 ← (word) scrollup1::line#4 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc line
    sta line
    bcc !+
    inc line+1
  !:
    // for (word line = 0; line < 40*24; line += 40)
    // [46] if((word) scrollup1::line#1<(word)(number) $28*(number) $18) goto scrollup1::@1 -- vwuz1_lt_vwuc1_then_la1 
    lda line+1
    cmp #>$28*$18
    bcc b1
    bne !+
    lda line
    cmp #<$28*$18
    bcc b1
  !:
    // scrollup1::@return
    // }
    // [47] return 
    rts
}
  // File Data

