Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx 

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  (byte*) PROCPORT_DDR#0 ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 0
  (byte) PROCPORT_DDR_MEMORY_MASK#0 ← (byte/signed byte/word/signed word/dword/signed dword) 7
  (byte*) PROCPORT#0 ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 1
  (byte) PROCPORT_RAM_ALL#0 ← (byte/signed byte/word/signed word/dword/signed dword) 48
  (byte) PROCPORT_RAM_IO#0 ← (byte/signed byte/word/signed word/dword/signed dword) 53
  (byte) PROCPORT_RAM_CHARROM#0 ← (byte/signed byte/word/signed word/dword/signed dword) 49
  (byte) PROCPORT_KERNEL_IO#0 ← (byte/signed byte/word/signed word/dword/signed dword) 54
  (byte) PROCPORT_BASIC_KERNEL_IO#0 ← (byte/signed byte/word/signed word/dword/signed dword) 55
  (byte*) CHARGEN#0 ← ((byte*)) (word/dword/signed dword) 53248
  (word) SPRITE_PTRS#0 ← (word/signed word/dword/signed dword) 1016
  (byte*) SPRITES_XPOS#0 ← ((byte*)) (word/dword/signed dword) 53248
  (byte*) SPRITES_YPOS#0 ← ((byte*)) (word/dword/signed dword) 53249
  (byte*) SPRITES_XMSB#0 ← ((byte*)) (word/dword/signed dword) 53264
  (byte*) RASTER#0 ← ((byte*)) (word/dword/signed dword) 53266
  (byte*) SPRITES_ENABLE#0 ← ((byte*)) (word/dword/signed dword) 53269
  (byte*) SPRITES_EXPAND_Y#0 ← ((byte*)) (word/dword/signed dword) 53271
  (byte*) SPRITES_PRIORITY#0 ← ((byte*)) (word/dword/signed dword) 53275
  (byte*) SPRITES_MC#0 ← ((byte*)) (word/dword/signed dword) 53276
  (byte*) SPRITES_EXPAND_X#0 ← ((byte*)) (word/dword/signed dword) 53277
  (byte*) BORDERCOL#0 ← ((byte*)) (word/dword/signed dword) 53280
  (byte*) BGCOL#0 ← ((byte*)) (word/dword/signed dword) 53281
  (byte*) BGCOL1#0 ← ((byte*)) (word/dword/signed dword) 53281
  (byte*) BGCOL2#0 ← ((byte*)) (word/dword/signed dword) 53282
  (byte*) BGCOL3#0 ← ((byte*)) (word/dword/signed dword) 53283
  (byte*) BGCOL4#0 ← ((byte*)) (word/dword/signed dword) 53284
  (byte*) SPRITES_MC1#0 ← ((byte*)) (word/dword/signed dword) 53285
  (byte*) SPRITES_MC2#0 ← ((byte*)) (word/dword/signed dword) 53286
  (byte*) SPRITES_COLS#0 ← ((byte*)) (word/dword/signed dword) 53287
  (byte*) VIC_CONTROL#0 ← ((byte*)) (word/dword/signed dword) 53265
  (byte*) D011#0 ← ((byte*)) (word/dword/signed dword) 53265
  (byte) VIC_RST8#0 ← (byte/word/signed word/dword/signed dword) 128
  (byte) VIC_ECM#0 ← (byte/signed byte/word/signed word/dword/signed dword) 64
  (byte) VIC_BMM#0 ← (byte/signed byte/word/signed word/dword/signed dword) 32
  (byte) VIC_DEN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 16
  (byte) VIC_RSEL#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
  (byte*) VIC_CONTROL2#0 ← ((byte*)) (word/dword/signed dword) 53270
  (byte*) D016#0 ← ((byte*)) (word/dword/signed dword) 53270
  (byte) VIC_MCM#0 ← (byte/signed byte/word/signed word/dword/signed dword) 16
  (byte) VIC_CSEL#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
  (byte*) D018#0 ← ((byte*)) (word/dword/signed dword) 53272
  (byte*) VIC_MEMORY#0 ← ((byte*)) (word/dword/signed dword) 53272
  (byte*) LIGHTPEN_X#0 ← ((byte*)) (word/dword/signed dword) 53267
  (byte*) LIGHTPEN_Y#0 ← ((byte*)) (word/dword/signed dword) 53268
  (byte*) IRQ_STATUS#0 ← ((byte*)) (word/dword/signed dword) 53273
  (byte*) IRQ_ENABLE#0 ← ((byte*)) (word/dword/signed dword) 53274
  (byte) IRQ_RASTER#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
  (byte) IRQ_COLLISION_BG#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
  (byte) IRQ_COLLISION_SPRITE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4
  (byte) IRQ_LIGHTPEN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
  (byte*) COLS#0 ← ((byte*)) (word/dword/signed dword) 55296
  (byte*) CIA1_PORT_A#0 ← ((byte*)) (word/dword/signed dword) 56320
  (byte*) CIA1_PORT_B#0 ← ((byte*)) (word/dword/signed dword) 56321
  (byte*) CIA1_PORT_A_DDR#0 ← ((byte*)) (word/dword/signed dword) 56322
  (byte*) CIA1_PORT_B_DDR#0 ← ((byte*)) (word/dword/signed dword) 56323
  (byte*) CIA1_INTERRUPT#0 ← ((byte*)) (word/dword/signed dword) 56333
  (byte) CIA_INTERRUPT_CLEAR#0 ← (byte/signed byte/word/signed word/dword/signed dword) 127
  (byte*) CIA2_PORT_A#0 ← ((byte*)) (word/dword/signed dword) 56576
  (byte*) CIA2_PORT_B#0 ← ((byte*)) (word/dword/signed dword) 56577
  (byte*) CIA2_PORT_A_DDR#0 ← ((byte*)) (word/dword/signed dword) 56578
  (byte*) CIA2_PORT_B_DDR#0 ← ((byte*)) (word/dword/signed dword) 56579
  (byte*) CIA2_INTERRUPT#0 ← ((byte*)) (word/dword/signed dword) 56589
  (void()**) KERNEL_IRQ#0 ← ((void()**)) (word/signed word/dword/signed dword) 788
  (void()**) HARDWARE_IRQ#0 ← ((void()**)) (word/dword/signed dword) 65534
  (byte) BLACK#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
  (byte) WHITE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
  (byte) RED#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
  (byte) CYAN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3
  (byte) PURPLE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4
  (byte) GREEN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 5
  (byte) BLUE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 6
  (byte) YELLOW#0 ← (byte/signed byte/word/signed word/dword/signed dword) 7
  (byte) ORANGE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
  (byte) BROWN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 9
  (byte) PINK#0 ← (byte/signed byte/word/signed word/dword/signed dword) 10
  (byte) DARK_GREY#0 ← (byte/signed byte/word/signed word/dword/signed dword) 11
  (byte) GREY#0 ← (byte/signed byte/word/signed word/dword/signed dword) 12
  (byte) LIGHT_GREEN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 13
  (byte) LIGHT_BLUE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 14
  (byte) LIGHT_GREY#0 ← (byte/signed byte/word/signed word/dword/signed dword) 15
  to:@6
