Fixing pointer array-indexing *((const word*) main::words + (byte) main::i)
Fixing pointer array-indexing *((const word*) main::words + (byte) main::i)
Fixing pointer array-indexing *((const word*) main::words + (number) 0)
Fixing pointer array-indexing *((const word*) main::words + (number) 0)
Fixing pointer array-indexing *((const word*) main::words + (number) 1)
Fixing pointer array-indexing *((const word*) main::words + (number) 1)
Fixing pointer array-indexing *((const word*) main::words + (number) 2)
Fixing pointer array-indexing *((const word*) main::words + (number) 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 )
  (byte~) main::$7 ← (byte) main::i#2 * (const byte) SIZEOF_WORD
  *((const word*) main::words + (byte~) main::$7) ← *((const word*) main::words + (byte~) main::$7) + (number) $101
  (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,2)
  (bool~) main::$6 ← (byte) main::i#1 != rangelast(0,2)
  if((bool~) main::$6) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@1
  (number~) main::$8 ← (number) 0 * (const byte) SIZEOF_WORD
  (byte~) main::$0 ← > *((const word*) main::words + (number~) main::$8)
  *((const byte*) main::SCREEN + (number) 0) ← (byte~) main::$0
  (number~) main::$9 ← (number) 0 * (const byte) SIZEOF_WORD
  (byte~) main::$1 ← < *((const word*) main::words + (number~) main::$9)
  *((const byte*) main::SCREEN + (number) 1) ← (byte~) main::$1
  (number~) main::$10 ← (number) 1 * (const byte) SIZEOF_WORD
  (byte~) main::$2 ← > *((const word*) main::words + (number~) main::$10)
  *((const byte*) main::SCREEN + (number) 2) ← (byte~) main::$2
  (number~) main::$11 ← (number) 1 * (const byte) SIZEOF_WORD
  (byte~) main::$3 ← < *((const word*) main::words + (number~) main::$11)
  *((const byte*) main::SCREEN + (number) 3) ← (byte~) main::$3
  (number~) main::$12 ← (number) 2 * (const byte) SIZEOF_WORD
  (byte~) main::$4 ← > *((const word*) main::words + (number~) main::$12)
  *((const byte*) main::SCREEN + (number) 4) ← (byte~) main::$4
  (number~) main::$13 ← (number) 2 * (const byte) SIZEOF_WORD
  (byte~) main::$5 ← < *((const word*) main::words + (number~) main::$13)
  *((const byte*) main::SCREEN + (number) 5) ← (byte~) main::$5
  to:main::@return
main::@return: scope:[main]  from main::@2
  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
