1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-06-10 10:29:36 +00:00
kickc/src/test/ref/inline-function-level2.log
2019-04-20 22:12:56 +02:00

1285 lines
57 KiB
Plaintext

Inlined call call line (byte/signed byte/word/signed word/dword/signed dword) 2 (byte/signed byte/word/signed word/dword/signed dword) $40 (byte/signed byte/word/signed word/dword/signed dword) $a (byte) '*'
Inlined call call plot (byte~) main::line1_$0 (byte) main::line1_ch
Inlined call call line (byte/signed byte/word/signed word/dword/signed dword) 4 (byte/word/signed word/dword/signed dword) $80 (byte/signed byte/word/signed word/dword/signed dword) $f (byte) '.'
Inlined call call plot (byte~) main::line2_$0 (byte) main::line2_ch
Inlined call call plot (byte~) line::$0 (byte) line::ch
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@1
main: scope:[main] from @3
(byte*) main::sc#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
to:main::@1
main::@1: scope:[main] from main main::@1
(byte*) main::sc#2 ← phi( main/(byte*) main::sc#0 main::@1/(byte*) main::sc#1 )
*((byte*) main::sc#2) ← (byte) ' '
(byte*) main::sc#1 ← ++ (byte*) main::sc#2
(word/signed word/dword/signed dword~) main::$2 ← (word/signed word/dword/signed dword) $400 + (word/signed word/dword/signed dword) $3e8
(bool~) main::$3 ← (byte*) main::sc#1 < (word/signed word/dword/signed dword~) main::$2
if((bool~) main::$3) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
(byte) main::line1_xpos#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) main::line1_xadd#0 ← (byte/signed byte/word/signed word/dword/signed dword) $40
(byte) main::line1_ysize#0 ← (byte/signed byte/word/signed word/dword/signed dword) $a
(byte) main::line1_ch#0 ← (byte) '*'
to:main::line1
main::line1: scope:[main] from main::@2
(byte) main::line1_ysize#4 ← phi( main::@2/(byte) main::line1_ysize#0 )
(byte) main::line1_xadd#4 ← phi( main::@2/(byte) main::line1_xadd#0 )
(byte) main::line1_ch#3 ← phi( main::@2/(byte) main::line1_ch#0 )
(byte) main::line1_xpos#1 ← phi( main::@2/(byte) main::line1_xpos#0 )
(byte*) cur_line#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(word) main::line1_pos#0 ← { (byte) main::line1_xpos#1, (byte/signed byte/word/signed word/dword/signed dword) 0 }
(byte) main::line1_i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:main::line1_@1
main::line1_@1: scope:[main] from main::@4 main::line1
(byte) main::line1_ysize#3 ← phi( main::@4/(byte) main::line1_ysize#1 main::line1/(byte) main::line1_ysize#4 )
(byte) main::line1_i#4 ← phi( main::@4/(byte) main::line1_i#1 main::line1/(byte) main::line1_i#0 )
(byte) main::line1_xadd#3 ← phi( main::@4/(byte) main::line1_xadd#1 main::line1/(byte) main::line1_xadd#4 )
(byte*) cur_line#13 ← phi( main::@4/(byte*) cur_line#1 main::line1/(byte*) cur_line#0 )
(byte) main::line1_ch#1 ← phi( main::@4/(byte) main::line1_ch#2 main::line1/(byte) main::line1_ch#3 )
(word) main::line1_pos#2 ← phi( main::@4/(word) main::line1_pos#1 main::line1/(word) main::line1_pos#0 )
(byte) main::line1_$0#0 ← > (word) main::line1_pos#2
(byte) main::plot1_xpos#0 ← (byte) main::line1_$0#0
(byte) main::plot1_ch#0 ← (byte) main::line1_ch#1
to:main::plot1
main::plot1: scope:[main] from main::line1_@1
(byte) main::line1_ch#4 ← phi( main::line1_@1/(byte) main::line1_ch#1 )
(byte) main::line1_ysize#2 ← phi( main::line1_@1/(byte) main::line1_ysize#3 )
(byte) main::line1_i#3 ← phi( main::line1_@1/(byte) main::line1_i#4 )
(byte) main::line1_xadd#2 ← phi( main::line1_@1/(byte) main::line1_xadd#3 )
(word) main::line1_pos#4 ← phi( main::line1_@1/(word) main::line1_pos#2 )
(byte) main::plot1_ch#1 ← phi( main::line1_@1/(byte) main::plot1_ch#0 )
(byte) main::plot1_xpos#1 ← phi( main::line1_@1/(byte) main::plot1_xpos#0 )
(byte*) cur_line#7 ← phi( main::line1_@1/(byte*) cur_line#13 )
(byte*) main::plot1_$0#0 ← (byte*) cur_line#7 + (byte) main::plot1_xpos#1
*((byte*) main::plot1_$0#0) ← (byte) main::plot1_ch#1
to:main::@4
main::@4: scope:[main] from main::plot1
(byte) main::line1_ch#2 ← phi( main::plot1/(byte) main::line1_ch#4 )
(byte) main::line1_ysize#1 ← phi( main::plot1/(byte) main::line1_ysize#2 )
(byte) main::line1_i#2 ← phi( main::plot1/(byte) main::line1_i#3 )
(byte*) cur_line#8 ← phi( main::plot1/(byte*) cur_line#7 )
(byte) main::line1_xadd#1 ← phi( main::plot1/(byte) main::line1_xadd#2 )
(word) main::line1_pos#3 ← phi( main::plot1/(word) main::line1_pos#4 )
(word) main::line1_pos#1 ← (word) main::line1_pos#3 + (byte) main::line1_xadd#1
(byte*) cur_line#1 ← (byte*) cur_line#8 + (byte/signed byte/word/signed word/dword/signed dword) $28
(byte) main::line1_i#1 ← ++ (byte) main::line1_i#2
(bool) main::line1_$2#0 ← (byte) main::line1_i#1 < (byte) main::line1_ysize#1
if((bool) main::line1_$2#0) goto main::line1_@1
to:main::@3
main::@3: scope:[main] from main::@4
(byte) main::line2_xpos#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) main::line2_xadd#0 ← (byte/word/signed word/dword/signed dword) $80
(byte) main::line2_ysize#0 ← (byte/signed byte/word/signed word/dword/signed dword) $f
(byte) main::line2_ch#0 ← (byte) '.'
to:main::line2
main::line2: scope:[main] from main::@3
(byte) main::line2_ysize#4 ← phi( main::@3/(byte) main::line2_ysize#0 )
(byte) main::line2_xadd#4 ← phi( main::@3/(byte) main::line2_xadd#0 )
(byte) main::line2_ch#3 ← phi( main::@3/(byte) main::line2_ch#0 )
(byte) main::line2_xpos#1 ← phi( main::@3/(byte) main::line2_xpos#0 )
(byte*) cur_line#2 ← ((byte*)) (word/signed word/dword/signed dword) $400
(word) main::line2_pos#0 ← { (byte) main::line2_xpos#1, (byte/signed byte/word/signed word/dword/signed dword) 0 }
(byte) main::line2_i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:main::line2_@1
main::line2_@1: scope:[main] from main::@6 main::line2
(byte) main::line2_ysize#3 ← phi( main::@6/(byte) main::line2_ysize#1 main::line2/(byte) main::line2_ysize#4 )
(byte) main::line2_i#4 ← phi( main::@6/(byte) main::line2_i#1 main::line2/(byte) main::line2_i#0 )
(byte) main::line2_xadd#3 ← phi( main::@6/(byte) main::line2_xadd#1 main::line2/(byte) main::line2_xadd#4 )
(byte*) cur_line#14 ← phi( main::@6/(byte*) cur_line#3 main::line2/(byte*) cur_line#2 )
(byte) main::line2_ch#1 ← phi( main::@6/(byte) main::line2_ch#2 main::line2/(byte) main::line2_ch#3 )
(word) main::line2_pos#2 ← phi( main::@6/(word) main::line2_pos#1 main::line2/(word) main::line2_pos#0 )
(byte) main::line2_$0#0 ← > (word) main::line2_pos#2
(byte) main::plot2_xpos#0 ← (byte) main::line2_$0#0
(byte) main::plot2_ch#0 ← (byte) main::line2_ch#1
to:main::plot2
main::plot2: scope:[main] from main::line2_@1
(byte) main::line2_ch#4 ← phi( main::line2_@1/(byte) main::line2_ch#1 )
(byte) main::line2_ysize#2 ← phi( main::line2_@1/(byte) main::line2_ysize#3 )
(byte) main::line2_i#3 ← phi( main::line2_@1/(byte) main::line2_i#4 )
(byte) main::line2_xadd#2 ← phi( main::line2_@1/(byte) main::line2_xadd#3 )
(word) main::line2_pos#4 ← phi( main::line2_@1/(word) main::line2_pos#2 )
(byte) main::plot2_ch#1 ← phi( main::line2_@1/(byte) main::plot2_ch#0 )
(byte) main::plot2_xpos#1 ← phi( main::line2_@1/(byte) main::plot2_xpos#0 )
(byte*) cur_line#9 ← phi( main::line2_@1/(byte*) cur_line#14 )
(byte*) main::plot2_$0#0 ← (byte*) cur_line#9 + (byte) main::plot2_xpos#1
*((byte*) main::plot2_$0#0) ← (byte) main::plot2_ch#1
to:main::@6
main::@6: scope:[main] from main::plot2
(byte) main::line2_ch#2 ← phi( main::plot2/(byte) main::line2_ch#4 )
(byte) main::line2_ysize#1 ← phi( main::plot2/(byte) main::line2_ysize#2 )
(byte) main::line2_i#2 ← phi( main::plot2/(byte) main::line2_i#3 )
(byte*) cur_line#10 ← phi( main::plot2/(byte*) cur_line#9 )
(byte) main::line2_xadd#1 ← phi( main::plot2/(byte) main::line2_xadd#2 )
(word) main::line2_pos#3 ← phi( main::plot2/(word) main::line2_pos#4 )
(word) main::line2_pos#1 ← (word) main::line2_pos#3 + (byte) main::line2_xadd#1
(byte*) cur_line#3 ← (byte*) cur_line#10 + (byte/signed byte/word/signed word/dword/signed dword) $28
(byte) main::line2_i#1 ← ++ (byte) main::line2_i#2
(bool) main::line2_$2#0 ← (byte) main::line2_i#1 < (byte) main::line2_ysize#1
if((bool) main::line2_$2#0) goto main::line2_@1
to:main::@return
main::@return: scope:[main] from main::@6
(byte*) cur_line#11 ← phi( main::@6/(byte*) cur_line#3 )
(byte*) cur_line#4 ← (byte*) cur_line#11
return
to:@return
@1: scope:[] from @begin
(byte*) cur_line#5 ← ((byte*)) (word/signed word/dword/signed dword) $400
to:@3
@3: scope:[] from @1
(byte*) cur_line#15 ← phi( @1/(byte*) cur_line#5 )
call main
to:@4
@4: scope:[] from @3
(byte*) cur_line#12 ← phi( @3/(byte*) cur_line#4 )
(byte*) cur_line#6 ← (byte*) cur_line#12
to:@end
@end: scope:[] from @4
SYMBOL TABLE SSA
(label) @1
(label) @3
(label) @4
(label) @begin
(label) @end
(byte*) cur_line
(byte*) cur_line#0
(byte*) cur_line#1
(byte*) cur_line#10
(byte*) cur_line#11
(byte*) cur_line#12
(byte*) cur_line#13
(byte*) cur_line#14
(byte*) cur_line#15
(byte*) cur_line#2
(byte*) cur_line#3
(byte*) cur_line#4
(byte*) cur_line#5
(byte*) cur_line#6
(byte*) cur_line#7
(byte*) cur_line#8
(byte*) cur_line#9
(void()) main()
(word/signed word/dword/signed dword~) main::$2
(bool~) main::$3
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@6
(label) main::@return
(label) main::line1
(byte~) main::line1_$0
(byte) main::line1_$0#0
(bool~) main::line1_$2
(bool) main::line1_$2#0
(label) main::line1_@1
(byte) main::line1_ch
(byte) main::line1_ch#0
(byte) main::line1_ch#1
(byte) main::line1_ch#2
(byte) main::line1_ch#3
(byte) main::line1_ch#4
(byte) main::line1_i
(byte) main::line1_i#0
(byte) main::line1_i#1
(byte) main::line1_i#2
(byte) main::line1_i#3
(byte) main::line1_i#4
(word) main::line1_pos
(word) main::line1_pos#0
(word) main::line1_pos#1
(word) main::line1_pos#2
(word) main::line1_pos#3
(word) main::line1_pos#4
(byte) main::line1_xadd
(byte) main::line1_xadd#0
(byte) main::line1_xadd#1
(byte) main::line1_xadd#2
(byte) main::line1_xadd#3
(byte) main::line1_xadd#4
(byte) main::line1_xpos
(byte) main::line1_xpos#0
(byte) main::line1_xpos#1
(byte) main::line1_ysize
(byte) main::line1_ysize#0
(byte) main::line1_ysize#1
(byte) main::line1_ysize#2
(byte) main::line1_ysize#3
(byte) main::line1_ysize#4
(label) main::line2
(byte~) main::line2_$0
(byte) main::line2_$0#0
(bool~) main::line2_$2
(bool) main::line2_$2#0
(label) main::line2_@1
(byte) main::line2_ch
(byte) main::line2_ch#0
(byte) main::line2_ch#1
(byte) main::line2_ch#2
(byte) main::line2_ch#3
(byte) main::line2_ch#4
(byte) main::line2_i
(byte) main::line2_i#0
(byte) main::line2_i#1
(byte) main::line2_i#2
(byte) main::line2_i#3
(byte) main::line2_i#4
(word) main::line2_pos
(word) main::line2_pos#0
(word) main::line2_pos#1
(word) main::line2_pos#2
(word) main::line2_pos#3
(word) main::line2_pos#4
(byte) main::line2_xadd
(byte) main::line2_xadd#0
(byte) main::line2_xadd#1
(byte) main::line2_xadd#2
(byte) main::line2_xadd#3
(byte) main::line2_xadd#4
(byte) main::line2_xpos
(byte) main::line2_xpos#0
(byte) main::line2_xpos#1
(byte) main::line2_ysize
(byte) main::line2_ysize#0
(byte) main::line2_ysize#1
(byte) main::line2_ysize#2
(byte) main::line2_ysize#3
(byte) main::line2_ysize#4
(label) main::plot1
(byte*~) main::plot1_$0
(byte*) main::plot1_$0#0
(byte) main::plot1_ch
(byte) main::plot1_ch#0
(byte) main::plot1_ch#1
(byte) main::plot1_xpos
(byte) main::plot1_xpos#0
(byte) main::plot1_xpos#1
(label) main::plot2
(byte*~) main::plot2_$0
(byte*) main::plot2_$0#0
(byte) main::plot2_ch
(byte) main::plot2_ch#0
(byte) main::plot2_ch#1
(byte) main::plot2_xpos
(byte) main::plot2_xpos#0
(byte) main::plot2_xpos#1
(byte*) main::sc
(byte*) main::sc#0
(byte*) main::sc#1
(byte*) main::sc#2
Alias (byte) main::line1_xpos#0 = (byte) main::line1_xpos#1
Alias (byte) main::line1_ch#0 = (byte) main::line1_ch#3
Alias (byte) main::line1_xadd#0 = (byte) main::line1_xadd#4
Alias (byte) main::line1_ysize#0 = (byte) main::line1_ysize#4
Alias (byte) main::plot1_xpos#0 = (byte) main::line1_$0#0 (byte) main::plot1_xpos#1
Alias (byte) main::line1_ch#1 = (byte) main::plot1_ch#0 (byte) main::plot1_ch#1 (byte) main::line1_ch#4 (byte) main::line1_ch#2
Alias (byte*) cur_line#13 = (byte*) cur_line#7 (byte*) cur_line#8
Alias (word) main::line1_pos#2 = (word) main::line1_pos#4 (word) main::line1_pos#3
Alias (byte) main::line1_xadd#1 = (byte) main::line1_xadd#2 (byte) main::line1_xadd#3
Alias (byte) main::line1_i#2 = (byte) main::line1_i#3 (byte) main::line1_i#4
Alias (byte) main::line1_ysize#1 = (byte) main::line1_ysize#2 (byte) main::line1_ysize#3
Alias (byte) main::line2_xpos#0 = (byte) main::line2_xpos#1
Alias (byte) main::line2_ch#0 = (byte) main::line2_ch#3
Alias (byte) main::line2_xadd#0 = (byte) main::line2_xadd#4
Alias (byte) main::line2_ysize#0 = (byte) main::line2_ysize#4
Alias (byte) main::plot2_xpos#0 = (byte) main::line2_$0#0 (byte) main::plot2_xpos#1
Alias (byte) main::line2_ch#1 = (byte) main::plot2_ch#0 (byte) main::plot2_ch#1 (byte) main::line2_ch#4 (byte) main::line2_ch#2
Alias (byte*) cur_line#10 = (byte*) cur_line#9 (byte*) cur_line#14
Alias (word) main::line2_pos#2 = (word) main::line2_pos#4 (word) main::line2_pos#3
Alias (byte) main::line2_xadd#1 = (byte) main::line2_xadd#2 (byte) main::line2_xadd#3
Alias (byte) main::line2_i#2 = (byte) main::line2_i#3 (byte) main::line2_i#4
Alias (byte) main::line2_ysize#1 = (byte) main::line2_ysize#2 (byte) main::line2_ysize#3
Alias (byte*) cur_line#11 = (byte*) cur_line#3 (byte*) cur_line#4
Alias (byte*) cur_line#15 = (byte*) cur_line#5
Alias (byte*) cur_line#12 = (byte*) cur_line#6
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte) main::line1_ch#1
Self Phi Eliminated (byte) main::line1_xadd#1
Self Phi Eliminated (byte) main::line1_ysize#1
Self Phi Eliminated (byte) main::line2_ch#1
Self Phi Eliminated (byte) main::line2_xadd#1
Self Phi Eliminated (byte) main::line2_ysize#1
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte) main::line1_ch#1 (byte) main::line1_ch#0
Redundant Phi (byte) main::line1_xadd#1 (byte) main::line1_xadd#0
Redundant Phi (byte) main::line1_ysize#1 (byte) main::line1_ysize#0
Redundant Phi (byte) main::line2_ch#1 (byte) main::line2_ch#0
Redundant Phi (byte) main::line2_xadd#1 (byte) main::line2_xadd#0
Redundant Phi (byte) main::line2_ysize#1 (byte) main::line2_ysize#0
Redundant Phi (byte*) cur_line#12 (byte*) cur_line#11
Successful SSA optimization Pass2RedundantPhiElimination
Simple Condition (bool~) main::$3 [6] if((byte*) main::sc#1<(word/signed word/dword/signed dword~) main::$2) goto main::@1
Simple Condition (bool) main::line1_$2#0 [27] if((byte) main::line1_i#1<(byte) main::line1_ysize#0) goto main::line1_@1
Simple Condition (bool) main::line2_$2#0 [48] if((byte) main::line2_i#1<(byte) main::line2_ysize#0) goto main::line2_@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) main::sc#0 = ((byte*))$400
Constant (const word/signed word/dword/signed dword) main::$2 = $400+$3e8
Constant (const byte) main::line1_xpos#0 = 2
Constant (const byte) main::line1_xadd#0 = $40
Constant (const byte) main::line1_ysize#0 = $a
Constant (const byte) main::line1_ch#0 = '*'
Constant (const byte*) cur_line#0 = ((byte*))$400
Constant (const byte) main::line1_i#0 = 0
Constant (const byte) main::line2_xpos#0 = 4
Constant (const byte) main::line2_xadd#0 = $80
Constant (const byte) main::line2_ysize#0 = $f
Constant (const byte) main::line2_ch#0 = '.'
Constant (const byte*) cur_line#2 = ((byte*))$400
Constant (const byte) main::line2_i#0 = 0
Constant (const byte*) cur_line#15 = ((byte*))$400
Successful SSA optimization Pass2ConstantIdentification
Fixing inline constructor with main::$4 ← main::line1_xpos#0 w= 0
Fixing inline constructor with main::$5 ← main::line2_xpos#0 w= 0
Successful SSA optimization Pass2FixInlineConstructors
Inferred type updated to word/signed word/dword/signed dword in (word~) main::$4 ← (const byte) main::line1_xpos#0 w= (byte/signed byte/word/signed word/dword/signed dword) 0
Inferred type updated to word/signed word/dword/signed dword in (word~) main::$5 ← (const byte) main::line2_xpos#0 w= (byte/signed byte/word/signed word/dword/signed dword) 0
Eliminating unused constant (const byte*) cur_line#15
Successful SSA optimization PassNEliminateUnusedVars
Converting *(pointer+n) to pointer[n] *((byte*) main::plot1_$0#0) ← (const byte) main::line1_ch#0 -- *(cur_line#13 + main::plot1_xpos#0)
Converting *(pointer+n) to pointer[n] *((byte*) main::plot2_$0#0) ← (const byte) main::line2_ch#0 -- *(cur_line#10 + main::plot2_xpos#0)
Successful SSA optimization Pass2InlineDerefIdx
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@3
Culled Empty Block (label) @1
Culled Empty Block (label) @4
Successful SSA optimization Pass2CullEmptyBlocks
Alias (word) main::line1_pos#0 = (word/signed word/dword/signed dword~) main::$4
Alias (word) main::line2_pos#0 = (word/signed word/dword/signed dword~) main::$5
Successful SSA optimization Pass2AliasElimination
Constant (const word) main::line1_pos#0 = main::line1_xpos#0*$100+0
Constant (const word) main::line2_pos#0 = main::line2_xpos#0*$100+0
Successful SSA optimization Pass2ConstantIdentification
Eliminating unused variable (byte*) main::plot1_$0#0 and assignment [6] (byte*) main::plot1_$0#0 ← (byte*) cur_line#13 + (byte) main::plot1_xpos#0
Eliminating unused variable (byte*) main::plot2_$0#0 and assignment [14] (byte*) main::plot2_$0#0 ← (byte*) cur_line#10 + (byte) main::plot2_xpos#0
Successful SSA optimization PassNEliminateUnusedVars
Inlining constant with var siblings (const byte*) main::sc#0
Inlining constant with var siblings (const byte) main::line1_i#0
Inlining constant with var siblings (const byte) main::line2_i#0
Inlining constant with var siblings (const word) main::line1_pos#0
Inlining constant with var siblings (const word) main::line2_pos#0
Inlining constant with var siblings (const byte*) cur_line#0
Inlining constant with var siblings (const byte*) cur_line#2
Constant inlined main::$2 = (word/signed word/dword/signed dword) $400+(word/signed word/dword/signed dword) $3e8
Constant inlined main::line2_i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::line1_i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::line2_pos#0 = (const byte) main::line2_xpos#0*(word/signed word/dword/signed dword) $100+(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined cur_line#0 = ((byte*))(word/signed word/dword/signed dword) $400
Constant inlined main::sc#0 = ((byte*))(word/signed word/dword/signed dword) $400
Constant inlined cur_line#2 = ((byte*))(word/signed word/dword/signed dword) $400
Constant inlined main::line1_pos#0 = (const byte) main::line1_xpos#0*(word/signed word/dword/signed dword) $100+(byte/signed byte/word/signed word/dword/signed dword) 0
Successful SSA optimization Pass2ConstantInlining
Simplifying constant plus zero main::line1_xpos#0*$100+0
Simplifying constant plus zero main::line2_xpos#0*$100+0
Added new block during phi lifting main::@7(between main::@1 and main::@1)
Added new block during phi lifting main::@8(between main::@4 and main::line1_@1)
Added new block during phi lifting main::@9(between main::@6 and main::line2_@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::line1
Adding NOP phi() at start of main::line2
CALL GRAPH
Calls in [] to main:2
Created 7 initial phi equivalence classes
Coalesced [26] main::line2_pos#5 ← main::line2_pos#1
Coalesced [27] cur_line#17 ← cur_line#11
Coalesced [28] main::line2_i#5 ← main::line2_i#1
Coalesced [29] main::line1_pos#5 ← main::line1_pos#1
Coalesced [30] cur_line#16 ← cur_line#1
Coalesced [31] main::line1_i#5 ← main::line1_i#1
Coalesced [32] main::sc#3 ← main::sc#1
Coalesced down to 7 phi equivalence classes
Culled Empty Block (label) main::@9
Culled Empty Block (label) main::@8
Culled Empty Block (label) main::@7
Renumbering block @3 to @1
Renumbering block main::@4 to main::@2
Renumbering block main::@6 to main::@3
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::line1
Adding NOP phi() at start of main::line2
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()
to:main::@1
main::@1: scope:[main] from main main::@1
[5] (byte*) main::sc#2 ← phi( main/((byte*))(word/signed word/dword/signed dword) $400 main::@1/(byte*) main::sc#1 )
[6] *((byte*) main::sc#2) ← (byte) ' '
[7] (byte*) main::sc#1 ← ++ (byte*) main::sc#2
[8] if((byte*) main::sc#1<(word/signed word/dword/signed dword) $400+(word/signed word/dword/signed dword) $3e8) goto main::@1
to:main::line1
main::line1: scope:[main] from main::@1
[9] phi()
to:main::line1_@1
main::line1_@1: scope:[main] from main::@2 main::line1
[10] (byte) main::line1_i#2 ← phi( main::@2/(byte) main::line1_i#1 main::line1/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[10] (byte*) cur_line#13 ← phi( main::@2/(byte*) cur_line#1 main::line1/((byte*))(word/signed word/dword/signed dword) $400 )
[10] (word) main::line1_pos#2 ← phi( main::@2/(word) main::line1_pos#1 main::line1/(const byte) main::line1_xpos#0*(word/signed word/dword/signed dword) $100 )
[11] (byte) main::plot1_xpos#0 ← > (word) main::line1_pos#2
to:main::plot1
main::plot1: scope:[main] from main::line1_@1
[12] *((byte*) cur_line#13 + (byte) main::plot1_xpos#0) ← (const byte) main::line1_ch#0
to:main::@2
main::@2: scope:[main] from main::plot1
[13] (word) main::line1_pos#1 ← (word) main::line1_pos#2 + (const byte) main::line1_xadd#0
[14] (byte*) cur_line#1 ← (byte*) cur_line#13 + (byte/signed byte/word/signed word/dword/signed dword) $28
[15] (byte) main::line1_i#1 ← ++ (byte) main::line1_i#2
[16] if((byte) main::line1_i#1<(const byte) main::line1_ysize#0) goto main::line1_@1
to:main::line2
main::line2: scope:[main] from main::@2
[17] phi()
to:main::line2_@1
main::line2_@1: scope:[main] from main::@3 main::line2
[18] (byte) main::line2_i#2 ← phi( main::@3/(byte) main::line2_i#1 main::line2/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[18] (byte*) cur_line#10 ← phi( main::@3/(byte*) cur_line#11 main::line2/((byte*))(word/signed word/dword/signed dword) $400 )
[18] (word) main::line2_pos#2 ← phi( main::@3/(word) main::line2_pos#1 main::line2/(const byte) main::line2_xpos#0*(word/signed word/dword/signed dword) $100 )
[19] (byte) main::plot2_xpos#0 ← > (word) main::line2_pos#2
to:main::plot2
main::plot2: scope:[main] from main::line2_@1
[20] *((byte*) cur_line#10 + (byte) main::plot2_xpos#0) ← (const byte) main::line2_ch#0
to:main::@3
main::@3: scope:[main] from main::plot2
[21] (word) main::line2_pos#1 ← (word) main::line2_pos#2 + (const byte) main::line2_xadd#0
[22] (byte*) cur_line#11 ← (byte*) cur_line#10 + (byte/signed byte/word/signed word/dword/signed dword) $28
[23] (byte) main::line2_i#1 ← ++ (byte) main::line2_i#2
[24] if((byte) main::line2_i#1<(const byte) main::line2_ysize#0) goto main::line2_@1
to:main::@return
main::@return: scope:[main] from main::@3
[25] return
to:@return
VARIABLE REGISTER WEIGHTS
(byte*) cur_line
(byte*) cur_line#1 7.333333333333333
(byte*) cur_line#10 8.25
(byte*) cur_line#11 7.333333333333333
(byte*) cur_line#13 8.25
(void()) main()
(byte~) main::line1_$0
(bool~) main::line1_$2
(byte) main::line1_ch
(byte) main::line1_i
(byte) main::line1_i#1 16.5
(byte) main::line1_i#2 4.4
(word) main::line1_pos
(word) main::line1_pos#1 5.5
(word) main::line1_pos#2 11.0
(byte) main::line1_xadd
(byte) main::line1_xpos
(byte) main::line1_ysize
(byte~) main::line2_$0
(bool~) main::line2_$2
(byte) main::line2_ch
(byte) main::line2_i
(byte) main::line2_i#1 16.5
(byte) main::line2_i#2 4.4
(word) main::line2_pos
(word) main::line2_pos#1 5.5
(word) main::line2_pos#2 11.0
(byte) main::line2_xadd
(byte) main::line2_xpos
(byte) main::line2_ysize
(byte*~) main::plot1_$0
(byte) main::plot1_ch
(byte) main::plot1_xpos
(byte) main::plot1_xpos#0 22.0
(byte*~) main::plot2_$0
(byte) main::plot2_ch
(byte) main::plot2_xpos
(byte) main::plot2_xpos#0 22.0
(byte*) main::sc
(byte*) main::sc#1 16.5
(byte*) main::sc#2 16.5
Initial phi equivalence classes
[ main::sc#2 main::sc#1 ]
[ main::line1_pos#2 main::line1_pos#1 ]
[ cur_line#13 cur_line#1 ]
[ main::line1_i#2 main::line1_i#1 ]
[ main::line2_pos#2 main::line2_pos#1 ]
[ cur_line#10 cur_line#11 ]
[ main::line2_i#2 main::line2_i#1 ]
Added variable main::plot1_xpos#0 to zero page equivalence class [ main::plot1_xpos#0 ]
Added variable main::plot2_xpos#0 to zero page equivalence class [ main::plot2_xpos#0 ]
Complete equivalence classes
[ main::sc#2 main::sc#1 ]
[ main::line1_pos#2 main::line1_pos#1 ]
[ cur_line#13 cur_line#1 ]
[ main::line1_i#2 main::line1_i#1 ]
[ main::line2_pos#2 main::line2_pos#1 ]
[ cur_line#10 cur_line#11 ]
[ main::line2_i#2 main::line2_i#1 ]
[ main::plot1_xpos#0 ]
[ main::plot2_xpos#0 ]
Allocated zp ZP_WORD:2 [ main::sc#2 main::sc#1 ]
Allocated zp ZP_WORD:4 [ main::line1_pos#2 main::line1_pos#1 ]
Allocated zp ZP_WORD:6 [ cur_line#13 cur_line#1 ]
Allocated zp ZP_BYTE:8 [ main::line1_i#2 main::line1_i#1 ]
Allocated zp ZP_WORD:9 [ main::line2_pos#2 main::line2_pos#1 ]
Allocated zp ZP_WORD:11 [ cur_line#10 cur_line#11 ]
Allocated zp ZP_BYTE:13 [ main::line2_i#2 main::line2_i#1 ]
Allocated zp ZP_BYTE:14 [ main::plot1_xpos#0 ]
Allocated zp ZP_BYTE:15 [ main::plot2_xpos#0 ]
INITIAL ASM
//SEG0 File Comments
// Inline functions in two levels
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.label cur_line = 6
.label cur_line_10 = $b
.label cur_line_11 = $b
//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: {
.const line1_xpos = 2
.const line1_xadd = $40
.const line1_ysize = $a
.const line1_ch = '*'
.const line2_xpos = 4
.const line2_xadd = $80
.const line2_ysize = $f
.const line2_ch = '.'
.label sc = 2
.label plot1_xpos = $e
.label line1_pos = 4
.label line1_i = 8
.label plot2_xpos = $f
.label line2_pos = 9
.label line2_i = $d
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte*) main::sc#2 = ((byte*))(word/signed word/dword/signed dword) $400 [phi:main->main::@1#0] -- pbuz1=pbuc1
lda #<$400
sta sc
lda #>$400
sta sc+1
jmp b1
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
b1_from_b1:
//SEG14 [5] phi (byte*) main::sc#2 = (byte*) main::sc#1 [phi:main::@1->main::@1#0] -- register_copy
jmp b1
//SEG15 main::@1
b1:
//SEG16 [6] *((byte*) main::sc#2) ← (byte) ' ' -- _deref_pbuz1=vbuc1
lda #' '
ldy #0
sta (sc),y
//SEG17 [7] (byte*) main::sc#1 ← ++ (byte*) main::sc#2 -- pbuz1=_inc_pbuz1
inc sc
bne !+
inc sc+1
!:
//SEG18 [8] if((byte*) main::sc#1<(word/signed word/dword/signed dword) $400+(word/signed word/dword/signed dword) $3e8) goto main::@1 -- pbuz1_lt_vwuc1_then_la1
lda sc+1
cmp #>$400+$3e8
bcc b1_from_b1
bne !+
lda sc
cmp #<$400+$3e8
bcc b1_from_b1
!:
//SEG19 [9] phi from main::@1 to main::line1 [phi:main::@1->main::line1]
line1_from_b1:
jmp line1
//SEG20 main::line1
line1:
//SEG21 [10] phi from main::line1 to main::line1_@1 [phi:main::line1->main::line1_@1]
line1_b1_from_line1:
//SEG22 [10] phi (byte) main::line1_i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::line1->main::line1_@1#0] -- vbuz1=vbuc1
lda #0
sta line1_i
//SEG23 [10] phi (byte*) cur_line#13 = ((byte*))(word/signed word/dword/signed dword) $400 [phi:main::line1->main::line1_@1#1] -- pbuz1=pbuc1
lda #<$400
sta cur_line
lda #>$400
sta cur_line+1
//SEG24 [10] phi (word) main::line1_pos#2 = (const byte) main::line1_xpos#0*(word/signed word/dword/signed dword) $100 [phi:main::line1->main::line1_@1#2] -- vwuz1=vwuc1
lda #<line1_xpos*$100
sta line1_pos
lda #>line1_xpos*$100
sta line1_pos+1
jmp line1_b1
//SEG25 [10] phi from main::@2 to main::line1_@1 [phi:main::@2->main::line1_@1]
line1_b1_from_b2:
//SEG26 [10] phi (byte) main::line1_i#2 = (byte) main::line1_i#1 [phi:main::@2->main::line1_@1#0] -- register_copy
//SEG27 [10] phi (byte*) cur_line#13 = (byte*) cur_line#1 [phi:main::@2->main::line1_@1#1] -- register_copy
//SEG28 [10] phi (word) main::line1_pos#2 = (word) main::line1_pos#1 [phi:main::@2->main::line1_@1#2] -- register_copy
jmp line1_b1
//SEG29 main::line1_@1
line1_b1:
//SEG30 [11] (byte) main::plot1_xpos#0 ← > (word) main::line1_pos#2 -- vbuz1=_hi_vwuz2
lda line1_pos+1
sta plot1_xpos
jmp plot1
//SEG31 main::plot1
plot1:
//SEG32 [12] *((byte*) cur_line#13 + (byte) main::plot1_xpos#0) ← (const byte) main::line1_ch#0 -- pbuz1_derefidx_vbuz2=vbuc1
lda #line1_ch
ldy plot1_xpos
sta (cur_line),y
jmp b2
//SEG33 main::@2
b2:
//SEG34 [13] (word) main::line1_pos#1 ← (word) main::line1_pos#2 + (const byte) main::line1_xadd#0 -- vwuz1=vwuz1_plus_vbuc1
lda #line1_xadd
clc
adc line1_pos
sta line1_pos
bcc !+
inc line1_pos+1
!:
//SEG35 [14] (byte*) cur_line#1 ← (byte*) cur_line#13 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc cur_line
sta cur_line
bcc !+
inc cur_line+1
!:
//SEG36 [15] (byte) main::line1_i#1 ← ++ (byte) main::line1_i#2 -- vbuz1=_inc_vbuz1
inc line1_i
//SEG37 [16] if((byte) main::line1_i#1<(const byte) main::line1_ysize#0) goto main::line1_@1 -- vbuz1_lt_vbuc1_then_la1
lda line1_i
cmp #line1_ysize
bcc line1_b1_from_b2
//SEG38 [17] phi from main::@2 to main::line2 [phi:main::@2->main::line2]
line2_from_b2:
jmp line2
//SEG39 main::line2
line2:
//SEG40 [18] phi from main::line2 to main::line2_@1 [phi:main::line2->main::line2_@1]
line2_b1_from_line2:
//SEG41 [18] phi (byte) main::line2_i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::line2->main::line2_@1#0] -- vbuz1=vbuc1
lda #0
sta line2_i
//SEG42 [18] phi (byte*) cur_line#10 = ((byte*))(word/signed word/dword/signed dword) $400 [phi:main::line2->main::line2_@1#1] -- pbuz1=pbuc1
lda #<$400
sta cur_line_10
lda #>$400
sta cur_line_10+1
//SEG43 [18] phi (word) main::line2_pos#2 = (const byte) main::line2_xpos#0*(word/signed word/dword/signed dword) $100 [phi:main::line2->main::line2_@1#2] -- vwuz1=vwuc1
lda #<line2_xpos*$100
sta line2_pos
lda #>line2_xpos*$100
sta line2_pos+1
jmp line2_b1
//SEG44 [18] phi from main::@3 to main::line2_@1 [phi:main::@3->main::line2_@1]
line2_b1_from_b3:
//SEG45 [18] phi (byte) main::line2_i#2 = (byte) main::line2_i#1 [phi:main::@3->main::line2_@1#0] -- register_copy
//SEG46 [18] phi (byte*) cur_line#10 = (byte*) cur_line#11 [phi:main::@3->main::line2_@1#1] -- register_copy
//SEG47 [18] phi (word) main::line2_pos#2 = (word) main::line2_pos#1 [phi:main::@3->main::line2_@1#2] -- register_copy
jmp line2_b1
//SEG48 main::line2_@1
line2_b1:
//SEG49 [19] (byte) main::plot2_xpos#0 ← > (word) main::line2_pos#2 -- vbuz1=_hi_vwuz2
lda line2_pos+1
sta plot2_xpos
jmp plot2
//SEG50 main::plot2
plot2:
//SEG51 [20] *((byte*) cur_line#10 + (byte) main::plot2_xpos#0) ← (const byte) main::line2_ch#0 -- pbuz1_derefidx_vbuz2=vbuc1
lda #line2_ch
ldy plot2_xpos
sta (cur_line_10),y
jmp b3
//SEG52 main::@3
b3:
//SEG53 [21] (word) main::line2_pos#1 ← (word) main::line2_pos#2 + (const byte) main::line2_xadd#0 -- vwuz1=vwuz1_plus_vbuc1
lda #line2_xadd
clc
adc line2_pos
sta line2_pos
bcc !+
inc line2_pos+1
!:
//SEG54 [22] (byte*) cur_line#11 ← (byte*) cur_line#10 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc cur_line_11
sta cur_line_11
bcc !+
inc cur_line_11+1
!:
//SEG55 [23] (byte) main::line2_i#1 ← ++ (byte) main::line2_i#2 -- vbuz1=_inc_vbuz1
inc line2_i
//SEG56 [24] if((byte) main::line2_i#1<(const byte) main::line2_ysize#0) goto main::line2_@1 -- vbuz1_lt_vbuc1_then_la1
lda line2_i
cmp #line2_ysize
bcc line2_b1_from_b3
jmp breturn
//SEG57 main::@return
breturn:
//SEG58 [25] return
rts
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [6] *((byte*) main::sc#2) ← (byte) ' ' [ main::sc#2 ] ( main:2 [ main::sc#2 ] ) always clobbers reg byte a reg byte y
Statement [8] if((byte*) main::sc#1<(word/signed word/dword/signed dword) $400+(word/signed word/dword/signed dword) $3e8) goto main::@1 [ main::sc#1 ] ( main:2 [ main::sc#1 ] ) always clobbers reg byte a
Statement [11] (byte) main::plot1_xpos#0 ← > (word) main::line1_pos#2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 main::plot1_xpos#0 ] ( main:2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 main::plot1_xpos#0 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:8 [ main::line1_i#2 main::line1_i#1 ]
Statement [12] *((byte*) cur_line#13 + (byte) main::plot1_xpos#0) ← (const byte) main::line1_ch#0 [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ( main:2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ) always clobbers reg byte a
Statement [13] (word) main::line1_pos#1 ← (word) main::line1_pos#2 + (const byte) main::line1_xadd#0 [ cur_line#13 main::line1_i#2 main::line1_pos#1 ] ( main:2 [ cur_line#13 main::line1_i#2 main::line1_pos#1 ] ) always clobbers reg byte a
Statement [14] (byte*) cur_line#1 ← (byte*) cur_line#13 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::line1_i#2 main::line1_pos#1 cur_line#1 ] ( main:2 [ main::line1_i#2 main::line1_pos#1 cur_line#1 ] ) always clobbers reg byte a
Statement [19] (byte) main::plot2_xpos#0 ← > (word) main::line2_pos#2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 main::plot2_xpos#0 ] ( main:2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 main::plot2_xpos#0 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:13 [ main::line2_i#2 main::line2_i#1 ]
Statement [20] *((byte*) cur_line#10 + (byte) main::plot2_xpos#0) ← (const byte) main::line2_ch#0 [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ( main:2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ) always clobbers reg byte a
Statement [21] (word) main::line2_pos#1 ← (word) main::line2_pos#2 + (const byte) main::line2_xadd#0 [ cur_line#10 main::line2_i#2 main::line2_pos#1 ] ( main:2 [ cur_line#10 main::line2_i#2 main::line2_pos#1 ] ) always clobbers reg byte a
Statement [22] (byte*) cur_line#11 ← (byte*) cur_line#10 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::line2_i#2 main::line2_pos#1 cur_line#11 ] ( main:2 [ main::line2_i#2 main::line2_pos#1 cur_line#11 ] ) always clobbers reg byte a
Statement [6] *((byte*) main::sc#2) ← (byte) ' ' [ main::sc#2 ] ( main:2 [ main::sc#2 ] ) always clobbers reg byte a reg byte y
Statement [8] if((byte*) main::sc#1<(word/signed word/dword/signed dword) $400+(word/signed word/dword/signed dword) $3e8) goto main::@1 [ main::sc#1 ] ( main:2 [ main::sc#1 ] ) always clobbers reg byte a
Statement [11] (byte) main::plot1_xpos#0 ← > (word) main::line1_pos#2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 main::plot1_xpos#0 ] ( main:2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 main::plot1_xpos#0 ] ) always clobbers reg byte a
Statement [12] *((byte*) cur_line#13 + (byte) main::plot1_xpos#0) ← (const byte) main::line1_ch#0 [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ( main:2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ) always clobbers reg byte a
Statement [13] (word) main::line1_pos#1 ← (word) main::line1_pos#2 + (const byte) main::line1_xadd#0 [ cur_line#13 main::line1_i#2 main::line1_pos#1 ] ( main:2 [ cur_line#13 main::line1_i#2 main::line1_pos#1 ] ) always clobbers reg byte a
Statement [14] (byte*) cur_line#1 ← (byte*) cur_line#13 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::line1_i#2 main::line1_pos#1 cur_line#1 ] ( main:2 [ main::line1_i#2 main::line1_pos#1 cur_line#1 ] ) always clobbers reg byte a
Statement [19] (byte) main::plot2_xpos#0 ← > (word) main::line2_pos#2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 main::plot2_xpos#0 ] ( main:2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 main::plot2_xpos#0 ] ) always clobbers reg byte a
Statement [20] *((byte*) cur_line#10 + (byte) main::plot2_xpos#0) ← (const byte) main::line2_ch#0 [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ( main:2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ) always clobbers reg byte a
Statement [21] (word) main::line2_pos#1 ← (word) main::line2_pos#2 + (const byte) main::line2_xadd#0 [ cur_line#10 main::line2_i#2 main::line2_pos#1 ] ( main:2 [ cur_line#10 main::line2_i#2 main::line2_pos#1 ] ) always clobbers reg byte a
Statement [22] (byte*) cur_line#11 ← (byte*) cur_line#10 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::line2_i#2 main::line2_pos#1 cur_line#11 ] ( main:2 [ main::line2_i#2 main::line2_pos#1 cur_line#11 ] ) always clobbers reg byte a
Potential registers zp ZP_WORD:2 [ main::sc#2 main::sc#1 ] : zp ZP_WORD:2 ,
Potential registers zp ZP_WORD:4 [ main::line1_pos#2 main::line1_pos#1 ] : zp ZP_WORD:4 ,
Potential registers zp ZP_WORD:6 [ cur_line#13 cur_line#1 ] : zp ZP_WORD:6 ,
Potential registers zp ZP_BYTE:8 [ main::line1_i#2 main::line1_i#1 ] : zp ZP_BYTE:8 , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:9 [ main::line2_pos#2 main::line2_pos#1 ] : zp ZP_WORD:9 ,
Potential registers zp ZP_WORD:11 [ cur_line#10 cur_line#11 ] : zp ZP_WORD:11 ,
Potential registers zp ZP_BYTE:13 [ main::line2_i#2 main::line2_i#1 ] : zp ZP_BYTE:13 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:14 [ main::plot1_xpos#0 ] : zp ZP_BYTE:14 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:15 [ main::plot2_xpos#0 ] : zp ZP_BYTE:15 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 33: zp ZP_WORD:2 [ main::sc#2 main::sc#1 ] 22: zp ZP_BYTE:14 [ main::plot1_xpos#0 ] 22: zp ZP_BYTE:15 [ main::plot2_xpos#0 ] 20.9: zp ZP_BYTE:8 [ main::line1_i#2 main::line1_i#1 ] 20.9: zp ZP_BYTE:13 [ main::line2_i#2 main::line2_i#1 ] 16.5: zp ZP_WORD:4 [ main::line1_pos#2 main::line1_pos#1 ] 16.5: zp ZP_WORD:9 [ main::line2_pos#2 main::line2_pos#1 ]
Uplift Scope [] 15.58: zp ZP_WORD:6 [ cur_line#13 cur_line#1 ] 15.58: zp ZP_WORD:11 [ cur_line#10 cur_line#11 ]
Uplifting [main] best 2384 combination zp ZP_WORD:2 [ main::sc#2 main::sc#1 ] reg byte a [ main::plot1_xpos#0 ] reg byte a [ main::plot2_xpos#0 ] reg byte x [ main::line1_i#2 main::line1_i#1 ] reg byte x [ main::line2_i#2 main::line2_i#1 ] zp ZP_WORD:4 [ main::line1_pos#2 main::line1_pos#1 ] zp ZP_WORD:9 [ main::line2_pos#2 main::line2_pos#1 ]
Limited combination testing to 100 combinations of 144 possible.
Uplifting [] best 2384 combination zp ZP_WORD:6 [ cur_line#13 cur_line#1 ] zp ZP_WORD:11 [ cur_line#10 cur_line#11 ]
Coalescing zero page register [ zp ZP_WORD:2 [ main::sc#2 main::sc#1 ] ] with [ zp ZP_WORD:4 [ main::line1_pos#2 main::line1_pos#1 ] ]
Coalescing zero page register [ zp ZP_WORD:2 [ main::sc#2 main::sc#1 main::line1_pos#2 main::line1_pos#1 ] ] with [ zp ZP_WORD:9 [ main::line2_pos#2 main::line2_pos#1 ] ]
Coalescing zero page register [ zp ZP_WORD:6 [ cur_line#13 cur_line#1 ] ] with [ zp ZP_WORD:11 [ cur_line#10 cur_line#11 ] ]
Allocated (was zp ZP_WORD:6) zp ZP_WORD:4 [ cur_line#13 cur_line#1 cur_line#10 cur_line#11 ]
ASSEMBLER BEFORE OPTIMIZATION
//SEG0 File Comments
// Inline functions in two levels
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.label cur_line = 4
//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: {
.const line1_xpos = 2
.const line1_xadd = $40
.const line1_ysize = $a
.const line1_ch = '*'
.const line2_xpos = 4
.const line2_xadd = $80
.const line2_ysize = $f
.const line2_ch = '.'
.label sc = 2
.label line1_pos = 2
.label line2_pos = 2
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte*) main::sc#2 = ((byte*))(word/signed word/dword/signed dword) $400 [phi:main->main::@1#0] -- pbuz1=pbuc1
lda #<$400
sta sc
lda #>$400
sta sc+1
jmp b1
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
b1_from_b1:
//SEG14 [5] phi (byte*) main::sc#2 = (byte*) main::sc#1 [phi:main::@1->main::@1#0] -- register_copy
jmp b1
//SEG15 main::@1
b1:
//SEG16 [6] *((byte*) main::sc#2) ← (byte) ' ' -- _deref_pbuz1=vbuc1
lda #' '
ldy #0
sta (sc),y
//SEG17 [7] (byte*) main::sc#1 ← ++ (byte*) main::sc#2 -- pbuz1=_inc_pbuz1
inc sc
bne !+
inc sc+1
!:
//SEG18 [8] if((byte*) main::sc#1<(word/signed word/dword/signed dword) $400+(word/signed word/dword/signed dword) $3e8) goto main::@1 -- pbuz1_lt_vwuc1_then_la1
lda sc+1
cmp #>$400+$3e8
bcc b1_from_b1
bne !+
lda sc
cmp #<$400+$3e8
bcc b1_from_b1
!:
//SEG19 [9] phi from main::@1 to main::line1 [phi:main::@1->main::line1]
line1_from_b1:
jmp line1
//SEG20 main::line1
line1:
//SEG21 [10] phi from main::line1 to main::line1_@1 [phi:main::line1->main::line1_@1]
line1_b1_from_line1:
//SEG22 [10] phi (byte) main::line1_i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::line1->main::line1_@1#0] -- vbuxx=vbuc1
ldx #0
//SEG23 [10] phi (byte*) cur_line#13 = ((byte*))(word/signed word/dword/signed dword) $400 [phi:main::line1->main::line1_@1#1] -- pbuz1=pbuc1
lda #<$400
sta cur_line
lda #>$400
sta cur_line+1
//SEG24 [10] phi (word) main::line1_pos#2 = (const byte) main::line1_xpos#0*(word/signed word/dword/signed dword) $100 [phi:main::line1->main::line1_@1#2] -- vwuz1=vwuc1
lda #<line1_xpos*$100
sta line1_pos
lda #>line1_xpos*$100
sta line1_pos+1
jmp line1_b1
//SEG25 [10] phi from main::@2 to main::line1_@1 [phi:main::@2->main::line1_@1]
line1_b1_from_b2:
//SEG26 [10] phi (byte) main::line1_i#2 = (byte) main::line1_i#1 [phi:main::@2->main::line1_@1#0] -- register_copy
//SEG27 [10] phi (byte*) cur_line#13 = (byte*) cur_line#1 [phi:main::@2->main::line1_@1#1] -- register_copy
//SEG28 [10] phi (word) main::line1_pos#2 = (word) main::line1_pos#1 [phi:main::@2->main::line1_@1#2] -- register_copy
jmp line1_b1
//SEG29 main::line1_@1
line1_b1:
//SEG30 [11] (byte) main::plot1_xpos#0 ← > (word) main::line1_pos#2 -- vbuaa=_hi_vwuz1
lda line1_pos+1
jmp plot1
//SEG31 main::plot1
plot1:
//SEG32 [12] *((byte*) cur_line#13 + (byte) main::plot1_xpos#0) ← (const byte) main::line1_ch#0 -- pbuz1_derefidx_vbuaa=vbuc1
tay
lda #line1_ch
sta (cur_line),y
jmp b2
//SEG33 main::@2
b2:
//SEG34 [13] (word) main::line1_pos#1 ← (word) main::line1_pos#2 + (const byte) main::line1_xadd#0 -- vwuz1=vwuz1_plus_vbuc1
lda #line1_xadd
clc
adc line1_pos
sta line1_pos
bcc !+
inc line1_pos+1
!:
//SEG35 [14] (byte*) cur_line#1 ← (byte*) cur_line#13 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc cur_line
sta cur_line
bcc !+
inc cur_line+1
!:
//SEG36 [15] (byte) main::line1_i#1 ← ++ (byte) main::line1_i#2 -- vbuxx=_inc_vbuxx
inx
//SEG37 [16] if((byte) main::line1_i#1<(const byte) main::line1_ysize#0) goto main::line1_@1 -- vbuxx_lt_vbuc1_then_la1
cpx #line1_ysize
bcc line1_b1_from_b2
//SEG38 [17] phi from main::@2 to main::line2 [phi:main::@2->main::line2]
line2_from_b2:
jmp line2
//SEG39 main::line2
line2:
//SEG40 [18] phi from main::line2 to main::line2_@1 [phi:main::line2->main::line2_@1]
line2_b1_from_line2:
//SEG41 [18] phi (byte) main::line2_i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::line2->main::line2_@1#0] -- vbuxx=vbuc1
ldx #0
//SEG42 [18] phi (byte*) cur_line#10 = ((byte*))(word/signed word/dword/signed dword) $400 [phi:main::line2->main::line2_@1#1] -- pbuz1=pbuc1
lda #<$400
sta cur_line
lda #>$400
sta cur_line+1
//SEG43 [18] phi (word) main::line2_pos#2 = (const byte) main::line2_xpos#0*(word/signed word/dword/signed dword) $100 [phi:main::line2->main::line2_@1#2] -- vwuz1=vwuc1
lda #<line2_xpos*$100
sta line2_pos
lda #>line2_xpos*$100
sta line2_pos+1
jmp line2_b1
//SEG44 [18] phi from main::@3 to main::line2_@1 [phi:main::@3->main::line2_@1]
line2_b1_from_b3:
//SEG45 [18] phi (byte) main::line2_i#2 = (byte) main::line2_i#1 [phi:main::@3->main::line2_@1#0] -- register_copy
//SEG46 [18] phi (byte*) cur_line#10 = (byte*) cur_line#11 [phi:main::@3->main::line2_@1#1] -- register_copy
//SEG47 [18] phi (word) main::line2_pos#2 = (word) main::line2_pos#1 [phi:main::@3->main::line2_@1#2] -- register_copy
jmp line2_b1
//SEG48 main::line2_@1
line2_b1:
//SEG49 [19] (byte) main::plot2_xpos#0 ← > (word) main::line2_pos#2 -- vbuaa=_hi_vwuz1
lda line2_pos+1
jmp plot2
//SEG50 main::plot2
plot2:
//SEG51 [20] *((byte*) cur_line#10 + (byte) main::plot2_xpos#0) ← (const byte) main::line2_ch#0 -- pbuz1_derefidx_vbuaa=vbuc1
tay
lda #line2_ch
sta (cur_line),y
jmp b3
//SEG52 main::@3
b3:
//SEG53 [21] (word) main::line2_pos#1 ← (word) main::line2_pos#2 + (const byte) main::line2_xadd#0 -- vwuz1=vwuz1_plus_vbuc1
lda #line2_xadd
clc
adc line2_pos
sta line2_pos
bcc !+
inc line2_pos+1
!:
//SEG54 [22] (byte*) cur_line#11 ← (byte*) cur_line#10 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc cur_line
sta cur_line
bcc !+
inc cur_line+1
!:
//SEG55 [23] (byte) main::line2_i#1 ← ++ (byte) main::line2_i#2 -- vbuxx=_inc_vbuxx
inx
//SEG56 [24] if((byte) main::line2_i#1<(const byte) main::line2_ysize#0) goto main::line2_@1 -- vbuxx_lt_vbuc1_then_la1
cpx #line2_ysize
bcc line2_b1_from_b3
jmp breturn
//SEG57 main::@return
breturn:
//SEG58 [25] return
rts
}
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp line1
Removing instruction jmp line1_b1
Removing instruction jmp plot1
Removing instruction jmp b2
Removing instruction jmp line2
Removing instruction jmp line2_b1
Removing instruction jmp plot2
Removing instruction jmp b3
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label b1_from_b1 with b1
Replacing label b1_from_b1 with b1
Replacing label line1_b1_from_b2 with line1_b1
Replacing label line2_b1_from_b3 with line2_b1
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Removing instruction b1_from_b1:
Removing instruction line1_from_b1:
Removing instruction line1_b1_from_line1:
Removing instruction line1_b1_from_b2:
Removing instruction line2_from_b2:
Removing instruction line2_b1_from_line2:
Removing instruction line2_b1_from_b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction b1_from_main:
Removing instruction line1:
Removing instruction plot1:
Removing instruction b2:
Removing instruction line2:
Removing instruction plot2:
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 line1_b1
Removing instruction jmp line2_b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(byte*) cur_line
(byte*) cur_line#1 cur_line zp ZP_WORD:4 7.333333333333333
(byte*) cur_line#10 cur_line zp ZP_WORD:4 8.25
(byte*) cur_line#11 cur_line zp ZP_WORD:4 7.333333333333333
(byte*) cur_line#13 cur_line zp ZP_WORD:4 8.25
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
(label) main::line1
(byte~) main::line1_$0
(bool~) main::line1_$2
(label) main::line1_@1
(byte) main::line1_ch
(const byte) main::line1_ch#0 line1_ch = (byte) '*'
(byte) main::line1_i
(byte) main::line1_i#1 reg byte x 16.5
(byte) main::line1_i#2 reg byte x 4.4
(word) main::line1_pos
(word) main::line1_pos#1 line1_pos zp ZP_WORD:2 5.5
(word) main::line1_pos#2 line1_pos zp ZP_WORD:2 11.0
(byte) main::line1_xadd
(const byte) main::line1_xadd#0 line1_xadd = (byte/signed byte/word/signed word/dword/signed dword) $40
(byte) main::line1_xpos
(const byte) main::line1_xpos#0 line1_xpos = (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) main::line1_ysize
(const byte) main::line1_ysize#0 line1_ysize = (byte/signed byte/word/signed word/dword/signed dword) $a
(label) main::line2
(byte~) main::line2_$0
(bool~) main::line2_$2
(label) main::line2_@1
(byte) main::line2_ch
(const byte) main::line2_ch#0 line2_ch = (byte) '.'
(byte) main::line2_i
(byte) main::line2_i#1 reg byte x 16.5
(byte) main::line2_i#2 reg byte x 4.4
(word) main::line2_pos
(word) main::line2_pos#1 line2_pos zp ZP_WORD:2 5.5
(word) main::line2_pos#2 line2_pos zp ZP_WORD:2 11.0
(byte) main::line2_xadd
(const byte) main::line2_xadd#0 line2_xadd = (byte/word/signed word/dword/signed dword) $80
(byte) main::line2_xpos
(const byte) main::line2_xpos#0 line2_xpos = (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) main::line2_ysize
(const byte) main::line2_ysize#0 line2_ysize = (byte/signed byte/word/signed word/dword/signed dword) $f
(label) main::plot1
(byte*~) main::plot1_$0
(byte) main::plot1_ch
(byte) main::plot1_xpos
(byte) main::plot1_xpos#0 reg byte a 22.0
(label) main::plot2
(byte*~) main::plot2_$0
(byte) main::plot2_ch
(byte) main::plot2_xpos
(byte) main::plot2_xpos#0 reg byte a 22.0
(byte*) main::sc
(byte*) main::sc#1 sc zp ZP_WORD:2 16.5
(byte*) main::sc#2 sc zp ZP_WORD:2 16.5
zp ZP_WORD:2 [ main::sc#2 main::sc#1 main::line1_pos#2 main::line1_pos#1 main::line2_pos#2 main::line2_pos#1 ]
zp ZP_WORD:4 [ cur_line#13 cur_line#1 cur_line#10 cur_line#11 ]
reg byte x [ main::line1_i#2 main::line1_i#1 ]
reg byte x [ main::line2_i#2 main::line2_i#1 ]
reg byte a [ main::plot1_xpos#0 ]
reg byte a [ main::plot2_xpos#0 ]
FINAL ASSEMBLER
Score: 2036
//SEG0 File Comments
// Inline functions in two levels
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.label cur_line = 4
//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: {
.const line1_xpos = 2
.const line1_xadd = $40
.const line1_ysize = $a
.const line1_ch = '*'
.const line2_xpos = 4
.const line2_xadd = $80
.const line2_ysize = $f
.const line2_ch = '.'
.label sc = 2
.label line1_pos = 2
.label line2_pos = 2
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
//SEG12 [5] phi (byte*) main::sc#2 = ((byte*))(word/signed word/dword/signed dword) $400 [phi:main->main::@1#0] -- pbuz1=pbuc1
lda #<$400
sta sc
lda #>$400
sta sc+1
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
//SEG14 [5] phi (byte*) main::sc#2 = (byte*) main::sc#1 [phi:main::@1->main::@1#0] -- register_copy
//SEG15 main::@1
b1:
//SEG16 [6] *((byte*) main::sc#2) ← (byte) ' ' -- _deref_pbuz1=vbuc1
lda #' '
ldy #0
sta (sc),y
//SEG17 [7] (byte*) main::sc#1 ← ++ (byte*) main::sc#2 -- pbuz1=_inc_pbuz1
inc sc
bne !+
inc sc+1
!:
//SEG18 [8] if((byte*) main::sc#1<(word/signed word/dword/signed dword) $400+(word/signed word/dword/signed dword) $3e8) goto main::@1 -- pbuz1_lt_vwuc1_then_la1
lda sc+1
cmp #>$400+$3e8
bcc b1
bne !+
lda sc
cmp #<$400+$3e8
bcc b1
!:
//SEG19 [9] phi from main::@1 to main::line1 [phi:main::@1->main::line1]
//SEG20 main::line1
//SEG21 [10] phi from main::line1 to main::line1_@1 [phi:main::line1->main::line1_@1]
//SEG22 [10] phi (byte) main::line1_i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::line1->main::line1_@1#0] -- vbuxx=vbuc1
ldx #0
//SEG23 [10] phi (byte*) cur_line#13 = ((byte*))(word/signed word/dword/signed dword) $400 [phi:main::line1->main::line1_@1#1] -- pbuz1=pbuc1
lda #<$400
sta cur_line
lda #>$400
sta cur_line+1
//SEG24 [10] phi (word) main::line1_pos#2 = (const byte) main::line1_xpos#0*(word/signed word/dword/signed dword) $100 [phi:main::line1->main::line1_@1#2] -- vwuz1=vwuc1
lda #<line1_xpos*$100
sta line1_pos
lda #>line1_xpos*$100
sta line1_pos+1
//SEG25 [10] phi from main::@2 to main::line1_@1 [phi:main::@2->main::line1_@1]
//SEG26 [10] phi (byte) main::line1_i#2 = (byte) main::line1_i#1 [phi:main::@2->main::line1_@1#0] -- register_copy
//SEG27 [10] phi (byte*) cur_line#13 = (byte*) cur_line#1 [phi:main::@2->main::line1_@1#1] -- register_copy
//SEG28 [10] phi (word) main::line1_pos#2 = (word) main::line1_pos#1 [phi:main::@2->main::line1_@1#2] -- register_copy
//SEG29 main::line1_@1
line1_b1:
//SEG30 [11] (byte) main::plot1_xpos#0 ← > (word) main::line1_pos#2 -- vbuaa=_hi_vwuz1
lda line1_pos+1
//SEG31 main::plot1
//SEG32 [12] *((byte*) cur_line#13 + (byte) main::plot1_xpos#0) ← (const byte) main::line1_ch#0 -- pbuz1_derefidx_vbuaa=vbuc1
tay
lda #line1_ch
sta (cur_line),y
//SEG33 main::@2
//SEG34 [13] (word) main::line1_pos#1 ← (word) main::line1_pos#2 + (const byte) main::line1_xadd#0 -- vwuz1=vwuz1_plus_vbuc1
lda #line1_xadd
clc
adc line1_pos
sta line1_pos
bcc !+
inc line1_pos+1
!:
//SEG35 [14] (byte*) cur_line#1 ← (byte*) cur_line#13 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc cur_line
sta cur_line
bcc !+
inc cur_line+1
!:
//SEG36 [15] (byte) main::line1_i#1 ← ++ (byte) main::line1_i#2 -- vbuxx=_inc_vbuxx
inx
//SEG37 [16] if((byte) main::line1_i#1<(const byte) main::line1_ysize#0) goto main::line1_@1 -- vbuxx_lt_vbuc1_then_la1
cpx #line1_ysize
bcc line1_b1
//SEG38 [17] phi from main::@2 to main::line2 [phi:main::@2->main::line2]
//SEG39 main::line2
//SEG40 [18] phi from main::line2 to main::line2_@1 [phi:main::line2->main::line2_@1]
//SEG41 [18] phi (byte) main::line2_i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::line2->main::line2_@1#0] -- vbuxx=vbuc1
ldx #0
//SEG42 [18] phi (byte*) cur_line#10 = ((byte*))(word/signed word/dword/signed dword) $400 [phi:main::line2->main::line2_@1#1] -- pbuz1=pbuc1
lda #<$400
sta cur_line
lda #>$400
sta cur_line+1
//SEG43 [18] phi (word) main::line2_pos#2 = (const byte) main::line2_xpos#0*(word/signed word/dword/signed dword) $100 [phi:main::line2->main::line2_@1#2] -- vwuz1=vwuc1
lda #<line2_xpos*$100
sta line2_pos
lda #>line2_xpos*$100
sta line2_pos+1
//SEG44 [18] phi from main::@3 to main::line2_@1 [phi:main::@3->main::line2_@1]
//SEG45 [18] phi (byte) main::line2_i#2 = (byte) main::line2_i#1 [phi:main::@3->main::line2_@1#0] -- register_copy
//SEG46 [18] phi (byte*) cur_line#10 = (byte*) cur_line#11 [phi:main::@3->main::line2_@1#1] -- register_copy
//SEG47 [18] phi (word) main::line2_pos#2 = (word) main::line2_pos#1 [phi:main::@3->main::line2_@1#2] -- register_copy
//SEG48 main::line2_@1
line2_b1:
//SEG49 [19] (byte) main::plot2_xpos#0 ← > (word) main::line2_pos#2 -- vbuaa=_hi_vwuz1
lda line2_pos+1
//SEG50 main::plot2
//SEG51 [20] *((byte*) cur_line#10 + (byte) main::plot2_xpos#0) ← (const byte) main::line2_ch#0 -- pbuz1_derefidx_vbuaa=vbuc1
tay
lda #line2_ch
sta (cur_line),y
//SEG52 main::@3
//SEG53 [21] (word) main::line2_pos#1 ← (word) main::line2_pos#2 + (const byte) main::line2_xadd#0 -- vwuz1=vwuz1_plus_vbuc1
lda #line2_xadd
clc
adc line2_pos
sta line2_pos
bcc !+
inc line2_pos+1
!:
//SEG54 [22] (byte*) cur_line#11 ← (byte*) cur_line#10 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc cur_line
sta cur_line
bcc !+
inc cur_line+1
!:
//SEG55 [23] (byte) main::line2_i#1 ← ++ (byte) main::line2_i#2 -- vbuxx=_inc_vbuxx
inx
//SEG56 [24] if((byte) main::line2_i#1<(const byte) main::line2_ysize#0) goto main::line2_@1 -- vbuxx_lt_vbuc1_then_la1
cpx #line2_ysize
bcc line2_b1
//SEG57 main::@return
//SEG58 [25] return
rts
}