Culled Empty Block (label) main::@6
Culled Empty Block (label) main::@7
Culled Empty Block (label) main::@8
Culled Empty Block (label) main::@17
Culled Empty Block (label) main::@11
Culled Empty Block (label) main::@18
Culled Empty Block (label) main::@24

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@1
main: scope:[main]  from @1
  (byte*) main::screen#0 ← ((byte*)) (number) $400
  (byte*~) main::$0 ← (byte*) main::screen#0 + (number) $3e8
  (byte*) main::sc#0 ← (byte*) main::screen#0
  to:main::@1
main::@1: scope:[main]  from main main::@1
  (byte*) main::screen#2 ← phi( main/(byte*) main::screen#0 main::@1/(byte*) main::screen#2 )
  (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 + rangenext(main::screen#2,main::$0)
  (bool~) main::$1 ← (byte*) main::sc#1 != rangelast(main::screen#2,main::$0)
  if((bool~) main::$1) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@1
  (byte*) main::screen#16 ← phi( main::@1/(byte*) main::screen#2 )
  (byte[]) main::header#0 ← (const string) main::$15
  (byte) main::i#0 ← (number) 0
  to:main::@3
main::@3: scope:[main]  from main::@2 main::@4
  (byte*) main::screen#10 ← phi( main::@2/(byte*) main::screen#16 main::@4/(byte*) main::screen#3 )
  (byte) main::i#2 ← phi( main::@2/(byte) main::i#0 main::@4/(byte) main::i#1 )
  (bool~) main::$2 ← *((byte[]) main::header#0 + (byte) main::i#2) != (number) 0
  if((bool~) main::$2) goto main::@4
  to:main::@5
main::@4: scope:[main]  from main::@3
  (byte*) main::screen#3 ← phi( main::@3/(byte*) main::screen#10 )
  (byte) main::i#3 ← phi( main::@3/(byte) main::i#2 )
  *((byte*) main::screen#3 + (byte) main::i#3) ← *((byte[]) main::header#0 + (byte) main::i#3)
  (byte) main::i#1 ← ++ (byte) main::i#3
  to:main::@3
main::@5: scope:[main]  from main::@3
  (byte*) main::screen#18 ← phi( main::@3/(byte*) main::screen#10 )
  (byte) main::i1#0 ← (number) 0
  to:main::@9
main::@9: scope:[main]  from main::@16 main::@5
  (byte*) main::screen#11 ← phi( main::@16/(byte*) main::screen#17 main::@5/(byte*) main::screen#18 )
  (byte) main::i1#2 ← phi( main::@16/(byte) main::i1#1 main::@5/(byte) main::i1#0 )
  (bool~) main::$3 ← (byte) main::i1#2 <= (number) 9
  if((bool~) main::$3) goto main::@10
  to:main::@return
main::@10: scope:[main]  from main::@9
  (byte) main::i1#3 ← phi( main::@9/(byte) main::i1#2 )
  (byte*) main::screen#4 ← phi( main::@9/(byte*) main::screen#11 )
  (byte*) main::screen#1 ← (byte*) main::screen#4 + (number) $28
  (byte~) main::$4 ← (byte) '0' + (byte) main::i1#3
  *((byte*) main::screen#1 + (number) 0) ← (byte~) main::$4
  (bool~) main::$5 ← (byte) main::i1#3 < (number) 5
  (bool~) main::$6 ← ! (bool~) main::$5
  if((bool~) main::$6) goto main::@12
  to:main::@19
main::@12: scope:[main]  from main::@10 main::@19
  (byte*) main::screen#12 ← phi( main::@10/(byte*) main::screen#1 main::@19/(byte*) main::screen#5 )
  (byte) main::i1#4 ← phi( main::@10/(byte) main::i1#3 main::@19/(byte) main::i1#9 )
  (bool~) main::$7 ← (byte) main::i1#4 <= (number) 5
  (bool~) main::$8 ← ! (bool~) main::$7
  if((bool~) main::$8) goto main::@13
  to:main::@20
main::@19: scope:[main]  from main::@10
  (byte) main::i1#9 ← phi( main::@10/(byte) main::i1#3 )
  (byte*) main::screen#5 ← phi( main::@10/(byte*) main::screen#1 )
  *((byte*) main::screen#5 + (number) 2) ← (byte) '+'
  to:main::@12
main::@13: scope:[main]  from main::@12 main::@20
  (byte*) main::screen#13 ← phi( main::@12/(byte*) main::screen#12 main::@20/(byte*) main::screen#6 )
  (byte) main::i1#5 ← phi( main::@12/(byte) main::i1#4 main::@20/(byte) main::i1#10 )
  (bool~) main::$9 ← (byte) main::i1#5 == (number) 5
  (bool~) main::$10 ← ! (bool~) main::$9
  if((bool~) main::$10) goto main::@14
  to:main::@21
main::@20: scope:[main]  from main::@12
  (byte) main::i1#10 ← phi( main::@12/(byte) main::i1#4 )
  (byte*) main::screen#6 ← phi( main::@12/(byte*) main::screen#12 )
  *((byte*) main::screen#6 + (number) 5) ← (byte) '+'
  to:main::@13
main::@14: scope:[main]  from main::@13 main::@21
  (byte*) main::screen#14 ← phi( main::@13/(byte*) main::screen#13 main::@21/(byte*) main::screen#7 )
  (byte) main::i1#6 ← phi( main::@13/(byte) main::i1#5 main::@21/(byte) main::i1#11 )
  (bool~) main::$11 ← (byte) main::i1#6 >= (number) 5
  (bool~) main::$12 ← ! (bool~) main::$11
  if((bool~) main::$12) goto main::@15
  to:main::@22
main::@21: scope:[main]  from main::@13
  (byte) main::i1#11 ← phi( main::@13/(byte) main::i1#5 )
  (byte*) main::screen#7 ← phi( main::@13/(byte*) main::screen#13 )
  *((byte*) main::screen#7 + (number) 8) ← (byte) '+'
  to:main::@14
main::@15: scope:[main]  from main::@14 main::@22
  (byte*) main::screen#15 ← phi( main::@14/(byte*) main::screen#14 main::@22/(byte*) main::screen#8 )
  (byte) main::i1#7 ← phi( main::@14/(byte) main::i1#6 main::@22/(byte) main::i1#12 )
  (bool~) main::$13 ← (byte) main::i1#7 > (number) 5
  (bool~) main::$14 ← ! (bool~) main::$13
  if((bool~) main::$14) goto main::@16
  to:main::@23
main::@22: scope:[main]  from main::@14
  (byte) main::i1#12 ← phi( main::@14/(byte) main::i1#6 )
  (byte*) main::screen#8 ← phi( main::@14/(byte*) main::screen#14 )
  *((byte*) main::screen#8 + (number) $b) ← (byte) '+'
  to:main::@15
main::@16: scope:[main]  from main::@15 main::@23
  (byte*) main::screen#17 ← phi( main::@15/(byte*) main::screen#15 main::@23/(byte*) main::screen#9 )
  (byte) main::i1#8 ← phi( main::@15/(byte) main::i1#7 main::@23/(byte) main::i1#13 )
  (byte) main::i1#1 ← ++ (byte) main::i1#8
  to:main::@9
main::@23: scope:[main]  from main::@15
  (byte) main::i1#13 ← phi( main::@15/(byte) main::i1#7 )
  (byte*) main::screen#9 ← phi( main::@15/(byte*) main::screen#15 )
  *((byte*) main::screen#9 + (number) $e) ← (byte) '+'
  to:main::@16
main::@return: scope:[main]  from main::@9
  return 
  to:@return
@1: scope:[]  from @begin
  call main 
  to:@2
@2: scope:[]  from @1
  to:@end
@end: scope:[]  from @2

SYMBOL TABLE SSA
(label) @1
(label) @2
(label) @begin
(label) @end
(void()) main()
(byte*~) main::$0
(bool~) main::$1
(bool~) main::$10
(bool~) main::$11
(bool~) main::$12
(bool~) main::$13
(bool~) main::$14
(const string) main::$15 = (string) "  <  <= == >= >"
(bool~) main::$2
(bool~) main::$3
(byte~) main::$4
(bool~) main::$5
(bool~) main::$6
(bool~) main::$7
(bool~) main::$8
(bool~) main::$9
(label) main::@1
(label) main::@10
(label) main::@12
(label) main::@13
(label) main::@14
(label) main::@15
(label) main::@16
(label) main::@19
(label) main::@2
(label) main::@20
(label) main::@21
(label) main::@22
(label) main::@23
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@9
(label) main::@return
(byte[]) main::header
(byte[]) main::header#0
(byte) main::i
(byte) main::i#0
(byte) main::i#1
(byte) main::i#2
(byte) main::i#3
(byte) main::i1
(byte) main::i1#0
(byte) main::i1#1
(byte) main::i1#10
(byte) main::i1#11
(byte) main::i1#12
(byte) main::i1#13
(byte) main::i1#2
(byte) main::i1#3
(byte) main::i1#4
(byte) main::i1#5
(byte) main::i1#6
(byte) main::i1#7
(byte) main::i1#8
(byte) main::i1#9
(byte*) main::sc
(byte*) main::sc#0
(byte*) main::sc#1
(byte*) main::sc#2
(byte*) main::screen
(byte*) main::screen#0
(byte*) main::screen#1
(byte*) main::screen#10
(byte*) main::screen#11
(byte*) main::screen#12
(byte*) main::screen#13
(byte*) main::screen#14
(byte*) main::screen#15
(byte*) main::screen#16
(byte*) main::screen#17
(byte*) main::screen#18
(byte*) main::screen#2
(byte*) main::screen#3
(byte*) main::screen#4
(byte*) main::screen#5
(byte*) main::screen#6
(byte*) main::screen#7
(byte*) main::screen#8
(byte*) main::screen#9

Adding number conversion cast (unumber) $3e8 in (byte*~) main::$0 ← (byte*) main::screen#0 + (number) $3e8
Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) main::$2 ← *((byte[]) main::header#0 + (byte) main::i#2) != (number) 0
Adding number conversion cast (unumber) 0 in (byte) main::i1#0 ← (number) 0
Adding number conversion cast (unumber) 9 in (bool~) main::$3 ← (byte) main::i1#2 <= (number) 9
Adding number conversion cast (unumber) $28 in (byte*) main::screen#1 ← (byte*) main::screen#4 + (number) $28
Adding number conversion cast (unumber) 0 in *((byte*) main::screen#1 + (number) 0) ← (byte~) main::$4
Adding number conversion cast (unumber) 5 in (bool~) main::$5 ← (byte) main::i1#3 < (number) 5
Adding number conversion cast (unumber) 5 in (bool~) main::$7 ← (byte) main::i1#4 <= (number) 5
Adding number conversion cast (unumber) 2 in *((byte*) main::screen#5 + (number) 2) ← (byte) '+'
Adding number conversion cast (unumber) 5 in (bool~) main::$9 ← (byte) main::i1#5 == (number) 5
Adding number conversion cast (unumber) 5 in *((byte*) main::screen#6 + (number) 5) ← (byte) '+'
Adding number conversion cast (unumber) 5 in (bool~) main::$11 ← (byte) main::i1#6 >= (number) 5
Adding number conversion cast (unumber) 8 in *((byte*) main::screen#7 + (number) 8) ← (byte) '+'
Adding number conversion cast (unumber) 5 in (bool~) main::$13 ← (byte) main::i1#7 > (number) 5
Adding number conversion cast (unumber) $b in *((byte*) main::screen#8 + (number) $b) ← (byte) '+'
Adding number conversion cast (unumber) $e in *((byte*) main::screen#9 + (number) $e) ← (byte) '+'
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Inlining cast (byte) main::i#0 ← (unumber)(number) 0
Inlining cast (byte) main::i1#0 ← (unumber)(number) 0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $3e8
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 9
Simplifying constant integer cast $28
Simplifying constant integer cast 0
Simplifying constant integer cast 5
Simplifying constant integer cast 5
Simplifying constant integer cast 2
Simplifying constant integer cast 5
Simplifying constant integer cast 5
Simplifying constant integer cast 5
Simplifying constant integer cast 8
Simplifying constant integer cast 5
Simplifying constant integer cast $b
Simplifying constant integer cast $e
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (word) $3e8
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 9
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 5
Finalized unsigned number type (byte) 5
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 5
Finalized unsigned number type (byte) 5
Finalized unsigned number type (byte) 5
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 5
Finalized unsigned number type (byte) $b
Finalized unsigned number type (byte) $e
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inversing boolean not [27] (bool~) main::$6 ← (byte) main::i1#3 >= (byte) 5 from [26] (bool~) main::$5 ← (byte) main::i1#3 < (byte) 5
Inversing boolean not [31] (bool~) main::$8 ← (byte) main::i1#4 > (byte) 5 from [30] (bool~) main::$7 ← (byte) main::i1#4 <= (byte) 5
Inversing boolean not [37] (bool~) main::$10 ← (byte) main::i1#5 != (byte) 5 from [36] (bool~) main::$9 ← (byte) main::i1#5 == (byte) 5
Inversing boolean not [43] (bool~) main::$12 ← (byte) main::i1#6 < (byte) 5 from [42] (bool~) main::$11 ← (byte) main::i1#6 >= (byte) 5
Inversing boolean not [49] (bool~) main::$14 ← (byte) main::i1#7 <= (byte) 5 from [48] (bool~) main::$13 ← (byte) main::i1#7 > (byte) 5
Successful SSA optimization Pass2UnaryNotSimplification
Alias (byte*) main::sc#0 = (byte*) main::screen#0 
Alias (byte*) main::screen#16 = (byte*) main::screen#2 
Alias (byte) main::i#2 = (byte) main::i#3 
Alias (byte*) main::screen#10 = (byte*) main::screen#3 (byte*) main::screen#18 
Alias (byte*) main::screen#11 = (byte*) main::screen#4 
Alias (byte) main::i1#2 = (byte) main::i1#3 (byte) main::i1#9 
Alias (byte*) main::screen#1 = (byte*) main::screen#5 
Alias (byte*) main::screen#12 = (byte*) main::screen#6 
Alias (byte) main::i1#10 = (byte) main::i1#4 
Alias (byte*) main::screen#13 = (byte*) main::screen#7 
Alias (byte) main::i1#11 = (byte) main::i1#5 
Alias (byte*) main::screen#14 = (byte*) main::screen#8 
Alias (byte) main::i1#12 = (byte) main::i1#6 
Alias (byte*) main::screen#15 = (byte*) main::screen#9 
Alias (byte) main::i1#13 = (byte) main::i1#7 
Successful SSA optimization Pass2AliasElimination
Alias (byte) main::i1#10 = (byte) main::i1#2 (byte) main::i1#11 (byte) main::i1#12 (byte) main::i1#13 (byte) main::i1#8 
Alias (byte*) main::screen#1 = (byte*) main::screen#12 (byte*) main::screen#13 (byte*) main::screen#14 (byte*) main::screen#15 (byte*) main::screen#17 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte*) main::screen#16 (byte*) main::sc#0
Identical Phi Values (byte*) main::screen#10 (byte*) main::screen#16
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::$1 [7] if((byte*) main::sc#1!=rangelast(main::sc#0,main::$0)) goto main::@1
Simple Condition (bool~) main::$2 [13] if(*((byte[]) main::header#0 + (byte) main::i#2)!=(byte) 0) goto main::@4
Simple Condition (bool~) main::$3 [21] if((byte) main::i1#10<=(byte) 9) goto main::@10
Simple Condition (bool~) main::$6 [28] if((byte) main::i1#10>=(byte) 5) goto main::@12
Simple Condition (bool~) main::$8 [32] if((byte) main::i1#10>(byte) 5) goto main::@13
Simple Condition (bool~) main::$10 [38] if((byte) main::i1#10!=(byte) 5) goto main::@14
Simple Condition (bool~) main::$12 [44] if((byte) main::i1#10<(byte) 5) goto main::@15
Simple Condition (bool~) main::$14 [50] if((byte) main::i1#10<=(byte) 5) goto main::@16
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) main::sc#0 = (byte*) 1024
Constant (const byte[]) main::header#0 = main::$15
Constant (const byte) main::i#0 = 0
Constant (const byte) main::i1#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Rewriting conditional comparison [21] if((byte) main::i1#10<=(byte) 9) goto main::@10
Rewriting conditional comparison [32] if((byte) main::i1#10>(byte) 5) goto main::@13
Rewriting conditional comparison [50] if((byte) main::i1#10<=(byte) 5) goto main::@16
Simplifying expression containing zero main::screen#1 in [25] *((byte*) main::screen#1 + (byte) 0) ← (byte~) main::$4
Successful SSA optimization PassNSimplifyExpressionWithZero
Successful SSA optimization Pass2LoopHeadConstantIdentification
Adding number conversion cast (unumber) 9+1 in if((byte) main::i1#10<(byte) 9+(number) 1) goto main::@10
Adding number conversion cast (unumber) 1 in if((byte) main::i1#10<(unumber)(byte) 9+(number) 1) goto main::@10
Adding number conversion cast (unumber) 5+1 in if((byte) main::i1#15>=(byte) 5+(number) 1) goto main::@13
Adding number conversion cast (unumber) 1 in if((byte) main::i1#15>=(unumber)(byte) 5+(number) 1) goto main::@13
Adding number conversion cast (unumber) 5+1 in if((byte) main::i1#18<(byte) 5+(number) 1) goto main::@16
Adding number conversion cast (unumber) 1 in if((byte) main::i1#18<(unumber)(byte) 5+(number) 1) goto main::@16
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast (byte) 9+(unumber)(number) 1
Simplifying constant integer cast 1
Simplifying constant integer cast (byte) 5+(unumber)(number) 1
Simplifying constant integer cast 1
Simplifying constant integer cast (byte) 5+(unumber)(number) 1
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte) main::i1#1 = (byte) main::i1#10 
Alias (byte*) main::screen#1 = (byte*) main::screen#11 
Alias (byte) main::i1#14 = (byte) main::i1#20 
Alias (byte) main::i1#15 = (byte) main::i1#21 
Alias (byte) main::i1#16 = (byte) main::i1#22 
Alias (byte) main::i1#17 = (byte) main::i1#23 
Alias (byte) main::i1#18 = (byte) main::i1#24 
Successful SSA optimization Pass2AliasElimination
Alias (byte) main::i1#14 = (byte) main::i1#15 (byte) main::i1#16 (byte) main::i1#17 (byte) main::i1#18 (byte) main::i1#19 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte) main::i1#25 (const byte) main::i1#0
Identical Phi Values (byte*) main::screen#20 (const byte*) main::sc#0
Successful SSA optimization Pass2IdenticalPhiElimination
Constant right-side identified [0] (byte*~) main::$0 ← (const byte*) main::sc#0 + (word) $3e8
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::$0 = main::sc#0+$3e8
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [40] if((const byte) main::i1#0<(byte) 9+(byte) 1) goto main::@10
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [3] main::sc#1 ← ++ main::sc#2 to ++
Resolved ranged comparison value [4] if(main::sc#1!=rangelast(main::sc#0,main::$0)) goto main::@1 to (byte*)(const byte*) main::$0+(number) 1
Successful SSA optimization Pass2LoopHeadConstantIdentification
Adding number conversion cast (unumber) 1 in if((byte*) main::sc#1!=(byte*)(const byte*) main::$0+(number) 1) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast (const byte*) main::$0+(unumber)(number) 1
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte*) main::screen#19 = (byte*) main::screen#21 (byte*) main::screen#27 
Alias (byte) main::i1#1 = (byte) main::i1#14 
Alias (byte) main::i1#26 = (byte) main::i1#32 
Alias (byte*) main::screen#23 = (byte*) main::screen#28 
Alias (byte) main::i1#27 = (byte) main::i1#33 
Alias (byte*) main::screen#24 = (byte*) main::screen#29 
Alias (byte) main::i1#28 = (byte) main::i1#34 
Alias (byte*) main::screen#25 = (byte*) main::screen#30 
Alias (byte) main::i1#29 = (byte) main::i1#35 
Alias (byte*) main::screen#26 = (byte*) main::screen#31 
Successful SSA optimization Pass2AliasElimination
Alias (byte) main::i1#26 = (byte) main::i1#27 (byte) main::i1#28 (byte) main::i1#29 (byte) main::i1#30 
Alias (byte*) main::screen#19 = (byte*) main::screen#24 (byte*) main::screen#23 (byte*) main::screen#25 (byte*) main::screen#26 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte) main::i1#36 (const byte) main::i1#0
Identical Phi Values (byte*) main::screen#32 (const byte*) main::sc#0
Successful SSA optimization Pass2IdenticalPhiElimination
Constant right-side identified [38] (byte*) main::screen#33 ← (const byte*) main::sc#0 + (byte) $28
Constant right-side identified [39] (byte~) main::$16 ← (byte) '0' + (const byte) main::i1#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::screen#33 = main::sc#0+$28
Constant (const byte) main::$16 = '0'+main::i1#0
Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (main::@10_1) in block main::@12
Removing PHI-reference to removed block (main::@10_1) in block main::@12
if() condition always false - eliminating [41] if((const byte) main::i1#0>=(byte) 5) goto main::@12
Successful SSA optimization Pass2ConstantIfs
Simplifying expression containing zero '0' in 
Successful SSA optimization PassNSimplifyExpressionWithZero
Inlining constant with var siblings (const byte*) main::sc#0
Inlining constant with var siblings (const byte) main::i#0
Inlining constant with var siblings (const byte) main::i1#0
Inlining constant with var siblings (const byte*) main::screen#33
Constant inlined main::$16 = (byte) '0'
Constant inlined main::$0 = (byte*) 1024+(word) $3e8
Constant inlined main::i#0 = (byte) 0
Constant inlined main::i1#0 = (byte) 0
Constant inlined main::sc#0 = (byte*) 1024
Constant inlined main::$15 = (const byte[]) main::header#0
Constant inlined main::screen#33 = (byte*) 1024+(byte) $28
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@25(between main::@1 and main::@1)
Added new block during phi lifting main::@26(between main::@10 and main::@12)
Added new block during phi lifting main::@27(between main::@10 and main::@19)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of main::@5
Adding NOP phi() at start of main::@9_1
CALL GRAPH
Calls in [] to main:2 

Created 6 initial phi equivalence classes
Coalesced [18] main::i1#38 ← main::i1#31
Coalesced [19] main::screen#35 ← main::screen#22
Coalesced [36] main::i1#39 ← main::i1#1
Coalesced [37] main::screen#36 ← main::screen#1
Coalesced (already) [38] main::i1#37 ← main::i1#1
Coalesced (already) [39] main::screen#34 ← main::screen#1
Coalesced [42] main::i#4 ← main::i#1
Coalesced [43] main::sc#3 ← main::sc#1
Coalesced down to 4 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@9_1
Culled Empty Block (label) main::@27
Culled Empty Block (label) main::@26
Culled Empty Block (label) main::@25
Renumbering block main::@3 to main::@2
Renumbering block main::@4 to main::@3
Renumbering block main::@9 to main::@4
Renumbering block main::@10 to main::@5
Renumbering block main::@12 to main::@6
Renumbering block main::@13 to main::@7
Renumbering block main::@14 to main::@8
Renumbering block main::@15 to main::@9
Renumbering block main::@16 to main::@10
Renumbering block main::@19 to main::@11
Renumbering block main::@20 to main::@12
Renumbering block main::@21 to main::@13
Renumbering block main::@22 to main::@14
Renumbering block main::@23 to main::@15
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

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*) 1024 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!=(byte*) 1024+(word) $3e8+(byte) 1) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@1 main::@3
  [9] (byte) main::i#2 ← phi( main::@1/(byte) 0 main::@3/(byte) main::i#1 )
  [10] if(*((const byte[]) main::header#0 + (byte) main::i#2)!=(byte) 0) goto main::@3
  to:main::@10_1
main::@10_1: scope:[main]  from main::@2
  [11] *((byte*) 1024+(byte) $28) ← (byte) '0'
  to:main::@11
main::@11: scope:[main]  from main::@10_1 main::@5
  [12] (byte*) main::screen#22 ← phi( main::@5/(byte*) main::screen#1 main::@10_1/(byte*) 1024+(byte) $28 )
  [12] (byte) main::i1#31 ← phi( main::@5/(byte) main::i1#1 main::@10_1/(byte) 0 )
  [13] *((byte*) main::screen#22 + (byte) 2) ← (byte) '+'
  to:main::@6
main::@6: scope:[main]  from main::@11 main::@5
  [14] (byte*) main::screen#19 ← phi( main::@5/(byte*) main::screen#1 main::@11/(byte*) main::screen#22 )
  [14] (byte) main::i1#26 ← phi( main::@5/(byte) main::i1#1 main::@11/(byte) main::i1#31 )
  [15] if((byte) main::i1#26>=(byte) 5+(byte) 1) goto main::@7
  to:main::@12
main::@12: scope:[main]  from main::@6
  [16] *((byte*) main::screen#19 + (byte) 5) ← (byte) '+'
  to:main::@7
main::@7: scope:[main]  from main::@12 main::@6
  [17] if((byte) main::i1#26!=(byte) 5) goto main::@8
  to:main::@13
main::@13: scope:[main]  from main::@7
  [18] *((byte*) main::screen#19 + (byte) 8) ← (byte) '+'
  to:main::@8
main::@8: scope:[main]  from main::@13 main::@7
  [19] if((byte) main::i1#26<(byte) 5) goto main::@9
  to:main::@14
main::@14: scope:[main]  from main::@8
  [20] *((byte*) main::screen#19 + (byte) $b) ← (byte) '+'
  to:main::@9
main::@9: scope:[main]  from main::@14 main::@8
  [21] if((byte) main::i1#26<(byte) 5+(byte) 1) goto main::@10
  to:main::@15
main::@15: scope:[main]  from main::@9
  [22] *((byte*) main::screen#19 + (byte) $e) ← (byte) '+'
  to:main::@10
main::@10: scope:[main]  from main::@15 main::@9
  [23] (byte) main::i1#1 ← ++ (byte) main::i1#26
  to:main::@4
main::@4: scope:[main]  from main::@10
  [24] if((byte) main::i1#1<(byte) 9+(byte) 1) goto main::@5
  to:main::@return
main::@return: scope:[main]  from main::@4
  [25] return 
  to:@return
main::@5: scope:[main]  from main::@4
  [26] (byte*) main::screen#1 ← (byte*) main::screen#19 + (byte) $28
  [27] (byte~) main::$4 ← (byte) '0' + (byte) main::i1#1
  [28] *((byte*) main::screen#1) ← (byte~) main::$4
  [29] if((byte) main::i1#1>=(byte) 5) goto main::@6
  to:main::@11
main::@3: scope:[main]  from main::@2
  [30] *((byte*) 1024 + (byte) main::i#2) ← *((const byte[]) main::header#0 + (byte) main::i#2)
  [31] (byte) main::i#1 ← ++ (byte) main::i#2
  to:main::@2


VARIABLE REGISTER WEIGHTS
(void()) main()
(byte~) main::$4 202.0
(byte[]) main::header
(byte) main::i
(byte) main::i#1 22.0
(byte) main::i#2 18.333333333333332
(byte) main::i1
(byte) main::i1#1 100.99999999999999
(byte) main::i1#26 68.55555555555554
(byte) main::i1#31 56.0
(byte*) main::sc
(byte*) main::sc#1 16.5
(byte*) main::sc#2 16.5
(byte*) main::screen
(byte*) main::screen#1 101.0
(byte*) main::screen#19 56.090909090909086
(byte*) main::screen#22 61.5

Initial phi equivalence classes
[ main::sc#2 main::sc#1 ]
[ main::i#2 main::i#1 ]
[ main::i1#26 main::i1#31 main::i1#1 ]
[ main::screen#19 main::screen#22 main::screen#1 ]
Added variable main::$4 to zero page equivalence class [ main::$4 ]
Complete equivalence classes
[ main::sc#2 main::sc#1 ]
[ main::i#2 main::i#1 ]
[ main::i1#26 main::i1#31 main::i1#1 ]
[ main::screen#19 main::screen#22 main::screen#1 ]
[ main::$4 ]
Allocated zp ZP_WORD:2 [ main::sc#2 main::sc#1 ]
Allocated zp ZP_BYTE:4 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:5 [ main::i1#26 main::i1#31 main::i1#1 ]
Allocated zp ZP_WORD:6 [ main::screen#19 main::screen#22 main::screen#1 ]
Allocated zp ZP_BYTE:8 [ main::$4 ]

INITIAL ASM
Target platform is c64basic
  // File Comments
// Test rewriting of constant comparisons
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from_b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    .label _4 = 8
    .label sc = 2
    .label i = 4
    .label screen = 6
    .label i1 = 5
    // [5] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    // [5] phi (byte*) main::sc#2 = (byte*) 1024 [phi:main->main::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z sc
    lda #>$400
    sta.z sc+1
    jmp b1
    // [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
  b1_from_b1:
    // [5] phi (byte*) main::sc#2 = (byte*) main::sc#1 [phi:main::@1->main::@1#0] -- register_copy 
    jmp b1
    // main::@1
  b1:
    // [6] *((byte*) main::sc#2) ← (byte) ' ' -- _deref_pbuz1=vbuc1 
    lda #' '
    ldy #0
    sta (sc),y
    // [7] (byte*) main::sc#1 ← ++ (byte*) main::sc#2 -- pbuz1=_inc_pbuz1 
    inc.z sc
    bne !+
    inc.z sc+1
  !:
    // [8] if((byte*) main::sc#1!=(byte*) 1024+(word) $3e8+(byte) 1) goto main::@1 -- pbuz1_neq_pbuc1_then_la1 
    lda.z sc+1
    cmp #>$400+$3e8+1
    bne b1_from_b1
    lda.z sc
    cmp #<$400+$3e8+1
    bne b1_from_b1
    // [9] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  b2_from_b1:
    // [9] phi (byte) main::i#2 = (byte) 0 [phi:main::@1->main::@2#0] -- vbuz1=vbuc1 
    lda #0
    sta.z i
    jmp b2
    // main::@2
  b2:
    // [10] if(*((const byte[]) main::header#0 + (byte) main::i#2)!=(byte) 0) goto main::@3 -- pbuc1_derefidx_vbuz1_neq_0_then_la1 
    ldy.z i
    lda header,y
    cmp #0
    bne b3
    jmp b10_1
    // main::@10_1
  b10_1:
    // [11] *((byte*) 1024+(byte) $28) ← (byte) '0' -- _deref_pbuc1=vbuc2 
    lda #'0'
    sta $400+$28
    // [12] phi from main::@10_1 to main::@11 [phi:main::@10_1->main::@11]
  b11_from_b10_1:
    // [12] phi (byte*) main::screen#22 = (byte*) 1024+(byte) $28 [phi:main::@10_1->main::@11#0] -- pbuz1=pbuc1 
    lda #<$400+$28
    sta.z screen
    lda #>$400+$28
    sta.z screen+1
    // [12] phi (byte) main::i1#31 = (byte) 0 [phi:main::@10_1->main::@11#1] -- vbuz1=vbuc1 
    lda #0
    sta.z i1
    jmp b11
    // main::@11
  b11:
    // [13] *((byte*) main::screen#22 + (byte) 2) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #2
    sta (screen),y
    // [14] phi from main::@11 main::@5 to main::@6 [phi:main::@11/main::@5->main::@6]
  b6_from_b11:
  b6_from_b5:
    // [14] phi (byte*) main::screen#19 = (byte*) main::screen#22 [phi:main::@11/main::@5->main::@6#0] -- register_copy 
    // [14] phi (byte) main::i1#26 = (byte) main::i1#31 [phi:main::@11/main::@5->main::@6#1] -- register_copy 
    jmp b6
    // main::@6
  b6:
    // [15] if((byte) main::i1#26>=(byte) 5+(byte) 1) goto main::@7 -- vbuz1_ge_vbuc1_then_la1 
    lda.z i1
    cmp #5+1
    bcs b7
    jmp b12
    // main::@12
  b12:
    // [16] *((byte*) main::screen#19 + (byte) 5) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #5
    sta (screen),y
    jmp b7
    // main::@7
  b7:
    // [17] if((byte) main::i1#26!=(byte) 5) goto main::@8 -- vbuz1_neq_vbuc1_then_la1 
    lda #5
    cmp.z i1
    bne b8
    jmp b13
    // main::@13
  b13:
    // [18] *((byte*) main::screen#19 + (byte) 8) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #8
    sta (screen),y
    jmp b8
    // main::@8
  b8:
    // [19] if((byte) main::i1#26<(byte) 5) goto main::@9 -- vbuz1_lt_vbuc1_then_la1 
    lda.z i1
    cmp #5
    bcc b9
    jmp b14
    // main::@14
  b14:
    // [20] *((byte*) main::screen#19 + (byte) $b) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #$b
    sta (screen),y
    jmp b9
    // main::@9
  b9:
    // [21] if((byte) main::i1#26<(byte) 5+(byte) 1) goto main::@10 -- vbuz1_lt_vbuc1_then_la1 
    lda.z i1
    cmp #5+1
    bcc b10
    jmp b15
    // main::@15
  b15:
    // [22] *((byte*) main::screen#19 + (byte) $e) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #$e
    sta (screen),y
    jmp b10
    // main::@10
  b10:
    // [23] (byte) main::i1#1 ← ++ (byte) main::i1#26 -- vbuz1=_inc_vbuz1 
    inc.z i1
    jmp b4
    // main::@4
  b4:
    // [24] if((byte) main::i1#1<(byte) 9+(byte) 1) goto main::@5 -- vbuz1_lt_vbuc1_then_la1 
    lda.z i1
    cmp #9+1
    bcc b5
    jmp breturn
    // main::@return
  breturn:
    // [25] return 
    rts
    // main::@5
  b5:
    // [26] (byte*) main::screen#1 ← (byte*) main::screen#19 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z screen
    sta.z screen
    bcc !+
    inc.z screen+1
  !:
    // [27] (byte~) main::$4 ← (byte) '0' + (byte) main::i1#1 -- vbuz1=vbuc1_plus_vbuz2 
    lax.z i1
    axs #-['0']
    stx.z _4
    // [28] *((byte*) main::screen#1) ← (byte~) main::$4 -- _deref_pbuz1=vbuz2 
    lda.z _4
    ldy #0
    sta (screen),y
    // [29] if((byte) main::i1#1>=(byte) 5) goto main::@6 -- vbuz1_ge_vbuc1_then_la1 
    lda.z i1
    cmp #5
    bcs b6_from_b5
    // [12] phi from main::@5 to main::@11 [phi:main::@5->main::@11]
  b11_from_b5:
    // [12] phi (byte*) main::screen#22 = (byte*) main::screen#1 [phi:main::@5->main::@11#0] -- register_copy 
    // [12] phi (byte) main::i1#31 = (byte) main::i1#1 [phi:main::@5->main::@11#1] -- register_copy 
    jmp b11
    // main::@3
  b3:
    // [30] *((byte*) 1024 + (byte) main::i#2) ← *((const byte[]) main::header#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 
    ldy.z i
    lda header,y
    sta $400,y
    // [31] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [9] phi from main::@3 to main::@2 [phi:main::@3->main::@2]
  b2_from_b3:
    // [9] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@3->main::@2#0] -- register_copy 
    jmp b2
    header: .text "  <  <= == >= >"
    .byte 0
}
  // File Data

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!=(byte*) 1024+(word) $3e8+(byte) 1) goto main::@1 [ main::sc#1 ] ( main:2 [ main::sc#1 ] ) always clobbers reg byte a 
Statement [10] if(*((const byte[]) main::header#0 + (byte) main::i#2)!=(byte) 0) goto main::@3 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ main::i#2 main::i#1 ]
Statement [11] *((byte*) 1024+(byte) $28) ← (byte) '0' [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [13] *((byte*) main::screen#22 + (byte) 2) ← (byte) '+' [ main::i1#31 main::screen#22 ] ( main:2 [ main::i1#31 main::screen#22 ] ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ main::i1#26 main::i1#31 main::i1#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:5 [ main::i1#26 main::i1#31 main::i1#1 ]
Statement [16] *((byte*) main::screen#19 + (byte) 5) ← (byte) '+' [ main::i1#26 main::screen#19 ] ( main:2 [ main::i1#26 main::screen#19 ] ) always clobbers reg byte a reg byte y 
Statement [18] *((byte*) main::screen#19 + (byte) 8) ← (byte) '+' [ main::i1#26 main::screen#19 ] ( main:2 [ main::i1#26 main::screen#19 ] ) always clobbers reg byte a reg byte y 
Statement [20] *((byte*) main::screen#19 + (byte) $b) ← (byte) '+' [ main::i1#26 main::screen#19 ] ( main:2 [ main::i1#26 main::screen#19 ] ) always clobbers reg byte a reg byte y 
Statement [22] *((byte*) main::screen#19 + (byte) $e) ← (byte) '+' [ main::i1#26 main::screen#19 ] ( main:2 [ main::i1#26 main::screen#19 ] ) always clobbers reg byte a reg byte y 
Statement [26] (byte*) main::screen#1 ← (byte*) main::screen#19 + (byte) $28 [ main::i1#1 main::screen#1 ] ( main:2 [ main::i1#1 main::screen#1 ] ) always clobbers reg byte a 
Statement [27] (byte~) main::$4 ← (byte) '0' + (byte) main::i1#1 [ main::i1#1 main::screen#1 main::$4 ] ( main:2 [ main::i1#1 main::screen#1 main::$4 ] ) always clobbers reg byte a 
Statement [28] *((byte*) main::screen#1) ← (byte~) main::$4 [ main::i1#1 main::screen#1 ] ( main:2 [ main::i1#1 main::screen#1 ] ) always clobbers reg byte y 
Statement [30] *((byte*) 1024 + (byte) main::i#2) ← *((const byte[]) main::header#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) 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!=(byte*) 1024+(word) $3e8+(byte) 1) goto main::@1 [ main::sc#1 ] ( main:2 [ main::sc#1 ] ) always clobbers reg byte a 
Statement [10] if(*((const byte[]) main::header#0 + (byte) main::i#2)!=(byte) 0) goto main::@3 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Statement [11] *((byte*) 1024+(byte) $28) ← (byte) '0' [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [13] *((byte*) main::screen#22 + (byte) 2) ← (byte) '+' [ main::i1#31 main::screen#22 ] ( main:2 [ main::i1#31 main::screen#22 ] ) always clobbers reg byte a reg byte y 
Statement [16] *((byte*) main::screen#19 + (byte) 5) ← (byte) '+' [ main::i1#26 main::screen#19 ] ( main:2 [ main::i1#26 main::screen#19 ] ) always clobbers reg byte a reg byte y 
Statement [18] *((byte*) main::screen#19 + (byte) 8) ← (byte) '+' [ main::i1#26 main::screen#19 ] ( main:2 [ main::i1#26 main::screen#19 ] ) always clobbers reg byte a reg byte y 
Statement [20] *((byte*) main::screen#19 + (byte) $b) ← (byte) '+' [ main::i1#26 main::screen#19 ] ( main:2 [ main::i1#26 main::screen#19 ] ) always clobbers reg byte a reg byte y 
Statement [22] *((byte*) main::screen#19 + (byte) $e) ← (byte) '+' [ main::i1#26 main::screen#19 ] ( main:2 [ main::i1#26 main::screen#19 ] ) always clobbers reg byte a reg byte y 
Statement [26] (byte*) main::screen#1 ← (byte*) main::screen#19 + (byte) $28 [ main::i1#1 main::screen#1 ] ( main:2 [ main::i1#1 main::screen#1 ] ) always clobbers reg byte a 
Statement [27] (byte~) main::$4 ← (byte) '0' + (byte) main::i1#1 [ main::i1#1 main::screen#1 main::$4 ] ( main:2 [ main::i1#1 main::screen#1 main::$4 ] ) always clobbers reg byte a 
Statement [28] *((byte*) main::screen#1) ← (byte~) main::$4 [ main::i1#1 main::screen#1 ] ( main:2 [ main::i1#1 main::screen#1 ] ) always clobbers reg byte y 
Statement [30] *((byte*) 1024 + (byte) main::i#2) ← *((const byte[]) main::header#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) 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_BYTE:4 [ main::i#2 main::i#1 ] : zp ZP_BYTE:4 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:5 [ main::i1#26 main::i1#31 main::i1#1 ] : zp ZP_BYTE:5 , reg byte x , 
Potential registers zp ZP_WORD:6 [ main::screen#19 main::screen#22 main::screen#1 ] : zp ZP_WORD:6 , 
Potential registers zp ZP_BYTE:8 [ main::$4 ] : zp ZP_BYTE:8 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 225.56: zp ZP_BYTE:5 [ main::i1#26 main::i1#31 main::i1#1 ] 218.59: zp ZP_WORD:6 [ main::screen#19 main::screen#22 main::screen#1 ] 202: zp ZP_BYTE:8 [ main::$4 ] 40.33: zp ZP_BYTE:4 [ main::i#2 main::i#1 ] 33: zp ZP_WORD:2 [ main::sc#2 main::sc#1 ] 
Uplift Scope [] 

Uplifting [main] best 14504 combination reg byte x [ main::i1#26 main::i1#31 main::i1#1 ] zp ZP_WORD:6 [ main::screen#19 main::screen#22 main::screen#1 ] reg byte a [ main::$4 ] reg byte x [ main::i#2 main::i#1 ] zp ZP_WORD:2 [ main::sc#2 main::sc#1 ] 
Uplifting [] best 14504 combination 
Allocated (was zp ZP_WORD:6) zp ZP_WORD:4 [ main::screen#19 main::screen#22 main::screen#1 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Test rewriting of constant comparisons
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from_b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    .label sc = 2
    .label screen = 4
    // [5] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    // [5] phi (byte*) main::sc#2 = (byte*) 1024 [phi:main->main::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z sc
    lda #>$400
    sta.z sc+1
    jmp b1
    // [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
  b1_from_b1:
    // [5] phi (byte*) main::sc#2 = (byte*) main::sc#1 [phi:main::@1->main::@1#0] -- register_copy 
    jmp b1
    // main::@1
  b1:
    // [6] *((byte*) main::sc#2) ← (byte) ' ' -- _deref_pbuz1=vbuc1 
    lda #' '
    ldy #0
    sta (sc),y
    // [7] (byte*) main::sc#1 ← ++ (byte*) main::sc#2 -- pbuz1=_inc_pbuz1 
    inc.z sc
    bne !+
    inc.z sc+1
  !:
    // [8] if((byte*) main::sc#1!=(byte*) 1024+(word) $3e8+(byte) 1) goto main::@1 -- pbuz1_neq_pbuc1_then_la1 
    lda.z sc+1
    cmp #>$400+$3e8+1
    bne b1_from_b1
    lda.z sc
    cmp #<$400+$3e8+1
    bne b1_from_b1
    // [9] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  b2_from_b1:
    // [9] phi (byte) main::i#2 = (byte) 0 [phi:main::@1->main::@2#0] -- vbuxx=vbuc1 
    ldx #0
    jmp b2
    // main::@2
  b2:
    // [10] if(*((const byte[]) main::header#0 + (byte) main::i#2)!=(byte) 0) goto main::@3 -- pbuc1_derefidx_vbuxx_neq_0_then_la1 
    lda header,x
    cmp #0
    bne b3
    jmp b10_1
    // main::@10_1
  b10_1:
    // [11] *((byte*) 1024+(byte) $28) ← (byte) '0' -- _deref_pbuc1=vbuc2 
    lda #'0'
    sta $400+$28
    // [12] phi from main::@10_1 to main::@11 [phi:main::@10_1->main::@11]
  b11_from_b10_1:
    // [12] phi (byte*) main::screen#22 = (byte*) 1024+(byte) $28 [phi:main::@10_1->main::@11#0] -- pbuz1=pbuc1 
    lda #<$400+$28
    sta.z screen
    lda #>$400+$28
    sta.z screen+1
    // [12] phi (byte) main::i1#31 = (byte) 0 [phi:main::@10_1->main::@11#1] -- vbuxx=vbuc1 
    ldx #0
    jmp b11
    // main::@11
  b11:
    // [13] *((byte*) main::screen#22 + (byte) 2) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #2
    sta (screen),y
    // [14] phi from main::@11 main::@5 to main::@6 [phi:main::@11/main::@5->main::@6]
  b6_from_b11:
  b6_from_b5:
    // [14] phi (byte*) main::screen#19 = (byte*) main::screen#22 [phi:main::@11/main::@5->main::@6#0] -- register_copy 
    // [14] phi (byte) main::i1#26 = (byte) main::i1#31 [phi:main::@11/main::@5->main::@6#1] -- register_copy 
    jmp b6
    // main::@6
  b6:
    // [15] if((byte) main::i1#26>=(byte) 5+(byte) 1) goto main::@7 -- vbuxx_ge_vbuc1_then_la1 
    cpx #5+1
    bcs b7
    jmp b12
    // main::@12
  b12:
    // [16] *((byte*) main::screen#19 + (byte) 5) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #5
    sta (screen),y
    jmp b7
    // main::@7
  b7:
    // [17] if((byte) main::i1#26!=(byte) 5) goto main::@8 -- vbuxx_neq_vbuc1_then_la1 
    cpx #5
    bne b8
    jmp b13
    // main::@13
  b13:
    // [18] *((byte*) main::screen#19 + (byte) 8) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #8
    sta (screen),y
    jmp b8
    // main::@8
  b8:
    // [19] if((byte) main::i1#26<(byte) 5) goto main::@9 -- vbuxx_lt_vbuc1_then_la1 
    cpx #5
    bcc b9
    jmp b14
    // main::@14
  b14:
    // [20] *((byte*) main::screen#19 + (byte) $b) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #$b
    sta (screen),y
    jmp b9
    // main::@9
  b9:
    // [21] if((byte) main::i1#26<(byte) 5+(byte) 1) goto main::@10 -- vbuxx_lt_vbuc1_then_la1 
    cpx #5+1
    bcc b10
    jmp b15
    // main::@15
  b15:
    // [22] *((byte*) main::screen#19 + (byte) $e) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #$e
    sta (screen),y
    jmp b10
    // main::@10
  b10:
    // [23] (byte) main::i1#1 ← ++ (byte) main::i1#26 -- vbuxx=_inc_vbuxx 
    inx
    jmp b4
    // main::@4
  b4:
    // [24] if((byte) main::i1#1<(byte) 9+(byte) 1) goto main::@5 -- vbuxx_lt_vbuc1_then_la1 
    cpx #9+1
    bcc b5
    jmp breturn
    // main::@return
  breturn:
    // [25] return 
    rts
    // main::@5
  b5:
    // [26] (byte*) main::screen#1 ← (byte*) main::screen#19 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z screen
    sta.z screen
    bcc !+
    inc.z screen+1
  !:
    // [27] (byte~) main::$4 ← (byte) '0' + (byte) main::i1#1 -- vbuaa=vbuc1_plus_vbuxx 
    txa
    clc
    adc #'0'
    // [28] *((byte*) main::screen#1) ← (byte~) main::$4 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (screen),y
    // [29] if((byte) main::i1#1>=(byte) 5) goto main::@6 -- vbuxx_ge_vbuc1_then_la1 
    cpx #5
    bcs b6_from_b5
    // [12] phi from main::@5 to main::@11 [phi:main::@5->main::@11]
  b11_from_b5:
    // [12] phi (byte*) main::screen#22 = (byte*) main::screen#1 [phi:main::@5->main::@11#0] -- register_copy 
    // [12] phi (byte) main::i1#31 = (byte) main::i1#1 [phi:main::@5->main::@11#1] -- register_copy 
    jmp b11
    // main::@3
  b3:
    // [30] *((byte*) 1024 + (byte) main::i#2) ← *((const byte[]) main::header#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda header,x
    sta $400,x
    // [31] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [9] phi from main::@3 to main::@2 [phi:main::@3->main::@2]
  b2_from_b3:
    // [9] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@3->main::@2#0] -- register_copy 
    jmp b2
    header: .text "  <  <= == >= >"
    .byte 0
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b10_1
Removing instruction jmp b11
Removing instruction jmp b6
Removing instruction jmp b12
Removing instruction jmp b7
Removing instruction jmp b13
Removing instruction jmp b8
Removing instruction jmp b14
Removing instruction jmp b9
Removing instruction jmp b15
Removing instruction jmp b10
Removing instruction jmp b4
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label b1_from_b1 with b1
Replacing label b1_from_b1 with b1
Replacing label b6_from_b5 with b6
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 b6_from_b11:
Removing instruction b6_from_b5:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction b1_from_main:
Removing instruction b2_from_b1:
Removing instruction b10_1:
Removing instruction b11_from_b10_1:
Removing instruction b12:
Removing instruction b13:
Removing instruction b14:
Removing instruction b15:
Removing instruction b4:
Removing instruction breturn:
Removing instruction b11_from_b5:
Removing instruction b2_from_b3:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(void()) main()
(byte~) main::$4 reg byte a 202.0
(label) main::@1
(label) main::@10
(label) main::@10_1
(label) main::@11
(label) main::@12
(label) main::@13
(label) main::@14
(label) main::@15
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@8
(label) main::@9
(label) main::@return
(byte[]) main::header
(const byte[]) main::header#0 header = (string) "  <  <= == >= >"
(byte) main::i
(byte) main::i#1 reg byte x 22.0
(byte) main::i#2 reg byte x 18.333333333333332
(byte) main::i1
(byte) main::i1#1 reg byte x 100.99999999999999
(byte) main::i1#26 reg byte x 68.55555555555554
(byte) main::i1#31 reg byte x 56.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
(byte*) main::screen
(byte*) main::screen#1 screen zp ZP_WORD:4 101.0
(byte*) main::screen#19 screen zp ZP_WORD:4 56.090909090909086
(byte*) main::screen#22 screen zp ZP_WORD:4 61.5

zp ZP_WORD:2 [ main::sc#2 main::sc#1 ]
reg byte x [ main::i#2 main::i#1 ]
reg byte x [ main::i1#26 main::i1#31 main::i1#1 ]
zp ZP_WORD:4 [ main::screen#19 main::screen#22 main::screen#1 ]
reg byte a [ main::$4 ]


FINAL ASSEMBLER
Score: 11042

  // File Comments
// Test rewriting of constant comparisons
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  // @begin
  // [1] phi from @begin to @1 [phi:@begin->@1]
  // @1
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
  // [3] phi from @1 to @end [phi:@1->@end]
  // @end
  // main
main: {
    .label sc = 2
    .label screen = 4
    // [5] phi from main to main::@1 [phi:main->main::@1]
    // [5] phi (byte*) main::sc#2 = (byte*) 1024 [phi:main->main::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z sc
    lda #>$400
    sta.z sc+1
    // [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
    // [5] phi (byte*) main::sc#2 = (byte*) main::sc#1 [phi:main::@1->main::@1#0] -- register_copy 
    // main::@1
  b1:
    // *sc=' '
    // [6] *((byte*) main::sc#2) ← (byte) ' ' -- _deref_pbuz1=vbuc1 
    lda #' '
    ldy #0
    sta (sc),y
    // for(byte* sc : screen..screen+1000)
    // [7] (byte*) main::sc#1 ← ++ (byte*) main::sc#2 -- pbuz1=_inc_pbuz1 
    inc.z sc
    bne !+
    inc.z sc+1
  !:
    // [8] if((byte*) main::sc#1!=(byte*) 1024+(word) $3e8+(byte) 1) goto main::@1 -- pbuz1_neq_pbuc1_then_la1 
    lda.z sc+1
    cmp #>$400+$3e8+1
    bne b1
    lda.z sc
    cmp #<$400+$3e8+1
    bne b1
    // [9] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
    // [9] phi (byte) main::i#2 = (byte) 0 [phi:main::@1->main::@2#0] -- vbuxx=vbuc1 
    ldx #0
    // main::@2
  b2:
    // for( byte i=0; header[i]!=0; i++)
    // [10] if(*((const byte[]) main::header#0 + (byte) main::i#2)!=(byte) 0) goto main::@3 -- pbuc1_derefidx_vbuxx_neq_0_then_la1 
    lda header,x
    cmp #0
    bne b3
    // main::@10_1
    // screen[0] = '0'+i
    // [11] *((byte*) 1024+(byte) $28) ← (byte) '0' -- _deref_pbuc1=vbuc2 
    lda #'0'
    sta $400+$28
    // [12] phi from main::@10_1 to main::@11 [phi:main::@10_1->main::@11]
    // [12] phi (byte*) main::screen#22 = (byte*) 1024+(byte) $28 [phi:main::@10_1->main::@11#0] -- pbuz1=pbuc1 
    lda #<$400+$28
    sta.z screen
    lda #>$400+$28
    sta.z screen+1
    // [12] phi (byte) main::i1#31 = (byte) 0 [phi:main::@10_1->main::@11#1] -- vbuxx=vbuc1 
    ldx #0
    // main::@11
  b11:
    // screen[2] = '+'
    // [13] *((byte*) main::screen#22 + (byte) 2) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #2
    sta (screen),y
    // [14] phi from main::@11 main::@5 to main::@6 [phi:main::@11/main::@5->main::@6]
    // [14] phi (byte*) main::screen#19 = (byte*) main::screen#22 [phi:main::@11/main::@5->main::@6#0] -- register_copy 
    // [14] phi (byte) main::i1#26 = (byte) main::i1#31 [phi:main::@11/main::@5->main::@6#1] -- register_copy 
    // main::@6
  b6:
    // if(i<=5)
    // [15] if((byte) main::i1#26>=(byte) 5+(byte) 1) goto main::@7 -- vbuxx_ge_vbuc1_then_la1 
    cpx #5+1
    bcs b7
    // main::@12
    // screen[5] = '+'
    // [16] *((byte*) main::screen#19 + (byte) 5) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #5
    sta (screen),y
    // main::@7
  b7:
    // if(i==5)
    // [17] if((byte) main::i1#26!=(byte) 5) goto main::@8 -- vbuxx_neq_vbuc1_then_la1 
    cpx #5
    bne b8
    // main::@13
    // screen[8] = '+'
    // [18] *((byte*) main::screen#19 + (byte) 8) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #8
    sta (screen),y
    // main::@8
  b8:
    // if(i>=5)
    // [19] if((byte) main::i1#26<(byte) 5) goto main::@9 -- vbuxx_lt_vbuc1_then_la1 
    cpx #5
    bcc b9
    // main::@14
    // screen[11] = '+'
    // [20] *((byte*) main::screen#19 + (byte) $b) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #$b
    sta (screen),y
    // main::@9
  b9:
    // if(i>5)
    // [21] if((byte) main::i1#26<(byte) 5+(byte) 1) goto main::@10 -- vbuxx_lt_vbuc1_then_la1 
    cpx #5+1
    bcc b10
    // main::@15
    // screen[14] = '+'
    // [22] *((byte*) main::screen#19 + (byte) $e) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #$e
    sta (screen),y
    // main::@10
  b10:
    // for(byte i=0;i<=9;i++)
    // [23] (byte) main::i1#1 ← ++ (byte) main::i1#26 -- vbuxx=_inc_vbuxx 
    inx
    // main::@4
    // [24] if((byte) main::i1#1<(byte) 9+(byte) 1) goto main::@5 -- vbuxx_lt_vbuc1_then_la1 
    cpx #9+1
    bcc b5
    // main::@return
    // }
    // [25] return 
    rts
    // main::@5
  b5:
    // screen +=40
    // [26] (byte*) main::screen#1 ← (byte*) main::screen#19 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z screen
    sta.z screen
    bcc !+
    inc.z screen+1
  !:
    // '0'+i
    // [27] (byte~) main::$4 ← (byte) '0' + (byte) main::i1#1 -- vbuaa=vbuc1_plus_vbuxx 
    txa
    clc
    adc #'0'
    // screen[0] = '0'+i
    // [28] *((byte*) main::screen#1) ← (byte~) main::$4 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (screen),y
    // if(i<5)
    // [29] if((byte) main::i1#1>=(byte) 5) goto main::@6 -- vbuxx_ge_vbuc1_then_la1 
    cpx #5
    bcs b6
    // [12] phi from main::@5 to main::@11 [phi:main::@5->main::@11]
    // [12] phi (byte*) main::screen#22 = (byte*) main::screen#1 [phi:main::@5->main::@11#0] -- register_copy 
    // [12] phi (byte) main::i1#31 = (byte) main::i1#1 [phi:main::@5->main::@11#1] -- register_copy 
    jmp b11
    // main::@3
  b3:
    // screen[i] = header[i]
    // [30] *((byte*) 1024 + (byte) main::i#2) ← *((const byte[]) main::header#0 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda header,x
    sta $400,x
    // for( byte i=0; header[i]!=0; i++)
    // [31] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [9] phi from main::@3 to main::@2 [phi:main::@3->main::@2]
    // [9] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@3->main::@2#0] -- register_copy 
    jmp b2
    header: .text "  <  <= == >= >"
    .byte 0
}
  // File Data

