Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx 
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) @4
Culled Empty Block (label) main::@2
Culled Empty Block (label) @5
Culled Empty Block (label) position_sprite::@2
Culled Empty Block (label) position_sprite::@4

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  (byte*) SPRITES_XPOS#0 ← ((byte*)) (number) $d000
  (byte*) SPRITES_YPOS#0 ← ((byte*)) (number) $d001
  (byte*) SPRITES_XMSB#0 ← ((byte*)) (number) $d010
  to:@6
main: scope:[main]  from @6
  (word) main::xpos#0 ← (number) $c8
  (byte) main::s#0 ← (byte) 0
  to:main::@1
main::@1: scope:[main]  from main main::@3
  (word) main::xpos#2 ← phi( main/(word) main::xpos#0 main::@3/(word) main::xpos#1 )
  (byte) main::s#2 ← phi( main/(byte) main::s#0 main::@3/(byte) main::s#1 )
  (byte) position_sprite::spriteno#0 ← (byte) main::s#2
  (word) position_sprite::x#0 ← (word) main::xpos#2
  (byte) position_sprite::y#0 ← (number) $32
  call position_sprite 
  to:main::@3
main::@3: scope:[main]  from main::@1
  (byte) main::s#3 ← phi( main::@1/(byte) main::s#2 )
  (word) main::xpos#3 ← phi( main::@1/(word) main::xpos#2 )
  (word) main::xpos#1 ← (word) main::xpos#3 + (number) $a
  (byte) main::s#1 ← (byte) main::s#3 + rangenext(0,7)
  (bool~) main::$1 ← (byte) main::s#1 != rangelast(0,7)
  if((bool~) main::$1) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@3
  return 
  to:@return
