Culled Empty Block (label) main::@2

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@1

(void()) main()
main: scope:[main]  from @1
  (byte) main::i#0 ← (byte) 0
  to:main::@1
main::@1: scope:[main]  from main main::@1
  (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 )
  (number~) main::$0 ← (byte) main::i#2 * (number) 1
  *((const byte*) main::SCREEN+(number) 0*(number) $28 + (byte) main::i#2) ← (number~) main::$0
  (number~) main::$1 ← (byte) main::i#2 * (number) 2
  *((const byte*) main::SCREEN+(number) 1*(number) $28 + (byte) main::i#2) ← (number~) main::$1
  (number~) main::$2 ← (byte) main::i#2 * (number) 3
  *((const byte*) main::SCREEN+(number) 2*(number) $28 + (byte) main::i#2) ← (number~) main::$2
  (number~) main::$3 ← (byte) main::i#2 * (number) 4
  *((const byte*) main::SCREEN+(number) 3*(number) $28 + (byte) main::i#2) ← (number~) main::$3
  (number~) main::$4 ← (byte) main::i#2 * (number) 5
  *((const byte*) main::SCREEN+(number) 4*(number) $28 + (byte) main::i#2) ← (number~) main::$4
  (number~) main::$5 ← (byte) main::i#2 * (number) 6
  *((const byte*) main::SCREEN+(number) 5*(number) $28 + (byte) main::i#2) ← (number~) main::$5
  (number~) main::$6 ← (byte) main::i#2 * (number) 7
  *((const byte*) main::SCREEN+(number) 6*(number) $28 + (byte) main::i#2) ← (number~) main::$6
  (number~) main::$7 ← (byte) main::i#2 * (number) 8
  *((const byte*) main::SCREEN+(number) 7*(number) $28 + (byte) main::i#2) ← (number~) main::$7
  (number~) main::$8 ← (byte) main::i#2 * (number) 9
  *((const byte*) main::SCREEN+(number) 8*(number) $28 + (byte) main::i#2) ← (number~) main::$8
  (number~) main::$9 ← (byte) main::i#2 * (number) $a
  *((const byte*) main::SCREEN+(number) 9*(number) $28 + (byte) main::i#2) ← (number~) main::$9
  (number~) main::$10 ← (byte) main::i#2 * (number) $b
  *((const byte*) main::SCREEN+(number) $a*(number) $28 + (byte) main::i#2) ← (number~) main::$10
  (number~) main::$11 ← (byte) main::i#2 * (number) $c
  *((const byte*) main::SCREEN+(number) $b*(number) $28 + (byte) main::i#2) ← (number~) main::$11
  (number~) main::$12 ← (byte) main::i#2 * (number) $d
  *((const byte*) main::SCREEN+(number) $c*(number) $28 + (byte) main::i#2) ← (number~) main::$12
  (number~) main::$13 ← (byte) main::i#2 * (number) $e
  *((const byte*) main::SCREEN+(number) $d*(number) $28 + (byte) main::i#2) ← (number~) main::$13
  (number~) main::$14 ← (byte) main::i#2 * (number) $f
  *((const byte*) main::SCREEN+(number) $e*(number) $28 + (byte) main::i#2) ← (number~) main::$14
  (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$11)
  (bool~) main::$15 ← (byte) main::i#1 != rangelast(0,$11)
  if((bool~) main::$15) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@1
  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()
(number~) main::$0
(number~) main::$1
(number~) main::$10
(number~) main::$11
(number~) main::$12
(number~) main::$13
(number~) main::$14
(bool~) main::$15
(number~) main::$2
(number~) main::$3
(number~) main::$4
(number~) main::$5
(number~) main::$6
(number~) main::$7
(number~) main::$8
(number~) main::$9
(label) main::@1
(label) main::@return
(const byte*) main::SCREEN = (byte*)(number) $400
(byte) main::i
(byte) main::i#0
(byte) main::i#1
(byte) main::i#2

Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) main::i#2 * (number) 1
Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::i#2 * (unumber)(number) 1
Adding number conversion cast (unumber) 0*$28 in *((const byte*) main::SCREEN+(number) 0*(number) $28 + (byte) main::i#2) ← (unumber~) main::$0
Adding number conversion cast (unumber) 2 in (number~) main::$1 ← (byte) main::i#2 * (number) 2
Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (byte) main::i#2 * (unumber)(number) 2
Adding number conversion cast (unumber) 1*$28 in *((const byte*) main::SCREEN+(number) 1*(number) $28 + (byte) main::i#2) ← (unumber~) main::$1
Adding number conversion cast (unumber) 3 in (number~) main::$2 ← (byte) main::i#2 * (number) 3
Adding number conversion cast (unumber) main::$2 in (number~) main::$2 ← (byte) main::i#2 * (unumber)(number) 3
Adding number conversion cast (unumber) 2*$28 in *((const byte*) main::SCREEN+(number) 2*(number) $28 + (byte) main::i#2) ← (unumber~) main::$2
Adding number conversion cast (unumber) 4 in (number~) main::$3 ← (byte) main::i#2 * (number) 4
Adding number conversion cast (unumber) main::$3 in (number~) main::$3 ← (byte) main::i#2 * (unumber)(number) 4
Adding number conversion cast (unumber) 3*$28 in *((const byte*) main::SCREEN+(number) 3*(number) $28 + (byte) main::i#2) ← (unumber~) main::$3
Adding number conversion cast (unumber) 5 in (number~) main::$4 ← (byte) main::i#2 * (number) 5
Adding number conversion cast (unumber) main::$4 in (number~) main::$4 ← (byte) main::i#2 * (unumber)(number) 5
Adding number conversion cast (unumber) 4*$28 in *((const byte*) main::SCREEN+(number) 4*(number) $28 + (byte) main::i#2) ← (unumber~) main::$4
Adding number conversion cast (unumber) 6 in (number~) main::$5 ← (byte) main::i#2 * (number) 6
Adding number conversion cast (unumber) main::$5 in (number~) main::$5 ← (byte) main::i#2 * (unumber)(number) 6
Adding number conversion cast (unumber) 5*$28 in *((const byte*) main::SCREEN+(number) 5*(number) $28 + (byte) main::i#2) ← (unumber~) main::$5
Adding number conversion cast (unumber) 7 in (number~) main::$6 ← (byte) main::i#2 * (number) 7
Adding number conversion cast (unumber) main::$6 in (number~) main::$6 ← (byte) main::i#2 * (unumber)(number) 7
Adding number conversion cast (unumber) 6*$28 in *((const byte*) main::SCREEN+(number) 6*(number) $28 + (byte) main::i#2) ← (unumber~) main::$6
Adding number conversion cast (unumber) 8 in (number~) main::$7 ← (byte) main::i#2 * (number) 8
Adding number conversion cast (unumber) main::$7 in (number~) main::$7 ← (byte) main::i#2 * (unumber)(number) 8
Adding number conversion cast (unumber) 7*$28 in *((const byte*) main::SCREEN+(number) 7*(number) $28 + (byte) main::i#2) ← (unumber~) main::$7
Adding number conversion cast (unumber) 9 in (number~) main::$8 ← (byte) main::i#2 * (number) 9
Adding number conversion cast (unumber) main::$8 in (number~) main::$8 ← (byte) main::i#2 * (unumber)(number) 9
Adding number conversion cast (unumber) 8*$28 in *((const byte*) main::SCREEN+(number) 8*(number) $28 + (byte) main::i#2) ← (unumber~) main::$8
Adding number conversion cast (unumber) $a in (number~) main::$9 ← (byte) main::i#2 * (number) $a
Adding number conversion cast (unumber) main::$9 in (number~) main::$9 ← (byte) main::i#2 * (unumber)(number) $a
Adding number conversion cast (unumber) 9*$28 in *((const byte*) main::SCREEN+(number) 9*(number) $28 + (byte) main::i#2) ← (unumber~) main::$9
Adding number conversion cast (unumber) $b in (number~) main::$10 ← (byte) main::i#2 * (number) $b
Adding number conversion cast (unumber) main::$10 in (number~) main::$10 ← (byte) main::i#2 * (unumber)(number) $b
Adding number conversion cast (unumber) $a*$28 in *((const byte*) main::SCREEN+(number) $a*(number) $28 + (byte) main::i#2) ← (unumber~) main::$10
Adding number conversion cast (unumber) $c in (number~) main::$11 ← (byte) main::i#2 * (number) $c
Adding number conversion cast (unumber) main::$11 in (number~) main::$11 ← (byte) main::i#2 * (unumber)(number) $c
Adding number conversion cast (unumber) $b*$28 in *((const byte*) main::SCREEN+(number) $b*(number) $28 + (byte) main::i#2) ← (unumber~) main::$11
Adding number conversion cast (unumber) $d in (number~) main::$12 ← (byte) main::i#2 * (number) $d
Adding number conversion cast (unumber) main::$12 in (number~) main::$12 ← (byte) main::i#2 * (unumber)(number) $d
Adding number conversion cast (unumber) $c*$28 in *((const byte*) main::SCREEN+(number) $c*(number) $28 + (byte) main::i#2) ← (unumber~) main::$12
Adding number conversion cast (unumber) $e in (number~) main::$13 ← (byte) main::i#2 * (number) $e
Adding number conversion cast (unumber) main::$13 in (number~) main::$13 ← (byte) main::i#2 * (unumber)(number) $e
Adding number conversion cast (unumber) $d*$28 in *((const byte*) main::SCREEN+(number) $d*(number) $28 + (byte) main::i#2) ← (unumber~) main::$13
Adding number conversion cast (unumber) $f in (number~) main::$14 ← (byte) main::i#2 * (number) $f
Adding number conversion cast (unumber) main::$14 in (number~) main::$14 ← (byte) main::i#2 * (unumber)(number) $f
Adding number conversion cast (unumber) $e*$28 in *((const byte*) main::SCREEN+(number) $e*(number) $28 + (byte) main::i#2) ← (unumber~) main::$14
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 3
Simplifying constant integer cast 4
Simplifying constant integer cast 5
Simplifying constant integer cast 6
Simplifying constant integer cast 7
Simplifying constant integer cast 8
Simplifying constant integer cast 9
Simplifying constant integer cast $a
Simplifying constant integer cast $b
Simplifying constant integer cast $c
Simplifying constant integer cast $d
Simplifying constant integer cast $e
Simplifying constant integer cast $f
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 5
Finalized unsigned number type (byte) 6
Finalized unsigned number type (byte) 7
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 9
Finalized unsigned number type (byte) $a
Finalized unsigned number type (byte) $b
Finalized unsigned number type (byte) $c
Finalized unsigned number type (byte) $d
Finalized unsigned number type (byte) $e
Finalized unsigned number type (byte) $f
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$0 ← (byte) main::i#2 * (byte) 1
Inferred type updated to byte in (unumber~) main::$1 ← (byte) main::i#2 * (byte) 2
Inferred type updated to byte in (unumber~) main::$2 ← (byte) main::i#2 * (byte) 3
Inferred type updated to byte in (unumber~) main::$3 ← (byte) main::i#2 * (byte) 4
Inferred type updated to byte in (unumber~) main::$4 ← (byte) main::i#2 * (byte) 5
Inferred type updated to byte in (unumber~) main::$5 ← (byte) main::i#2 * (byte) 6
Inferred type updated to byte in (unumber~) main::$6 ← (byte) main::i#2 * (byte) 7
Inferred type updated to byte in (unumber~) main::$7 ← (byte) main::i#2 * (byte) 8
Inferred type updated to byte in (unumber~) main::$8 ← (byte) main::i#2 * (byte) 9
Inferred type updated to byte in (unumber~) main::$9 ← (byte) main::i#2 * (byte) $a
Inferred type updated to byte in (unumber~) main::$10 ← (byte) main::i#2 * (byte) $b
Inferred type updated to byte in (unumber~) main::$11 ← (byte) main::i#2 * (byte) $c
Inferred type updated to byte in (unumber~) main::$12 ← (byte) main::i#2 * (byte) $d
Inferred type updated to byte in (unumber~) main::$13 ← (byte) main::i#2 * (byte) $e
Inferred type updated to byte in (unumber~) main::$14 ← (byte) main::i#2 * (byte) $f
Simple Condition (bool~) main::$15 [34] if((byte) main::i#1!=rangelast(0,$11)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte) main::i#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [32] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [34] if(main::i#1!=rangelast(0,$11)) goto main::@1 to (number) $12
Simplifying constant evaluating to zero (byte)(number) 0*(number) $28 in [3] *((const byte*) main::SCREEN+(byte)(number) 0*(number) $28 + (byte) main::i#2) ← (byte~) main::$0
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero main::SCREEN in [3] *((const byte*) main::SCREEN+(byte) 0 + (byte) main::i#2) ← (byte~) main::$0
Successful SSA optimization PassNSimplifyExpressionWithZero
Adding number conversion cast (unumber) $12 in if((byte) main::i#1!=(number) $12) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast $12
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $12
Successful SSA optimization PassNFinalizeNumberTypeConversions
Rewriting multiplication to remove identity multiply/divide [1] (byte~) main::$0 ← (byte) main::i#2 * (byte) 1
Rewriting multiplication to use shift [3] (byte~) main::$1 ← (byte) main::i#2 * (byte) 2
Rewriting multiplication to use shift and addition[5] (byte~) main::$2 ← (byte) main::i#2 * (byte) 3
Rewriting multiplication to use shift [7] (byte~) main::$3 ← (byte) main::i#2 * (byte) 4
Rewriting multiplication to use shift and addition[9] (byte~) main::$4 ← (byte) main::i#2 * (byte) 5
Rewriting multiplication to use shift and addition[11] (byte~) main::$5 ← (byte) main::i#2 * (byte) 6
Rewriting multiplication to use shift and addition[13] (byte~) main::$6 ← (byte) main::i#2 * (byte) 7
Rewriting multiplication to use shift [15] (byte~) main::$7 ← (byte) main::i#2 * (byte) 8
Rewriting multiplication to use shift and addition[17] (byte~) main::$8 ← (byte) main::i#2 * (byte) 9
Rewriting multiplication to use shift and addition[19] (byte~) main::$9 ← (byte) main::i#2 * (byte) $a
Rewriting multiplication to use shift and addition[21] (byte~) main::$10 ← (byte) main::i#2 * (byte) $b
Rewriting multiplication to use shift and addition[23] (byte~) main::$11 ← (byte) main::i#2 * (byte) $c
Rewriting multiplication to use shift and addition[25] (byte~) main::$12 ← (byte) main::i#2 * (byte) $d
Rewriting multiplication to use shift and addition[27] (byte~) main::$13 ← (byte) main::i#2 * (byte) $e
Rewriting multiplication to use shift and addition[29] (byte~) main::$14 ← (byte) main::i#2 * (byte) $f
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const byte) main::i#0
Constant inlined main::i#0 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Alias (byte) main::i#2 = (byte~) main::$0 
Alias (byte~) main::$2 = (byte~) main::$17 
Alias (byte~) main::$4 = (byte~) main::$19 
Alias (byte~) main::$5 = (byte~) main::$22 
Alias (byte~) main::$6 = (byte~) main::$26 
Alias (byte~) main::$8 = (byte~) main::$28 
Alias (byte~) main::$9 = (byte~) main::$31 
Alias (byte~) main::$10 = (byte~) main::$35 
Alias (byte~) main::$11 = (byte~) main::$38 
Alias (byte~) main::$12 = (byte~) main::$42 
Alias (byte~) main::$13 = (byte~) main::$47 
Alias (byte~) main::$14 = (byte~) main::$53 
Successful SSA optimization Pass2AliasElimination
Identified duplicate assignment right side [5] (byte~) main::$16 ← (byte) main::i#2 << (byte) 1
Identified duplicate assignment right side [11] (byte~) main::$18 ← (byte) main::i#2 << (byte) 2
Identified duplicate assignment right side [15] (byte~) main::$20 ← (byte) main::i#2 << (byte) 1
Identified duplicate assignment right side [20] (byte~) main::$23 ← (byte) main::i#2 << (byte) 1
Identified duplicate assignment right side [28] (byte~) main::$27 ← (byte) main::i#2 << (byte) 3
Identified duplicate assignment right side [32] (byte~) main::$29 ← (byte) main::i#2 << (byte) 2
Identified duplicate assignment right side [37] (byte~) main::$32 ← (byte) main::i#2 << (byte) 2
Identified duplicate assignment right side [43] (byte~) main::$36 ← (byte) main::i#2 << (byte) 1
Identified duplicate assignment right side [48] (byte~) main::$39 ← (byte) main::i#2 << (byte) 1
Identified duplicate assignment right side [54] (byte~) main::$43 ← (byte) main::i#2 << (byte) 1
Identified duplicate assignment right side [61] (byte~) main::$48 ← (byte) main::i#2 << (byte) 1
Successful SSA optimization Pass2DuplicateRValueIdentification
Alias (byte~) main::$16 = (byte~) main::$1 (byte~) main::$20 (byte~) main::$23 (byte~) main::$36 (byte~) main::$39 (byte~) main::$43 (byte~) main::$48 
Alias (byte~) main::$18 = (byte~) main::$3 (byte~) main::$29 (byte~) main::$32 
Alias (byte~) main::$27 = (byte~) main::$7 
Successful SSA optimization Pass2AliasElimination
Added new block during phi lifting main::@3(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
CALL GRAPH
Calls in [] to main:2 

Created 1 initial phi equivalence classes
Coalesced [55] main::i#3 ← main::i#1
Coalesced down to 1 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) main::@3
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main

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::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
  [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte) main::i#2
  [7] (byte~) main::$16 ← (byte) main::i#2 << (byte) 1
  [8] *((const byte*) main::SCREEN+(byte)(number) 1*(number) $28 + (byte) main::i#2) ← (byte~) main::$16
  [9] (byte~) main::$2 ← (byte~) main::$16 + (byte) main::i#2
  [10] *((const byte*) main::SCREEN+(byte)(number) 2*(number) $28 + (byte) main::i#2) ← (byte~) main::$2
  [11] (byte~) main::$18 ← (byte) main::i#2 << (byte) 2
  [12] *((const byte*) main::SCREEN+(byte)(number) 3*(number) $28 + (byte) main::i#2) ← (byte~) main::$18
  [13] (byte~) main::$4 ← (byte~) main::$18 + (byte) main::i#2
  [14] *((const byte*) main::SCREEN+(byte)(number) 4*(number) $28 + (byte) main::i#2) ← (byte~) main::$4
  [15] (byte~) main::$21 ← (byte~) main::$16 + (byte) main::i#2
  [16] (byte~) main::$5 ← (byte~) main::$21 << (byte) 1
  [17] *((const byte*) main::SCREEN+(byte)(number) 5*(number) $28 + (byte) main::i#2) ← (byte~) main::$5
  [18] (byte~) main::$24 ← (byte~) main::$16 + (byte) main::i#2
  [19] (byte~) main::$25 ← (byte~) main::$24 << (byte) 1
  [20] (byte~) main::$6 ← (byte~) main::$25 + (byte) main::i#2
  [21] *((const byte*) main::SCREEN+(byte)(number) 6*(number) $28 + (byte) main::i#2) ← (byte~) main::$6
  [22] (byte~) main::$27 ← (byte) main::i#2 << (byte) 3
  [23] *((const byte*) main::SCREEN+(word)(number) 7*(number) $28 + (byte) main::i#2) ← (byte~) main::$27
  [24] (byte~) main::$8 ← (byte~) main::$27 + (byte) main::i#2
  [25] *((const byte*) main::SCREEN+(word)(number) 8*(number) $28 + (byte) main::i#2) ← (byte~) main::$8
  [26] (byte~) main::$30 ← (byte~) main::$18 + (byte) main::i#2
  [27] (byte~) main::$9 ← (byte~) main::$30 << (byte) 1
  [28] *((const byte*) main::SCREEN+(word)(number) 9*(number) $28 + (byte) main::i#2) ← (byte~) main::$9
  [29] (byte~) main::$33 ← (byte~) main::$18 + (byte) main::i#2
  [30] (byte~) main::$34 ← (byte~) main::$33 << (byte) 1
  [31] (byte~) main::$10 ← (byte~) main::$34 + (byte) main::i#2
  [32] *((const byte*) main::SCREEN+(word)(number) $a*(number) $28 + (byte) main::i#2) ← (byte~) main::$10
  [33] (byte~) main::$37 ← (byte~) main::$16 + (byte) main::i#2
  [34] (byte~) main::$11 ← (byte~) main::$37 << (byte) 2
  [35] *((const byte*) main::SCREEN+(word)(number) $b*(number) $28 + (byte) main::i#2) ← (byte~) main::$11
  [36] (byte~) main::$40 ← (byte~) main::$16 + (byte) main::i#2
  [37] (byte~) main::$41 ← (byte~) main::$40 << (byte) 2
  [38] (byte~) main::$12 ← (byte~) main::$41 + (byte) main::i#2
  [39] *((const byte*) main::SCREEN+(word)(number) $c*(number) $28 + (byte) main::i#2) ← (byte~) main::$12
  [40] (byte~) main::$44 ← (byte~) main::$16 + (byte) main::i#2
  [41] (byte~) main::$45 ← (byte~) main::$44 << (byte) 1
  [42] (byte~) main::$46 ← (byte~) main::$45 + (byte) main::i#2
  [43] (byte~) main::$13 ← (byte~) main::$46 << (byte) 1
  [44] *((const byte*) main::SCREEN+(word)(number) $d*(number) $28 + (byte) main::i#2) ← (byte~) main::$13
  [45] (byte~) main::$49 ← (byte~) main::$16 + (byte) main::i#2
  [46] (byte~) main::$50 ← (byte~) main::$49 << (byte) 1
  [47] (byte~) main::$51 ← (byte~) main::$50 + (byte) main::i#2
  [48] (byte~) main::$52 ← (byte~) main::$51 << (byte) 1
  [49] (byte~) main::$14 ← (byte~) main::$52 + (byte) main::i#2
  [50] *((const byte*) main::SCREEN+(word)(number) $e*(number) $28 + (byte) main::i#2) ← (byte~) main::$14
  [51] (byte) main::i#1 ← ++ (byte) main::i#2
  [52] if((byte) main::i#1!=(byte) $12) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@1
  [53] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(void()) main()
(byte~) main::$10 22.0
(byte~) main::$11 22.0
(byte~) main::$12 22.0
(byte~) main::$13 22.0
(byte~) main::$14 22.0
(byte~) main::$16 2.605263157894737
(byte~) main::$18 3.055555555555556
(byte~) main::$2 22.0
(byte~) main::$21 22.0
(byte~) main::$24 22.0
(byte~) main::$25 22.0
(byte~) main::$27 16.5
(byte~) main::$30 22.0
(byte~) main::$33 22.0
(byte~) main::$34 22.0
(byte~) main::$37 22.0
(byte~) main::$4 22.0
(byte~) main::$40 22.0
(byte~) main::$41 22.0
(byte~) main::$44 22.0
(byte~) main::$45 22.0
(byte~) main::$46 22.0
(byte~) main::$49 22.0
(byte~) main::$5 22.0
(byte~) main::$50 22.0
(byte~) main::$51 22.0
(byte~) main::$52 22.0
(byte~) main::$6 22.0
(byte~) main::$8 22.0
(byte~) main::$9 22.0
(byte) main::i
(byte) main::i#1 16.5
(byte) main::i#2 9.086956521739129

Initial phi equivalence classes
[ main::i#2 main::i#1 ]
Added variable main::$16 to live range equivalence class [ main::$16 ]
Added variable main::$2 to live range equivalence class [ main::$2 ]
Added variable main::$18 to live range equivalence class [ main::$18 ]
Added variable main::$4 to live range equivalence class [ main::$4 ]
Added variable main::$21 to live range equivalence class [ main::$21 ]
Added variable main::$5 to live range equivalence class [ main::$5 ]
Added variable main::$24 to live range equivalence class [ main::$24 ]
Added variable main::$25 to live range equivalence class [ main::$25 ]
Added variable main::$6 to live range equivalence class [ main::$6 ]
Added variable main::$27 to live range equivalence class [ main::$27 ]
Added variable main::$8 to live range equivalence class [ main::$8 ]
Added variable main::$30 to live range equivalence class [ main::$30 ]
Added variable main::$9 to live range equivalence class [ main::$9 ]
Added variable main::$33 to live range equivalence class [ main::$33 ]
Added variable main::$34 to live range equivalence class [ main::$34 ]
Added variable main::$10 to live range equivalence class [ main::$10 ]
Added variable main::$37 to live range equivalence class [ main::$37 ]
Added variable main::$11 to live range equivalence class [ main::$11 ]
Added variable main::$40 to live range equivalence class [ main::$40 ]
Added variable main::$41 to live range equivalence class [ main::$41 ]
Added variable main::$12 to live range equivalence class [ main::$12 ]
Added variable main::$44 to live range equivalence class [ main::$44 ]
Added variable main::$45 to live range equivalence class [ main::$45 ]
Added variable main::$46 to live range equivalence class [ main::$46 ]
Added variable main::$13 to live range equivalence class [ main::$13 ]
Added variable main::$49 to live range equivalence class [ main::$49 ]
Added variable main::$50 to live range equivalence class [ main::$50 ]
Added variable main::$51 to live range equivalence class [ main::$51 ]
Added variable main::$52 to live range equivalence class [ main::$52 ]
Added variable main::$14 to live range equivalence class [ main::$14 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ main::$16 ]
[ main::$2 ]
[ main::$18 ]
[ main::$4 ]
[ main::$21 ]
[ main::$5 ]
[ main::$24 ]
[ main::$25 ]
[ main::$6 ]
[ main::$27 ]
[ main::$8 ]
[ main::$30 ]
[ main::$9 ]
[ main::$33 ]
[ main::$34 ]
[ main::$10 ]
[ main::$37 ]
[ main::$11 ]
[ main::$40 ]
[ main::$41 ]
[ main::$12 ]
[ main::$44 ]
[ main::$45 ]
[ main::$46 ]
[ main::$13 ]
[ main::$49 ]
[ main::$50 ]
[ main::$51 ]
[ main::$52 ]
[ main::$14 ]
Allocated zp[1]:2 [ main::i#2 main::i#1 ]
Allocated zp[1]:3 [ main::$16 ]
Allocated zp[1]:4 [ main::$2 ]
Allocated zp[1]:5 [ main::$18 ]
Allocated zp[1]:6 [ main::$4 ]
Allocated zp[1]:7 [ main::$21 ]
Allocated zp[1]:8 [ main::$5 ]
Allocated zp[1]:9 [ main::$24 ]
Allocated zp[1]:10 [ main::$25 ]
Allocated zp[1]:11 [ main::$6 ]
Allocated zp[1]:12 [ main::$27 ]
Allocated zp[1]:13 [ main::$8 ]
Allocated zp[1]:14 [ main::$30 ]
Allocated zp[1]:15 [ main::$9 ]
Allocated zp[1]:16 [ main::$33 ]
Allocated zp[1]:17 [ main::$34 ]
Allocated zp[1]:18 [ main::$10 ]
Allocated zp[1]:19 [ main::$37 ]
Allocated zp[1]:20 [ main::$11 ]
Allocated zp[1]:21 [ main::$40 ]
Allocated zp[1]:22 [ main::$41 ]
Allocated zp[1]:23 [ main::$12 ]
Allocated zp[1]:24 [ main::$44 ]
Allocated zp[1]:25 [ main::$45 ]
Allocated zp[1]:26 [ main::$46 ]
Allocated zp[1]:27 [ main::$13 ]
Allocated zp[1]:28 [ main::$49 ]
Allocated zp[1]:29 [ main::$50 ]
Allocated zp[1]:30 [ main::$51 ]
Allocated zp[1]:31 [ main::$52 ]
Allocated zp[1]:32 [ main::$14 ]

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
// Check that multiplication by constants is converted to shift/add
  // 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 SCREEN = $400
    .label __2 = 4
    .label __4 = 6
    .label __5 = 8
    .label __6 = $b
    .label __8 = $d
    .label __9 = $f
    .label __10 = $12
    .label __11 = $14
    .label __12 = $17
    .label __13 = $1b
    .label __14 = $20
    .label i = 2
    .label __16 = 3
    .label __18 = 5
    .label __21 = 7
    .label __24 = 9
    .label __25 = $a
    .label __27 = $c
    .label __30 = $e
    .label __33 = $10
    .label __34 = $11
    .label __37 = $13
    .label __40 = $15
    .label __41 = $16
    .label __44 = $18
    .label __45 = $19
    .label __46 = $1a
    .label __49 = $1c
    .label __50 = $1d
    .label __51 = $1e
    .label __52 = $1f
    // [5] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z i
    jmp __b1
    // [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
  __b1_from___b1:
    // [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy 
    jmp __b1
    // main::@1
  __b1:
    // [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 
    ldy.z i
    tya
    sta SCREEN,y
    // [7] (byte~) main::$16 ← (byte) main::i#2 << (byte) 1 -- vbuz1=vbuz2_rol_1 
    lda.z i
    asl
    sta.z __16
    // [8] *((const byte*) main::SCREEN+(byte)(number) 1*(number) $28 + (byte) main::i#2) ← (byte~) main::$16 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __16
    ldy.z i
    sta SCREEN+1*$28,y
    // [9] (byte~) main::$2 ← (byte~) main::$16 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __16
    clc
    adc.z i
    sta.z __2
    // [10] *((const byte*) main::SCREEN+(byte)(number) 2*(number) $28 + (byte) main::i#2) ← (byte~) main::$2 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __2
    ldy.z i
    sta SCREEN+2*$28,y
    // [11] (byte~) main::$18 ← (byte) main::i#2 << (byte) 2 -- vbuz1=vbuz2_rol_2 
    lda.z i
    asl
    asl
    sta.z __18
    // [12] *((const byte*) main::SCREEN+(byte)(number) 3*(number) $28 + (byte) main::i#2) ← (byte~) main::$18 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __18
    ldy.z i
    sta SCREEN+3*$28,y
    // [13] (byte~) main::$4 ← (byte~) main::$18 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __18
    clc
    adc.z i
    sta.z __4
    // [14] *((const byte*) main::SCREEN+(byte)(number) 4*(number) $28 + (byte) main::i#2) ← (byte~) main::$4 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __4
    ldy.z i
    sta SCREEN+4*$28,y
    // [15] (byte~) main::$21 ← (byte~) main::$16 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __16
    clc
    adc.z i
    sta.z __21
    // [16] (byte~) main::$5 ← (byte~) main::$21 << (byte) 1 -- vbuz1=vbuz2_rol_1 
    lda.z __21
    asl
    sta.z __5
    // [17] *((const byte*) main::SCREEN+(byte)(number) 5*(number) $28 + (byte) main::i#2) ← (byte~) main::$5 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __5
    ldy.z i
    sta SCREEN+5*$28,y
    // [18] (byte~) main::$24 ← (byte~) main::$16 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __16
    clc
    adc.z i
    sta.z __24
    // [19] (byte~) main::$25 ← (byte~) main::$24 << (byte) 1 -- vbuz1=vbuz2_rol_1 
    lda.z __24
    asl
    sta.z __25
    // [20] (byte~) main::$6 ← (byte~) main::$25 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __25
    clc
    adc.z i
    sta.z __6
    // [21] *((const byte*) main::SCREEN+(byte)(number) 6*(number) $28 + (byte) main::i#2) ← (byte~) main::$6 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __6
    ldy.z i
    sta SCREEN+6*$28,y
    // [22] (byte~) main::$27 ← (byte) main::i#2 << (byte) 3 -- vbuz1=vbuz2_rol_3 
    lda.z i
    asl
    asl
    asl
    sta.z __27
    // [23] *((const byte*) main::SCREEN+(word)(number) 7*(number) $28 + (byte) main::i#2) ← (byte~) main::$27 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __27
    ldy.z i
    sta SCREEN+7*$28,y
    // [24] (byte~) main::$8 ← (byte~) main::$27 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __27
    clc
    adc.z i
    sta.z __8
    // [25] *((const byte*) main::SCREEN+(word)(number) 8*(number) $28 + (byte) main::i#2) ← (byte~) main::$8 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __8
    ldy.z i
    sta SCREEN+8*$28,y
    // [26] (byte~) main::$30 ← (byte~) main::$18 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __18
    clc
    adc.z i
    sta.z __30
    // [27] (byte~) main::$9 ← (byte~) main::$30 << (byte) 1 -- vbuz1=vbuz2_rol_1 
    lda.z __30
    asl
    sta.z __9
    // [28] *((const byte*) main::SCREEN+(word)(number) 9*(number) $28 + (byte) main::i#2) ← (byte~) main::$9 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __9
    ldy.z i
    sta SCREEN+9*$28,y
    // [29] (byte~) main::$33 ← (byte~) main::$18 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __18
    clc
    adc.z i
    sta.z __33
    // [30] (byte~) main::$34 ← (byte~) main::$33 << (byte) 1 -- vbuz1=vbuz2_rol_1 
    lda.z __33
    asl
    sta.z __34
    // [31] (byte~) main::$10 ← (byte~) main::$34 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __34
    clc
    adc.z i
    sta.z __10
    // [32] *((const byte*) main::SCREEN+(word)(number) $a*(number) $28 + (byte) main::i#2) ← (byte~) main::$10 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __10
    ldy.z i
    sta SCREEN+$a*$28,y
    // [33] (byte~) main::$37 ← (byte~) main::$16 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __16
    clc
    adc.z i
    sta.z __37
    // [34] (byte~) main::$11 ← (byte~) main::$37 << (byte) 2 -- vbuz1=vbuz2_rol_2 
    lda.z __37
    asl
    asl
    sta.z __11
    // [35] *((const byte*) main::SCREEN+(word)(number) $b*(number) $28 + (byte) main::i#2) ← (byte~) main::$11 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __11
    ldy.z i
    sta SCREEN+$b*$28,y
    // [36] (byte~) main::$40 ← (byte~) main::$16 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __16
    clc
    adc.z i
    sta.z __40
    // [37] (byte~) main::$41 ← (byte~) main::$40 << (byte) 2 -- vbuz1=vbuz2_rol_2 
    lda.z __40
    asl
    asl
    sta.z __41
    // [38] (byte~) main::$12 ← (byte~) main::$41 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __41
    clc
    adc.z i
    sta.z __12
    // [39] *((const byte*) main::SCREEN+(word)(number) $c*(number) $28 + (byte) main::i#2) ← (byte~) main::$12 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __12
    ldy.z i
    sta SCREEN+$c*$28,y
    // [40] (byte~) main::$44 ← (byte~) main::$16 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __16
    clc
    adc.z i
    sta.z __44
    // [41] (byte~) main::$45 ← (byte~) main::$44 << (byte) 1 -- vbuz1=vbuz2_rol_1 
    lda.z __44
    asl
    sta.z __45
    // [42] (byte~) main::$46 ← (byte~) main::$45 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __45
    clc
    adc.z i
    sta.z __46
    // [43] (byte~) main::$13 ← (byte~) main::$46 << (byte) 1 -- vbuz1=vbuz2_rol_1 
    lda.z __46
    asl
    sta.z __13
    // [44] *((const byte*) main::SCREEN+(word)(number) $d*(number) $28 + (byte) main::i#2) ← (byte~) main::$13 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __13
    ldy.z i
    sta SCREEN+$d*$28,y
    // [45] (byte~) main::$49 ← (byte~) main::$16 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __16
    clc
    adc.z i
    sta.z __49
    // [46] (byte~) main::$50 ← (byte~) main::$49 << (byte) 1 -- vbuz1=vbuz2_rol_1 
    lda.z __49
    asl
    sta.z __50
    // [47] (byte~) main::$51 ← (byte~) main::$50 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __50
    clc
    adc.z i
    sta.z __51
    // [48] (byte~) main::$52 ← (byte~) main::$51 << (byte) 1 -- vbuz1=vbuz2_rol_1 
    lda.z __51
    asl
    sta.z __52
    // [49] (byte~) main::$14 ← (byte~) main::$52 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3 
    lda.z __52
    clc
    adc.z i
    sta.z __14
    // [50] *((const byte*) main::SCREEN+(word)(number) $e*(number) $28 + (byte) main::i#2) ← (byte~) main::$14 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __14
    ldy.z i
    sta SCREEN+$e*$28,y
    // [51] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [52] if((byte) main::i#1!=(byte) $12) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #$12
    cmp.z i
    bne __b1_from___b1
    jmp __breturn
    // main::@return
  __breturn:
    // [53] return 
    rts
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] (byte~) main::$16 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::$16 ] ( main:2 [ main::i#2 main::$16 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::i#2 main::i#1 ]
Statement [9] (byte~) main::$2 ← (byte~) main::$16 + (byte) main::i#2 [ main::i#2 main::$16 main::$2 ] ( main:2 [ main::i#2 main::$16 main::$2 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:3 [ main::$16 ]
Statement [11] (byte~) main::$18 ← (byte) main::i#2 << (byte) 2 [ main::i#2 main::$16 main::$18 ] ( main:2 [ main::i#2 main::$16 main::$18 ] ) always clobbers reg byte a 
Statement [13] (byte~) main::$4 ← (byte~) main::$18 + (byte) main::i#2 [ main::i#2 main::$16 main::$18 main::$4 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$4 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:5 [ main::$18 ]
Statement [15] (byte~) main::$21 ← (byte~) main::$16 + (byte) main::i#2 [ main::i#2 main::$16 main::$18 main::$21 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$21 ] ) always clobbers reg byte a 
Statement [16] (byte~) main::$5 ← (byte~) main::$21 << (byte) 1 [ main::i#2 main::$16 main::$18 main::$5 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$5 ] ) always clobbers reg byte a 
Statement [18] (byte~) main::$24 ← (byte~) main::$16 + (byte) main::i#2 [ main::i#2 main::$16 main::$18 main::$24 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$24 ] ) always clobbers reg byte a 
Statement [19] (byte~) main::$25 ← (byte~) main::$24 << (byte) 1 [ main::i#2 main::$16 main::$18 main::$25 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$25 ] ) always clobbers reg byte a 
Statement [20] (byte~) main::$6 ← (byte~) main::$25 + (byte) main::i#2 [ main::i#2 main::$16 main::$18 main::$6 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$6 ] ) always clobbers reg byte a 
Statement [22] (byte~) main::$27 ← (byte) main::i#2 << (byte) 3 [ main::i#2 main::$16 main::$18 main::$27 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$27 ] ) always clobbers reg byte a 
Statement [24] (byte~) main::$8 ← (byte~) main::$27 + (byte) main::i#2 [ main::i#2 main::$16 main::$18 main::$8 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$8 ] ) always clobbers reg byte a 
Statement [26] (byte~) main::$30 ← (byte~) main::$18 + (byte) main::i#2 [ main::i#2 main::$16 main::$18 main::$30 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$30 ] ) always clobbers reg byte a 
Statement [27] (byte~) main::$9 ← (byte~) main::$30 << (byte) 1 [ main::i#2 main::$16 main::$18 main::$9 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$9 ] ) always clobbers reg byte a 
Statement [29] (byte~) main::$33 ← (byte~) main::$18 + (byte) main::i#2 [ main::i#2 main::$16 main::$33 ] ( main:2 [ main::i#2 main::$16 main::$33 ] ) always clobbers reg byte a 
Statement [30] (byte~) main::$34 ← (byte~) main::$33 << (byte) 1 [ main::i#2 main::$16 main::$34 ] ( main:2 [ main::i#2 main::$16 main::$34 ] ) always clobbers reg byte a 
Statement [31] (byte~) main::$10 ← (byte~) main::$34 + (byte) main::i#2 [ main::i#2 main::$16 main::$10 ] ( main:2 [ main::i#2 main::$16 main::$10 ] ) always clobbers reg byte a 
Statement [33] (byte~) main::$37 ← (byte~) main::$16 + (byte) main::i#2 [ main::i#2 main::$16 main::$37 ] ( main:2 [ main::i#2 main::$16 main::$37 ] ) always clobbers reg byte a 
Statement [34] (byte~) main::$11 ← (byte~) main::$37 << (byte) 2 [ main::i#2 main::$16 main::$11 ] ( main:2 [ main::i#2 main::$16 main::$11 ] ) always clobbers reg byte a 
Statement [36] (byte~) main::$40 ← (byte~) main::$16 + (byte) main::i#2 [ main::i#2 main::$16 main::$40 ] ( main:2 [ main::i#2 main::$16 main::$40 ] ) always clobbers reg byte a 
Statement [37] (byte~) main::$41 ← (byte~) main::$40 << (byte) 2 [ main::i#2 main::$16 main::$41 ] ( main:2 [ main::i#2 main::$16 main::$41 ] ) always clobbers reg byte a 
Statement [38] (byte~) main::$12 ← (byte~) main::$41 + (byte) main::i#2 [ main::i#2 main::$16 main::$12 ] ( main:2 [ main::i#2 main::$16 main::$12 ] ) always clobbers reg byte a 
Statement [40] (byte~) main::$44 ← (byte~) main::$16 + (byte) main::i#2 [ main::i#2 main::$16 main::$44 ] ( main:2 [ main::i#2 main::$16 main::$44 ] ) always clobbers reg byte a 
Statement [41] (byte~) main::$45 ← (byte~) main::$44 << (byte) 1 [ main::i#2 main::$16 main::$45 ] ( main:2 [ main::i#2 main::$16 main::$45 ] ) always clobbers reg byte a 
Statement [42] (byte~) main::$46 ← (byte~) main::$45 + (byte) main::i#2 [ main::i#2 main::$16 main::$46 ] ( main:2 [ main::i#2 main::$16 main::$46 ] ) always clobbers reg byte a 
Statement [43] (byte~) main::$13 ← (byte~) main::$46 << (byte) 1 [ main::i#2 main::$16 main::$13 ] ( main:2 [ main::i#2 main::$16 main::$13 ] ) always clobbers reg byte a 
Statement [45] (byte~) main::$49 ← (byte~) main::$16 + (byte) main::i#2 [ main::i#2 main::$49 ] ( main:2 [ main::i#2 main::$49 ] ) always clobbers reg byte a 
Statement [46] (byte~) main::$50 ← (byte~) main::$49 << (byte) 1 [ main::i#2 main::$50 ] ( main:2 [ main::i#2 main::$50 ] ) always clobbers reg byte a 
Statement [47] (byte~) main::$51 ← (byte~) main::$50 + (byte) main::i#2 [ main::i#2 main::$51 ] ( main:2 [ main::i#2 main::$51 ] ) always clobbers reg byte a 
Statement [48] (byte~) main::$52 ← (byte~) main::$51 << (byte) 1 [ main::i#2 main::$52 ] ( main:2 [ main::i#2 main::$52 ] ) always clobbers reg byte a 
Statement [49] (byte~) main::$14 ← (byte~) main::$52 + (byte) main::i#2 [ main::i#2 main::$14 ] ( main:2 [ main::i#2 main::$14 ] ) always clobbers reg byte a 
Statement [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte) main::i#2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Statement [7] (byte~) main::$16 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::$16 ] ( main:2 [ main::i#2 main::$16 ] ) always clobbers reg byte a 
Statement [8] *((const byte*) main::SCREEN+(byte)(number) 1*(number) $28 + (byte) main::i#2) ← (byte~) main::$16 [ main::i#2 main::$16 ] ( main:2 [ main::i#2 main::$16 ] ) always clobbers reg byte a 
Statement [9] (byte~) main::$2 ← (byte~) main::$16 + (byte) main::i#2 [ main::i#2 main::$16 main::$2 ] ( main:2 [ main::i#2 main::$16 main::$2 ] ) always clobbers reg byte a 
Statement [11] (byte~) main::$18 ← (byte) main::i#2 << (byte) 2 [ main::i#2 main::$16 main::$18 ] ( main:2 [ main::i#2 main::$16 main::$18 ] ) always clobbers reg byte a 
Statement [12] *((const byte*) main::SCREEN+(byte)(number) 3*(number) $28 + (byte) main::i#2) ← (byte~) main::$18 [ main::i#2 main::$16 main::$18 ] ( main:2 [ main::i#2 main::$16 main::$18 ] ) always clobbers reg byte a 
Statement [13] (byte~) main::$4 ← (byte~) main::$18 + (byte) main::i#2 [ main::i#2 main::$16 main::$18 main::$4 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$4 ] ) always clobbers reg byte a 
Statement [15] (byte~) main::$21 ← (byte~) main::$16 + (byte) main::i#2 [ main::i#2 main::$16 main::$18 main::$21 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$21 ] ) always clobbers reg byte a 
Statement [16] (byte~) main::$5 ← (byte~) main::$21 << (byte) 1 [ main::i#2 main::$16 main::$18 main::$5 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$5 ] ) always clobbers reg byte a 
Statement [18] (byte~) main::$24 ← (byte~) main::$16 + (byte) main::i#2 [ main::i#2 main::$16 main::$18 main::$24 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$24 ] ) always clobbers reg byte a 
Statement [19] (byte~) main::$25 ← (byte~) main::$24 << (byte) 1 [ main::i#2 main::$16 main::$18 main::$25 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$25 ] ) always clobbers reg byte a 
Statement [20] (byte~) main::$6 ← (byte~) main::$25 + (byte) main::i#2 [ main::i#2 main::$16 main::$18 main::$6 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$6 ] ) always clobbers reg byte a 
Statement [22] (byte~) main::$27 ← (byte) main::i#2 << (byte) 3 [ main::i#2 main::$16 main::$18 main::$27 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$27 ] ) always clobbers reg byte a 
Statement [24] (byte~) main::$8 ← (byte~) main::$27 + (byte) main::i#2 [ main::i#2 main::$16 main::$18 main::$8 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$8 ] ) always clobbers reg byte a 
Statement [26] (byte~) main::$30 ← (byte~) main::$18 + (byte) main::i#2 [ main::i#2 main::$16 main::$18 main::$30 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$30 ] ) always clobbers reg byte a 
Statement [27] (byte~) main::$9 ← (byte~) main::$30 << (byte) 1 [ main::i#2 main::$16 main::$18 main::$9 ] ( main:2 [ main::i#2 main::$16 main::$18 main::$9 ] ) always clobbers reg byte a 
Statement [29] (byte~) main::$33 ← (byte~) main::$18 + (byte) main::i#2 [ main::i#2 main::$16 main::$33 ] ( main:2 [ main::i#2 main::$16 main::$33 ] ) always clobbers reg byte a 
Statement [30] (byte~) main::$34 ← (byte~) main::$33 << (byte) 1 [ main::i#2 main::$16 main::$34 ] ( main:2 [ main::i#2 main::$16 main::$34 ] ) always clobbers reg byte a 
Statement [31] (byte~) main::$10 ← (byte~) main::$34 + (byte) main::i#2 [ main::i#2 main::$16 main::$10 ] ( main:2 [ main::i#2 main::$16 main::$10 ] ) always clobbers reg byte a 
Statement [33] (byte~) main::$37 ← (byte~) main::$16 + (byte) main::i#2 [ main::i#2 main::$16 main::$37 ] ( main:2 [ main::i#2 main::$16 main::$37 ] ) always clobbers reg byte a 
Statement [34] (byte~) main::$11 ← (byte~) main::$37 << (byte) 2 [ main::i#2 main::$16 main::$11 ] ( main:2 [ main::i#2 main::$16 main::$11 ] ) always clobbers reg byte a 
Statement [36] (byte~) main::$40 ← (byte~) main::$16 + (byte) main::i#2 [ main::i#2 main::$16 main::$40 ] ( main:2 [ main::i#2 main::$16 main::$40 ] ) always clobbers reg byte a 
Statement [37] (byte~) main::$41 ← (byte~) main::$40 << (byte) 2 [ main::i#2 main::$16 main::$41 ] ( main:2 [ main::i#2 main::$16 main::$41 ] ) always clobbers reg byte a 
Statement [38] (byte~) main::$12 ← (byte~) main::$41 + (byte) main::i#2 [ main::i#2 main::$16 main::$12 ] ( main:2 [ main::i#2 main::$16 main::$12 ] ) always clobbers reg byte a 
Statement [40] (byte~) main::$44 ← (byte~) main::$16 + (byte) main::i#2 [ main::i#2 main::$16 main::$44 ] ( main:2 [ main::i#2 main::$16 main::$44 ] ) always clobbers reg byte a 
Statement [41] (byte~) main::$45 ← (byte~) main::$44 << (byte) 1 [ main::i#2 main::$16 main::$45 ] ( main:2 [ main::i#2 main::$16 main::$45 ] ) always clobbers reg byte a 
Statement [42] (byte~) main::$46 ← (byte~) main::$45 + (byte) main::i#2 [ main::i#2 main::$16 main::$46 ] ( main:2 [ main::i#2 main::$16 main::$46 ] ) always clobbers reg byte a 
Statement [43] (byte~) main::$13 ← (byte~) main::$46 << (byte) 1 [ main::i#2 main::$16 main::$13 ] ( main:2 [ main::i#2 main::$16 main::$13 ] ) always clobbers reg byte a 
Statement [45] (byte~) main::$49 ← (byte~) main::$16 + (byte) main::i#2 [ main::i#2 main::$49 ] ( main:2 [ main::i#2 main::$49 ] ) always clobbers reg byte a 
Statement [46] (byte~) main::$50 ← (byte~) main::$49 << (byte) 1 [ main::i#2 main::$50 ] ( main:2 [ main::i#2 main::$50 ] ) always clobbers reg byte a 
Statement [47] (byte~) main::$51 ← (byte~) main::$50 + (byte) main::i#2 [ main::i#2 main::$51 ] ( main:2 [ main::i#2 main::$51 ] ) always clobbers reg byte a 
Statement [48] (byte~) main::$52 ← (byte~) main::$51 << (byte) 1 [ main::i#2 main::$52 ] ( main:2 [ main::i#2 main::$52 ] ) always clobbers reg byte a 
Statement [49] (byte~) main::$14 ← (byte~) main::$52 + (byte) main::i#2 [ main::i#2 main::$14 ] ( main:2 [ main::i#2 main::$14 ] ) always clobbers reg byte a 
Potential registers zp[1]:2 [ main::i#2 main::i#1 ] : zp[1]:2 , reg byte x , reg byte y , 
Potential registers zp[1]:3 [ main::$16 ] : zp[1]:3 , reg byte x , reg byte y , 
Potential registers zp[1]:4 [ main::$2 ] : zp[1]:4 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:5 [ main::$18 ] : zp[1]:5 , reg byte x , reg byte y , 
Potential registers zp[1]:6 [ main::$4 ] : zp[1]:6 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:7 [ main::$21 ] : zp[1]:7 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:8 [ main::$5 ] : zp[1]:8 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:9 [ main::$24 ] : zp[1]:9 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:10 [ main::$25 ] : zp[1]:10 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:11 [ main::$6 ] : zp[1]:11 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:12 [ main::$27 ] : zp[1]:12 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:13 [ main::$8 ] : zp[1]:13 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:14 [ main::$30 ] : zp[1]:14 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:15 [ main::$9 ] : zp[1]:15 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:16 [ main::$33 ] : zp[1]:16 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:17 [ main::$34 ] : zp[1]:17 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:18 [ main::$10 ] : zp[1]:18 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:19 [ main::$37 ] : zp[1]:19 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:20 [ main::$11 ] : zp[1]:20 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:21 [ main::$40 ] : zp[1]:21 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:22 [ main::$41 ] : zp[1]:22 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:23 [ main::$12 ] : zp[1]:23 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:24 [ main::$44 ] : zp[1]:24 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:25 [ main::$45 ] : zp[1]:25 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:26 [ main::$46 ] : zp[1]:26 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:27 [ main::$13 ] : zp[1]:27 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:28 [ main::$49 ] : zp[1]:28 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:29 [ main::$50 ] : zp[1]:29 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:30 [ main::$51 ] : zp[1]:30 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:31 [ main::$52 ] : zp[1]:31 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:32 [ main::$14 ] : zp[1]:32 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 25.59: zp[1]:2 [ main::i#2 main::i#1 ] 22: zp[1]:4 [ main::$2 ] 22: zp[1]:6 [ main::$4 ] 22: zp[1]:7 [ main::$21 ] 22: zp[1]:8 [ main::$5 ] 22: zp[1]:9 [ main::$24 ] 22: zp[1]:10 [ main::$25 ] 22: zp[1]:11 [ main::$6 ] 22: zp[1]:13 [ main::$8 ] 22: zp[1]:14 [ main::$30 ] 22: zp[1]:15 [ main::$9 ] 22: zp[1]:16 [ main::$33 ] 22: zp[1]:17 [ main::$34 ] 22: zp[1]:18 [ main::$10 ] 22: zp[1]:19 [ main::$37 ] 22: zp[1]:20 [ main::$11 ] 22: zp[1]:21 [ main::$40 ] 22: zp[1]:22 [ main::$41 ] 22: zp[1]:23 [ main::$12 ] 22: zp[1]:24 [ main::$44 ] 22: zp[1]:25 [ main::$45 ] 22: zp[1]:26 [ main::$46 ] 22: zp[1]:27 [ main::$13 ] 22: zp[1]:28 [ main::$49 ] 22: zp[1]:29 [ main::$50 ] 22: zp[1]:30 [ main::$51 ] 22: zp[1]:31 [ main::$52 ] 22: zp[1]:32 [ main::$14 ] 16.5: zp[1]:12 [ main::$27 ] 3.06: zp[1]:5 [ main::$18 ] 2.61: zp[1]:3 [ main::$16 ] 
Uplift Scope [] 

Uplifting [] best 4933 combination 
Attempting to uplift remaining variables inzp[1]:2 [ main::i#2 main::i#1 ]
Uplifting [main] best 4193 combination reg byte x [ main::i#2 main::i#1 ] 
Attempting to uplift remaining variables inzp[1]:4 [ main::$2 ]
Uplifting [main] best 4133 combination reg byte a [ main::$2 ] 
Attempting to uplift remaining variables inzp[1]:6 [ main::$4 ]
Uplifting [main] best 4073 combination reg byte a [ main::$4 ] 
Attempting to uplift remaining variables inzp[1]:7 [ main::$21 ]
Uplifting [main] best 4013 combination reg byte a [ main::$21 ] 
Attempting to uplift remaining variables inzp[1]:8 [ main::$5 ]
Uplifting [main] best 3953 combination reg byte a [ main::$5 ] 
Attempting to uplift remaining variables inzp[1]:9 [ main::$24 ]
Uplifting [main] best 3893 combination reg byte a [ main::$24 ] 
Attempting to uplift remaining variables inzp[1]:10 [ main::$25 ]
Uplifting [main] best 3873 combination reg byte a [ main::$25 ] 
Attempting to uplift remaining variables inzp[1]:11 [ main::$6 ]
Uplifting [main] best 3813 combination reg byte a [ main::$6 ] 
Attempting to uplift remaining variables inzp[1]:13 [ main::$8 ]
Uplifting [main] best 3753 combination reg byte a [ main::$8 ] 
Attempting to uplift remaining variables inzp[1]:14 [ main::$30 ]
Uplifting [main] best 3693 combination reg byte a [ main::$30 ] 
Attempting to uplift remaining variables inzp[1]:15 [ main::$9 ]
Uplifting [main] best 3633 combination reg byte a [ main::$9 ] 
Attempting to uplift remaining variables inzp[1]:16 [ main::$33 ]
Uplifting [main] best 3573 combination reg byte a [ main::$33 ] 
Attempting to uplift remaining variables inzp[1]:17 [ main::$34 ]
Uplifting [main] best 3553 combination reg byte a [ main::$34 ] 
Attempting to uplift remaining variables inzp[1]:18 [ main::$10 ]
Uplifting [main] best 3493 combination reg byte a [ main::$10 ] 
Attempting to uplift remaining variables inzp[1]:19 [ main::$37 ]
Uplifting [main] best 3433 combination reg byte a [ main::$37 ] 
Attempting to uplift remaining variables inzp[1]:20 [ main::$11 ]
Uplifting [main] best 3373 combination reg byte a [ main::$11 ] 
Attempting to uplift remaining variables inzp[1]:21 [ main::$40 ]
Uplifting [main] best 3313 combination reg byte a [ main::$40 ] 
Attempting to uplift remaining variables inzp[1]:22 [ main::$41 ]
Uplifting [main] best 3293 combination reg byte a [ main::$41 ] 
Attempting to uplift remaining variables inzp[1]:23 [ main::$12 ]
Uplifting [main] best 3233 combination reg byte a [ main::$12 ] 
Attempting to uplift remaining variables inzp[1]:24 [ main::$44 ]
Uplifting [main] best 3173 combination reg byte a [ main::$44 ] 
Attempting to uplift remaining variables inzp[1]:25 [ main::$45 ]
Uplifting [main] best 3153 combination reg byte a [ main::$45 ] 
Attempting to uplift remaining variables inzp[1]:26 [ main::$46 ]
Uplifting [main] best 3093 combination reg byte a [ main::$46 ] 
Attempting to uplift remaining variables inzp[1]:27 [ main::$13 ]
Uplifting [main] best 3033 combination reg byte a [ main::$13 ] 
Attempting to uplift remaining variables inzp[1]:28 [ main::$49 ]
Uplifting [main] best 2973 combination reg byte a [ main::$49 ] 
Attempting to uplift remaining variables inzp[1]:29 [ main::$50 ]
Uplifting [main] best 2953 combination reg byte a [ main::$50 ] 
Attempting to uplift remaining variables inzp[1]:30 [ main::$51 ]
Uplifting [main] best 2893 combination reg byte a [ main::$51 ] 
Attempting to uplift remaining variables inzp[1]:31 [ main::$52 ]
Uplifting [main] best 2873 combination reg byte a [ main::$52 ] 
Attempting to uplift remaining variables inzp[1]:32 [ main::$14 ]
Uplifting [main] best 2813 combination reg byte a [ main::$14 ] 
Attempting to uplift remaining variables inzp[1]:12 [ main::$27 ]
Uplifting [main] best 2763 combination reg byte a [ main::$27 ] 
Attempting to uplift remaining variables inzp[1]:5 [ main::$18 ]
Uplifting [main] best 2763 combination zp[1]:5 [ main::$18 ] 
Attempting to uplift remaining variables inzp[1]:3 [ main::$16 ]
Uplifting [main] best 2763 combination zp[1]:3 [ main::$16 ] 
Allocated (was zp[1]:3) zp[1]:2 [ main::$16 ]
Allocated (was zp[1]:5) zp[1]:3 [ main::$18 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Check that multiplication by constants is converted to shift/add
  // 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 SCREEN = $400
    .label __16 = 2
    .label __18 = 3
    // [5] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 
    ldx #0
    jmp __b1
    // [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
  __b1_from___b1:
    // [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy 
    jmp __b1
    // main::@1
  __b1:
    // [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx 
    txa
    sta SCREEN,x
    // [7] (byte~) main::$16 ← (byte) main::i#2 << (byte) 1 -- vbuz1=vbuxx_rol_1 
    txa
    asl
    sta.z __16
    // [8] *((const byte*) main::SCREEN+(byte)(number) 1*(number) $28 + (byte) main::i#2) ← (byte~) main::$16 -- pbuc1_derefidx_vbuxx=vbuz1 
    lda.z __16
    sta SCREEN+1*$28,x
    // [9] (byte~) main::$2 ← (byte~) main::$16 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __16
    // [10] *((const byte*) main::SCREEN+(byte)(number) 2*(number) $28 + (byte) main::i#2) ← (byte~) main::$2 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+2*$28,x
    // [11] (byte~) main::$18 ← (byte) main::i#2 << (byte) 2 -- vbuz1=vbuxx_rol_2 
    txa
    asl
    asl
    sta.z __18
    // [12] *((const byte*) main::SCREEN+(byte)(number) 3*(number) $28 + (byte) main::i#2) ← (byte~) main::$18 -- pbuc1_derefidx_vbuxx=vbuz1 
    lda.z __18
    sta SCREEN+3*$28,x
    // [13] (byte~) main::$4 ← (byte~) main::$18 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __18
    // [14] *((const byte*) main::SCREEN+(byte)(number) 4*(number) $28 + (byte) main::i#2) ← (byte~) main::$4 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+4*$28,x
    // [15] (byte~) main::$21 ← (byte~) main::$16 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __16
    // [16] (byte~) main::$5 ← (byte~) main::$21 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // [17] *((const byte*) main::SCREEN+(byte)(number) 5*(number) $28 + (byte) main::i#2) ← (byte~) main::$5 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+5*$28,x
    // [18] (byte~) main::$24 ← (byte~) main::$16 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __16
    // [19] (byte~) main::$25 ← (byte~) main::$24 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // [20] (byte~) main::$6 ← (byte~) main::$25 + (byte) main::i#2 -- vbuaa=vbuaa_plus_vbuxx 
    stx.z $ff
    clc
    adc.z $ff
    // [21] *((const byte*) main::SCREEN+(byte)(number) 6*(number) $28 + (byte) main::i#2) ← (byte~) main::$6 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+6*$28,x
    // [22] (byte~) main::$27 ← (byte) main::i#2 << (byte) 3 -- vbuaa=vbuxx_rol_3 
    txa
    asl
    asl
    asl
    // [23] *((const byte*) main::SCREEN+(word)(number) 7*(number) $28 + (byte) main::i#2) ← (byte~) main::$27 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+7*$28,x
    // [24] (byte~) main::$8 ← (byte~) main::$27 + (byte) main::i#2 -- vbuaa=vbuaa_plus_vbuxx 
    stx.z $ff
    clc
    adc.z $ff
    // [25] *((const byte*) main::SCREEN+(word)(number) 8*(number) $28 + (byte) main::i#2) ← (byte~) main::$8 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+8*$28,x
    // [26] (byte~) main::$30 ← (byte~) main::$18 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __18
    // [27] (byte~) main::$9 ← (byte~) main::$30 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // [28] *((const byte*) main::SCREEN+(word)(number) 9*(number) $28 + (byte) main::i#2) ← (byte~) main::$9 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+9*$28,x
    // [29] (byte~) main::$33 ← (byte~) main::$18 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __18
    // [30] (byte~) main::$34 ← (byte~) main::$33 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // [31] (byte~) main::$10 ← (byte~) main::$34 + (byte) main::i#2 -- vbuaa=vbuaa_plus_vbuxx 
    stx.z $ff
    clc
    adc.z $ff
    // [32] *((const byte*) main::SCREEN+(word)(number) $a*(number) $28 + (byte) main::i#2) ← (byte~) main::$10 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+$a*$28,x
    // [33] (byte~) main::$37 ← (byte~) main::$16 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __16
    // [34] (byte~) main::$11 ← (byte~) main::$37 << (byte) 2 -- vbuaa=vbuaa_rol_2 
    asl
    asl
    // [35] *((const byte*) main::SCREEN+(word)(number) $b*(number) $28 + (byte) main::i#2) ← (byte~) main::$11 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+$b*$28,x
    // [36] (byte~) main::$40 ← (byte~) main::$16 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __16
    // [37] (byte~) main::$41 ← (byte~) main::$40 << (byte) 2 -- vbuaa=vbuaa_rol_2 
    asl
    asl
    // [38] (byte~) main::$12 ← (byte~) main::$41 + (byte) main::i#2 -- vbuaa=vbuaa_plus_vbuxx 
    stx.z $ff
    clc
    adc.z $ff
    // [39] *((const byte*) main::SCREEN+(word)(number) $c*(number) $28 + (byte) main::i#2) ← (byte~) main::$12 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+$c*$28,x
    // [40] (byte~) main::$44 ← (byte~) main::$16 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __16
    // [41] (byte~) main::$45 ← (byte~) main::$44 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // [42] (byte~) main::$46 ← (byte~) main::$45 + (byte) main::i#2 -- vbuaa=vbuaa_plus_vbuxx 
    stx.z $ff
    clc
    adc.z $ff
    // [43] (byte~) main::$13 ← (byte~) main::$46 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // [44] *((const byte*) main::SCREEN+(word)(number) $d*(number) $28 + (byte) main::i#2) ← (byte~) main::$13 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+$d*$28,x
    // [45] (byte~) main::$49 ← (byte~) main::$16 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __16
    // [46] (byte~) main::$50 ← (byte~) main::$49 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // [47] (byte~) main::$51 ← (byte~) main::$50 + (byte) main::i#2 -- vbuaa=vbuaa_plus_vbuxx 
    stx.z $ff
    clc
    adc.z $ff
    // [48] (byte~) main::$52 ← (byte~) main::$51 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // [49] (byte~) main::$14 ← (byte~) main::$52 + (byte) main::i#2 -- vbuaa=vbuaa_plus_vbuxx 
    stx.z $ff
    clc
    adc.z $ff
    // [50] *((const byte*) main::SCREEN+(word)(number) $e*(number) $28 + (byte) main::i#2) ← (byte~) main::$14 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+$e*$28,x
    // [51] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [52] if((byte) main::i#1!=(byte) $12) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$12
    bne __b1_from___b1
    jmp __breturn
    // main::@return
  __breturn:
    // [53] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __bend
Removing instruction jmp __b1
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda.z __16
Removing instruction lda.z __18
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label __bbegin 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 __breturn:
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
Fixing long branch [102] bne __b1 to beq

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(void()) main()
(byte~) main::$10 reg byte a 22.0
(byte~) main::$11 reg byte a 22.0
(byte~) main::$12 reg byte a 22.0
(byte~) main::$13 reg byte a 22.0
(byte~) main::$14 reg byte a 22.0
(byte~) main::$16 zp[1]:2 2.605263157894737
(byte~) main::$18 zp[1]:3 3.055555555555556
(byte~) main::$2 reg byte a 22.0
(byte~) main::$21 reg byte a 22.0
(byte~) main::$24 reg byte a 22.0
(byte~) main::$25 reg byte a 22.0
(byte~) main::$27 reg byte a 16.5
(byte~) main::$30 reg byte a 22.0
(byte~) main::$33 reg byte a 22.0
(byte~) main::$34 reg byte a 22.0
(byte~) main::$37 reg byte a 22.0
(byte~) main::$4 reg byte a 22.0
(byte~) main::$40 reg byte a 22.0
(byte~) main::$41 reg byte a 22.0
(byte~) main::$44 reg byte a 22.0
(byte~) main::$45 reg byte a 22.0
(byte~) main::$46 reg byte a 22.0
(byte~) main::$49 reg byte a 22.0
(byte~) main::$5 reg byte a 22.0
(byte~) main::$50 reg byte a 22.0
(byte~) main::$51 reg byte a 22.0
(byte~) main::$52 reg byte a 22.0
(byte~) main::$6 reg byte a 22.0
(byte~) main::$8 reg byte a 22.0
(byte~) main::$9 reg byte a 22.0
(label) main::@1
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(byte) main::i
(byte) main::i#1 reg byte x 16.5
(byte) main::i#2 reg byte x 9.086956521739129

reg byte x [ main::i#2 main::i#1 ]
zp[1]:2 [ main::$16 ]
reg byte a [ main::$2 ]
zp[1]:3 [ main::$18 ]
reg byte a [ main::$4 ]
reg byte a [ main::$21 ]
reg byte a [ main::$5 ]
reg byte a [ main::$24 ]
reg byte a [ main::$25 ]
reg byte a [ main::$6 ]
reg byte a [ main::$27 ]
reg byte a [ main::$8 ]
reg byte a [ main::$30 ]
reg byte a [ main::$9 ]
reg byte a [ main::$33 ]
reg byte a [ main::$34 ]
reg byte a [ main::$10 ]
reg byte a [ main::$37 ]
reg byte a [ main::$11 ]
reg byte a [ main::$40 ]
reg byte a [ main::$41 ]
reg byte a [ main::$12 ]
reg byte a [ main::$44 ]
reg byte a [ main::$45 ]
reg byte a [ main::$46 ]
reg byte a [ main::$13 ]
reg byte a [ main::$49 ]
reg byte a [ main::$50 ]
reg byte a [ main::$51 ]
reg byte a [ main::$52 ]
reg byte a [ main::$14 ]


FINAL ASSEMBLER
Score: 2631

  // File Comments
// Check that multiplication by constants is converted to shift/add
  // 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 SCREEN = $400
    .label __16 = 2
    .label __18 = 3
    // [5] phi from main to main::@1 [phi:main->main::@1]
    // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 
    ldx #0
    // [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
    // [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy 
    // main::@1
  __b1:
    // (SCREEN+0*40)[i] = i*1
    // [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx 
    txa
    sta SCREEN,x
    // i*2
    // [7] (byte~) main::$16 ← (byte) main::i#2 << (byte) 1 -- vbuz1=vbuxx_rol_1 
    txa
    asl
    sta.z __16
    // (SCREEN+1*40)[i] = i*2
    // [8] *((const byte*) main::SCREEN+(byte)(number) 1*(number) $28 + (byte) main::i#2) ← (byte~) main::$16 -- pbuc1_derefidx_vbuxx=vbuz1 
    sta SCREEN+1*$28,x
    // i*3
    // [9] (byte~) main::$2 ← (byte~) main::$16 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __16
    // (SCREEN+2*40)[i] = i*3
    // [10] *((const byte*) main::SCREEN+(byte)(number) 2*(number) $28 + (byte) main::i#2) ← (byte~) main::$2 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+2*$28,x
    // i*4
    // [11] (byte~) main::$18 ← (byte) main::i#2 << (byte) 2 -- vbuz1=vbuxx_rol_2 
    txa
    asl
    asl
    sta.z __18
    // (SCREEN+3*40)[i] = i*4
    // [12] *((const byte*) main::SCREEN+(byte)(number) 3*(number) $28 + (byte) main::i#2) ← (byte~) main::$18 -- pbuc1_derefidx_vbuxx=vbuz1 
    sta SCREEN+3*$28,x
    // i*5
    // [13] (byte~) main::$4 ← (byte~) main::$18 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __18
    // (SCREEN+4*40)[i] = i*5
    // [14] *((const byte*) main::SCREEN+(byte)(number) 4*(number) $28 + (byte) main::i#2) ← (byte~) main::$4 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+4*$28,x
    // i*6
    // [15] (byte~) main::$21 ← (byte~) main::$16 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __16
    // [16] (byte~) main::$5 ← (byte~) main::$21 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // (SCREEN+5*40)[i] = i*6
    // [17] *((const byte*) main::SCREEN+(byte)(number) 5*(number) $28 + (byte) main::i#2) ← (byte~) main::$5 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+5*$28,x
    // i*7
    // [18] (byte~) main::$24 ← (byte~) main::$16 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __16
    // [19] (byte~) main::$25 ← (byte~) main::$24 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // [20] (byte~) main::$6 ← (byte~) main::$25 + (byte) main::i#2 -- vbuaa=vbuaa_plus_vbuxx 
    stx.z $ff
    clc
    adc.z $ff
    // (SCREEN+6*40)[i] = i*7
    // [21] *((const byte*) main::SCREEN+(byte)(number) 6*(number) $28 + (byte) main::i#2) ← (byte~) main::$6 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+6*$28,x
    // i*8
    // [22] (byte~) main::$27 ← (byte) main::i#2 << (byte) 3 -- vbuaa=vbuxx_rol_3 
    txa
    asl
    asl
    asl
    // (SCREEN+7*40)[i] = i*8
    // [23] *((const byte*) main::SCREEN+(word)(number) 7*(number) $28 + (byte) main::i#2) ← (byte~) main::$27 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+7*$28,x
    // i*9
    // [24] (byte~) main::$8 ← (byte~) main::$27 + (byte) main::i#2 -- vbuaa=vbuaa_plus_vbuxx 
    stx.z $ff
    clc
    adc.z $ff
    // (SCREEN+8*40)[i] = i*9
    // [25] *((const byte*) main::SCREEN+(word)(number) 8*(number) $28 + (byte) main::i#2) ← (byte~) main::$8 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+8*$28,x
    // i*10
    // [26] (byte~) main::$30 ← (byte~) main::$18 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __18
    // [27] (byte~) main::$9 ← (byte~) main::$30 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // (SCREEN+9*40)[i] = i*10
    // [28] *((const byte*) main::SCREEN+(word)(number) 9*(number) $28 + (byte) main::i#2) ← (byte~) main::$9 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+9*$28,x
    // i*11
    // [29] (byte~) main::$33 ← (byte~) main::$18 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __18
    // [30] (byte~) main::$34 ← (byte~) main::$33 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // [31] (byte~) main::$10 ← (byte~) main::$34 + (byte) main::i#2 -- vbuaa=vbuaa_plus_vbuxx 
    stx.z $ff
    clc
    adc.z $ff
    // (SCREEN+10*40)[i] = i*11
    // [32] *((const byte*) main::SCREEN+(word)(number) $a*(number) $28 + (byte) main::i#2) ← (byte~) main::$10 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+$a*$28,x
    // i*12
    // [33] (byte~) main::$37 ← (byte~) main::$16 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __16
    // [34] (byte~) main::$11 ← (byte~) main::$37 << (byte) 2 -- vbuaa=vbuaa_rol_2 
    asl
    asl
    // (SCREEN+11*40)[i] = i*12
    // [35] *((const byte*) main::SCREEN+(word)(number) $b*(number) $28 + (byte) main::i#2) ← (byte~) main::$11 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+$b*$28,x
    // i*13
    // [36] (byte~) main::$40 ← (byte~) main::$16 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __16
    // [37] (byte~) main::$41 ← (byte~) main::$40 << (byte) 2 -- vbuaa=vbuaa_rol_2 
    asl
    asl
    // [38] (byte~) main::$12 ← (byte~) main::$41 + (byte) main::i#2 -- vbuaa=vbuaa_plus_vbuxx 
    stx.z $ff
    clc
    adc.z $ff
    // (SCREEN+12*40)[i] = i*13
    // [39] *((const byte*) main::SCREEN+(word)(number) $c*(number) $28 + (byte) main::i#2) ← (byte~) main::$12 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+$c*$28,x
    // i*14
    // [40] (byte~) main::$44 ← (byte~) main::$16 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __16
    // [41] (byte~) main::$45 ← (byte~) main::$44 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // [42] (byte~) main::$46 ← (byte~) main::$45 + (byte) main::i#2 -- vbuaa=vbuaa_plus_vbuxx 
    stx.z $ff
    clc
    adc.z $ff
    // [43] (byte~) main::$13 ← (byte~) main::$46 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // (SCREEN+13*40)[i] = i*14
    // [44] *((const byte*) main::SCREEN+(word)(number) $d*(number) $28 + (byte) main::i#2) ← (byte~) main::$13 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+$d*$28,x
    // i*15
    // [45] (byte~) main::$49 ← (byte~) main::$16 + (byte) main::i#2 -- vbuaa=vbuz1_plus_vbuxx 
    txa
    clc
    adc.z __16
    // [46] (byte~) main::$50 ← (byte~) main::$49 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // [47] (byte~) main::$51 ← (byte~) main::$50 + (byte) main::i#2 -- vbuaa=vbuaa_plus_vbuxx 
    stx.z $ff
    clc
    adc.z $ff
    // [48] (byte~) main::$52 ← (byte~) main::$51 << (byte) 1 -- vbuaa=vbuaa_rol_1 
    asl
    // [49] (byte~) main::$14 ← (byte~) main::$52 + (byte) main::i#2 -- vbuaa=vbuaa_plus_vbuxx 
    stx.z $ff
    clc
    adc.z $ff
    // (SCREEN+14*40)[i] = i*15
    // [50] *((const byte*) main::SCREEN+(word)(number) $e*(number) $28 + (byte) main::i#2) ← (byte~) main::$14 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta SCREEN+$e*$28,x
    // for(byte i: 0..17)
    // [51] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [52] if((byte) main::i#1!=(byte) $12) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$12
    beq !__b1+
    jmp __b1
  !__b1:
    // main::@return
    // }
    // [53] return 
    rts
}
  // File Data

