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

(void()) main()
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::i#0 ← (byte) 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 ← *((const byte*) main::header + (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) ← *((const byte*) main::header + (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 ← (byte) 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
(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
(const byte*) main::header[]  = (string) "  <  <= == >= >"
(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 (bool~) main::$2 ← *((const byte*) main::header + (byte) main::i#2) != (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
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $3e8
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) 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 [26] (bool~) main::$6 ← (byte) main::i1#3 >= (byte) 5 from [25] (bool~) main::$5 ← (byte) main::i1#3 < (byte) 5
Inversing boolean not [30] (bool~) main::$8 ← (byte) main::i1#4 > (byte) 5 from [29] (bool~) main::$7 ← (byte) main::i1#4 <= (byte) 5
Inversing boolean not [36] (bool~) main::$10 ← (byte) main::i1#5 != (byte) 5 from [35] (bool~) main::$9 ← (byte) main::i1#5 == (byte) 5
Inversing boolean not [42] (bool~) main::$12 ← (byte) main::i1#6 < (byte) 5 from [41] (bool~) main::$11 ← (byte) main::i1#6 >= (byte) 5
Inversing boolean not [48] (bool~) main::$14 ← (byte) main::i1#7 <= (byte) 5 from [47] (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 [12] if(*((const byte*) main::header + (byte) main::i#2)!=(byte) 0) goto main::@4
Simple Condition (bool~) main::$3 [20] if((byte) main::i1#10<=(byte) 9) goto main::@10
Simple Condition (bool~) main::$6 [27] if((byte) main::i1#10>=(byte) 5) goto main::@12
Simple Condition (bool~) main::$8 [31] if((byte) main::i1#10>(byte) 5) goto main::@13
Simple Condition (bool~) main::$10 [37] if((byte) main::i1#10!=(byte) 5) goto main::@14
Simple Condition (bool~) main::$12 [43] if((byte) main::i1#10<(byte) 5) goto main::@15
Simple Condition (bool~) main::$14 [49] 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::i#0 = 0
Constant (const byte) main::i1#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Rewriting conditional comparison [20] if((byte) main::i1#10<=(byte) 9) goto main::@10
Rewriting conditional comparison [31] if((byte) main::i1#10>(byte) 5) goto main::@13
Rewriting conditional comparison [49] if((byte) main::i1#10<=(byte) 5) goto main::@16
Simplifying expression containing zero main::screen#1 in [24] *((byte*) main::screen#1 + (byte) 0) ← (byte~) main::$4
Successful SSA optimization PassNSimplifyExpressionWithZero
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#10>=(byte) 5+(number) 1) goto main::@13
Adding number conversion cast (unumber) 1 in if((byte) main::i1#10>=(unumber)(byte) 5+(number) 1) goto main::@13
Adding number conversion cast (unumber) 5+1 in if((byte) main::i1#10<(byte) 5+(number) 1) goto main::@16
Adding number conversion cast (unumber) 1 in if((byte) main::i1#10<(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
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
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
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
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
Constant inlined main::i#0 = (byte) 0
Constant inlined main::i1#0 = (byte) 0
Constant inlined main::sc#0 = (byte*) 1024
Constant inlined main::$0 = (byte*) 1024+(word) $3e8
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@25(between main::@1 and main::@1)
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
CALL GRAPH
Calls in [] to main:2 

Created 4 initial phi equivalence classes
Coalesced [31] main::i1#14 ← main::i1#1
Coalesced [32] main::screen#19 ← main::screen#1
Coalesced [35] main::i#4 ← main::i#1
Coalesced [36] 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::@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()

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


VARIABLE REGISTER WEIGHTS
(void()) main()
(byte~) main::$4 22.0
(byte) main::i
(byte) main::i#1 22.0
(byte) main::i#2 18.333333333333332
(byte) main::i1
(byte) main::i1#1 22.0
(byte) main::i1#10 6.6
(byte*) main::sc
(byte*) main::sc#1 16.5
(byte*) main::sc#2 16.5
(byte*) main::screen
(byte*) main::screen#1 6.285714285714286
(byte*) main::screen#11 11.0

Initial phi equivalence classes
[ main::sc#2 main::sc#1 ]
[ main::i#2 main::i#1 ]
[ main::i1#10 main::i1#1 ]
[ main::screen#11 main::screen#1 ]
Added variable main::$4 to live range equivalence class [ main::$4 ]
Complete equivalence classes
[ main::sc#2 main::sc#1 ]
[ main::i#2 main::i#1 ]
[ main::i1#10 main::i1#1 ]
[ main::screen#11 main::screen#1 ]
[ main::$4 ]
Allocated zp[2]:2 [ main::sc#2 main::sc#1 ]
Allocated zp[1]:4 [ main::i#2 main::i#1 ]
Allocated zp[1]:5 [ main::i1#10 main::i1#1 ]
Allocated zp[2]:6 [ main::screen#11 main::screen#1 ]
Allocated zp[1]:8 [ main::$4 ]

INITIAL ASM
Target platform is c64basic / MOS6502X
  // 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 + (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
    // [11] phi from main::@2 to main::@4 [phi:main::@2->main::@4]
  __b4_from___b2:
    // [11] phi (byte*) main::screen#11 = (byte*) 1024 [phi:main::@2->main::@4#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z screen
    lda #>$400
    sta.z screen+1
    // [11] phi (byte) main::i1#10 = (byte) 0 [phi:main::@2->main::@4#1] -- vbuz1=vbuc1 
    lda #0
    sta.z i1
    jmp __b4
    // main::@4
  __b4:
    // [12] if((byte) main::i1#10<(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:
    // [13] return 
    rts
    // main::@5
  __b5:
    // [14] (byte*) main::screen#1 ← (byte*) main::screen#11 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z screen
    sta.z screen
    bcc !+
    inc.z screen+1
  !:
    // [15] (byte~) main::$4 ← (byte) '0' + (byte) main::i1#10 -- vbuz1=vbuc1_plus_vbuz2 
    lax.z i1
    axs #-['0']
    stx.z __4
    // [16] *((byte*) main::screen#1) ← (byte~) main::$4 -- _deref_pbuz1=vbuz2 
    lda.z __4
    ldy #0
    sta (screen),y
    // [17] if((byte) main::i1#10>=(byte) 5) goto main::@6 -- vbuz1_ge_vbuc1_then_la1 
    lda.z i1
    cmp #5
    bcs __b6
    jmp __b11
    // main::@11
  __b11:
    // [18] *((byte*) main::screen#1 + (byte) 2) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #2
    sta (screen),y
    jmp __b6
    // main::@6
  __b6:
    // [19] if((byte) main::i1#10>=(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:
    // [20] *((byte*) main::screen#1 + (byte) 5) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #5
    sta (screen),y
    jmp __b7
    // main::@7
  __b7:
    // [21] if((byte) main::i1#10!=(byte) 5) goto main::@8 -- vbuz1_neq_vbuc1_then_la1 
    lda #5
    cmp.z i1
    bne __b8
    jmp __b13
    // main::@13
  __b13:
    // [22] *((byte*) main::screen#1 + (byte) 8) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #8
    sta (screen),y
    jmp __b8
    // main::@8
  __b8:
    // [23] if((byte) main::i1#10<(byte) 5) goto main::@9 -- vbuz1_lt_vbuc1_then_la1 
    lda.z i1
    cmp #5
    bcc __b9
    jmp __b14
    // main::@14
  __b14:
    // [24] *((byte*) main::screen#1 + (byte) $b) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #$b
    sta (screen),y
    jmp __b9
    // main::@9
  __b9:
    // [25] if((byte) main::i1#10<(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:
    // [26] *((byte*) main::screen#1 + (byte) $e) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #$e
    sta (screen),y
    jmp __b10
    // main::@10
  __b10:
    // [27] (byte) main::i1#1 ← ++ (byte) main::i1#10 -- vbuz1=_inc_vbuz1 
    inc.z i1
    // [11] phi from main::@10 to main::@4 [phi:main::@10->main::@4]
  __b4_from___b10:
    // [11] phi (byte*) main::screen#11 = (byte*) main::screen#1 [phi:main::@10->main::@4#0] -- register_copy 
    // [11] phi (byte) main::i1#10 = (byte) main::i1#1 [phi:main::@10->main::@4#1] -- register_copy 
    jmp __b4
    // main::@3
  __b3:
    // [28] *((byte*) 1024 + (byte) main::i#2) ← *((const byte*) main::header + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 
    ldy.z i
    lda header,y
    sta $400,y
    // [29] (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 + (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[1]:4 [ main::i#2 main::i#1 ]
Statement [14] (byte*) main::screen#1 ← (byte*) main::screen#11 + (byte) $28 [ main::i1#10 main::screen#1 ] ( main:2 [ main::i1#10 main::screen#1 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:5 [ main::i1#10 main::i1#1 ]
Statement [15] (byte~) main::$4 ← (byte) '0' + (byte) main::i1#10 [ main::i1#10 main::screen#1 main::$4 ] ( main:2 [ main::i1#10 main::screen#1 main::$4 ] ) always clobbers reg byte a 
Statement [16] *((byte*) main::screen#1) ← (byte~) main::$4 [ main::i1#10 main::screen#1 ] ( main:2 [ main::i1#10 main::screen#1 ] ) always clobbers reg byte y 
Removing always clobbered register reg byte y as potential for zp[1]:5 [ main::i1#10 main::i1#1 ]
Statement [18] *((byte*) main::screen#1 + (byte) 2) ← (byte) '+' [ main::i1#10 main::screen#1 ] ( main:2 [ main::i1#10 main::screen#1 ] ) always clobbers reg byte a reg byte y 
Statement [20] *((byte*) main::screen#1 + (byte) 5) ← (byte) '+' [ main::i1#10 main::screen#1 ] ( main:2 [ main::i1#10 main::screen#1 ] ) always clobbers reg byte a reg byte y 
Statement [22] *((byte*) main::screen#1 + (byte) 8) ← (byte) '+' [ main::i1#10 main::screen#1 ] ( main:2 [ main::i1#10 main::screen#1 ] ) always clobbers reg byte a reg byte y 
Statement [24] *((byte*) main::screen#1 + (byte) $b) ← (byte) '+' [ main::i1#10 main::screen#1 ] ( main:2 [ main::i1#10 main::screen#1 ] ) always clobbers reg byte a reg byte y 
Statement [26] *((byte*) main::screen#1 + (byte) $e) ← (byte) '+' [ main::i1#10 main::screen#1 ] ( main:2 [ main::i1#10 main::screen#1 ] ) always clobbers reg byte a reg byte y 
Statement [28] *((byte*) 1024 + (byte) main::i#2) ← *((const byte*) main::header + (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 + (byte) main::i#2)!=(byte) 0) goto main::@3 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Statement [14] (byte*) main::screen#1 ← (byte*) main::screen#11 + (byte) $28 [ main::i1#10 main::screen#1 ] ( main:2 [ main::i1#10 main::screen#1 ] ) always clobbers reg byte a 
Statement [15] (byte~) main::$4 ← (byte) '0' + (byte) main::i1#10 [ main::i1#10 main::screen#1 main::$4 ] ( main:2 [ main::i1#10 main::screen#1 main::$4 ] ) always clobbers reg byte a 
Statement [16] *((byte*) main::screen#1) ← (byte~) main::$4 [ main::i1#10 main::screen#1 ] ( main:2 [ main::i1#10 main::screen#1 ] ) always clobbers reg byte y 
Statement [18] *((byte*) main::screen#1 + (byte) 2) ← (byte) '+' [ main::i1#10 main::screen#1 ] ( main:2 [ main::i1#10 main::screen#1 ] ) always clobbers reg byte a reg byte y 
Statement [20] *((byte*) main::screen#1 + (byte) 5) ← (byte) '+' [ main::i1#10 main::screen#1 ] ( main:2 [ main::i1#10 main::screen#1 ] ) always clobbers reg byte a reg byte y 
Statement [22] *((byte*) main::screen#1 + (byte) 8) ← (byte) '+' [ main::i1#10 main::screen#1 ] ( main:2 [ main::i1#10 main::screen#1 ] ) always clobbers reg byte a reg byte y 
Statement [24] *((byte*) main::screen#1 + (byte) $b) ← (byte) '+' [ main::i1#10 main::screen#1 ] ( main:2 [ main::i1#10 main::screen#1 ] ) always clobbers reg byte a reg byte y 
Statement [26] *((byte*) main::screen#1 + (byte) $e) ← (byte) '+' [ main::i1#10 main::screen#1 ] ( main:2 [ main::i1#10 main::screen#1 ] ) always clobbers reg byte a reg byte y 
Statement [28] *((byte*) 1024 + (byte) main::i#2) ← *((const byte*) main::header + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Potential registers zp[2]:2 [ main::sc#2 main::sc#1 ] : zp[2]:2 , 
Potential registers zp[1]:4 [ main::i#2 main::i#1 ] : zp[1]:4 , reg byte x , reg byte y , 
Potential registers zp[1]:5 [ main::i1#10 main::i1#1 ] : zp[1]:5 , reg byte x , 
Potential registers zp[2]:6 [ main::screen#11 main::screen#1 ] : zp[2]:6 , 
Potential registers zp[1]:8 [ main::$4 ] : zp[1]:8 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 40.33: zp[1]:4 [ main::i#2 main::i#1 ] 33: zp[2]:2 [ main::sc#2 main::sc#1 ] 28.6: zp[1]:5 [ main::i1#10 main::i1#1 ] 22: zp[1]:8 [ main::$4 ] 17.29: zp[2]:6 [ main::screen#11 main::screen#1 ] 
Uplift Scope [] 

Uplifting [main] best 2453 combination reg byte x [ main::i#2 main::i#1 ] zp[2]:2 [ main::sc#2 main::sc#1 ] reg byte x [ main::i1#10 main::i1#1 ] reg byte a [ main::$4 ] zp[2]:6 [ main::screen#11 main::screen#1 ] 
Uplifting [] best 2453 combination 
Allocated (was zp[2]:6) zp[2]:4 [ main::screen#11 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 + (byte) main::i#2)!=(byte) 0) goto main::@3 -- pbuc1_derefidx_vbuxx_neq_0_then_la1 
    lda header,x
    cmp #0
    bne __b3
    // [11] phi from main::@2 to main::@4 [phi:main::@2->main::@4]
  __b4_from___b2:
    // [11] phi (byte*) main::screen#11 = (byte*) 1024 [phi:main::@2->main::@4#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z screen
    lda #>$400
    sta.z screen+1
    // [11] phi (byte) main::i1#10 = (byte) 0 [phi:main::@2->main::@4#1] -- vbuxx=vbuc1 
    ldx #0
    jmp __b4
    // main::@4
  __b4:
    // [12] if((byte) main::i1#10<(byte) 9+(byte) 1) goto main::@5 -- vbuxx_lt_vbuc1_then_la1 
    cpx #9+1
    bcc __b5
    jmp __breturn
    // main::@return
  __breturn:
    // [13] return 
    rts
    // main::@5
  __b5:
    // [14] (byte*) main::screen#1 ← (byte*) main::screen#11 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z screen
    sta.z screen
    bcc !+
    inc.z screen+1
  !:
    // [15] (byte~) main::$4 ← (byte) '0' + (byte) main::i1#10 -- vbuaa=vbuc1_plus_vbuxx 
    txa
    clc
    adc #'0'
    // [16] *((byte*) main::screen#1) ← (byte~) main::$4 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (screen),y
    // [17] if((byte) main::i1#10>=(byte) 5) goto main::@6 -- vbuxx_ge_vbuc1_then_la1 
    cpx #5
    bcs __b6
    jmp __b11
    // main::@11
  __b11:
    // [18] *((byte*) main::screen#1 + (byte) 2) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #2
    sta (screen),y
    jmp __b6
    // main::@6
  __b6:
    // [19] if((byte) main::i1#10>=(byte) 5+(byte) 1) goto main::@7 -- vbuxx_ge_vbuc1_then_la1 
    cpx #5+1
    bcs __b7
    jmp __b12
    // main::@12
  __b12:
    // [20] *((byte*) main::screen#1 + (byte) 5) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #5
    sta (screen),y
    jmp __b7
    // main::@7
  __b7:
    // [21] if((byte) main::i1#10!=(byte) 5) goto main::@8 -- vbuxx_neq_vbuc1_then_la1 
    cpx #5
    bne __b8
    jmp __b13
    // main::@13
  __b13:
    // [22] *((byte*) main::screen#1 + (byte) 8) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #8
    sta (screen),y
    jmp __b8
    // main::@8
  __b8:
    // [23] if((byte) main::i1#10<(byte) 5) goto main::@9 -- vbuxx_lt_vbuc1_then_la1 
    cpx #5
    bcc __b9
    jmp __b14
    // main::@14
  __b14:
    // [24] *((byte*) main::screen#1 + (byte) $b) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #$b
    sta (screen),y
    jmp __b9
    // main::@9
  __b9:
    // [25] if((byte) main::i1#10<(byte) 5+(byte) 1) goto main::@10 -- vbuxx_lt_vbuc1_then_la1 
    cpx #5+1
    bcc __b10
    jmp __b15
    // main::@15
  __b15:
    // [26] *((byte*) main::screen#1 + (byte) $e) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #$e
    sta (screen),y
    jmp __b10
    // main::@10
  __b10:
    // [27] (byte) main::i1#1 ← ++ (byte) main::i1#10 -- vbuxx=_inc_vbuxx 
    inx
    // [11] phi from main::@10 to main::@4 [phi:main::@10->main::@4]
  __b4_from___b10:
    // [11] phi (byte*) main::screen#11 = (byte*) main::screen#1 [phi:main::@10->main::@4#0] -- register_copy 
    // [11] phi (byte) main::i1#10 = (byte) main::i1#1 [phi:main::@10->main::@4#1] -- register_copy 
    jmp __b4
    // main::@3
  __b3:
    // [28] *((byte*) 1024 + (byte) main::i#2) ← *((const byte*) main::header + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda header,x
    sta $400,x
    // [29] (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 __b4
Removing instruction jmp __breturn
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
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __bbegin with __b1
Replacing label __b1_from___b1 with __b1
Replacing label __b1_from___b1 with __b1
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Removing instruction __b1_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b2_from___b1:
Removing instruction __b4_from___b2:
Removing instruction __breturn:
Removing instruction __b11:
Removing instruction __b12:
Removing instruction __b13:
Removing instruction __b14:
Removing instruction __b15:
Removing instruction __b4_from___b10:
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 __b1:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(void()) main()
(byte~) main::$4 reg byte a 22.0
(label) main::@1
(label) main::@10
(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
(const byte*) main::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 22.0
(byte) main::i1#10 reg byte x 6.6
(byte*) main::sc
(byte*) main::sc#1 sc zp[2]:2 16.5
(byte*) main::sc#2 sc zp[2]:2 16.5
(byte*) main::screen
(byte*) main::screen#1 screen zp[2]:4 6.285714285714286
(byte*) main::screen#11 screen zp[2]:4 11.0

zp[2]:2 [ main::sc#2 main::sc#1 ]
reg byte x [ main::i#2 main::i#1 ]
reg byte x [ main::i1#10 main::i1#1 ]
zp[2]:4 [ main::screen#11 main::screen#1 ]
reg byte a [ main::$4 ]


FINAL ASSEMBLER
Score: 1991

  // 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 + (byte) main::i#2)!=(byte) 0) goto main::@3 -- pbuc1_derefidx_vbuxx_neq_0_then_la1 
    lda header,x
    cmp #0
    bne __b3
    // [11] phi from main::@2 to main::@4 [phi:main::@2->main::@4]
    // [11] phi (byte*) main::screen#11 = (byte*) 1024 [phi:main::@2->main::@4#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z screen
    lda #>$400
    sta.z screen+1
    // [11] phi (byte) main::i1#10 = (byte) 0 [phi:main::@2->main::@4#1] -- vbuxx=vbuc1 
    ldx #0
    // main::@4
  __b4:
    // for(byte i=0;i<=9;i++)
    // [12] if((byte) main::i1#10<(byte) 9+(byte) 1) goto main::@5 -- vbuxx_lt_vbuc1_then_la1 
    cpx #9+1
    bcc __b5
    // main::@return
    // }
    // [13] return 
    rts
    // main::@5
  __b5:
    // screen +=40
    // [14] (byte*) main::screen#1 ← (byte*) main::screen#11 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z screen
    sta.z screen
    bcc !+
    inc.z screen+1
  !:
    // '0'+i
    // [15] (byte~) main::$4 ← (byte) '0' + (byte) main::i1#10 -- vbuaa=vbuc1_plus_vbuxx 
    txa
    clc
    adc #'0'
    // screen[0] = '0'+i
    // [16] *((byte*) main::screen#1) ← (byte~) main::$4 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (screen),y
    // if(i<5)
    // [17] if((byte) main::i1#10>=(byte) 5) goto main::@6 -- vbuxx_ge_vbuc1_then_la1 
    cpx #5
    bcs __b6
    // main::@11
    // screen[2] = '+'
    // [18] *((byte*) main::screen#1 + (byte) 2) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #2
    sta (screen),y
    // main::@6
  __b6:
    // if(i<=5)
    // [19] if((byte) main::i1#10>=(byte) 5+(byte) 1) goto main::@7 -- vbuxx_ge_vbuc1_then_la1 
    cpx #5+1
    bcs __b7
    // main::@12
    // screen[5] = '+'
    // [20] *((byte*) main::screen#1 + (byte) 5) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #5
    sta (screen),y
    // main::@7
  __b7:
    // if(i==5)
    // [21] if((byte) main::i1#10!=(byte) 5) goto main::@8 -- vbuxx_neq_vbuc1_then_la1 
    cpx #5
    bne __b8
    // main::@13
    // screen[8] = '+'
    // [22] *((byte*) main::screen#1 + (byte) 8) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #8
    sta (screen),y
    // main::@8
  __b8:
    // if(i>=5)
    // [23] if((byte) main::i1#10<(byte) 5) goto main::@9 -- vbuxx_lt_vbuc1_then_la1 
    cpx #5
    bcc __b9
    // main::@14
    // screen[11] = '+'
    // [24] *((byte*) main::screen#1 + (byte) $b) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #$b
    sta (screen),y
    // main::@9
  __b9:
    // if(i>5)
    // [25] if((byte) main::i1#10<(byte) 5+(byte) 1) goto main::@10 -- vbuxx_lt_vbuc1_then_la1 
    cpx #5+1
    bcc __b10
    // main::@15
    // screen[14] = '+'
    // [26] *((byte*) main::screen#1 + (byte) $e) ← (byte) '+' -- pbuz1_derefidx_vbuc1=vbuc2 
    lda #'+'
    ldy #$e
    sta (screen),y
    // main::@10
  __b10:
    // for(byte i=0;i<=9;i++)
    // [27] (byte) main::i1#1 ← ++ (byte) main::i1#10 -- vbuxx=_inc_vbuxx 
    inx
    // [11] phi from main::@10 to main::@4 [phi:main::@10->main::@4]
    // [11] phi (byte*) main::screen#11 = (byte*) main::screen#1 [phi:main::@10->main::@4#0] -- register_copy 
    // [11] phi (byte) main::i1#10 = (byte) main::i1#1 [phi:main::@10->main::@4#1] -- register_copy 
    jmp __b4
    // main::@3
  __b3:
    // screen[i] = header[i]
    // [28] *((byte*) 1024 + (byte) main::i#2) ← *((const byte*) main::header + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda header,x
    sta $400,x
    // for( byte i=0; header[i]!=0; i++)
    // [29] (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