position_sprite: scope:[position_sprite]  from main::@1
  (word) position_sprite::x#1 ← phi( main::@1/(word) position_sprite::x#0 )
  (byte) position_sprite::y#1 ← phi( main::@1/(byte) position_sprite::y#0 )
  (byte) position_sprite::spriteno#1 ← phi( main::@1/(byte) position_sprite::spriteno#0 )
  (number~) position_sprite::$0 ← (byte) position_sprite::spriteno#1 * (number) 2
  *((byte*) SPRITES_YPOS#0 + (number~) position_sprite::$0) ← (byte) position_sprite::y#1
  (number~) position_sprite::$1 ← (byte) position_sprite::spriteno#1 * (number) 2
  (byte~) position_sprite::$2 ← < (word) position_sprite::x#1
  *((byte*) SPRITES_XPOS#0 + (number~) position_sprite::$1) ← (byte~) position_sprite::$2
  (bool~) position_sprite::$3 ← (word) position_sprite::x#1 > (number) $ff
  if((bool~) position_sprite::$3) goto position_sprite::@1
  to:position_sprite::@3
position_sprite::@1: scope:[position_sprite]  from position_sprite
  (byte) position_sprite::spriteno#2 ← phi( position_sprite/(byte) position_sprite::spriteno#1 )
  (number~) position_sprite::$6 ← (number) 1 << (byte) position_sprite::spriteno#2
  *((byte*) SPRITES_XMSB#0) ← *((byte*) SPRITES_XMSB#0) | (number~) position_sprite::$6
  to:position_sprite::@return
position_sprite::@3: scope:[position_sprite]  from position_sprite
  (byte) position_sprite::spriteno#3 ← phi( position_sprite/(byte) position_sprite::spriteno#1 )
  (number~) position_sprite::$4 ← (number) 1 << (byte) position_sprite::spriteno#3
  (number~) position_sprite::$5 ← (number~) position_sprite::$4 ^ (number) $ff
  *((byte*) SPRITES_XMSB#0) ← *((byte*) SPRITES_XMSB#0) & (number~) position_sprite::$5
  to:position_sprite::@return
position_sprite::@return: scope:[position_sprite]  from position_sprite::@1 position_sprite::@3
  return 
  to:@return
@6: scope:[]  from @begin
  call main 
  to:@7
@7: scope:[]  from @6
  to:@end
@end: scope:[]  from @7

SYMBOL TABLE SSA
(label) @6
(label) @7
(label) @begin
(label) @end
(byte*) SPRITES_XMSB
(byte*) SPRITES_XMSB#0
(byte*) SPRITES_XPOS
(byte*) SPRITES_XPOS#0
(byte*) SPRITES_YPOS
(byte*) SPRITES_YPOS#0
(void()) main()
(bool~) main::$1
(label) main::@1
(label) main::@3
(label) main::@return
(byte) main::s
(byte) main::s#0
(byte) main::s#1
(byte) main::s#2
(byte) main::s#3
(word) main::xpos
(word) main::xpos#0
(word) main::xpos#1
(word) main::xpos#2
(word) main::xpos#3
(void()) position_sprite((byte) position_sprite::spriteno , (word) position_sprite::x , (byte) position_sprite::y)
(number~) position_sprite::$0
(number~) position_sprite::$1
(byte~) position_sprite::$2
(bool~) position_sprite::$3
(number~) position_sprite::$4
(number~) position_sprite::$5
(number~) position_sprite::$6
(label) position_sprite::@1
(label) position_sprite::@3
(label) position_sprite::@return
(byte) position_sprite::spriteno
(byte) position_sprite::spriteno#0
(byte) position_sprite::spriteno#1
(byte) position_sprite::spriteno#2
(byte) position_sprite::spriteno#3
(word) position_sprite::x
(word) position_sprite::x#0
(word) position_sprite::x#1
(byte) position_sprite::y
(byte) position_sprite::y#0
(byte) position_sprite::y#1

Adding number conversion cast (unumber) $c8 in (word) main::xpos#0 ← (number) $c8
Adding number conversion cast (unumber) $32 in (byte) position_sprite::y#0 ← (number) $32
Adding number conversion cast (unumber) $a in (word) main::xpos#1 ← (word) main::xpos#3 + (number) $a
Adding number conversion cast (unumber) 2 in (number~) position_sprite::$0 ← (byte) position_sprite::spriteno#1 * (number) 2
Adding number conversion cast (unumber) position_sprite::$0 in (number~) position_sprite::$0 ← (byte) position_sprite::spriteno#1 * (unumber)(number) 2
Adding number conversion cast (unumber) 2 in (number~) position_sprite::$1 ← (byte) position_sprite::spriteno#1 * (number) 2
Adding number conversion cast (unumber) position_sprite::$1 in (number~) position_sprite::$1 ← (byte) position_sprite::spriteno#1 * (unumber)(number) 2
Adding number conversion cast (unumber) $ff in (bool~) position_sprite::$3 ← (word) position_sprite::x#1 > (number) $ff
Adding number conversion cast (unumber) 1 in (number~) position_sprite::$6 ← (number) 1 << (byte) position_sprite::spriteno#2
Adding number conversion cast (unumber) position_sprite::$6 in (number~) position_sprite::$6 ← (unumber)(number) 1 << (byte) position_sprite::spriteno#2
Adding number conversion cast (unumber) 1 in (number~) position_sprite::$4 ← (number) 1 << (byte) position_sprite::spriteno#3
Adding number conversion cast (unumber) position_sprite::$4 in (number~) position_sprite::$4 ← (unumber)(number) 1 << (byte) position_sprite::spriteno#3
Adding number conversion cast (unumber) $ff in (number~) position_sprite::$5 ← (unumber~) position_sprite::$4 ^ (number) $ff
Adding number conversion cast (unumber) position_sprite::$5 in (number~) position_sprite::$5 ← (unumber~) position_sprite::$4 ^ (unumber)(number) $ff
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) SPRITES_XPOS#0 ← (byte*)(number) $d000
Inlining cast (byte*) SPRITES_YPOS#0 ← (byte*)(number) $d001
Inlining cast (byte*) SPRITES_XMSB#0 ← (byte*)(number) $d010
Inlining cast (word) main::xpos#0 ← (unumber)(number) $c8
Inlining cast (byte) position_sprite::y#0 ← (unumber)(number) $32
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53248
Simplifying constant pointer cast (byte*) 53249
Simplifying constant pointer cast (byte*) 53264
Simplifying constant integer cast $c8
Simplifying constant integer cast $32
Simplifying constant integer cast $a
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Simplifying constant integer cast $ff
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast $ff
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $c8
Finalized unsigned number type (byte) $32
Finalized unsigned number type (byte) $a
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) $ff
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) $ff
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) position_sprite::$0 ← (byte) position_sprite::spriteno#1 * (byte) 2
Inferred type updated to byte in (unumber~) position_sprite::$1 ← (byte) position_sprite::spriteno#1 * (byte) 2
Inferred type updated to byte in (unumber~) position_sprite::$6 ← (byte) 1 << (byte) position_sprite::spriteno#2
Inferred type updated to byte in (unumber~) position_sprite::$4 ← (byte) 1 << (byte) position_sprite::spriteno#3
Inferred type updated to byte in (unumber~) position_sprite::$5 ← (byte~) position_sprite::$4 ^ (byte) $ff
Alias (word) main::xpos#2 = (word) main::xpos#3 
Alias (byte) main::s#2 = (byte) main::s#3 
Alias (byte) position_sprite::spriteno#1 = (byte) position_sprite::spriteno#2 (byte) position_sprite::spriteno#3 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte) position_sprite::spriteno#1 (byte) position_sprite::spriteno#0
Identical Phi Values (byte) position_sprite::y#1 (byte) position_sprite::y#0
Identical Phi Values (word) position_sprite::x#1 (word) position_sprite::x#0
Successful SSA optimization Pass2IdenticalPhiElimination
Identified duplicate assignment right side [19] (byte~) position_sprite::$1 ← (byte) position_sprite::spriteno#0 * (byte) 2
Successful SSA optimization Pass2DuplicateRValueIdentification
Simple Condition (bool~) main::$1 [14] if((byte) main::s#1!=rangelast(0,7)) goto main::@1
Simple Condition (bool~) position_sprite::$3 [23] if((word) position_sprite::x#0>(byte) $ff) goto position_sprite::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) SPRITES_XPOS#0 = (byte*) 53248
Constant (const byte*) SPRITES_YPOS#0 = (byte*) 53249
Constant (const byte*) SPRITES_XMSB#0 = (byte*) 53264
Constant (const word) main::xpos#0 = $c8
Constant (const byte) main::s#0 = 0
Constant (const byte) position_sprite::y#0 = $32
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [12] main::s#1 ← ++ main::s#2 to ++
Resolved ranged comparison value [14] if(main::s#1!=rangelast(0,7)) goto main::@1 to (number) 8
Adding number conversion cast (unumber) 8 in if((byte) main::s#1!=(number) 8) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 8
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 8
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte~) position_sprite::$1 = (byte~) position_sprite::$0 
Successful SSA optimization Pass2AliasElimination
Rewriting multiplication to use shift [8] (byte~) position_sprite::$1 ← (byte) position_sprite::spriteno#0 * (byte) 2
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const word) main::xpos#0
Inlining constant with var siblings (const byte) main::s#0
Constant inlined main::xpos#0 = (byte) $c8
Constant inlined main::s#0 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@4(between main::@3 and main::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @6
Adding NOP phi() at start of @7
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:2 
Calls in [main] to position_sprite:9 

Created 2 initial phi equivalence classes
Coalesced [14] main::s#4 ← main::s#1
Coalesced [15] main::xpos#4 ← main::xpos#1
Coalesced down to 2 phi equivalence classes
Culled Empty Block (label) @7
Culled Empty Block (label) main::@4
Renumbering block @6 to @1
Renumbering block main::@3 to main::@2
Renumbering block position_sprite::@3 to position_sprite::@2
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  [1] phi()
  [2] call main 
  to:@end
@end: scope:[]  from @1
  [3] phi()
main: scope:[main]  from @1
  [4] phi()
  to:main::@1
main::@1: scope:[main]  from main main::@2
  [5] (word) main::xpos#2 ← phi( main/(byte) $c8 main::@2/(word) main::xpos#1 )
  [5] (byte) main::s#2 ← phi( main/(byte) 0 main::@2/(byte) main::s#1 )
  [6] (byte) position_sprite::spriteno#0 ← (byte) main::s#2
  [7] (word) position_sprite::x#0 ← (word) main::xpos#2
  [8] call position_sprite 
  to:main::@2
main::@2: scope:[main]  from main::@1
  [9] (word) main::xpos#1 ← (word) main::xpos#2 + (byte) $a
  [10] (byte) main::s#1 ← ++ (byte) main::s#2
  [11] if((byte) main::s#1!=(byte) 8) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@2
  [12] return 
  to:@return
position_sprite: scope:[position_sprite]  from main::@1
  [13] (byte~) position_sprite::$1 ← (byte) position_sprite::spriteno#0 << (byte) 1
  [14] *((const byte*) SPRITES_YPOS#0 + (byte~) position_sprite::$1) ← (const byte) position_sprite::y#0
  [15] (byte~) position_sprite::$2 ← < (word) position_sprite::x#0
  [16] *((const byte*) SPRITES_XPOS#0 + (byte~) position_sprite::$1) ← (byte~) position_sprite::$2
  [17] if((word) position_sprite::x#0>(byte) $ff) goto position_sprite::@1
  to:position_sprite::@2
position_sprite::@2: scope:[position_sprite]  from position_sprite
  [18] (byte~) position_sprite::$4 ← (byte) 1 << (byte) position_sprite::spriteno#0
  [19] (byte~) position_sprite::$5 ← (byte~) position_sprite::$4 ^ (byte) $ff
  [20] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte~) position_sprite::$5
  to:position_sprite::@return
position_sprite::@return: scope:[position_sprite]  from position_sprite::@1 position_sprite::@2
  [21] return 
  to:@return
position_sprite::@1: scope:[position_sprite]  from position_sprite
  [22] (byte~) position_sprite::$6 ← (byte) 1 << (byte) position_sprite::spriteno#0
  [23] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte~) position_sprite::$6
  to:position_sprite::@return


VARIABLE REGISTER WEIGHTS
(byte*) SPRITES_XMSB
(byte*) SPRITES_XPOS
(byte*) SPRITES_YPOS
(void()) main()
(byte) main::s
(byte) main::s#1 16.5
(byte) main::s#2 6.6000000000000005
(word) main::xpos
(word) main::xpos#1 7.333333333333333
(word) main::xpos#2 8.25
(void()) position_sprite((byte) position_sprite::spriteno , (word) position_sprite::x , (byte) position_sprite::y)
(byte~) position_sprite::$1 2.0
(byte~) position_sprite::$2 4.0
(byte~) position_sprite::$4 4.0
(byte~) position_sprite::$5 4.0
(byte~) position_sprite::$6 4.0
(byte) position_sprite::spriteno
(byte) position_sprite::spriteno#0 2.4285714285714284
(word) position_sprite::x
(word) position_sprite::x#0 3.0
(byte) position_sprite::y

Initial phi equivalence classes
[ main::s#2 main::s#1 ]
[ main::xpos#2 main::xpos#1 ]
Added variable position_sprite::spriteno#0 to zero page equivalence class [ position_sprite::spriteno#0 ]
Added variable position_sprite::x#0 to zero page equivalence class [ position_sprite::x#0 ]
Added variable position_sprite::$1 to zero page equivalence class [ position_sprite::$1 ]
Added variable position_sprite::$2 to zero page equivalence class [ position_sprite::$2 ]
Added variable position_sprite::$4 to zero page equivalence class [ position_sprite::$4 ]
Added variable position_sprite::$5 to zero page equivalence class [ position_sprite::$5 ]
Added variable position_sprite::$6 to zero page equivalence class [ position_sprite::$6 ]
Complete equivalence classes
[ main::s#2 main::s#1 ]
[ main::xpos#2 main::xpos#1 ]
[ position_sprite::spriteno#0 ]
[ position_sprite::x#0 ]
[ position_sprite::$1 ]
[ position_sprite::$2 ]
[ position_sprite::$4 ]
[ position_sprite::$5 ]
[ position_sprite::$6 ]
Allocated zp ZP_BYTE:2 [ main::s#2 main::s#1 ]
Allocated zp ZP_WORD:3 [ main::xpos#2 main::xpos#1 ]
Allocated zp ZP_BYTE:5 [ position_sprite::spriteno#0 ]
Allocated zp ZP_WORD:6 [ position_sprite::x#0 ]
Allocated zp ZP_BYTE:8 [ position_sprite::$1 ]
Allocated zp ZP_BYTE:9 [ position_sprite::$2 ]
Allocated zp ZP_BYTE:10 [ position_sprite::$4 ]
Allocated zp ZP_BYTE:11 [ position_sprite::$5 ]
Allocated zp ZP_BYTE:12 [ position_sprite::$6 ]

INITIAL ASM
Target platform is c64basic
  // File Comments
// Tests rolling sprite MSB by variable amount
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label SPRITES_XPOS = $d000
  .label SPRITES_YPOS = $d001
  .label SPRITES_XMSB = $d010
  // @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 xpos = 3
    .label s = 2
    // [5] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    // [5] phi (word) main::xpos#2 = (byte) $c8 [phi:main->main::@1#0] -- vwuz1=vbuc1 
    lda #<$c8
    sta.z xpos
    lda #>$c8
    sta.z xpos+1
    // [5] phi (byte) main::s#2 = (byte) 0 [phi:main->main::@1#1] -- vbuz1=vbuc1 
    lda #0
    sta.z s
    jmp b1
    // [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
  b1_from_b2:
    // [5] phi (word) main::xpos#2 = (word) main::xpos#1 [phi:main::@2->main::@1#0] -- register_copy 
    // [5] phi (byte) main::s#2 = (byte) main::s#1 [phi:main::@2->main::@1#1] -- register_copy 
    jmp b1
    // main::@1
  b1:
    // [6] (byte) position_sprite::spriteno#0 ← (byte) main::s#2 -- vbuz1=vbuz2 
    lda.z s
    sta.z position_sprite.spriteno
    // [7] (word) position_sprite::x#0 ← (word) main::xpos#2 -- vwuz1=vwuz2 
    lda.z xpos
    sta.z position_sprite.x
    lda.z xpos+1
    sta.z position_sprite.x+1
    // [8] call position_sprite 
    jsr position_sprite
    jmp b2
    // main::@2
  b2:
    // [9] (word) main::xpos#1 ← (word) main::xpos#2 + (byte) $a -- vwuz1=vwuz1_plus_vbuc1 
    lda #$a
    clc
    adc.z xpos
    sta.z xpos
    bcc !+
    inc.z xpos+1
  !:
    // [10] (byte) main::s#1 ← ++ (byte) main::s#2 -- vbuz1=_inc_vbuz1 
    inc.z s
    // [11] if((byte) main::s#1!=(byte) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #8
    cmp.z s
    bne b1_from_b2
    jmp breturn
    // main::@return
  breturn:
    // [12] return 
    rts
}
  // position_sprite
// position_sprite(byte zeropage(5) spriteno, word zeropage(6) x)
position_sprite: {
    .const y = $32
    .label _1 = 8
    .label _2 = 9
    .label _4 = $a
    .label _5 = $b
    .label _6 = $c
    .label spriteno = 5
    .label x = 6
    // [13] (byte~) position_sprite::$1 ← (byte) position_sprite::spriteno#0 << (byte) 1 -- vbuz1=vbuz2_rol_1 
    lda.z spriteno
    asl
    sta.z _1
    // [14] *((const byte*) SPRITES_YPOS#0 + (byte~) position_sprite::$1) ← (const byte) position_sprite::y#0 -- pbuc1_derefidx_vbuz1=vbuc2 
    lda #y
    ldy.z _1
    sta SPRITES_YPOS,y
    // [15] (byte~) position_sprite::$2 ← < (word) position_sprite::x#0 -- vbuz1=_lo_vwuz2 
    lda.z x
    sta.z _2
    // [16] *((const byte*) SPRITES_XPOS#0 + (byte~) position_sprite::$1) ← (byte~) position_sprite::$2 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z _2
    ldy.z _1
    sta SPRITES_XPOS,y
    // [17] if((word) position_sprite::x#0>(byte) $ff) goto position_sprite::@1 -- vwuz1_gt_vbuc1_then_la1 
    lda.z x+1
    bne b1
    lda.z x
    cmp #$ff
    beq !+
    bcs b1
  !:
    jmp b2
    // position_sprite::@2
  b2:
    // [18] (byte~) position_sprite::$4 ← (byte) 1 << (byte) position_sprite::spriteno#0 -- vbuz1=vbuc1_rol_vbuz2 
    lda #1
    ldy.z spriteno
    cpy #0
    beq !e+
  !:
    asl
    dey
    bne !-
  !e:
    sta.z _4
    // [19] (byte~) position_sprite::$5 ← (byte~) position_sprite::$4 ^ (byte) $ff -- vbuz1=vbuz2_bxor_vbuc1 
    lda #$ff
    eor.z _4
    sta.z _5
    // [20] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte~) position_sprite::$5 -- _deref_pbuc1=_deref_pbuc1_band_vbuz1 
    lda SPRITES_XMSB
    and.z _5
    sta SPRITES_XMSB
    jmp breturn
    // position_sprite::@return
  breturn:
    // [21] return 
    rts
    // position_sprite::@1
  b1:
    // [22] (byte~) position_sprite::$6 ← (byte) 1 << (byte) position_sprite::spriteno#0 -- vbuz1=vbuc1_rol_vbuz2 
    lda #1
    ldy.z spriteno
    cpy #0
    beq !e+
  !:
    asl
    dey
    bne !-
  !e:
    sta.z _6
    // [23] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte~) position_sprite::$6 -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 
    lda SPRITES_XMSB
    ora.z _6
    sta SPRITES_XMSB
    jmp breturn
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] (word) position_sprite::x#0 ← (word) main::xpos#2 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 position_sprite::x#0 ] ( main:2 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 position_sprite::x#0 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::s#2 main::s#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ position_sprite::spriteno#0 ]
Statement [9] (word) main::xpos#1 ← (word) main::xpos#2 + (byte) $a [ main::s#2 main::xpos#1 ] ( main:2 [ main::s#2 main::xpos#1 ] ) always clobbers reg byte a 
Statement [13] (byte~) position_sprite::$1 ← (byte) position_sprite::spriteno#0 << (byte) 1 [ position_sprite::spriteno#0 position_sprite::x#0 position_sprite::$1 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 position_sprite::x#0 position_sprite::$1 ] ) always clobbers reg byte a 
Statement [14] *((const byte*) SPRITES_YPOS#0 + (byte~) position_sprite::$1) ← (const byte) position_sprite::y#0 [ position_sprite::spriteno#0 position_sprite::x#0 position_sprite::$1 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 position_sprite::x#0 position_sprite::$1 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:8 [ position_sprite::$1 ]
Statement [15] (byte~) position_sprite::$2 ← < (word) position_sprite::x#0 [ position_sprite::spriteno#0 position_sprite::x#0 position_sprite::$1 position_sprite::$2 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 position_sprite::x#0 position_sprite::$1 position_sprite::$2 ] ) always clobbers reg byte a 
Statement [17] if((word) position_sprite::x#0>(byte) $ff) goto position_sprite::@1 [ position_sprite::spriteno#0 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 ] ) always clobbers reg byte a 
Statement [18] (byte~) position_sprite::$4 ← (byte) 1 << (byte) position_sprite::spriteno#0 [ position_sprite::$4 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::$4 ] ) always clobbers reg byte a 
Statement [19] (byte~) position_sprite::$5 ← (byte~) position_sprite::$4 ^ (byte) $ff [ position_sprite::$5 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::$5 ] ) always clobbers reg byte a 
Statement [20] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte~) position_sprite::$5 [ ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 ] ) always clobbers reg byte a 
Statement [22] (byte~) position_sprite::$6 ← (byte) 1 << (byte) position_sprite::spriteno#0 [ position_sprite::$6 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::$6 ] ) always clobbers reg byte a 
Statement [23] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte~) position_sprite::$6 [ ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 ] ) always clobbers reg byte a 
Statement [7] (word) position_sprite::x#0 ← (word) main::xpos#2 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 position_sprite::x#0 ] ( main:2 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 position_sprite::x#0 ] ) always clobbers reg byte a 
Statement [9] (word) main::xpos#1 ← (word) main::xpos#2 + (byte) $a [ main::s#2 main::xpos#1 ] ( main:2 [ main::s#2 main::xpos#1 ] ) always clobbers reg byte a 
Statement [13] (byte~) position_sprite::$1 ← (byte) position_sprite::spriteno#0 << (byte) 1 [ position_sprite::spriteno#0 position_sprite::x#0 position_sprite::$1 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 position_sprite::x#0 position_sprite::$1 ] ) always clobbers reg byte a 
Statement [14] *((const byte*) SPRITES_YPOS#0 + (byte~) position_sprite::$1) ← (const byte) position_sprite::y#0 [ position_sprite::spriteno#0 position_sprite::x#0 position_sprite::$1 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 position_sprite::x#0 position_sprite::$1 ] ) always clobbers reg byte a 
Statement [15] (byte~) position_sprite::$2 ← < (word) position_sprite::x#0 [ position_sprite::spriteno#0 position_sprite::x#0 position_sprite::$1 position_sprite::$2 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 position_sprite::x#0 position_sprite::$1 position_sprite::$2 ] ) always clobbers reg byte a 
Statement [17] if((word) position_sprite::x#0>(byte) $ff) goto position_sprite::@1 [ position_sprite::spriteno#0 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 ] ) always clobbers reg byte a 
Statement [18] (byte~) position_sprite::$4 ← (byte) 1 << (byte) position_sprite::spriteno#0 [ position_sprite::$4 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::$4 ] ) always clobbers reg byte a 
Statement [19] (byte~) position_sprite::$5 ← (byte~) position_sprite::$4 ^ (byte) $ff [ position_sprite::$5 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::$5 ] ) always clobbers reg byte a 
Statement [20] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte~) position_sprite::$5 [ ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 ] ) always clobbers reg byte a 
Statement [22] (byte~) position_sprite::$6 ← (byte) 1 << (byte) position_sprite::spriteno#0 [ position_sprite::$6 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::$6 ] ) always clobbers reg byte a 
Statement [23] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte~) position_sprite::$6 [ ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 ] ) always clobbers reg byte a 
Potential registers zp ZP_BYTE:2 [ main::s#2 main::s#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , 
Potential registers zp ZP_WORD:3 [ main::xpos#2 main::xpos#1 ] : zp ZP_WORD:3 , 
Potential registers zp ZP_BYTE:5 [ position_sprite::spriteno#0 ] : zp ZP_BYTE:5 , reg byte x , reg byte y , 
Potential registers zp ZP_WORD:6 [ position_sprite::x#0 ] : zp ZP_WORD:6 , 
Potential registers zp ZP_BYTE:8 [ position_sprite::$1 ] : zp ZP_BYTE:8 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:9 [ position_sprite::$2 ] : zp ZP_BYTE:9 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:10 [ position_sprite::$4 ] : zp ZP_BYTE:10 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:11 [ position_sprite::$5 ] : zp ZP_BYTE:11 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:12 [ position_sprite::$6 ] : zp ZP_BYTE:12 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 23.1: zp ZP_BYTE:2 [ main::s#2 main::s#1 ] 15.58: zp ZP_WORD:3 [ main::xpos#2 main::xpos#1 ] 
Uplift Scope [position_sprite] 4: zp ZP_BYTE:9 [ position_sprite::$2 ] 4: zp ZP_BYTE:10 [ position_sprite::$4 ] 4: zp ZP_BYTE:11 [ position_sprite::$5 ] 4: zp ZP_BYTE:12 [ position_sprite::$6 ] 3: zp ZP_WORD:6 [ position_sprite::x#0 ] 2.43: zp ZP_BYTE:5 [ position_sprite::spriteno#0 ] 2: zp ZP_BYTE:8 [ position_sprite::$1 ] 
Uplift Scope [] 

Uplifting [main] best 841 combination reg byte x [ main::s#2 main::s#1 ] zp ZP_WORD:3 [ main::xpos#2 main::xpos#1 ] 
Uplifting [position_sprite] best 817 combination reg byte a [ position_sprite::$2 ] reg byte a [ position_sprite::$4 ] reg byte a [ position_sprite::$5 ] reg byte a [ position_sprite::$6 ] zp ZP_WORD:6 [ position_sprite::x#0 ] zp ZP_BYTE:5 [ position_sprite::spriteno#0 ] zp ZP_BYTE:8 [ position_sprite::$1 ] 
Limited combination testing to 100 combinations of 2304 possible.
Uplifting [] best 817 combination 
Attempting to uplift remaining variables inzp ZP_BYTE:5 [ position_sprite::spriteno#0 ]
Uplifting [position_sprite] best 817 combination zp ZP_BYTE:5 [ position_sprite::spriteno#0 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:8 [ position_sprite::$1 ]
Uplifting [position_sprite] best 810 combination reg byte y [ position_sprite::$1 ] 
Coalescing zero page register [ zp ZP_WORD:3 [ main::xpos#2 main::xpos#1 ] ] with [ zp ZP_WORD:6 [ position_sprite::x#0 ] ] - score: 1
Allocated (was zp ZP_WORD:3) zp ZP_WORD:2 [ main::xpos#2 main::xpos#1 position_sprite::x#0 ]
Allocated (was zp ZP_BYTE:5) zp ZP_BYTE:4 [ position_sprite::spriteno#0 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Tests rolling sprite MSB by variable amount
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label SPRITES_XPOS = $d000
  .label SPRITES_YPOS = $d001
  .label SPRITES_XMSB = $d010
  // @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 xpos = 2
    // [5] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    // [5] phi (word) main::xpos#2 = (byte) $c8 [phi:main->main::@1#0] -- vwuz1=vbuc1 
    lda #<$c8
    sta.z xpos
    lda #>$c8
    sta.z xpos+1
    // [5] phi (byte) main::s#2 = (byte) 0 [phi:main->main::@1#1] -- vbuxx=vbuc1 
    ldx #0
    jmp b1
    // [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
  b1_from_b2:
    // [5] phi (word) main::xpos#2 = (word) main::xpos#1 [phi:main::@2->main::@1#0] -- register_copy 
    // [5] phi (byte) main::s#2 = (byte) main::s#1 [phi:main::@2->main::@1#1] -- register_copy 
    jmp b1
    // main::@1
  b1:
    // [6] (byte) position_sprite::spriteno#0 ← (byte) main::s#2 -- vbuz1=vbuxx 
    stx.z position_sprite.spriteno
    // [7] (word) position_sprite::x#0 ← (word) main::xpos#2
    // [8] call position_sprite 
    jsr position_sprite
    jmp b2
    // main::@2
  b2:
    // [9] (word) main::xpos#1 ← (word) main::xpos#2 + (byte) $a -- vwuz1=vwuz1_plus_vbuc1 
    lda #$a
    clc
    adc.z xpos
    sta.z xpos
    bcc !+
    inc.z xpos+1
  !:
    // [10] (byte) main::s#1 ← ++ (byte) main::s#2 -- vbuxx=_inc_vbuxx 
    inx
    // [11] if((byte) main::s#1!=(byte) 8) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #8
    bne b1_from_b2
    jmp breturn
    // main::@return
  breturn:
    // [12] return 
    rts
}
  // position_sprite
// position_sprite(byte zeropage(4) spriteno, word zeropage(2) x)
position_sprite: {
    .const y = $32
    .label spriteno = 4
    .label x = 2
    // [13] (byte~) position_sprite::$1 ← (byte) position_sprite::spriteno#0 << (byte) 1 -- vbuyy=vbuz1_rol_1 
    lda.z spriteno
    asl
    tay
    // [14] *((const byte*) SPRITES_YPOS#0 + (byte~) position_sprite::$1) ← (const byte) position_sprite::y#0 -- pbuc1_derefidx_vbuyy=vbuc2 
    lda #y
    sta SPRITES_YPOS,y
    // [15] (byte~) position_sprite::$2 ← < (word) position_sprite::x#0 -- vbuaa=_lo_vwuz1 
    lda.z x
    // [16] *((const byte*) SPRITES_XPOS#0 + (byte~) position_sprite::$1) ← (byte~) position_sprite::$2 -- pbuc1_derefidx_vbuyy=vbuaa 
    sta SPRITES_XPOS,y
    // [17] if((word) position_sprite::x#0>(byte) $ff) goto position_sprite::@1 -- vwuz1_gt_vbuc1_then_la1 
    lda.z x+1
    bne b1
    lda.z x
    cmp #$ff
    beq !+
    bcs b1
  !:
    jmp b2
    // position_sprite::@2
  b2:
    // [18] (byte~) position_sprite::$4 ← (byte) 1 << (byte) position_sprite::spriteno#0 -- vbuaa=vbuc1_rol_vbuz1 
    lda #1
    ldy.z spriteno
    cpy #0
    beq !e+
  !:
    asl
    dey
    bne !-
  !e:
    // [19] (byte~) position_sprite::$5 ← (byte~) position_sprite::$4 ^ (byte) $ff -- vbuaa=vbuaa_bxor_vbuc1 
    eor #$ff
    // [20] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte~) position_sprite::$5 -- _deref_pbuc1=_deref_pbuc1_band_vbuaa 
    and SPRITES_XMSB
    sta SPRITES_XMSB
    jmp breturn
    // position_sprite::@return
  breturn:
    // [21] return 
    rts
    // position_sprite::@1
  b1:
    // [22] (byte~) position_sprite::$6 ← (byte) 1 << (byte) position_sprite::spriteno#0 -- vbuaa=vbuc1_rol_vbuz1 
    lda #1
    ldy.z spriteno
    cpy #0
    beq !e+
  !:
    asl
    dey
    bne !-
  !e:
    // [23] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte~) position_sprite::$6 -- _deref_pbuc1=_deref_pbuc1_bor_vbuaa 
    ora SPRITES_XMSB
    sta SPRITES_XMSB
    jmp breturn
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp breturn
Removing instruction jmp b2
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label b1_from_b2 with b1
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Removing instruction b1_from_b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction b1_from_main:
Removing instruction b2:
Removing instruction breturn:
Removing instruction b2:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Replacing jump to rts with rts in jmp breturn
Succesful ASM optimization Pass5DoubleJumpElimination
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(byte*) SPRITES_XMSB
(const byte*) SPRITES_XMSB#0 SPRITES_XMSB = (byte*) 53264
(byte*) SPRITES_XPOS
(const byte*) SPRITES_XPOS#0 SPRITES_XPOS = (byte*) 53248
(byte*) SPRITES_YPOS
(const byte*) SPRITES_YPOS#0 SPRITES_YPOS = (byte*) 53249
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@return
(byte) main::s
(byte) main::s#1 reg byte x 16.5
(byte) main::s#2 reg byte x 6.6000000000000005
(word) main::xpos
(word) main::xpos#1 xpos zp ZP_WORD:2 7.333333333333333
(word) main::xpos#2 xpos zp ZP_WORD:2 8.25
(void()) position_sprite((byte) position_sprite::spriteno , (word) position_sprite::x , (byte) position_sprite::y)
(byte~) position_sprite::$1 reg byte y 2.0
(byte~) position_sprite::$2 reg byte a 4.0
(byte~) position_sprite::$4 reg byte a 4.0
(byte~) position_sprite::$5 reg byte a 4.0
(byte~) position_sprite::$6 reg byte a 4.0
(label) position_sprite::@1
(label) position_sprite::@2
(label) position_sprite::@return
(byte) position_sprite::spriteno
(byte) position_sprite::spriteno#0 spriteno zp ZP_BYTE:4 2.4285714285714284
(word) position_sprite::x
(word) position_sprite::x#0 x zp ZP_WORD:2 3.0
(byte) position_sprite::y
(const byte) position_sprite::y#0 y = (byte) $32

reg byte x [ main::s#2 main::s#1 ]
zp ZP_WORD:2 [ main::xpos#2 main::xpos#1 position_sprite::x#0 ]
zp ZP_BYTE:4 [ position_sprite::spriteno#0 ]
reg byte y [ position_sprite::$1 ]
reg byte a [ position_sprite::$2 ]
reg byte a [ position_sprite::$4 ]
reg byte a [ position_sprite::$5 ]
reg byte a [ position_sprite::$6 ]


FINAL ASSEMBLER
Score: 555

  // File Comments
// Tests rolling sprite MSB by variable amount
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .label SPRITES_XPOS = $d000
  .label SPRITES_YPOS = $d001
  .label SPRITES_XMSB = $d010
  // @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 xpos = 2
    // [5] phi from main to main::@1 [phi:main->main::@1]
    // [5] phi (word) main::xpos#2 = (byte) $c8 [phi:main->main::@1#0] -- vwuz1=vbuc1 
    lda #<$c8
    sta.z xpos
    lda #>$c8
    sta.z xpos+1
    // [5] phi (byte) main::s#2 = (byte) 0 [phi:main->main::@1#1] -- vbuxx=vbuc1 
    ldx #0
    // [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
    // [5] phi (word) main::xpos#2 = (word) main::xpos#1 [phi:main::@2->main::@1#0] -- register_copy 
    // [5] phi (byte) main::s#2 = (byte) main::s#1 [phi:main::@2->main::@1#1] -- register_copy 
    // main::@1
  b1:
    // position_sprite(s, xpos, 50)
    // [6] (byte) position_sprite::spriteno#0 ← (byte) main::s#2 -- vbuz1=vbuxx 
    stx.z position_sprite.spriteno
    // [7] (word) position_sprite::x#0 ← (word) main::xpos#2
    // [8] call position_sprite 
    jsr position_sprite
    // main::@2
    // xpos += 10
    // [9] (word) main::xpos#1 ← (word) main::xpos#2 + (byte) $a -- vwuz1=vwuz1_plus_vbuc1 
    lda #$a
    clc
    adc.z xpos
    sta.z xpos
    bcc !+
    inc.z xpos+1
  !:
    // for(byte s: 0..7)
    // [10] (byte) main::s#1 ← ++ (byte) main::s#2 -- vbuxx=_inc_vbuxx 
    inx
    // [11] if((byte) main::s#1!=(byte) 8) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #8
    bne b1
    // main::@return
    // }
    // [12] return 
    rts
}
  // position_sprite
// position_sprite(byte zeropage(4) spriteno, word zeropage(2) x)
position_sprite: {
    .const y = $32
    .label spriteno = 4
    .label x = 2
    // spriteno * 2
    // [13] (byte~) position_sprite::$1 ← (byte) position_sprite::spriteno#0 << (byte) 1 -- vbuyy=vbuz1_rol_1 
    lda.z spriteno
    asl
    tay
    // SPRITES_YPOS[spriteno * 2] = y
    // [14] *((const byte*) SPRITES_YPOS#0 + (byte~) position_sprite::$1) ← (const byte) position_sprite::y#0 -- pbuc1_derefidx_vbuyy=vbuc2 
    lda #y
    sta SPRITES_YPOS,y
    // <x
    // [15] (byte~) position_sprite::$2 ← < (word) position_sprite::x#0 -- vbuaa=_lo_vwuz1 
    lda.z x
    // SPRITES_XPOS[spriteno * 2] = <x
    // [16] *((const byte*) SPRITES_XPOS#0 + (byte~) position_sprite::$1) ← (byte~) position_sprite::$2 -- pbuc1_derefidx_vbuyy=vbuaa 
    sta SPRITES_XPOS,y
    // if (x > 255)
    // [17] if((word) position_sprite::x#0>(byte) $ff) goto position_sprite::@1 -- vwuz1_gt_vbuc1_then_la1 
    lda.z x+1
    bne b1
    lda.z x
    cmp #$ff
    beq !+
    bcs b1
  !:
    // position_sprite::@2
    // 1 << spriteno
    // [18] (byte~) position_sprite::$4 ← (byte) 1 << (byte) position_sprite::spriteno#0 -- vbuaa=vbuc1_rol_vbuz1 
    lda #1
    ldy.z spriteno
    cpy #0
    beq !e+
  !:
    asl
    dey
    bne !-
  !e:
    // (1 << spriteno) ^ $ff
    // [19] (byte~) position_sprite::$5 ← (byte~) position_sprite::$4 ^ (byte) $ff -- vbuaa=vbuaa_bxor_vbuc1 
    eor #$ff
    // *SPRITES_XMSB &= (1 << spriteno) ^ $ff
    // [20] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte~) position_sprite::$5 -- _deref_pbuc1=_deref_pbuc1_band_vbuaa 
    and SPRITES_XMSB
    sta SPRITES_XMSB
    // position_sprite::@return
    // }
    // [21] return 
    rts
    // position_sprite::@1
  b1:
    // 1 << spriteno
    // [22] (byte~) position_sprite::$6 ← (byte) 1 << (byte) position_sprite::spriteno#0 -- vbuaa=vbuc1_rol_vbuz1 
    lda #1
    ldy.z spriteno
    cpy #0
    beq !e+
  !:
    asl
    dey
    bne !-
  !e:
    // *SPRITES_XMSB |= 1 << spriteno
    // [23] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte~) position_sprite::$6 -- _deref_pbuc1=_deref_pbuc1_bor_vbuaa 
    ora SPRITES_XMSB
    sta SPRITES_XMSB
    rts
}
  // File Data

