Culled Empty Block (label) @1
Culled Empty Block (label) scrollup1::@11
Culled Empty Block (label) scrollup1::@3
Culled Empty Block (label) scrollup1::@12
Culled Empty Block (label) scrollup1::@7
Culled Empty Block (label) scrollup1::@8
Culled Empty Block (label) scrollup1::@9
Culled Empty Block (label) scrollup1::@10
Culled Empty Block (label) @2
Culled Empty Block (label) scrollup2::@4
Culled Empty Block (label) @3
Culled Empty Block (label) scrollup3::@11
Culled Empty Block (label) scrollup3::@3
Culled Empty Block (label) scrollup3::@12
Culled Empty Block (label) scrollup3::@7
Culled Empty Block (label) scrollup3::@8
Culled Empty Block (label) scrollup3::@9
Culled Empty Block (label) scrollup3::@10

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@4

(void()) main()
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

(void()) scrollup1()
scrollup1: scope:[scrollup1]  from main
  (word) scrollup1::line#0 ← (word) 0
  to:scrollup1::@1
scrollup1::@1: scope:[scrollup1]  from scrollup1 scrollup1::@6
  (word) scrollup1::line#2 ← phi( scrollup1/(word) scrollup1::line#0 scrollup1::@6/(word) scrollup1::line#1 )
  (bool~) scrollup1::$0 ← (word) scrollup1::line#2 < (number) $28*(number) $18
  if((bool~) scrollup1::$0) goto scrollup1::@2
  to:scrollup1::@return
scrollup1::@2: scope:[scrollup1]  from scrollup1::@1
  (word) scrollup1::line#6 ← phi( scrollup1::@1/(word) scrollup1::line#2 )
  (byte) scrollup1::c#0 ← (byte) 0
  to:scrollup1::@4
scrollup1::@4: scope:[scrollup1]  from scrollup1::@2 scrollup1::@5
  (word) scrollup1::line#5 ← phi( scrollup1::@2/(word) scrollup1::line#6 scrollup1::@5/(word) scrollup1::line#3 )
  (byte) scrollup1::c#2 ← phi( scrollup1::@2/(byte) scrollup1::c#0 scrollup1::@5/(byte) scrollup1::c#1 )
  (bool~) scrollup1::$1 ← (byte) scrollup1::c#2 < (number) $28
  if((bool~) scrollup1::$1) goto scrollup1::@5
  to:scrollup1::@6
