1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-08-07 06:30:04 +00:00
Files
kickc/src/test/ref/test-scroll-up.log
2019-04-21 01:22:14 +02:00

1701 lines
77 KiB
Plaintext

CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*) screen#0 ← ((byte*)) (word/signed word/dword/signed dword) $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 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:scrollup1::@1
scrollup1::@1: scope:[scrollup1] from scrollup1 scrollup1::@3
(word) scrollup1::line#4 ← phi( scrollup1/(word) scrollup1::line#0 scrollup1::@3/(word) scrollup1::line#1 )
(byte) scrollup1::c#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:scrollup1::@2
scrollup1::@2: scope:[scrollup1] from scrollup1::@1 scrollup1::@2
(byte) scrollup1::c#2 ← phi( scrollup1::@1/(byte) scrollup1::c#0 scrollup1::@2/(byte) scrollup1::c#1 )
(word) scrollup1::line#2 ← phi( scrollup1::@1/(word) scrollup1::line#4 scrollup1::@2/(word) scrollup1::line#2 )
(word~) scrollup1::$0 ← (word) scrollup1::line#2 + (byte) scrollup1::c#2
(word~) scrollup1::$1 ← (word) scrollup1::line#2 + (byte) scrollup1::c#2
(word/signed dword/dword~) scrollup1::$2 ← (word~) scrollup1::$1 + (byte/signed byte/word/signed word/dword/signed dword) $28
*((byte*) screen#0 + (word~) scrollup1::$0) ← *((byte*) screen#0 + (word/signed dword/dword~) scrollup1::$2)
(byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#2
(bool~) scrollup1::$3 ← (byte) scrollup1::c#1 < (byte/signed byte/word/signed word/dword/signed dword) $28
if((bool~) scrollup1::$3) goto scrollup1::@2
to:scrollup1::@3
scrollup1::@3: scope:[scrollup1] from scrollup1::@2
(word) scrollup1::line#3 ← phi( scrollup1::@2/(word) scrollup1::line#2 )
(word) scrollup1::line#1 ← (word) scrollup1::line#3 + (byte/signed byte/word/signed word/dword/signed dword) $28
(word/signed word/dword/signed dword~) scrollup1::$4 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) $18
(bool~) scrollup1::$5 ← (word) scrollup1::line#1 < (word/signed word/dword/signed dword~) scrollup1::$4
if((bool~) scrollup1::$5) goto scrollup1::@1
to:scrollup1::@return
scrollup1::@return: scope:[scrollup1] from scrollup1::@3
return
to:@return
scrollup2: scope:[scrollup2] from main::@1
(byte*) scrollup2::line1#0 ← (byte*) screen#0
(byte*~) scrollup2::$0 ← (byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword) $28
(byte*) scrollup2::line2#0 ← (byte*~) scrollup2::$0
(byte) scrollup2::l#0 ← (byte/signed byte/word/signed word/dword/signed dword) 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/signed byte/word/signed word/dword/signed dword) 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 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:scrollup3::@1
scrollup3::@1: scope:[scrollup3] from scrollup3 scrollup3::@3
(word) scrollup3::line#2 ← phi( scrollup3/(word) scrollup3::line#0 scrollup3::@3/(word) scrollup3::line#1 )
(word) scrollup3::l2#0 ← (word) scrollup3::line#2
(byte) scrollup3::c#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:scrollup3::@2
scrollup3::@2: scope:[scrollup3] from scrollup3::@1 scrollup3::@2
(word) scrollup3::line#4 ← phi( scrollup3::@1/(word) scrollup3::line#2 scrollup3::@2/(word) scrollup3::line#4 )
(byte) scrollup3::c#2 ← phi( scrollup3::@1/(byte) scrollup3::c#0 scrollup3::@2/(byte) scrollup3::c#1 )
(word) scrollup3::l2#2 ← phi( scrollup3::@1/(word) scrollup3::l2#0 scrollup3::@2/(word) scrollup3::l2#1 )
(word/signed dword/dword~) scrollup3::$0 ← (word) scrollup3::l2#2 + (byte/signed byte/word/signed word/dword/signed dword) $28
*((byte*) screen#0 + (word) scrollup3::l2#2) ← *((byte*) screen#0 + (word/signed dword/dword~) scrollup3::$0)
(word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2
(byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#2
(bool~) scrollup3::$1 ← (byte) scrollup3::c#1 < (byte/signed byte/word/signed word/dword/signed dword) $28
if((bool~) scrollup3::$1) goto scrollup3::@2
to:scrollup3::@3
scrollup3::@3: scope:[scrollup3] from scrollup3::@2
(word) scrollup3::line#3 ← phi( scrollup3::@2/(word) scrollup3::line#4 )
(word) scrollup3::line#1 ← (word) scrollup3::line#3 + (byte/signed byte/word/signed word/dword/signed dword) $28
(word/signed word/dword/signed dword~) scrollup3::$2 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) $18
(bool~) scrollup3::$3 ← (word) scrollup3::line#1 < (word/signed word/dword/signed dword~) scrollup3::$2
if((bool~) scrollup3::$3) goto scrollup3::@1
to:scrollup3::@return
scrollup3::@return: scope:[scrollup3] from scrollup3::@3
return
to:@return
@4: scope:[] from @begin
call main
to:@5
@5: scope:[] from @4
to:@end
@end: scope:[] from @5
SYMBOL TABLE SSA
(label) @4
(label) @5
(label) @begin
(label) @end
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
(byte*) screen
(byte*) screen#0
(void()) scrollup1()
(word~) scrollup1::$0
(word~) scrollup1::$1
(word/signed dword/dword~) scrollup1::$2
(bool~) scrollup1::$3
(word/signed word/dword/signed dword~) scrollup1::$4
(bool~) scrollup1::$5
(label) scrollup1::@1
(label) scrollup1::@2
(label) scrollup1::@3
(label) scrollup1::@return
(byte) scrollup1::c
(byte) scrollup1::c#0
(byte) scrollup1::c#1
(byte) scrollup1::c#2
(word) scrollup1::line
(word) scrollup1::line#0
(word) scrollup1::line#1
(word) scrollup1::line#2
(word) scrollup1::line#3
(word) scrollup1::line#4
(void()) scrollup2()
(byte*~) scrollup2::$0
(bool~) scrollup2::$1
(bool~) scrollup2::$2
(label) scrollup2::@1
(label) scrollup2::@2
(label) scrollup2::@3
(label) scrollup2::@return
(byte) scrollup2::c
(byte) scrollup2::c#0
(byte) scrollup2::c#1
(byte) scrollup2::c#2
(byte) scrollup2::l
(byte) scrollup2::l#0
(byte) scrollup2::l#1
(byte) scrollup2::l#2
(byte) scrollup2::l#3
(byte) scrollup2::l#4
(byte*) scrollup2::line1
(byte*) scrollup2::line1#0
(byte*) scrollup2::line1#1
(byte*) scrollup2::line1#2
(byte*) scrollup2::line1#3
(byte*) scrollup2::line1#4
(byte*) scrollup2::line2
(byte*) scrollup2::line2#0
(byte*) scrollup2::line2#1
(byte*) scrollup2::line2#2
(byte*) scrollup2::line2#3
(byte*) scrollup2::line2#4
(void()) scrollup3()
(word/signed dword/dword~) scrollup3::$0
(bool~) scrollup3::$1
(word/signed word/dword/signed dword~) scrollup3::$2
(bool~) scrollup3::$3
(label) scrollup3::@1
(label) scrollup3::@2
(label) scrollup3::@3
(label) scrollup3::@return
(byte) scrollup3::c
(byte) scrollup3::c#0
(byte) scrollup3::c#1
(byte) scrollup3::c#2
(word) scrollup3::l2
(word) scrollup3::l2#0
(word) scrollup3::l2#1
(word) scrollup3::l2#2
(word) scrollup3::line
(word) scrollup3::line#0
(word) scrollup3::line#1
(word) scrollup3::line#2
(word) scrollup3::line#3
(word) scrollup3::line#4
Culled Empty Block (label) main::@3
Culled Empty Block (label) @5
Successful SSA optimization Pass2CullEmptyBlocks
Alias (word) scrollup1::line#2 = (word) scrollup1::line#3
Alias (byte*) scrollup2::line2#0 = (byte*~) scrollup2::$0
Alias (byte) scrollup2::l#2 = (byte) scrollup2::l#3
Alias (byte*) scrollup2::line2#1 = (byte*) scrollup2::line2#4
Alias (byte*) scrollup2::line1#1 = (byte*) scrollup2::line1#4
Alias (word) scrollup3::l2#0 = (word) scrollup3::line#2
Alias (word) scrollup3::line#3 = (word) scrollup3::line#4
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (word) scrollup1::line#2
Self Phi Eliminated (byte) scrollup2::l#2
Self Phi Eliminated (word) scrollup3::line#3
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (word) scrollup1::line#2 (word) scrollup1::line#4
Redundant Phi (byte) scrollup2::l#2 (byte) scrollup2::l#4
Redundant Phi (word) scrollup3::line#3 (word) scrollup3::l2#0
Successful SSA optimization Pass2RedundantPhiElimination
Simple Condition (bool~) scrollup1::$3 [15] if((byte) scrollup1::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup1::@2
Simple Condition (bool~) scrollup1::$5 [20] if((word) scrollup1::line#1<(word/signed word/dword/signed dword~) scrollup1::$4) goto scrollup1::@1
Simple Condition (bool~) scrollup2::$1 [34] if((byte) scrollup2::c#1!=rangelast(0,$27)) goto scrollup2::@2
Simple Condition (bool~) scrollup2::$2 [38] if((byte) scrollup2::l#1!=rangelast(0,$17)) goto scrollup2::@1
Simple Condition (bool~) scrollup3::$1 [50] if((byte) scrollup3::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup3::@2
Simple Condition (bool~) scrollup3::$3 [55] if((word) scrollup3::line#1<(word/signed word/dword/signed dword~) scrollup3::$2) goto scrollup3::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) screen#0 = ((byte*))$400
Constant (const word) scrollup1::line#0 = 0
Constant (const byte) scrollup1::c#0 = 0
Constant (const word/signed word/dword/signed dword) scrollup1::$4 = $28*$18
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
Constant (const word/signed word/dword/signed dword) scrollup3::$2 = $28*$18
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) scrollup2::line1#0 = screen#0
Constant (const byte*) scrollup2::line2#0 = screen#0+$28
Successful SSA optimization Pass2ConstantIdentification
Consolidated array index constant in assignment *(screen#0+$28 + scrollup1::$2)
Consolidated array index constant in assignment *(screen#0+$28 + scrollup3::$0)
Successful SSA optimization Pass2ConstantAdditionElimination
Inferred type updated to word in [8] (word/signed dword/dword~) scrollup1::$2 ← (word~) scrollup1::$1
Inferred type updated to word in [27] (word/signed dword/dword~) scrollup3::$0 ← (word) scrollup3::l2#2
Resolved ranged next value scrollup2::c#1 ← ++ scrollup2::c#2 to ++
Resolved ranged comparison value if(scrollup2::c#1!=rangelast(0,$27)) goto scrollup2::@2 to (byte/signed byte/word/signed word/dword/signed dword) $28
Resolved ranged next value scrollup2::l#1 ← ++ scrollup2::l#4 to ++
Resolved ranged comparison value if(scrollup2::l#1!=rangelast(0,$17)) goto scrollup2::@1 to (byte/signed byte/word/signed word/dword/signed dword) $18
De-inlining pointer[w] to *(pointer+w) *((const byte*) screen#0 + (word~) scrollup1::$0) ← *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) scrollup1::$2)
De-inlining pointer[w] to *(pointer+w) *((const byte*) screen#0 + (word~) scrollup1::$0) ← *((byte*) scrollup1::$6)
De-inlining pointer[w] to *(pointer+w) *((const byte*) screen#0 + (word) scrollup3::l2#2) ← *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) scrollup3::$0)
De-inlining pointer[w] to *(pointer+w) *((const byte*) screen#0 + (word) scrollup3::l2#2) ← *((byte*) scrollup3::$4)
Successful SSA optimization Pass2DeInlineWordDerefIdx
Alias (word~) scrollup1::$2 = (word~) scrollup1::$1
Alias (word) scrollup3::l2#2 = (word~) scrollup3::$0
Successful SSA optimization Pass2AliasElimination
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/signed byte/word/signed word/dword/signed dword) 0
Constant inlined scrollup3::line#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined scrollup3::c#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined scrollup3::$2 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18
Constant inlined scrollup1::$4 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18
Constant inlined scrollup2::c#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined scrollup1::c#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined scrollup1::line#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined scrollup2::line2#0 = (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28
Constant inlined scrollup2::line1#0 = (const byte*) screen#0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting scrollup3::@5(between scrollup3::@3 and scrollup3::@1)
Added new block during phi lifting scrollup3::@6(between scrollup3::@2 and scrollup3::@2)
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 scrollup1::@5(between scrollup1::@3 and scrollup1::@1)
Added new block during phi lifting scrollup1::@6(between scrollup1::@2 and scrollup1::@2)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @4
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
CALL GRAPH
Calls in [] to main:2
Calls in [main] to scrollup1:5 scrollup2:7 scrollup3:9
Created 11 initial phi equivalence classes
Not coalescing [13] scrollup3::l2#4 ← scrollup3::l2#0
Coalesced [24] scrollup3::l2#3 ← scrollup3::line#1
Coalesced [25] scrollup3::l2#5 ← scrollup3::l2#1
Coalesced [26] scrollup3::c#3 ← scrollup3::c#1
Coalesced [29] scrollup2::line2#6 ← scrollup2::line2#3
Coalesced [30] scrollup2::line1#6 ← scrollup2::line1#3
Coalesced [40] scrollup2::line2#5 ← scrollup2::line2#1
Coalesced [41] scrollup2::line1#5 ← scrollup2::line1#1
Coalesced [42] scrollup2::l#5 ← scrollup2::l#1
Coalesced (already) [43] scrollup2::line2#7 ← scrollup2::line2#1
Coalesced (already) [44] scrollup2::line1#7 ← scrollup2::line1#1
Coalesced [45] scrollup2::c#3 ← scrollup2::c#1
Coalesced [59] scrollup1::line#5 ← scrollup1::line#1
Coalesced [60] scrollup1::c#3 ← scrollup1::c#1
Coalesced down to 9 phi equivalence classes
Culled Empty Block (label) scrollup3::@5
Culled Empty Block (label) scrollup3::@6
Culled Empty Block (label) scrollup2::@5
Culled Empty Block (label) scrollup2::@6
Culled Empty Block (label) scrollup1::@5
Culled Empty Block (label) scrollup1::@6
Renumbering block @4 to @1
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of scrollup3
Adding NOP phi() at start of scrollup2
Adding NOP phi() at start of scrollup1
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi()
to:@1
@1: scope:[] from @begin
[1] phi()
[2] call main
to:@end
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] phi()
[5] call scrollup1
to:main::@1
main::@1: scope:[main] from main
[6] phi()
[7] call scrollup2
to:main::@2
main::@2: scope:[main] from main::@1
[8] phi()
[9] call scrollup3
to:main::@return
main::@return: scope:[main] from main::@2
[10] return
to:@return
scrollup3: scope:[scrollup3] from main::@2
[11] phi()
to:scrollup3::@1
scrollup3::@1: scope:[scrollup3] from scrollup3 scrollup3::@3
[12] (word) scrollup3::l2#0 ← phi( scrollup3/(byte/signed byte/word/signed word/dword/signed dword) 0 scrollup3::@3/(word) scrollup3::line#1 )
[13] (word~) scrollup3::l2#4 ← (word) scrollup3::l2#0
to:scrollup3::@2
scrollup3::@2: scope:[scrollup3] from scrollup3::@1 scrollup3::@2
[14] (byte) scrollup3::c#2 ← phi( scrollup3::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 scrollup3::@2/(byte) scrollup3::c#1 )
[14] (word) scrollup3::l2#2 ← phi( scrollup3::@1/(word~) scrollup3::l2#4 scrollup3::@2/(word) scrollup3::l2#1 )
[15] (byte*) scrollup3::$4 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word) scrollup3::l2#2
[16] (byte*) scrollup3::$5 ← (const byte*) screen#0 + (word) scrollup3::l2#2
[17] *((byte*) scrollup3::$5) ← *((byte*) scrollup3::$4)
[18] (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2
[19] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#2
[20] if((byte) scrollup3::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup3::@2
to:scrollup3::@3
scrollup3::@3: scope:[scrollup3] from scrollup3::@2
[21] (word) scrollup3::line#1 ← (word) scrollup3::l2#0 + (byte/signed byte/word/signed word/dword/signed dword) $28
[22] if((word) scrollup3::line#1<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup3::@1
to:scrollup3::@return
scrollup3::@return: scope:[scrollup3] from scrollup3::@3
[23] return
to:@return
scrollup2: scope:[scrollup2] from main::@1
[24] phi()
to:scrollup2::@1
scrollup2::@1: scope:[scrollup2] from scrollup2 scrollup2::@3
[25] (byte) scrollup2::l#4 ← phi( scrollup2/(byte/signed byte/word/signed word/dword/signed dword) 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/signed byte/word/signed word/dword/signed dword) $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/signed byte/word/signed word/dword/signed dword) 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/signed byte/word/signed word/dword/signed dword) $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/signed byte/word/signed word/dword/signed dword) $18) goto scrollup2::@1
to:scrollup2::@return
scrollup2::@return: scope:[scrollup2] from scrollup2::@3
[34] return
to:@return
scrollup1: scope:[scrollup1] from main
[35] phi()
to:scrollup1::@1
scrollup1::@1: scope:[scrollup1] from scrollup1 scrollup1::@3
[36] (word) scrollup1::line#4 ← phi( scrollup1/(byte/signed byte/word/signed word/dword/signed dword) 0 scrollup1::@3/(word) scrollup1::line#1 )
to:scrollup1::@2
scrollup1::@2: scope:[scrollup1] from scrollup1::@1 scrollup1::@2
[37] (byte) scrollup1::c#2 ← phi( scrollup1::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 scrollup1::@2/(byte) scrollup1::c#1 )
[38] (word~) scrollup1::$0 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2
[39] (word~) scrollup1::$2 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2
[40] (byte*) scrollup1::$6 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) scrollup1::$2
[41] (byte*) scrollup1::$7 ← (const byte*) screen#0 + (word~) scrollup1::$0
[42] *((byte*) scrollup1::$7) ← *((byte*) scrollup1::$6)
[43] (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#2
[44] if((byte) scrollup1::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup1::@2
to:scrollup1::@3
scrollup1::@3: scope:[scrollup1] from scrollup1::@2
[45] (word) scrollup1::line#1 ← (word) scrollup1::line#4 + (byte/signed byte/word/signed word/dword/signed dword) $28
[46] if((word) scrollup1::line#1<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup1::@1
to:scrollup1::@return
scrollup1::@return: scope:[scrollup1] from scrollup1::@3
[47] return
to:@return
VARIABLE REGISTER WEIGHTS
(void()) main()
(byte*) screen
(void()) scrollup1()
(word~) scrollup1::$0 67.33333333333333
(word~) scrollup1::$2 202.0
(byte*) scrollup1::$6 101.0
(byte*) scrollup1::$7 202.0
(byte) scrollup1::c
(byte) scrollup1::c#1 151.5
(byte) scrollup1::c#2 67.33333333333333
(word) scrollup1::line
(word) scrollup1::line#1 16.5
(word) scrollup1::line#4 24.888888888888886
(void()) scrollup2()
(byte) scrollup2::c
(byte) scrollup2::c#1 151.5
(byte) scrollup2::c#2 50.5
(byte) scrollup2::l
(byte) scrollup2::l#1 16.5
(byte) scrollup2::l#4 3.142857142857143
(byte*) scrollup2::line1
(byte*) scrollup2::line1#1 35.5
(byte*) scrollup2::line1#2 157.0
(byte*) scrollup2::line1#3 22.0
(byte*) scrollup2::line2
(byte*) scrollup2::line2#1 42.599999999999994
(byte*) scrollup2::line2#2 104.66666666666666
(byte*) scrollup2::line2#3 22.0
(void()) scrollup3()
(byte*) scrollup3::$4 101.0
(byte*) scrollup3::$5 202.0
(byte) scrollup3::c
(byte) scrollup3::c#1 151.5
(byte) scrollup3::c#2 40.4
(word) scrollup3::l2
(word) scrollup3::l2#0 3.666666666666667
(word) scrollup3::l2#1 67.33333333333333
(word) scrollup3::l2#2 103.75
(word~) scrollup3::l2#4 22.0
(word) scrollup3::line
(word) scrollup3::line#1 16.5
Initial phi equivalence classes
[ scrollup3::l2#0 scrollup3::line#1 ]
[ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ]
[ scrollup3::c#2 scrollup3::c#1 ]
[ scrollup2::l#4 scrollup2::l#1 ]
[ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ]
[ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ]
[ scrollup2::c#2 scrollup2::c#1 ]
[ scrollup1::line#4 scrollup1::line#1 ]
[ scrollup1::c#2 scrollup1::c#1 ]
Added variable scrollup3::$4 to zero page equivalence class [ scrollup3::$4 ]
Added variable scrollup3::$5 to zero page equivalence class [ scrollup3::$5 ]
Added variable scrollup1::$0 to zero page equivalence class [ scrollup1::$0 ]
Added variable scrollup1::$2 to zero page equivalence class [ scrollup1::$2 ]
Added variable scrollup1::$6 to zero page equivalence class [ scrollup1::$6 ]
Added variable scrollup1::$7 to zero page equivalence class [ scrollup1::$7 ]
Complete equivalence classes
[ scrollup3::l2#0 scrollup3::line#1 ]
[ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ]
[ scrollup3::c#2 scrollup3::c#1 ]
[ scrollup2::l#4 scrollup2::l#1 ]
[ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ]
[ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ]
[ scrollup2::c#2 scrollup2::c#1 ]
[ scrollup1::line#4 scrollup1::line#1 ]
[ scrollup1::c#2 scrollup1::c#1 ]
[ scrollup3::$4 ]
[ scrollup3::$5 ]
[ scrollup1::$0 ]
[ scrollup1::$2 ]
[ scrollup1::$6 ]
[ scrollup1::$7 ]
Allocated zp ZP_WORD:2 [ scrollup3::l2#0 scrollup3::line#1 ]
Allocated zp ZP_WORD:4 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ]
Allocated zp ZP_BYTE:6 [ scrollup3::c#2 scrollup3::c#1 ]
Allocated zp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ]
Allocated zp ZP_WORD:8 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ]
Allocated zp ZP_WORD:10 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ]
Allocated zp ZP_BYTE:12 [ scrollup2::c#2 scrollup2::c#1 ]
Allocated zp ZP_WORD:13 [ scrollup1::line#4 scrollup1::line#1 ]
Allocated zp ZP_BYTE:15 [ scrollup1::c#2 scrollup1::c#1 ]
Allocated zp ZP_WORD:16 [ scrollup3::$4 ]
Allocated zp ZP_WORD:18 [ scrollup3::$5 ]
Allocated zp ZP_WORD:20 [ scrollup1::$0 ]
Allocated zp ZP_WORD:22 [ scrollup1::$2 ]
Allocated zp ZP_WORD:24 [ scrollup1::$6 ]
Allocated zp ZP_WORD:26 [ scrollup1::$7 ]
INITIAL ASM
//SEG0 File Comments
// Tests different ways of scrolling up the screen
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.label screen = $400
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
jmp b1
//SEG5 @1
b1:
//SEG6 [2] call main
//SEG7 [4] phi from @1 to main [phi:@1->main]
main_from_b1:
jsr main
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
jmp bend
//SEG9 @end
bend:
//SEG10 main
main: {
//SEG11 [5] call scrollup1
//SEG12 [35] phi from main to scrollup1 [phi:main->scrollup1]
scrollup1_from_main:
jsr scrollup1
//SEG13 [6] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
jmp b1
//SEG14 main::@1
b1:
//SEG15 [7] call scrollup2
//SEG16 [24] phi from main::@1 to scrollup2 [phi:main::@1->scrollup2]
scrollup2_from_b1:
jsr scrollup2
//SEG17 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
b2_from_b1:
jmp b2
//SEG18 main::@2
b2:
//SEG19 [9] call scrollup3
//SEG20 [11] phi from main::@2 to scrollup3 [phi:main::@2->scrollup3]
scrollup3_from_b2:
jsr scrollup3
jmp breturn
//SEG21 main::@return
breturn:
//SEG22 [10] return
rts
}
//SEG23 scrollup3
scrollup3: {
.label l2 = 2
.label l2_1 = 4
.label c = 6
.label line = 2
.label l2_2 = 4
.label _4 = $10
.label _5 = $12
.label l2_4 = 4
//SEG24 [12] phi from scrollup3 to scrollup3::@1 [phi:scrollup3->scrollup3::@1]
b1_from_scrollup3:
//SEG25 [12] phi (word) scrollup3::l2#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup3->scrollup3::@1#0] -- vwuz1=vbuc1
lda #0
sta l2
lda #0
sta l2+1
jmp b1
//SEG26 [12] phi from scrollup3::@3 to scrollup3::@1 [phi:scrollup3::@3->scrollup3::@1]
b1_from_b3:
//SEG27 [12] phi (word) scrollup3::l2#0 = (word) scrollup3::line#1 [phi:scrollup3::@3->scrollup3::@1#0] -- register_copy
jmp b1
//SEG28 scrollup3::@1
b1:
//SEG29 [13] (word~) scrollup3::l2#4 ← (word) scrollup3::l2#0 -- vwuz1=vwuz2
lda l2
sta l2_4
lda l2+1
sta l2_4+1
//SEG30 [14] phi from scrollup3::@1 to scrollup3::@2 [phi:scrollup3::@1->scrollup3::@2]
b2_from_b1:
//SEG31 [14] phi (byte) scrollup3::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup3::@1->scrollup3::@2#0] -- vbuz1=vbuc1
lda #0
sta c
//SEG32 [14] phi (word) scrollup3::l2#2 = (word~) scrollup3::l2#4 [phi:scrollup3::@1->scrollup3::@2#1] -- register_copy
jmp b2
//SEG33 [14] phi from scrollup3::@2 to scrollup3::@2 [phi:scrollup3::@2->scrollup3::@2]
b2_from_b2:
//SEG34 [14] phi (byte) scrollup3::c#2 = (byte) scrollup3::c#1 [phi:scrollup3::@2->scrollup3::@2#0] -- register_copy
//SEG35 [14] phi (word) scrollup3::l2#2 = (word) scrollup3::l2#1 [phi:scrollup3::@2->scrollup3::@2#1] -- register_copy
jmp b2
//SEG36 scrollup3::@2
b2:
//SEG37 [15] (byte*) scrollup3::$4 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2
lda l2_2
clc
adc #<screen+$28
sta _4
lda l2_2+1
adc #>screen+$28
sta _4+1
//SEG38 [16] (byte*) scrollup3::$5 ← (const byte*) screen#0 + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2
lda l2_2
clc
adc #<screen
sta _5
lda l2_2+1
adc #>screen
sta _5+1
//SEG39 [17] *((byte*) scrollup3::$5) ← *((byte*) scrollup3::$4) -- _deref_pbuz1=_deref_pbuz2
ldy #0
lda (_4),y
ldy #0
sta (_5),y
//SEG40 [18] (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2 -- vwuz1=_inc_vwuz1
inc l2_1
bne !+
inc l2_1+1
!:
//SEG41 [19] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#2 -- vbuz1=_inc_vbuz1
inc c
//SEG42 [20] if((byte) scrollup3::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup3::@2 -- vbuz1_lt_vbuc1_then_la1
lda c
cmp #$28
bcc b2_from_b2
jmp b3
//SEG43 scrollup3::@3
b3:
//SEG44 [21] (word) scrollup3::line#1 ← (word) scrollup3::l2#0 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
lda #$28
clc
adc line
sta line
bcc !+
inc line+1
!:
//SEG45 [22] if((word) scrollup3::line#1<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup3::@1 -- vwuz1_lt_vwuc1_then_la1
lda line+1
cmp #>$28*$18
bcc b1_from_b3
bne !+
lda line
cmp #<$28*$18
bcc b1_from_b3
!:
jmp breturn
//SEG46 scrollup3::@return
breturn:
//SEG47 [23] return
rts
}
//SEG48 scrollup2
scrollup2: {
.label line1 = $a
.label line2 = 8
.label c = $c
.label l = 7
//SEG49 [25] phi from scrollup2 to scrollup2::@1 [phi:scrollup2->scrollup2::@1]
b1_from_scrollup2:
//SEG50 [25] phi (byte) scrollup2::l#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup2->scrollup2::@1#0] -- vbuz1=vbuc1
lda #0
sta l
//SEG51 [25] phi (byte*) scrollup2::line1#3 = (const byte*) screen#0 [phi:scrollup2->scrollup2::@1#1] -- pbuz1=pbuc1
lda #<screen
sta line1
lda #>screen
sta line1+1
//SEG52 [25] phi (byte*) scrollup2::line2#3 = (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 [phi:scrollup2->scrollup2::@1#2] -- pbuz1=pbuc1
lda #<screen+$28
sta line2
lda #>screen+$28
sta line2+1
jmp b1
//SEG53 [25] phi from scrollup2::@3 to scrollup2::@1 [phi:scrollup2::@3->scrollup2::@1]
b1_from_b3:
//SEG54 [25] phi (byte) scrollup2::l#4 = (byte) scrollup2::l#1 [phi:scrollup2::@3->scrollup2::@1#0] -- register_copy
//SEG55 [25] phi (byte*) scrollup2::line1#3 = (byte*) scrollup2::line1#1 [phi:scrollup2::@3->scrollup2::@1#1] -- register_copy
//SEG56 [25] phi (byte*) scrollup2::line2#3 = (byte*) scrollup2::line2#1 [phi:scrollup2::@3->scrollup2::@1#2] -- register_copy
jmp b1
//SEG57 scrollup2::@1
b1:
//SEG58 [26] phi from scrollup2::@1 to scrollup2::@2 [phi:scrollup2::@1->scrollup2::@2]
b2_from_b1:
//SEG59 [26] phi (byte) scrollup2::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup2::@1->scrollup2::@2#0] -- vbuz1=vbuc1
lda #0
sta c
//SEG60 [26] phi (byte*) scrollup2::line1#2 = (byte*) scrollup2::line1#3 [phi:scrollup2::@1->scrollup2::@2#1] -- register_copy
//SEG61 [26] phi (byte*) scrollup2::line2#2 = (byte*) scrollup2::line2#3 [phi:scrollup2::@1->scrollup2::@2#2] -- register_copy
jmp b2
//SEG62 [26] phi from scrollup2::@2 to scrollup2::@2 [phi:scrollup2::@2->scrollup2::@2]
b2_from_b2:
//SEG63 [26] phi (byte) scrollup2::c#2 = (byte) scrollup2::c#1 [phi:scrollup2::@2->scrollup2::@2#0] -- register_copy
//SEG64 [26] phi (byte*) scrollup2::line1#2 = (byte*) scrollup2::line1#1 [phi:scrollup2::@2->scrollup2::@2#1] -- register_copy
//SEG65 [26] phi (byte*) scrollup2::line2#2 = (byte*) scrollup2::line2#1 [phi:scrollup2::@2->scrollup2::@2#2] -- register_copy
jmp b2
//SEG66 scrollup2::@2
b2:
//SEG67 [27] *((byte*) scrollup2::line1#2) ← *((byte*) scrollup2::line2#2) -- _deref_pbuz1=_deref_pbuz2
ldy #0
lda (line2),y
ldy #0
sta (line1),y
//SEG68 [28] (byte*) scrollup2::line1#1 ← ++ (byte*) scrollup2::line1#2 -- pbuz1=_inc_pbuz1
inc line1
bne !+
inc line1+1
!:
//SEG69 [29] (byte*) scrollup2::line2#1 ← ++ (byte*) scrollup2::line2#2 -- pbuz1=_inc_pbuz1
inc line2
bne !+
inc line2+1
!:
//SEG70 [30] (byte) scrollup2::c#1 ← ++ (byte) scrollup2::c#2 -- vbuz1=_inc_vbuz1
inc c
//SEG71 [31] if((byte) scrollup2::c#1!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup2::@2 -- vbuz1_neq_vbuc1_then_la1
lda #$28
cmp c
bne b2_from_b2
jmp b3
//SEG72 scrollup2::@3
b3:
//SEG73 [32] (byte) scrollup2::l#1 ← ++ (byte) scrollup2::l#4 -- vbuz1=_inc_vbuz1
inc l
//SEG74 [33] if((byte) scrollup2::l#1!=(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup2::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$18
cmp l
bne b1_from_b3
jmp breturn
//SEG75 scrollup2::@return
breturn:
//SEG76 [34] return
rts
}
//SEG77 scrollup1
scrollup1: {
.label _0 = $14
.label _2 = $16
.label c = $f
.label line = $d
.label _6 = $18
.label _7 = $1a
//SEG78 [36] phi from scrollup1 to scrollup1::@1 [phi:scrollup1->scrollup1::@1]
b1_from_scrollup1:
//SEG79 [36] phi (word) scrollup1::line#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup1->scrollup1::@1#0] -- vwuz1=vbuc1
lda #0
sta line
lda #0
sta line+1
jmp b1
//SEG80 [36] phi from scrollup1::@3 to scrollup1::@1 [phi:scrollup1::@3->scrollup1::@1]
b1_from_b3:
//SEG81 [36] phi (word) scrollup1::line#4 = (word) scrollup1::line#1 [phi:scrollup1::@3->scrollup1::@1#0] -- register_copy
jmp b1
//SEG82 scrollup1::@1
b1:
//SEG83 [37] phi from scrollup1::@1 to scrollup1::@2 [phi:scrollup1::@1->scrollup1::@2]
b2_from_b1:
//SEG84 [37] phi (byte) scrollup1::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup1::@1->scrollup1::@2#0] -- vbuz1=vbuc1
lda #0
sta c
jmp b2
//SEG85 [37] phi from scrollup1::@2 to scrollup1::@2 [phi:scrollup1::@2->scrollup1::@2]
b2_from_b2:
//SEG86 [37] phi (byte) scrollup1::c#2 = (byte) scrollup1::c#1 [phi:scrollup1::@2->scrollup1::@2#0] -- register_copy
jmp b2
//SEG87 scrollup1::@2
b2:
//SEG88 [38] (word~) scrollup1::$0 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuz3
lda c
clc
adc line
sta _0
lda #0
adc line+1
sta _0+1
//SEG89 [39] (word~) scrollup1::$2 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuz3
lda c
clc
adc line
sta _2
lda #0
adc line+1
sta _2+1
//SEG90 [40] (byte*) scrollup1::$6 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) scrollup1::$2 -- pbuz1=pbuc1_plus_vwuz2
lda _2
clc
adc #<screen+$28
sta _6
lda _2+1
adc #>screen+$28
sta _6+1
//SEG91 [41] (byte*) scrollup1::$7 ← (const byte*) screen#0 + (word~) scrollup1::$0 -- pbuz1=pbuc1_plus_vwuz2
lda _0
clc
adc #<screen
sta _7
lda _0+1
adc #>screen
sta _7+1
//SEG92 [42] *((byte*) scrollup1::$7) ← *((byte*) scrollup1::$6) -- _deref_pbuz1=_deref_pbuz2
ldy #0
lda (_6),y
ldy #0
sta (_7),y
//SEG93 [43] (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#2 -- vbuz1=_inc_vbuz1
inc c
//SEG94 [44] if((byte) scrollup1::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup1::@2 -- vbuz1_lt_vbuc1_then_la1
lda c
cmp #$28
bcc b2_from_b2
jmp b3
//SEG95 scrollup1::@3
b3:
//SEG96 [45] (word) scrollup1::line#1 ← (word) scrollup1::line#4 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
lda #$28
clc
adc line
sta line
bcc !+
inc line+1
!:
//SEG97 [46] if((word) scrollup1::line#1<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup1::@1 -- vwuz1_lt_vwuc1_then_la1
lda line+1
cmp #>$28*$18
bcc b1_from_b3
bne !+
lda line
cmp #<$28*$18
bcc b1_from_b3
!:
jmp breturn
//SEG98 scrollup1::@return
breturn:
//SEG99 [47] return
rts
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [13] (word~) scrollup3::l2#4 ← (word) scrollup3::l2#0 [ scrollup3::l2#0 scrollup3::l2#4 ] ( main:2::scrollup3:9 [ scrollup3::l2#0 scrollup3::l2#4 ] ) always clobbers reg byte a
Statement [15] (byte*) scrollup3::$4 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word) scrollup3::l2#2 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 scrollup3::$4 ] ( main:2::scrollup3:9 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 scrollup3::$4 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ scrollup3::c#2 scrollup3::c#1 ]
Statement [16] (byte*) scrollup3::$5 ← (const byte*) screen#0 + (word) scrollup3::l2#2 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 scrollup3::$4 scrollup3::$5 ] ( main:2::scrollup3:9 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 scrollup3::$4 scrollup3::$5 ] ) always clobbers reg byte a
Statement [17] *((byte*) scrollup3::$5) ← *((byte*) scrollup3::$4) [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 ] ( main:2::scrollup3:9 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ scrollup3::c#2 scrollup3::c#1 ]
Statement [21] (word) scrollup3::line#1 ← (word) scrollup3::l2#0 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ scrollup3::line#1 ] ( main:2::scrollup3:9 [ scrollup3::line#1 ] ) always clobbers reg byte a
Statement [22] if((word) scrollup3::line#1<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup3::@1 [ scrollup3::line#1 ] ( main:2::scrollup3:9 [ scrollup3::line#1 ] ) always clobbers reg byte a
Statement [27] *((byte*) scrollup2::line1#2) ← *((byte*) scrollup2::line2#2) [ scrollup2::l#4 scrollup2::line2#2 scrollup2::line1#2 scrollup2::c#2 ] ( main:2::scrollup2:7 [ scrollup2::l#4 scrollup2::line2#2 scrollup2::line1#2 scrollup2::c#2 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:12 [ scrollup2::c#2 scrollup2::c#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:12 [ scrollup2::c#2 scrollup2::c#1 ]
Statement [38] (word~) scrollup1::$0 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:15 [ scrollup1::c#2 scrollup1::c#1 ]
Statement [39] (word~) scrollup1::$2 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 scrollup1::$2 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 scrollup1::$2 ] ) always clobbers reg byte a
Statement [40] (byte*) scrollup1::$6 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) scrollup1::$2 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 scrollup1::$6 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 scrollup1::$6 ] ) always clobbers reg byte a
Statement [41] (byte*) scrollup1::$7 ← (const byte*) screen#0 + (word~) scrollup1::$0 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$6 scrollup1::$7 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$6 scrollup1::$7 ] ) always clobbers reg byte a
Statement [42] *((byte*) scrollup1::$7) ← *((byte*) scrollup1::$6) [ scrollup1::line#4 scrollup1::c#2 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:15 [ scrollup1::c#2 scrollup1::c#1 ]
Statement [45] (word) scrollup1::line#1 ← (word) scrollup1::line#4 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ scrollup1::line#1 ] ( main:2::scrollup1:5 [ scrollup1::line#1 ] ) always clobbers reg byte a
Statement [46] if((word) scrollup1::line#1<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup1::@1 [ scrollup1::line#1 ] ( main:2::scrollup1:5 [ scrollup1::line#1 ] ) always clobbers reg byte a
Statement [13] (word~) scrollup3::l2#4 ← (word) scrollup3::l2#0 [ scrollup3::l2#0 scrollup3::l2#4 ] ( main:2::scrollup3:9 [ scrollup3::l2#0 scrollup3::l2#4 ] ) always clobbers reg byte a
Statement [15] (byte*) scrollup3::$4 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word) scrollup3::l2#2 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 scrollup3::$4 ] ( main:2::scrollup3:9 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 scrollup3::$4 ] ) always clobbers reg byte a
Statement [16] (byte*) scrollup3::$5 ← (const byte*) screen#0 + (word) scrollup3::l2#2 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 scrollup3::$4 scrollup3::$5 ] ( main:2::scrollup3:9 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 scrollup3::$4 scrollup3::$5 ] ) always clobbers reg byte a
Statement [17] *((byte*) scrollup3::$5) ← *((byte*) scrollup3::$4) [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 ] ( main:2::scrollup3:9 [ scrollup3::l2#0 scrollup3::l2#2 scrollup3::c#2 ] ) always clobbers reg byte a reg byte y
Statement [21] (word) scrollup3::line#1 ← (word) scrollup3::l2#0 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ scrollup3::line#1 ] ( main:2::scrollup3:9 [ scrollup3::line#1 ] ) always clobbers reg byte a
Statement [22] if((word) scrollup3::line#1<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup3::@1 [ scrollup3::line#1 ] ( main:2::scrollup3:9 [ scrollup3::line#1 ] ) always clobbers reg byte a
Statement [27] *((byte*) scrollup2::line1#2) ← *((byte*) scrollup2::line2#2) [ scrollup2::l#4 scrollup2::line2#2 scrollup2::line1#2 scrollup2::c#2 ] ( main:2::scrollup2:7 [ scrollup2::l#4 scrollup2::line2#2 scrollup2::line1#2 scrollup2::c#2 ] ) always clobbers reg byte a reg byte y
Statement [38] (word~) scrollup1::$0 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 ] ) always clobbers reg byte a
Statement [39] (word~) scrollup1::$2 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 scrollup1::$2 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 scrollup1::$2 ] ) always clobbers reg byte a
Statement [40] (byte*) scrollup1::$6 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) scrollup1::$2 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 scrollup1::$6 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$0 scrollup1::$6 ] ) always clobbers reg byte a
Statement [41] (byte*) scrollup1::$7 ← (const byte*) screen#0 + (word~) scrollup1::$0 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$6 scrollup1::$7 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 scrollup1::$6 scrollup1::$7 ] ) always clobbers reg byte a
Statement [42] *((byte*) scrollup1::$7) ← *((byte*) scrollup1::$6) [ scrollup1::line#4 scrollup1::c#2 ] ( main:2::scrollup1:5 [ scrollup1::line#4 scrollup1::c#2 ] ) always clobbers reg byte a reg byte y
Statement [45] (word) scrollup1::line#1 ← (word) scrollup1::line#4 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ scrollup1::line#1 ] ( main:2::scrollup1:5 [ scrollup1::line#1 ] ) always clobbers reg byte a
Statement [46] if((word) scrollup1::line#1<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup1::@1 [ scrollup1::line#1 ] ( main:2::scrollup1:5 [ scrollup1::line#1 ] ) always clobbers reg byte a
Potential registers zp ZP_WORD:2 [ scrollup3::l2#0 scrollup3::line#1 ] : zp ZP_WORD:2 ,
Potential registers zp ZP_WORD:4 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ] : zp ZP_WORD:4 ,
Potential registers zp ZP_BYTE:6 [ scrollup3::c#2 scrollup3::c#1 ] : zp ZP_BYTE:6 , reg byte x ,
Potential registers zp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ] : zp ZP_BYTE:7 , reg byte x ,
Potential registers zp ZP_WORD:8 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ] : zp ZP_WORD:8 ,
Potential registers zp ZP_WORD:10 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ] : zp ZP_WORD:10 ,
Potential registers zp ZP_BYTE:12 [ scrollup2::c#2 scrollup2::c#1 ] : zp ZP_BYTE:12 , reg byte x ,
Potential registers zp ZP_WORD:13 [ scrollup1::line#4 scrollup1::line#1 ] : zp ZP_WORD:13 ,
Potential registers zp ZP_BYTE:15 [ scrollup1::c#2 scrollup1::c#1 ] : zp ZP_BYTE:15 , reg byte x ,
Potential registers zp ZP_WORD:16 [ scrollup3::$4 ] : zp ZP_WORD:16 ,
Potential registers zp ZP_WORD:18 [ scrollup3::$5 ] : zp ZP_WORD:18 ,
Potential registers zp ZP_WORD:20 [ scrollup1::$0 ] : zp ZP_WORD:20 ,
Potential registers zp ZP_WORD:22 [ scrollup1::$2 ] : zp ZP_WORD:22 ,
Potential registers zp ZP_WORD:24 [ scrollup1::$6 ] : zp ZP_WORD:24 ,
Potential registers zp ZP_WORD:26 [ scrollup1::$7 ] : zp ZP_WORD:26 ,
REGISTER UPLIFT SCOPES
Uplift Scope [scrollup1] 218.83: zp ZP_BYTE:15 [ scrollup1::c#2 scrollup1::c#1 ] 202: zp ZP_WORD:22 [ scrollup1::$2 ] 202: zp ZP_WORD:26 [ scrollup1::$7 ] 101: zp ZP_WORD:24 [ scrollup1::$6 ] 67.33: zp ZP_WORD:20 [ scrollup1::$0 ] 41.39: zp ZP_WORD:13 [ scrollup1::line#4 scrollup1::line#1 ]
Uplift Scope [scrollup3] 202: zp ZP_WORD:18 [ scrollup3::$5 ] 193.08: zp ZP_WORD:4 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ] 191.9: zp ZP_BYTE:6 [ scrollup3::c#2 scrollup3::c#1 ] 101: zp ZP_WORD:16 [ scrollup3::$4 ] 20.17: zp ZP_WORD:2 [ scrollup3::l2#0 scrollup3::line#1 ]
Uplift Scope [scrollup2] 214.5: zp ZP_WORD:10 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ] 202: zp ZP_BYTE:12 [ scrollup2::c#2 scrollup2::c#1 ] 169.27: zp ZP_WORD:8 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ] 19.64: zp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ]
Uplift Scope [main]
Uplift Scope []
Uplifting [scrollup1] best 27978 combination reg byte x [ scrollup1::c#2 scrollup1::c#1 ] zp ZP_WORD:22 [ scrollup1::$2 ] zp ZP_WORD:26 [ scrollup1::$7 ] zp ZP_WORD:24 [ scrollup1::$6 ] zp ZP_WORD:20 [ scrollup1::$0 ] zp ZP_WORD:13 [ scrollup1::line#4 scrollup1::line#1 ]
Uplifting [scrollup3] best 27078 combination zp ZP_WORD:18 [ scrollup3::$5 ] zp ZP_WORD:4 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ] reg byte x [ scrollup3::c#2 scrollup3::c#1 ] zp ZP_WORD:16 [ scrollup3::$4 ] zp ZP_WORD:2 [ scrollup3::l2#0 scrollup3::line#1 ]
Uplifting [scrollup2] best 26178 combination zp ZP_WORD:10 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ] reg byte x [ scrollup2::c#2 scrollup2::c#1 ] zp ZP_WORD:8 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ] zp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ]
Uplifting [main] best 26178 combination
Uplifting [] best 26178 combination
Attempting to uplift remaining variables inzp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ]
Uplifting [scrollup2] best 26178 combination zp ZP_BYTE:7 [ scrollup2::l#4 scrollup2::l#1 ]
Coalescing zero page register with common assignment [ zp ZP_WORD:20 [ scrollup1::$0 ] ] with [ zp ZP_WORD:26 [ scrollup1::$7 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:22 [ scrollup1::$2 ] ] with [ zp ZP_WORD:24 [ scrollup1::$6 ] ] - score: 1
Coalescing zero page register [ zp ZP_WORD:2 [ scrollup3::l2#0 scrollup3::line#1 ] ] with [ zp ZP_WORD:8 [ scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ] ]
Coalescing zero page register [ zp ZP_WORD:2 [ scrollup3::l2#0 scrollup3::line#1 scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 ] ] with [ zp ZP_WORD:13 [ scrollup1::line#4 scrollup1::line#1 ] ]
Coalescing zero page register [ zp ZP_WORD:4 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 ] ] with [ zp ZP_WORD:10 [ scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ] ]
Coalescing zero page register [ zp ZP_WORD:4 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 ] ] with [ zp ZP_WORD:20 [ scrollup1::$0 scrollup1::$7 ] ]
Coalescing zero page register [ zp ZP_WORD:16 [ scrollup3::$4 ] ] with [ zp ZP_WORD:22 [ scrollup1::$2 scrollup1::$6 ] ]
Allocated (was zp ZP_BYTE:7) zp ZP_BYTE:6 [ scrollup2::l#4 scrollup2::l#1 ]
Allocated (was zp ZP_WORD:16) zp ZP_WORD:7 [ scrollup3::$4 scrollup1::$2 scrollup1::$6 ]
Allocated (was zp ZP_WORD:18) zp ZP_WORD:9 [ scrollup3::$5 ]
ASSEMBLER BEFORE OPTIMIZATION
//SEG0 File Comments
// Tests different ways of scrolling up the screen
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.label screen = $400
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
jmp b1
//SEG5 @1
b1:
//SEG6 [2] call main
//SEG7 [4] phi from @1 to main [phi:@1->main]
main_from_b1:
jsr main
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
jmp bend
//SEG9 @end
bend:
//SEG10 main
main: {
//SEG11 [5] call scrollup1
//SEG12 [35] phi from main to scrollup1 [phi:main->scrollup1]
scrollup1_from_main:
jsr scrollup1
//SEG13 [6] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
jmp b1
//SEG14 main::@1
b1:
//SEG15 [7] call scrollup2
//SEG16 [24] phi from main::@1 to scrollup2 [phi:main::@1->scrollup2]
scrollup2_from_b1:
jsr scrollup2
//SEG17 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
b2_from_b1:
jmp b2
//SEG18 main::@2
b2:
//SEG19 [9] call scrollup3
//SEG20 [11] phi from main::@2 to scrollup3 [phi:main::@2->scrollup3]
scrollup3_from_b2:
jsr scrollup3
jmp breturn
//SEG21 main::@return
breturn:
//SEG22 [10] return
rts
}
//SEG23 scrollup3
scrollup3: {
.label l2 = 2
.label l2_1 = 4
.label line = 2
.label l2_2 = 4
.label _4 = 7
.label _5 = 9
.label l2_4 = 4
//SEG24 [12] phi from scrollup3 to scrollup3::@1 [phi:scrollup3->scrollup3::@1]
b1_from_scrollup3:
//SEG25 [12] phi (word) scrollup3::l2#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup3->scrollup3::@1#0] -- vwuz1=vbuc1
lda #0
sta l2
lda #0
sta l2+1
jmp b1
//SEG26 [12] phi from scrollup3::@3 to scrollup3::@1 [phi:scrollup3::@3->scrollup3::@1]
b1_from_b3:
//SEG27 [12] phi (word) scrollup3::l2#0 = (word) scrollup3::line#1 [phi:scrollup3::@3->scrollup3::@1#0] -- register_copy
jmp b1
//SEG28 scrollup3::@1
b1:
//SEG29 [13] (word~) scrollup3::l2#4 ← (word) scrollup3::l2#0 -- vwuz1=vwuz2
lda l2
sta l2_4
lda l2+1
sta l2_4+1
//SEG30 [14] phi from scrollup3::@1 to scrollup3::@2 [phi:scrollup3::@1->scrollup3::@2]
b2_from_b1:
//SEG31 [14] phi (byte) scrollup3::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup3::@1->scrollup3::@2#0] -- vbuxx=vbuc1
ldx #0
//SEG32 [14] phi (word) scrollup3::l2#2 = (word~) scrollup3::l2#4 [phi:scrollup3::@1->scrollup3::@2#1] -- register_copy
jmp b2
//SEG33 [14] phi from scrollup3::@2 to scrollup3::@2 [phi:scrollup3::@2->scrollup3::@2]
b2_from_b2:
//SEG34 [14] phi (byte) scrollup3::c#2 = (byte) scrollup3::c#1 [phi:scrollup3::@2->scrollup3::@2#0] -- register_copy
//SEG35 [14] phi (word) scrollup3::l2#2 = (word) scrollup3::l2#1 [phi:scrollup3::@2->scrollup3::@2#1] -- register_copy
jmp b2
//SEG36 scrollup3::@2
b2:
//SEG37 [15] (byte*) scrollup3::$4 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2
lda l2_2
clc
adc #<screen+$28
sta _4
lda l2_2+1
adc #>screen+$28
sta _4+1
//SEG38 [16] (byte*) scrollup3::$5 ← (const byte*) screen#0 + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2
lda l2_2
clc
adc #<screen
sta _5
lda l2_2+1
adc #>screen
sta _5+1
//SEG39 [17] *((byte*) scrollup3::$5) ← *((byte*) scrollup3::$4) -- _deref_pbuz1=_deref_pbuz2
ldy #0
lda (_4),y
ldy #0
sta (_5),y
//SEG40 [18] (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2 -- vwuz1=_inc_vwuz1
inc l2_1
bne !+
inc l2_1+1
!:
//SEG41 [19] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#2 -- vbuxx=_inc_vbuxx
inx
//SEG42 [20] if((byte) scrollup3::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup3::@2 -- vbuxx_lt_vbuc1_then_la1
cpx #$28
bcc b2_from_b2
jmp b3
//SEG43 scrollup3::@3
b3:
//SEG44 [21] (word) scrollup3::line#1 ← (word) scrollup3::l2#0 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
lda #$28
clc
adc line
sta line
bcc !+
inc line+1
!:
//SEG45 [22] if((word) scrollup3::line#1<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup3::@1 -- vwuz1_lt_vwuc1_then_la1
lda line+1
cmp #>$28*$18
bcc b1_from_b3
bne !+
lda line
cmp #<$28*$18
bcc b1_from_b3
!:
jmp breturn
//SEG46 scrollup3::@return
breturn:
//SEG47 [23] return
rts
}
//SEG48 scrollup2
scrollup2: {
.label line1 = 4
.label line2 = 2
.label l = 6
//SEG49 [25] phi from scrollup2 to scrollup2::@1 [phi:scrollup2->scrollup2::@1]
b1_from_scrollup2:
//SEG50 [25] phi (byte) scrollup2::l#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup2->scrollup2::@1#0] -- vbuz1=vbuc1
lda #0
sta l
//SEG51 [25] phi (byte*) scrollup2::line1#3 = (const byte*) screen#0 [phi:scrollup2->scrollup2::@1#1] -- pbuz1=pbuc1
lda #<screen
sta line1
lda #>screen
sta line1+1
//SEG52 [25] phi (byte*) scrollup2::line2#3 = (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 [phi:scrollup2->scrollup2::@1#2] -- pbuz1=pbuc1
lda #<screen+$28
sta line2
lda #>screen+$28
sta line2+1
jmp b1
//SEG53 [25] phi from scrollup2::@3 to scrollup2::@1 [phi:scrollup2::@3->scrollup2::@1]
b1_from_b3:
//SEG54 [25] phi (byte) scrollup2::l#4 = (byte) scrollup2::l#1 [phi:scrollup2::@3->scrollup2::@1#0] -- register_copy
//SEG55 [25] phi (byte*) scrollup2::line1#3 = (byte*) scrollup2::line1#1 [phi:scrollup2::@3->scrollup2::@1#1] -- register_copy
//SEG56 [25] phi (byte*) scrollup2::line2#3 = (byte*) scrollup2::line2#1 [phi:scrollup2::@3->scrollup2::@1#2] -- register_copy
jmp b1
//SEG57 scrollup2::@1
b1:
//SEG58 [26] phi from scrollup2::@1 to scrollup2::@2 [phi:scrollup2::@1->scrollup2::@2]
b2_from_b1:
//SEG59 [26] phi (byte) scrollup2::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup2::@1->scrollup2::@2#0] -- vbuxx=vbuc1
ldx #0
//SEG60 [26] phi (byte*) scrollup2::line1#2 = (byte*) scrollup2::line1#3 [phi:scrollup2::@1->scrollup2::@2#1] -- register_copy
//SEG61 [26] phi (byte*) scrollup2::line2#2 = (byte*) scrollup2::line2#3 [phi:scrollup2::@1->scrollup2::@2#2] -- register_copy
jmp b2
//SEG62 [26] phi from scrollup2::@2 to scrollup2::@2 [phi:scrollup2::@2->scrollup2::@2]
b2_from_b2:
//SEG63 [26] phi (byte) scrollup2::c#2 = (byte) scrollup2::c#1 [phi:scrollup2::@2->scrollup2::@2#0] -- register_copy
//SEG64 [26] phi (byte*) scrollup2::line1#2 = (byte*) scrollup2::line1#1 [phi:scrollup2::@2->scrollup2::@2#1] -- register_copy
//SEG65 [26] phi (byte*) scrollup2::line2#2 = (byte*) scrollup2::line2#1 [phi:scrollup2::@2->scrollup2::@2#2] -- register_copy
jmp b2
//SEG66 scrollup2::@2
b2:
//SEG67 [27] *((byte*) scrollup2::line1#2) ← *((byte*) scrollup2::line2#2) -- _deref_pbuz1=_deref_pbuz2
ldy #0
lda (line2),y
ldy #0
sta (line1),y
//SEG68 [28] (byte*) scrollup2::line1#1 ← ++ (byte*) scrollup2::line1#2 -- pbuz1=_inc_pbuz1
inc line1
bne !+
inc line1+1
!:
//SEG69 [29] (byte*) scrollup2::line2#1 ← ++ (byte*) scrollup2::line2#2 -- pbuz1=_inc_pbuz1
inc line2
bne !+
inc line2+1
!:
//SEG70 [30] (byte) scrollup2::c#1 ← ++ (byte) scrollup2::c#2 -- vbuxx=_inc_vbuxx
inx
//SEG71 [31] if((byte) scrollup2::c#1!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup2::@2 -- vbuxx_neq_vbuc1_then_la1
cpx #$28
bne b2_from_b2
jmp b3
//SEG72 scrollup2::@3
b3:
//SEG73 [32] (byte) scrollup2::l#1 ← ++ (byte) scrollup2::l#4 -- vbuz1=_inc_vbuz1
inc l
//SEG74 [33] if((byte) scrollup2::l#1!=(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup2::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$18
cmp l
bne b1_from_b3
jmp breturn
//SEG75 scrollup2::@return
breturn:
//SEG76 [34] return
rts
}
//SEG77 scrollup1
scrollup1: {
.label _0 = 4
.label _2 = 7
.label line = 2
.label _6 = 7
.label _7 = 4
//SEG78 [36] phi from scrollup1 to scrollup1::@1 [phi:scrollup1->scrollup1::@1]
b1_from_scrollup1:
//SEG79 [36] phi (word) scrollup1::line#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup1->scrollup1::@1#0] -- vwuz1=vbuc1
lda #0
sta line
lda #0
sta line+1
jmp b1
//SEG80 [36] phi from scrollup1::@3 to scrollup1::@1 [phi:scrollup1::@3->scrollup1::@1]
b1_from_b3:
//SEG81 [36] phi (word) scrollup1::line#4 = (word) scrollup1::line#1 [phi:scrollup1::@3->scrollup1::@1#0] -- register_copy
jmp b1
//SEG82 scrollup1::@1
b1:
//SEG83 [37] phi from scrollup1::@1 to scrollup1::@2 [phi:scrollup1::@1->scrollup1::@2]
b2_from_b1:
//SEG84 [37] phi (byte) scrollup1::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup1::@1->scrollup1::@2#0] -- vbuxx=vbuc1
ldx #0
jmp b2
//SEG85 [37] phi from scrollup1::@2 to scrollup1::@2 [phi:scrollup1::@2->scrollup1::@2]
b2_from_b2:
//SEG86 [37] phi (byte) scrollup1::c#2 = (byte) scrollup1::c#1 [phi:scrollup1::@2->scrollup1::@2#0] -- register_copy
jmp b2
//SEG87 scrollup1::@2
b2:
//SEG88 [38] (word~) scrollup1::$0 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuxx
txa
clc
adc line
sta _0
lda #0
adc line+1
sta _0+1
//SEG89 [39] (word~) scrollup1::$2 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuxx
txa
clc
adc line
sta _2
lda #0
adc line+1
sta _2+1
//SEG90 [40] (byte*) scrollup1::$6 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) scrollup1::$2 -- pbuz1=pbuc1_plus_vwuz1
clc
lda _6
adc #<screen+$28
sta _6
lda _6+1
adc #>screen+$28
sta _6+1
//SEG91 [41] (byte*) scrollup1::$7 ← (const byte*) screen#0 + (word~) scrollup1::$0 -- pbuz1=pbuc1_plus_vwuz1
clc
lda _7
adc #<screen
sta _7
lda _7+1
adc #>screen
sta _7+1
//SEG92 [42] *((byte*) scrollup1::$7) ← *((byte*) scrollup1::$6) -- _deref_pbuz1=_deref_pbuz2
ldy #0
lda (_6),y
ldy #0
sta (_7),y
//SEG93 [43] (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#2 -- vbuxx=_inc_vbuxx
inx
//SEG94 [44] if((byte) scrollup1::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup1::@2 -- vbuxx_lt_vbuc1_then_la1
cpx #$28
bcc b2_from_b2
jmp b3
//SEG95 scrollup1::@3
b3:
//SEG96 [45] (word) scrollup1::line#1 ← (word) scrollup1::line#4 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
lda #$28
clc
adc line
sta line
bcc !+
inc line+1
!:
//SEG97 [46] if((word) scrollup1::line#1<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup1::@1 -- vwuz1_lt_vwuc1_then_la1
lda line+1
cmp #>$28*$18
bcc b1_from_b3
bne !+
lda line
cmp #<$28*$18
bcc b1_from_b3
!:
jmp breturn
//SEG98 scrollup1::@return
breturn:
//SEG99 [47] return
rts
}
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #0
Removing instruction ldy #0
Removing instruction ldy #0
Removing instruction lda #0
Removing instruction ldy #0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label b2_from_b2 with b2
Replacing label b1_from_b3 with b1
Replacing label b1_from_b3 with b1
Replacing label b2_from_b2 with b2
Replacing label b1_from_b3 with b1
Replacing label b2_from_b2 with b2
Replacing label b1_from_b3 with b1
Replacing label b1_from_b3 with b1
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Removing instruction b1_from_main:
Removing instruction scrollup2_from_b1:
Removing instruction b2_from_b1:
Removing instruction scrollup3_from_b2:
Removing instruction b1_from_b3:
Removing instruction b2_from_b2:
Removing instruction b1_from_b3:
Removing instruction b2_from_b1:
Removing instruction b2_from_b2:
Removing instruction b1_from_b3:
Removing instruction b2_from_b1:
Removing instruction b2_from_b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction scrollup1_from_main:
Removing instruction b1:
Removing instruction b2:
Removing instruction breturn:
Removing instruction b1_from_scrollup3:
Removing instruction b2_from_b1:
Removing instruction b3:
Removing instruction breturn:
Removing instruction b1_from_scrollup2:
Removing instruction b3:
Removing instruction breturn:
Removing instruction b1_from_scrollup1:
Removing instruction b3:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b1
Removing instruction jmp b2
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@return
(byte*) screen
(const byte*) screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $400
(void()) scrollup1()
(word~) scrollup1::$0 $0 zp ZP_WORD:4 67.33333333333333
(word~) scrollup1::$2 $2 zp ZP_WORD:7 202.0
(byte*) scrollup1::$6 $6 zp ZP_WORD:7 101.0
(byte*) scrollup1::$7 $7 zp ZP_WORD:4 202.0
(label) scrollup1::@1
(label) scrollup1::@2
(label) scrollup1::@3
(label) scrollup1::@return
(byte) scrollup1::c
(byte) scrollup1::c#1 reg byte x 151.5
(byte) scrollup1::c#2 reg byte x 67.33333333333333
(word) scrollup1::line
(word) scrollup1::line#1 line zp ZP_WORD:2 16.5
(word) scrollup1::line#4 line zp ZP_WORD:2 24.888888888888886
(void()) scrollup2()
(label) scrollup2::@1
(label) scrollup2::@2
(label) scrollup2::@3
(label) scrollup2::@return
(byte) scrollup2::c
(byte) scrollup2::c#1 reg byte x 151.5
(byte) scrollup2::c#2 reg byte x 50.5
(byte) scrollup2::l
(byte) scrollup2::l#1 l zp ZP_BYTE:6 16.5
(byte) scrollup2::l#4 l zp ZP_BYTE:6 3.142857142857143
(byte*) scrollup2::line1
(byte*) scrollup2::line1#1 line1 zp ZP_WORD:4 35.5
(byte*) scrollup2::line1#2 line1 zp ZP_WORD:4 157.0
(byte*) scrollup2::line1#3 line1 zp ZP_WORD:4 22.0
(byte*) scrollup2::line2
(byte*) scrollup2::line2#1 line2 zp ZP_WORD:2 42.599999999999994
(byte*) scrollup2::line2#2 line2 zp ZP_WORD:2 104.66666666666666
(byte*) scrollup2::line2#3 line2 zp ZP_WORD:2 22.0
(void()) scrollup3()
(byte*) scrollup3::$4 $4 zp ZP_WORD:7 101.0
(byte*) scrollup3::$5 $5 zp ZP_WORD:9 202.0
(label) scrollup3::@1
(label) scrollup3::@2
(label) scrollup3::@3
(label) scrollup3::@return
(byte) scrollup3::c
(byte) scrollup3::c#1 reg byte x 151.5
(byte) scrollup3::c#2 reg byte x 40.4
(word) scrollup3::l2
(word) scrollup3::l2#0 l2 zp ZP_WORD:2 3.666666666666667
(word) scrollup3::l2#1 l2#1 zp ZP_WORD:4 67.33333333333333
(word) scrollup3::l2#2 l2#2 zp ZP_WORD:4 103.75
(word~) scrollup3::l2#4 l2#4 zp ZP_WORD:4 22.0
(word) scrollup3::line
(word) scrollup3::line#1 line zp ZP_WORD:2 16.5
zp ZP_WORD:2 [ scrollup3::l2#0 scrollup3::line#1 scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 scrollup1::line#4 scrollup1::line#1 ]
zp ZP_WORD:4 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 scrollup1::$0 scrollup1::$7 ]
reg byte x [ scrollup3::c#2 scrollup3::c#1 ]
zp ZP_BYTE:6 [ scrollup2::l#4 scrollup2::l#1 ]
reg byte x [ scrollup2::c#2 scrollup2::c#1 ]
reg byte x [ scrollup1::c#2 scrollup1::c#1 ]
zp ZP_WORD:7 [ scrollup3::$4 scrollup1::$2 scrollup1::$6 ]
zp ZP_WORD:9 [ scrollup3::$5 ]
FINAL ASSEMBLER
Score: 22547
//SEG0 File Comments
// Tests different ways of scrolling up the screen
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.label screen = $400
//SEG3 @begin
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
//SEG5 @1
//SEG6 [2] call main
//SEG7 [4] phi from @1 to main [phi:@1->main]
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
//SEG9 @end
//SEG10 main
main: {
//SEG11 [5] call scrollup1
//SEG12 [35] phi from main to scrollup1 [phi:main->scrollup1]
jsr scrollup1
//SEG13 [6] phi from main to main::@1 [phi:main->main::@1]
//SEG14 main::@1
//SEG15 [7] call scrollup2
//SEG16 [24] phi from main::@1 to scrollup2 [phi:main::@1->scrollup2]
jsr scrollup2
//SEG17 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
//SEG18 main::@2
//SEG19 [9] call scrollup3
//SEG20 [11] phi from main::@2 to scrollup3 [phi:main::@2->scrollup3]
jsr scrollup3
//SEG21 main::@return
//SEG22 [10] return
rts
}
//SEG23 scrollup3
scrollup3: {
.label l2 = 2
.label l2_1 = 4
.label line = 2
.label l2_2 = 4
.label _4 = 7
.label _5 = 9
.label l2_4 = 4
//SEG24 [12] phi from scrollup3 to scrollup3::@1 [phi:scrollup3->scrollup3::@1]
//SEG25 [12] phi (word) scrollup3::l2#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup3->scrollup3::@1#0] -- vwuz1=vbuc1
lda #0
sta l2
sta l2+1
//SEG26 [12] phi from scrollup3::@3 to scrollup3::@1 [phi:scrollup3::@3->scrollup3::@1]
//SEG27 [12] phi (word) scrollup3::l2#0 = (word) scrollup3::line#1 [phi:scrollup3::@3->scrollup3::@1#0] -- register_copy
//SEG28 scrollup3::@1
b1:
//SEG29 [13] (word~) scrollup3::l2#4 ← (word) scrollup3::l2#0 -- vwuz1=vwuz2
lda l2
sta l2_4
lda l2+1
sta l2_4+1
//SEG30 [14] phi from scrollup3::@1 to scrollup3::@2 [phi:scrollup3::@1->scrollup3::@2]
//SEG31 [14] phi (byte) scrollup3::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup3::@1->scrollup3::@2#0] -- vbuxx=vbuc1
ldx #0
//SEG32 [14] phi (word) scrollup3::l2#2 = (word~) scrollup3::l2#4 [phi:scrollup3::@1->scrollup3::@2#1] -- register_copy
//SEG33 [14] phi from scrollup3::@2 to scrollup3::@2 [phi:scrollup3::@2->scrollup3::@2]
//SEG34 [14] phi (byte) scrollup3::c#2 = (byte) scrollup3::c#1 [phi:scrollup3::@2->scrollup3::@2#0] -- register_copy
//SEG35 [14] phi (word) scrollup3::l2#2 = (word) scrollup3::l2#1 [phi:scrollup3::@2->scrollup3::@2#1] -- register_copy
//SEG36 scrollup3::@2
b2:
//SEG37 [15] (byte*) scrollup3::$4 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2
lda l2_2
clc
adc #<screen+$28
sta _4
lda l2_2+1
adc #>screen+$28
sta _4+1
//SEG38 [16] (byte*) scrollup3::$5 ← (const byte*) screen#0 + (word) scrollup3::l2#2 -- pbuz1=pbuc1_plus_vwuz2
lda l2_2
clc
adc #<screen
sta _5
lda l2_2+1
adc #>screen
sta _5+1
//SEG39 [17] *((byte*) scrollup3::$5) ← *((byte*) scrollup3::$4) -- _deref_pbuz1=_deref_pbuz2
ldy #0
lda (_4),y
sta (_5),y
//SEG40 [18] (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2 -- vwuz1=_inc_vwuz1
inc l2_1
bne !+
inc l2_1+1
!:
//SEG41 [19] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#2 -- vbuxx=_inc_vbuxx
inx
//SEG42 [20] if((byte) scrollup3::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup3::@2 -- vbuxx_lt_vbuc1_then_la1
cpx #$28
bcc b2
//SEG43 scrollup3::@3
//SEG44 [21] (word) scrollup3::line#1 ← (word) scrollup3::l2#0 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
lda #$28
clc
adc line
sta line
bcc !+
inc line+1
!:
//SEG45 [22] if((word) scrollup3::line#1<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup3::@1 -- vwuz1_lt_vwuc1_then_la1
lda line+1
cmp #>$28*$18
bcc b1
bne !+
lda line
cmp #<$28*$18
bcc b1
!:
//SEG46 scrollup3::@return
//SEG47 [23] return
rts
}
//SEG48 scrollup2
scrollup2: {
.label line1 = 4
.label line2 = 2
.label l = 6
//SEG49 [25] phi from scrollup2 to scrollup2::@1 [phi:scrollup2->scrollup2::@1]
//SEG50 [25] phi (byte) scrollup2::l#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup2->scrollup2::@1#0] -- vbuz1=vbuc1
lda #0
sta l
//SEG51 [25] phi (byte*) scrollup2::line1#3 = (const byte*) screen#0 [phi:scrollup2->scrollup2::@1#1] -- pbuz1=pbuc1
lda #<screen
sta line1
lda #>screen
sta line1+1
//SEG52 [25] phi (byte*) scrollup2::line2#3 = (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 [phi:scrollup2->scrollup2::@1#2] -- pbuz1=pbuc1
lda #<screen+$28
sta line2
lda #>screen+$28
sta line2+1
//SEG53 [25] phi from scrollup2::@3 to scrollup2::@1 [phi:scrollup2::@3->scrollup2::@1]
//SEG54 [25] phi (byte) scrollup2::l#4 = (byte) scrollup2::l#1 [phi:scrollup2::@3->scrollup2::@1#0] -- register_copy
//SEG55 [25] phi (byte*) scrollup2::line1#3 = (byte*) scrollup2::line1#1 [phi:scrollup2::@3->scrollup2::@1#1] -- register_copy
//SEG56 [25] phi (byte*) scrollup2::line2#3 = (byte*) scrollup2::line2#1 [phi:scrollup2::@3->scrollup2::@1#2] -- register_copy
//SEG57 scrollup2::@1
b1:
//SEG58 [26] phi from scrollup2::@1 to scrollup2::@2 [phi:scrollup2::@1->scrollup2::@2]
//SEG59 [26] phi (byte) scrollup2::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup2::@1->scrollup2::@2#0] -- vbuxx=vbuc1
ldx #0
//SEG60 [26] phi (byte*) scrollup2::line1#2 = (byte*) scrollup2::line1#3 [phi:scrollup2::@1->scrollup2::@2#1] -- register_copy
//SEG61 [26] phi (byte*) scrollup2::line2#2 = (byte*) scrollup2::line2#3 [phi:scrollup2::@1->scrollup2::@2#2] -- register_copy
//SEG62 [26] phi from scrollup2::@2 to scrollup2::@2 [phi:scrollup2::@2->scrollup2::@2]
//SEG63 [26] phi (byte) scrollup2::c#2 = (byte) scrollup2::c#1 [phi:scrollup2::@2->scrollup2::@2#0] -- register_copy
//SEG64 [26] phi (byte*) scrollup2::line1#2 = (byte*) scrollup2::line1#1 [phi:scrollup2::@2->scrollup2::@2#1] -- register_copy
//SEG65 [26] phi (byte*) scrollup2::line2#2 = (byte*) scrollup2::line2#1 [phi:scrollup2::@2->scrollup2::@2#2] -- register_copy
//SEG66 scrollup2::@2
b2:
//SEG67 [27] *((byte*) scrollup2::line1#2) ← *((byte*) scrollup2::line2#2) -- _deref_pbuz1=_deref_pbuz2
ldy #0
lda (line2),y
sta (line1),y
//SEG68 [28] (byte*) scrollup2::line1#1 ← ++ (byte*) scrollup2::line1#2 -- pbuz1=_inc_pbuz1
inc line1
bne !+
inc line1+1
!:
//SEG69 [29] (byte*) scrollup2::line2#1 ← ++ (byte*) scrollup2::line2#2 -- pbuz1=_inc_pbuz1
inc line2
bne !+
inc line2+1
!:
//SEG70 [30] (byte) scrollup2::c#1 ← ++ (byte) scrollup2::c#2 -- vbuxx=_inc_vbuxx
inx
//SEG71 [31] if((byte) scrollup2::c#1!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup2::@2 -- vbuxx_neq_vbuc1_then_la1
cpx #$28
bne b2
//SEG72 scrollup2::@3
//SEG73 [32] (byte) scrollup2::l#1 ← ++ (byte) scrollup2::l#4 -- vbuz1=_inc_vbuz1
inc l
//SEG74 [33] if((byte) scrollup2::l#1!=(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup2::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$18
cmp l
bne b1
//SEG75 scrollup2::@return
//SEG76 [34] return
rts
}
//SEG77 scrollup1
scrollup1: {
.label _0 = 4
.label _2 = 7
.label line = 2
.label _6 = 7
.label _7 = 4
//SEG78 [36] phi from scrollup1 to scrollup1::@1 [phi:scrollup1->scrollup1::@1]
//SEG79 [36] phi (word) scrollup1::line#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup1->scrollup1::@1#0] -- vwuz1=vbuc1
lda #0
sta line
sta line+1
//SEG80 [36] phi from scrollup1::@3 to scrollup1::@1 [phi:scrollup1::@3->scrollup1::@1]
//SEG81 [36] phi (word) scrollup1::line#4 = (word) scrollup1::line#1 [phi:scrollup1::@3->scrollup1::@1#0] -- register_copy
//SEG82 scrollup1::@1
b1:
//SEG83 [37] phi from scrollup1::@1 to scrollup1::@2 [phi:scrollup1::@1->scrollup1::@2]
//SEG84 [37] phi (byte) scrollup1::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:scrollup1::@1->scrollup1::@2#0] -- vbuxx=vbuc1
ldx #0
//SEG85 [37] phi from scrollup1::@2 to scrollup1::@2 [phi:scrollup1::@2->scrollup1::@2]
//SEG86 [37] phi (byte) scrollup1::c#2 = (byte) scrollup1::c#1 [phi:scrollup1::@2->scrollup1::@2#0] -- register_copy
//SEG87 scrollup1::@2
b2:
//SEG88 [38] (word~) scrollup1::$0 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuxx
txa
clc
adc line
sta _0
lda #0
adc line+1
sta _0+1
//SEG89 [39] (word~) scrollup1::$2 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2 -- vwuz1=vwuz2_plus_vbuxx
txa
clc
adc line
sta _2
lda #0
adc line+1
sta _2+1
//SEG90 [40] (byte*) scrollup1::$6 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) scrollup1::$2 -- pbuz1=pbuc1_plus_vwuz1
clc
lda _6
adc #<screen+$28
sta _6
lda _6+1
adc #>screen+$28
sta _6+1
//SEG91 [41] (byte*) scrollup1::$7 ← (const byte*) screen#0 + (word~) scrollup1::$0 -- pbuz1=pbuc1_plus_vwuz1
clc
lda _7
adc #<screen
sta _7
lda _7+1
adc #>screen
sta _7+1
//SEG92 [42] *((byte*) scrollup1::$7) ← *((byte*) scrollup1::$6) -- _deref_pbuz1=_deref_pbuz2
ldy #0
lda (_6),y
sta (_7),y
//SEG93 [43] (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#2 -- vbuxx=_inc_vbuxx
inx
//SEG94 [44] if((byte) scrollup1::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup1::@2 -- vbuxx_lt_vbuc1_then_la1
cpx #$28
bcc b2
//SEG95 scrollup1::@3
//SEG96 [45] (word) scrollup1::line#1 ← (word) scrollup1::line#4 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
lda #$28
clc
adc line
sta line
bcc !+
inc line+1
!:
//SEG97 [46] if((word) scrollup1::line#1<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup1::@1 -- vwuz1_lt_vwuc1_then_la1
lda line+1
cmp #>$28*$18
bcc b1
bne !+
lda line
cmp #<$28*$18
bcc b1
!:
//SEG98 scrollup1::@return
//SEG99 [47] return
rts
}