(const byte) SIZEOF_WORD = (byte) 2
(void()) main()
(byte~) main::$0
(byte~) main::$1
(number~) main::$10
(number~) main::$11
(number~) main::$12
(number~) main::$13
(byte~) main::$2
(byte~) main::$3
(byte~) main::$4
(byte~) main::$5
(bool~) main::$6
(byte~) main::$7
(number~) main::$8
(number~) main::$9
(label) main::@1
(label) main::@2
(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
(const word*) main::words[]  = { (word) $3031, (word) $3233, (word) $3435 }

Adding number conversion cast (unumber) $101 in *((const word*) main::words + (byte~) main::$7) ← *((const word*) main::words + (byte~) main::$7) + (number) $101
Adding number conversion cast (unumber) 0 in (number~) main::$8 ← (number) 0 * (const byte) SIZEOF_WORD
Adding number conversion cast (unumber) main::$8 in (number~) main::$8 ← (unumber)(number) 0 * (const byte) SIZEOF_WORD
Adding number conversion cast (unumber) 0 in *((const byte*) main::SCREEN + (number) 0) ← (byte~) main::$0
Adding number conversion cast (unumber) 0 in (number~) main::$9 ← (number) 0 * (const byte) SIZEOF_WORD
Adding number conversion cast (unumber) main::$9 in (number~) main::$9 ← (unumber)(number) 0 * (const byte) SIZEOF_WORD
Adding number conversion cast (unumber) 1 in *((const byte*) main::SCREEN + (number) 1) ← (byte~) main::$1
Adding number conversion cast (unumber) 1 in (number~) main::$10 ← (number) 1 * (const byte) SIZEOF_WORD
Adding number conversion cast (unumber) main::$10 in (number~) main::$10 ← (unumber)(number) 1 * (const byte) SIZEOF_WORD
Adding number conversion cast (unumber) 2 in *((const byte*) main::SCREEN + (number) 2) ← (byte~) main::$2
Adding number conversion cast (unumber) 1 in (number~) main::$11 ← (number) 1 * (const byte) SIZEOF_WORD
Adding number conversion cast (unumber) main::$11 in (number~) main::$11 ← (unumber)(number) 1 * (const byte) SIZEOF_WORD
Adding number conversion cast (unumber) 3 in *((const byte*) main::SCREEN + (number) 3) ← (byte~) main::$3
Adding number conversion cast (unumber) 2 in (number~) main::$12 ← (number) 2 * (const byte) SIZEOF_WORD
Adding number conversion cast (unumber) main::$12 in (number~) main::$12 ← (unumber)(number) 2 * (const byte) SIZEOF_WORD
Adding number conversion cast (unumber) 4 in *((const byte*) main::SCREEN + (number) 4) ← (byte~) main::$4
Adding number conversion cast (unumber) 2 in (number~) main::$13 ← (number) 2 * (const byte) SIZEOF_WORD
Adding number conversion cast (unumber) main::$13 in (number~) main::$13 ← (unumber)(number) 2 * (const byte) SIZEOF_WORD
Adding number conversion cast (unumber) 5 in *((const byte*) main::SCREEN + (number) 5) ← (byte~) main::$5
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $101
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 1
Simplifying constant integer cast 3
Simplifying constant integer cast 2
Simplifying constant integer cast 4
Simplifying constant integer cast 2
Simplifying constant integer cast 5
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (word) $101
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 5
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$8 ← (byte) 0 * (const byte) SIZEOF_WORD
Inferred type updated to byte in (unumber~) main::$9 ← (byte) 0 * (const byte) SIZEOF_WORD
Inferred type updated to byte in (unumber~) main::$10 ← (byte) 1 * (const byte) SIZEOF_WORD
Inferred type updated to byte in (unumber~) main::$11 ← (byte) 1 * (const byte) SIZEOF_WORD
Inferred type updated to byte in (unumber~) main::$12 ← (byte) 2 * (const byte) SIZEOF_WORD
Inferred type updated to byte in (unumber~) main::$13 ← (byte) 2 * (const byte) SIZEOF_WORD
Simple Condition (bool~) main::$6 [6] if((byte) main::i#1!=rangelast(0,2)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [7] (byte~) main::$8 ← (byte) 0 * (const byte) SIZEOF_WORD
Constant right-side identified [10] (byte~) main::$9 ← (byte) 0 * (const byte) SIZEOF_WORD
Constant right-side identified [13] (byte~) main::$10 ← (byte) 1 * (const byte) SIZEOF_WORD
Constant right-side identified [16] (byte~) main::$11 ← (byte) 1 * (const byte) SIZEOF_WORD
Constant right-side identified [19] (byte~) main::$12 ← (byte) 2 * (const byte) SIZEOF_WORD
Constant right-side identified [22] (byte~) main::$13 ← (byte) 2 * (const byte) SIZEOF_WORD
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::i#0 = 0
Constant (const byte) main::$8 = 0*SIZEOF_WORD
Constant (const byte) main::$9 = 0*SIZEOF_WORD
Constant (const byte) main::$10 = 1*SIZEOF_WORD
Constant (const byte) main::$11 = 1*SIZEOF_WORD
Constant (const byte) main::$12 = 2*SIZEOF_WORD
Constant (const byte) main::$13 = 2*SIZEOF_WORD
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [4] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [6] if(main::i#1!=rangelast(0,2)) goto main::@1 to (number) 3
Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_WORD in 
Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_WORD in 
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero main::words in [8] (byte~) main::$0 ← > *((const word*) main::words + (const byte) main::$8)
Simplifying expression containing zero main::SCREEN in [9] *((const byte*) main::SCREEN + (byte) 0) ← (byte~) main::$0
Simplifying expression containing zero main::words in [11] (byte~) main::$1 ← < *((const word*) main::words + (const byte) main::$9)
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) main::$8
Eliminating unused constant (const byte) main::$9
Successful SSA optimization PassNEliminateUnusedVars
Adding number conversion cast (unumber) 3 in if((byte) main::i#1!=(number) 3) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 3
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 3
Successful SSA optimization PassNFinalizeNumberTypeConversions
Rewriting multiplication to use shift [1] (byte~) main::$7 ← (byte) main::i#2 * (const byte) SIZEOF_WORD
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const byte) main::i#0
Constant inlined main::$12 = (byte) 2*(const byte) SIZEOF_WORD
Constant inlined main::i#0 = (byte) 0
Constant inlined main::$13 = (byte) 2*(const byte) SIZEOF_WORD
Constant inlined main::$10 = (byte) 1*(const byte) SIZEOF_WORD
Constant inlined main::$11 = (byte) 1*(const byte) SIZEOF_WORD
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(main::SCREEN+1)
Consolidated array index constant in *(main::words+1*SIZEOF_WORD)
Consolidated array index constant in *(main::SCREEN+2)
Consolidated array index constant in *(main::words+1*SIZEOF_WORD)
Consolidated array index constant in *(main::SCREEN+3)
Consolidated array index constant in *(main::words+2*SIZEOF_WORD)
Consolidated array index constant in *(main::SCREEN+4)
Consolidated array index constant in *(main::words+2*SIZEOF_WORD)
Consolidated array index constant in *(main::SCREEN+5)
Successful SSA optimization Pass2ConstantAdditionElimination
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 [24] 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] (byte~) main::$7 ← (byte) main::i#2 << (byte) 1
  [7] *((const word*) main::words + (byte~) main::$7) ← *((const word*) main::words + (byte~) main::$7) + (word) $101
  [8] (byte) main::i#1 ← ++ (byte) main::i#2
  [9] if((byte) main::i#1!=(byte) 3) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@1
  [10] (byte~) main::$0 ← > *((const word*) main::words)
  [11] *((const byte*) main::SCREEN) ← (byte~) main::$0
  [12] (byte~) main::$1 ← < *((const word*) main::words)
  [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte~) main::$1
  [14] (byte~) main::$2 ← > *((const word*) main::words+(byte) 1*(const byte) SIZEOF_WORD)
  [15] *((const byte*) main::SCREEN+(byte) 2) ← (byte~) main::$2
  [16] (byte~) main::$3 ← < *((const word*) main::words+(byte) 1*(const byte) SIZEOF_WORD)
  [17] *((const byte*) main::SCREEN+(byte) 3) ← (byte~) main::$3
  [18] (byte~) main::$4 ← > *((const word*) main::words+(byte) 2*(const byte) SIZEOF_WORD)
  [19] *((const byte*) main::SCREEN+(byte) 4) ← (byte~) main::$4
  [20] (byte~) main::$5 ← < *((const word*) main::words+(byte) 2*(const byte) SIZEOF_WORD)
  [21] *((const byte*) main::SCREEN+(byte) 5) ← (byte~) main::$5
  to:main::@return
main::@return: scope:[main]  from main::@2
  [22] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(void()) main()
(byte~) main::$0 4.0
(byte~) main::$1 4.0
(byte~) main::$2 4.0
(byte~) main::$3 4.0
(byte~) main::$4 4.0
(byte~) main::$5 4.0
(byte~) main::$7 33.0
(byte) main::i
(byte) main::i#1 16.5
(byte) main::i#2 11.0

Initial phi equivalence classes
[ main::i#2 main::i#1 ]
Added variable main::$7 to live range equivalence class [ main::$7 ]
Added variable main::$0 to live range equivalence class [ main::$0 ]
Added variable main::$1 to live range equivalence class [ main::$1 ]
Added variable main::$2 to live range equivalence class [ main::$2 ]
Added variable main::$3 to live range equivalence class [ main::$3 ]
Added variable main::$4 to live range equivalence class [ main::$4 ]
Added variable main::$5 to live range equivalence class [ main::$5 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ main::$7 ]
[ main::$0 ]
[ main::$1 ]
[ main::$2 ]
[ main::$3 ]
[ main::$4 ]
[ main::$5 ]
Allocated zp[1]:2 [ main::i#2 main::i#1 ]
Allocated zp[1]:3 [ main::$7 ]
Allocated zp[1]:4 [ main::$0 ]
Allocated zp[1]:5 [ main::$1 ]
Allocated zp[1]:6 [ main::$2 ]
Allocated zp[1]:7 [ main::$3 ]
Allocated zp[1]:8 [ main::$4 ]
Allocated zp[1]:9 [ main::$5 ]

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
// Test word pointer compound assignment
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .const SIZEOF_WORD = 2
  // @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 __0 = 4
    .label __1 = 5
    .label __2 = 6
    .label __3 = 7
    .label __4 = 8
    .label __5 = 9
    .label __7 = 3
    .label i = 2
    // [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] (byte~) main::$7 ← (byte) main::i#2 << (byte) 1 -- vbuz1=vbuz2_rol_1 
    lda.z i
    asl
    sta.z __7
    // [7] *((const word*) main::words + (byte~) main::$7) ← *((const word*) main::words + (byte~) main::$7) + (word) $101 -- pwuc1_derefidx_vbuz1=pwuc1_derefidx_vbuz1_plus_vwuc2 
    ldy.z __7
    clc
    lda words,y
    adc #<$101
    sta words,y
    lda words+1,y
    adc #>$101
    sta words+1,y
    // [8] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [9] if((byte) main::i#1!=(byte) 3) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #3
    cmp.z i
    bne __b1_from___b1
    jmp __b2
    // main::@2
  __b2:
    // [10] (byte~) main::$0 ← > *((const word*) main::words) -- vbuz1=_hi__deref_pwuc1 
    lda words+1
    sta.z __0
    // [11] *((const byte*) main::SCREEN) ← (byte~) main::$0 -- _deref_pbuc1=vbuz1 
    lda.z __0
    sta SCREEN
    // [12] (byte~) main::$1 ← < *((const word*) main::words) -- vbuz1=_lo__deref_pwuc1 
    lda words
    sta.z __1
    // [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuz1 
    lda.z __1
    sta SCREEN+1
    // [14] (byte~) main::$2 ← > *((const word*) main::words+(byte) 1*(const byte) SIZEOF_WORD) -- vbuz1=_hi__deref_pwuc1 
    lda words+1*SIZEOF_WORD+1
    sta.z __2
    // [15] *((const byte*) main::SCREEN+(byte) 2) ← (byte~) main::$2 -- _deref_pbuc1=vbuz1 
    lda.z __2
    sta SCREEN+2
    // [16] (byte~) main::$3 ← < *((const word*) main::words+(byte) 1*(const byte) SIZEOF_WORD) -- vbuz1=_lo__deref_pwuc1 
    lda words+1*SIZEOF_WORD
    sta.z __3
    // [17] *((const byte*) main::SCREEN+(byte) 3) ← (byte~) main::$3 -- _deref_pbuc1=vbuz1 
    lda.z __3
    sta SCREEN+3
    // [18] (byte~) main::$4 ← > *((const word*) main::words+(byte) 2*(const byte) SIZEOF_WORD) -- vbuz1=_hi__deref_pwuc1 
    lda words+2*SIZEOF_WORD+1
    sta.z __4
    // [19] *((const byte*) main::SCREEN+(byte) 4) ← (byte~) main::$4 -- _deref_pbuc1=vbuz1 
    lda.z __4
    sta SCREEN+4
    // [20] (byte~) main::$5 ← < *((const word*) main::words+(byte) 2*(const byte) SIZEOF_WORD) -- vbuz1=_lo__deref_pwuc1 
    lda words+2*SIZEOF_WORD
    sta.z __5
    // [21] *((const byte*) main::SCREEN+(byte) 5) ← (byte~) main::$5 -- _deref_pbuc1=vbuz1 
    lda.z __5
    sta SCREEN+5
    jmp __breturn
    // main::@return
  __breturn:
    // [22] return 
    rts
    words: .word $3031, $3233, $3435
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [6] (byte~) main::$7 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::$7 ] ( main:2 [ main::i#2 main::$7 ] ) 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 [7] *((const word*) main::words + (byte~) main::$7) ← *((const word*) main::words + (byte~) main::$7) + (word) $101 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a 
Statement [6] (byte~) main::$7 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::$7 ] ( main:2 [ main::i#2 main::$7 ] ) always clobbers reg byte a 
Statement [7] *((const word*) main::words + (byte~) main::$7) ← *((const word*) main::words + (byte~) main::$7) + (word) $101 [ main::i#2 ] ( main:2 [ main::i#2 ] ) 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::$7 ] : zp[1]:3 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:4 [ main::$0 ] : zp[1]:4 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:5 [ main::$1 ] : zp[1]:5 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:6 [ main::$2 ] : zp[1]:6 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:7 [ main::$3 ] : zp[1]:7 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:8 [ main::$4 ] : zp[1]:8 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:9 [ main::$5 ] : zp[1]:9 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 33: zp[1]:3 [ main::$7 ] 27.5: zp[1]:2 [ main::i#2 main::i#1 ] 4: zp[1]:4 [ main::$0 ] 4: zp[1]:5 [ main::$1 ] 4: zp[1]:6 [ main::$2 ] 4: zp[1]:7 [ main::$3 ] 4: zp[1]:8 [ main::$4 ] 4: zp[1]:9 [ main::$5 ] 
Uplift Scope [] 

Uplifting [main] best 578 combination reg byte a [ main::$7 ] reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$0 ] reg byte a [ main::$1 ] zp[1]:6 [ main::$2 ] zp[1]:7 [ main::$3 ] zp[1]:8 [ main::$4 ] zp[1]:9 [ main::$5 ] 
Limited combination testing to 100 combinations of 49152 possible.
Uplifting [] best 578 combination 
Attempting to uplift remaining variables inzp[1]:6 [ main::$2 ]
Uplifting [main] best 572 combination reg byte a [ main::$2 ] 
Attempting to uplift remaining variables inzp[1]:7 [ main::$3 ]
Uplifting [main] best 566 combination reg byte a [ main::$3 ] 
Attempting to uplift remaining variables inzp[1]:8 [ main::$4 ]
Uplifting [main] best 560 combination reg byte a [ main::$4 ] 
Attempting to uplift remaining variables inzp[1]:9 [ main::$5 ]
Uplifting [main] best 554 combination reg byte a [ main::$5 ] 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Test word pointer compound assignment
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .const SIZEOF_WORD = 2
  // @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
    // [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] (byte~) main::$7 ← (byte) main::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1 
    txa
    asl
    // [7] *((const word*) main::words + (byte~) main::$7) ← *((const word*) main::words + (byte~) main::$7) + (word) $101 -- pwuc1_derefidx_vbuaa=pwuc1_derefidx_vbuaa_plus_vwuc2 
    tay
    clc
    lda words,y
    adc #<$101
    sta words,y
    lda words+1,y
    adc #>$101
    sta words+1,y
    // [8] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [9] if((byte) main::i#1!=(byte) 3) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #3
    bne __b1_from___b1
    jmp __b2
    // main::@2
  __b2:
    // [10] (byte~) main::$0 ← > *((const word*) main::words) -- vbuaa=_hi__deref_pwuc1 
    lda words+1
    // [11] *((const byte*) main::SCREEN) ← (byte~) main::$0 -- _deref_pbuc1=vbuaa 
    sta SCREEN
    // [12] (byte~) main::$1 ← < *((const word*) main::words) -- vbuaa=_lo__deref_pwuc1 
    lda words
    // [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa 
    sta SCREEN+1
    // [14] (byte~) main::$2 ← > *((const word*) main::words+(byte) 1*(const byte) SIZEOF_WORD) -- vbuaa=_hi__deref_pwuc1 
    lda words+1*SIZEOF_WORD+1
    // [15] *((const byte*) main::SCREEN+(byte) 2) ← (byte~) main::$2 -- _deref_pbuc1=vbuaa 
    sta SCREEN+2
    // [16] (byte~) main::$3 ← < *((const word*) main::words+(byte) 1*(const byte) SIZEOF_WORD) -- vbuaa=_lo__deref_pwuc1 
    lda words+1*SIZEOF_WORD
    // [17] *((const byte*) main::SCREEN+(byte) 3) ← (byte~) main::$3 -- _deref_pbuc1=vbuaa 
    sta SCREEN+3
    // [18] (byte~) main::$4 ← > *((const word*) main::words+(byte) 2*(const byte) SIZEOF_WORD) -- vbuaa=_hi__deref_pwuc1 
    lda words+2*SIZEOF_WORD+1
    // [19] *((const byte*) main::SCREEN+(byte) 4) ← (byte~) main::$4 -- _deref_pbuc1=vbuaa 
    sta SCREEN+4
    // [20] (byte~) main::$5 ← < *((const word*) main::words+(byte) 2*(const byte) SIZEOF_WORD) -- vbuaa=_lo__deref_pwuc1 
    lda words+2*SIZEOF_WORD
    // [21] *((const byte*) main::SCREEN+(byte) 5) ← (byte~) main::$5 -- _deref_pbuc1=vbuaa 
    sta SCREEN+5
    jmp __breturn
    // main::@return
  __breturn:
    // [22] return 
    rts
    words: .word $3031, $3233, $3435
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __bend
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
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 __b2:
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

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const byte) SIZEOF_WORD = (byte) 2
(void()) main()
(byte~) main::$0 reg byte a 4.0
(byte~) main::$1 reg byte a 4.0
(byte~) main::$2 reg byte a 4.0
(byte~) main::$3 reg byte a 4.0
(byte~) main::$4 reg byte a 4.0
(byte~) main::$5 reg byte a 4.0
(byte~) main::$7 reg byte a 33.0
(label) main::@1
(label) main::@2
(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 11.0
(const word*) main::words[]  = { (word) $3031, (word) $3233, (word) $3435 }

reg byte x [ main::i#2 main::i#1 ]
reg byte a [ main::$7 ]
reg byte a [ main::$0 ]
reg byte a [ main::$1 ]
reg byte a [ main::$2 ]
reg byte a [ main::$3 ]
reg byte a [ main::$4 ]
reg byte a [ main::$5 ]


FINAL ASSEMBLER
Score: 449

  // File Comments
// Test word pointer compound assignment
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .const SIZEOF_WORD = 2
  // @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
    // [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:
    // words[i] += $0101
    // [6] (byte~) main::$7 ← (byte) main::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1 
    txa
    asl
    // [7] *((const word*) main::words + (byte~) main::$7) ← *((const word*) main::words + (byte~) main::$7) + (word) $101 -- pwuc1_derefidx_vbuaa=pwuc1_derefidx_vbuaa_plus_vwuc2 
    tay
    clc
    lda words,y
    adc #<$101
    sta words,y
    lda words+1,y
    adc #>$101
    sta words+1,y
    // for( byte i: 0..2)
    // [8] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [9] if((byte) main::i#1!=(byte) 3) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #3
    bne __b1
    // main::@2
    // >words[0]
    // [10] (byte~) main::$0 ← > *((const word*) main::words) -- vbuaa=_hi__deref_pwuc1 
    lda words+1
    // SCREEN[0] = >words[0]
    // [11] *((const byte*) main::SCREEN) ← (byte~) main::$0 -- _deref_pbuc1=vbuaa 
    sta SCREEN
    // <words[0]
    // [12] (byte~) main::$1 ← < *((const word*) main::words) -- vbuaa=_lo__deref_pwuc1 
    lda words
    // SCREEN[1] = <words[0]
    // [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa 
    sta SCREEN+1
    // >words[1]
    // [14] (byte~) main::$2 ← > *((const word*) main::words+(byte) 1*(const byte) SIZEOF_WORD) -- vbuaa=_hi__deref_pwuc1 
    lda words+1*SIZEOF_WORD+1
    // SCREEN[2] = >words[1]
    // [15] *((const byte*) main::SCREEN+(byte) 2) ← (byte~) main::$2 -- _deref_pbuc1=vbuaa 
    sta SCREEN+2
    // <words[1]
    // [16] (byte~) main::$3 ← < *((const word*) main::words+(byte) 1*(const byte) SIZEOF_WORD) -- vbuaa=_lo__deref_pwuc1 
    lda words+1*SIZEOF_WORD
    // SCREEN[3] = <words[1]
    // [17] *((const byte*) main::SCREEN+(byte) 3) ← (byte~) main::$3 -- _deref_pbuc1=vbuaa 
    sta SCREEN+3
    // >words[2]
    // [18] (byte~) main::$4 ← > *((const word*) main::words+(byte) 2*(const byte) SIZEOF_WORD) -- vbuaa=_hi__deref_pwuc1 
    lda words+2*SIZEOF_WORD+1
    // SCREEN[4] = >words[2]
    // [19] *((const byte*) main::SCREEN+(byte) 4) ← (byte~) main::$4 -- _deref_pbuc1=vbuaa 
    sta SCREEN+4
    // <words[2]
    // [20] (byte~) main::$5 ← < *((const word*) main::words+(byte) 2*(const byte) SIZEOF_WORD) -- vbuaa=_lo__deref_pwuc1 
    lda words+2*SIZEOF_WORD
    // SCREEN[5] = <words[2]
    // [21] *((const byte*) main::SCREEN+(byte) 5) ← (byte~) main::$5 -- _deref_pbuc1=vbuaa 
    sta SCREEN+5
    // main::@return
    // }
    // [22] return 
    rts
    words: .word $3031, $3233, $3435
}
  // File Data