scrollup1::@5: scope:[scrollup1]  from scrollup1::@4
  (byte) scrollup1::c#3 ← phi( scrollup1::@4/(byte) scrollup1::c#2 )
  (word) scrollup1::line#3 ← phi( scrollup1::@4/(word) scrollup1::line#5 )
  (word~) scrollup1::$2 ← (word) scrollup1::line#3 + (byte) scrollup1::c#3
  (word~) scrollup1::$3 ← (word) scrollup1::line#3 + (byte) scrollup1::c#3
  (number~) scrollup1::$4 ← (word~) scrollup1::$3 + (number) $28
  *((const byte*) screen + (word~) scrollup1::$2) ← *((const byte*) screen + (number~) scrollup1::$4)
  (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#3
  to:scrollup1::@4
scrollup1::@6: scope:[scrollup1]  from scrollup1::@4
  (word) scrollup1::line#4 ← phi( scrollup1::@4/(word) scrollup1::line#5 )
  (word) scrollup1::line#1 ← (word) scrollup1::line#4 + (number) $28
  to:scrollup1::@1
scrollup1::@return: scope:[scrollup1]  from scrollup1::@1
  return 
  to:@return

(void()) scrollup2()
scrollup2: scope:[scrollup2]  from main::@1
  (byte*) scrollup2::line1#0 ← (const byte*) screen
  (byte*) scrollup2::line2#0 ← (const byte*) screen+(number) $28
  (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::$0 ← (byte) scrollup2::c#1 != rangelast(0,$27)
  if((bool~) scrollup2::$0) 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::$1 ← (byte) scrollup2::l#1 != rangelast(0,$17)
  if((bool~) scrollup2::$1) goto scrollup2::@1
  to:scrollup2::@return
scrollup2::@return: scope:[scrollup2]  from scrollup2::@3
  return 
  to:@return

(void()) scrollup3()
scrollup3: scope:[scrollup3]  from main::@2
  (word) scrollup3::line#0 ← (word) 0
  to:scrollup3::@1
scrollup3::@1: scope:[scrollup3]  from scrollup3 scrollup3::@6
  (word) scrollup3::line#2 ← phi( scrollup3/(word) scrollup3::line#0 scrollup3::@6/(word) scrollup3::line#1 )
  (bool~) scrollup3::$0 ← (word) scrollup3::line#2 < (number) $28*(number) $18
  if((bool~) scrollup3::$0) goto scrollup3::@2
  to:scrollup3::@return
scrollup3::@2: scope:[scrollup3]  from scrollup3::@1
  (word) scrollup3::line#3 ← phi( scrollup3::@1/(word) scrollup3::line#2 )
  (word) scrollup3::l2#0 ← (word) scrollup3::line#3
  (byte) scrollup3::c#0 ← (byte) 0
  to:scrollup3::@4
scrollup3::@4: scope:[scrollup3]  from scrollup3::@2 scrollup3::@5
  (word) scrollup3::line#5 ← phi( scrollup3::@2/(word) scrollup3::line#3 scrollup3::@5/(word) scrollup3::line#6 )
  (word) scrollup3::l2#3 ← phi( scrollup3::@2/(word) scrollup3::l2#0 scrollup3::@5/(word) scrollup3::l2#1 )
  (byte) scrollup3::c#2 ← phi( scrollup3::@2/(byte) scrollup3::c#0 scrollup3::@5/(byte) scrollup3::c#1 )
  (bool~) scrollup3::$1 ← (byte) scrollup3::c#2 < (number) $28
  if((bool~) scrollup3::$1) goto scrollup3::@5
  to:scrollup3::@6
scrollup3::@5: scope:[scrollup3]  from scrollup3::@4
  (word) scrollup3::line#6 ← phi( scrollup3::@4/(word) scrollup3::line#5 )
  (byte) scrollup3::c#3 ← phi( scrollup3::@4/(byte) scrollup3::c#2 )
  (word) scrollup3::l2#2 ← phi( scrollup3::@4/(word) scrollup3::l2#3 )
  (number~) scrollup3::$2 ← (word) scrollup3::l2#2 + (number) $28
  *((const byte*) screen + (word) scrollup3::l2#2) ← *((const byte*) screen + (number~) scrollup3::$2)
  (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2
  (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#3
  to:scrollup3::@4
scrollup3::@6: scope:[scrollup3]  from scrollup3::@4
  (word) scrollup3::line#4 ← phi( scrollup3::@4/(word) scrollup3::line#5 )
  (word) scrollup3::line#1 ← (word) scrollup3::line#4 + (number) $28
  to:scrollup3::@1
scrollup3::@return: scope:[scrollup3]  from scrollup3::@1
  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
(const byte*) screen = (byte*)(number) $400
(void()) scrollup1()
(bool~) scrollup1::$0
(bool~) scrollup1::$1
(word~) scrollup1::$2
(word~) scrollup1::$3
(number~) scrollup1::$4
(label) scrollup1::@1
(label) scrollup1::@2
(label) scrollup1::@4
(label) scrollup1::@5
(label) scrollup1::@6
(label) scrollup1::@return
(byte) scrollup1::c
(byte) scrollup1::c#0
(byte) scrollup1::c#1
(byte) scrollup1::c#2
(byte) scrollup1::c#3
(word) scrollup1::line
(word) scrollup1::line#0
(word) scrollup1::line#1
(word) scrollup1::line#2
(word) scrollup1::line#3
(word) scrollup1::line#4
(word) scrollup1::line#5
(word) scrollup1::line#6
(void()) scrollup2()
(bool~) scrollup2::$0
(bool~) scrollup2::$1
(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()
(bool~) scrollup3::$0
(bool~) scrollup3::$1
(number~) scrollup3::$2
(label) scrollup3::@1
(label) scrollup3::@2
(label) scrollup3::@4
(label) scrollup3::@5
(label) scrollup3::@6
(label) scrollup3::@return
(byte) scrollup3::c
(byte) scrollup3::c#0
(byte) scrollup3::c#1
(byte) scrollup3::c#2
(byte) scrollup3::c#3
(word) scrollup3::l2
(word) scrollup3::l2#0
(word) scrollup3::l2#1
(word) scrollup3::l2#2
(word) scrollup3::l2#3
(word) scrollup3::line
(word) scrollup3::line#0
(word) scrollup3::line#1
(word) scrollup3::line#2
(word) scrollup3::line#3
(word) scrollup3::line#4
(word) scrollup3::line#5
(word) scrollup3::line#6

Adding number conversion cast (unumber) $28*$18 in (bool~) scrollup1::$0 ← (word) scrollup1::line#2 < (number) $28*(number) $18
Adding number conversion cast (unumber) $28 in (bool~) scrollup1::$1 ← (byte) scrollup1::c#2 < (number) $28
Adding number conversion cast (unumber) $28 in (number~) scrollup1::$4 ← (word~) scrollup1::$3 + (number) $28
Adding number conversion cast (unumber) scrollup1::$4 in (number~) scrollup1::$4 ← (word~) scrollup1::$3 + (unumber)(number) $28
Adding number conversion cast (unumber) $28 in (word) scrollup1::line#1 ← (word) scrollup1::line#4 + (number) $28
Adding number conversion cast (unumber) $28 in (byte*) scrollup2::line2#0 ← (const byte*) screen+(number) $28
Adding number conversion cast (unumber) $28*$18 in (bool~) scrollup3::$0 ← (word) scrollup3::line#2 < (number) $28*(number) $18
Adding number conversion cast (unumber) $28 in (bool~) scrollup3::$1 ← (byte) scrollup3::c#2 < (number) $28
Adding number conversion cast (unumber) $28 in (number~) scrollup3::$2 ← (word) scrollup3::l2#2 + (number) $28
Adding number conversion cast (unumber) scrollup3::$2 in (number~) scrollup3::$2 ← (word) scrollup3::l2#2 + (unumber)(number) $28
Adding number conversion cast (unumber) $28 in (word) scrollup3::line#1 ← (word) scrollup3::line#4 + (number) $28
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $28
Simplifying constant integer cast $28
Simplifying constant integer cast $28
Simplifying constant integer cast $28
Simplifying constant integer cast $28
Simplifying constant integer cast $28
Simplifying constant integer cast $28
Successful SSA optimization PassNCastSimplification
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) $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::$4 ← (word~) scrollup1::$3 + (byte) $28
Inferred type updated to word in (unumber~) scrollup3::$2 ← (word) scrollup3::l2#2 + (byte) $28
Alias (word) scrollup1::line#2 = (word) scrollup1::line#6 
Alias (word) scrollup1::line#3 = (word) scrollup1::line#5 (word) scrollup1::line#4 
Alias (byte) scrollup1::c#2 = (byte) scrollup1::c#3 
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::line#2 = (word) scrollup3::line#3 (word) scrollup3::l2#0 
Alias (word) scrollup3::l2#2 = (word) scrollup3::l2#3 
Alias (byte) scrollup3::c#2 = (byte) scrollup3::c#3 
Alias (word) scrollup3::line#4 = (word) scrollup3::line#6 (word) scrollup3::line#5 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (word) scrollup1::line#3 (word) scrollup1::line#2
Identical Phi Values (byte) scrollup2::l#2 (byte) scrollup2::l#4
Identical Phi Values (word) scrollup3::line#4 (word) scrollup3::line#2
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) scrollup1::$0 [7] if((word) scrollup1::line#2<(word)(number) $28*(number) $18) goto scrollup1::@2
Simple Condition (bool~) scrollup1::$1 [11] if((byte) scrollup1::c#2<(byte) $28) goto scrollup1::@5
Simple Condition (bool~) scrollup2::$0 [30] if((byte) scrollup2::c#1!=rangelast(0,$27)) goto scrollup2::@2
Simple Condition (bool~) scrollup2::$1 [33] if((byte) scrollup2::l#1!=rangelast(0,$17)) goto scrollup2::@1
Simple Condition (bool~) scrollup3::$0 [38] if((word) scrollup3::line#2<(word)(number) $28*(number) $18) goto scrollup3::@2
Simple Condition (bool~) scrollup3::$1 [42] if((byte) scrollup3::c#2<(byte) $28) goto scrollup3::@5
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const word) scrollup1::line#0 = 0
Constant (const byte) scrollup1::c#0 = 0
Constant (const byte*) scrollup2::line1#0 = screen
Constant (const byte*) scrollup2::line2#0 = screen+$28
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
Resolved ranged next value [28] scrollup2::c#1 ← ++ scrollup2::c#2 to ++
Resolved ranged comparison value [30] if(scrollup2::c#1!=rangelast(0,$27)) goto scrollup2::@2 to (number) $28
Resolved ranged next value [31] scrollup2::l#1 ← ++ scrollup2::l#4 to ++
Resolved ranged comparison value [33] if(scrollup2::l#1!=rangelast(0,$17)) goto scrollup2::@1 to (number) $18
De-inlining pointer[w] to *(pointer+w)   [15] *((const byte*) screen + (word~) scrollup1::$2) ← *((const byte*) screen + (word~) scrollup1::$4)
De-inlining pointer[w] to *(pointer+w)   [15] *((const byte*) screen + (word~) scrollup1::$2) ← *((byte*~) scrollup1::$5)
De-inlining pointer[w] to *(pointer+w)   [44] *((const byte*) screen + (word) scrollup3::l2#2) ← *((const byte*) screen + (word~) scrollup3::$2)
De-inlining pointer[w] to *(pointer+w)   [44] *((const byte*) screen + (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
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::line1#0
Inlining constant with var siblings (const byte*) scrollup2::line2#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 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 = (word) 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 = (word) 0
Constant inlined scrollup2::line2#0 = (const byte*) screen+(byte) $28
Constant inlined scrollup2::line1#0 = (const byte*) screen
Successful SSA optimization Pass2ConstantInlining
Consolidated constant in assignment scrollup1::$5
Consolidated constant in assignment scrollup3::$3
Successful SSA optimization Pass2ConstantAdditionElimination
Alias (word~) scrollup1::$4 = (word~) scrollup1::$3 
Alias (word) scrollup3::l2#2 = (word~) scrollup3::$2 
Successful SSA optimization Pass2AliasElimination
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)
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
Adding NOP phi() at start of scrollup1::@2
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 [17] scrollup3::l2#4 ← scrollup3::line#2
Coalesced [21] scrollup3::line#7 ← scrollup3::line#1
Coalesced [27] scrollup3::c#4 ← scrollup3::c#1
Coalesced [28] scrollup3::l2#5 ← scrollup3::l2#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 [56] scrollup1::line#7 ← scrollup1::line#1
Coalesced [63] scrollup1::c#4 ← 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) scrollup2::@5
Culled Empty Block (label) scrollup2::@6
Culled Empty Block (label) scrollup1::@2
Renumbering block @4 to @1
Renumbering block scrollup1::@4 to scrollup1::@2
Renumbering block scrollup1::@5 to scrollup1::@3
Renumbering block scrollup1::@6 to scrollup1::@4
Renumbering block scrollup3::@4 to scrollup3::@3
Renumbering block scrollup3::@5 to scrollup3::@4
Renumbering block scrollup3::@6 to scrollup3::@5
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()

(void()) main()
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

(void()) scrollup3()
scrollup3: scope:[scrollup3]  from main::@2
  [11] phi()
  to:scrollup3::@1
scrollup3::@1: scope:[scrollup3]  from scrollup3 scrollup3::@5
  [12] (word) scrollup3::line#2 ← phi( scrollup3/(word) 0 scrollup3::@5/(word) scrollup3::line#1 )
  [13] if((word) scrollup3::line#2<(word)(number) $28*(number) $18) goto scrollup3::@2
  to:scrollup3::@return
scrollup3::@return: scope:[scrollup3]  from scrollup3::@1
  [14] return 
  to:@return
scrollup3::@2: scope:[scrollup3]  from scrollup3::@1
  [15] (word) scrollup3::l2#4 ← (word) scrollup3::line#2
  to:scrollup3::@3
scrollup3::@3: scope:[scrollup3]  from scrollup3::@2 scrollup3::@4
  [16] (word) scrollup3::l2#2 ← phi( scrollup3::@2/(word) scrollup3::l2#4 scrollup3::@4/(word) scrollup3::l2#1 )
  [16] (byte) scrollup3::c#2 ← phi( scrollup3::@2/(byte) 0 scrollup3::@4/(byte) scrollup3::c#1 )
  [17] if((byte) scrollup3::c#2<(byte) $28) goto scrollup3::@4
  to:scrollup3::@5
scrollup3::@5: scope:[scrollup3]  from scrollup3::@3
  [18] (word) scrollup3::line#1 ← (word) scrollup3::line#2 + (byte) $28
  to:scrollup3::@1
scrollup3::@4: scope:[scrollup3]  from scrollup3::@3
  [19] (byte*~) scrollup3::$3 ← (const byte*) screen+(byte) $28 + (word) scrollup3::l2#2
  [20] (byte*~) scrollup3::$4 ← (const byte*) screen + (word) scrollup3::l2#2
  [21] *((byte*~) scrollup3::$4) ← *((byte*~) scrollup3::$3)
  [22] (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2
  [23] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#2
  to:scrollup3::@3

(void()) scrollup2()
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 scrollup2::@3/(byte*) scrollup2::line1#1 )
  [25] (byte*) scrollup2::line2#3 ← phi( scrollup2/(const byte*) screen+(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

(void()) scrollup1()
scrollup1: scope:[scrollup1]  from main
  [35] phi()
  to:scrollup1::@1
scrollup1::@1: scope:[scrollup1]  from scrollup1 scrollup1::@4
  [36] (word) scrollup1::line#2 ← phi( scrollup1/(word) 0 scrollup1::@4/(word) scrollup1::line#1 )
  [37] if((word) scrollup1::line#2<(word)(number) $28*(number) $18) goto scrollup1::@2
  to:scrollup1::@return
scrollup1::@return: scope:[scrollup1]  from scrollup1::@1
  [38] return 
  to:@return
scrollup1::@2: scope:[scrollup1]  from scrollup1::@1 scrollup1::@3
  [39] (byte) scrollup1::c#2 ← phi( scrollup1::@1/(byte) 0 scrollup1::@3/(byte) scrollup1::c#1 )
  [40] if((byte) scrollup1::c#2<(byte) $28) goto scrollup1::@3
  to:scrollup1::@4
scrollup1::@4: scope:[scrollup1]  from scrollup1::@2
  [41] (word) scrollup1::line#1 ← (word) scrollup1::line#2 + (byte) $28
  to:scrollup1::@1
scrollup1::@3: scope:[scrollup1]  from scrollup1::@2
  [42] (word~) scrollup1::$2 ← (word) scrollup1::line#2 + (byte) scrollup1::c#2
  [43] (word~) scrollup1::$4 ← (word) scrollup1::line#2 + (byte) scrollup1::c#2
  [44] (byte*~) scrollup1::$5 ← (const byte*) screen+(byte) $28 + (word~) scrollup1::$4
  [45] (byte*~) scrollup1::$6 ← (const byte*) screen + (word~) scrollup1::$2
  [46] *((byte*~) scrollup1::$6) ← *((byte*~) scrollup1::$5)
  [47] (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#2
  to:scrollup1::@2


VARIABLE REGISTER WEIGHTS
(void()) main()
(void()) scrollup1()
(word~) scrollup1::$2 67.33333333333333
(word~) scrollup1::$4 202.0
(byte*~) scrollup1::$5 101.0
(byte*~) scrollup1::$6 202.0
(byte) scrollup1::c
(byte) scrollup1::c#1 202.0
(byte) scrollup1::c#2 72.14285714285714
(word) scrollup1::line
(word) scrollup1::line#1 22.0
(word) scrollup1::line#2 23.5
(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 202.0
(byte) scrollup3::c#2 50.5
(word) scrollup3::l2
(word) scrollup3::l2#1 101.0
(word) scrollup3::l2#2 83.0
(word) scrollup3::l2#4 22.0
(word) scrollup3::line
(word) scrollup3::line#1 22.0
(word) scrollup3::line#2 4.4

Initial phi equivalence classes
[ scrollup3::line#2 scrollup3::line#1 ]
[ scrollup3::c#2 scrollup3::c#1 ]
[ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#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#2 scrollup1::line#1 ]
[ scrollup1::c#2 scrollup1::c#1 ]
Added variable scrollup3::$3 to live range equivalence class [ scrollup3::$3 ]
Added variable scrollup3::$4 to live range equivalence class [ scrollup3::$4 ]
Added variable scrollup1::$2 to live range equivalence class [ scrollup1::$2 ]
Added variable scrollup1::$4 to live range equivalence class [ scrollup1::$4 ]
Added variable scrollup1::$5 to live range equivalence class [ scrollup1::$5 ]
Added variable scrollup1::$6 to live range equivalence class [ scrollup1::$6 ]
Complete equivalence classes
[ scrollup3::line#2 scrollup3::line#1 ]
[ scrollup3::c#2 scrollup3::c#1 ]
[ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#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#2 scrollup1::line#1 ]
[ scrollup1::c#2 scrollup1::c#1 ]
[ scrollup3::$3 ]
[ scrollup3::$4 ]
[ scrollup1::$2 ]
[ scrollup1::$4 ]
[ scrollup1::$5 ]
[ scrollup1::$6 ]
Allocated zp[2]:2 [ scrollup3::line#2 scrollup3::line#1 ]
Allocated zp[1]:4 [ scrollup3::c#2 scrollup3::c#1 ]
Allocated zp[2]:5 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ]
Allocated zp[1]:7 [ scrollup2::l#4 scrollup2::l#1 ]
Allocated zp[2]:8 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ]
Allocated zp[2]:10 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ]
Allocated zp[1]:12 [ scrollup2::c#2 scrollup2::c#1 ]
Allocated zp[2]:13 [ scrollup1::line#2 scrollup1::line#1 ]
Allocated zp[1]:15 [ scrollup1::c#2 scrollup1::c#1 ]
Allocated zp[2]:16 [ scrollup3::$3 ]
Allocated zp[2]:18 [ scrollup3::$4 ]
Allocated zp[2]:20 [ scrollup1::$2 ]
Allocated zp[2]:22 [ scrollup1::$4 ]
Allocated zp[2]:24 [ scrollup1::$5 ]
Allocated zp[2]:26 [ scrollup1::$6 ]

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
// Tests different ways of scrolling up the screen
  // 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 = 5
    .label c = 4
    .label line = 2
    .label __3 = $10
    .label __4 = $12
    // [12] phi from scrollup3 to scrollup3::@1 [phi:scrollup3->scrollup3::@1]
  __b1_from_scrollup3:
    // [12] phi (word) scrollup3::line#2 = (word) 0 [phi:scrollup3->scrollup3::@1#0] -- vwuz1=vwuc1 
    lda #<0
    sta.z line
    lda #>0
    sta.z line+1
    jmp __b1
    // scrollup3::@1
  __b1:
    // [13] if((word) scrollup3::line#2<(word)(number) $28*(number) $18) goto scrollup3::@2 -- vwuz1_lt_vwuc1_then_la1 
    lda.z line+1
    cmp #>$28*$18
    bcc __b2
    bne !+
    lda.z line
    cmp #<$28*$18
    bcc __b2
  !:
    jmp __breturn
    // scrollup3::@return
  __breturn:
    // [14] return 
    rts
    // scrollup3::@2
  __b2:
    // [15] (word) scrollup3::l2#4 ← (word) scrollup3::line#2 -- vwuz1=vwuz2 
    lda.z line
    sta.z l2
    lda.z line+1
    sta.z l2+1
    // [16] phi from scrollup3::@2 to scrollup3::@3 [phi:scrollup3::@2->scrollup3::@3]
  __b3_from___b2:
    // [16] phi (word) scrollup3::l2#2 = (word) scrollup3::l2#4 [phi:scrollup3::@2->scrollup3::@3#0] -- register_copy 
    // [16] phi (byte) scrollup3::c#2 = (byte) 0 [phi:scrollup3::@2->scrollup3::@3#1] -- vbuz1=vbuc1 
    lda #0
    sta.z c
    jmp __b3
    // scrollup3::@3
  __b3:
    // [17] if((byte) scrollup3::c#2<(byte) $28) goto scrollup3::@4 -- vbuz1_lt_vbuc1_then_la1 
    lda.z c
    cmp #$28
    bcc __b4
    jmp __b5
    // scrollup3::@5
  __b5:
    // [18] (word) scrollup3::line#1 ← (word) scrollup3::line#2 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z line
    sta.z line
    bcc !+
    inc.z line+1
  !:
    // [12] phi from scrollup3::@5 to scrollup3::@1 [phi:scrollup3::@5->scrollup3::@1]
  __b1_from___b5:
    // [12] phi (word) scrollup3::line#2 = (word) scrollup3::line#1 [phi:scrollup3::@5->scrollup3::@1#0] -- register_copy 
    jmp __b1
    // scrollup3::@4
  __b4:
    // [19] (byte*~) scrollup3::$3 ← (const byte*) screen+(byte) $28 + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z l2
    clc
    adc #<screen+$28
    sta.z __3
    lda.z l2+1
    adc #>screen+$28
    sta.z __3+1
    // [20] (byte*~) scrollup3::$4 ← (const byte*) screen + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z l2
    clc
    adc #<screen
    sta.z __4
    lda.z l2+1
    adc #>screen
    sta.z __4+1
    // [21] *((byte*~) scrollup3::$4) ← *((byte*~) scrollup3::$3) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (__3),y
    ldy #0
    sta (__4),y
    // [22] (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2 -- vwuz1=_inc_vwuz1 
    inc.z l2
    bne !+
    inc.z l2+1
  !:
    // [23] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#2 -- vbuz1=_inc_vbuz1 
    inc.z c
    // [16] phi from scrollup3::@4 to scrollup3::@3 [phi:scrollup3::@4->scrollup3::@3]
  __b3_from___b4:
    // [16] phi (word) scrollup3::l2#2 = (word) scrollup3::l2#1 [phi:scrollup3::@4->scrollup3::@3#0] -- register_copy 
    // [16] phi (byte) scrollup3::c#2 = (byte) scrollup3::c#1 [phi:scrollup3::@4->scrollup3::@3#1] -- register_copy 
    jmp __b3
}
  // 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.z l
    // [25] phi (byte*) scrollup2::line1#3 = (const byte*) screen [phi:scrollup2->scrollup2::@1#1] -- pbuz1=pbuc1 
    lda #<screen
    sta.z line1
    lda #>screen
    sta.z line1+1
    // [25] phi (byte*) scrollup2::line2#3 = (const byte*) screen+(byte) $28 [phi:scrollup2->scrollup2::@1#2] -- pbuz1=pbuc1 
    lda #<screen+$28
    sta.z line2
    lda #>screen+$28
    sta.z 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.z 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.z line1
    bne !+
    inc.z line1+1
  !:
    // [29] (byte*) scrollup2::line2#1 ← ++ (byte*) scrollup2::line2#2 -- pbuz1=_inc_pbuz1 
    inc.z line2
    bne !+
    inc.z line2+1
  !:
    // [30] (byte) scrollup2::c#1 ← ++ (byte) scrollup2::c#2 -- vbuz1=_inc_vbuz1 
    inc.z c
    // [31] if((byte) scrollup2::c#1!=(byte) $28) goto scrollup2::@2 -- vbuz1_neq_vbuc1_then_la1 
    lda #$28
    cmp.z c
    bne __b2_from___b2
    jmp __b3
    // scrollup2::@3
  __b3:
    // [32] (byte) scrollup2::l#1 ← ++ (byte) scrollup2::l#4 -- vbuz1=_inc_vbuz1 
    inc.z l
    // [33] if((byte) scrollup2::l#1!=(byte) $18) goto scrollup2::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #$18
    cmp.z l
    bne __b1_from___b3
    jmp __breturn
    // scrollup2::@return
  __breturn:
    // [34] return 
    rts
}
  // scrollup1
scrollup1: {
    .label __2 = $14
    .label __4 = $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#2 = (word) 0 [phi:scrollup1->scrollup1::@1#0] -- vwuz1=vwuc1 
    lda #<0
    sta.z line
    lda #>0
    sta.z line+1
    jmp __b1
    // scrollup1::@1
  __b1:
    // [37] if((word) scrollup1::line#2<(word)(number) $28*(number) $18) goto scrollup1::@2 -- vwuz1_lt_vwuc1_then_la1 
    lda.z line+1
    cmp #>$28*$18
    bcc __b2_from___b1
    bne !+
    lda.z line
    cmp #<$28*$18
    bcc __b2_from___b1
  !:
    jmp __breturn
    // scrollup1::@return
  __breturn:
    // [38] return 
    rts
    // [39] phi from scrollup1::@1 to scrollup1::@2 [phi:scrollup1::@1->scrollup1::@2]
  __b2_from___b1:
    // [39] phi (byte) scrollup1::c#2 = (byte) 0 [phi:scrollup1::@1->scrollup1::@2#0] -- vbuz1=vbuc1 
    lda #0
    sta.z c
    jmp __b2
    // scrollup1::@2
  __b2:
    // [40] if((byte) scrollup1::c#2<(byte) $28) goto scrollup1::@3 -- vbuz1_lt_vbuc1_then_la1 
    lda.z c
    cmp #$28
    bcc __b3
    jmp __b4
    // scrollup1::@4
  __b4:
    // [41] (word) scrollup1::line#1 ← (word) scrollup1::line#2 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z line
    sta.z line
    bcc !+
    inc.z line+1
  !:
    // [36] phi from scrollup1::@4 to scrollup1::@1 [phi:scrollup1::@4->scrollup1::@1]
  __b1_from___b4:
    // [36] phi (word) scrollup1::line#2 = (word) scrollup1::line#1 [phi:scrollup1::@4->scrollup1::@1#0] -- register_copy 
    jmp __b1
    // scrollup1::@3
  __b3:
    // [42] (word~) scrollup1::$2 ← (word) scrollup1::line#2 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuz3 
    lda.z c
    clc
    adc.z line
    sta.z __2
    lda #0
    adc.z line+1
    sta.z __2+1
    // [43] (word~) scrollup1::$4 ← (word) scrollup1::line#2 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuz3 
    lda.z c
    clc
    adc.z line
    sta.z __4
    lda #0
    adc.z line+1
    sta.z __4+1
    // [44] (byte*~) scrollup1::$5 ← (const byte*) screen+(byte) $28 + (word~) scrollup1::$4 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z __4
    clc
    adc #<screen+$28
    sta.z __5
    lda.z __4+1
    adc #>screen+$28
    sta.z __5+1
    // [45] (byte*~) scrollup1::$6 ← (const byte*) screen + (word~) scrollup1::$2 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z __2
    clc
    adc #<screen
    sta.z __6
    lda.z __2+1
    adc #>screen
    sta.z __6+1
    // [46] *((byte*~) scrollup1::$6) ← *((byte*~) scrollup1::$5) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (__5),y
    ldy #0
    sta (__6),y
    // [47] (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#2 -- vbuz1=_inc_vbuz1 
    inc.z c
    // [39] phi from scrollup1::@3 to scrollup1::@2 [phi:scrollup1::@3->scrollup1::@2]
  __b2_from___b3:
    // [39] phi (byte) scrollup1::c#2 = (byte) scrollup1::c#1 [phi:scrollup1::@3->scrollup1::@2#0] -- register_copy 
    jmp __b2
}
  // File Data

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

REGISTER UPLIFT SCOPES
Uplift Scope [scrollup1] 274.14: zp[1]:15 [ scrollup1::c#2 scrollup1::c#1 ] 202: zp[2]:22 [ scrollup1::$4 ] 202: zp[2]:26 [ scrollup1::$6 ] 101: zp[2]:24 [ scrollup1::$5 ] 67.33: zp[2]:20 [ scrollup1::$2 ] 45.5: zp[2]:13 [ scrollup1::line#2 scrollup1::line#1 ] 
Uplift Scope [scrollup3] 252.5: zp[1]:4 [ scrollup3::c#2 scrollup3::c#1 ] 206: zp[2]:5 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ] 202: zp[2]:18 [ scrollup3::$4 ] 101: zp[2]:16 [ scrollup3::$3 ] 26.4: zp[2]:2 [ scrollup3::line#2 scrollup3::line#1 ] 
Uplift Scope [scrollup2] 214.5: zp[2]:10 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ] 202: zp[1]:12 [ scrollup2::c#2 scrollup2::c#1 ] 169.27: zp[2]:8 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ] 19.64: zp[1]: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[2]:22 [ scrollup1::$4 ] zp[2]:26 [ scrollup1::$6 ] zp[2]:24 [ scrollup1::$5 ] zp[2]:20 [ scrollup1::$2 ] zp[2]:13 [ scrollup1::line#2 scrollup1::line#1 ] 
Uplifting [scrollup3] best 27078 combination reg byte x [ scrollup3::c#2 scrollup3::c#1 ] zp[2]:5 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ] zp[2]:18 [ scrollup3::$4 ] zp[2]:16 [ scrollup3::$3 ] zp[2]:2 [ scrollup3::line#2 scrollup3::line#1 ] 
Uplifting [scrollup2] best 26178 combination zp[2]:10 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ] reg byte x [ scrollup2::c#2 scrollup2::c#1 ] zp[2]:8 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ] zp[1]:7 [ scrollup2::l#4 scrollup2::l#1 ] 
Uplifting [main] best 26178 combination 
Uplifting [] best 26178 combination 
Attempting to uplift remaining variables inzp[1]:7 [ scrollup2::l#4 scrollup2::l#1 ]
Uplifting [scrollup2] best 26178 combination zp[1]:7 [ scrollup2::l#4 scrollup2::l#1 ] 
Coalescing zero page register [ zp[2]:20 [ scrollup1::$2 ] ] with [ zp[2]:26 [ scrollup1::$6 ] ] - score: 1
Coalescing zero page register [ zp[2]:22 [ scrollup1::$4 ] ] with [ zp[2]:24 [ scrollup1::$5 ] ] - score: 1
Coalescing zero page register [ zp[2]:8 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ] ] with [ zp[2]:2 [ scrollup3::line#2 scrollup3::line#1 ] ]
Coalescing zero page register [ zp[2]:10 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ] ] with [ zp[2]:5 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ] ]
Coalescing zero page register [ zp[2]:16 [ scrollup3::$3 ] ] with [ zp[2]:13 [ scrollup1::line#2 scrollup1::line#1 ] ]
Coalescing zero page register [ zp[2]:20 [ scrollup1::$2 scrollup1::$6 ] ] with [ zp[2]:18 [ scrollup3::$4 ] ]
Coalescing zero page register [ zp[2]:22 [ scrollup1::$4 scrollup1::$5 ] ] with [ zp[2]:8 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 scrollup3::line#2 scrollup3::line#1 ] ]
Allocated (was zp[1]:7) zp[1]:2 [ scrollup2::l#4 scrollup2::l#1 ]
Allocated (was zp[2]:10) zp[2]:3 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ]
Allocated (was zp[2]:16) zp[2]:5 [ scrollup3::$3 scrollup1::line#2 scrollup1::line#1 ]
Allocated (was zp[2]:20) zp[2]:7 [ scrollup1::$2 scrollup1::$6 scrollup3::$4 ]
Allocated (was zp[2]:22) zp[2]:9 [ scrollup1::$4 scrollup1::$5 scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 scrollup3::line#2 scrollup3::line#1 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Tests different ways of scrolling up the screen
  // 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 = 3
    .label line = 9
    .label __3 = 5
    .label __4 = 7
    // [12] phi from scrollup3 to scrollup3::@1 [phi:scrollup3->scrollup3::@1]
  __b1_from_scrollup3:
    // [12] phi (word) scrollup3::line#2 = (word) 0 [phi:scrollup3->scrollup3::@1#0] -- vwuz1=vwuc1 
    lda #<0
    sta.z line
    lda #>0
    sta.z line+1
    jmp __b1
    // scrollup3::@1
  __b1:
    // [13] if((word) scrollup3::line#2<(word)(number) $28*(number) $18) goto scrollup3::@2 -- vwuz1_lt_vwuc1_then_la1 
    lda.z line+1
    cmp #>$28*$18
    bcc __b2
    bne !+
    lda.z line
    cmp #<$28*$18
    bcc __b2
  !:
    jmp __breturn
    // scrollup3::@return
  __breturn:
    // [14] return 
    rts
    // scrollup3::@2
  __b2:
    // [15] (word) scrollup3::l2#4 ← (word) scrollup3::line#2 -- vwuz1=vwuz2 
    lda.z line
    sta.z l2
    lda.z line+1
    sta.z l2+1
    // [16] phi from scrollup3::@2 to scrollup3::@3 [phi:scrollup3::@2->scrollup3::@3]
  __b3_from___b2:
    // [16] phi (word) scrollup3::l2#2 = (word) scrollup3::l2#4 [phi:scrollup3::@2->scrollup3::@3#0] -- register_copy 
    // [16] phi (byte) scrollup3::c#2 = (byte) 0 [phi:scrollup3::@2->scrollup3::@3#1] -- vbuxx=vbuc1 
    ldx #0
    jmp __b3
    // scrollup3::@3
  __b3:
    // [17] if((byte) scrollup3::c#2<(byte) $28) goto scrollup3::@4 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$28
    bcc __b4
    jmp __b5
    // scrollup3::@5
  __b5:
    // [18] (word) scrollup3::line#1 ← (word) scrollup3::line#2 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z line
    sta.z line
    bcc !+
    inc.z line+1
  !:
    // [12] phi from scrollup3::@5 to scrollup3::@1 [phi:scrollup3::@5->scrollup3::@1]
  __b1_from___b5:
    // [12] phi (word) scrollup3::line#2 = (word) scrollup3::line#1 [phi:scrollup3::@5->scrollup3::@1#0] -- register_copy 
    jmp __b1
    // scrollup3::@4
  __b4:
    // [19] (byte*~) scrollup3::$3 ← (const byte*) screen+(byte) $28 + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z l2
    clc
    adc #<screen+$28
    sta.z __3
    lda.z l2+1
    adc #>screen+$28
    sta.z __3+1
    // [20] (byte*~) scrollup3::$4 ← (const byte*) screen + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z l2
    clc
    adc #<screen
    sta.z __4
    lda.z l2+1
    adc #>screen
    sta.z __4+1
    // [21] *((byte*~) scrollup3::$4) ← *((byte*~) scrollup3::$3) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (__3),y
    ldy #0
    sta (__4),y
    // [22] (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2 -- vwuz1=_inc_vwuz1 
    inc.z l2
    bne !+
    inc.z l2+1
  !:
    // [23] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#2 -- vbuxx=_inc_vbuxx 
    inx
    // [16] phi from scrollup3::@4 to scrollup3::@3 [phi:scrollup3::@4->scrollup3::@3]
  __b3_from___b4:
    // [16] phi (word) scrollup3::l2#2 = (word) scrollup3::l2#1 [phi:scrollup3::@4->scrollup3::@3#0] -- register_copy 
    // [16] phi (byte) scrollup3::c#2 = (byte) scrollup3::c#1 [phi:scrollup3::@4->scrollup3::@3#1] -- register_copy 
    jmp __b3
}
  // scrollup2
scrollup2: {
    .label line1 = 3
    .label line2 = 9
    .label l = 2
    // [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.z l
    // [25] phi (byte*) scrollup2::line1#3 = (const byte*) screen [phi:scrollup2->scrollup2::@1#1] -- pbuz1=pbuc1 
    lda #<screen
    sta.z line1
    lda #>screen
    sta.z line1+1
    // [25] phi (byte*) scrollup2::line2#3 = (const byte*) screen+(byte) $28 [phi:scrollup2->scrollup2::@1#2] -- pbuz1=pbuc1 
    lda #<screen+$28
    sta.z line2
    lda #>screen+$28
    sta.z 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.z line1
    bne !+
    inc.z line1+1
  !:
    // [29] (byte*) scrollup2::line2#1 ← ++ (byte*) scrollup2::line2#2 -- pbuz1=_inc_pbuz1 
    inc.z line2
    bne !+
    inc.z 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.z l
    // [33] if((byte) scrollup2::l#1!=(byte) $18) goto scrollup2::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #$18
    cmp.z l
    bne __b1_from___b3
    jmp __breturn
    // scrollup2::@return
  __breturn:
    // [34] return 
    rts
}
  // scrollup1
scrollup1: {
    .label __2 = 7
    .label __4 = 9
    .label line = 5
    .label __5 = 9
    .label __6 = 7
    // [36] phi from scrollup1 to scrollup1::@1 [phi:scrollup1->scrollup1::@1]
  __b1_from_scrollup1:
    // [36] phi (word) scrollup1::line#2 = (word) 0 [phi:scrollup1->scrollup1::@1#0] -- vwuz1=vwuc1 
    lda #<0
    sta.z line
    lda #>0
    sta.z line+1
    jmp __b1
    // scrollup1::@1
  __b1:
    // [37] if((word) scrollup1::line#2<(word)(number) $28*(number) $18) goto scrollup1::@2 -- vwuz1_lt_vwuc1_then_la1 
    lda.z line+1
    cmp #>$28*$18
    bcc __b2_from___b1
    bne !+
    lda.z line
    cmp #<$28*$18
    bcc __b2_from___b1
  !:
    jmp __breturn
    // scrollup1::@return
  __breturn:
    // [38] return 
    rts
    // [39] phi from scrollup1::@1 to scrollup1::@2 [phi:scrollup1::@1->scrollup1::@2]
  __b2_from___b1:
    // [39] phi (byte) scrollup1::c#2 = (byte) 0 [phi:scrollup1::@1->scrollup1::@2#0] -- vbuxx=vbuc1 
    ldx #0
    jmp __b2
    // scrollup1::@2
  __b2:
    // [40] if((byte) scrollup1::c#2<(byte) $28) goto scrollup1::@3 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$28
    bcc __b3
    jmp __b4
    // scrollup1::@4
  __b4:
    // [41] (word) scrollup1::line#1 ← (word) scrollup1::line#2 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z line
    sta.z line
    bcc !+
    inc.z line+1
  !:
    // [36] phi from scrollup1::@4 to scrollup1::@1 [phi:scrollup1::@4->scrollup1::@1]
  __b1_from___b4:
    // [36] phi (word) scrollup1::line#2 = (word) scrollup1::line#1 [phi:scrollup1::@4->scrollup1::@1#0] -- register_copy 
    jmp __b1
    // scrollup1::@3
  __b3:
    // [42] (word~) scrollup1::$2 ← (word) scrollup1::line#2 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuxx 
    txa
    clc
    adc.z line
    sta.z __2
    lda #0
    adc.z line+1
    sta.z __2+1
    // [43] (word~) scrollup1::$4 ← (word) scrollup1::line#2 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuxx 
    txa
    clc
    adc.z line
    sta.z __4
    lda #0
    adc.z line+1
    sta.z __4+1
    // [44] (byte*~) scrollup1::$5 ← (const byte*) screen+(byte) $28 + (word~) scrollup1::$4 -- pbuz1=pbuc1_plus_vwuz1 
    clc
    lda.z __5
    adc #<screen+$28
    sta.z __5
    lda.z __5+1
    adc #>screen+$28
    sta.z __5+1
    // [45] (byte*~) scrollup1::$6 ← (const byte*) screen + (word~) scrollup1::$2 -- pbuz1=pbuc1_plus_vwuz1 
    clc
    lda.z __6
    adc #<screen
    sta.z __6
    lda.z __6+1
    adc #>screen
    sta.z __6+1
    // [46] *((byte*~) scrollup1::$6) ← *((byte*~) scrollup1::$5) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (__5),y
    ldy #0
    sta (__6),y
    // [47] (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#2 -- vbuxx=_inc_vbuxx 
    inx
    // [39] phi from scrollup1::@3 to scrollup1::@2 [phi:scrollup1::@3->scrollup1::@2]
  __b2_from___b3:
    // [39] phi (byte) scrollup1::c#2 = (byte) scrollup1::c#1 [phi:scrollup1::@3->scrollup1::@2#0] -- register_copy 
    jmp __b2
}
  // 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 __breturn
Removing instruction jmp __b3
Removing instruction jmp __b5
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b3
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b2
Removing instruction jmp __b4
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 __bbegin with __b1
Replacing label __b2_from___b2 with __b2
Replacing label __b1_from___b3 with __b1
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
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___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 __breturn:
Removing instruction __b3_from___b2:
Removing instruction __b5:
Removing instruction __b1_from___b5:
Removing instruction __b3_from___b4:
Removing instruction __b1_from_scrollup2:
Removing instruction __b3:
Removing instruction __breturn:
Removing instruction __b1_from_scrollup1:
Removing instruction __breturn:
Removing instruction __b4:
Removing instruction __b1_from___b4:
Removing instruction __b2_from___b3:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Relabelling long label __b2_from___b1 to b1
Succesful ASM optimization Pass5RelabelLongLabels
Removing instruction jmp __b1
Removing instruction jmp __b2
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __b1:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@return
(const byte*) screen = (byte*) 1024
(void()) scrollup1()
(word~) scrollup1::$2 zp[2]:7 67.33333333333333
(word~) scrollup1::$4 zp[2]:9 202.0
(byte*~) scrollup1::$5 zp[2]:9 101.0
(byte*~) scrollup1::$6 zp[2]:7 202.0
(label) scrollup1::@1
(label) scrollup1::@2
(label) scrollup1::@3
(label) scrollup1::@4
(label) scrollup1::@return
(byte) scrollup1::c
(byte) scrollup1::c#1 reg byte x 202.0
(byte) scrollup1::c#2 reg byte x 72.14285714285714
(word) scrollup1::line
(word) scrollup1::line#1 line zp[2]:5 22.0
(word) scrollup1::line#2 line zp[2]:5 23.5
(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[1]:2 16.5
(byte) scrollup2::l#4 l zp[1]:2 3.142857142857143
(byte*) scrollup2::line1
(byte*) scrollup2::line1#1 line1 zp[2]:3 35.5
(byte*) scrollup2::line1#2 line1 zp[2]:3 157.0
(byte*) scrollup2::line1#3 line1 zp[2]:3 22.0
(byte*) scrollup2::line2
(byte*) scrollup2::line2#1 line2 zp[2]:9 42.599999999999994
(byte*) scrollup2::line2#2 line2 zp[2]:9 104.66666666666666
(byte*) scrollup2::line2#3 line2 zp[2]:9 22.0
(void()) scrollup3()
(byte*~) scrollup3::$3 zp[2]:5 101.0
(byte*~) scrollup3::$4 zp[2]:7 202.0
(label) scrollup3::@1
(label) scrollup3::@2
(label) scrollup3::@3
(label) scrollup3::@4
(label) scrollup3::@5
(label) scrollup3::@return
(byte) scrollup3::c
(byte) scrollup3::c#1 reg byte x 202.0
(byte) scrollup3::c#2 reg byte x 50.5
(word) scrollup3::l2
(word) scrollup3::l2#1 l2 zp[2]:3 101.0
(word) scrollup3::l2#2 l2 zp[2]:3 83.0
(word) scrollup3::l2#4 l2 zp[2]:3 22.0
(word) scrollup3::line
(word) scrollup3::line#1 line zp[2]:9 22.0
(word) scrollup3::line#2 line zp[2]:9 4.4

reg byte x [ scrollup3::c#2 scrollup3::c#1 ]
zp[1]:2 [ scrollup2::l#4 scrollup2::l#1 ]
zp[2]:3 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ]
reg byte x [ scrollup2::c#2 scrollup2::c#1 ]
reg byte x [ scrollup1::c#2 scrollup1::c#1 ]
zp[2]:5 [ scrollup3::$3 scrollup1::line#2 scrollup1::line#1 ]
zp[2]:7 [ scrollup1::$2 scrollup1::$6 scrollup3::$4 ]
zp[2]:9 [ scrollup1::$4 scrollup1::$5 scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 scrollup3::line#2 scrollup3::line#1 ]


FINAL ASSEMBLER
Score: 23207

  // File Comments
// Tests different ways of scrolling up the screen
  // 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 = 3
    .label line = 9
    .label __3 = 5
    .label __4 = 7
    // [12] phi from scrollup3 to scrollup3::@1 [phi:scrollup3->scrollup3::@1]
    // [12] phi (word) scrollup3::line#2 = (word) 0 [phi:scrollup3->scrollup3::@1#0] -- vwuz1=vwuc1 
    lda #<0
    sta.z line
    sta.z line+1
    // scrollup3::@1
  __b1:
    // for (word line = 0; line < 40*24; line += 40)
    // [13] if((word) scrollup3::line#2<(word)(number) $28*(number) $18) goto scrollup3::@2 -- vwuz1_lt_vwuc1_then_la1 
    lda.z line+1
    cmp #>$28*$18
    bcc __b2
    bne !+
    lda.z line
    cmp #<$28*$18
    bcc __b2
  !:
    // scrollup3::@return
    // }
    // [14] return 
    rts
    // scrollup3::@2
  __b2:
    // [15] (word) scrollup3::l2#4 ← (word) scrollup3::line#2 -- vwuz1=vwuz2 
    lda.z line
    sta.z l2
    lda.z line+1
    sta.z l2+1
    // [16] phi from scrollup3::@2 to scrollup3::@3 [phi:scrollup3::@2->scrollup3::@3]
    // [16] phi (word) scrollup3::l2#2 = (word) scrollup3::l2#4 [phi:scrollup3::@2->scrollup3::@3#0] -- register_copy 
    // [16] phi (byte) scrollup3::c#2 = (byte) 0 [phi:scrollup3::@2->scrollup3::@3#1] -- vbuxx=vbuc1 
    ldx #0
    // scrollup3::@3
  __b3:
    // for (byte c=0; c<40; ++c)
    // [17] if((byte) scrollup3::c#2<(byte) $28) goto scrollup3::@4 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$28
    bcc __b4
    // scrollup3::@5
    // line += 40
    // [18] (word) scrollup3::line#1 ← (word) scrollup3::line#2 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z line
    sta.z line
    bcc !+
    inc.z line+1
  !:
    // [12] phi from scrollup3::@5 to scrollup3::@1 [phi:scrollup3::@5->scrollup3::@1]
    // [12] phi (word) scrollup3::line#2 = (word) scrollup3::line#1 [phi:scrollup3::@5->scrollup3::@1#0] -- register_copy 
    jmp __b1
    // scrollup3::@4
  __b4:
    // screen[l2++] = screen[l2+40]
    // [19] (byte*~) scrollup3::$3 ← (const byte*) screen+(byte) $28 + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z l2
    clc
    adc #<screen+$28
    sta.z __3
    lda.z l2+1
    adc #>screen+$28
    sta.z __3+1
    // [20] (byte*~) scrollup3::$4 ← (const byte*) screen + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z l2
    clc
    adc #<screen
    sta.z __4
    lda.z l2+1
    adc #>screen
    sta.z __4+1
    // [21] *((byte*~) scrollup3::$4) ← *((byte*~) scrollup3::$3) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (__3),y
    sta (__4),y
    // screen[l2++] = screen[l2+40];
    // [22] (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2 -- vwuz1=_inc_vwuz1 
    inc.z l2
    bne !+
    inc.z l2+1
  !:
    // for (byte c=0; c<40; ++c)
    // [23] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#2 -- vbuxx=_inc_vbuxx 
    inx
    // [16] phi from scrollup3::@4 to scrollup3::@3 [phi:scrollup3::@4->scrollup3::@3]
    // [16] phi (word) scrollup3::l2#2 = (word) scrollup3::l2#1 [phi:scrollup3::@4->scrollup3::@3#0] -- register_copy 
    // [16] phi (byte) scrollup3::c#2 = (byte) scrollup3::c#1 [phi:scrollup3::@4->scrollup3::@3#1] -- register_copy 
    jmp __b3
}
  // scrollup2
scrollup2: {
    .label line1 = 3
    .label line2 = 9
    .label l = 2
    // [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.z l
    // [25] phi (byte*) scrollup2::line1#3 = (const byte*) screen [phi:scrollup2->scrollup2::@1#1] -- pbuz1=pbuc1 
    lda #<screen
    sta.z line1
    lda #>screen
    sta.z line1+1
    // [25] phi (byte*) scrollup2::line2#3 = (const byte*) screen+(byte) $28 [phi:scrollup2->scrollup2::@1#2] -- pbuz1=pbuc1 
    lda #<screen+$28
    sta.z line2
    lda #>screen+$28
    sta.z 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.z line1
    bne !+
    inc.z line1+1
  !:
    // [29] (byte*) scrollup2::line2#1 ← ++ (byte*) scrollup2::line2#2 -- pbuz1=_inc_pbuz1 
    inc.z line2
    bne !+
    inc.z 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.z l
    // [33] if((byte) scrollup2::l#1!=(byte) $18) goto scrollup2::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #$18
    cmp.z l
    bne __b1
    // scrollup2::@return
    // }
    // [34] return 
    rts
}
  // scrollup1
scrollup1: {
    .label __2 = 7
    .label __4 = 9
    .label line = 5
    .label __5 = 9
    .label __6 = 7
    // [36] phi from scrollup1 to scrollup1::@1 [phi:scrollup1->scrollup1::@1]
    // [36] phi (word) scrollup1::line#2 = (word) 0 [phi:scrollup1->scrollup1::@1#0] -- vwuz1=vwuc1 
    lda #<0
    sta.z line
    sta.z line+1
    // scrollup1::@1
  __b1:
    // for (word line = 0; line < 40*24; line += 40)
    // [37] if((word) scrollup1::line#2<(word)(number) $28*(number) $18) goto scrollup1::@2 -- vwuz1_lt_vwuc1_then_la1 
    lda.z line+1
    cmp #>$28*$18
    bcc b1
    bne !+
    lda.z line
    cmp #<$28*$18
    bcc b1
  !:
    // scrollup1::@return
    // }
    // [38] return 
    rts
    // [39] phi from scrollup1::@1 to scrollup1::@2 [phi:scrollup1::@1->scrollup1::@2]
  b1:
    // [39] phi (byte) scrollup1::c#2 = (byte) 0 [phi:scrollup1::@1->scrollup1::@2#0] -- vbuxx=vbuc1 
    ldx #0
    // scrollup1::@2
  __b2:
    // for (byte c=0; c<40; ++c)
    // [40] if((byte) scrollup1::c#2<(byte) $28) goto scrollup1::@3 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$28
    bcc __b3
    // scrollup1::@4
    // line += 40
    // [41] (word) scrollup1::line#1 ← (word) scrollup1::line#2 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z line
    sta.z line
    bcc !+
    inc.z line+1
  !:
    // [36] phi from scrollup1::@4 to scrollup1::@1 [phi:scrollup1::@4->scrollup1::@1]
    // [36] phi (word) scrollup1::line#2 = (word) scrollup1::line#1 [phi:scrollup1::@4->scrollup1::@1#0] -- register_copy 
    jmp __b1
    // scrollup1::@3
  __b3:
    // line+c
    // [42] (word~) scrollup1::$2 ← (word) scrollup1::line#2 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuxx 
    txa
    clc
    adc.z line
    sta.z __2
    lda #0
    adc.z line+1
    sta.z __2+1
    // line+c+40
    // [43] (word~) scrollup1::$4 ← (word) scrollup1::line#2 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuxx 
    txa
    clc
    adc.z line
    sta.z __4
    lda #0
    adc.z line+1
    sta.z __4+1
    // screen[line+c] = screen[line+c+40]
    // [44] (byte*~) scrollup1::$5 ← (const byte*) screen+(byte) $28 + (word~) scrollup1::$4 -- pbuz1=pbuc1_plus_vwuz1 
    clc
    lda.z __5
    adc #<screen+$28
    sta.z __5
    lda.z __5+1
    adc #>screen+$28
    sta.z __5+1
    // [45] (byte*~) scrollup1::$6 ← (const byte*) screen + (word~) scrollup1::$2 -- pbuz1=pbuc1_plus_vwuz1 
    clc
    lda.z __6
    adc #<screen
    sta.z __6
    lda.z __6+1
    adc #>screen
    sta.z __6+1
    // [46] *((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)
    // [47] (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#2 -- vbuxx=_inc_vbuxx 
    inx
    // [39] phi from scrollup1::@3 to scrollup1::@2 [phi:scrollup1::@3->scrollup1::@2]
    // [39] phi (byte) scrollup1::c#2 = (byte) scrollup1::c#1 [phi:scrollup1::@3->scrollup1::@2#0] -- register_copy 
    jmp __b2
}
  // File Data

