Identified constant variable (byte*) rvalue::screen2
Identified constant variable (byte) lvaluevar::b
Identified constant variable (byte*) rvaluevar::screen2
Culled Empty Block (label) @1
Culled Empty Block (label) lvalue::@4
Culled Empty Block (label) lvalue::@3
Culled Empty Block (label) lvalue::@5
Culled Empty Block (label) lvalue::@6
Culled Empty Block (label) @2
Culled Empty Block (label) rvalue::@4
Culled Empty Block (label) rvalue::@5
Culled Empty Block (label) rvalue::@6
Culled Empty Block (label) @3
Culled Empty Block (label) lvaluevar::@4
Culled Empty Block (label) lvaluevar::@3
Culled Empty Block (label) lvaluevar::@5
Culled Empty Block (label) lvaluevar::@6
Culled Empty Block (label) @4
Culled Empty Block (label) rvaluevar::@4
Culled Empty Block (label) rvaluevar::@5
Culled Empty Block (label) rvaluevar::@6

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

(void()) main()
main: scope:[main]  from @5
  call lvalue 
  to:main::@1
main::@1: scope:[main]  from main
  call rvalue 
  to:main::@2
main::@2: scope:[main]  from main::@1
  call rvaluevar 
  to:main::@3
main::@3: scope:[main]  from main::@2
  call lvaluevar 
  to:main::@4
main::@4: scope:[main]  from main::@3
  to:main::@return
main::@return: scope:[main]  from main::@4
  return 
  to:@return

(void()) lvalue()
lvalue: scope:[lvalue]  from main
  *((const byte*) lvalue::SCREEN) ← (number) 1
  *((const byte*) lvalue::SCREEN + (number) 1) ← (number) 2
  (byte) lvalue::i#0 ← (byte) 2
  to:lvalue::@1
lvalue::@1: scope:[lvalue]  from lvalue lvalue::@2
  (byte) lvalue::i#2 ← phi( lvalue/(byte) lvalue::i#0 lvalue::@2/(byte) lvalue::i#1 )
  (bool~) lvalue::$0 ← (byte) lvalue::i#2 < (number) $a
  if((bool~) lvalue::$0) goto lvalue::@2
  to:lvalue::@return