main: scope:[main]  from @6
  (word) main::xpos#0 ← (byte/word/signed word/dword/signed dword) 200
  (byte) main::s#0 ← (byte/signed byte/word/signed word/dword/signed dword) 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 ← (byte/signed byte/word/signed word/dword/signed dword) 50
  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 + (byte/signed byte/word/signed word/dword/signed dword) 10
  (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 )
  (byte~) position_sprite::$0 ← (byte) position_sprite::spriteno#1 << (byte/signed byte/word/signed word/dword/signed dword) 1
  *((byte*) SPRITES_YPOS#0 + (byte~) position_sprite::$0) ← (byte) position_sprite::y#1
  (byte~) position_sprite::$1 ← (byte) position_sprite::spriteno#1 << (byte/signed byte/word/signed word/dword/signed dword) 1
  (byte~) position_sprite::$2 ← < (word) position_sprite::x#1
  *((byte*) SPRITES_XPOS#0 + (byte~) position_sprite::$1) ← (byte~) position_sprite::$2
  (bool~) position_sprite::$3 ← (word) position_sprite::x#1 > (byte/word/signed word/dword/signed dword) 255
  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 )
  (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$6 ← (byte/signed byte/word/signed word/dword/signed dword) 1 << (byte) position_sprite::spriteno#2
  *((byte*) SPRITES_XMSB#0) ← *((byte*) SPRITES_XMSB#0) | (byte/signed byte/word/signed word/dword/signed dword~) 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 )
  (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$4 ← (byte/signed byte/word/signed word/dword/signed dword) 1 << (byte) position_sprite::spriteno#3
  (byte/word/dword~) position_sprite::$5 ← (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$4 ^ (byte/word/signed word/dword/signed dword) 255
  *((byte*) SPRITES_XMSB#0) ← *((byte*) SPRITES_XMSB#0) & (byte/word/dword~) 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*) BGCOL
(byte*) BGCOL#0
(byte*) BGCOL1
(byte*) BGCOL1#0
(byte*) BGCOL2
(byte*) BGCOL2#0
(byte*) BGCOL3
(byte*) BGCOL3#0
(byte*) BGCOL4
(byte*) BGCOL4#0
(byte) BLACK
(byte) BLACK#0
(byte) BLUE
(byte) BLUE#0
(byte*) BORDERCOL
(byte*) BORDERCOL#0
(byte) BROWN
(byte) BROWN#0
(byte*) CHARGEN
(byte*) CHARGEN#0
(byte*) CIA1_INTERRUPT
(byte*) CIA1_INTERRUPT#0
(byte*) CIA1_PORT_A
(byte*) CIA1_PORT_A#0
(byte*) CIA1_PORT_A_DDR
(byte*) CIA1_PORT_A_DDR#0
(byte*) CIA1_PORT_B
(byte*) CIA1_PORT_B#0
(byte*) CIA1_PORT_B_DDR
(byte*) CIA1_PORT_B_DDR#0
(byte*) CIA2_INTERRUPT
(byte*) CIA2_INTERRUPT#0
(byte*) CIA2_PORT_A
(byte*) CIA2_PORT_A#0
(byte*) CIA2_PORT_A_DDR
(byte*) CIA2_PORT_A_DDR#0
(byte*) CIA2_PORT_B
(byte*) CIA2_PORT_B#0
(byte*) CIA2_PORT_B_DDR
(byte*) CIA2_PORT_B_DDR#0
(byte) CIA_INTERRUPT_CLEAR
(byte) CIA_INTERRUPT_CLEAR#0
(byte*) COLS
(byte*) COLS#0
(byte) CYAN
(byte) CYAN#0
(byte*) D011
(byte*) D011#0
(byte*) D016
(byte*) D016#0
(byte*) D018
(byte*) D018#0
(byte) DARK_GREY
(byte) DARK_GREY#0
(byte) GREEN
(byte) GREEN#0
(byte) GREY
(byte) GREY#0
(void()**) HARDWARE_IRQ
(void()**) HARDWARE_IRQ#0
(byte) IRQ_COLLISION_BG
(byte) IRQ_COLLISION_BG#0
(byte) IRQ_COLLISION_SPRITE
(byte) IRQ_COLLISION_SPRITE#0
(byte*) IRQ_ENABLE
(byte*) IRQ_ENABLE#0
(byte) IRQ_LIGHTPEN
(byte) IRQ_LIGHTPEN#0
(byte) IRQ_RASTER
(byte) IRQ_RASTER#0
(byte*) IRQ_STATUS
(byte*) IRQ_STATUS#0
(void()**) KERNEL_IRQ
(void()**) KERNEL_IRQ#0
(byte*) LIGHTPEN_X
(byte*) LIGHTPEN_X#0
(byte*) LIGHTPEN_Y
(byte*) LIGHTPEN_Y#0
(byte) LIGHT_BLUE
(byte) LIGHT_BLUE#0
(byte) LIGHT_GREEN
(byte) LIGHT_GREEN#0
(byte) LIGHT_GREY
(byte) LIGHT_GREY#0
(byte) ORANGE
(byte) ORANGE#0
(byte) PINK
(byte) PINK#0
(byte*) PROCPORT
(byte*) PROCPORT#0
(byte) PROCPORT_BASIC_KERNEL_IO
(byte) PROCPORT_BASIC_KERNEL_IO#0
(byte*) PROCPORT_DDR
(byte*) PROCPORT_DDR#0
(byte) PROCPORT_DDR_MEMORY_MASK
(byte) PROCPORT_DDR_MEMORY_MASK#0
(byte) PROCPORT_KERNEL_IO
(byte) PROCPORT_KERNEL_IO#0
(byte) PROCPORT_RAM_ALL
(byte) PROCPORT_RAM_ALL#0
(byte) PROCPORT_RAM_CHARROM
(byte) PROCPORT_RAM_CHARROM#0
(byte) PROCPORT_RAM_IO
(byte) PROCPORT_RAM_IO#0
(byte) PURPLE
(byte) PURPLE#0
(byte*) RASTER
(byte*) RASTER#0
(byte) RED
(byte) RED#0
(byte*) SPRITES_COLS
(byte*) SPRITES_COLS#0
(byte*) SPRITES_ENABLE
(byte*) SPRITES_ENABLE#0
(byte*) SPRITES_EXPAND_X
(byte*) SPRITES_EXPAND_X#0
(byte*) SPRITES_EXPAND_Y
(byte*) SPRITES_EXPAND_Y#0
(byte*) SPRITES_MC
(byte*) SPRITES_MC#0
(byte*) SPRITES_MC1
(byte*) SPRITES_MC1#0
(byte*) SPRITES_MC2
(byte*) SPRITES_MC2#0
(byte*) SPRITES_PRIORITY
(byte*) SPRITES_PRIORITY#0
(byte*) SPRITES_XMSB
(byte*) SPRITES_XMSB#0
(byte*) SPRITES_XPOS
(byte*) SPRITES_XPOS#0
(byte*) SPRITES_YPOS
(byte*) SPRITES_YPOS#0
(word) SPRITE_PTRS
(word) SPRITE_PTRS#0
(byte) VIC_BMM
(byte) VIC_BMM#0
(byte*) VIC_CONTROL
(byte*) VIC_CONTROL#0
(byte*) VIC_CONTROL2
(byte*) VIC_CONTROL2#0
(byte) VIC_CSEL
(byte) VIC_CSEL#0
(byte) VIC_DEN
(byte) VIC_DEN#0
(byte) VIC_ECM
(byte) VIC_ECM#0
(byte) VIC_MCM
(byte) VIC_MCM#0
(byte*) VIC_MEMORY
(byte*) VIC_MEMORY#0
(byte) VIC_RSEL
(byte) VIC_RSEL#0
(byte) VIC_RST8
(byte) VIC_RST8#0
(byte) WHITE
(byte) WHITE#0
(byte) YELLOW
(byte) YELLOW#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)
(byte~) position_sprite::$0
(byte~) position_sprite::$1
(byte~) position_sprite::$2
(bool~) position_sprite::$3
(byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$4
(byte/word/dword~) position_sprite::$5
(byte/signed byte/word/signed word/dword/signed dword~) 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

Culled Empty Block (label) @7
Successful SSA optimization Pass2CullEmptyBlocks
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
Redundant Phi (byte) position_sprite::spriteno#1 (byte) position_sprite::spriteno#0
Redundant Phi (byte) position_sprite::y#1 (byte) position_sprite::y#0
Redundant Phi (word) position_sprite::x#1 (word) position_sprite::x#0
Successful SSA optimization Pass2RedundantPhiElimination
Simple Condition (bool~) main::$1 [90] if((byte) main::s#1!=rangelast(0,7)) goto main::@1
Simple Condition (bool~) position_sprite::$3 [99] if((word) position_sprite::x#0>(byte/word/signed word/dword/signed dword) 255) goto position_sprite::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) PROCPORT_DDR#0 = ((byte*))0
Constant (const byte) PROCPORT_DDR_MEMORY_MASK#0 = 7
Constant (const byte*) PROCPORT#0 = ((byte*))1
Constant (const byte) PROCPORT_RAM_ALL#0 = 48
Constant (const byte) PROCPORT_RAM_IO#0 = 53
Constant (const byte) PROCPORT_RAM_CHARROM#0 = 49
Constant (const byte) PROCPORT_KERNEL_IO#0 = 54
Constant (const byte) PROCPORT_BASIC_KERNEL_IO#0 = 55
Constant (const byte*) CHARGEN#0 = ((byte*))53248
Constant (const word) SPRITE_PTRS#0 = 1016
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 byte*) RASTER#0 = ((byte*))53266
Constant (const byte*) SPRITES_ENABLE#0 = ((byte*))53269
Constant (const byte*) SPRITES_EXPAND_Y#0 = ((byte*))53271
Constant (const byte*) SPRITES_PRIORITY#0 = ((byte*))53275
Constant (const byte*) SPRITES_MC#0 = ((byte*))53276
Constant (const byte*) SPRITES_EXPAND_X#0 = ((byte*))53277
Constant (const byte*) BORDERCOL#0 = ((byte*))53280
Constant (const byte*) BGCOL#0 = ((byte*))53281
Constant (const byte*) BGCOL1#0 = ((byte*))53281
Constant (const byte*) BGCOL2#0 = ((byte*))53282
Constant (const byte*) BGCOL3#0 = ((byte*))53283
Constant (const byte*) BGCOL4#0 = ((byte*))53284
Constant (const byte*) SPRITES_MC1#0 = ((byte*))53285
Constant (const byte*) SPRITES_MC2#0 = ((byte*))53286
Constant (const byte*) SPRITES_COLS#0 = ((byte*))53287
Constant (const byte*) VIC_CONTROL#0 = ((byte*))53265
Constant (const byte*) D011#0 = ((byte*))53265
Constant (const byte) VIC_RST8#0 = 128
Constant (const byte) VIC_ECM#0 = 64
Constant (const byte) VIC_BMM#0 = 32
Constant (const byte) VIC_DEN#0 = 16
Constant (const byte) VIC_RSEL#0 = 8
Constant (const byte*) VIC_CONTROL2#0 = ((byte*))53270
Constant (const byte*) D016#0 = ((byte*))53270
Constant (const byte) VIC_MCM#0 = 16
Constant (const byte) VIC_CSEL#0 = 8
Constant (const byte*) D018#0 = ((byte*))53272
Constant (const byte*) VIC_MEMORY#0 = ((byte*))53272
Constant (const byte*) LIGHTPEN_X#0 = ((byte*))53267
Constant (const byte*) LIGHTPEN_Y#0 = ((byte*))53268
Constant (const byte*) IRQ_STATUS#0 = ((byte*))53273
Constant (const byte*) IRQ_ENABLE#0 = ((byte*))53274
Constant (const byte) IRQ_RASTER#0 = 1
Constant (const byte) IRQ_COLLISION_BG#0 = 2
Constant (const byte) IRQ_COLLISION_SPRITE#0 = 4
Constant (const byte) IRQ_LIGHTPEN#0 = 8
Constant (const byte*) COLS#0 = ((byte*))55296
Constant (const byte*) CIA1_PORT_A#0 = ((byte*))56320
Constant (const byte*) CIA1_PORT_B#0 = ((byte*))56321
Constant (const byte*) CIA1_PORT_A_DDR#0 = ((byte*))56322
Constant (const byte*) CIA1_PORT_B_DDR#0 = ((byte*))56323
Constant (const byte*) CIA1_INTERRUPT#0 = ((byte*))56333
Constant (const byte) CIA_INTERRUPT_CLEAR#0 = 127
Constant (const byte*) CIA2_PORT_A#0 = ((byte*))56576
Constant (const byte*) CIA2_PORT_B#0 = ((byte*))56577
Constant (const byte*) CIA2_PORT_A_DDR#0 = ((byte*))56578
Constant (const byte*) CIA2_PORT_B_DDR#0 = ((byte*))56579
Constant (const byte*) CIA2_INTERRUPT#0 = ((byte*))56589
Constant (const void()**) KERNEL_IRQ#0 = ((void()**))788
Constant (const void()**) HARDWARE_IRQ#0 = ((void()**))65534
Constant (const byte) BLACK#0 = 0
Constant (const byte) WHITE#0 = 1
Constant (const byte) RED#0 = 2
Constant (const byte) CYAN#0 = 3
Constant (const byte) PURPLE#0 = 4
Constant (const byte) GREEN#0 = 5
Constant (const byte) BLUE#0 = 6
Constant (const byte) YELLOW#0 = 7
Constant (const byte) ORANGE#0 = 8
Constant (const byte) BROWN#0 = 9
Constant (const byte) PINK#0 = 10
Constant (const byte) DARK_GREY#0 = 11
Constant (const byte) GREY#0 = 12
Constant (const byte) LIGHT_GREEN#0 = 13
Constant (const byte) LIGHT_BLUE#0 = 14
Constant (const byte) LIGHT_GREY#0 = 15
Constant (const word) main::xpos#0 = 200
Constant (const byte) main::s#0 = 0
Constant (const byte) position_sprite::y#0 = 50
Successful SSA optimization Pass2ConstantIdentification
Successful SSA optimization PassNEliminateUnusedVars
Resolved ranged next value main::s#1 ← ++ main::s#2 to ++
Resolved ranged comparison value if(main::s#1!=rangelast(0,7)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) 8
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/word/signed word/dword/signed dword) 200
Constant inlined main::s#0 = (byte/signed byte/word/signed word/dword/signed dword) 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 @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:2 
Calls in [main] to position_sprite:8 

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

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


VARIABLE REGISTER WEIGHTS
(byte*) BGCOL
(byte*) BGCOL1
(byte*) BGCOL2
(byte*) BGCOL3
(byte*) BGCOL4
(byte) BLACK
(byte) BLUE
(byte*) BORDERCOL
(byte) BROWN
(byte*) CHARGEN
(byte*) CIA1_INTERRUPT
(byte*) CIA1_PORT_A
(byte*) CIA1_PORT_A_DDR
(byte*) CIA1_PORT_B
(byte*) CIA1_PORT_B_DDR
(byte*) CIA2_INTERRUPT
(byte*) CIA2_PORT_A
(byte*) CIA2_PORT_A_DDR
(byte*) CIA2_PORT_B
(byte*) CIA2_PORT_B_DDR
(byte) CIA_INTERRUPT_CLEAR
(byte*) COLS
(byte) CYAN
(byte*) D011
(byte*) D016
(byte*) D018
(byte) DARK_GREY
(byte) GREEN
(byte) GREY
(void()**) HARDWARE_IRQ
(byte) IRQ_COLLISION_BG
(byte) IRQ_COLLISION_SPRITE
(byte*) IRQ_ENABLE
(byte) IRQ_LIGHTPEN
(byte) IRQ_RASTER
(byte*) IRQ_STATUS
(void()**) KERNEL_IRQ
(byte*) LIGHTPEN_X
(byte*) LIGHTPEN_Y
(byte) LIGHT_BLUE
(byte) LIGHT_GREEN
(byte) LIGHT_GREY
(byte) ORANGE
(byte) PINK
(byte*) PROCPORT
(byte) PROCPORT_BASIC_KERNEL_IO
(byte*) PROCPORT_DDR
(byte) PROCPORT_DDR_MEMORY_MASK
(byte) PROCPORT_KERNEL_IO
(byte) PROCPORT_RAM_ALL
(byte) PROCPORT_RAM_CHARROM
(byte) PROCPORT_RAM_IO
(byte) PURPLE
(byte*) RASTER
(byte) RED
(byte*) SPRITES_COLS
(byte*) SPRITES_ENABLE
(byte*) SPRITES_EXPAND_X
(byte*) SPRITES_EXPAND_Y
(byte*) SPRITES_MC
(byte*) SPRITES_MC1
(byte*) SPRITES_MC2
(byte*) SPRITES_PRIORITY
(byte*) SPRITES_XMSB
(byte*) SPRITES_XPOS
(byte*) SPRITES_YPOS
(word) SPRITE_PTRS
(byte) VIC_BMM
(byte*) VIC_CONTROL
(byte*) VIC_CONTROL2
(byte) VIC_CSEL
(byte) VIC_DEN
(byte) VIC_ECM
(byte) VIC_MCM
(byte*) VIC_MEMORY
(byte) VIC_RSEL
(byte) VIC_RST8
(byte) WHITE
(byte) YELLOW
(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::$0 4.0
(byte~) position_sprite::$1 2.0
(byte~) position_sprite::$2 4.0
(byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$4 4.0
(byte/word/dword~) position_sprite::$5 4.0
(byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$6 4.0
(byte) position_sprite::spriteno
(byte) position_sprite::spriteno#0 2.375
(word) position_sprite::x
(word) position_sprite::x#0 2.5
(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::$0 to zero page equivalence class [ position_sprite::$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::$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::$0 ]
Allocated zp ZP_BYTE:9 [ position_sprite::$1 ]
Allocated zp ZP_BYTE:10 [ position_sprite::$2 ]
Allocated zp ZP_BYTE:11 [ position_sprite::$4 ]
Allocated zp ZP_BYTE:12 [ position_sprite::$5 ]
Allocated zp ZP_BYTE:13 [ position_sprite::$6 ]

INITIAL ASM
//SEG0 File Comments
// Tests rolling sprite MSB by variable amount
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
  .label SPRITES_XPOS = $d000
  .label SPRITES_YPOS = $d001
  .label SPRITES_XMSB = $d010
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @6 [phi:@begin->@6]
b6_from_bbegin:
  jmp b6
//SEG5 @6
b6:
//SEG6 [2] call main 
//SEG7 [4] phi from @6 to main [phi:@6->main]
main_from_b6:
  jsr main
//SEG8 [3] phi from @6 to @end [phi:@6->@end]
bend_from_b6:
  jmp bend
//SEG9 @end
bend:
//SEG10 main
main: {
    .label xpos = 3
    .label s = 2
  //SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
  //SEG12 [5] phi (word) main::xpos#2 = (byte/word/signed word/dword/signed dword) 200 [phi:main->main::@1#0] -- vwuz1=vbuc1 
    lda #<$c8
    sta xpos
    lda #>$c8
    sta xpos+1
  //SEG13 [5] phi (byte) main::s#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#1] -- vbuz1=vbuc1 
    lda #0
    sta s
    jmp b1
  //SEG14 [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
  b1_from_b3:
  //SEG15 [5] phi (word) main::xpos#2 = (word) main::xpos#1 [phi:main::@3->main::@1#0] -- register_copy 
  //SEG16 [5] phi (byte) main::s#2 = (byte) main::s#1 [phi:main::@3->main::@1#1] -- register_copy 
    jmp b1
  //SEG17 main::@1
  b1:
  //SEG18 [6] (byte) position_sprite::spriteno#0 ← (byte) main::s#2 -- vbuz1=vbuz2 
    lda s
    sta position_sprite.spriteno
  //SEG19 [7] (word) position_sprite::x#0 ← (word) main::xpos#2 -- vwuz1=vwuz2 
    lda xpos
    sta position_sprite.x
    lda xpos+1
    sta position_sprite.x+1
  //SEG20 [8] call position_sprite 
    jsr position_sprite
    jmp b3
  //SEG21 main::@3
  b3:
  //SEG22 [9] (word) main::xpos#1 ← (word) main::xpos#2 + (byte/signed byte/word/signed word/dword/signed dword) 10 -- vwuz1=vwuz1_plus_vbuc1 
    clc
    lda xpos
    adc #<$a
    sta xpos
    lda xpos+1
    adc #>$a
    sta xpos+1
  //SEG23 [10] (byte) main::s#1 ← ++ (byte) main::s#2 -- vbuz1=_inc_vbuz1 
    inc s
  //SEG24 [11] if((byte) main::s#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda s
    cmp #8
    bne b1_from_b3
    jmp breturn
  //SEG25 main::@return
  breturn:
  //SEG26 [12] return 
    rts
}
//SEG27 position_sprite
// position_sprite(byte zeropage(5) spriteno, word zeropage(6) x)
position_sprite: {
    .const y = $32
    .label _0 = 8
    .label _1 = 9
    .label _2 = $a
    .label _4 = $b
    .label _5 = $c
    .label _6 = $d
    .label spriteno = 5
    .label x = 6
  //SEG28 [13] (byte~) position_sprite::$0 ← (byte) position_sprite::spriteno#0 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_rol_1 
    lda spriteno
    asl
    sta _0
  //SEG29 [14] *((const byte*) SPRITES_YPOS#0 + (byte~) position_sprite::$0) ← (const byte) position_sprite::y#0 -- pbuc1_derefidx_vbuz1=vbuc2 
    ldy _0
    lda #y
    sta SPRITES_YPOS,y
  //SEG30 [15] (byte~) position_sprite::$1 ← (byte) position_sprite::spriteno#0 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_rol_1 
    lda spriteno
    asl
    sta _1
  //SEG31 [16] (byte~) position_sprite::$2 ← < (word) position_sprite::x#0 -- vbuz1=_lo_vwuz2 
    lda x
    sta _2
  //SEG32 [17] *((const byte*) SPRITES_XPOS#0 + (byte~) position_sprite::$1) ← (byte~) position_sprite::$2 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda _2
    ldy _1
    sta SPRITES_XPOS,y
  //SEG33 [18] if((word) position_sprite::x#0>(byte/word/signed word/dword/signed dword) 255) goto position_sprite::@1 -- vwuz1_gt_vbuc1_then_la1 
    lda x+1
    bne b1
    lda x
    cmp #$ff
    beq !+
    bcs b1
  !:
    jmp b3
  //SEG34 position_sprite::@3
  b3:
  //SEG35 [19] (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$4 ← (byte/signed byte/word/signed word/dword/signed dword) 1 << (byte) position_sprite::spriteno#0 -- vbuz1=vbuc1_rol_vbuz2 
    lda #1
    ldy spriteno
    cpy #0
    beq !e+
  !:
    asl
    dey
    bne !-
  !e:
    sta _4
  //SEG36 [20] (byte/word/dword~) position_sprite::$5 ← (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$4 ^ (byte/word/signed word/dword/signed dword) 255 -- vbuz1=vbuz2_bxor_vbuc1 
    lda _4
    eor #$ff
    sta _5
  //SEG37 [21] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte/word/dword~) position_sprite::$5 -- _deref_pbuc1=_deref_pbuc1_band_vbuz1 
    lda SPRITES_XMSB
    and _5
    sta SPRITES_XMSB
    jmp breturn
  //SEG38 position_sprite::@return
  breturn:
  //SEG39 [22] return 
    rts
  //SEG40 position_sprite::@1
  b1:
  //SEG41 [23] (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$6 ← (byte/signed byte/word/signed word/dword/signed dword) 1 << (byte) position_sprite::spriteno#0 -- vbuz1=vbuc1_rol_vbuz2 
    lda #1
    ldy spriteno
    cpy #0
    beq !e+
  !:
    asl
    dey
    bne !-
  !e:
    sta _6
  //SEG42 [24] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$6 -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 
    lda SPRITES_XMSB
    ora _6
    sta SPRITES_XMSB
    jmp breturn
}

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/signed byte/word/signed word/dword/signed dword) 10 [ main::s#2 main::xpos#1 ] ( main:2 [ main::s#2 main::xpos#1 ] ) always clobbers reg byte a 
Statement [13] (byte~) position_sprite::$0 ← (byte) position_sprite::spriteno#0 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ position_sprite::spriteno#0 position_sprite::x#0 position_sprite::$0 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 position_sprite::x#0 position_sprite::$0 ] ) always clobbers reg byte a 
Statement [14] *((const byte*) SPRITES_YPOS#0 + (byte~) position_sprite::$0) ← (const byte) position_sprite::y#0 [ position_sprite::spriteno#0 position_sprite::x#0 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 position_sprite::x#0 ] ) always clobbers reg byte a 
Statement [15] (byte~) position_sprite::$1 ← (byte) position_sprite::spriteno#0 << (byte/signed byte/word/signed word/dword/signed dword) 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 [16] (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 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:9 [ position_sprite::$1 ]
Statement [18] if((word) position_sprite::x#0>(byte/word/signed word/dword/signed dword) 255) 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 [19] (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$4 ← (byte/signed byte/word/signed word/dword/signed dword) 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 [20] (byte/word/dword~) position_sprite::$5 ← (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$4 ^ (byte/word/signed word/dword/signed dword) 255 [ position_sprite::$5 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::$5 ] ) always clobbers reg byte a 
Statement [21] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte/word/dword~) position_sprite::$5 [ ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 ] ) always clobbers reg byte a 
Statement [23] (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$6 ← (byte/signed byte/word/signed word/dword/signed dword) 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 [24] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte/signed byte/word/signed word/dword/signed dword~) 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/signed byte/word/signed word/dword/signed dword) 10 [ main::s#2 main::xpos#1 ] ( main:2 [ main::s#2 main::xpos#1 ] ) always clobbers reg byte a 
Statement [13] (byte~) position_sprite::$0 ← (byte) position_sprite::spriteno#0 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ position_sprite::spriteno#0 position_sprite::x#0 position_sprite::$0 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 position_sprite::x#0 position_sprite::$0 ] ) always clobbers reg byte a 
Statement [14] *((const byte*) SPRITES_YPOS#0 + (byte~) position_sprite::$0) ← (const byte) position_sprite::y#0 [ position_sprite::spriteno#0 position_sprite::x#0 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 position_sprite::x#0 ] ) always clobbers reg byte a 
Statement [15] (byte~) position_sprite::$1 ← (byte) position_sprite::spriteno#0 << (byte/signed byte/word/signed word/dword/signed dword) 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 [16] (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 [18] if((word) position_sprite::x#0>(byte/word/signed word/dword/signed dword) 255) 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 [19] (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$4 ← (byte/signed byte/word/signed word/dword/signed dword) 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 [20] (byte/word/dword~) position_sprite::$5 ← (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$4 ^ (byte/word/signed word/dword/signed dword) 255 [ position_sprite::$5 ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 position_sprite::$5 ] ) always clobbers reg byte a 
Statement [21] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte/word/dword~) position_sprite::$5 [ ] ( main:2::position_sprite:8 [ main::s#2 main::xpos#2 ] ) always clobbers reg byte a 
Statement [23] (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$6 ← (byte/signed byte/word/signed word/dword/signed dword) 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 [24] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte/signed byte/word/signed word/dword/signed dword~) 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::$0 ] : zp ZP_BYTE:8 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:9 [ position_sprite::$1 ] : zp ZP_BYTE:9 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:10 [ position_sprite::$2 ] : zp ZP_BYTE:10 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:11 [ position_sprite::$4 ] : zp ZP_BYTE:11 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:12 [ position_sprite::$5 ] : zp ZP_BYTE:12 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:13 [ position_sprite::$6 ] : zp ZP_BYTE:13 , 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:8 [ position_sprite::$0 ] 4: zp ZP_BYTE:10 [ position_sprite::$2 ] 4: zp ZP_BYTE:11 [ position_sprite::$4 ] 4: zp ZP_BYTE:12 [ position_sprite::$5 ] 4: zp ZP_BYTE:13 [ position_sprite::$6 ] 2.5: zp ZP_WORD:6 [ position_sprite::x#0 ] 2.38: zp ZP_BYTE:5 [ position_sprite::spriteno#0 ] 2: zp ZP_BYTE:9 [ position_sprite::$1 ] 
Uplift Scope [] 

Uplifting [main] best 854 combination reg byte x [ main::s#2 main::s#1 ] zp ZP_WORD:3 [ main::xpos#2 main::xpos#1 ] 
Uplifting [position_sprite] best 832 combination reg byte a [ position_sprite::$0 ] reg byte a [ position_sprite::$2 ] reg byte a [ position_sprite::$4 ] reg byte a [ position_sprite::$5 ] zp ZP_BYTE:13 [ position_sprite::$6 ] zp ZP_WORD:6 [ position_sprite::x#0 ] zp ZP_BYTE:5 [ position_sprite::spriteno#0 ] zp ZP_BYTE:9 [ position_sprite::$1 ] 
Limited combination testing to 100 combinations of 9216 possible.
Uplifting [] best 832 combination 
Attempting to uplift remaining variables inzp ZP_BYTE:13 [ position_sprite::$6 ]
Uplifting [position_sprite] best 826 combination reg byte a [ position_sprite::$6 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:5 [ position_sprite::spriteno#0 ]
Uplifting [position_sprite] best 826 combination zp ZP_BYTE:5 [ position_sprite::spriteno#0 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:9 [ position_sprite::$1 ]
Uplifting [position_sprite] best 822 combination reg byte y [ position_sprite::$1 ] 
Coalescing zero page register with common assignment [ 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
//SEG0 File Comments
// Tests rolling sprite MSB by variable amount
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
  .label SPRITES_XPOS = $d000
  .label SPRITES_YPOS = $d001
  .label SPRITES_XMSB = $d010
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @6 [phi:@begin->@6]
b6_from_bbegin:
  jmp b6
//SEG5 @6
b6:
//SEG6 [2] call main 
//SEG7 [4] phi from @6 to main [phi:@6->main]
main_from_b6:
  jsr main
//SEG8 [3] phi from @6 to @end [phi:@6->@end]
bend_from_b6:
  jmp bend
//SEG9 @end
bend:
//SEG10 main
main: {
    .label xpos = 2
  //SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
  //SEG12 [5] phi (word) main::xpos#2 = (byte/word/signed word/dword/signed dword) 200 [phi:main->main::@1#0] -- vwuz1=vbuc1 
    lda #<$c8
    sta xpos
    lda #>$c8
    sta xpos+1
  //SEG13 [5] phi (byte) main::s#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#1] -- vbuxx=vbuc1 
    ldx #0
    jmp b1
  //SEG14 [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
  b1_from_b3:
  //SEG15 [5] phi (word) main::xpos#2 = (word) main::xpos#1 [phi:main::@3->main::@1#0] -- register_copy 
  //SEG16 [5] phi (byte) main::s#2 = (byte) main::s#1 [phi:main::@3->main::@1#1] -- register_copy 
    jmp b1
  //SEG17 main::@1
  b1:
  //SEG18 [6] (byte) position_sprite::spriteno#0 ← (byte) main::s#2 -- vbuz1=vbuxx 
    stx position_sprite.spriteno
  //SEG19 [7] (word) position_sprite::x#0 ← (word) main::xpos#2
  //SEG20 [8] call position_sprite 
    jsr position_sprite
    jmp b3
  //SEG21 main::@3
  b3:
  //SEG22 [9] (word) main::xpos#1 ← (word) main::xpos#2 + (byte/signed byte/word/signed word/dword/signed dword) 10 -- vwuz1=vwuz1_plus_vbuc1 
    clc
    lda xpos
    adc #<$a
    sta xpos
    lda xpos+1
    adc #>$a
    sta xpos+1
  //SEG23 [10] (byte) main::s#1 ← ++ (byte) main::s#2 -- vbuxx=_inc_vbuxx 
    inx
  //SEG24 [11] if((byte) main::s#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #8
    bne b1_from_b3
    jmp breturn
  //SEG25 main::@return
  breturn:
  //SEG26 [12] return 
    rts
}
//SEG27 position_sprite
// position_sprite(byte zeropage(4) spriteno, word zeropage(2) x)
position_sprite: {
    .const y = $32
    .label spriteno = 4
    .label x = 2
  //SEG28 [13] (byte~) position_sprite::$0 ← (byte) position_sprite::spriteno#0 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuaa=vbuz1_rol_1 
    lda spriteno
    asl
  //SEG29 [14] *((const byte*) SPRITES_YPOS#0 + (byte~) position_sprite::$0) ← (const byte) position_sprite::y#0 -- pbuc1_derefidx_vbuaa=vbuc2 
    tay
    lda #y
    sta SPRITES_YPOS,y
  //SEG30 [15] (byte~) position_sprite::$1 ← (byte) position_sprite::spriteno#0 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuyy=vbuz1_rol_1 
    lda spriteno
    asl
    tay
  //SEG31 [16] (byte~) position_sprite::$2 ← < (word) position_sprite::x#0 -- vbuaa=_lo_vwuz1 
    lda x
  //SEG32 [17] *((const byte*) SPRITES_XPOS#0 + (byte~) position_sprite::$1) ← (byte~) position_sprite::$2 -- pbuc1_derefidx_vbuyy=vbuaa 
    sta SPRITES_XPOS,y
  //SEG33 [18] if((word) position_sprite::x#0>(byte/word/signed word/dword/signed dword) 255) goto position_sprite::@1 -- vwuz1_gt_vbuc1_then_la1 
    lda x+1
    bne b1
    lda x
    cmp #$ff
    beq !+
    bcs b1
  !:
    jmp b3
  //SEG34 position_sprite::@3
  b3:
  //SEG35 [19] (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$4 ← (byte/signed byte/word/signed word/dword/signed dword) 1 << (byte) position_sprite::spriteno#0 -- vbuaa=vbuc1_rol_vbuz1 
    lda #1
    ldy spriteno
    cpy #0
    beq !e+
  !:
    asl
    dey
    bne !-
  !e:
  //SEG36 [20] (byte/word/dword~) position_sprite::$5 ← (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$4 ^ (byte/word/signed word/dword/signed dword) 255 -- vbuaa=vbuaa_bxor_vbuc1 
    eor #$ff
  //SEG37 [21] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte/word/dword~) position_sprite::$5 -- _deref_pbuc1=_deref_pbuc1_band_vbuaa 
    and SPRITES_XMSB
    sta SPRITES_XMSB
    jmp breturn
  //SEG38 position_sprite::@return
  breturn:
  //SEG39 [22] return 
    rts
  //SEG40 position_sprite::@1
  b1:
  //SEG41 [23] (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$6 ← (byte/signed byte/word/signed word/dword/signed dword) 1 << (byte) position_sprite::spriteno#0 -- vbuaa=vbuc1_rol_vbuz1 
    lda #1
    ldy spriteno
    cpy #0
    beq !e+
  !:
    asl
    dey
    bne !-
  !e:
  //SEG42 [24] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$6 -- _deref_pbuc1=_deref_pbuc1_bor_vbuaa 
    ora SPRITES_XMSB
    sta SPRITES_XMSB
    jmp breturn
}

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b6
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b3
Removing instruction jmp breturn
Removing instruction jmp b3
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label b1_from_b3 with b1
Removing instruction b6_from_bbegin:
Removing instruction b6:
Removing instruction main_from_b6:
Removing instruction bend_from_b6:
Removing instruction b1_from_b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction b1_from_main:
Removing instruction b3:
Removing instruction breturn:
Removing instruction b3:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @6
(label) @begin
(label) @end
(byte*) BGCOL
(byte*) BGCOL1
(byte*) BGCOL2
(byte*) BGCOL3
(byte*) BGCOL4
(byte) BLACK
(byte) BLUE
(byte*) BORDERCOL
(byte) BROWN
(byte*) CHARGEN
(byte*) CIA1_INTERRUPT
(byte*) CIA1_PORT_A
(byte*) CIA1_PORT_A_DDR
(byte*) CIA1_PORT_B
(byte*) CIA1_PORT_B_DDR
(byte*) CIA2_INTERRUPT
(byte*) CIA2_PORT_A
(byte*) CIA2_PORT_A_DDR
(byte*) CIA2_PORT_B
(byte*) CIA2_PORT_B_DDR
(byte) CIA_INTERRUPT_CLEAR
(byte*) COLS
(byte) CYAN
(byte*) D011
(byte*) D016
(byte*) D018
(byte) DARK_GREY
(byte) GREEN
(byte) GREY
(void()**) HARDWARE_IRQ
(byte) IRQ_COLLISION_BG
(byte) IRQ_COLLISION_SPRITE
(byte*) IRQ_ENABLE
(byte) IRQ_LIGHTPEN
(byte) IRQ_RASTER
(byte*) IRQ_STATUS
(void()**) KERNEL_IRQ
(byte*) LIGHTPEN_X
(byte*) LIGHTPEN_Y
(byte) LIGHT_BLUE
(byte) LIGHT_GREEN
(byte) LIGHT_GREY
(byte) ORANGE
(byte) PINK
(byte*) PROCPORT
(byte) PROCPORT_BASIC_KERNEL_IO
(byte*) PROCPORT_DDR
(byte) PROCPORT_DDR_MEMORY_MASK
(byte) PROCPORT_KERNEL_IO
(byte) PROCPORT_RAM_ALL
(byte) PROCPORT_RAM_CHARROM
(byte) PROCPORT_RAM_IO
(byte) PURPLE
(byte*) RASTER
(byte) RED
(byte*) SPRITES_COLS
(byte*) SPRITES_ENABLE
(byte*) SPRITES_EXPAND_X
(byte*) SPRITES_EXPAND_Y
(byte*) SPRITES_MC
(byte*) SPRITES_MC1
(byte*) SPRITES_MC2
(byte*) SPRITES_PRIORITY
(byte*) SPRITES_XMSB
(const byte*) SPRITES_XMSB#0 SPRITES_XMSB = ((byte*))(word/dword/signed dword) 53264
(byte*) SPRITES_XPOS
(const byte*) SPRITES_XPOS#0 SPRITES_XPOS = ((byte*))(word/dword/signed dword) 53248
(byte*) SPRITES_YPOS
(const byte*) SPRITES_YPOS#0 SPRITES_YPOS = ((byte*))(word/dword/signed dword) 53249
(word) SPRITE_PTRS
(byte) VIC_BMM
(byte*) VIC_CONTROL
(byte*) VIC_CONTROL2
(byte) VIC_CSEL
(byte) VIC_DEN
(byte) VIC_ECM
(byte) VIC_MCM
(byte*) VIC_MEMORY
(byte) VIC_RSEL
(byte) VIC_RST8
(byte) WHITE
(byte) YELLOW
(void()) main()
(label) main::@1
(label) main::@3
(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::$0 reg byte a 4.0
(byte~) position_sprite::$1 reg byte y 2.0
(byte~) position_sprite::$2 reg byte a 4.0
(byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$4 reg byte a 4.0
(byte/word/dword~) position_sprite::$5 reg byte a 4.0
(byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$6 reg byte a 4.0
(label) position_sprite::@1
(label) position_sprite::@3
(label) position_sprite::@return
(byte) position_sprite::spriteno
(byte) position_sprite::spriteno#0 spriteno zp ZP_BYTE:4 2.375
(word) position_sprite::x
(word) position_sprite::x#0 x zp ZP_WORD:2 2.5
(byte) position_sprite::y
(const byte) position_sprite::y#0 y = (byte/signed byte/word/signed word/dword/signed dword) 50

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 a [ position_sprite::$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: 564

//SEG0 File Comments
// Tests rolling sprite MSB by variable amount
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG2 Global Constants & labels
  .label SPRITES_XPOS = $d000
  .label SPRITES_YPOS = $d001
  .label SPRITES_XMSB = $d010
//SEG3 @begin
//SEG4 [1] phi from @begin to @6 [phi:@begin->@6]
//SEG5 @6
//SEG6 [2] call main 
//SEG7 [4] phi from @6 to main [phi:@6->main]
//SEG8 [3] phi from @6 to @end [phi:@6->@end]
//SEG9 @end
//SEG10 main
main: {
    .label xpos = 2
  //SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
  //SEG12 [5] phi (word) main::xpos#2 = (byte/word/signed word/dword/signed dword) 200 [phi:main->main::@1#0] -- vwuz1=vbuc1 
    lda #<$c8
    sta xpos
    lda #>$c8
    sta xpos+1
  //SEG13 [5] phi (byte) main::s#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#1] -- vbuxx=vbuc1 
    ldx #0
  //SEG14 [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
  //SEG15 [5] phi (word) main::xpos#2 = (word) main::xpos#1 [phi:main::@3->main::@1#0] -- register_copy 
  //SEG16 [5] phi (byte) main::s#2 = (byte) main::s#1 [phi:main::@3->main::@1#1] -- register_copy 
  //SEG17 main::@1
  b1:
  //SEG18 [6] (byte) position_sprite::spriteno#0 ← (byte) main::s#2 -- vbuz1=vbuxx 
    stx position_sprite.spriteno
  //SEG19 [7] (word) position_sprite::x#0 ← (word) main::xpos#2
  //SEG20 [8] call position_sprite 
    jsr position_sprite
  //SEG21 main::@3
  //SEG22 [9] (word) main::xpos#1 ← (word) main::xpos#2 + (byte/signed byte/word/signed word/dword/signed dword) 10 -- vwuz1=vwuz1_plus_vbuc1 
    clc
    lda xpos
    adc #<$a
    sta xpos
    lda xpos+1
    adc #>$a
    sta xpos+1
  //SEG23 [10] (byte) main::s#1 ← ++ (byte) main::s#2 -- vbuxx=_inc_vbuxx 
    inx
  //SEG24 [11] if((byte) main::s#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #8
    bne b1
  //SEG25 main::@return
  //SEG26 [12] return 
    rts
}
//SEG27 position_sprite
// position_sprite(byte zeropage(4) spriteno, word zeropage(2) x)
position_sprite: {
    .const y = $32
    .label spriteno = 4
    .label x = 2
  //SEG28 [13] (byte~) position_sprite::$0 ← (byte) position_sprite::spriteno#0 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuaa=vbuz1_rol_1 
    lda spriteno
    asl
  //SEG29 [14] *((const byte*) SPRITES_YPOS#0 + (byte~) position_sprite::$0) ← (const byte) position_sprite::y#0 -- pbuc1_derefidx_vbuaa=vbuc2 
    tay
    lda #y
    sta SPRITES_YPOS,y
  //SEG30 [15] (byte~) position_sprite::$1 ← (byte) position_sprite::spriteno#0 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuyy=vbuz1_rol_1 
    lda spriteno
    asl
    tay
  //SEG31 [16] (byte~) position_sprite::$2 ← < (word) position_sprite::x#0 -- vbuaa=_lo_vwuz1 
    lda x
  //SEG32 [17] *((const byte*) SPRITES_XPOS#0 + (byte~) position_sprite::$1) ← (byte~) position_sprite::$2 -- pbuc1_derefidx_vbuyy=vbuaa 
    sta SPRITES_XPOS,y
  //SEG33 [18] if((word) position_sprite::x#0>(byte/word/signed word/dword/signed dword) 255) goto position_sprite::@1 -- vwuz1_gt_vbuc1_then_la1 
    lda x+1
    bne b1
    lda x
    cmp #$ff
    beq !+
    bcs b1
  !:
  //SEG34 position_sprite::@3
  //SEG35 [19] (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$4 ← (byte/signed byte/word/signed word/dword/signed dword) 1 << (byte) position_sprite::spriteno#0 -- vbuaa=vbuc1_rol_vbuz1 
    lda #1
    ldy spriteno
    cpy #0
    beq !e+
  !:
    asl
    dey
    bne !-
  !e:
  //SEG36 [20] (byte/word/dword~) position_sprite::$5 ← (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$4 ^ (byte/word/signed word/dword/signed dword) 255 -- vbuaa=vbuaa_bxor_vbuc1 
    eor #$ff
  //SEG37 [21] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte/word/dword~) position_sprite::$5 -- _deref_pbuc1=_deref_pbuc1_band_vbuaa 
    and SPRITES_XMSB
    sta SPRITES_XMSB
  //SEG38 position_sprite::@return
  breturn:
  //SEG39 [22] return 
    rts
  //SEG40 position_sprite::@1
  b1:
  //SEG41 [23] (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$6 ← (byte/signed byte/word/signed word/dword/signed dword) 1 << (byte) position_sprite::spriteno#0 -- vbuaa=vbuc1_rol_vbuz1 
    lda #1
    ldy spriteno
    cpy #0
    beq !e+
  !:
    asl
    dey
    bne !-
  !e:
  //SEG42 [24] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$6 -- _deref_pbuc1=_deref_pbuc1_bor_vbuaa 
    ora SPRITES_XMSB
    sta SPRITES_XMSB
    jmp breturn
}

