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
  (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::@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 ← (number) 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
  *((byte*) screen#0 + (word~) scrollup1::$2) ← *((byte*) screen#0 + (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
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::@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 ← (number) 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
  *((byte*) screen#0 + (word) scrollup3::l2#2) ← *((byte*) screen#0 + (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
(byte*) screen
(byte*) screen#0
(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()
(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()
(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) 0 in (word) scrollup1::line#0 ← (number) 0
Adding number conversion cast (unumber) $28*$18 in (bool~) scrollup1::$0 ← (word) scrollup1::line#2 < (number) $28*(number) $18
Adding number conversion cast (unumber) 0 in (byte) scrollup1::c#0 ← (number) 0
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::$0 ← (byte*) screen#0 + (number) $28
Adding number conversion cast (unumber) 0 in (word) scrollup3::line#0 ← (number) 0
Adding number conversion cast (unumber) $28*$18 in (bool~) scrollup3::$0 ← (word) scrollup3::line#2 < (number) $28*(number) $18
Adding number conversion cast (unumber) 0 in (byte) scrollup3::c#0 ← (number) 0
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
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::$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::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::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 [8] if((word) scrollup1::line#2<(word)(number) $28*(number) $18) goto scrollup1::@2
Simple Condition (bool~) scrollup1::$1 [13] if((byte) scrollup1::c#2<(byte) $28) goto scrollup1::@5
Simple Condition (bool~) scrollup2::$1 [35] if((byte) scrollup2::c#1!=rangelast(0,$27)) goto scrollup2::@2
Simple Condition (bool~) scrollup2::$2 [39] if((byte) scrollup2::l#1!=rangelast(0,$17)) goto scrollup2::@1
Simple Condition (bool~) scrollup3::$0 [44] if((word) scrollup3::line#2<(word)(number) $28*(number) $18) goto scrollup3::@2
Simple Condition (bool~) scrollup3::$1 [50] if((byte) scrollup3::c#2<(byte) $28) goto scrollup3::@5
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 [33] scrollup2::c#1 ← ++ scrollup2::c#2 to ++
Resolved ranged comparison value [35] if(scrollup2::c#1!=rangelast(0,$27)) goto scrollup2::@2 to (number) $28
Resolved ranged next value [37] scrollup2::l#1 ← ++ scrollup2::l#4 to ++
Resolved ranged comparison value [39] if(scrollup2::l#1!=rangelast(0,$17)) goto scrollup2::@1 to (number) $18
De-inlining pointer[w] to *(pointer+w)   [18] *((const byte*) screen#0 + (word~) scrollup1::$2) ← *((const byte*) screen#0 + (word~) scrollup1::$4)
De-inlining pointer[w] to *(pointer+w)   [18] *((const byte*) screen#0 + (word~) scrollup1::$2) ← *((byte*~) scrollup1::$5)
De-inlining pointer[w] to *(pointer+w)   [53] *((const byte*) screen#0 + (word) scrollup3::l2#2) ← *((const byte*) screen#0 + (word~) scrollup3::$2)
De-inlining pointer[w] to *(pointer+w)   [53] *((const byte*) screen#0 + (word) scrollup3::l2#2) ← *((byte*~) scrollup3::$3)
Successful SSA optimization Pass2DeInlineWordDerefIdx
Successful SSA optimization Pass2LoopHeadConstantIdentification
Successful SSA optimization Pass2LoopHeadConstantIdentification
Successful SSA optimization Pass2LoopHeadConstantIdentification
Successful SSA optimization Pass2LoopHeadConstantIdentification
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
Alias (word) scrollup1::line#1 = (word) scrollup1::line#2 
Alias (byte) scrollup1::c#1 = (byte) scrollup1::c#2 
Alias (word) scrollup1::line#7 = (word) scrollup1::line#9 
Alias (word) scrollup3::line#1 = (word) scrollup3::line#2 
Alias (byte) scrollup3::c#1 = (byte) scrollup3::c#2 
Alias (word) scrollup3::l2#1 = (word) scrollup3::l2#2 
Alias (word) scrollup3::line#11 = (word) scrollup3::line#9 
Alias (word) scrollup1::line#10 = (word) scrollup1::line#11 
Alias (word) scrollup3::line#10 = (word) scrollup3::l2#5 (word) scrollup3::line#8 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (word) scrollup1::line#7 (word) scrollup1::line#10
Identical Phi Values (word) scrollup3::line#11 (word) scrollup3::line#10
Identical Phi Values (byte) scrollup1::c#5 (const byte) scrollup1::c#0
Identical Phi Values (word) scrollup1::line#12 (const word) scrollup1::line#0
Identical Phi Values (byte) scrollup3::c#5 (const byte) scrollup3::c#0
Identical Phi Values (word) scrollup3::line#12 (const word) scrollup3::line#0
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values (word) scrollup1::line#8 (word) scrollup1::line#10
Identical Phi Values (word) scrollup3::line#7 (word) scrollup3::line#10
Successful SSA optimization Pass2IdenticalPhiElimination
Constant right-side identified [21] (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
if() condition always true - replacing block destination [50] if((const byte) scrollup1::c#0<(byte) $28) goto scrollup1::@5
if() condition always true - replacing block destination [52] if((const word) scrollup1::line#0<(word)(number) $28*(number) $18) goto scrollup1::@2
if() condition always true - replacing block destination [54] if((const byte) scrollup3::c#0<(byte) $28) goto scrollup3::@5
if() condition always true - replacing block destination [56] if((const word) scrollup3::line#0<(word)(number) $28*(number) $18) goto scrollup3::@2
Successful SSA optimization Pass2ConstantIfs
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::$4 = (word~) scrollup1::$3 
Alias (word) scrollup3::l2#4 = (word~) scrollup3::$2 
Successful SSA optimization Pass2AliasElimination
Added new block during phi lifting scrollup1::@13(between scrollup1::@1 and scrollup1::@2)
Added new block during phi lifting scrollup1::@14(between scrollup1::@4 and scrollup1::@5)
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::@13(between scrollup3::@1 and scrollup3::@2)
Added new block during phi lifting scrollup3::@14(between scrollup3::@4 and scrollup3::@5)
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 scrollup3::@1_1
Adding NOP phi() at start of scrollup2
Adding NOP phi() at start of scrollup1
Adding NOP phi() at start of scrollup1::@1_1
Adding NOP phi() at start of scrollup1::@4_1
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 [16] scrollup3::l2#7 ← scrollup3::line#10
Coalesced [27] scrollup3::line#13 ← scrollup3::line#1
Coalesced [28] scrollup3::c#6 ← scrollup3::c#1
Coalesced [29] scrollup3::l2#6 ← scrollup3::l2#1
Coalesced [32] scrollup2::line2#6 ← scrollup2::line2#3
Coalesced [33] scrollup2::line1#6 ← scrollup2::line1#3
Coalesced [43] scrollup2::line2#5 ← scrollup2::line2#1
Coalesced [44] scrollup2::line1#5 ← scrollup2::line1#1
Coalesced [45] scrollup2::l#5 ← scrollup2::l#1
Coalesced (already) [46] scrollup2::line2#7 ← scrollup2::line2#1
Coalesced (already) [47] scrollup2::line1#7 ← scrollup2::line1#1
Coalesced [48] scrollup2::c#3 ← scrollup2::c#1
Coalesced [64] scrollup1::line#13 ← scrollup1::line#1
Coalesced [65] scrollup1::c#6 ← 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::@1_1
Culled Empty Block (label) scrollup3::@13
Culled Empty Block (label) scrollup3::@14
Culled Empty Block (label) scrollup2::@5
Culled Empty Block (label) scrollup2::@6
Culled Empty Block (label) scrollup1::@1_1
Culled Empty Block (label) scrollup1::@4_1
Culled Empty Block (label) scrollup1::@13
Culled Empty Block (label) scrollup1::@14
Renumbering block @4 to @1
Renumbering block scrollup1::@4 to scrollup1::@3
Renumbering block scrollup1::@5 to scrollup1::@4
Renumbering block scrollup1::@6 to scrollup1::@5
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()
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::@2
scrollup3::@2: scope:[scrollup3]  from scrollup3 scrollup3::@1
  [12] (word) scrollup3::line#10 ← phi( scrollup3::@1/(word) scrollup3::line#1 scrollup3/(byte) 0 )
  to:scrollup3::@4_1
scrollup3::@4_1: scope:[scrollup3]  from scrollup3::@2
  [13] (word~) scrollup3::l2#7 ← (word) scrollup3::line#10
  to:scrollup3::@4
scrollup3::@4: scope:[scrollup3]  from scrollup3::@3 scrollup3::@4_1
  [14] (word) scrollup3::l2#4 ← phi( scrollup3::@3/(word) scrollup3::l2#1 scrollup3::@4_1/(word~) scrollup3::l2#7 )
  [14] (byte) scrollup3::c#4 ← phi( scrollup3::@3/(byte) scrollup3::c#1 scrollup3::@4_1/(byte) 0 )
  [15] (byte*~) scrollup3::$3 ← (const byte*) screen#0+(byte) $28 + (word) scrollup3::l2#4
  [16] (byte*~) scrollup3::$4 ← (const byte*) screen#0 + (word) scrollup3::l2#4
  [17] *((byte*~) scrollup3::$4) ← *((byte*~) scrollup3::$3)
  [18] (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#4
  [19] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#4
  to:scrollup3::@3
scrollup3::@3: scope:[scrollup3]  from scrollup3::@4
  [20] if((byte) scrollup3::c#1<(byte) $28) goto scrollup3::@4
  to:scrollup3::@5
scrollup3::@5: scope:[scrollup3]  from scrollup3::@3
  [21] (word) scrollup3::line#1 ← (word) scrollup3::line#10 + (byte) $28
  to:scrollup3::@1
scrollup3::@1: scope:[scrollup3]  from scrollup3::@5
  [22] if((word) scrollup3::line#1<(word)(number) $28*(number) $18) goto scrollup3::@2
  to:scrollup3::@return
scrollup3::@return: scope:[scrollup3]  from scrollup3::@1
  [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::@2
scrollup1::@2: scope:[scrollup1]  from scrollup1 scrollup1::@1
  [36] (word) scrollup1::line#10 ← phi( scrollup1::@1/(word) scrollup1::line#1 scrollup1/(byte) 0 )
  to:scrollup1::@4
scrollup1::@4: scope:[scrollup1]  from scrollup1::@2 scrollup1::@3
  [37] (byte) scrollup1::c#4 ← phi( scrollup1::@3/(byte) scrollup1::c#1 scrollup1::@2/(byte) 0 )
  [38] (word~) scrollup1::$2 ← (word) scrollup1::line#10 + (byte) scrollup1::c#4
  [39] (word~) scrollup1::$4 ← (word) scrollup1::line#10 + (byte) scrollup1::c#4
  [40] (byte*~) scrollup1::$5 ← (const byte*) screen#0+(byte) $28 + (word~) scrollup1::$4
  [41] (byte*~) scrollup1::$6 ← (const byte*) screen#0 + (word~) scrollup1::$2
  [42] *((byte*~) scrollup1::$6) ← *((byte*~) scrollup1::$5)
  [43] (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#4
  to:scrollup1::@3
scrollup1::@3: scope:[scrollup1]  from scrollup1::@4
  [44] if((byte) scrollup1::c#1<(byte) $28) goto scrollup1::@4
  to:scrollup1::@5
scrollup1::@5: scope:[scrollup1]  from scrollup1::@3
  [45] (word) scrollup1::line#1 ← (word) scrollup1::line#10 + (byte) $28
  to:scrollup1::@1
scrollup1::@1: scope:[scrollup1]  from scrollup1::@5
  [46] if((word) scrollup1::line#1<(word)(number) $28*(number) $18) goto scrollup1::@2
  to:scrollup1::@return
scrollup1::@return: scope:[scrollup1]  from scrollup1::@1
  [47] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(void()) main()
(byte*) screen
(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 151.5
(byte) scrollup1::c#4 67.33333333333333
(word) scrollup1::line
(word) scrollup1::line#1 16.5
(word) scrollup1::line#10 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#4 40.4
(word) scrollup3::l2
(word) scrollup3::l2#1 67.33333333333333
(word) scrollup3::l2#4 103.75
(word~) scrollup3::l2#7 22.0
(word) scrollup3::line
(word) scrollup3::line#1 16.5
(word) scrollup3::line#10 3.666666666666667

Initial phi equivalence classes
[ scrollup3::line#10 scrollup3::line#1 ]
[ scrollup3::c#4 scrollup3::c#1 ]
[ scrollup3::l2#4 scrollup3::l2#1 scrollup3::l2#7 ]
[ 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#10 scrollup1::line#1 ]
[ scrollup1::c#4 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::$2 to zero page equivalence class [ scrollup1::$2 ]
Added variable scrollup1::$4 to zero page equivalence class [ scrollup1::$4 ]
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::line#10 scrollup3::line#1 ]
[ scrollup3::c#4 scrollup3::c#1 ]
[ scrollup3::l2#4 scrollup3::l2#1 scrollup3::l2#7 ]
[ 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#10 scrollup1::line#1 ]
[ scrollup1::c#4 scrollup1::c#1 ]
[ scrollup3::$3 ]
[ scrollup3::$4 ]
[ scrollup1::$2 ]
[ scrollup1::$4 ]
[ scrollup1::$5 ]
[ scrollup1::$6 ]
Allocated zp ZP_WORD:2 [ scrollup3::line#10 scrollup3::line#1 ]
Allocated zp ZP_BYTE:4 [ scrollup3::c#4 scrollup3::c#1 ]
Allocated zp ZP_WORD:5 [ scrollup3::l2#4 scrollup3::l2#1 scrollup3::l2#7 ]
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#10 scrollup1::line#1 ]
Allocated zp ZP_BYTE:15 [ scrollup1::c#4 scrollup1::c#1 ]
Allocated zp ZP_WORD:16 [ scrollup3::$3 ]
Allocated zp ZP_WORD:18 [ scrollup3::$4 ]
Allocated zp ZP_WORD:20 [ scrollup1::$2 ]
Allocated zp ZP_WORD:22 [ scrollup1::$4 ]
Allocated zp ZP_WORD:24 [ scrollup1::$5 ]
Allocated zp ZP_WORD:26 [ scrollup1::$6 ]

INITIAL ASM
Target platform is c64basic
  // 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::@2 [phi:scrollup3->scrollup3::@2]
  b2_from_scrollup3:
    // [12] phi (word) scrollup3::line#10 = (byte) 0 [phi:scrollup3->scrollup3::@2#0] -- vwuz1=vbuc1 
    lda #<0
    sta.z line
    lda #>0
    sta.z line+1
    jmp b2
    // [12] phi from scrollup3::@1 to scrollup3::@2 [phi:scrollup3::@1->scrollup3::@2]
  b2_from_b1:
    // [12] phi (word) scrollup3::line#10 = (word) scrollup3::line#1 [phi:scrollup3::@1->scrollup3::@2#0] -- register_copy 
    jmp b2
    // scrollup3::@2
  b2:
    jmp b4_1
    // scrollup3::@4_1
  b4_1:
    // [13] (word~) scrollup3::l2#7 ← (word) scrollup3::line#10 -- vwuz1=vwuz2 
    lda.z line
    sta.z l2
    lda.z line+1
    sta.z l2+1
    // [14] phi from scrollup3::@4_1 to scrollup3::@4 [phi:scrollup3::@4_1->scrollup3::@4]
  b4_from_b4_1:
    // [14] phi (word) scrollup3::l2#4 = (word~) scrollup3::l2#7 [phi:scrollup3::@4_1->scrollup3::@4#0] -- register_copy 
    // [14] phi (byte) scrollup3::c#4 = (byte) 0 [phi:scrollup3::@4_1->scrollup3::@4#1] -- vbuz1=vbuc1 
    lda #0
    sta.z c
    jmp b4
    // [14] phi from scrollup3::@3 to scrollup3::@4 [phi:scrollup3::@3->scrollup3::@4]
  b4_from_b3:
    // [14] phi (word) scrollup3::l2#4 = (word) scrollup3::l2#1 [phi:scrollup3::@3->scrollup3::@4#0] -- register_copy 
    // [14] phi (byte) scrollup3::c#4 = (byte) scrollup3::c#1 [phi:scrollup3::@3->scrollup3::@4#1] -- register_copy 
    jmp b4
    // scrollup3::@4
  b4:
    // [15] (byte*~) scrollup3::$3 ← (const byte*) screen#0+(byte) $28 + (word) scrollup3::l2#4 -- 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
    // [16] (byte*~) scrollup3::$4 ← (const byte*) screen#0 + (word) scrollup3::l2#4 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z l2
    clc
    adc #<screen
    sta.z _4
    lda.z l2+1
    adc #>screen
    sta.z _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#4 -- vwuz1=_inc_vwuz1 
    inc.z l2
    bne !+
    inc.z l2+1
  !:
    // [19] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#4 -- vbuz1=_inc_vbuz1 
    inc.z c
    jmp b3
    // scrollup3::@3
  b3:
    // [20] if((byte) scrollup3::c#1<(byte) $28) goto scrollup3::@4 -- vbuz1_lt_vbuc1_then_la1 
    lda.z c
    cmp #$28
    bcc b4_from_b3
    jmp b5
    // scrollup3::@5
  b5:
    // [21] (word) scrollup3::line#1 ← (word) scrollup3::line#10 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z line
    sta.z line
    bcc !+
    inc.z line+1
  !:
    jmp b1
    // scrollup3::@1
  b1:
    // [22] if((word) scrollup3::line#1<(word)(number) $28*(number) $18) goto scrollup3::@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
    // 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.z l
    // [25] phi (byte*) scrollup2::line1#3 = (const byte*) screen#0 [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#0+(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::@2 [phi:scrollup1->scrollup1::@2]
  b2_from_scrollup1:
    // [36] phi (word) scrollup1::line#10 = (byte) 0 [phi:scrollup1->scrollup1::@2#0] -- vwuz1=vbuc1 
    lda #<0
    sta.z line
    lda #>0
    sta.z line+1
    jmp b2
    // [36] phi from scrollup1::@1 to scrollup1::@2 [phi:scrollup1::@1->scrollup1::@2]
  b2_from_b1:
    // [36] phi (word) scrollup1::line#10 = (word) scrollup1::line#1 [phi:scrollup1::@1->scrollup1::@2#0] -- register_copy 
    jmp b2
    // scrollup1::@2
  b2:
    // [37] phi from scrollup1::@2 to scrollup1::@4 [phi:scrollup1::@2->scrollup1::@4]
  b4_from_b2:
    // [37] phi (byte) scrollup1::c#4 = (byte) 0 [phi:scrollup1::@2->scrollup1::@4#0] -- vbuz1=vbuc1 
    lda #0
    sta.z c
    jmp b4
    // [37] phi from scrollup1::@3 to scrollup1::@4 [phi:scrollup1::@3->scrollup1::@4]
  b4_from_b3:
    // [37] phi (byte) scrollup1::c#4 = (byte) scrollup1::c#1 [phi:scrollup1::@3->scrollup1::@4#0] -- register_copy 
    jmp b4
    // scrollup1::@4
  b4:
    // [38] (word~) scrollup1::$2 ← (word) scrollup1::line#10 + (byte) scrollup1::c#4 -- vwuz1=vwuz2_plus_vbuz3 
    lda.z c
    clc
    adc.z line
    sta.z _2
    lda #0
    adc.z line+1
    sta.z _2+1
    // [39] (word~) scrollup1::$4 ← (word) scrollup1::line#10 + (byte) scrollup1::c#4 -- vwuz1=vwuz2_plus_vbuz3 
    lda.z c
    clc
    adc.z line
    sta.z _4
    lda #0
    adc.z line+1
    sta.z _4+1
    // [40] (byte*~) scrollup1::$5 ← (const byte*) screen#0+(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
    // [41] (byte*~) scrollup1::$6 ← (const byte*) screen#0 + (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
    // [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#4 -- vbuz1=_inc_vbuz1 
    inc.z c
    jmp b3
    // scrollup1::@3
  b3:
    // [44] if((byte) scrollup1::c#1<(byte) $28) goto scrollup1::@4 -- vbuz1_lt_vbuc1_then_la1 
    lda.z c
    cmp #$28
    bcc b4_from_b3
    jmp b5
    // scrollup1::@5
  b5:
    // [45] (word) scrollup1::line#1 ← (word) scrollup1::line#10 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z line
    sta.z line
    bcc !+
    inc.z line+1
  !:
    jmp b1
    // scrollup1::@1
  b1:
    // [46] if((word) scrollup1::line#1<(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:
    // [47] return 
    rts
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [13] (word~) scrollup3::l2#7 ← (word) scrollup3::line#10 [ scrollup3::line#10 scrollup3::l2#7 ] ( main:2::scrollup3:9 [ scrollup3::line#10 scrollup3::l2#7 ] ) always clobbers reg byte a 
Statement [15] (byte*~) scrollup3::$3 ← (const byte*) screen#0+(byte) $28 + (word) scrollup3::l2#4 [ scrollup3::line#10 scrollup3::c#4 scrollup3::l2#4 scrollup3::$3 ] ( main:2::scrollup3:9 [ scrollup3::line#10 scrollup3::c#4 scrollup3::l2#4 scrollup3::$3 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ scrollup3::c#4 scrollup3::c#1 ]
Statement [16] (byte*~) scrollup3::$4 ← (const byte*) screen#0 + (word) scrollup3::l2#4 [ scrollup3::line#10 scrollup3::c#4 scrollup3::l2#4 scrollup3::$3 scrollup3::$4 ] ( main:2::scrollup3:9 [ scrollup3::line#10 scrollup3::c#4 scrollup3::l2#4 scrollup3::$3 scrollup3::$4 ] ) always clobbers reg byte a 
Statement [17] *((byte*~) scrollup3::$4) ← *((byte*~) scrollup3::$3) [ scrollup3::line#10 scrollup3::c#4 scrollup3::l2#4 ] ( main:2::scrollup3:9 [ scrollup3::line#10 scrollup3::c#4 scrollup3::l2#4 ] ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:4 [ scrollup3::c#4 scrollup3::c#1 ]
Statement [21] (word) scrollup3::line#1 ← (word) scrollup3::line#10 + (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::@2 [ 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::$2 ← (word) scrollup1::line#10 + (byte) scrollup1::c#4 [ scrollup1::line#10 scrollup1::c#4 scrollup1::$2 ] ( main:2::scrollup1:5 [ scrollup1::line#10 scrollup1::c#4 scrollup1::$2 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:15 [ scrollup1::c#4 scrollup1::c#1 ]
Statement [39] (word~) scrollup1::$4 ← (word) scrollup1::line#10 + (byte) scrollup1::c#4 [ scrollup1::line#10 scrollup1::c#4 scrollup1::$2 scrollup1::$4 ] ( main:2::scrollup1:5 [ scrollup1::line#10 scrollup1::c#4 scrollup1::$2 scrollup1::$4 ] ) always clobbers reg byte a 
Statement [40] (byte*~) scrollup1::$5 ← (const byte*) screen#0+(byte) $28 + (word~) scrollup1::$4 [ scrollup1::line#10 scrollup1::c#4 scrollup1::$2 scrollup1::$5 ] ( main:2::scrollup1:5 [ scrollup1::line#10 scrollup1::c#4 scrollup1::$2 scrollup1::$5 ] ) always clobbers reg byte a 
Statement [41] (byte*~) scrollup1::$6 ← (const byte*) screen#0 + (word~) scrollup1::$2 [ scrollup1::line#10 scrollup1::c#4 scrollup1::$5 scrollup1::$6 ] ( main:2::scrollup1:5 [ scrollup1::line#10 scrollup1::c#4 scrollup1::$5 scrollup1::$6 ] ) always clobbers reg byte a 
Statement [42] *((byte*~) scrollup1::$6) ← *((byte*~) scrollup1::$5) [ scrollup1::line#10 scrollup1::c#4 ] ( main:2::scrollup1:5 [ scrollup1::line#10 scrollup1::c#4 ] ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:15 [ scrollup1::c#4 scrollup1::c#1 ]
Statement [45] (word) scrollup1::line#1 ← (word) scrollup1::line#10 + (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::@2 [ scrollup1::line#1 ] ( main:2::scrollup1:5 [ scrollup1::line#1 ] ) always clobbers reg byte a 
Statement [13] (word~) scrollup3::l2#7 ← (word) scrollup3::line#10 [ scrollup3::line#10 scrollup3::l2#7 ] ( main:2::scrollup3:9 [ scrollup3::line#10 scrollup3::l2#7 ] ) always clobbers reg byte a 
Statement [15] (byte*~) scrollup3::$3 ← (const byte*) screen#0+(byte) $28 + (word) scrollup3::l2#4 [ scrollup3::line#10 scrollup3::c#4 scrollup3::l2#4 scrollup3::$3 ] ( main:2::scrollup3:9 [ scrollup3::line#10 scrollup3::c#4 scrollup3::l2#4 scrollup3::$3 ] ) always clobbers reg byte a 
Statement [16] (byte*~) scrollup3::$4 ← (const byte*) screen#0 + (word) scrollup3::l2#4 [ scrollup3::line#10 scrollup3::c#4 scrollup3::l2#4 scrollup3::$3 scrollup3::$4 ] ( main:2::scrollup3:9 [ scrollup3::line#10 scrollup3::c#4 scrollup3::l2#4 scrollup3::$3 scrollup3::$4 ] ) always clobbers reg byte a 
Statement [17] *((byte*~) scrollup3::$4) ← *((byte*~) scrollup3::$3) [ scrollup3::line#10 scrollup3::c#4 scrollup3::l2#4 ] ( main:2::scrollup3:9 [ scrollup3::line#10 scrollup3::c#4 scrollup3::l2#4 ] ) always clobbers reg byte a reg byte y 
Statement [21] (word) scrollup3::line#1 ← (word) scrollup3::line#10 + (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::@2 [ 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::$2 ← (word) scrollup1::line#10 + (byte) scrollup1::c#4 [ scrollup1::line#10 scrollup1::c#4 scrollup1::$2 ] ( main:2::scrollup1:5 [ scrollup1::line#10 scrollup1::c#4 scrollup1::$2 ] ) always clobbers reg byte a 
Statement [39] (word~) scrollup1::$4 ← (word) scrollup1::line#10 + (byte) scrollup1::c#4 [ scrollup1::line#10 scrollup1::c#4 scrollup1::$2 scrollup1::$4 ] ( main:2::scrollup1:5 [ scrollup1::line#10 scrollup1::c#4 scrollup1::$2 scrollup1::$4 ] ) always clobbers reg byte a 
Statement [40] (byte*~) scrollup1::$5 ← (const byte*) screen#0+(byte) $28 + (word~) scrollup1::$4 [ scrollup1::line#10 scrollup1::c#4 scrollup1::$2 scrollup1::$5 ] ( main:2::scrollup1:5 [ scrollup1::line#10 scrollup1::c#4 scrollup1::$2 scrollup1::$5 ] ) always clobbers reg byte a 
Statement [41] (byte*~) scrollup1::$6 ← (const byte*) screen#0 + (word~) scrollup1::$2 [ scrollup1::line#10 scrollup1::c#4 scrollup1::$5 scrollup1::$6 ] ( main:2::scrollup1:5 [ scrollup1::line#10 scrollup1::c#4 scrollup1::$5 scrollup1::$6 ] ) always clobbers reg byte a 
Statement [42] *((byte*~) scrollup1::$6) ← *((byte*~) scrollup1::$5) [ scrollup1::line#10 scrollup1::c#4 ] ( main:2::scrollup1:5 [ scrollup1::line#10 scrollup1::c#4 ] ) always clobbers reg byte a reg byte y 
Statement [45] (word) scrollup1::line#1 ← (word) scrollup1::line#10 + (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::@2 [ scrollup1::line#1 ] ( main:2::scrollup1:5 [ scrollup1::line#1 ] ) always clobbers reg byte a 
Potential registers zp ZP_WORD:2 [ scrollup3::line#10 scrollup3::line#1 ] : zp ZP_WORD:2 , 
Potential registers zp ZP_BYTE:4 [ scrollup3::c#4 scrollup3::c#1 ] : zp ZP_BYTE:4 , reg byte x , 
Potential registers zp ZP_WORD:5 [ scrollup3::l2#4 scrollup3::l2#1 scrollup3::l2#7 ] : zp ZP_WORD:5 , 
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#10 scrollup1::line#1 ] : zp ZP_WORD:13 , 
Potential registers zp ZP_BYTE:15 [ scrollup1::c#4 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::$2 ] : zp ZP_WORD:20 , 
Potential registers zp ZP_WORD:22 [ scrollup1::$4 ] : 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#4 scrollup1::c#1 ] 202: zp ZP_WORD:22 [ scrollup1::$4 ] 202: zp ZP_WORD:26 [ scrollup1::$6 ] 101: zp ZP_WORD:24 [ scrollup1::$5 ] 67.33: zp ZP_WORD:20 [ scrollup1::$2 ] 41.39: zp ZP_WORD:13 [ scrollup1::line#10 scrollup1::line#1 ] 
Uplift Scope [scrollup3] 202: zp ZP_WORD:18 [ scrollup3::$4 ] 193.08: zp ZP_WORD:5 [ scrollup3::l2#4 scrollup3::l2#1 scrollup3::l2#7 ] 191.9: zp ZP_BYTE:4 [ scrollup3::c#4 scrollup3::c#1 ] 101: zp ZP_WORD:16 [ scrollup3::$3 ] 20.17: zp ZP_WORD:2 [ scrollup3::line#10 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 28668 combination reg byte x [ scrollup1::c#4 scrollup1::c#1 ] zp ZP_WORD:22 [ scrollup1::$4 ] zp ZP_WORD:26 [ scrollup1::$6 ] zp ZP_WORD:24 [ scrollup1::$5 ] zp ZP_WORD:20 [ scrollup1::$2 ] zp ZP_WORD:13 [ scrollup1::line#10 scrollup1::line#1 ] 
Uplifting [scrollup3] best 27768 combination zp ZP_WORD:18 [ scrollup3::$4 ] zp ZP_WORD:5 [ scrollup3::l2#4 scrollup3::l2#1 scrollup3::l2#7 ] reg byte x [ scrollup3::c#4 scrollup3::c#1 ] zp ZP_WORD:16 [ scrollup3::$3 ] zp ZP_WORD:2 [ scrollup3::line#10 scrollup3::line#1 ] 
Uplifting [scrollup2] best 26868 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 26868 combination 
Uplifting [] best 26868 combination 
Attempting to uplift remaining variables inzp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ]
Uplifting [scrollup2] best 26868 combination zp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ] 
Coalescing zero page register [ zp ZP_WORD:20 [ scrollup1::$2 ] ] with [ zp ZP_WORD:26 [ scrollup1::$6 ] ] - score: 1
Coalescing zero page register [ zp ZP_WORD:22 [ scrollup1::$4 ] ] with [ zp ZP_WORD:24 [ scrollup1::$5 ] ] - score: 1
Coalescing zero page register [ zp ZP_WORD:8 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ] ] with [ zp ZP_WORD:2 [ scrollup3::line#10 scrollup3::line#1 ] ]
Coalescing zero page register [ zp ZP_WORD:10 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ] ] with [ zp ZP_WORD:5 [ scrollup3::l2#4 scrollup3::l2#1 scrollup3::l2#7 ] ]
Coalescing zero page register [ zp ZP_WORD:16 [ scrollup3::$3 ] ] with [ zp ZP_WORD:13 [ scrollup1::line#10 scrollup1::line#1 ] ]
Coalescing zero page register [ zp ZP_WORD:20 [ scrollup1::$2 scrollup1::$6 ] ] with [ zp ZP_WORD:18 [ scrollup3::$4 ] ]
Coalescing zero page register [ zp ZP_WORD:22 [ scrollup1::$4 scrollup1::$5 ] ] with [ zp ZP_WORD:8 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 scrollup3::line#10 scrollup3::line#1 ] ]
Allocated (was zp ZP_BYTE:7) zp ZP_BYTE:2 [ scrollup2::l#4 scrollup2::l#1 ]
Allocated (was zp ZP_WORD:10) zp ZP_WORD:3 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 scrollup3::l2#4 scrollup3::l2#1 scrollup3::l2#7 ]
Allocated (was zp ZP_WORD:16) zp ZP_WORD:5 [ scrollup3::$3 scrollup1::line#10 scrollup1::line#1 ]
Allocated (was zp ZP_WORD:20) zp ZP_WORD:7 [ scrollup1::$2 scrollup1::$6 scrollup3::$4 ]
Allocated (was zp ZP_WORD:22) zp ZP_WORD:9 [ scrollup1::$4 scrollup1::$5 scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 scrollup3::line#10 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::@2 [phi:scrollup3->scrollup3::@2]
  b2_from_scrollup3:
    // [12] phi (word) scrollup3::line#10 = (byte) 0 [phi:scrollup3->scrollup3::@2#0] -- vwuz1=vbuc1 
    lda #<0
    sta.z line
    lda #>0
    sta.z line+1
    jmp b2
    // [12] phi from scrollup3::@1 to scrollup3::@2 [phi:scrollup3::@1->scrollup3::@2]
  b2_from_b1:
    // [12] phi (word) scrollup3::line#10 = (word) scrollup3::line#1 [phi:scrollup3::@1->scrollup3::@2#0] -- register_copy 
    jmp b2
    // scrollup3::@2
  b2:
    jmp b4_1
    // scrollup3::@4_1
  b4_1:
    // [13] (word~) scrollup3::l2#7 ← (word) scrollup3::line#10 -- vwuz1=vwuz2 
    lda.z line
    sta.z l2
    lda.z line+1
    sta.z l2+1
    // [14] phi from scrollup3::@4_1 to scrollup3::@4 [phi:scrollup3::@4_1->scrollup3::@4]
  b4_from_b4_1:
    // [14] phi (word) scrollup3::l2#4 = (word~) scrollup3::l2#7 [phi:scrollup3::@4_1->scrollup3::@4#0] -- register_copy 
    // [14] phi (byte) scrollup3::c#4 = (byte) 0 [phi:scrollup3::@4_1->scrollup3::@4#1] -- vbuxx=vbuc1 
    ldx #0
    jmp b4
    // [14] phi from scrollup3::@3 to scrollup3::@4 [phi:scrollup3::@3->scrollup3::@4]
  b4_from_b3:
    // [14] phi (word) scrollup3::l2#4 = (word) scrollup3::l2#1 [phi:scrollup3::@3->scrollup3::@4#0] -- register_copy 
    // [14] phi (byte) scrollup3::c#4 = (byte) scrollup3::c#1 [phi:scrollup3::@3->scrollup3::@4#1] -- register_copy 
    jmp b4
    // scrollup3::@4
  b4:
    // [15] (byte*~) scrollup3::$3 ← (const byte*) screen#0+(byte) $28 + (word) scrollup3::l2#4 -- 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
    // [16] (byte*~) scrollup3::$4 ← (const byte*) screen#0 + (word) scrollup3::l2#4 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z l2
    clc
    adc #<screen
    sta.z _4
    lda.z l2+1
    adc #>screen
    sta.z _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#4 -- vwuz1=_inc_vwuz1 
    inc.z l2
    bne !+
    inc.z l2+1
  !:
    // [19] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#4 -- vbuxx=_inc_vbuxx 
    inx
    jmp b3
    // scrollup3::@3
  b3:
    // [20] if((byte) scrollup3::c#1<(byte) $28) goto scrollup3::@4 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$28
    bcc b4_from_b3
    jmp b5
    // scrollup3::@5
  b5:
    // [21] (word) scrollup3::line#1 ← (word) scrollup3::line#10 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z line
    sta.z line
    bcc !+
    inc.z line+1
  !:
    jmp b1
    // scrollup3::@1
  b1:
    // [22] if((word) scrollup3::line#1<(word)(number) $28*(number) $18) goto scrollup3::@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
    // scrollup3::@return
  breturn:
    // [23] return 
    rts
}
  // 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#0 [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#0+(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::@2 [phi:scrollup1->scrollup1::@2]
  b2_from_scrollup1:
    // [36] phi (word) scrollup1::line#10 = (byte) 0 [phi:scrollup1->scrollup1::@2#0] -- vwuz1=vbuc1 
    lda #<0
    sta.z line
    lda #>0
    sta.z line+1
    jmp b2
    // [36] phi from scrollup1::@1 to scrollup1::@2 [phi:scrollup1::@1->scrollup1::@2]
  b2_from_b1:
    // [36] phi (word) scrollup1::line#10 = (word) scrollup1::line#1 [phi:scrollup1::@1->scrollup1::@2#0] -- register_copy 
    jmp b2
    // scrollup1::@2
  b2:
    // [37] phi from scrollup1::@2 to scrollup1::@4 [phi:scrollup1::@2->scrollup1::@4]
  b4_from_b2:
    // [37] phi (byte) scrollup1::c#4 = (byte) 0 [phi:scrollup1::@2->scrollup1::@4#0] -- vbuxx=vbuc1 
    ldx #0
    jmp b4
    // [37] phi from scrollup1::@3 to scrollup1::@4 [phi:scrollup1::@3->scrollup1::@4]
  b4_from_b3:
    // [37] phi (byte) scrollup1::c#4 = (byte) scrollup1::c#1 [phi:scrollup1::@3->scrollup1::@4#0] -- register_copy 
    jmp b4
    // scrollup1::@4
  b4:
    // [38] (word~) scrollup1::$2 ← (word) scrollup1::line#10 + (byte) scrollup1::c#4 -- vwuz1=vwuz2_plus_vbuxx 
    txa
    clc
    adc.z line
    sta.z _2
    lda #0
    adc.z line+1
    sta.z _2+1
    // [39] (word~) scrollup1::$4 ← (word) scrollup1::line#10 + (byte) scrollup1::c#4 -- vwuz1=vwuz2_plus_vbuxx 
    txa
    clc
    adc.z line
    sta.z _4
    lda #0
    adc.z line+1
    sta.z _4+1
    // [40] (byte*~) scrollup1::$5 ← (const byte*) screen#0+(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
    // [41] (byte*~) scrollup1::$6 ← (const byte*) screen#0 + (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
    // [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#4 -- vbuxx=_inc_vbuxx 
    inx
    jmp b3
    // scrollup1::@3
  b3:
    // [44] if((byte) scrollup1::c#1<(byte) $28) goto scrollup1::@4 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$28
    bcc b4_from_b3
    jmp b5
    // scrollup1::@5
  b5:
    // [45] (word) scrollup1::line#1 ← (word) scrollup1::line#10 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z line
    sta.z line
    bcc !+
    inc.z line+1
  !:
    jmp b1
    // scrollup1::@1
  b1:
    // [46] if((word) scrollup1::line#1<(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:
    // [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 b2
Removing instruction jmp b4_1
Removing instruction jmp b4
Removing instruction jmp b3
Removing instruction jmp b5
Removing instruction jmp b1
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp breturn
Removing instruction jmp b2
Removing instruction jmp b4
Removing instruction jmp b3
Removing instruction jmp b5
Removing instruction jmp b1
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 b4_from_b3 with b4
Replacing label b2_from_b1 with b2
Replacing label b2_from_b1 with b2
Replacing label b2_from_b2 with b2
Replacing label b1_from_b3 with b1
Replacing label b4_from_b3 with b4
Replacing label b2_from_b1 with b2
Replacing label b2_from_b1 with b2
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 b2_from_b1:
Removing instruction b4_1:
Removing instruction b4_from_b3:
Removing instruction b1_from_b3:
Removing instruction b2_from_b1:
Removing instruction b2_from_b2:
Removing instruction b2_from_b1:
Removing instruction b4_from_b2:
Removing instruction b4_from_b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction scrollup1_from_main:
Removing instruction b1:
Removing instruction b2:
Removing instruction breturn:
Removing instruction b2_from_scrollup3:
Removing instruction b4_from_b4_1:
Removing instruction b3:
Removing instruction b5:
Removing instruction b1:
Removing instruction breturn:
Removing instruction b1_from_scrollup2:
Removing instruction b3:
Removing instruction breturn:
Removing instruction b2_from_scrollup1:
Removing instruction b3:
Removing instruction b5:
Removing instruction b1:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp b2
Removing instruction jmp b4
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b2
Removing instruction jmp b4
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::$2 $2 zp ZP_WORD:7 67.33333333333333
(word~) scrollup1::$4 $4 zp ZP_WORD:9 202.0
(byte*~) scrollup1::$5 $5 zp ZP_WORD:9 101.0
(byte*~) scrollup1::$6 $6 zp ZP_WORD:7 202.0
(label) scrollup1::@1
(label) scrollup1::@2
(label) scrollup1::@3
(label) scrollup1::@4
(label) scrollup1::@5
(label) scrollup1::@return
(byte) scrollup1::c
(byte) scrollup1::c#1 reg byte x 151.5
(byte) scrollup1::c#4 reg byte x 67.33333333333333
(word) scrollup1::line
(word) scrollup1::line#1 line zp ZP_WORD:5 16.5
(word) scrollup1::line#10 line zp ZP_WORD:5 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:2 16.5
(byte) scrollup2::l#4 l zp ZP_BYTE:2 3.142857142857143
(byte*) scrollup2::line1
(byte*) scrollup2::line1#1 line1 zp ZP_WORD:3 35.5
(byte*) scrollup2::line1#2 line1 zp ZP_WORD:3 157.0
(byte*) scrollup2::line1#3 line1 zp ZP_WORD:3 22.0
(byte*) scrollup2::line2
(byte*) scrollup2::line2#1 line2 zp ZP_WORD:9 42.599999999999994
(byte*) scrollup2::line2#2 line2 zp ZP_WORD:9 104.66666666666666
(byte*) scrollup2::line2#3 line2 zp ZP_WORD:9 22.0
(void()) scrollup3()
(byte*~) scrollup3::$3 $3 zp ZP_WORD:5 101.0
(byte*~) scrollup3::$4 $4 zp ZP_WORD:7 202.0
(label) scrollup3::@1
(label) scrollup3::@2
(label) scrollup3::@3
(label) scrollup3::@4
(label) scrollup3::@4_1
(label) scrollup3::@5
(label) scrollup3::@return
(byte) scrollup3::c
(byte) scrollup3::c#1 reg byte x 151.5
(byte) scrollup3::c#4 reg byte x 40.4
(word) scrollup3::l2
(word) scrollup3::l2#1 l2 zp ZP_WORD:3 67.33333333333333
(word) scrollup3::l2#4 l2 zp ZP_WORD:3 103.75
(word~) scrollup3::l2#7 l2 zp ZP_WORD:3 22.0
(word) scrollup3::line
(word) scrollup3::line#1 line zp ZP_WORD:9 16.5
(word) scrollup3::line#10 line zp ZP_WORD:9 3.666666666666667

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


FINAL ASSEMBLER
Score: 22547

  // 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::@2 [phi:scrollup3->scrollup3::@2]
    // [12] phi (word) scrollup3::line#10 = (byte) 0 [phi:scrollup3->scrollup3::@2#0] -- vwuz1=vbuc1 
    lda #<0
    sta.z line
    sta.z line+1
    // [12] phi from scrollup3::@1 to scrollup3::@2 [phi:scrollup3::@1->scrollup3::@2]
    // [12] phi (word) scrollup3::line#10 = (word) scrollup3::line#1 [phi:scrollup3::@1->scrollup3::@2#0] -- register_copy 
    // scrollup3::@2
  b2:
    // scrollup3::@4_1
    // [13] (word~) scrollup3::l2#7 ← (word) scrollup3::line#10 -- vwuz1=vwuz2 
    lda.z line
    sta.z l2
    lda.z line+1
    sta.z l2+1
    // [14] phi from scrollup3::@4_1 to scrollup3::@4 [phi:scrollup3::@4_1->scrollup3::@4]
    // [14] phi (word) scrollup3::l2#4 = (word~) scrollup3::l2#7 [phi:scrollup3::@4_1->scrollup3::@4#0] -- register_copy 
    // [14] phi (byte) scrollup3::c#4 = (byte) 0 [phi:scrollup3::@4_1->scrollup3::@4#1] -- vbuxx=vbuc1 
    ldx #0
    // [14] phi from scrollup3::@3 to scrollup3::@4 [phi:scrollup3::@3->scrollup3::@4]
    // [14] phi (word) scrollup3::l2#4 = (word) scrollup3::l2#1 [phi:scrollup3::@3->scrollup3::@4#0] -- register_copy 
    // [14] phi (byte) scrollup3::c#4 = (byte) scrollup3::c#1 [phi:scrollup3::@3->scrollup3::@4#1] -- register_copy 
    // scrollup3::@4
  b4:
    // screen[l2++] = screen[l2+40]
    // [15] (byte*~) scrollup3::$3 ← (const byte*) screen#0+(byte) $28 + (word) scrollup3::l2#4 -- 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
    // [16] (byte*~) scrollup3::$4 ← (const byte*) screen#0 + (word) scrollup3::l2#4 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z l2
    clc
    adc #<screen
    sta.z _4
    lda.z l2+1
    adc #>screen
    sta.z _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#4 -- vwuz1=_inc_vwuz1 
    inc.z l2
    bne !+
    inc.z l2+1
  !:
    // for (byte c=0; c<40; ++c)
    // [19] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#4 -- vbuxx=_inc_vbuxx 
    inx
    // scrollup3::@3
    // [20] if((byte) scrollup3::c#1<(byte) $28) goto scrollup3::@4 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$28
    bcc b4
    // scrollup3::@5
    // line += 40
    // [21] (word) scrollup3::line#1 ← (word) scrollup3::line#10 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z line
    sta.z line
    bcc !+
    inc.z line+1
  !:
    // scrollup3::@1
    // for (word line = 0; line < 40*24; line += 40)
    // [22] if((word) scrollup3::line#1<(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
    // }
    // [23] return 
    rts
}
  // 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#0 [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#0+(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::@2 [phi:scrollup1->scrollup1::@2]
    // [36] phi (word) scrollup1::line#10 = (byte) 0 [phi:scrollup1->scrollup1::@2#0] -- vwuz1=vbuc1 
    lda #<0
    sta.z line
    sta.z line+1
    // [36] phi from scrollup1::@1 to scrollup1::@2 [phi:scrollup1::@1->scrollup1::@2]
    // [36] phi (word) scrollup1::line#10 = (word) scrollup1::line#1 [phi:scrollup1::@1->scrollup1::@2#0] -- register_copy 
    // scrollup1::@2
  b2:
    // [37] phi from scrollup1::@2 to scrollup1::@4 [phi:scrollup1::@2->scrollup1::@4]
    // [37] phi (byte) scrollup1::c#4 = (byte) 0 [phi:scrollup1::@2->scrollup1::@4#0] -- vbuxx=vbuc1 
    ldx #0
    // [37] phi from scrollup1::@3 to scrollup1::@4 [phi:scrollup1::@3->scrollup1::@4]
    // [37] phi (byte) scrollup1::c#4 = (byte) scrollup1::c#1 [phi:scrollup1::@3->scrollup1::@4#0] -- register_copy 
    // scrollup1::@4
  b4:
    // line+c
    // [38] (word~) scrollup1::$2 ← (word) scrollup1::line#10 + (byte) scrollup1::c#4 -- 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
    // [39] (word~) scrollup1::$4 ← (word) scrollup1::line#10 + (byte) scrollup1::c#4 -- 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]
    // [40] (byte*~) scrollup1::$5 ← (const byte*) screen#0+(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
    // [41] (byte*~) scrollup1::$6 ← (const byte*) screen#0 + (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
    // [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#4 -- vbuxx=_inc_vbuxx 
    inx
    // scrollup1::@3
    // [44] if((byte) scrollup1::c#1<(byte) $28) goto scrollup1::@4 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$28
    bcc b4
    // scrollup1::@5
    // line += 40
    // [45] (word) scrollup1::line#1 ← (word) scrollup1::line#10 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z line
    sta.z line
    bcc !+
    inc.z line+1
  !:
    // scrollup1::@1
    // for (word line = 0; line < 40*24; line += 40)
    // [46] if((word) scrollup1::line#1<(word)(number) $28*(number) $18) goto scrollup1::@2 -- vwuz1_lt_vwuc1_then_la1 
    lda.z line+1
    cmp #>$28*$18
    bcc b2
    bne !+
    lda.z line
    cmp #<$28*$18
    bcc b2
  !:
    // scrollup1::@return
    // }
    // [47] return 
    rts
}
  // File Data