lvalue::@2: scope:[lvalue]  from lvalue::@1
  (byte) lvalue::i#3 ← phi( lvalue::@1/(byte) lvalue::i#2 )
  *((const byte*) lvalue::SCREEN + (byte) lvalue::i#3) ← (number) 3
  (byte) lvalue::i#1 ← ++ (byte) lvalue::i#3
  to:lvalue::@1
lvalue::@return: scope:[lvalue]  from lvalue::@1
  return 
  to:@return

(void()) rvalue()
rvalue: scope:[rvalue]  from main::@1
  (byte) rvalue::b#0 ← *((const byte*) rvalue::SCREEN)
  (byte) rvalue::b#1 ← *((const byte*) rvalue::SCREEN + (number) 1)
  (byte) rvalue::i#0 ← (byte) 2
  to:rvalue::@1
rvalue::@1: scope:[rvalue]  from rvalue rvalue::@2
  (byte) rvalue::b#4 ← phi( rvalue/(byte) rvalue::b#1 rvalue::@2/(byte) rvalue::b#2 )
  (byte) rvalue::i#2 ← phi( rvalue/(byte) rvalue::i#0 rvalue::@2/(byte) rvalue::i#1 )
  (bool~) rvalue::$0 ← (byte) rvalue::i#2 < (number) $a
  if((bool~) rvalue::$0) goto rvalue::@2
  to:rvalue::@3
rvalue::@2: scope:[rvalue]  from rvalue::@1
  (byte) rvalue::i#3 ← phi( rvalue::@1/(byte) rvalue::i#2 )
  (byte) rvalue::b#2 ← *((const byte*) rvalue::SCREEN + (byte) rvalue::i#3)
  (byte) rvalue::i#1 ← ++ (byte) rvalue::i#3
  to:rvalue::@1
rvalue::@3: scope:[rvalue]  from rvalue::@1
  (byte) rvalue::b#3 ← phi( rvalue::@1/(byte) rvalue::b#4 )
  *((const byte*) rvalue::screen2) ← (byte) rvalue::b#3
  to:rvalue::@return
rvalue::@return: scope:[rvalue]  from rvalue::@3
  return 
  to:@return

(void()) lvaluevar()
lvaluevar: scope:[lvaluevar]  from main::@3
  (byte*) lvaluevar::screen#0 ← (byte*)(number) $400
  (byte) lvaluevar::i#0 ← (byte) 2
  to:lvaluevar::@1
lvaluevar::@1: scope:[lvaluevar]  from lvaluevar lvaluevar::@2
  (byte*) lvaluevar::screen#3 ← phi( lvaluevar/(byte*) lvaluevar::screen#0 lvaluevar::@2/(byte*) lvaluevar::screen#1 )
  (byte) lvaluevar::i#2 ← phi( lvaluevar/(byte) lvaluevar::i#0 lvaluevar::@2/(byte) lvaluevar::i#1 )
  (bool~) lvaluevar::$0 ← (byte) lvaluevar::i#2 < (number) $a
  if((bool~) lvaluevar::$0) goto lvaluevar::@2
  to:lvaluevar::@return
lvaluevar::@2: scope:[lvaluevar]  from lvaluevar::@1
  (byte) lvaluevar::i#3 ← phi( lvaluevar::@1/(byte) lvaluevar::i#2 )
  (byte*) lvaluevar::screen#2 ← phi( lvaluevar::@1/(byte*) lvaluevar::screen#3 )
  *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b
  (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2
  (byte) lvaluevar::i#1 ← ++ (byte) lvaluevar::i#3
  to:lvaluevar::@1
lvaluevar::@return: scope:[lvaluevar]  from lvaluevar::@1
  return 
  to:@return

(void()) rvaluevar()
rvaluevar: scope:[rvaluevar]  from main::@2
  (byte*) rvaluevar::screen#0 ← (byte*)(number) $400
  (byte) rvaluevar::b#0 ← (byte) 0
  (byte) rvaluevar::i#0 ← (byte) 2
  to:rvaluevar::@1
rvaluevar::@1: scope:[rvaluevar]  from rvaluevar rvaluevar::@2
  (byte) rvaluevar::b#3 ← phi( rvaluevar/(byte) rvaluevar::b#0 rvaluevar::@2/(byte) rvaluevar::b#1 )
  (byte*) rvaluevar::screen#3 ← phi( rvaluevar/(byte*) rvaluevar::screen#0 rvaluevar::@2/(byte*) rvaluevar::screen#1 )
  (byte) rvaluevar::i#2 ← phi( rvaluevar/(byte) rvaluevar::i#0 rvaluevar::@2/(byte) rvaluevar::i#1 )
  (bool~) rvaluevar::$0 ← (byte) rvaluevar::i#2 < (number) $a
  if((bool~) rvaluevar::$0) goto rvaluevar::@2
  to:rvaluevar::@3
rvaluevar::@2: scope:[rvaluevar]  from rvaluevar::@1
  (byte) rvaluevar::i#3 ← phi( rvaluevar::@1/(byte) rvaluevar::i#2 )
  (byte*) rvaluevar::screen#2 ← phi( rvaluevar::@1/(byte*) rvaluevar::screen#3 )
  (byte) rvaluevar::b#1 ← *((byte*) rvaluevar::screen#2)
  (byte*) rvaluevar::screen#1 ← ++ (byte*) rvaluevar::screen#2
  (byte) rvaluevar::i#1 ← ++ (byte) rvaluevar::i#3
  to:rvaluevar::@1
rvaluevar::@3: scope:[rvaluevar]  from rvaluevar::@1
  (byte) rvaluevar::b#2 ← phi( rvaluevar::@1/(byte) rvaluevar::b#3 )
  *((const byte*) rvaluevar::screen2) ← (byte) rvaluevar::b#2
  to:rvaluevar::@return
rvaluevar::@return: scope:[rvaluevar]  from rvaluevar::@3
  return 
  to:@return
@5: scope:[]  from @begin
  call main 
  to:@6
@6: scope:[]  from @5
  to:@end
@end: scope:[]  from @6

SYMBOL TABLE SSA
(label) @5
(label) @6
(label) @begin
(label) @end
(void()) lvalue()
(bool~) lvalue::$0
(label) lvalue::@1
(label) lvalue::@2
(label) lvalue::@return
(const byte*) lvalue::SCREEN[(number) $400]  = (byte*)(number) $400
(byte) lvalue::i
(byte) lvalue::i#0
(byte) lvalue::i#1
(byte) lvalue::i#2
(byte) lvalue::i#3
(void()) lvaluevar()
(bool~) lvaluevar::$0
(label) lvaluevar::@1
(label) lvaluevar::@2
(label) lvaluevar::@return
(const byte) lvaluevar::b = (byte) 4
(byte) lvaluevar::i
(byte) lvaluevar::i#0
(byte) lvaluevar::i#1
(byte) lvaluevar::i#2
(byte) lvaluevar::i#3
(byte*) lvaluevar::screen
(byte*) lvaluevar::screen#0
(byte*) lvaluevar::screen#1
(byte*) lvaluevar::screen#2
(byte*) lvaluevar::screen#3
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@return
(void()) rvalue()
(bool~) rvalue::$0
(label) rvalue::@1
(label) rvalue::@2
(label) rvalue::@3
(label) rvalue::@return
(const byte*) rvalue::SCREEN[(number) $400]  = (byte*)(number) $400
(byte) rvalue::b
(byte) rvalue::b#0
(byte) rvalue::b#1
(byte) rvalue::b#2
(byte) rvalue::b#3
(byte) rvalue::b#4
(byte) rvalue::i
(byte) rvalue::i#0
(byte) rvalue::i#1
(byte) rvalue::i#2
(byte) rvalue::i#3
(const byte*) rvalue::screen2 = (byte*)(number) $400
(void()) rvaluevar()
(bool~) rvaluevar::$0
(label) rvaluevar::@1
(label) rvaluevar::@2
(label) rvaluevar::@3
(label) rvaluevar::@return
(byte) rvaluevar::b
(byte) rvaluevar::b#0
(byte) rvaluevar::b#1
(byte) rvaluevar::b#2
(byte) rvaluevar::b#3
(byte) rvaluevar::i
(byte) rvaluevar::i#0
(byte) rvaluevar::i#1
(byte) rvaluevar::i#2
(byte) rvaluevar::i#3
(byte*) rvaluevar::screen
(byte*) rvaluevar::screen#0
(byte*) rvaluevar::screen#1
(byte*) rvaluevar::screen#2
(byte*) rvaluevar::screen#3
(const byte*) rvaluevar::screen2 = (byte*)(number) $400

Adding number conversion cast (unumber) 1 in *((const byte*) lvalue::SCREEN) ← (number) 1
Adding number conversion cast (unumber) 2 in *((const byte*) lvalue::SCREEN + (number) 1) ← (number) 2
Adding number conversion cast (unumber) 1 in *((const byte*) lvalue::SCREEN + (number) 1) ← ((unumber)) (number) 2
Adding number conversion cast (unumber) $a in (bool~) lvalue::$0 ← (byte) lvalue::i#2 < (number) $a
Adding number conversion cast (unumber) 3 in *((const byte*) lvalue::SCREEN + (byte) lvalue::i#3) ← (number) 3
Adding number conversion cast (unumber) 1 in (byte) rvalue::b#1 ← *((const byte*) rvalue::SCREEN + (number) 1)
Adding number conversion cast (unumber) $a in (bool~) rvalue::$0 ← (byte) rvalue::i#2 < (number) $a
Adding number conversion cast (unumber) $a in (bool~) lvaluevar::$0 ← (byte) lvaluevar::i#2 < (number) $a
Adding number conversion cast (unumber) $a in (bool~) rvaluevar::$0 ← (byte) rvaluevar::i#2 < (number) $a
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast *((const byte*) lvalue::SCREEN) ← (unumber)(number) 1
Inlining cast *((const byte*) lvalue::SCREEN + (unumber)(number) 1) ← (unumber)(number) 2
Inlining cast *((const byte*) lvalue::SCREEN + (byte) lvalue::i#3) ← (unumber)(number) 3
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 1
Simplifying constant integer cast $a
Simplifying constant integer cast 3
Simplifying constant integer cast 1
Simplifying constant integer cast $a
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $a
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $a
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) $a
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) $a
Finalized unsigned number type (byte) $a
Finalized unsigned number type (byte) $a
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte) lvalue::i#2 = (byte) lvalue::i#3 
Alias (byte) rvalue::i#2 = (byte) rvalue::i#3 
Alias (byte) rvalue::b#3 = (byte) rvalue::b#4 
Alias (byte*) lvaluevar::screen#2 = (byte*) lvaluevar::screen#3 
Alias (byte) lvaluevar::i#2 = (byte) lvaluevar::i#3 
Alias (byte*) rvaluevar::screen#2 = (byte*) rvaluevar::screen#3 
Alias (byte) rvaluevar::i#2 = (byte) rvaluevar::i#3 
Alias (byte) rvaluevar::b#2 = (byte) rvaluevar::b#3 
Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) lvalue::$0 [10] if((byte) lvalue::i#2<(byte) $a) goto lvalue::@2
Simple Condition (bool~) rvalue::$0 [20] if((byte) rvalue::i#2<(byte) $a) goto rvalue::@2
Simple Condition (bool~) lvaluevar::$0 [31] if((byte) lvaluevar::i#2<(byte) $a) goto lvaluevar::@2
Simple Condition (bool~) rvaluevar::$0 [42] if((byte) rvaluevar::i#2<(byte) $a) goto rvaluevar::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte) lvalue::i#0 = 2
Constant (const byte) rvalue::i#0 = 2
Constant (const byte*) lvaluevar::screen#0 = (byte*) 1024
Constant (const byte) lvaluevar::i#0 = 2
Constant (const byte*) rvaluevar::screen#0 = (byte*) 1024
Constant (const byte) rvaluevar::b#0 = 0
Constant (const byte) rvaluevar::i#0 = 2
Successful SSA optimization Pass2ConstantIdentification
Eliminating unused variable (byte) rvalue::b#0 and assignment [12] (byte) rvalue::b#0 ← *((const byte*) rvalue::SCREEN)
Successful SSA optimization PassNEliminateUnusedVars
Inlining constant with var siblings (const byte) lvalue::i#0
Inlining constant with var siblings (const byte) rvalue::i#0
Inlining constant with var siblings (const byte*) lvaluevar::screen#0
Inlining constant with var siblings (const byte) lvaluevar::i#0
Inlining constant with var siblings (const byte*) rvaluevar::screen#0
Inlining constant with var siblings (const byte) rvaluevar::b#0
Inlining constant with var siblings (const byte) rvaluevar::i#0
Constant inlined lvalue::i#0 = (byte) 2
Constant inlined rvaluevar::screen#0 = (byte*) 1024
Constant inlined rvaluevar::b#0 = (byte) 0
Constant inlined rvalue::i#0 = (byte) 2
Constant inlined lvaluevar::i#0 = (byte) 2
Constant inlined lvaluevar::screen#0 = (byte*) 1024
Constant inlined rvaluevar::i#0 = (byte) 2
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(lvalue::SCREEN+1)
Consolidated array index constant in *(rvalue::SCREEN+1)
Successful SSA optimization Pass2ConstantAdditionElimination
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @5
Adding NOP phi() at start of @6
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of main::@4
Adding NOP phi() at start of lvaluevar
Adding NOP phi() at start of rvaluevar
CALL GRAPH
Calls in [] to main:2 
Calls in [main] to lvalue:6 rvalue:8 rvaluevar:10 lvaluevar:12 

Created 8 initial phi equivalence classes
Coalesced [22] lvaluevar::i#4 ← lvaluevar::i#1
Coalesced [23] lvaluevar::screen#4 ← lvaluevar::screen#1
Coalesced [32] rvaluevar::i#4 ← rvaluevar::i#1
Coalesced [33] rvaluevar::screen#4 ← rvaluevar::screen#1
Coalesced [34] rvaluevar::b#4 ← rvaluevar::b#1
Coalesced [36] rvalue::b#5 ← rvalue::b#1
Coalesced [43] rvalue::i#4 ← rvalue::i#1
Coalesced [44] rvalue::b#6 ← rvalue::b#2
Coalesced [52] lvalue::i#4 ← lvalue::i#1
Coalesced down to 8 phi equivalence classes
Culled Empty Block (label) @6
Culled Empty Block (label) main::@4
Renumbering block @5 to @1
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of lvaluevar
Adding NOP phi() at start of rvaluevar

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()
  [5] call lvalue 
  to:main::@1
main::@1: scope:[main]  from main
  [6] phi()
  [7] call rvalue 
  to:main::@2
main::@2: scope:[main]  from main::@1
  [8] phi()
  [9] call rvaluevar 
  to:main::@3
main::@3: scope:[main]  from main::@2
  [10] phi()
  [11] call lvaluevar 
  to:main::@return
main::@return: scope:[main]  from main::@3
  [12] return 
  to:@return

(void()) lvaluevar()
lvaluevar: scope:[lvaluevar]  from main::@3
  [13] phi()
  to:lvaluevar::@1
lvaluevar::@1: scope:[lvaluevar]  from lvaluevar lvaluevar::@2
  [14] (byte*) lvaluevar::screen#2 ← phi( lvaluevar/(byte*) 1024 lvaluevar::@2/(byte*) lvaluevar::screen#1 )
  [14] (byte) lvaluevar::i#2 ← phi( lvaluevar/(byte) 2 lvaluevar::@2/(byte) lvaluevar::i#1 )
  [15] if((byte) lvaluevar::i#2<(byte) $a) goto lvaluevar::@2
  to:lvaluevar::@return
lvaluevar::@return: scope:[lvaluevar]  from lvaluevar::@1
  [16] return 
  to:@return
lvaluevar::@2: scope:[lvaluevar]  from lvaluevar::@1
  [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b
  [18] (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2
  [19] (byte) lvaluevar::i#1 ← ++ (byte) lvaluevar::i#2
  to:lvaluevar::@1

(void()) rvaluevar()
rvaluevar: scope:[rvaluevar]  from main::@2
  [20] phi()
  to:rvaluevar::@1
rvaluevar::@1: scope:[rvaluevar]  from rvaluevar rvaluevar::@2
  [21] (byte) rvaluevar::b#2 ← phi( rvaluevar/(byte) 0 rvaluevar::@2/(byte) rvaluevar::b#1 )
  [21] (byte*) rvaluevar::screen#2 ← phi( rvaluevar/(byte*) 1024 rvaluevar::@2/(byte*) rvaluevar::screen#1 )
  [21] (byte) rvaluevar::i#2 ← phi( rvaluevar/(byte) 2 rvaluevar::@2/(byte) rvaluevar::i#1 )
  [22] if((byte) rvaluevar::i#2<(byte) $a) goto rvaluevar::@2
  to:rvaluevar::@3
rvaluevar::@3: scope:[rvaluevar]  from rvaluevar::@1
  [23] *((const byte*) rvaluevar::screen2) ← (byte) rvaluevar::b#2
  to:rvaluevar::@return
rvaluevar::@return: scope:[rvaluevar]  from rvaluevar::@3
  [24] return 
  to:@return
rvaluevar::@2: scope:[rvaluevar]  from rvaluevar::@1
  [25] (byte) rvaluevar::b#1 ← *((byte*) rvaluevar::screen#2)
  [26] (byte*) rvaluevar::screen#1 ← ++ (byte*) rvaluevar::screen#2
  [27] (byte) rvaluevar::i#1 ← ++ (byte) rvaluevar::i#2
  to:rvaluevar::@1

(void()) rvalue()
rvalue: scope:[rvalue]  from main::@1
  [28] (byte) rvalue::b#1 ← *((const byte*) rvalue::SCREEN+(byte) 1)
  to:rvalue::@1
rvalue::@1: scope:[rvalue]  from rvalue rvalue::@2
  [29] (byte) rvalue::b#3 ← phi( rvalue/(byte) rvalue::b#1 rvalue::@2/(byte) rvalue::b#2 )
  [29] (byte) rvalue::i#2 ← phi( rvalue/(byte) 2 rvalue::@2/(byte) rvalue::i#1 )
  [30] if((byte) rvalue::i#2<(byte) $a) goto rvalue::@2
  to:rvalue::@3
rvalue::@3: scope:[rvalue]  from rvalue::@1
  [31] *((const byte*) rvalue::screen2) ← (byte) rvalue::b#3
  to:rvalue::@return
rvalue::@return: scope:[rvalue]  from rvalue::@3
  [32] return 
  to:@return
rvalue::@2: scope:[rvalue]  from rvalue::@1
  [33] (byte) rvalue::b#2 ← *((const byte*) rvalue::SCREEN + (byte) rvalue::i#2)
  [34] (byte) rvalue::i#1 ← ++ (byte) rvalue::i#2
  to:rvalue::@1

(void()) lvalue()
lvalue: scope:[lvalue]  from main
  [35] *((const byte*) lvalue::SCREEN) ← (byte) 1
  [36] *((const byte*) lvalue::SCREEN+(byte) 1) ← (byte) 2
  to:lvalue::@1
lvalue::@1: scope:[lvalue]  from lvalue lvalue::@2
  [37] (byte) lvalue::i#2 ← phi( lvalue/(byte) 2 lvalue::@2/(byte) lvalue::i#1 )
  [38] if((byte) lvalue::i#2<(byte) $a) goto lvalue::@2
  to:lvalue::@return
lvalue::@return: scope:[lvalue]  from lvalue::@1
  [39] return 
  to:@return
lvalue::@2: scope:[lvalue]  from lvalue::@1
  [40] *((const byte*) lvalue::SCREEN + (byte) lvalue::i#2) ← (byte) 3
  [41] (byte) lvalue::i#1 ← ++ (byte) lvalue::i#2
  to:lvalue::@1


VARIABLE REGISTER WEIGHTS
(void()) lvalue()
(byte) lvalue::i
(byte) lvalue::i#1 22.0
(byte) lvalue::i#2 14.666666666666666
(void()) lvaluevar()
(byte) lvaluevar::i
(byte) lvaluevar::i#1 22.0
(byte) lvaluevar::i#2 8.25
(byte*) lvaluevar::screen
(byte*) lvaluevar::screen#1 11.0
(byte*) lvaluevar::screen#2 11.0
(void()) main()
(void()) rvalue()
(byte) rvalue::b
(byte) rvalue::b#1 4.0
(byte) rvalue::b#2 11.0
(byte) rvalue::b#3 7.5
(byte) rvalue::i
(byte) rvalue::i#1 22.0
(byte) rvalue::i#2 14.666666666666666
(void()) rvaluevar()
(byte) rvaluevar::b
(byte) rvaluevar::b#1 7.333333333333333
(byte) rvaluevar::b#2 6.5
(byte) rvaluevar::i
(byte) rvaluevar::i#1 22.0
(byte) rvaluevar::i#2 8.25
(byte*) rvaluevar::screen
(byte*) rvaluevar::screen#1 11.0
(byte*) rvaluevar::screen#2 11.0

Initial phi equivalence classes
[ lvaluevar::i#2 lvaluevar::i#1 ]
[ lvaluevar::screen#2 lvaluevar::screen#1 ]
[ rvaluevar::i#2 rvaluevar::i#1 ]
[ rvaluevar::screen#2 rvaluevar::screen#1 ]
[ rvaluevar::b#2 rvaluevar::b#1 ]
[ rvalue::i#2 rvalue::i#1 ]
[ rvalue::b#3 rvalue::b#1 rvalue::b#2 ]
[ lvalue::i#2 lvalue::i#1 ]
Complete equivalence classes
[ lvaluevar::i#2 lvaluevar::i#1 ]
[ lvaluevar::screen#2 lvaluevar::screen#1 ]
[ rvaluevar::i#2 rvaluevar::i#1 ]
[ rvaluevar::screen#2 rvaluevar::screen#1 ]
[ rvaluevar::b#2 rvaluevar::b#1 ]
[ rvalue::i#2 rvalue::i#1 ]
[ rvalue::b#3 rvalue::b#1 rvalue::b#2 ]
[ lvalue::i#2 lvalue::i#1 ]
Allocated zp[1]:2 [ lvaluevar::i#2 lvaluevar::i#1 ]
Allocated zp[2]:3 [ lvaluevar::screen#2 lvaluevar::screen#1 ]
Allocated zp[1]:5 [ rvaluevar::i#2 rvaluevar::i#1 ]
Allocated zp[2]:6 [ rvaluevar::screen#2 rvaluevar::screen#1 ]
Allocated zp[1]:8 [ rvaluevar::b#2 rvaluevar::b#1 ]
Allocated zp[1]:9 [ rvalue::i#2 rvalue::i#1 ]
Allocated zp[1]:10 [ rvalue::b#3 rvalue::b#1 rvalue::b#2 ]
Allocated zp[1]:11 [ lvalue::i#2 lvalue::i#1 ]

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
// Test all types of pointers
  // 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: {
    // [5] call lvalue 
    jsr lvalue
    // [6] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    jmp __b1
    // main::@1
  __b1:
    // [7] call rvalue 
    jsr rvalue
    // [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  __b2_from___b1:
    jmp __b2
    // main::@2
  __b2:
    // [9] call rvaluevar 
    // [20] phi from main::@2 to rvaluevar [phi:main::@2->rvaluevar]
  rvaluevar_from___b2:
    jsr rvaluevar
    // [10] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
  __b3_from___b2:
    jmp __b3
    // main::@3
  __b3:
    // [11] call lvaluevar 
    // [13] phi from main::@3 to lvaluevar [phi:main::@3->lvaluevar]
  lvaluevar_from___b3:
    jsr lvaluevar
    jmp __breturn
    // main::@return
  __breturn:
    // [12] return 
    rts
}
  // lvaluevar
lvaluevar: {
    // LValue Variable pointer dereference
    .const b = 4
    .label screen = 3
    .label i = 2
    // [14] phi from lvaluevar to lvaluevar::@1 [phi:lvaluevar->lvaluevar::@1]
  __b1_from_lvaluevar:
    // [14] phi (byte*) lvaluevar::screen#2 = (byte*) 1024 [phi:lvaluevar->lvaluevar::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z screen
    lda #>$400
    sta.z screen+1
    // [14] phi (byte) lvaluevar::i#2 = (byte) 2 [phi:lvaluevar->lvaluevar::@1#1] -- vbuz1=vbuc1 
    lda #2
    sta.z i
    jmp __b1
    // lvaluevar::@1
  __b1:
    // [15] if((byte) lvaluevar::i#2<(byte) $a) goto lvaluevar::@2 -- vbuz1_lt_vbuc1_then_la1 
    lda.z i
    cmp #$a
    bcc __b2
    jmp __breturn
    // lvaluevar::@return
  __breturn:
    // [16] return 
    rts
    // lvaluevar::@2
  __b2:
    // [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b -- _deref_pbuz1=vbuc1 
    lda #b
    ldy #0
    sta (screen),y
    // [18] (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2 -- pbuz1=_inc_pbuz1 
    inc.z screen
    bne !+
    inc.z screen+1
  !:
    // [19] (byte) lvaluevar::i#1 ← ++ (byte) lvaluevar::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [14] phi from lvaluevar::@2 to lvaluevar::@1 [phi:lvaluevar::@2->lvaluevar::@1]
  __b1_from___b2:
    // [14] phi (byte*) lvaluevar::screen#2 = (byte*) lvaluevar::screen#1 [phi:lvaluevar::@2->lvaluevar::@1#0] -- register_copy 
    // [14] phi (byte) lvaluevar::i#2 = (byte) lvaluevar::i#1 [phi:lvaluevar::@2->lvaluevar::@1#1] -- register_copy 
    jmp __b1
}
  // rvaluevar
rvaluevar: {
    .label screen2 = $400
    // RValue Variable pointer dereference
    .label b = 8
    .label screen = 6
    .label i = 5
    // [21] phi from rvaluevar to rvaluevar::@1 [phi:rvaluevar->rvaluevar::@1]
  __b1_from_rvaluevar:
    // [21] phi (byte) rvaluevar::b#2 = (byte) 0 [phi:rvaluevar->rvaluevar::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z b
    // [21] phi (byte*) rvaluevar::screen#2 = (byte*) 1024 [phi:rvaluevar->rvaluevar::@1#1] -- pbuz1=pbuc1 
    lda #<$400
    sta.z screen
    lda #>$400
    sta.z screen+1
    // [21] phi (byte) rvaluevar::i#2 = (byte) 2 [phi:rvaluevar->rvaluevar::@1#2] -- vbuz1=vbuc1 
    lda #2
    sta.z i
    jmp __b1
    // rvaluevar::@1
  __b1:
    // [22] if((byte) rvaluevar::i#2<(byte) $a) goto rvaluevar::@2 -- vbuz1_lt_vbuc1_then_la1 
    lda.z i
    cmp #$a
    bcc __b2
    jmp __b3
    // rvaluevar::@3
  __b3:
    // [23] *((const byte*) rvaluevar::screen2) ← (byte) rvaluevar::b#2 -- _deref_pbuc1=vbuz1 
    lda.z b
    sta screen2
    jmp __breturn
    // rvaluevar::@return
  __breturn:
    // [24] return 
    rts
    // rvaluevar::@2
  __b2:
    // [25] (byte) rvaluevar::b#1 ← *((byte*) rvaluevar::screen#2) -- vbuz1=_deref_pbuz2 
    ldy #0
    lda (screen),y
    sta.z b
    // [26] (byte*) rvaluevar::screen#1 ← ++ (byte*) rvaluevar::screen#2 -- pbuz1=_inc_pbuz1 
    inc.z screen
    bne !+
    inc.z screen+1
  !:
    // [27] (byte) rvaluevar::i#1 ← ++ (byte) rvaluevar::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [21] phi from rvaluevar::@2 to rvaluevar::@1 [phi:rvaluevar::@2->rvaluevar::@1]
  __b1_from___b2:
    // [21] phi (byte) rvaluevar::b#2 = (byte) rvaluevar::b#1 [phi:rvaluevar::@2->rvaluevar::@1#0] -- register_copy 
    // [21] phi (byte*) rvaluevar::screen#2 = (byte*) rvaluevar::screen#1 [phi:rvaluevar::@2->rvaluevar::@1#1] -- register_copy 
    // [21] phi (byte) rvaluevar::i#2 = (byte) rvaluevar::i#1 [phi:rvaluevar::@2->rvaluevar::@1#2] -- register_copy 
    jmp __b1
}
  // rvalue
rvalue: {
    // A constant pointer
    .label SCREEN = $400
    .label screen2 = $400
    .label b = $a
    // RValue constant array variable index
    .label i = 9
    // [28] (byte) rvalue::b#1 ← *((const byte*) rvalue::SCREEN+(byte) 1) -- vbuz1=_deref_pbuc1 
    // RValue constant array pointer constant index
    lda SCREEN+1
    sta.z b
    // [29] phi from rvalue to rvalue::@1 [phi:rvalue->rvalue::@1]
  __b1_from_rvalue:
    // [29] phi (byte) rvalue::b#3 = (byte) rvalue::b#1 [phi:rvalue->rvalue::@1#0] -- register_copy 
    // [29] phi (byte) rvalue::i#2 = (byte) 2 [phi:rvalue->rvalue::@1#1] -- vbuz1=vbuc1 
    lda #2
    sta.z i
    jmp __b1
    // rvalue::@1
  __b1:
    // [30] if((byte) rvalue::i#2<(byte) $a) goto rvalue::@2 -- vbuz1_lt_vbuc1_then_la1 
    lda.z i
    cmp #$a
    bcc __b2
    jmp __b3
    // rvalue::@3
  __b3:
    // [31] *((const byte*) rvalue::screen2) ← (byte) rvalue::b#3 -- _deref_pbuc1=vbuz1 
    lda.z b
    sta screen2
    jmp __breturn
    // rvalue::@return
  __breturn:
    // [32] return 
    rts
    // rvalue::@2
  __b2:
    // [33] (byte) rvalue::b#2 ← *((const byte*) rvalue::SCREEN + (byte) rvalue::i#2) -- vbuz1=pbuc1_derefidx_vbuz2 
    ldy.z i
    lda SCREEN,y
    sta.z b
    // [34] (byte) rvalue::i#1 ← ++ (byte) rvalue::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [29] phi from rvalue::@2 to rvalue::@1 [phi:rvalue::@2->rvalue::@1]
  __b1_from___b2:
    // [29] phi (byte) rvalue::b#3 = (byte) rvalue::b#2 [phi:rvalue::@2->rvalue::@1#0] -- register_copy 
    // [29] phi (byte) rvalue::i#2 = (byte) rvalue::i#1 [phi:rvalue::@2->rvalue::@1#1] -- register_copy 
    jmp __b1
}
  // lvalue
lvalue: {
    // A constant pointer
    .label SCREEN = $400
    // LValue constant array variable indexing
    .label i = $b
    // [35] *((const byte*) lvalue::SCREEN) ← (byte) 1 -- _deref_pbuc1=vbuc2 
    // LValue constant pointer dereference
    lda #1
    sta SCREEN
    // [36] *((const byte*) lvalue::SCREEN+(byte) 1) ← (byte) 2 -- _deref_pbuc1=vbuc2 
    // LValue constant array constant indexing
    lda #2
    sta SCREEN+1
    // [37] phi from lvalue to lvalue::@1 [phi:lvalue->lvalue::@1]
  __b1_from_lvalue:
    // [37] phi (byte) lvalue::i#2 = (byte) 2 [phi:lvalue->lvalue::@1#0] -- vbuz1=vbuc1 
    lda #2
    sta.z i
    jmp __b1
    // lvalue::@1
  __b1:
    // [38] if((byte) lvalue::i#2<(byte) $a) goto lvalue::@2 -- vbuz1_lt_vbuc1_then_la1 
    lda.z i
    cmp #$a
    bcc __b2
    jmp __breturn
    // lvalue::@return
  __breturn:
    // [39] return 
    rts
    // lvalue::@2
  __b2:
    // [40] *((const byte*) lvalue::SCREEN + (byte) lvalue::i#2) ← (byte) 3 -- pbuc1_derefidx_vbuz1=vbuc2 
    lda #3
    ldy.z i
    sta SCREEN,y
    // [41] (byte) lvalue::i#1 ← ++ (byte) lvalue::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [37] phi from lvalue::@2 to lvalue::@1 [phi:lvalue::@2->lvalue::@1]
  __b1_from___b2:
    // [37] phi (byte) lvalue::i#2 = (byte) lvalue::i#1 [phi:lvalue::@2->lvalue::@1#0] -- register_copy 
    jmp __b1
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte a as potential for zp[1]:2 [ lvaluevar::i#2 lvaluevar::i#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:2 [ lvaluevar::i#2 lvaluevar::i#1 ]
Statement [25] (byte) rvaluevar::b#1 ← *((byte*) rvaluevar::screen#2) [ rvaluevar::i#2 rvaluevar::screen#2 rvaluevar::b#1 ] ( main:2::rvaluevar:9 [ rvaluevar::i#2 rvaluevar::screen#2 rvaluevar::b#1 ] ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte a as potential for zp[1]:5 [ rvaluevar::i#2 rvaluevar::i#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:5 [ rvaluevar::i#2 rvaluevar::i#1 ]
Statement [35] *((const byte*) lvalue::SCREEN) ← (byte) 1 [ ] ( main:2::lvalue:5 [ ] ) always clobbers reg byte a 
Statement [36] *((const byte*) lvalue::SCREEN+(byte) 1) ← (byte) 2 [ ] ( main:2::lvalue:5 [ ] ) always clobbers reg byte a 
Statement [40] *((const byte*) lvalue::SCREEN + (byte) lvalue::i#2) ← (byte) 3 [ lvalue::i#2 ] ( main:2::lvalue:5 [ lvalue::i#2 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:11 [ lvalue::i#2 lvalue::i#1 ]
Statement [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) always clobbers reg byte a reg byte y 
Statement [25] (byte) rvaluevar::b#1 ← *((byte*) rvaluevar::screen#2) [ rvaluevar::i#2 rvaluevar::screen#2 rvaluevar::b#1 ] ( main:2::rvaluevar:9 [ rvaluevar::i#2 rvaluevar::screen#2 rvaluevar::b#1 ] ) always clobbers reg byte a reg byte y 
Statement [35] *((const byte*) lvalue::SCREEN) ← (byte) 1 [ ] ( main:2::lvalue:5 [ ] ) always clobbers reg byte a 
Statement [36] *((const byte*) lvalue::SCREEN+(byte) 1) ← (byte) 2 [ ] ( main:2::lvalue:5 [ ] ) always clobbers reg byte a 
Statement [40] *((const byte*) lvalue::SCREEN + (byte) lvalue::i#2) ← (byte) 3 [ lvalue::i#2 ] ( main:2::lvalue:5 [ lvalue::i#2 ] ) always clobbers reg byte a 
Potential registers zp[1]:2 [ lvaluevar::i#2 lvaluevar::i#1 ] : zp[1]:2 , reg byte x , 
Potential registers zp[2]:3 [ lvaluevar::screen#2 lvaluevar::screen#1 ] : zp[2]:3 , 
Potential registers zp[1]:5 [ rvaluevar::i#2 rvaluevar::i#1 ] : zp[1]:5 , reg byte x , 
Potential registers zp[2]:6 [ rvaluevar::screen#2 rvaluevar::screen#1 ] : zp[2]:6 , 
Potential registers zp[1]:8 [ rvaluevar::b#2 rvaluevar::b#1 ] : zp[1]:8 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:9 [ rvalue::i#2 rvalue::i#1 ] : zp[1]:9 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:10 [ rvalue::b#3 rvalue::b#1 rvalue::b#2 ] : zp[1]:10 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:11 [ lvalue::i#2 lvalue::i#1 ] : zp[1]:11 , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [rvaluevar] 30.25: zp[1]:5 [ rvaluevar::i#2 rvaluevar::i#1 ] 22: zp[2]:6 [ rvaluevar::screen#2 rvaluevar::screen#1 ] 13.83: zp[1]:8 [ rvaluevar::b#2 rvaluevar::b#1 ] 
Uplift Scope [rvalue] 36.67: zp[1]:9 [ rvalue::i#2 rvalue::i#1 ] 22.5: zp[1]:10 [ rvalue::b#3 rvalue::b#1 rvalue::b#2 ] 
Uplift Scope [lvaluevar] 30.25: zp[1]:2 [ lvaluevar::i#2 lvaluevar::i#1 ] 22: zp[2]:3 [ lvaluevar::screen#2 lvaluevar::screen#1 ] 
Uplift Scope [lvalue] 36.67: zp[1]:11 [ lvalue::i#2 lvalue::i#1 ] 
Uplift Scope [main] 
Uplift Scope [] 

Uplifting [rvaluevar] best 1954 combination reg byte x [ rvaluevar::i#2 rvaluevar::i#1 ] zp[2]:6 [ rvaluevar::screen#2 rvaluevar::screen#1 ] reg byte y [ rvaluevar::b#2 rvaluevar::b#1 ] 
Uplifting [rvalue] best 1798 combination reg byte x [ rvalue::i#2 rvalue::i#1 ] reg byte a [ rvalue::b#3 rvalue::b#1 rvalue::b#2 ] 
Uplifting [lvaluevar] best 1708 combination reg byte x [ lvaluevar::i#2 lvaluevar::i#1 ] zp[2]:3 [ lvaluevar::screen#2 lvaluevar::screen#1 ] 
Uplifting [lvalue] best 1588 combination reg byte x [ lvalue::i#2 lvalue::i#1 ] 
Uplifting [main] best 1588 combination 
Uplifting [] best 1588 combination 
Coalescing zero page register [ zp[2]:6 [ rvaluevar::screen#2 rvaluevar::screen#1 ] ] with [ zp[2]:3 [ lvaluevar::screen#2 lvaluevar::screen#1 ] ]
Allocated (was zp[2]:6) zp[2]:2 [ rvaluevar::screen#2 rvaluevar::screen#1 lvaluevar::screen#2 lvaluevar::screen#1 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Test all types of pointers
  // 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: {
    // [5] call lvalue 
    jsr lvalue
    // [6] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    jmp __b1
    // main::@1
  __b1:
    // [7] call rvalue 
    jsr rvalue
    // [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  __b2_from___b1:
    jmp __b2
    // main::@2
  __b2:
    // [9] call rvaluevar 
    // [20] phi from main::@2 to rvaluevar [phi:main::@2->rvaluevar]
  rvaluevar_from___b2:
    jsr rvaluevar
    // [10] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
  __b3_from___b2:
    jmp __b3
    // main::@3
  __b3:
    // [11] call lvaluevar 
    // [13] phi from main::@3 to lvaluevar [phi:main::@3->lvaluevar]
  lvaluevar_from___b3:
    jsr lvaluevar
    jmp __breturn
    // main::@return
  __breturn:
    // [12] return 
    rts
}
  // lvaluevar
lvaluevar: {
    // LValue Variable pointer dereference
    .const b = 4
    .label screen = 2
    // [14] phi from lvaluevar to lvaluevar::@1 [phi:lvaluevar->lvaluevar::@1]
  __b1_from_lvaluevar:
    // [14] phi (byte*) lvaluevar::screen#2 = (byte*) 1024 [phi:lvaluevar->lvaluevar::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z screen
    lda #>$400
    sta.z screen+1
    // [14] phi (byte) lvaluevar::i#2 = (byte) 2 [phi:lvaluevar->lvaluevar::@1#1] -- vbuxx=vbuc1 
    ldx #2
    jmp __b1
    // lvaluevar::@1
  __b1:
    // [15] if((byte) lvaluevar::i#2<(byte) $a) goto lvaluevar::@2 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$a
    bcc __b2
    jmp __breturn
    // lvaluevar::@return
  __breturn:
    // [16] return 
    rts
    // lvaluevar::@2
  __b2:
    // [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b -- _deref_pbuz1=vbuc1 
    lda #b
    ldy #0
    sta (screen),y
    // [18] (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2 -- pbuz1=_inc_pbuz1 
    inc.z screen
    bne !+
    inc.z screen+1
  !:
    // [19] (byte) lvaluevar::i#1 ← ++ (byte) lvaluevar::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [14] phi from lvaluevar::@2 to lvaluevar::@1 [phi:lvaluevar::@2->lvaluevar::@1]
  __b1_from___b2:
    // [14] phi (byte*) lvaluevar::screen#2 = (byte*) lvaluevar::screen#1 [phi:lvaluevar::@2->lvaluevar::@1#0] -- register_copy 
    // [14] phi (byte) lvaluevar::i#2 = (byte) lvaluevar::i#1 [phi:lvaluevar::@2->lvaluevar::@1#1] -- register_copy 
    jmp __b1
}
  // rvaluevar
rvaluevar: {
    .label screen2 = $400
    .label screen = 2
    // [21] phi from rvaluevar to rvaluevar::@1 [phi:rvaluevar->rvaluevar::@1]
  __b1_from_rvaluevar:
    // [21] phi (byte) rvaluevar::b#2 = (byte) 0 [phi:rvaluevar->rvaluevar::@1#0] -- vbuyy=vbuc1 
    ldy #0
    // [21] phi (byte*) rvaluevar::screen#2 = (byte*) 1024 [phi:rvaluevar->rvaluevar::@1#1] -- pbuz1=pbuc1 
    lda #<$400
    sta.z screen
    lda #>$400
    sta.z screen+1
    // [21] phi (byte) rvaluevar::i#2 = (byte) 2 [phi:rvaluevar->rvaluevar::@1#2] -- vbuxx=vbuc1 
    ldx #2
    jmp __b1
    // rvaluevar::@1
  __b1:
    // [22] if((byte) rvaluevar::i#2<(byte) $a) goto rvaluevar::@2 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$a
    bcc __b2
    jmp __b3
    // rvaluevar::@3
  __b3:
    // [23] *((const byte*) rvaluevar::screen2) ← (byte) rvaluevar::b#2 -- _deref_pbuc1=vbuyy 
    sty screen2
    jmp __breturn
    // rvaluevar::@return
  __breturn:
    // [24] return 
    rts
    // rvaluevar::@2
  __b2:
    // [25] (byte) rvaluevar::b#1 ← *((byte*) rvaluevar::screen#2) -- vbuyy=_deref_pbuz1 
    ldy #0
    lda (screen),y
    tay
    // [26] (byte*) rvaluevar::screen#1 ← ++ (byte*) rvaluevar::screen#2 -- pbuz1=_inc_pbuz1 
    inc.z screen
    bne !+
    inc.z screen+1
  !:
    // [27] (byte) rvaluevar::i#1 ← ++ (byte) rvaluevar::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [21] phi from rvaluevar::@2 to rvaluevar::@1 [phi:rvaluevar::@2->rvaluevar::@1]
  __b1_from___b2:
    // [21] phi (byte) rvaluevar::b#2 = (byte) rvaluevar::b#1 [phi:rvaluevar::@2->rvaluevar::@1#0] -- register_copy 
    // [21] phi (byte*) rvaluevar::screen#2 = (byte*) rvaluevar::screen#1 [phi:rvaluevar::@2->rvaluevar::@1#1] -- register_copy 
    // [21] phi (byte) rvaluevar::i#2 = (byte) rvaluevar::i#1 [phi:rvaluevar::@2->rvaluevar::@1#2] -- register_copy 
    jmp __b1
}
  // rvalue
rvalue: {
    // A constant pointer
    .label SCREEN = $400
    .label screen2 = $400
    // [28] (byte) rvalue::b#1 ← *((const byte*) rvalue::SCREEN+(byte) 1) -- vbuaa=_deref_pbuc1 
    // RValue constant array pointer constant index
    lda SCREEN+1
    // [29] phi from rvalue to rvalue::@1 [phi:rvalue->rvalue::@1]
  __b1_from_rvalue:
    // [29] phi (byte) rvalue::b#3 = (byte) rvalue::b#1 [phi:rvalue->rvalue::@1#0] -- register_copy 
    // [29] phi (byte) rvalue::i#2 = (byte) 2 [phi:rvalue->rvalue::@1#1] -- vbuxx=vbuc1 
    ldx #2
    jmp __b1
    // rvalue::@1
  __b1:
    // [30] if((byte) rvalue::i#2<(byte) $a) goto rvalue::@2 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$a
    bcc __b2
    jmp __b3
    // rvalue::@3
  __b3:
    // [31] *((const byte*) rvalue::screen2) ← (byte) rvalue::b#3 -- _deref_pbuc1=vbuaa 
    sta screen2
    jmp __breturn
    // rvalue::@return
  __breturn:
    // [32] return 
    rts
    // rvalue::@2
  __b2:
    // [33] (byte) rvalue::b#2 ← *((const byte*) rvalue::SCREEN + (byte) rvalue::i#2) -- vbuaa=pbuc1_derefidx_vbuxx 
    lda SCREEN,x
    // [34] (byte) rvalue::i#1 ← ++ (byte) rvalue::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [29] phi from rvalue::@2 to rvalue::@1 [phi:rvalue::@2->rvalue::@1]
  __b1_from___b2:
    // [29] phi (byte) rvalue::b#3 = (byte) rvalue::b#2 [phi:rvalue::@2->rvalue::@1#0] -- register_copy 
    // [29] phi (byte) rvalue::i#2 = (byte) rvalue::i#1 [phi:rvalue::@2->rvalue::@1#1] -- register_copy 
    jmp __b1
}
  // lvalue
lvalue: {
    // A constant pointer
    .label SCREEN = $400
    // [35] *((const byte*) lvalue::SCREEN) ← (byte) 1 -- _deref_pbuc1=vbuc2 
    // LValue constant pointer dereference
    lda #1
    sta SCREEN
    // [36] *((const byte*) lvalue::SCREEN+(byte) 1) ← (byte) 2 -- _deref_pbuc1=vbuc2 
    // LValue constant array constant indexing
    lda #2
    sta SCREEN+1
    // [37] phi from lvalue to lvalue::@1 [phi:lvalue->lvalue::@1]
  __b1_from_lvalue:
    // [37] phi (byte) lvalue::i#2 = (byte) 2 [phi:lvalue->lvalue::@1#0] -- vbuxx=vbuc1 
    ldx #2
    jmp __b1
    // lvalue::@1
  __b1:
    // [38] if((byte) lvalue::i#2<(byte) $a) goto lvalue::@2 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$a
    bcc __b2
    jmp __breturn
    // lvalue::@return
  __breturn:
    // [39] return 
    rts
    // lvalue::@2
  __b2:
    // [40] *((const byte*) lvalue::SCREEN + (byte) lvalue::i#2) ← (byte) 3 -- pbuc1_derefidx_vbuxx=vbuc2 
    lda #3
    sta SCREEN,x
    // [41] (byte) lvalue::i#1 ← ++ (byte) lvalue::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [37] phi from lvalue::@2 to lvalue::@1 [phi:lvalue::@2->lvalue::@1]
  __b1_from___b2:
    // [37] phi (byte) lvalue::i#2 = (byte) lvalue::i#1 [phi:lvalue::@2->lvalue::@1#0] -- register_copy 
    jmp __b1
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __bend
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b3
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __b3
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __b3
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __bbegin with __b1
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Removing instruction __b1_from_main:
Removing instruction __b2_from___b1:
Removing instruction rvaluevar_from___b2:
Removing instruction __b3_from___b2:
Removing instruction lvaluevar_from___b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bend:
Removing instruction __b1:
Removing instruction __b2:
Removing instruction __b3:
Removing instruction __breturn:
Removing instruction __b1_from_lvaluevar:
Removing instruction __breturn:
Removing instruction __b1_from___b2:
Removing instruction __b1_from_rvaluevar:
Removing instruction __b3:
Removing instruction __breturn:
Removing instruction __b1_from___b2:
Removing instruction __b1_from_rvalue:
Removing instruction __b3:
Removing instruction __breturn:
Removing instruction __b1_from___b2:
Removing instruction __b1_from_lvalue:
Removing instruction __breturn:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Replacing instruction ldx #2 with TAX
Removing instruction __b1:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(void()) lvalue()
(label) lvalue::@1
(label) lvalue::@2
(label) lvalue::@return
(const byte*) lvalue::SCREEN[(number) $400]  = (byte*) 1024
(byte) lvalue::i
(byte) lvalue::i#1 reg byte x 22.0
(byte) lvalue::i#2 reg byte x 14.666666666666666
(void()) lvaluevar()
(label) lvaluevar::@1
(label) lvaluevar::@2
(label) lvaluevar::@return
(const byte) lvaluevar::b = (byte) 4
(byte) lvaluevar::i
(byte) lvaluevar::i#1 reg byte x 22.0
(byte) lvaluevar::i#2 reg byte x 8.25
(byte*) lvaluevar::screen
(byte*) lvaluevar::screen#1 screen zp[2]:2 11.0
(byte*) lvaluevar::screen#2 screen zp[2]:2 11.0
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
(void()) rvalue()
(label) rvalue::@1
(label) rvalue::@2
(label) rvalue::@3
(label) rvalue::@return
(const byte*) rvalue::SCREEN[(number) $400]  = (byte*) 1024
(byte) rvalue::b
(byte) rvalue::b#1 reg byte a 4.0
(byte) rvalue::b#2 reg byte a 11.0
(byte) rvalue::b#3 reg byte a 7.5
(byte) rvalue::i
(byte) rvalue::i#1 reg byte x 22.0
(byte) rvalue::i#2 reg byte x 14.666666666666666
(const byte*) rvalue::screen2 = (byte*) 1024
(void()) rvaluevar()
(label) rvaluevar::@1
(label) rvaluevar::@2
(label) rvaluevar::@3
(label) rvaluevar::@return
(byte) rvaluevar::b
(byte) rvaluevar::b#1 reg byte y 7.333333333333333
(byte) rvaluevar::b#2 reg byte y 6.5
(byte) rvaluevar::i
(byte) rvaluevar::i#1 reg byte x 22.0
(byte) rvaluevar::i#2 reg byte x 8.25
(byte*) rvaluevar::screen
(byte*) rvaluevar::screen#1 screen zp[2]:2 11.0
(byte*) rvaluevar::screen#2 screen zp[2]:2 11.0
(const byte*) rvaluevar::screen2 = (byte*) 1024

reg byte x [ lvaluevar::i#2 lvaluevar::i#1 ]
reg byte x [ rvaluevar::i#2 rvaluevar::i#1 ]
zp[2]:2 [ rvaluevar::screen#2 rvaluevar::screen#1 lvaluevar::screen#2 lvaluevar::screen#1 ]
reg byte y [ rvaluevar::b#2 rvaluevar::b#1 ]
reg byte x [ rvalue::i#2 rvalue::i#1 ]
reg byte a [ rvalue::b#3 rvalue::b#1 rvalue::b#2 ]
reg byte x [ lvalue::i#2 lvalue::i#1 ]


FINAL ASSEMBLER
Score: 1318

  // File Comments
// Test all types of pointers
  // 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: {
    // lvalue()
    // [5] call lvalue 
    jsr lvalue
    // [6] phi from main to main::@1 [phi:main->main::@1]
    // main::@1
    // rvalue()
    // [7] call rvalue 
    jsr rvalue
    // [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
    // main::@2
    // rvaluevar()
    // [9] call rvaluevar 
    // [20] phi from main::@2 to rvaluevar [phi:main::@2->rvaluevar]
    jsr rvaluevar
    // [10] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
    // main::@3
    // lvaluevar()
    // [11] call lvaluevar 
    // [13] phi from main::@3 to lvaluevar [phi:main::@3->lvaluevar]
    jsr lvaluevar
    // main::@return
    // }
    // [12] return 
    rts
}
  // lvaluevar
lvaluevar: {
    // LValue Variable pointer dereference
    .const b = 4
    .label screen = 2
    // [14] phi from lvaluevar to lvaluevar::@1 [phi:lvaluevar->lvaluevar::@1]
    // [14] phi (byte*) lvaluevar::screen#2 = (byte*) 1024 [phi:lvaluevar->lvaluevar::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z screen
    lda #>$400
    sta.z screen+1
    // [14] phi (byte) lvaluevar::i#2 = (byte) 2 [phi:lvaluevar->lvaluevar::@1#1] -- vbuxx=vbuc1 
    ldx #2
    // lvaluevar::@1
  __b1:
    // while(i<10)
    // [15] if((byte) lvaluevar::i#2<(byte) $a) goto lvaluevar::@2 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$a
    bcc __b2
    // lvaluevar::@return
    // }
    // [16] return 
    rts
    // lvaluevar::@2
  __b2:
    // *screen = b
    // [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b -- _deref_pbuz1=vbuc1 
    lda #b
    ldy #0
    sta (screen),y
    // screen++;
    // [18] (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2 -- pbuz1=_inc_pbuz1 
    inc.z screen
    bne !+
    inc.z screen+1
  !:
    // i++;
    // [19] (byte) lvaluevar::i#1 ← ++ (byte) lvaluevar::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [14] phi from lvaluevar::@2 to lvaluevar::@1 [phi:lvaluevar::@2->lvaluevar::@1]
    // [14] phi (byte*) lvaluevar::screen#2 = (byte*) lvaluevar::screen#1 [phi:lvaluevar::@2->lvaluevar::@1#0] -- register_copy 
    // [14] phi (byte) lvaluevar::i#2 = (byte) lvaluevar::i#1 [phi:lvaluevar::@2->lvaluevar::@1#1] -- register_copy 
    jmp __b1
}
  // rvaluevar
rvaluevar: {
    .label screen2 = $400
    .label screen = 2
    // [21] phi from rvaluevar to rvaluevar::@1 [phi:rvaluevar->rvaluevar::@1]
    // [21] phi (byte) rvaluevar::b#2 = (byte) 0 [phi:rvaluevar->rvaluevar::@1#0] -- vbuyy=vbuc1 
    ldy #0
    // [21] phi (byte*) rvaluevar::screen#2 = (byte*) 1024 [phi:rvaluevar->rvaluevar::@1#1] -- pbuz1=pbuc1 
    lda #<$400
    sta.z screen
    lda #>$400
    sta.z screen+1
    // [21] phi (byte) rvaluevar::i#2 = (byte) 2 [phi:rvaluevar->rvaluevar::@1#2] -- vbuxx=vbuc1 
    ldx #2
    // rvaluevar::@1
  __b1:
    // while(i<10)
    // [22] if((byte) rvaluevar::i#2<(byte) $a) goto rvaluevar::@2 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$a
    bcc __b2
    // rvaluevar::@3
    // *screen2 = b
    // [23] *((const byte*) rvaluevar::screen2) ← (byte) rvaluevar::b#2 -- _deref_pbuc1=vbuyy 
    sty screen2
    // rvaluevar::@return
    // }
    // [24] return 
    rts
    // rvaluevar::@2
  __b2:
    // b = *screen
    // [25] (byte) rvaluevar::b#1 ← *((byte*) rvaluevar::screen#2) -- vbuyy=_deref_pbuz1 
    ldy #0
    lda (screen),y
    tay
    // screen++;
    // [26] (byte*) rvaluevar::screen#1 ← ++ (byte*) rvaluevar::screen#2 -- pbuz1=_inc_pbuz1 
    inc.z screen
    bne !+
    inc.z screen+1
  !:
    // i++;
    // [27] (byte) rvaluevar::i#1 ← ++ (byte) rvaluevar::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [21] phi from rvaluevar::@2 to rvaluevar::@1 [phi:rvaluevar::@2->rvaluevar::@1]
    // [21] phi (byte) rvaluevar::b#2 = (byte) rvaluevar::b#1 [phi:rvaluevar::@2->rvaluevar::@1#0] -- register_copy 
    // [21] phi (byte*) rvaluevar::screen#2 = (byte*) rvaluevar::screen#1 [phi:rvaluevar::@2->rvaluevar::@1#1] -- register_copy 
    // [21] phi (byte) rvaluevar::i#2 = (byte) rvaluevar::i#1 [phi:rvaluevar::@2->rvaluevar::@1#2] -- register_copy 
    jmp __b1
}
  // rvalue
rvalue: {
    // A constant pointer
    .label SCREEN = $400
    .label screen2 = $400
    // b = SCREEN[1]
    // [28] (byte) rvalue::b#1 ← *((const byte*) rvalue::SCREEN+(byte) 1) -- vbuaa=_deref_pbuc1 
    // RValue constant array pointer constant index
    lda SCREEN+1
    // [29] phi from rvalue to rvalue::@1 [phi:rvalue->rvalue::@1]
    // [29] phi (byte) rvalue::b#3 = (byte) rvalue::b#1 [phi:rvalue->rvalue::@1#0] -- register_copy 
    // [29] phi (byte) rvalue::i#2 = (byte) 2 [phi:rvalue->rvalue::@1#1] -- vbuxx=vbuc1 
    ldx #2
    // rvalue::@1
  __b1:
    // while(i<10)
    // [30] if((byte) rvalue::i#2<(byte) $a) goto rvalue::@2 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$a
    bcc __b2
    // rvalue::@3
    // *screen2 = b
    // [31] *((const byte*) rvalue::screen2) ← (byte) rvalue::b#3 -- _deref_pbuc1=vbuaa 
    sta screen2
    // rvalue::@return
    // }
    // [32] return 
    rts
    // rvalue::@2
  __b2:
    // b = SCREEN[i++]
    // [33] (byte) rvalue::b#2 ← *((const byte*) rvalue::SCREEN + (byte) rvalue::i#2) -- vbuaa=pbuc1_derefidx_vbuxx 
    lda SCREEN,x
    // b = SCREEN[i++];
    // [34] (byte) rvalue::i#1 ← ++ (byte) rvalue::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [29] phi from rvalue::@2 to rvalue::@1 [phi:rvalue::@2->rvalue::@1]
    // [29] phi (byte) rvalue::b#3 = (byte) rvalue::b#2 [phi:rvalue::@2->rvalue::@1#0] -- register_copy 
    // [29] phi (byte) rvalue::i#2 = (byte) rvalue::i#1 [phi:rvalue::@2->rvalue::@1#1] -- register_copy 
    jmp __b1
}
  // lvalue
lvalue: {
    // A constant pointer
    .label SCREEN = $400
    // *SCREEN = 1
    // [35] *((const byte*) lvalue::SCREEN) ← (byte) 1 -- _deref_pbuc1=vbuc2 
    // LValue constant pointer dereference
    lda #1
    sta SCREEN
    // SCREEN[1] = 2
    // [36] *((const byte*) lvalue::SCREEN+(byte) 1) ← (byte) 2 -- _deref_pbuc1=vbuc2 
    // LValue constant array constant indexing
    lda #2
    sta SCREEN+1
    // [37] phi from lvalue to lvalue::@1 [phi:lvalue->lvalue::@1]
    // [37] phi (byte) lvalue::i#2 = (byte) 2 [phi:lvalue->lvalue::@1#0] -- vbuxx=vbuc1 
    tax
    // lvalue::@1
  __b1:
    // while(i<10)
    // [38] if((byte) lvalue::i#2<(byte) $a) goto lvalue::@2 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$a
    bcc __b2
    // lvalue::@return
    // }
    // [39] return 
    rts
    // lvalue::@2
  __b2:
    // SCREEN[i++] = 3
    // [40] *((const byte*) lvalue::SCREEN + (byte) lvalue::i#2) ← (byte) 3 -- pbuc1_derefidx_vbuxx=vbuc2 
    lda #3
    sta SCREEN,x
    // SCREEN[i++] = 3;
    // [41] (byte) lvalue::i#1 ← ++ (byte) lvalue::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [37] phi from lvalue::@2 to lvalue::@1 [phi:lvalue::@2->lvalue::@1]
    // [37] phi (byte) lvalue::i#2 = (byte) lvalue::i#1 [phi:lvalue::@2->lvalue::@1#0] -- register_copy 
    jmp __b1
}
  // File Data

