Resolved forward reference sprites_irq to interrupt(HARDWARE_CLOBBER)(void()) sprites_irq()
Identified constant variable (byte*) current_piece_gfx
Identified constant variable (byte) current_piece_char
Identified constant variable (byte) current_xpos
Identified constant variable (byte) current_ypos
Identified constant variable (byte) render_screen_render
Identified constant variable (byte) render_screen_show
Identified constant variable (dword) score_bcd
Identified constant variable (word) lines_bcd
Identified constant variable (byte) level_bcd
Identified constant variable (byte) level
Identified constant variable (byte) game_over
Identified constant variable (byte*) SIN_SPRITE
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx 
Inlined call (byte~) $0 ← call toSpritePtr (const byte*) PLAYFIELD_SPRITES 
Inlined call (byte~) sprites_irq::$5 ← call toSpritePtr (const byte*) PLAYFIELD_SPRITES 
Inlined call call vicSelectGfxBank (const byte*) PLAYFIELD_SCREEN_1 
Inlined call (byte~) main::$1 ← call toD018 (const byte*) PLAYFIELD_SCREEN_1 (const byte*) PLAYFIELD_CHARSET 
Inlined call (byte~) main::$7 ← call toSpritePtr (const byte*) SIN_SPRITE 
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) sprites_init::@2
Culled Empty Block (label) toSpritePtr1_@1
Culled Empty Block (label) @6
Culled Empty Block (label) sprites_irq::@14
Culled Empty Block (label) sprites_irq::toSpritePtr2_@1
Culled Empty Block (label) sprites_irq::@5
Culled Empty Block (label) sprites_irq::@9
Culled Empty Block (label) sprites_irq::@10
Culled Empty Block (label) main::vicSelectGfxBank1_toDd001_@1
Culled Empty Block (label) main::vicSelectGfxBank1_@return
Culled Empty Block (label) main::toD0181_@1
Culled Empty Block (label) main::toSpritePtr2_@1
Culled Empty Block (label) @8
Culled Empty Block (label) loop::@2
Culled Empty Block (label) loop::@9
Culled Empty Block (label) loop::@3
Culled Empty Block (label) loop::@10
Culled Empty Block (label) loop::@8

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@4
@4: scope:[]  from @begin
  (byte) render_screen_showing ← (byte) 0
  kickasm(location (const byte*) PLAYFIELD_SPRITES) {{ .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000))
	// Put the sprites into memory 
	.for(var sy=0;sy<10;sy++) {
	    .var sprite_gfx_y = sy*20
		.for(var sx=0;sx<3;sx++) {
	    	.for (var y=0;y<21; y++) {
	    	    .var gfx_y =  sprite_gfx_y + mod(2100+y-sprite_gfx_y,21)
		    	.for (var c=0; c<3; c++) {
	            	.byte sprites.getSinglecolorByte(sx*3+c,gfx_y)
	            }
	        }
	    	.byte 0
	  	}
	}
 }}
  to:@5

(void()) sprites_init()
sprites_init: scope:[sprites_init]  from main::@4
  *((const byte*) SPRITES_ENABLE) ← (number) $f
  *((const byte*) SPRITES_MC) ← (number) 0
  *((const byte*) SPRITES_EXPAND_Y) ← *((const byte*) SPRITES_MC)
  *((const byte*) SPRITES_EXPAND_X) ← *((const byte*) SPRITES_EXPAND_Y)
  (byte) sprites_init::xpos#0 ← (byte)(number) $18+(number) $f*(number) 8
  (byte) sprites_init::s#0 ← (byte) 0
  to:sprites_init::@1
sprites_init::@1: scope:[sprites_init]  from sprites_init sprites_init::@1
  (byte) sprites_init::xpos#2 ← phi( sprites_init/(byte) sprites_init::xpos#0 sprites_init::@1/(byte) sprites_init::xpos#1 )
  (byte) sprites_init::s#2 ← phi( sprites_init/(byte) sprites_init::s#0 sprites_init::@1/(byte) sprites_init::s#1 )
  (number~) sprites_init::$0 ← (byte) sprites_init::s#2 * (number) 2
  (byte) sprites_init::s2#0 ← (number~) sprites_init::$0
  *((const byte*) SPRITES_XPOS + (byte) sprites_init::s2#0) ← (byte) sprites_init::xpos#2
  *((const byte*) SPRITES_COLS + (byte) sprites_init::s#2) ← (const byte) BLACK
  (number~) sprites_init::$1 ← (byte) sprites_init::xpos#2 + (number) $18
  (byte) sprites_init::xpos#1 ← (number~) sprites_init::$1
  (byte) sprites_init::s#1 ← (byte) sprites_init::s#2 + rangenext(0,3)
  (bool~) sprites_init::$2 ← (byte) sprites_init::s#1 != rangelast(0,3)
  if((bool~) sprites_init::$2) goto sprites_init::@1
  to:sprites_init::@return
sprites_init::@return: scope:[sprites_init]  from sprites_init::@1
  return 
  to:@return
@5: scope:[]  from @4
  (byte) irq_raster_next ← (const byte) IRQ_RASTER_FIRST
  (byte) irq_sprite_ypos ← (byte)(const byte) SPRITES_FIRST_YPOS+(number) $15
  (byte*) toSpritePtr1_sprite#0 ← (const byte*) PLAYFIELD_SPRITES
  to:toSpritePtr1
toSpritePtr1: scope:[]  from @5
  (byte*) toSpritePtr1_sprite#1 ← phi( @5/(byte*) toSpritePtr1_sprite#0 )
  (word~) toSpritePtr1_$0 ← ((word)) (byte*) toSpritePtr1_sprite#1
  (number~) toSpritePtr1_$1 ← (word~) toSpritePtr1_$0 / (number) $40
  (byte~) toSpritePtr1_$2 ← ((byte)) (number~) toSpritePtr1_$1
  (byte) toSpritePtr1_return#0 ← (byte~) toSpritePtr1_$2
  to:toSpritePtr1_@return
toSpritePtr1_@return: scope:[]  from toSpritePtr1
  (byte) toSpritePtr1_return#2 ← phi( toSpritePtr1/(byte) toSpritePtr1_return#0 )
  (byte) toSpritePtr1_return#1 ← (byte) toSpritePtr1_return#2
  to:@10
@10: scope:[]  from toSpritePtr1_@return
  (byte) toSpritePtr1_return#3 ← phi( toSpritePtr1_@return/(byte) toSpritePtr1_return#1 )
  (byte~) $0 ← (byte) toSpritePtr1_return#3
  (number~) $1 ← (byte~) $0 + (number) 3
  (byte) irq_sprite_ptr ← (number~) $1
  (byte) irq_cnt ← (byte) 0
  to:@7

(void()) sprites_irq_init()
sprites_irq_init: scope:[sprites_irq_init]  from main::@2
  asm { sei  }
  *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER
  asm { ldaCIA1_INTERRUPT  }
  *((const byte*) PROCPORT_DDR) ← (const byte) PROCPORT_DDR_MEMORY_MASK
  *((const byte*) PROCPORT) ← (const byte) PROCPORT_RAM_IO
  *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR
  *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) & (number) $7f
  *((const byte*) RASTER) ← (const byte) IRQ_RASTER_FIRST
  *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER
  *((const void()**) HARDWARE_IRQ) ← &interrupt(HARDWARE_CLOBBER)(void()) sprites_irq()
  asm { cli  }
  to:sprites_irq_init::@return
sprites_irq_init::@return: scope:[sprites_irq_init]  from sprites_irq_init
  return 
  to:@return

interrupt(HARDWARE_CLOBBER)(void()) sprites_irq()
sprites_irq: scope:[sprites_irq]  from
  asm { cld  }
  (byte) sprites_irq::ypos#0 ← (byte) irq_sprite_ypos
  *((const byte*) SPRITES_YPOS + (number) 0) ← (byte) sprites_irq::ypos#0
  *((const byte*) SPRITES_YPOS + (number) 2) ← (byte) sprites_irq::ypos#0
  *((const byte*) SPRITES_YPOS + (number) 4) ← (byte) sprites_irq::ypos#0
  *((const byte*) SPRITES_YPOS + (number) 6) ← (byte) sprites_irq::ypos#0
  (number~) sprites_irq::$0 ← (byte) irq_raster_next + (number) 1
  (byte) sprites_irq::raster_sprite_gfx_modify ← (number~) sprites_irq::$0
  to:sprites_irq::@11
sprites_irq::@11: scope:[sprites_irq]  from sprites_irq sprites_irq::@11
  (bool~) sprites_irq::$4 ← *((const byte*) RASTER) < (byte) sprites_irq::raster_sprite_gfx_modify
  if((bool~) sprites_irq::$4) goto sprites_irq::@11
  to:sprites_irq::@12
sprites_irq::@12: scope:[sprites_irq]  from sprites_irq::@11
  (byte) sprites_irq::ptr#0 ← (byte) irq_sprite_ptr
  (bool~) sprites_irq::$1 ← (byte) render_screen_showing == (number) 0
  if((bool~) sprites_irq::$1) goto sprites_irq::@1
  to:sprites_irq::@13
sprites_irq::@1: scope:[sprites_irq]  from sprites_irq::@12
  (byte) sprites_irq::ptr#5 ← phi( sprites_irq::@12/(byte) sprites_irq::ptr#0 )
  *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (number) 0) ← (byte) sprites_irq::ptr#5
  (byte) sprites_irq::ptr#1 ← ++ (byte) sprites_irq::ptr#5
  *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (number) 1) ← (byte) sprites_irq::ptr#1
  *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (number) 2) ← (byte) sprites_irq::ptr#1
  (byte) sprites_irq::ptr#2 ← ++ (byte) sprites_irq::ptr#1
  *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (number) 3) ← (byte) sprites_irq::ptr#2
  to:sprites_irq::@2
sprites_irq::@13: scope:[sprites_irq]  from sprites_irq::@12
  (byte) sprites_irq::ptr#6 ← phi( sprites_irq::@12/(byte) sprites_irq::ptr#0 )
  *((const byte*) PLAYFIELD_SPRITE_PTRS_2 + (number) 0) ← (byte) sprites_irq::ptr#6
  (byte) sprites_irq::ptr#3 ← ++ (byte) sprites_irq::ptr#6
  *((const byte*) PLAYFIELD_SPRITE_PTRS_2 + (number) 1) ← (byte) sprites_irq::ptr#3
  *((const byte*) PLAYFIELD_SPRITE_PTRS_2 + (number) 2) ← (byte) sprites_irq::ptr#3
  (byte) sprites_irq::ptr#4 ← ++ (byte) sprites_irq::ptr#3
  *((const byte*) PLAYFIELD_SPRITE_PTRS_2 + (number) 3) ← (byte) sprites_irq::ptr#4
  to:sprites_irq::@2
sprites_irq::@2: scope:[sprites_irq]  from sprites_irq::@1 sprites_irq::@13
  (byte) irq_cnt ← ++ (byte) irq_cnt
  (bool~) sprites_irq::$2 ← (byte) irq_cnt == (number) 9
  if((bool~) sprites_irq::$2) goto sprites_irq::@3
  to:sprites_irq::@7
sprites_irq::@3: scope:[sprites_irq]  from sprites_irq::@2
  (byte) irq_raster_next ← (byte) irq_raster_next + (number) $15
  (byte) irq_sprite_ypos ← (const byte) SPRITES_FIRST_YPOS
  (byte*) sprites_irq::toSpritePtr2_sprite#0 ← (const byte*) PLAYFIELD_SPRITES
  to:sprites_irq::toSpritePtr2
sprites_irq::toSpritePtr2: scope:[sprites_irq]  from sprites_irq::@3
  (byte*) sprites_irq::toSpritePtr2_sprite#1 ← phi( sprites_irq::@3/(byte*) sprites_irq::toSpritePtr2_sprite#0 )
  (word~) sprites_irq::toSpritePtr2_$0 ← ((word)) (byte*) sprites_irq::toSpritePtr2_sprite#1
  (number~) sprites_irq::toSpritePtr2_$1 ← (word~) sprites_irq::toSpritePtr2_$0 / (number) $40
  (byte~) sprites_irq::toSpritePtr2_$2 ← ((byte)) (number~) sprites_irq::toSpritePtr2_$1
  (byte) sprites_irq::toSpritePtr2_return#0 ← (byte~) sprites_irq::toSpritePtr2_$2
  to:sprites_irq::toSpritePtr2_@return
sprites_irq::toSpritePtr2_@return: scope:[sprites_irq]  from sprites_irq::toSpritePtr2
  (byte) sprites_irq::toSpritePtr2_return#2 ← phi( sprites_irq::toSpritePtr2/(byte) sprites_irq::toSpritePtr2_return#0 )
  (byte) sprites_irq::toSpritePtr2_return#1 ← (byte) sprites_irq::toSpritePtr2_return#2
  to:sprites_irq::@15
sprites_irq::@15: scope:[sprites_irq]  from sprites_irq::toSpritePtr2_@return
  (byte) sprites_irq::toSpritePtr2_return#3 ← phi( sprites_irq::toSpritePtr2_@return/(byte) sprites_irq::toSpritePtr2_return#1 )
  (byte~) sprites_irq::$5 ← (byte) sprites_irq::toSpritePtr2_return#3
  (byte) irq_sprite_ptr ← (byte~) sprites_irq::$5
  to:sprites_irq::@6
sprites_irq::@7: scope:[sprites_irq]  from sprites_irq::@2
  (bool~) sprites_irq::$3 ← (byte) irq_cnt == (number) $a
  if((bool~) sprites_irq::$3) goto sprites_irq::@4
  to:sprites_irq::@8
sprites_irq::@4: scope:[sprites_irq]  from sprites_irq::@7
  (byte) irq_cnt ← (number) 0
  (byte) irq_raster_next ← (const byte) IRQ_RASTER_FIRST
  (byte) irq_sprite_ypos ← (byte) irq_sprite_ypos + (number) $15
  (byte) irq_sprite_ptr ← (byte) irq_sprite_ptr + (number) 3
  to:sprites_irq::@6
sprites_irq::@8: scope:[sprites_irq]  from sprites_irq::@7
  (byte) irq_raster_next ← (byte) irq_raster_next + (number) $14
  (byte) irq_sprite_ypos ← (byte) irq_sprite_ypos + (number) $15
  (byte) irq_sprite_ptr ← (byte) irq_sprite_ptr + (number) 3
  to:sprites_irq::@6
sprites_irq::@6: scope:[sprites_irq]  from sprites_irq::@15 sprites_irq::@4 sprites_irq::@8
  *((const byte*) RASTER) ← (byte) irq_raster_next
  *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER
  to:sprites_irq::@return
sprites_irq::@return: scope:[sprites_irq]  from sprites_irq::@6
  return 
  to:@return
@7: scope:[]  from @10
  kickasm(location (const byte*) SIN_SPRITE) {{ .fill $40, $ff
 }}
  (byte) sin_idx#0 ← (byte) 0
  to:@9

(void()) main()
main: scope:[main]  from @9
  (byte) sin_idx#32 ← phi( @9/(byte) sin_idx#16 )
  (byte*) main::vicSelectGfxBank1_gfx#0 ← (const byte*) PLAYFIELD_SCREEN_1
  to:main::vicSelectGfxBank1
main::vicSelectGfxBank1: scope:[main]  from main
  (byte) sin_idx#31 ← phi( main/(byte) sin_idx#32 )
  (byte*) main::vicSelectGfxBank1_gfx#1 ← phi( main/(byte*) main::vicSelectGfxBank1_gfx#0 )
  *((const byte*) CIA2_PORT_A_DDR) ← (number) 3
  (byte*) main::vicSelectGfxBank1_toDd001_gfx#0 ← (byte*) main::vicSelectGfxBank1_gfx#1
  to:main::vicSelectGfxBank1_toDd001
main::vicSelectGfxBank1_toDd001: scope:[main]  from main::vicSelectGfxBank1
  (byte) sin_idx#30 ← phi( main::vicSelectGfxBank1/(byte) sin_idx#31 )
  (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 ← phi( main::vicSelectGfxBank1/(byte*) main::vicSelectGfxBank1_toDd001_gfx#0 )
  (word~) main::vicSelectGfxBank1_toDd001_$0 ← ((word)) (byte*) main::vicSelectGfxBank1_toDd001_gfx#1
  (byte~) main::vicSelectGfxBank1_toDd001_$1 ← > (word~) main::vicSelectGfxBank1_toDd001_$0
  (number~) main::vicSelectGfxBank1_toDd001_$2 ← (byte~) main::vicSelectGfxBank1_toDd001_$1 / (number) $40
  (number~) main::vicSelectGfxBank1_toDd001_$3 ← (number) 3 ^ (number~) main::vicSelectGfxBank1_toDd001_$2
  (byte) main::vicSelectGfxBank1_toDd001_return#0 ← (number~) main::vicSelectGfxBank1_toDd001_$3
  to:main::vicSelectGfxBank1_toDd001_@return
main::vicSelectGfxBank1_toDd001_@return: scope:[main]  from main::vicSelectGfxBank1_toDd001
  (byte) sin_idx#29 ← phi( main::vicSelectGfxBank1_toDd001/(byte) sin_idx#30 )
  (byte) main::vicSelectGfxBank1_toDd001_return#2 ← phi( main::vicSelectGfxBank1_toDd001/(byte) main::vicSelectGfxBank1_toDd001_return#0 )
  (byte) main::vicSelectGfxBank1_toDd001_return#1 ← (byte) main::vicSelectGfxBank1_toDd001_return#2
  to:main::vicSelectGfxBank1_@1
main::vicSelectGfxBank1_@1: scope:[main]  from main::vicSelectGfxBank1_toDd001_@return
  (byte) sin_idx#28 ← phi( main::vicSelectGfxBank1_toDd001_@return/(byte) sin_idx#29 )
  (byte) main::vicSelectGfxBank1_toDd001_return#3 ← phi( main::vicSelectGfxBank1_toDd001_@return/(byte) main::vicSelectGfxBank1_toDd001_return#1 )
  (byte~) main::vicSelectGfxBank1_$0 ← (byte) main::vicSelectGfxBank1_toDd001_return#3
  *((const byte*) CIA2_PORT_A) ← (byte~) main::vicSelectGfxBank1_$0
  to:main::@3
main::@3: scope:[main]  from main::vicSelectGfxBank1_@1
  (byte) sin_idx#27 ← phi( main::vicSelectGfxBank1_@1/(byte) sin_idx#28 )
  (byte*) main::toD0181_screen#0 ← (const byte*) PLAYFIELD_SCREEN_1
  (byte*) main::toD0181_gfx#0 ← (const byte*) PLAYFIELD_CHARSET
  to:main::toD0181
main::toD0181: scope:[main]  from main::@3
  (byte) sin_idx#26 ← phi( main::@3/(byte) sin_idx#27 )
  (byte*) main::toD0181_gfx#1 ← phi( main::@3/(byte*) main::toD0181_gfx#0 )
  (byte*) main::toD0181_screen#1 ← phi( main::@3/(byte*) main::toD0181_screen#0 )
  (word~) main::toD0181_$0 ← ((word)) (byte*) main::toD0181_screen#1
  (number~) main::toD0181_$1 ← (word~) main::toD0181_$0 & (number) $3fff
  (number~) main::toD0181_$2 ← (number~) main::toD0181_$1 * (number) 4
  (number~) main::toD0181_$3 ← > (number~) main::toD0181_$2
  (word~) main::toD0181_$4 ← ((word)) (byte*) main::toD0181_gfx#1
  (byte~) main::toD0181_$5 ← > (word~) main::toD0181_$4
  (number~) main::toD0181_$6 ← (byte~) main::toD0181_$5 / (number) 4
  (number~) main::toD0181_$7 ← (number~) main::toD0181_$6 & (number) $f
  (number~) main::toD0181_$8 ← (number~) main::toD0181_$3 | (number~) main::toD0181_$7
  (byte) main::toD0181_return#0 ← (number~) main::toD0181_$8
  to:main::toD0181_@return
main::toD0181_@return: scope:[main]  from main::toD0181
  (byte) sin_idx#25 ← phi( main::toD0181/(byte) sin_idx#26 )
  (byte) main::toD0181_return#2 ← phi( main::toD0181/(byte) main::toD0181_return#0 )
  (byte) main::toD0181_return#1 ← (byte) main::toD0181_return#2
  to:main::@4
main::@4: scope:[main]  from main::toD0181_@return
  (byte) sin_idx#24 ← phi( main::toD0181_@return/(byte) sin_idx#25 )
  (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 )
  (byte~) main::$1 ← (byte) main::toD0181_return#3
  *((const byte*) D018) ← (byte~) main::$1
  call sprites_init 
  to:main::@6
main::@6: scope:[main]  from main::@4
  (byte) sin_idx#23 ← phi( main::@4/(byte) sin_idx#24 )
  *((const byte*) SPRITES_ENABLE) ← (number) $ff
  (byte) main::xpos#0 ← (byte) $18
  (byte) main::ypos#0 ← (byte) $32
  (byte) main::s#0 ← (byte) 4
  to:main::@1
main::@1: scope:[main]  from main::@5 main::@6
  (byte) sin_idx#22 ← phi( main::@5/(byte) sin_idx#19 main::@6/(byte) sin_idx#23 )
  (byte) main::ypos#2 ← phi( main::@5/(byte) main::ypos#1 main::@6/(byte) main::ypos#0 )
  (byte) main::xpos#2 ← phi( main::@5/(byte) main::xpos#1 main::@6/(byte) main::xpos#0 )
  (byte) main::s#2 ← phi( main::@5/(byte) main::s#1 main::@6/(byte) main::s#0 )
  (number~) main::$5 ← (byte) main::s#2 * (number) 2
  (byte) main::s2#0 ← (number~) main::$5
  *((const byte*) SPRITES_XPOS + (byte) main::s2#0) ← (byte) main::xpos#2
  *((const byte*) SPRITES_YPOS + (byte) main::s2#0) ← (byte) main::ypos#2
  (number~) main::$6 ← (byte) main::s#2 - (number) 3
  *((const byte*) SPRITES_COLS + (byte) main::s#2) ← (number~) main::$6
  (byte*) main::toSpritePtr2_sprite#0 ← (const byte*) SIN_SPRITE
  to:main::toSpritePtr2
main::toSpritePtr2: scope:[main]  from main::@1
  (byte) sin_idx#21 ← phi( main::@1/(byte) sin_idx#22 )
  (byte) main::ypos#5 ← phi( main::@1/(byte) main::ypos#2 )
  (byte) main::xpos#5 ← phi( main::@1/(byte) main::xpos#2 )
  (byte) main::s#5 ← phi( main::@1/(byte) main::s#2 )
  (byte*) main::toSpritePtr2_sprite#1 ← phi( main::@1/(byte*) main::toSpritePtr2_sprite#0 )
  (word~) main::toSpritePtr2_$0 ← ((word)) (byte*) main::toSpritePtr2_sprite#1
  (number~) main::toSpritePtr2_$1 ← (word~) main::toSpritePtr2_$0 / (number) $40
  (byte~) main::toSpritePtr2_$2 ← ((byte)) (number~) main::toSpritePtr2_$1
  (byte) main::toSpritePtr2_return#0 ← (byte~) main::toSpritePtr2_$2
  to:main::toSpritePtr2_@return
main::toSpritePtr2_@return: scope:[main]  from main::toSpritePtr2
  (byte) sin_idx#20 ← phi( main::toSpritePtr2/(byte) sin_idx#21 )
  (byte) main::ypos#4 ← phi( main::toSpritePtr2/(byte) main::ypos#5 )
  (byte) main::xpos#4 ← phi( main::toSpritePtr2/(byte) main::xpos#5 )
  (byte) main::s#4 ← phi( main::toSpritePtr2/(byte) main::s#5 )
  (byte) main::toSpritePtr2_return#2 ← phi( main::toSpritePtr2/(byte) main::toSpritePtr2_return#0 )
  (byte) main::toSpritePtr2_return#1 ← (byte) main::toSpritePtr2_return#2
  to:main::@5
main::@5: scope:[main]  from main::toSpritePtr2_@return
  (byte) sin_idx#19 ← phi( main::toSpritePtr2_@return/(byte) sin_idx#20 )
  (byte) main::ypos#3 ← phi( main::toSpritePtr2_@return/(byte) main::ypos#4 )
  (byte) main::xpos#3 ← phi( main::toSpritePtr2_@return/(byte) main::xpos#4 )
  (byte) main::s#3 ← phi( main::toSpritePtr2_@return/(byte) main::s#4 )
  (byte) main::toSpritePtr2_return#3 ← phi( main::toSpritePtr2_@return/(byte) main::toSpritePtr2_return#1 )
  (byte~) main::$7 ← (byte) main::toSpritePtr2_return#3
  *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (byte) main::s#3) ← (byte~) main::$7
  (byte) main::xpos#1 ← (byte) main::xpos#3 + (number) $18
  (byte) main::ypos#1 ← (byte) main::ypos#3 + (number) $18
  (byte) main::s#1 ← (byte) main::s#3 + rangenext(4,7)
  (bool~) main::$8 ← (byte) main::s#1 != rangelast(4,7)
  if((bool~) main::$8) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@5
  (byte) sin_idx#17 ← phi( main::@5/(byte) sin_idx#19 )
  call sprites_irq_init 
  to:main::@7
main::@7: scope:[main]  from main::@2
  (byte) sin_idx#12 ← phi( main::@2/(byte) sin_idx#17 )
  call loop 
  to:main::@8
main::@8: scope:[main]  from main::@7
  (byte) sin_idx#6 ← phi( main::@7/(byte) sin_idx#4 )
  (byte) sin_idx#1 ← (byte) sin_idx#6
  to:main::@return
main::@return: scope:[main]  from main::@8
  (byte) sin_idx#7 ← phi( main::@8/(byte) sin_idx#1 )
  (byte) sin_idx#2 ← (byte) sin_idx#7
  return 
  to:@return

(void()) loop()
loop: scope:[loop]  from main::@7
  (byte) sin_idx#18 ← phi( main::@7/(byte) sin_idx#12 )
  to:loop::@1
loop::@1: scope:[loop]  from loop loop::@7
  (byte) sin_idx#15 ← phi( loop/(byte) sin_idx#18 loop::@7/(byte) sin_idx#3 )
  if(true) goto loop::@4
  to:loop::@return
loop::@4: scope:[loop]  from loop::@1 loop::@4
  (byte) sin_idx#13 ← phi( loop::@1/(byte) sin_idx#15 loop::@4/(byte) sin_idx#13 )
  (bool~) loop::$0 ← *((const byte*) RASTER) != (number) $ff
  if((bool~) loop::$0) goto loop::@4
  to:loop::@5
loop::@5: scope:[loop]  from loop::@4
  (byte) sin_idx#8 ← phi( loop::@4/(byte) sin_idx#13 )
  (byte) loop::idx#0 ← (byte) sin_idx#8
  (byte) loop::s#0 ← (byte) 4
  to:loop::@6
loop::@6: scope:[loop]  from loop::@5 loop::@6
  (byte) sin_idx#14 ← phi( loop::@5/(byte) sin_idx#8 loop::@6/(byte) sin_idx#14 )
  (byte) loop::idx#2 ← phi( loop::@5/(byte) loop::idx#0 loop::@6/(byte) loop::idx#1 )
  (byte) loop::s#2 ← phi( loop::@5/(byte) loop::s#0 loop::@6/(byte) loop::s#1 )
  (number~) loop::$1 ← (byte) loop::s#2 * (number) 2
  *((const byte*) SPRITES_YPOS + (number~) loop::$1) ← *((const byte*) SIN + (byte) loop::idx#2)
  (byte) loop::idx#1 ← (byte) loop::idx#2 + (number) $a
  (byte) loop::s#1 ← (byte) loop::s#2 + rangenext(4,7)
  (bool~) loop::$2 ← (byte) loop::s#1 != rangelast(4,7)
  if((bool~) loop::$2) goto loop::@6
  to:loop::@7
loop::@7: scope:[loop]  from loop::@6
  (byte) sin_idx#9 ← phi( loop::@6/(byte) sin_idx#14 )
  (byte) sin_idx#3 ← ++ (byte) sin_idx#9
  to:loop::@1
loop::@return: scope:[loop]  from loop::@1
  (byte) sin_idx#10 ← phi( loop::@1/(byte) sin_idx#15 )
  (byte) sin_idx#4 ← (byte) sin_idx#10
  return 
  to:@return
@9: scope:[]  from @7
  (byte) sin_idx#16 ← phi( @7/(byte) sin_idx#0 )
  call main 
  to:@11
@11: scope:[]  from @9
  (byte) sin_idx#11 ← phi( @9/(byte) sin_idx#2 )
  (byte) sin_idx#5 ← (byte) sin_idx#11
  to:@end
@end: scope:[]  from @11

SYMBOL TABLE SSA
(byte~) $0
(number~) $1
(label) @10
(label) @11
(label) @4
(label) @5
(label) @7
(label) @9
(label) @begin
(label) @end
(const byte) BLACK = (byte) 0
(const byte*) CIA1_INTERRUPT = (byte*)(number) $dc0d
(const byte*) CIA2_PORT_A = (byte*)(number) $dd00
(const byte*) CIA2_PORT_A_DDR = (byte*)(number) $dd02
(const byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const byte*) D018 = (byte*)(number) $d018
(const void()**) HARDWARE_IRQ = (void()**)(number) $fffe
(const byte*) IRQ_ENABLE = (byte*)(number) $d01a
(const byte) IRQ_RASTER = (byte) 1
(const byte) IRQ_RASTER_FIRST = (byte)(const byte) SPRITES_FIRST_YPOS+(number) $13
(const byte*) IRQ_STATUS = (byte*)(number) $d019
(const byte*) PLAYFIELD_CHARSET = (byte*)(number) $2800
(const byte*) PLAYFIELD_SCREEN_1 = (byte*)(number) $400
(const byte*) PLAYFIELD_SCREEN_2 = (byte*)(number) $2c00
(const byte*) PLAYFIELD_SPRITES = (byte*)(number) $2000
(const byte*) PLAYFIELD_SPRITE_PTRS_1 = (const byte*) PLAYFIELD_SCREEN_1+(const word) SPRITE_PTRS
(const byte*) PLAYFIELD_SPRITE_PTRS_2 = (const byte*) PLAYFIELD_SCREEN_2+(const word) SPRITE_PTRS
(const byte*) PROCPORT = (byte*)(number) 1
(const byte*) PROCPORT_DDR = (byte*)(number) 0
(const byte) PROCPORT_DDR_MEMORY_MASK = (byte) 7
(const byte) PROCPORT_RAM_IO = (byte) 5
(const byte*) RASTER = (byte*)(number) $d012
(const byte*) SIN[(number) $100]  = kickasm {{ .var AMPL = 200-21
    .for(var i=0; i<256; i++) {
  	  .byte 51+AMPL/2+sin(toRadians([i*360]/256))*AMPL/2
    }
 }}
(const byte*) SIN_SPRITE = (byte*)(number) $2800
(const byte*) SPRITES_COLS = (byte*)(number) $d027
(const byte*) SPRITES_ENABLE = (byte*)(number) $d015
(const byte*) SPRITES_EXPAND_X = (byte*)(number) $d01d
(const byte*) SPRITES_EXPAND_Y = (byte*)(number) $d017
(const byte) SPRITES_FIRST_YPOS = (byte) $31
(const byte*) SPRITES_MC = (byte*)(number) $d01c
(const byte*) SPRITES_XPOS = (byte*)(number) $d000
(const byte*) SPRITES_YPOS = (byte*)(number) $d001
(const word) SPRITE_PTRS = (word) $3f8
(const byte*) VIC_CONTROL = (byte*)(number) $d011
(byte) irq_cnt loadstore
(byte) irq_raster_next loadstore
(byte) irq_sprite_ptr loadstore
(byte) irq_sprite_ypos loadstore
(void()) loop()
(bool~) loop::$0
(number~) loop::$1
(bool~) loop::$2
(label) loop::@1
(label) loop::@4
(label) loop::@5
(label) loop::@6
(label) loop::@7
(label) loop::@return
(byte) loop::idx
(byte) loop::idx#0
(byte) loop::idx#1
(byte) loop::idx#2
(byte) loop::s
(byte) loop::s#0
(byte) loop::s#1
(byte) loop::s#2
(void()) main()
(byte~) main::$1
(number~) main::$5
(number~) main::$6
(byte~) main::$7
(bool~) main::$8
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@8
(label) main::@return
(byte) main::s
(byte) main::s#0
(byte) main::s#1
(byte) main::s#2
(byte) main::s#3
(byte) main::s#4
(byte) main::s#5
(byte) main::s2
(byte) main::s2#0
(label) main::toD0181
(word~) main::toD0181_$0
(number~) main::toD0181_$1
(number~) main::toD0181_$2
(number~) main::toD0181_$3
(word~) main::toD0181_$4
(byte~) main::toD0181_$5
(number~) main::toD0181_$6
(number~) main::toD0181_$7
(number~) main::toD0181_$8
(label) main::toD0181_@return
(byte*) main::toD0181_gfx
(byte*) main::toD0181_gfx#0
(byte*) main::toD0181_gfx#1
(byte) main::toD0181_return
(byte) main::toD0181_return#0
(byte) main::toD0181_return#1
(byte) main::toD0181_return#2
(byte) main::toD0181_return#3
(byte*) main::toD0181_screen
(byte*) main::toD0181_screen#0
(byte*) main::toD0181_screen#1
(label) main::toSpritePtr2
(word~) main::toSpritePtr2_$0
(number~) main::toSpritePtr2_$1
(byte~) main::toSpritePtr2_$2
(label) main::toSpritePtr2_@return
(byte) main::toSpritePtr2_return
(byte) main::toSpritePtr2_return#0
(byte) main::toSpritePtr2_return#1
(byte) main::toSpritePtr2_return#2
(byte) main::toSpritePtr2_return#3
(byte*) main::toSpritePtr2_sprite
(byte*) main::toSpritePtr2_sprite#0
(byte*) main::toSpritePtr2_sprite#1
(label) main::vicSelectGfxBank1
(byte~) main::vicSelectGfxBank1_$0
(label) main::vicSelectGfxBank1_@1
(byte*) main::vicSelectGfxBank1_gfx
(byte*) main::vicSelectGfxBank1_gfx#0
(byte*) main::vicSelectGfxBank1_gfx#1
(label) main::vicSelectGfxBank1_toDd001
(word~) main::vicSelectGfxBank1_toDd001_$0
(byte~) main::vicSelectGfxBank1_toDd001_$1
(number~) main::vicSelectGfxBank1_toDd001_$2
(number~) main::vicSelectGfxBank1_toDd001_$3
(label) main::vicSelectGfxBank1_toDd001_@return
(byte*) main::vicSelectGfxBank1_toDd001_gfx
(byte*) main::vicSelectGfxBank1_toDd001_gfx#0
(byte*) main::vicSelectGfxBank1_toDd001_gfx#1
(byte) main::vicSelectGfxBank1_toDd001_return
(byte) main::vicSelectGfxBank1_toDd001_return#0
(byte) main::vicSelectGfxBank1_toDd001_return#1
(byte) main::vicSelectGfxBank1_toDd001_return#2
(byte) main::vicSelectGfxBank1_toDd001_return#3
(byte) main::xpos
(byte) main::xpos#0
(byte) main::xpos#1
(byte) main::xpos#2
(byte) main::xpos#3
(byte) main::xpos#4
(byte) main::xpos#5
(byte) main::ypos
(byte) main::ypos#0
(byte) main::ypos#1
(byte) main::ypos#2
(byte) main::ypos#3
(byte) main::ypos#4
(byte) main::ypos#5
(byte) render_screen_showing loadstore
(byte) sin_idx
(byte) sin_idx#0
(byte) sin_idx#1
(byte) sin_idx#10
(byte) sin_idx#11
(byte) sin_idx#12
(byte) sin_idx#13
(byte) sin_idx#14
(byte) sin_idx#15
(byte) sin_idx#16
(byte) sin_idx#17
(byte) sin_idx#18
(byte) sin_idx#19
(byte) sin_idx#2
(byte) sin_idx#20
(byte) sin_idx#21
(byte) sin_idx#22
(byte) sin_idx#23
(byte) sin_idx#24
(byte) sin_idx#25
(byte) sin_idx#26
(byte) sin_idx#27
(byte) sin_idx#28
(byte) sin_idx#29
(byte) sin_idx#3
(byte) sin_idx#30
(byte) sin_idx#31
(byte) sin_idx#32
(byte) sin_idx#4
(byte) sin_idx#5
(byte) sin_idx#6
(byte) sin_idx#7
(byte) sin_idx#8
(byte) sin_idx#9
(void()) sprites_init()
(number~) sprites_init::$0
(number~) sprites_init::$1
(bool~) sprites_init::$2
(label) sprites_init::@1
(label) sprites_init::@return
(byte) sprites_init::s
(byte) sprites_init::s#0
(byte) sprites_init::s#1
(byte) sprites_init::s#2
(byte) sprites_init::s2
(byte) sprites_init::s2#0
(byte) sprites_init::xpos
(byte) sprites_init::xpos#0
(byte) sprites_init::xpos#1
(byte) sprites_init::xpos#2
interrupt(HARDWARE_CLOBBER)(void()) sprites_irq()
(number~) sprites_irq::$0
(bool~) sprites_irq::$1
(bool~) sprites_irq::$2
(bool~) sprites_irq::$3
(bool~) sprites_irq::$4
(byte~) sprites_irq::$5
(label) sprites_irq::@1
(label) sprites_irq::@11
(label) sprites_irq::@12
(label) sprites_irq::@13
(label) sprites_irq::@15
(label) sprites_irq::@2
(label) sprites_irq::@3
(label) sprites_irq::@4
(label) sprites_irq::@6
(label) sprites_irq::@7
(label) sprites_irq::@8
(label) sprites_irq::@return
(byte) sprites_irq::ptr
(byte) sprites_irq::ptr#0
(byte) sprites_irq::ptr#1
(byte) sprites_irq::ptr#2
(byte) sprites_irq::ptr#3
(byte) sprites_irq::ptr#4
(byte) sprites_irq::ptr#5
(byte) sprites_irq::ptr#6
(byte) sprites_irq::raster_sprite_gfx_modify loadstore
(label) sprites_irq::toSpritePtr2
(word~) sprites_irq::toSpritePtr2_$0
(number~) sprites_irq::toSpritePtr2_$1
(byte~) sprites_irq::toSpritePtr2_$2
(label) sprites_irq::toSpritePtr2_@return
(byte) sprites_irq::toSpritePtr2_return
(byte) sprites_irq::toSpritePtr2_return#0
(byte) sprites_irq::toSpritePtr2_return#1
(byte) sprites_irq::toSpritePtr2_return#2
(byte) sprites_irq::toSpritePtr2_return#3
(byte*) sprites_irq::toSpritePtr2_sprite
(byte*) sprites_irq::toSpritePtr2_sprite#0
(byte*) sprites_irq::toSpritePtr2_sprite#1
(byte) sprites_irq::ypos
(byte) sprites_irq::ypos#0
(void()) sprites_irq_init()
(label) sprites_irq_init::@return
(label) toSpritePtr1
(word~) toSpritePtr1_$0
(number~) toSpritePtr1_$1
(byte~) toSpritePtr1_$2
(label) toSpritePtr1_@return
(byte) toSpritePtr1_return
(byte) toSpritePtr1_return#0
(byte) toSpritePtr1_return#1
(byte) toSpritePtr1_return#2
(byte) toSpritePtr1_return#3
(byte*) toSpritePtr1_sprite
(byte*) toSpritePtr1_sprite#0
(byte*) toSpritePtr1_sprite#1

Adding number conversion cast (unumber) $13 in 
Adding number conversion cast (unumber) $f in *((const byte*) SPRITES_ENABLE) ← (number) $f
Adding number conversion cast (unumber) 0 in *((const byte*) SPRITES_MC) ← (number) 0
Adding number conversion cast (unumber) 2 in (number~) sprites_init::$0 ← (byte) sprites_init::s#2 * (number) 2
Adding number conversion cast (unumber) sprites_init::$0 in (number~) sprites_init::$0 ← (byte) sprites_init::s#2 * (unumber)(number) 2
Adding number conversion cast (unumber) $18 in (number~) sprites_init::$1 ← (byte) sprites_init::xpos#2 + (number) $18
Adding number conversion cast (unumber) sprites_init::$1 in (number~) sprites_init::$1 ← (byte) sprites_init::xpos#2 + (unumber)(number) $18
Adding number conversion cast (unumber) $15 in (byte) irq_sprite_ypos ← (byte)(const byte) SPRITES_FIRST_YPOS+(number) $15
Adding number conversion cast (unumber) $40 in (number~) toSpritePtr1_$1 ← (word~) toSpritePtr1_$0 / (number) $40
Adding number conversion cast (unumber) toSpritePtr1_$1 in (number~) toSpritePtr1_$1 ← (word~) toSpritePtr1_$0 / (unumber)(number) $40
Adding number conversion cast (unumber) 3 in (number~) $1 ← (byte~) $0 + (number) 3
Adding number conversion cast (unumber) $1 in (number~) $1 ← (byte~) $0 + (unumber)(number) 3
Adding number conversion cast (unumber) $7f in *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) & (number) $7f
Adding number conversion cast (unumber) 0 in *((const byte*) SPRITES_YPOS + (number) 0) ← (byte) sprites_irq::ypos#0
Adding number conversion cast (unumber) 2 in *((const byte*) SPRITES_YPOS + (number) 2) ← (byte) sprites_irq::ypos#0
Adding number conversion cast (unumber) 4 in *((const byte*) SPRITES_YPOS + (number) 4) ← (byte) sprites_irq::ypos#0
Adding number conversion cast (unumber) 6 in *((const byte*) SPRITES_YPOS + (number) 6) ← (byte) sprites_irq::ypos#0
Adding number conversion cast (unumber) 1 in (number~) sprites_irq::$0 ← (byte) irq_raster_next + (number) 1
Adding number conversion cast (unumber) sprites_irq::$0 in (number~) sprites_irq::$0 ← (byte) irq_raster_next + (unumber)(number) 1
Adding number conversion cast (unumber) 0 in (bool~) sprites_irq::$1 ← (byte) render_screen_showing == (number) 0
Adding number conversion cast (unumber) 0 in *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (number) 0) ← (byte) sprites_irq::ptr#5
Adding number conversion cast (unumber) 1 in *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (number) 1) ← (byte) sprites_irq::ptr#1
Adding number conversion cast (unumber) 2 in *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (number) 2) ← (byte) sprites_irq::ptr#1
Adding number conversion cast (unumber) 3 in *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (number) 3) ← (byte) sprites_irq::ptr#2
Adding number conversion cast (unumber) 0 in *((const byte*) PLAYFIELD_SPRITE_PTRS_2 + (number) 0) ← (byte) sprites_irq::ptr#6
Adding number conversion cast (unumber) 1 in *((const byte*) PLAYFIELD_SPRITE_PTRS_2 + (number) 1) ← (byte) sprites_irq::ptr#3
Adding number conversion cast (unumber) 2 in *((const byte*) PLAYFIELD_SPRITE_PTRS_2 + (number) 2) ← (byte) sprites_irq::ptr#3
Adding number conversion cast (unumber) 3 in *((const byte*) PLAYFIELD_SPRITE_PTRS_2 + (number) 3) ← (byte) sprites_irq::ptr#4
Adding number conversion cast (unumber) 9 in (bool~) sprites_irq::$2 ← (byte) irq_cnt == (number) 9
Adding number conversion cast (unumber) $15 in (byte) irq_raster_next ← (byte) irq_raster_next + (number) $15
Adding number conversion cast (unumber) $40 in (number~) sprites_irq::toSpritePtr2_$1 ← (word~) sprites_irq::toSpritePtr2_$0 / (number) $40
Adding number conversion cast (unumber) sprites_irq::toSpritePtr2_$1 in (number~) sprites_irq::toSpritePtr2_$1 ← (word~) sprites_irq::toSpritePtr2_$0 / (unumber)(number) $40
Adding number conversion cast (unumber) $a in (bool~) sprites_irq::$3 ← (byte) irq_cnt == (number) $a
Adding number conversion cast (unumber) 0 in (byte) irq_cnt ← (number) 0
Adding number conversion cast (unumber) $15 in (byte) irq_sprite_ypos ← (byte) irq_sprite_ypos + (number) $15
Adding number conversion cast (unumber) 3 in (byte) irq_sprite_ptr ← (byte) irq_sprite_ptr + (number) 3
Adding number conversion cast (unumber) $14 in (byte) irq_raster_next ← (byte) irq_raster_next + (number) $14
Adding number conversion cast (unumber) $15 in (byte) irq_sprite_ypos ← (byte) irq_sprite_ypos + (number) $15
Adding number conversion cast (unumber) 3 in (byte) irq_sprite_ptr ← (byte) irq_sprite_ptr + (number) 3
Adding number conversion cast (unumber) 3 in *((const byte*) CIA2_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) $40 in (number~) main::vicSelectGfxBank1_toDd001_$2 ← (byte~) main::vicSelectGfxBank1_toDd001_$1 / (number) $40
Adding number conversion cast (unumber) main::vicSelectGfxBank1_toDd001_$2 in (number~) main::vicSelectGfxBank1_toDd001_$2 ← (byte~) main::vicSelectGfxBank1_toDd001_$1 / (unumber)(number) $40
Adding number conversion cast (unumber) 3 in (number~) main::vicSelectGfxBank1_toDd001_$3 ← (number) 3 ^ (unumber~) main::vicSelectGfxBank1_toDd001_$2
Adding number conversion cast (unumber) main::vicSelectGfxBank1_toDd001_$3 in (number~) main::vicSelectGfxBank1_toDd001_$3 ← (unumber)(number) 3 ^ (unumber~) main::vicSelectGfxBank1_toDd001_$2
Adding number conversion cast (unumber) $3fff in (number~) main::toD0181_$1 ← (word~) main::toD0181_$0 & (number) $3fff
Adding number conversion cast (unumber) main::toD0181_$1 in (number~) main::toD0181_$1 ← (word~) main::toD0181_$0 & (unumber)(number) $3fff
Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$2 ← (unumber~) main::toD0181_$1 * (number) 4
Adding number conversion cast (unumber) main::toD0181_$2 in (number~) main::toD0181_$2 ← (unumber~) main::toD0181_$1 * (unumber)(number) 4
Adding number conversion cast (unumber) main::toD0181_$3 in (number~) main::toD0181_$3 ← > (unumber~) main::toD0181_$2
Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$6 ← (byte~) main::toD0181_$5 / (number) 4
Adding number conversion cast (unumber) main::toD0181_$6 in (number~) main::toD0181_$6 ← (byte~) main::toD0181_$5 / (unumber)(number) 4
Adding number conversion cast (unumber) $f in (number~) main::toD0181_$7 ← (unumber~) main::toD0181_$6 & (number) $f
Adding number conversion cast (unumber) main::toD0181_$7 in (number~) main::toD0181_$7 ← (unumber~) main::toD0181_$6 & (unumber)(number) $f
Adding number conversion cast (unumber) main::toD0181_$8 in (number~) main::toD0181_$8 ← (unumber~) main::toD0181_$3 | (unumber~) main::toD0181_$7
Adding number conversion cast (unumber) $ff in *((const byte*) SPRITES_ENABLE) ← (number) $ff
Adding number conversion cast (unumber) 2 in (number~) main::$5 ← (byte) main::s#2 * (number) 2
Adding number conversion cast (unumber) main::$5 in (number~) main::$5 ← (byte) main::s#2 * (unumber)(number) 2
Adding number conversion cast (unumber) 3 in (number~) main::$6 ← (byte) main::s#2 - (number) 3
Adding number conversion cast (unumber) main::$6 in (number~) main::$6 ← (byte) main::s#2 - (unumber)(number) 3
Adding number conversion cast (unumber) $40 in (number~) main::toSpritePtr2_$1 ← (word~) main::toSpritePtr2_$0 / (number) $40
Adding number conversion cast (unumber) main::toSpritePtr2_$1 in (number~) main::toSpritePtr2_$1 ← (word~) main::toSpritePtr2_$0 / (unumber)(number) $40
Adding number conversion cast (unumber) $18 in (byte) main::xpos#1 ← (byte) main::xpos#3 + (number) $18
Adding number conversion cast (unumber) $18 in (byte) main::ypos#1 ← (byte) main::ypos#3 + (number) $18
Adding number conversion cast (unumber) $ff in (bool~) loop::$0 ← *((const byte*) RASTER) != (number) $ff
Adding number conversion cast (unumber) 2 in (number~) loop::$1 ← (byte) loop::s#2 * (number) 2
Adding number conversion cast (unumber) loop::$1 in (number~) loop::$1 ← (byte) loop::s#2 * (unumber)(number) 2
Adding number conversion cast (unumber) $a in (byte) loop::idx#1 ← (byte) loop::idx#2 + (number) $a
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast *((const byte*) SPRITES_ENABLE) ← (unumber)(number) $f
Inlining cast *((const byte*) SPRITES_MC) ← (unumber)(number) 0
Inlining cast (word~) toSpritePtr1_$0 ← (word)(byte*) toSpritePtr1_sprite#1
Inlining cast (byte~) toSpritePtr1_$2 ← (byte)(unumber~) toSpritePtr1_$1
Inlining cast (word~) sprites_irq::toSpritePtr2_$0 ← (word)(byte*) sprites_irq::toSpritePtr2_sprite#1
Inlining cast (byte~) sprites_irq::toSpritePtr2_$2 ← (byte)(unumber~) sprites_irq::toSpritePtr2_$1
Inlining cast (byte) irq_cnt ← (unumber)(number) 0
Inlining cast *((const byte*) CIA2_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast (word~) main::vicSelectGfxBank1_toDd001_$0 ← (word)(byte*) main::vicSelectGfxBank1_toDd001_gfx#1
Inlining cast (word~) main::toD0181_$0 ← (word)(byte*) main::toD0181_screen#1
Inlining cast (word~) main::toD0181_$4 ← (word)(byte*) main::toD0181_gfx#1
Inlining cast *((const byte*) SPRITES_ENABLE) ← (unumber)(number) $ff
Inlining cast (word~) main::toSpritePtr2_$0 ← (word)(byte*) main::toSpritePtr2_sprite#1
Inlining cast (byte~) main::toSpritePtr2_$2 ← (byte)(unumber~) main::toSpritePtr2_$1
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 0
Simplifying constant pointer cast (byte*) 1
Simplifying constant pointer cast (byte*) 53248
Simplifying constant pointer cast (byte*) 53249
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 53269
Simplifying constant pointer cast (byte*) 53271
Simplifying constant pointer cast (byte*) 53276
Simplifying constant pointer cast (byte*) 53277
Simplifying constant pointer cast (byte*) 53287
Simplifying constant pointer cast (byte*) 53265
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (byte*) 53273
Simplifying constant pointer cast (byte*) 53274
Simplifying constant pointer cast (byte*) 56333
Simplifying constant pointer cast (byte*) 56576
Simplifying constant pointer cast (byte*) 56578
Simplifying constant pointer cast (void()**) 65534
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 11264
Simplifying constant pointer cast (byte*) 8192
Simplifying constant pointer cast (byte*) 10240
Simplifying constant integer cast $13
Simplifying constant pointer cast (byte*) 10240
Simplifying constant integer cast $f
Simplifying constant integer cast 0
Simplifying constant integer cast 2
Simplifying constant integer cast $18
Simplifying constant integer cast $15
Simplifying constant integer cast $40
Simplifying constant integer cast 3
Simplifying constant integer cast $7f
Simplifying constant integer cast 0
Simplifying constant integer cast 2
Simplifying constant integer cast 4
Simplifying constant integer cast 6
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 3
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 3
Simplifying constant integer cast 9
Simplifying constant integer cast $15
Simplifying constant integer cast $40
Simplifying constant integer cast $a
Simplifying constant integer cast 0
Simplifying constant integer cast $15
Simplifying constant integer cast 3
Simplifying constant integer cast $14
Simplifying constant integer cast $15
Simplifying constant integer cast 3
Simplifying constant integer cast 3
Simplifying constant integer cast $40
Simplifying constant integer cast 3
Simplifying constant integer cast $3fff
Simplifying constant integer cast 4
Simplifying constant integer cast 4
Simplifying constant integer cast $f
Simplifying constant integer cast $ff
Simplifying constant integer cast 2
Simplifying constant integer cast 3
Simplifying constant integer cast $40
Simplifying constant integer cast $18
Simplifying constant integer cast $18
Simplifying constant integer cast $ff
Simplifying constant integer cast 2
Simplifying constant integer cast $a
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $13
Finalized unsigned number type (byte) $f
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) $18
Finalized unsigned number type (byte) $15
Finalized unsigned number type (byte) $40
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) $7f
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 6
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) 9
Finalized unsigned number type (byte) $15
Finalized unsigned number type (byte) $40
Finalized unsigned number type (byte) $a
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $15
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) $14
Finalized unsigned number type (byte) $15
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) $40
Finalized unsigned number type (byte) 3
Finalized unsigned number type (word) $3fff
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) $f
Finalized unsigned number type (byte) $ff
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) $40
Finalized unsigned number type (byte) $18
Finalized unsigned number type (byte) $18
Finalized unsigned number type (byte) $ff
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) $a
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) sprites_init::$0 ← (byte) sprites_init::s#2 * (byte) 2
Inferred type updated to byte in (unumber~) sprites_init::$1 ← (byte) sprites_init::xpos#2 + (byte) $18
Inferred type updated to word in (unumber~) toSpritePtr1_$1 ← (word~) toSpritePtr1_$0 / (byte) $40
Inferred type updated to byte in (unumber~) $1 ← (byte~) $0 + (byte) 3
Inferred type updated to byte in (unumber~) sprites_irq::$0 ← (byte) irq_raster_next + (byte) 1
Inferred type updated to word in (unumber~) sprites_irq::toSpritePtr2_$1 ← (word~) sprites_irq::toSpritePtr2_$0 / (byte) $40
Inferred type updated to byte in (unumber~) main::vicSelectGfxBank1_toDd001_$2 ← (byte~) main::vicSelectGfxBank1_toDd001_$1 / (byte) $40
Inferred type updated to byte in (unumber~) main::vicSelectGfxBank1_toDd001_$3 ← (byte) 3 ^ (byte~) main::vicSelectGfxBank1_toDd001_$2
Inferred type updated to word in (unumber~) main::toD0181_$1 ← (word~) main::toD0181_$0 & (word) $3fff
Inferred type updated to word in (unumber~) main::toD0181_$2 ← (word~) main::toD0181_$1 * (byte) 4
Inferred type updated to byte in (unumber~) main::toD0181_$3 ← > (word~) main::toD0181_$2
Inferred type updated to byte in (unumber~) main::toD0181_$6 ← (byte~) main::toD0181_$5 / (byte) 4
Inferred type updated to byte in (unumber~) main::toD0181_$7 ← (byte~) main::toD0181_$6 & (byte) $f
Inferred type updated to byte in (unumber~) main::toD0181_$8 ← (byte~) main::toD0181_$3 | (byte~) main::toD0181_$7
Inferred type updated to byte in (unumber~) main::$5 ← (byte) main::s#2 * (byte) 2
Inferred type updated to byte in (unumber~) main::$6 ← (byte) main::s#2 - (byte) 3
Inferred type updated to word in (unumber~) main::toSpritePtr2_$1 ← (word~) main::toSpritePtr2_$0 / (byte) $40
Inferred type updated to byte in (unumber~) loop::$1 ← (byte) loop::s#2 * (byte) 2
Alias candidate removed (volatile)(byte) sprites_irq::toSpritePtr2_return#0 = (byte) irq_sprite_ptr (byte~) $1 (byte~) sprites_irq::toSpritePtr2_$2 (byte) sprites_irq::toSpritePtr2_return#2 (byte) sprites_irq::toSpritePtr2_return#1 (byte) sprites_irq::toSpritePtr2_return#3 (byte~) sprites_irq::$5 
Alias candidate removed (volatile)(byte) sprites_irq::raster_sprite_gfx_modify = (byte~) sprites_irq::$0 
Alias (byte) sprites_init::s2#0 = (byte~) sprites_init::$0 
Alias (byte) sprites_init::xpos#1 = (byte~) sprites_init::$1 
Alias (byte*) toSpritePtr1_sprite#0 = (byte*) toSpritePtr1_sprite#1 
Alias (byte) toSpritePtr1_return#0 = (byte~) toSpritePtr1_$2 (byte) toSpritePtr1_return#2 (byte) toSpritePtr1_return#1 (byte) toSpritePtr1_return#3 (byte~) $0 
Alias (byte) sprites_irq::ptr#0 = (byte) sprites_irq::ptr#5 (byte) sprites_irq::ptr#6 
Alias (byte*) sprites_irq::toSpritePtr2_sprite#0 = (byte*) sprites_irq::toSpritePtr2_sprite#1 
Alias (byte*) main::vicSelectGfxBank1_gfx#0 = (byte*) main::vicSelectGfxBank1_gfx#1 (byte*) main::vicSelectGfxBank1_toDd001_gfx#0 (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 
Alias (byte) sin_idx#23 = (byte) sin_idx#31 (byte) sin_idx#32 (byte) sin_idx#30 (byte) sin_idx#29 (byte) sin_idx#28 (byte) sin_idx#27 (byte) sin_idx#26 (byte) sin_idx#25 (byte) sin_idx#24 
Alias (byte) main::vicSelectGfxBank1_toDd001_return#0 = (byte~) main::vicSelectGfxBank1_toDd001_$3 (byte) main::vicSelectGfxBank1_toDd001_return#2 (byte) main::vicSelectGfxBank1_toDd001_return#1 (byte) main::vicSelectGfxBank1_toDd001_return#3 (byte~) main::vicSelectGfxBank1_$0 
Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 
Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 
Alias (byte) main::toD0181_return#0 = (byte~) main::toD0181_$8 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$1 
Alias (byte) main::s2#0 = (byte~) main::$5 
Alias (byte*) main::toSpritePtr2_sprite#0 = (byte*) main::toSpritePtr2_sprite#1 
Alias (byte) main::s#2 = (byte) main::s#5 (byte) main::s#4 (byte) main::s#3 
Alias (byte) main::xpos#2 = (byte) main::xpos#5 (byte) main::xpos#4 (byte) main::xpos#3 
Alias (byte) main::ypos#2 = (byte) main::ypos#5 (byte) main::ypos#4 (byte) main::ypos#3 
Alias (byte) sin_idx#12 = (byte) sin_idx#21 (byte) sin_idx#22 (byte) sin_idx#20 (byte) sin_idx#19 (byte) sin_idx#17 
Alias (byte) main::toSpritePtr2_return#0 = (byte~) main::toSpritePtr2_$2 (byte) main::toSpritePtr2_return#2 (byte) main::toSpritePtr2_return#1 (byte) main::toSpritePtr2_return#3 (byte~) main::$7 
Alias (byte) sin_idx#1 = (byte) sin_idx#6 (byte) sin_idx#7 (byte) sin_idx#2 
Alias (byte) sin_idx#13 = (byte) sin_idx#8 
Alias (byte) sin_idx#14 = (byte) sin_idx#9 
Alias (byte) sin_idx#10 = (byte) sin_idx#15 (byte) sin_idx#4 
Alias (byte) sin_idx#0 = (byte) sin_idx#16 
Alias (byte) sin_idx#11 = (byte) sin_idx#5 
Successful SSA optimization Pass2AliasElimination
Alias candidate removed (volatile)(byte) sprites_irq::toSpritePtr2_return#0 = (byte) irq_sprite_ptr (byte~) $1 (byte~) sprites_irq::toSpritePtr2_$2 (byte) sprites_irq::toSpritePtr2_return#2 (byte) sprites_irq::toSpritePtr2_return#1 (byte) sprites_irq::toSpritePtr2_return#3 (byte~) sprites_irq::$5 
Alias candidate removed (volatile)(byte) sprites_irq::raster_sprite_gfx_modify = (byte~) sprites_irq::$0 
Identical Phi Values (byte) sprites_irq::toSpritePtr2_return#2 (byte) sprites_irq::toSpritePtr2_return#0
Identical Phi Values (byte) sprites_irq::toSpritePtr2_return#3 (byte) sprites_irq::toSpritePtr2_return#1
Identical Phi Values (byte) sin_idx#23 (byte) sin_idx#0
Identical Phi Values (byte) sin_idx#12 (byte) sin_idx#23
Identical Phi Values (byte) sin_idx#1 (byte) sin_idx#10
Identical Phi Values (byte) sin_idx#18 (byte) sin_idx#12
Identical Phi Values (byte) sin_idx#13 (byte) sin_idx#10
Identical Phi Values (byte) sin_idx#14 (byte) sin_idx#13
Identical Phi Values (byte) sin_idx#11 (byte) sin_idx#1
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) sprites_init::$2 [17] if((byte) sprites_init::s#1!=rangelast(0,3)) goto sprites_init::@1
Simple Condition (bool~) sprites_irq::$4 [55] if(*((const byte*) RASTER)<(byte) sprites_irq::raster_sprite_gfx_modify) goto sprites_irq::@11
Simple Condition (bool~) sprites_irq::$1 [58] if((byte) render_screen_showing==(byte) 0) goto sprites_irq::@1
Simple Condition (bool~) sprites_irq::$2 [75] if((byte) irq_cnt==(byte) 9) goto sprites_irq::@3
Simple Condition (bool~) sprites_irq::$3 [90] if((byte) irq_cnt==(byte) $a) goto sprites_irq::@4
Simple Condition (bool~) main::$8 [166] if((byte) main::s#1!=rangelast(4,7)) goto main::@1
Simple Condition (bool~) loop::$0 [181] if(*((const byte*) RASTER)!=(byte) $ff) goto loop::@4
Simple Condition (bool~) loop::$2 [191] if((byte) loop::s#1!=rangelast(4,7)) goto loop::@6
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte) sprites_init::xpos#0 = (byte)$18+$f*8
Constant (const byte) sprites_init::s#0 = 0
Constant (const byte*) toSpritePtr1_sprite#0 = PLAYFIELD_SPRITES
Constant (const byte*) sprites_irq::toSpritePtr2_sprite#0 = PLAYFIELD_SPRITES
Constant (const byte) sin_idx#0 = 0
Constant (const byte*) main::vicSelectGfxBank1_gfx#0 = PLAYFIELD_SCREEN_1
Constant (const byte*) main::toD0181_screen#0 = PLAYFIELD_SCREEN_1
Constant (const byte*) main::toD0181_gfx#0 = PLAYFIELD_CHARSET
Constant (const byte) main::xpos#0 = $18
Constant (const byte) main::ypos#0 = $32
Constant (const byte) main::s#0 = 4
Constant (const byte*) main::toSpritePtr2_sprite#0 = SIN_SPRITE
Constant (const byte) loop::s#0 = 4
Successful SSA optimization Pass2ConstantIdentification
Constant (const word) toSpritePtr1_$0 = (word)toSpritePtr1_sprite#0
Constant (const word) sprites_irq::toSpritePtr2_$0 = (word)sprites_irq::toSpritePtr2_sprite#0
Constant (const word) main::vicSelectGfxBank1_toDd001_$0 = (word)main::vicSelectGfxBank1_gfx#0
Constant (const word) main::toD0181_$0 = (word)main::toD0181_screen#0
Constant (const word) main::toD0181_$4 = (word)main::toD0181_gfx#0
Constant (const word) main::toSpritePtr2_$0 = (word)main::toSpritePtr2_sprite#0
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [178] if(true) goto loop::@4
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [15] sprites_init::s#1 ← ++ sprites_init::s#2 to ++
Resolved ranged comparison value [17] if(sprites_init::s#1!=rangelast(0,3)) goto sprites_init::@1 to (number) 4
Resolved ranged next value [164] main::s#1 ← ++ main::s#2 to ++
Resolved ranged comparison value [166] if(main::s#1!=rangelast(4,7)) goto main::@1 to (number) 8
Resolved ranged next value [189] loop::s#1 ← ++ loop::s#2 to ++
Resolved ranged comparison value [191] if(loop::s#1!=rangelast(4,7)) goto loop::@6 to (number) 8
Simplifying expression containing zero SPRITES_YPOS in [48] *((const byte*) SPRITES_YPOS + (byte) 0) ← (byte) sprites_irq::ypos#0
Simplifying expression containing zero PLAYFIELD_SPRITE_PTRS_1 in [60] *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (byte) 0) ← (byte) sprites_irq::ptr#0
Simplifying expression containing zero PLAYFIELD_SPRITE_PTRS_2 in [67] *((const byte*) PLAYFIELD_SPRITE_PTRS_2 + (byte) 0) ← (byte) sprites_irq::ptr#0
Successful SSA optimization PassNSimplifyExpressionWithZero
Removing unused block loop::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Adding number conversion cast (unumber) 4 in if((byte) sprites_init::s#1!=(number) 4) goto sprites_init::@1
Adding number conversion cast (unumber) 8 in if((byte) main::s#1!=(number) 8) goto main::@1
Adding number conversion cast (unumber) 8 in if((byte) loop::s#1!=(number) 8) goto loop::@6
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast (const byte) SPRITES_FIRST_YPOS+(byte) $13
Simplifying constant integer cast 4
Simplifying constant integer cast (const byte) SPRITES_FIRST_YPOS+(byte) $15
Simplifying constant integer cast 8
Simplifying constant integer cast 8
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 8
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias candidate removed (volatile)(byte) sprites_irq::toSpritePtr2_return#0 = (byte) irq_sprite_ptr (byte~) $1 (byte~) sprites_irq::toSpritePtr2_$2 (byte) sprites_irq::toSpritePtr2_return#1 (byte~) sprites_irq::$5 
Alias candidate removed (volatile)(byte) sprites_irq::raster_sprite_gfx_modify = (byte~) sprites_irq::$0 
Constant right-side identified [16] (word~) toSpritePtr1_$1 ← (const word) toSpritePtr1_$0 / (byte) $40
Constant right-side identified [60] (word~) sprites_irq::toSpritePtr2_$1 ← (const word) sprites_irq::toSpritePtr2_$0 / (byte) $40
Constant right-side identified [79] (byte~) main::vicSelectGfxBank1_toDd001_$1 ← > (const word) main::vicSelectGfxBank1_toDd001_$0
Constant right-side identified [83] (word~) main::toD0181_$1 ← (const word) main::toD0181_$0 & (word) $3fff
Constant right-side identified [86] (byte~) main::toD0181_$5 ← > (const word) main::toD0181_$4
Constant right-side identified [99] (word~) main::toSpritePtr2_$1 ← (const word) main::toSpritePtr2_$0 / (byte) $40
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) toSpritePtr1_$1 = toSpritePtr1_$0/$40
Constant (const word) sprites_irq::toSpritePtr2_$1 = sprites_irq::toSpritePtr2_$0/$40
Constant (const byte) main::vicSelectGfxBank1_toDd001_$1 = >main::vicSelectGfxBank1_toDd001_$0
Constant (const word) main::toD0181_$1 = main::toD0181_$0&$3fff
Constant (const byte) main::toD0181_$5 = >main::toD0181_$4
Constant (const word) main::toSpritePtr2_$1 = main::toSpritePtr2_$0/$40
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) toSpritePtr1_return#0 = (byte)toSpritePtr1_$1
Constant (const byte) sprites_irq::toSpritePtr2_$2 = (byte)sprites_irq::toSpritePtr2_$1
Constant (const byte) main::toSpritePtr2_return#0 = (byte)main::toSpritePtr2_$1
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) sprites_irq::toSpritePtr2_return#0 = sprites_irq::toSpritePtr2_$2
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) sprites_irq::toSpritePtr2_return#1 = sprites_irq::toSpritePtr2_return#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) sprites_irq::$5 = sprites_irq::toSpritePtr2_return#1
Successful SSA optimization Pass2ConstantIdentification
Alias candidate removed (volatile)(byte) irq_sprite_ptr = (byte~) $1 
Alias candidate removed (volatile)(byte) sprites_irq::raster_sprite_gfx_modify = (byte~) sprites_irq::$0 
Constant right-side identified [16] (byte~) $1 ← (const byte) toSpritePtr1_return#0 + (byte) 3
Constant right-side identified [72] (byte~) main::vicSelectGfxBank1_toDd001_$2 ← (const byte) main::vicSelectGfxBank1_toDd001_$1 / (byte) $40
Constant right-side identified [75] (word~) main::toD0181_$2 ← (const word) main::toD0181_$1 * (byte) 4
Constant right-side identified [77] (byte~) main::toD0181_$6 ← (const byte) main::toD0181_$5 / (byte) 4
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) $1 = toSpritePtr1_return#0+3
Constant (const byte) main::vicSelectGfxBank1_toDd001_$2 = main::vicSelectGfxBank1_toDd001_$1/$40
Constant (const word) main::toD0181_$2 = main::toD0181_$1*4
Constant (const byte) main::toD0181_$6 = main::toD0181_$5/4
Successful SSA optimization Pass2ConstantIdentification
Simplifying constant evaluating to zero (const byte) main::vicSelectGfxBank1_toDd001_$1/(byte) $40 in 
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero 3 in [73] (byte) main::vicSelectGfxBank1_toDd001_return#0 ← (byte) 3 ^ (const byte) main::vicSelectGfxBank1_toDd001_$2
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) main::vicSelectGfxBank1_toDd001_$1
Eliminating unused constant (const byte) main::vicSelectGfxBank1_toDd001_$2
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const word) main::vicSelectGfxBank1_toDd001_$0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const byte*) main::vicSelectGfxBank1_gfx#0
Successful SSA optimization PassNEliminateUnusedVars
Alias candidate removed (volatile)(byte) sprites_irq::raster_sprite_gfx_modify = (byte~) sprites_irq::$0 
Constant right-side identified [73] (byte~) main::toD0181_$3 ← > (const word) main::toD0181_$2
Constant right-side identified [74] (byte~) main::toD0181_$7 ← (const byte) main::toD0181_$6 & (byte) $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::vicSelectGfxBank1_toDd001_return#0 = 3
Constant (const byte) main::toD0181_$3 = >main::toD0181_$2
Constant (const byte) main::toD0181_$7 = main::toD0181_$6&$f
Successful SSA optimization Pass2ConstantIdentification
Alias candidate removed (volatile)(byte) sprites_irq::raster_sprite_gfx_modify = (byte~) sprites_irq::$0 
Constant right-side identified [72] (byte) main::toD0181_return#0 ← (const byte) main::toD0181_$3 | (const byte) main::toD0181_$7
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::toD0181_return#0 = main::toD0181_$3|main::toD0181_$7
Successful SSA optimization Pass2ConstantIdentification
Alias candidate removed (volatile)(byte) sprites_irq::raster_sprite_gfx_modify = (byte~) sprites_irq::$0 
Rewriting multiplication to use shift [7] (byte) sprites_init::s2#0 ← (byte) sprites_init::s#2 * (byte) 2
Rewriting multiplication to use shift [76] (byte) main::s2#0 ← (byte) main::s#2 * (byte) 2
Rewriting multiplication to use shift [93] (byte~) loop::$1 ← (byte) loop::s#2 * (byte) 2
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const byte) sprites_init::xpos#0
Inlining constant with var siblings (const byte) sprites_init::s#0
Inlining constant with different constant siblings (const byte) sprites_irq::toSpritePtr2_return#1
Inlining constant with var siblings (const byte) main::xpos#0
Inlining constant with var siblings (const byte) main::ypos#0
Inlining constant with var siblings (const byte) main::s#0
Inlining constant with var siblings (const byte) loop::s#0
Inlining constant with var siblings (const byte) sin_idx#0
Constant inlined main::toD0181_screen#0 = (const byte*) PLAYFIELD_SCREEN_1
Constant inlined main::toD0181_gfx#0 = (const byte*) PLAYFIELD_CHARSET
Constant inlined sprites_irq::toSpritePtr2_return#1 = (const byte) sprites_irq::toSpritePtr2_return#0
Constant inlined sprites_irq::toSpritePtr2_$2 = (byte)(word)(const byte*) PLAYFIELD_SPRITES/(byte) $40
Constant inlined sprites_irq::$5 = (const byte) sprites_irq::toSpritePtr2_return#0
Constant inlined sprites_irq::toSpritePtr2_$1 = (word)(const byte*) PLAYFIELD_SPRITES/(byte) $40
Constant inlined sprites_init::xpos#0 = (byte)(number) $18+(number) $f*(number) 8
Constant inlined main::toSpritePtr2_sprite#0 = (const byte*) SIN_SPRITE
Constant inlined sprites_irq::toSpritePtr2_$0 = (word)(const byte*) PLAYFIELD_SPRITES
Constant inlined $1 = (const byte) toSpritePtr1_return#0+(byte) 3
Constant inlined toSpritePtr1_$0 = (word)(const byte*) PLAYFIELD_SPRITES
Constant inlined toSpritePtr1_$1 = (word)(const byte*) PLAYFIELD_SPRITES/(byte) $40
Constant inlined sin_idx#0 = (byte) 0
Constant inlined sprites_init::s#0 = (byte) 0
Constant inlined main::xpos#0 = (byte) $18
Constant inlined main::s#0 = (byte) 4
Constant inlined main::toD0181_$7 = >(word)(const byte*) PLAYFIELD_CHARSET/(byte) 4&(byte) $f
Constant inlined main::toSpritePtr2_$1 = (word)(const byte*) SIN_SPRITE/(byte) $40
Constant inlined main::toSpritePtr2_$0 = (word)(const byte*) SIN_SPRITE
Constant inlined main::toD0181_$2 = (word)(const byte*) PLAYFIELD_SCREEN_1&(word) $3fff*(byte) 4
Constant inlined main::toD0181_$1 = (word)(const byte*) PLAYFIELD_SCREEN_1&(word) $3fff
Constant inlined main::toD0181_$0 = (word)(const byte*) PLAYFIELD_SCREEN_1
Constant inlined main::toD0181_$6 = >(word)(const byte*) PLAYFIELD_CHARSET/(byte) 4
Constant inlined main::toD0181_$5 = >(word)(const byte*) PLAYFIELD_CHARSET
Constant inlined main::toD0181_$4 = (word)(const byte*) PLAYFIELD_CHARSET
Constant inlined sprites_irq::toSpritePtr2_sprite#0 = (const byte*) PLAYFIELD_SPRITES
Constant inlined main::toD0181_$3 = >(word)(const byte*) PLAYFIELD_SCREEN_1&(word) $3fff*(byte) 4
Constant inlined main::ypos#0 = (byte) $32
Constant inlined toSpritePtr1_sprite#0 = (const byte*) PLAYFIELD_SPRITES
Constant inlined loop::s#0 = (byte) 4
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(SPRITES_YPOS+2)
Consolidated array index constant in *(SPRITES_YPOS+4)
Consolidated array index constant in *(SPRITES_YPOS+6)
Consolidated array index constant in *(PLAYFIELD_SPRITE_PTRS_1+1)
Consolidated array index constant in *(PLAYFIELD_SPRITE_PTRS_1+2)
Consolidated array index constant in *(PLAYFIELD_SPRITE_PTRS_1+3)
Consolidated array index constant in *(PLAYFIELD_SPRITE_PTRS_2+1)
Consolidated array index constant in *(PLAYFIELD_SPRITE_PTRS_2+2)
Consolidated array index constant in *(PLAYFIELD_SPRITE_PTRS_2+3)
Successful SSA optimization Pass2ConstantAdditionElimination
Alias candidate removed (volatile)(byte) sprites_irq::raster_sprite_gfx_modify = (byte~) sprites_irq::$0 
Alias candidate removed (volatile)(byte) sprites_irq::raster_sprite_gfx_modify = (byte~) sprites_irq::$0 
Added new block during phi lifting sprites_init::@3(between sprites_init::@1 and sprites_init::@1)
Added new block during phi lifting main::@9(between main::@5 and main::@1)
Added new block during phi lifting loop::@11(between loop::@6 and loop::@6)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of toSpritePtr1
Adding NOP phi() at start of toSpritePtr1_@return
Adding NOP phi() at start of @9
Adding NOP phi() at start of @11
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::vicSelectGfxBank1_toDd001
Adding NOP phi() at start of main::vicSelectGfxBank1_toDd001_@return
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of main::toD0181
Adding NOP phi() at start of main::toD0181_@return
Adding NOP phi() at start of main::toSpritePtr2
Adding NOP phi() at start of main::toSpritePtr2_@return
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of main::@7
Adding NOP phi() at start of main::@8
Adding NOP phi() at start of loop
Adding NOP phi() at start of sprites_irq::toSpritePtr2
Adding NOP phi() at start of sprites_irq::toSpritePtr2_@return
CALL GRAPH
Calls in [] to main:11 
Calls in [main] to sprites_init:23 sprites_irq_init:39 loop:41 

Created 8 initial phi equivalence classes
Coalesced [44] main::s#6 ← main::s#1
Coalesced [45] main::xpos#6 ← main::xpos#1
Coalesced [46] main::ypos#6 ← main::ypos#1
Coalesced [51] loop::idx#3 ← loop::idx#0
Coalesced [59] sin_idx#33 ← sin_idx#3
Coalesced [60] loop::s#3 ← loop::s#1
Coalesced [61] loop::idx#4 ← loop::idx#1
Coalesced [86] sprites_init::s#3 ← sprites_init::s#1
Coalesced [87] sprites_init::xpos#3 ← sprites_init::xpos#1
Coalesced down to 8 phi equivalence classes
Culled Empty Block (label) toSpritePtr1_@return
Culled Empty Block (label) @11
Culled Empty Block (label) main::vicSelectGfxBank1_toDd001_@return
Culled Empty Block (label) main::@3
Culled Empty Block (label) main::toD0181_@return
Culled Empty Block (label) main::toSpritePtr2_@return
Culled Empty Block (label) main::@8
Culled Empty Block (label) main::@9
Culled Empty Block (label) loop::@11
Culled Empty Block (label) sprites_init::@3
Culled Empty Block (label) sprites_irq::toSpritePtr2_@return
Renumbering block @4 to @1
Renumbering block @5 to @2
Renumbering block @7 to @3
Renumbering block @9 to @4
Renumbering block @10 to @5
Renumbering block sprites_irq::@6 to sprites_irq::@5
Renumbering block sprites_irq::@7 to sprites_irq::@6
Renumbering block sprites_irq::@8 to sprites_irq::@7
Renumbering block sprites_irq::@11 to sprites_irq::@8
Renumbering block sprites_irq::@12 to sprites_irq::@9
Renumbering block sprites_irq::@13 to sprites_irq::@10
Renumbering block sprites_irq::@15 to sprites_irq::@11
Renumbering block main::@4 to main::@3
Renumbering block main::@5 to main::@4
Renumbering block main::@6 to main::@5
Renumbering block main::@7 to main::@6
Renumbering block loop::@4 to loop::@2
Renumbering block loop::@5 to loop::@3
Renumbering block loop::@6 to loop::@4
Renumbering block loop::@7 to loop::@5
Adding NOP phi() at start of @begin
Adding NOP phi() at start of toSpritePtr1
Adding NOP phi() at start of @4
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::vicSelectGfxBank1_toDd001
Adding NOP phi() at start of main::toD0181
Adding NOP phi() at start of main::toSpritePtr2
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of main::@6
Adding NOP phi() at start of loop
Adding NOP phi() at start of sprites_irq::toSpritePtr2

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  [1] (byte) render_screen_showing ← (byte) 0
  kickasm(location (const byte*) PLAYFIELD_SPRITES) {{ .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000))
	// Put the sprites into memory 
	.for(var sy=0;sy<10;sy++) {
	    .var sprite_gfx_y = sy*20
		.for(var sx=0;sx<3;sx++) {
	    	.for (var y=0;y<21; y++) {
	    	    .var gfx_y =  sprite_gfx_y + mod(2100+y-sprite_gfx_y,21)
		    	.for (var c=0; c<3; c++) {
	            	.byte sprites.getSinglecolorByte(sx*3+c,gfx_y)
	            }
	        }
	    	.byte 0
	  	}
	}
 }}
  to:@2
@2: scope:[]  from @1
  [3] (byte) irq_raster_next ← (const byte) IRQ_RASTER_FIRST
  [4] (byte) irq_sprite_ypos ← (const byte) SPRITES_FIRST_YPOS+(byte) $15
  to:toSpritePtr1
toSpritePtr1: scope:[]  from @2
  [5] phi()
  to:@5
@5: scope:[]  from toSpritePtr1
  [6] (byte) irq_sprite_ptr ← (const byte) toSpritePtr1_return#0+(byte) 3
  [7] (byte) irq_cnt ← (byte) 0
  to:@3
@3: scope:[]  from @5
  kickasm(location (const byte*) SIN_SPRITE) {{ .fill $40, $ff
 }}
  to:@4
@4: scope:[]  from @3
  [9] phi()
  [10] call main 
  to:@end
@end: scope:[]  from @4
  [11] phi()

(void()) main()
main: scope:[main]  from @4
  [12] phi()
  to:main::vicSelectGfxBank1
main::vicSelectGfxBank1: scope:[main]  from main
  [13] *((const byte*) CIA2_PORT_A_DDR) ← (byte) 3
  to:main::vicSelectGfxBank1_toDd001
main::vicSelectGfxBank1_toDd001: scope:[main]  from main::vicSelectGfxBank1
  [14] phi()
  to:main::vicSelectGfxBank1_@1
main::vicSelectGfxBank1_@1: scope:[main]  from main::vicSelectGfxBank1_toDd001
  [15] *((const byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0
  to:main::toD0181
main::toD0181: scope:[main]  from main::vicSelectGfxBank1_@1
  [16] phi()
  to:main::@3
main::@3: scope:[main]  from main::toD0181
  [17] *((const byte*) D018) ← (const byte) main::toD0181_return#0
  [18] call sprites_init 
  to:main::@5
main::@5: scope:[main]  from main::@3
  [19] *((const byte*) SPRITES_ENABLE) ← (byte) $ff
  to:main::@1
main::@1: scope:[main]  from main::@4 main::@5
  [20] (byte) main::ypos#2 ← phi( main::@4/(byte) main::ypos#1 main::@5/(byte) $32 )
  [20] (byte) main::xpos#2 ← phi( main::@4/(byte) main::xpos#1 main::@5/(byte) $18 )
  [20] (byte) main::s#2 ← phi( main::@4/(byte) main::s#1 main::@5/(byte) 4 )
  [21] (byte) main::s2#0 ← (byte) main::s#2 << (byte) 1
  [22] *((const byte*) SPRITES_XPOS + (byte) main::s2#0) ← (byte) main::xpos#2
  [23] *((const byte*) SPRITES_YPOS + (byte) main::s2#0) ← (byte) main::ypos#2
  [24] (byte~) main::$6 ← (byte) main::s#2 - (byte) 3
  [25] *((const byte*) SPRITES_COLS + (byte) main::s#2) ← (byte~) main::$6
  to:main::toSpritePtr2
main::toSpritePtr2: scope:[main]  from main::@1
  [26] phi()
  to:main::@4
main::@4: scope:[main]  from main::toSpritePtr2
  [27] *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (byte) main::s#2) ← (const byte) main::toSpritePtr2_return#0
  [28] (byte) main::xpos#1 ← (byte) main::xpos#2 + (byte) $18
  [29] (byte) main::ypos#1 ← (byte) main::ypos#2 + (byte) $18
  [30] (byte) main::s#1 ← ++ (byte) main::s#2
  [31] if((byte) main::s#1!=(byte) 8) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@4
  [32] phi()
  [33] call sprites_irq_init 
  to:main::@6
main::@6: scope:[main]  from main::@2
  [34] phi()
  [35] call loop 
  to:main::@return
main::@return: scope:[main]  from main::@6
  [36] return 
  to:@return

(void()) loop()
loop: scope:[loop]  from main::@6
  [37] phi()
  to:loop::@1
loop::@1: scope:[loop]  from loop loop::@5
  [38] (byte) sin_idx#10 ← phi( loop/(byte) 0 loop::@5/(byte) sin_idx#3 )
  to:loop::@2
loop::@2: scope:[loop]  from loop::@1 loop::@2
  [39] if(*((const byte*) RASTER)!=(byte) $ff) goto loop::@2
  to:loop::@3
loop::@3: scope:[loop]  from loop::@2
  [40] (byte) loop::idx#0 ← (byte) sin_idx#10
  to:loop::@4
loop::@4: scope:[loop]  from loop::@3 loop::@4
  [41] (byte) loop::idx#2 ← phi( loop::@3/(byte) loop::idx#0 loop::@4/(byte) loop::idx#1 )
  [41] (byte) loop::s#2 ← phi( loop::@3/(byte) 4 loop::@4/(byte) loop::s#1 )
  [42] (byte~) loop::$1 ← (byte) loop::s#2 << (byte) 1
  [43] *((const byte*) SPRITES_YPOS + (byte~) loop::$1) ← *((const byte*) SIN + (byte) loop::idx#2)
  [44] (byte) loop::idx#1 ← (byte) loop::idx#2 + (byte) $a
  [45] (byte) loop::s#1 ← ++ (byte) loop::s#2
  [46] if((byte) loop::s#1!=(byte) 8) goto loop::@4
  to:loop::@5
loop::@5: scope:[loop]  from loop::@4
  [47] (byte) sin_idx#3 ← ++ (byte) sin_idx#10
  to:loop::@1

(void()) sprites_irq_init()
sprites_irq_init: scope:[sprites_irq_init]  from main::@2
  asm { sei  }
  [49] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER
  asm { ldaCIA1_INTERRUPT  }
  [51] *((const byte*) PROCPORT_DDR) ← (const byte) PROCPORT_DDR_MEMORY_MASK
  [52] *((const byte*) PROCPORT) ← (const byte) PROCPORT_RAM_IO
  [53] *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR
  [54] *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) & (byte) $7f
  [55] *((const byte*) RASTER) ← (const byte) IRQ_RASTER_FIRST
  [56] *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER
  [57] *((const void()**) HARDWARE_IRQ) ← &interrupt(HARDWARE_CLOBBER)(void()) sprites_irq()
  asm { cli  }
  to:sprites_irq_init::@return
sprites_irq_init::@return: scope:[sprites_irq_init]  from sprites_irq_init
  [59] return 
  to:@return

(void()) sprites_init()
sprites_init: scope:[sprites_init]  from main::@3
  [60] *((const byte*) SPRITES_ENABLE) ← (byte) $f
  [61] *((const byte*) SPRITES_MC) ← (byte) 0
  [62] *((const byte*) SPRITES_EXPAND_Y) ← *((const byte*) SPRITES_MC)
  [63] *((const byte*) SPRITES_EXPAND_X) ← *((const byte*) SPRITES_EXPAND_Y)
  to:sprites_init::@1
sprites_init::@1: scope:[sprites_init]  from sprites_init sprites_init::@1
  [64] (byte) sprites_init::xpos#2 ← phi( sprites_init/(byte)(number) $18+(number) $f*(number) 8 sprites_init::@1/(byte) sprites_init::xpos#1 )
  [64] (byte) sprites_init::s#2 ← phi( sprites_init/(byte) 0 sprites_init::@1/(byte) sprites_init::s#1 )
  [65] (byte) sprites_init::s2#0 ← (byte) sprites_init::s#2 << (byte) 1
  [66] *((const byte*) SPRITES_XPOS + (byte) sprites_init::s2#0) ← (byte) sprites_init::xpos#2
  [67] *((const byte*) SPRITES_COLS + (byte) sprites_init::s#2) ← (const byte) BLACK
  [68] (byte) sprites_init::xpos#1 ← (byte) sprites_init::xpos#2 + (byte) $18
  [69] (byte) sprites_init::s#1 ← ++ (byte) sprites_init::s#2
  [70] if((byte) sprites_init::s#1!=(byte) 4) goto sprites_init::@1
  to:sprites_init::@return
sprites_init::@return: scope:[sprites_init]  from sprites_init::@1
  [71] return 
  to:@return

interrupt(HARDWARE_CLOBBER)(void()) sprites_irq()
sprites_irq: scope:[sprites_irq]  from
  asm { cld  }
  [73] (byte) sprites_irq::ypos#0 ← (byte) irq_sprite_ypos
  [74] *((const byte*) SPRITES_YPOS) ← (byte) sprites_irq::ypos#0
  [75] *((const byte*) SPRITES_YPOS+(byte) 2) ← (byte) sprites_irq::ypos#0
  [76] *((const byte*) SPRITES_YPOS+(byte) 4) ← (byte) sprites_irq::ypos#0
  [77] *((const byte*) SPRITES_YPOS+(byte) 6) ← (byte) sprites_irq::ypos#0
  [78] (byte~) sprites_irq::$0 ← (byte) irq_raster_next + (byte) 1
  [79] (byte) sprites_irq::raster_sprite_gfx_modify ← (byte~) sprites_irq::$0
  to:sprites_irq::@8
sprites_irq::@8: scope:[sprites_irq]  from sprites_irq sprites_irq::@8
  [80] if(*((const byte*) RASTER)<(byte) sprites_irq::raster_sprite_gfx_modify) goto sprites_irq::@8
  to:sprites_irq::@9
sprites_irq::@9: scope:[sprites_irq]  from sprites_irq::@8
  [81] (byte) sprites_irq::ptr#0 ← (byte) irq_sprite_ptr
  [82] if((byte) render_screen_showing==(byte) 0) goto sprites_irq::@1
  to:sprites_irq::@10
sprites_irq::@10: scope:[sprites_irq]  from sprites_irq::@9
  [83] *((const byte*) PLAYFIELD_SPRITE_PTRS_2) ← (byte) sprites_irq::ptr#0
  [84] (byte) sprites_irq::ptr#3 ← ++ (byte) sprites_irq::ptr#0
  [85] *((const byte*) PLAYFIELD_SPRITE_PTRS_2+(byte) 1) ← (byte) sprites_irq::ptr#3
  [86] *((const byte*) PLAYFIELD_SPRITE_PTRS_2+(byte) 2) ← (byte) sprites_irq::ptr#3
  [87] (byte) sprites_irq::ptr#4 ← ++ (byte) sprites_irq::ptr#3
  [88] *((const byte*) PLAYFIELD_SPRITE_PTRS_2+(byte) 3) ← (byte) sprites_irq::ptr#4
  to:sprites_irq::@2
sprites_irq::@2: scope:[sprites_irq]  from sprites_irq::@1 sprites_irq::@10
  [89] (byte) irq_cnt ← ++ (byte) irq_cnt
  [90] if((byte) irq_cnt==(byte) 9) goto sprites_irq::@3
  to:sprites_irq::@6
sprites_irq::@6: scope:[sprites_irq]  from sprites_irq::@2
  [91] if((byte) irq_cnt==(byte) $a) goto sprites_irq::@4
  to:sprites_irq::@7
sprites_irq::@7: scope:[sprites_irq]  from sprites_irq::@6
  [92] (byte) irq_raster_next ← (byte) irq_raster_next + (byte) $14
  [93] (byte) irq_sprite_ypos ← (byte) irq_sprite_ypos + (byte) $15
  [94] (byte) irq_sprite_ptr ← (byte) irq_sprite_ptr + (byte) 3
  to:sprites_irq::@5
sprites_irq::@5: scope:[sprites_irq]  from sprites_irq::@11 sprites_irq::@4 sprites_irq::@7
  [95] *((const byte*) RASTER) ← (byte) irq_raster_next
  [96] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER
  to:sprites_irq::@return
sprites_irq::@return: scope:[sprites_irq]  from sprites_irq::@5
  [97] return 
  to:@return
sprites_irq::@4: scope:[sprites_irq]  from sprites_irq::@6
  [98] (byte) irq_cnt ← (byte) 0
  [99] (byte) irq_raster_next ← (const byte) IRQ_RASTER_FIRST
  [100] (byte) irq_sprite_ypos ← (byte) irq_sprite_ypos + (byte) $15
  [101] (byte) irq_sprite_ptr ← (byte) irq_sprite_ptr + (byte) 3
  to:sprites_irq::@5
sprites_irq::@3: scope:[sprites_irq]  from sprites_irq::@2
  [102] (byte) irq_raster_next ← (byte) irq_raster_next + (byte) $15
  [103] (byte) irq_sprite_ypos ← (const byte) SPRITES_FIRST_YPOS
  to:sprites_irq::toSpritePtr2
sprites_irq::toSpritePtr2: scope:[sprites_irq]  from sprites_irq::@3
  [104] phi()
  to:sprites_irq::@11
sprites_irq::@11: scope:[sprites_irq]  from sprites_irq::toSpritePtr2
  [105] (byte) irq_sprite_ptr ← (const byte) sprites_irq::toSpritePtr2_return#0
  to:sprites_irq::@5
sprites_irq::@1: scope:[sprites_irq]  from sprites_irq::@9
  [106] *((const byte*) PLAYFIELD_SPRITE_PTRS_1) ← (byte) sprites_irq::ptr#0
  [107] (byte) sprites_irq::ptr#1 ← ++ (byte) sprites_irq::ptr#0
  [108] *((const byte*) PLAYFIELD_SPRITE_PTRS_1+(byte) 1) ← (byte) sprites_irq::ptr#1
  [109] *((const byte*) PLAYFIELD_SPRITE_PTRS_1+(byte) 2) ← (byte) sprites_irq::ptr#1
  [110] (byte) sprites_irq::ptr#2 ← ++ (byte) sprites_irq::ptr#1
  [111] *((const byte*) PLAYFIELD_SPRITE_PTRS_1+(byte) 3) ← (byte) sprites_irq::ptr#2
  to:sprites_irq::@2


VARIABLE REGISTER WEIGHTS
(byte) irq_cnt loadstore 6.0
(byte) irq_raster_next loadstore 1.0
(byte) irq_sprite_ptr loadstore 1.5555555555555558
(byte) irq_sprite_ypos loadstore 14.0
(void()) loop()
(byte~) loop::$1 202.0
(byte) loop::idx
(byte) loop::idx#0 22.0
(byte) loop::idx#1 67.33333333333333
(byte) loop::idx#2 104.66666666666666
(byte) loop::s
(byte) loop::s#1 151.5
(byte) loop::s#2 75.75
(void()) main()
(byte~) main::$6 22.0
(byte) main::s
(byte) main::s#1 16.5
(byte) main::s#2 6.6
(byte) main::s2
(byte) main::s2#0 16.5
(byte*) main::toD0181_gfx
(byte) main::toD0181_return
(byte*) main::toD0181_screen
(byte) main::toSpritePtr2_return
(byte*) main::toSpritePtr2_sprite
(byte*) main::vicSelectGfxBank1_gfx
(byte*) main::vicSelectGfxBank1_toDd001_gfx
(byte) main::vicSelectGfxBank1_toDd001_return
(byte) main::xpos
(byte) main::xpos#1 5.5
(byte) main::xpos#2 4.125
(byte) main::ypos
(byte) main::ypos#1 7.333333333333333
(byte) main::ypos#2 3.666666666666667
(byte) render_screen_showing loadstore 0.4
(byte) sin_idx
(byte) sin_idx#10 3.666666666666667
(byte) sin_idx#3 22.0
(void()) sprites_init()
(byte) sprites_init::s
(byte) sprites_init::s#1 16.5
(byte) sprites_init::s#2 8.8
(byte) sprites_init::s2
(byte) sprites_init::s2#0 22.0
(byte) sprites_init::xpos
(byte) sprites_init::xpos#1 7.333333333333333
(byte) sprites_init::xpos#2 8.25
interrupt(HARDWARE_CLOBBER)(void()) sprites_irq()
(byte~) sprites_irq::$0 4.0
(byte) sprites_irq::ptr
(byte) sprites_irq::ptr#0 2.5
(byte) sprites_irq::ptr#1 2.6666666666666665
(byte) sprites_irq::ptr#2 4.0
(byte) sprites_irq::ptr#3 2.6666666666666665
(byte) sprites_irq::ptr#4 4.0
(byte) sprites_irq::raster_sprite_gfx_modify loadstore 6.5
(byte) sprites_irq::toSpritePtr2_return
(byte*) sprites_irq::toSpritePtr2_sprite
(byte) sprites_irq::ypos
(byte) sprites_irq::ypos#0 2.5
(void()) sprites_irq_init()
(byte) toSpritePtr1_return
(byte*) toSpritePtr1_sprite

Initial phi equivalence classes
[ main::s#2 main::s#1 ]
[ main::xpos#2 main::xpos#1 ]
[ main::ypos#2 main::ypos#1 ]
[ sin_idx#10 sin_idx#3 ]
[ loop::s#2 loop::s#1 ]
[ loop::idx#2 loop::idx#0 loop::idx#1 ]
[ sprites_init::s#2 sprites_init::s#1 ]
[ sprites_init::xpos#2 sprites_init::xpos#1 ]
Added variable render_screen_showing to live range equivalence class [ render_screen_showing ]
Added variable irq_raster_next to live range equivalence class [ irq_raster_next ]
Added variable irq_sprite_ypos to live range equivalence class [ irq_sprite_ypos ]
Added variable irq_sprite_ptr to live range equivalence class [ irq_sprite_ptr ]
Added variable irq_cnt to live range equivalence class [ irq_cnt ]
Added variable main::s2#0 to live range equivalence class [ main::s2#0 ]
Added variable main::$6 to live range equivalence class [ main::$6 ]
Added variable loop::$1 to live range equivalence class [ loop::$1 ]
Added variable sprites_init::s2#0 to live range equivalence class [ sprites_init::s2#0 ]
Added variable sprites_irq::ypos#0 to live range equivalence class [ sprites_irq::ypos#0 ]
Added variable sprites_irq::$0 to live range equivalence class [ sprites_irq::$0 ]
Added variable sprites_irq::raster_sprite_gfx_modify to live range equivalence class [ sprites_irq::raster_sprite_gfx_modify ]
Added variable sprites_irq::ptr#0 to live range equivalence class [ sprites_irq::ptr#0 ]
Added variable sprites_irq::ptr#3 to live range equivalence class [ sprites_irq::ptr#3 ]
Added variable sprites_irq::ptr#4 to live range equivalence class [ sprites_irq::ptr#4 ]
Added variable sprites_irq::ptr#1 to live range equivalence class [ sprites_irq::ptr#1 ]
Added variable sprites_irq::ptr#2 to live range equivalence class [ sprites_irq::ptr#2 ]
Complete equivalence classes
[ main::s#2 main::s#1 ]
[ main::xpos#2 main::xpos#1 ]
[ main::ypos#2 main::ypos#1 ]
[ sin_idx#10 sin_idx#3 ]
[ loop::s#2 loop::s#1 ]
[ loop::idx#2 loop::idx#0 loop::idx#1 ]
[ sprites_init::s#2 sprites_init::s#1 ]
[ sprites_init::xpos#2 sprites_init::xpos#1 ]
[ render_screen_showing ]
[ irq_raster_next ]
[ irq_sprite_ypos ]
[ irq_sprite_ptr ]
[ irq_cnt ]
[ main::s2#0 ]
[ main::$6 ]
[ loop::$1 ]
[ sprites_init::s2#0 ]
[ sprites_irq::ypos#0 ]
[ sprites_irq::$0 ]
[ sprites_irq::raster_sprite_gfx_modify ]
[ sprites_irq::ptr#0 ]
[ sprites_irq::ptr#3 ]
[ sprites_irq::ptr#4 ]
[ sprites_irq::ptr#1 ]
[ sprites_irq::ptr#2 ]
Allocated zp[1]:2 [ main::s#2 main::s#1 ]
Allocated zp[1]:3 [ main::xpos#2 main::xpos#1 ]
Allocated zp[1]:4 [ main::ypos#2 main::ypos#1 ]
Allocated zp[1]:5 [ sin_idx#10 sin_idx#3 ]
Allocated zp[1]:6 [ loop::s#2 loop::s#1 ]
Allocated zp[1]:7 [ loop::idx#2 loop::idx#0 loop::idx#1 ]
Allocated zp[1]:8 [ sprites_init::s#2 sprites_init::s#1 ]
Allocated zp[1]:9 [ sprites_init::xpos#2 sprites_init::xpos#1 ]
Allocated zp[1]:10 [ render_screen_showing ]
Allocated zp[1]:11 [ irq_raster_next ]
Allocated zp[1]:12 [ irq_sprite_ypos ]
Allocated zp[1]:13 [ irq_sprite_ptr ]
Allocated zp[1]:14 [ irq_cnt ]
Allocated zp[1]:15 [ main::s2#0 ]
Allocated zp[1]:16 [ main::$6 ]
Allocated zp[1]:17 [ loop::$1 ]
Allocated zp[1]:18 [ sprites_init::s2#0 ]
Allocated zp[1]:19 [ sprites_irq::ypos#0 ]
Allocated zp[1]:20 [ sprites_irq::$0 ]
Allocated zp[1]:21 [ sprites_irq::raster_sprite_gfx_modify ]
Allocated zp[1]:22 [ sprites_irq::ptr#0 ]
Allocated zp[1]:23 [ sprites_irq::ptr#3 ]
Allocated zp[1]:24 [ sprites_irq::ptr#4 ]
Allocated zp[1]:25 [ sprites_irq::ptr#1 ]
Allocated zp[1]:26 [ sprites_irq::ptr#2 ]

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  // Processor port data direction register
  .label PROCPORT_DDR = 0
  // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written
  .const PROCPORT_DDR_MEMORY_MASK = 7
  // Processor Port Register controlling RAM/ROM configuration and the datasette
  .label PROCPORT = 1
  // RAM in $A000, $E000 I/O in $D000
  .const PROCPORT_RAM_IO = 5
  // The offset of the sprite pointers from the screen start address
  .const SPRITE_PTRS = $3f8
  .label SPRITES_XPOS = $d000
  .label SPRITES_YPOS = $d001
  .label RASTER = $d012
  .label SPRITES_ENABLE = $d015
  .label SPRITES_EXPAND_Y = $d017
  .label SPRITES_MC = $d01c
  .label SPRITES_EXPAND_X = $d01d
  .label SPRITES_COLS = $d027
  .label VIC_CONTROL = $d011
  .label D018 = $d018
  // VIC II IRQ Status Register
  .label IRQ_STATUS = $d019
  // VIC II IRQ Enable Register
  .label IRQ_ENABLE = $d01a
  // Bits for the IRQ Status/Enable Registers
  .const IRQ_RASTER = 1
  // CIA#1 Interrupt Status & Control Register
  .label CIA1_INTERRUPT = $dc0d
  // CIA#2 Port A: Serial bus, RS-232, VIC memory bank
  .label CIA2_PORT_A = $dd00
  // CIA #2 Port A data direction register.
  .label CIA2_PORT_A_DDR = $dd02
  // Value that disables all CIA interrupts when stored to the CIA Interrupt registers
  .const CIA_INTERRUPT_CLEAR = $7f
  // The vector used when the HARDWARE serves IRQ interrupts
  .label HARDWARE_IRQ = $fffe
  // The colors of the C64
  .const BLACK = 0
  // Address of the first screen
  .label PLAYFIELD_SCREEN_1 = $400
  // Address of the second screen
  .label PLAYFIELD_SCREEN_2 = $2c00
  // Screen Sprite pointers on screen 1
  .label PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+SPRITE_PTRS
  // Screen Sprite pointers on screen 2
  .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS
  // Address of the sprites covering the playfield
  .label PLAYFIELD_SPRITES = $2000
  // Address of the charset
  .label PLAYFIELD_CHARSET = $2800
  // The Y-position of the first sprite row
  .const SPRITES_FIRST_YPOS = $31
  // The line of the first IRQ
  .const IRQ_RASTER_FIRST = SPRITES_FIRST_YPOS+$13
  .label SIN_SPRITE = $2800
  .const toSpritePtr1_return = PLAYFIELD_SPRITES/$40
  .label render_screen_showing = $a
  .label irq_raster_next = $b
  .label irq_sprite_ypos = $c
  .label irq_sprite_ptr = $d
  .label irq_cnt = $e
  .label sin_idx = 5
  // @begin
__bbegin:
  jmp __b1
  // @1
__b1:
  // [1] (byte) render_screen_showing ← (byte) 0 -- vbuz1=vbuc1 
  // The screen currently being showed to the user. 0x00 for screen 1 / 0x20 for screen 2.
  lda #0
  sta.z render_screen_showing
  // kickasm(location (const byte*) PLAYFIELD_SPRITES) {{ .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000)) 	// Put the sprites into memory  	.for(var sy=0;sy<10;sy++) { 	    .var sprite_gfx_y = sy*20 		.for(var sx=0;sx<3;sx++) { 	    	.for (var y=0;y<21; y++) { 	    	    .var gfx_y =  sprite_gfx_y + mod(2100+y-sprite_gfx_y,21) 		    	.for (var c=0; c<3; c++) { 	            	.byte sprites.getSinglecolorByte(sx*3+c,gfx_y) 	            } 	        } 	    	.byte 0 	  	} 	}  }}
  jmp __b2
  // @2
__b2:
  // [3] (byte) irq_raster_next ← (const byte) IRQ_RASTER_FIRST -- vbuz1=vbuc1 
  // The raster line of the next IRQ
  lda #IRQ_RASTER_FIRST
  sta.z irq_raster_next
  // [4] (byte) irq_sprite_ypos ← (const byte) SPRITES_FIRST_YPOS+(byte) $15 -- vbuz1=vbuc1 
  // Y-pos of the sprites on the next IRQ
  lda #SPRITES_FIRST_YPOS+$15
  sta.z irq_sprite_ypos
  // [5] phi from @2 to toSpritePtr1 [phi:@2->toSpritePtr1]
toSpritePtr1_from___b2:
  jmp toSpritePtr1
  // toSpritePtr1
toSpritePtr1:
  jmp __b5
  // @5
__b5:
  // [6] (byte) irq_sprite_ptr ← (const byte) toSpritePtr1_return#0+(byte) 3 -- vbuz1=vbuc1 
  // Index of the sprites to show on the next IRQ
  lda #toSpritePtr1_return+3
  sta.z irq_sprite_ptr
  // [7] (byte) irq_cnt ← (byte) 0 -- vbuz1=vbuc1 
  // Counting the 10 IRQs
  lda #0
  sta.z irq_cnt
  jmp __b3
  // @3
__b3:
  // kickasm(location (const byte*) SIN_SPRITE) {{ .fill $40, $ff  }}
  // [9] phi from @3 to @4 [phi:@3->@4]
__b4_from___b3:
  jmp __b4
  // @4
__b4:
  // [10] call main 
  // [12] phi from @4 to main [phi:@4->main]
main_from___b4:
  jsr main
  // [11] phi from @4 to @end [phi:@4->@end]
__bend_from___b4:
  jmp __bend
  // @end
__bend:
  // main
main: {
    .const toSpritePtr2_return = SIN_SPRITE/$40
    .const vicSelectGfxBank1_toDd001_return = 3
    .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)*4)|(>PLAYFIELD_CHARSET)/4&$f
    .label __6 = $10
    .label s2 = $f
    .label xpos = 3
    .label ypos = 4
    .label s = 2
    jmp vicSelectGfxBank1
    // main::vicSelectGfxBank1
  vicSelectGfxBank1:
    // [13] *((const byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2 
    lda #3
    sta CIA2_PORT_A_DDR
    // [14] phi from main::vicSelectGfxBank1 to main::vicSelectGfxBank1_toDd001 [phi:main::vicSelectGfxBank1->main::vicSelectGfxBank1_toDd001]
  vicSelectGfxBank1_toDd001_from_vicSelectGfxBank1:
    jmp vicSelectGfxBank1_toDd001
    // main::vicSelectGfxBank1_toDd001
  vicSelectGfxBank1_toDd001:
    jmp vicSelectGfxBank1___b1
    // main::vicSelectGfxBank1_@1
  vicSelectGfxBank1___b1:
    // [15] *((const byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 -- _deref_pbuc1=vbuc2 
    lda #vicSelectGfxBank1_toDd001_return
    sta CIA2_PORT_A
    // [16] phi from main::vicSelectGfxBank1_@1 to main::toD0181 [phi:main::vicSelectGfxBank1_@1->main::toD0181]
  toD0181_from_vicSelectGfxBank1___b1:
    jmp toD0181
    // main::toD0181
  toD0181:
    jmp __b3
    // main::@3
  __b3:
    // [17] *((const byte*) D018) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0181_return
    sta D018
    // [18] call sprites_init 
    jsr sprites_init
    jmp __b5
    // main::@5
  __b5:
    // [19] *((const byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2 
    lda #$ff
    sta SPRITES_ENABLE
    // [20] phi from main::@5 to main::@1 [phi:main::@5->main::@1]
  __b1_from___b5:
    // [20] phi (byte) main::ypos#2 = (byte) $32 [phi:main::@5->main::@1#0] -- vbuz1=vbuc1 
    lda #$32
    sta.z ypos
    // [20] phi (byte) main::xpos#2 = (byte) $18 [phi:main::@5->main::@1#1] -- vbuz1=vbuc1 
    lda #$18
    sta.z xpos
    // [20] phi (byte) main::s#2 = (byte) 4 [phi:main::@5->main::@1#2] -- vbuz1=vbuc1 
    lda #4
    sta.z s
    jmp __b1
    // [20] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
  __b1_from___b4:
    // [20] phi (byte) main::ypos#2 = (byte) main::ypos#1 [phi:main::@4->main::@1#0] -- register_copy 
    // [20] phi (byte) main::xpos#2 = (byte) main::xpos#1 [phi:main::@4->main::@1#1] -- register_copy 
    // [20] phi (byte) main::s#2 = (byte) main::s#1 [phi:main::@4->main::@1#2] -- register_copy 
    jmp __b1
    // main::@1
  __b1:
    // [21] (byte) main::s2#0 ← (byte) main::s#2 << (byte) 1 -- vbuz1=vbuz2_rol_1 
    lda.z s
    asl
    sta.z s2
    // [22] *((const byte*) SPRITES_XPOS + (byte) main::s2#0) ← (byte) main::xpos#2 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z xpos
    ldy.z s2
    sta SPRITES_XPOS,y
    // [23] *((const byte*) SPRITES_YPOS + (byte) main::s2#0) ← (byte) main::ypos#2 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z ypos
    ldy.z s2
    sta SPRITES_YPOS,y
    // [24] (byte~) main::$6 ← (byte) main::s#2 - (byte) 3 -- vbuz1=vbuz2_minus_vbuc1 
    lax.z s
    axs #3
    stx.z __6
    // [25] *((const byte*) SPRITES_COLS + (byte) main::s#2) ← (byte~) main::$6 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __6
    ldy.z s
    sta SPRITES_COLS,y
    // [26] phi from main::@1 to main::toSpritePtr2 [phi:main::@1->main::toSpritePtr2]
  toSpritePtr2_from___b1:
    jmp toSpritePtr2
    // main::toSpritePtr2
  toSpritePtr2:
    jmp __b4
    // main::@4
  __b4:
    // [27] *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (byte) main::s#2) ← (const byte) main::toSpritePtr2_return#0 -- pbuc1_derefidx_vbuz1=vbuc2 
    lda #toSpritePtr2_return
    ldy.z s
    sta PLAYFIELD_SPRITE_PTRS_1,y
    // [28] (byte) main::xpos#1 ← (byte) main::xpos#2 + (byte) $18 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z xpos
    axs #-[$18]
    stx.z xpos
    // [29] (byte) main::ypos#1 ← (byte) main::ypos#2 + (byte) $18 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z ypos
    axs #-[$18]
    stx.z ypos
    // [30] (byte) main::s#1 ← ++ (byte) main::s#2 -- vbuz1=_inc_vbuz1 
    inc.z s
    // [31] if((byte) main::s#1!=(byte) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #8
    cmp.z s
    bne __b1_from___b4
    // [32] phi from main::@4 to main::@2 [phi:main::@4->main::@2]
  __b2_from___b4:
    jmp __b2
    // main::@2
  __b2:
    // [33] call sprites_irq_init 
    jsr sprites_irq_init
    // [34] phi from main::@2 to main::@6 [phi:main::@2->main::@6]
  __b6_from___b2:
    jmp __b6
    // main::@6
  __b6:
    // [35] call loop 
    // [37] phi from main::@6 to loop [phi:main::@6->loop]
  loop_from___b6:
    jsr loop
    jmp __breturn
    // main::@return
  __breturn:
    // [36] return 
    rts
}
  // loop
loop: {
    .label __1 = $11
    .label idx = 7
    .label s = 6
    // [38] phi from loop to loop::@1 [phi:loop->loop::@1]
  __b1_from_loop:
    // [38] phi (byte) sin_idx#10 = (byte) 0 [phi:loop->loop::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z sin_idx
    jmp __b1
    // loop::@1
  __b1:
    jmp __b2
    // loop::@2
  __b2:
    // [39] if(*((const byte*) RASTER)!=(byte) $ff) goto loop::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$ff
    cmp RASTER
    bne __b2
    jmp __b3
    // loop::@3
  __b3:
    // [40] (byte) loop::idx#0 ← (byte) sin_idx#10 -- vbuz1=vbuz2 
    lda.z sin_idx
    sta.z idx
    // [41] phi from loop::@3 to loop::@4 [phi:loop::@3->loop::@4]
  __b4_from___b3:
    // [41] phi (byte) loop::idx#2 = (byte) loop::idx#0 [phi:loop::@3->loop::@4#0] -- register_copy 
    // [41] phi (byte) loop::s#2 = (byte) 4 [phi:loop::@3->loop::@4#1] -- vbuz1=vbuc1 
    lda #4
    sta.z s
    jmp __b4
    // [41] phi from loop::@4 to loop::@4 [phi:loop::@4->loop::@4]
  __b4_from___b4:
    // [41] phi (byte) loop::idx#2 = (byte) loop::idx#1 [phi:loop::@4->loop::@4#0] -- register_copy 
    // [41] phi (byte) loop::s#2 = (byte) loop::s#1 [phi:loop::@4->loop::@4#1] -- register_copy 
    jmp __b4
    // loop::@4
  __b4:
    // [42] (byte~) loop::$1 ← (byte) loop::s#2 << (byte) 1 -- vbuz1=vbuz2_rol_1 
    lda.z s
    asl
    sta.z __1
    // [43] *((const byte*) SPRITES_YPOS + (byte~) loop::$1) ← *((const byte*) SIN + (byte) loop::idx#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 
    ldy.z idx
    lda SIN,y
    ldy.z __1
    sta SPRITES_YPOS,y
    // [44] (byte) loop::idx#1 ← (byte) loop::idx#2 + (byte) $a -- vbuz1=vbuz1_plus_vbuc1 
    lax.z idx
    axs #-[$a]
    stx.z idx
    // [45] (byte) loop::s#1 ← ++ (byte) loop::s#2 -- vbuz1=_inc_vbuz1 
    inc.z s
    // [46] if((byte) loop::s#1!=(byte) 8) goto loop::@4 -- vbuz1_neq_vbuc1_then_la1 
    lda #8
    cmp.z s
    bne __b4_from___b4
    jmp __b5
    // loop::@5
  __b5:
    // [47] (byte) sin_idx#3 ← ++ (byte) sin_idx#10 -- vbuz1=_inc_vbuz1 
    inc.z sin_idx
    // [38] phi from loop::@5 to loop::@1 [phi:loop::@5->loop::@1]
  __b1_from___b5:
    // [38] phi (byte) sin_idx#10 = (byte) sin_idx#3 [phi:loop::@5->loop::@1#0] -- register_copy 
    jmp __b1
}
  // sprites_irq_init
// Setup the IRQ
sprites_irq_init: {
    // asm { sei  }
    sei
    // [49] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 
    // Acknowledge any IRQ and setup the next one
    lda #IRQ_RASTER
    sta IRQ_STATUS
    // asm { ldaCIA1_INTERRUPT  }
    lda CIA1_INTERRUPT
    // [51] *((const byte*) PROCPORT_DDR) ← (const byte) PROCPORT_DDR_MEMORY_MASK -- _deref_pbuc1=vbuc2 
    // Disable kernal & basic
    lda #PROCPORT_DDR_MEMORY_MASK
    sta PROCPORT_DDR
    // [52] *((const byte*) PROCPORT) ← (const byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2 
    lda #PROCPORT_RAM_IO
    sta PROCPORT
    // [53] *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 
    // Disable CIA 1 Timer IRQ
    lda #CIA_INTERRUPT_CLEAR
    sta CIA1_INTERRUPT
    // [54] *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 
    // Set raster line
    lda #$7f
    and VIC_CONTROL
    sta VIC_CONTROL
    // [55] *((const byte*) RASTER) ← (const byte) IRQ_RASTER_FIRST -- _deref_pbuc1=vbuc2 
    lda #IRQ_RASTER_FIRST
    sta RASTER
    // [56] *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 
    // Enable Raster Interrupt
    lda #IRQ_RASTER
    sta IRQ_ENABLE
    // [57] *((const void()**) HARDWARE_IRQ) ← &interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() -- _deref_pptc1=pprc2 
    // Set the IRQ routine
    lda #<sprites_irq
    sta HARDWARE_IRQ
    lda #>sprites_irq
    sta HARDWARE_IRQ+1
    // asm { cli  }
    cli
    jmp __breturn
    // sprites_irq_init::@return
  __breturn:
    // [59] return 
    rts
}
  // sprites_init
// Setup the sprites
sprites_init: {
    .label s2 = $12
    .label xpos = 9
    .label s = 8
    // [60] *((const byte*) SPRITES_ENABLE) ← (byte) $f -- _deref_pbuc1=vbuc2 
    lda #$f
    sta SPRITES_ENABLE
    // [61] *((const byte*) SPRITES_MC) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SPRITES_MC
    // [62] *((const byte*) SPRITES_EXPAND_Y) ← *((const byte*) SPRITES_MC) -- _deref_pbuc1=_deref_pbuc2 
    lda SPRITES_MC
    sta SPRITES_EXPAND_Y
    // [63] *((const byte*) SPRITES_EXPAND_X) ← *((const byte*) SPRITES_EXPAND_Y) -- _deref_pbuc1=_deref_pbuc2 
    lda SPRITES_EXPAND_Y
    sta SPRITES_EXPAND_X
    // [64] phi from sprites_init to sprites_init::@1 [phi:sprites_init->sprites_init::@1]
  __b1_from_sprites_init:
    // [64] phi (byte) sprites_init::xpos#2 = (byte)(number) $18+(number) $f*(number) 8 [phi:sprites_init->sprites_init::@1#0] -- vbuz1=vbuc1 
    lda #$18+$f*8
    sta.z xpos
    // [64] phi (byte) sprites_init::s#2 = (byte) 0 [phi:sprites_init->sprites_init::@1#1] -- vbuz1=vbuc1 
    lda #0
    sta.z s
    jmp __b1
    // [64] phi from sprites_init::@1 to sprites_init::@1 [phi:sprites_init::@1->sprites_init::@1]
  __b1_from___b1:
    // [64] phi (byte) sprites_init::xpos#2 = (byte) sprites_init::xpos#1 [phi:sprites_init::@1->sprites_init::@1#0] -- register_copy 
    // [64] phi (byte) sprites_init::s#2 = (byte) sprites_init::s#1 [phi:sprites_init::@1->sprites_init::@1#1] -- register_copy 
    jmp __b1
    // sprites_init::@1
  __b1:
    // [65] (byte) sprites_init::s2#0 ← (byte) sprites_init::s#2 << (byte) 1 -- vbuz1=vbuz2_rol_1 
    lda.z s
    asl
    sta.z s2
    // [66] *((const byte*) SPRITES_XPOS + (byte) sprites_init::s2#0) ← (byte) sprites_init::xpos#2 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z xpos
    ldy.z s2
    sta SPRITES_XPOS,y
    // [67] *((const byte*) SPRITES_COLS + (byte) sprites_init::s#2) ← (const byte) BLACK -- pbuc1_derefidx_vbuz1=vbuc2 
    lda #BLACK
    ldy.z s
    sta SPRITES_COLS,y
    // [68] (byte) sprites_init::xpos#1 ← (byte) sprites_init::xpos#2 + (byte) $18 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z xpos
    axs #-[$18]
    stx.z xpos
    // [69] (byte) sprites_init::s#1 ← ++ (byte) sprites_init::s#2 -- vbuz1=_inc_vbuz1 
    inc.z s
    // [70] if((byte) sprites_init::s#1!=(byte) 4) goto sprites_init::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #4
    cmp.z s
    bne __b1_from___b1
    jmp __breturn
    // sprites_init::@return
  __breturn:
    // [71] return 
    rts
}
  // sprites_irq
// Raster Interrupt Routine - sets up the sprites covering the playfield
// Repeats 10 timers every 2 lines from line IRQ_RASTER_FIRST
// Utilizes duplicated gfx in the sprites to allow for some leeway in updating the sprite pointers
sprites_irq: {
    .const toSpritePtr2_return = PLAYFIELD_SPRITES/$40
    .label __0 = $14
    .label raster_sprite_gfx_modify = $15
    .label ypos = $13
    .label ptr = $16
    .label ptr_1 = $19
    .label ptr_2 = $1a
    .label ptr_3 = $17
    .label ptr_4 = $18
    // entry interrupt(HARDWARE_CLOBBER)
    sta rega+1
    stx regx+1
    sty regy+1
    // asm { cld  }
    //(*BGCOL)++;
    // Clear decimal flag (because it is used by the score algorithm)
    cld
    // [73] (byte) sprites_irq::ypos#0 ← (byte) irq_sprite_ypos -- vbuz1=vbuz2 
    // Place the sprites
    lda.z irq_sprite_ypos
    sta.z ypos
    // [74] *((const byte*) SPRITES_YPOS) ← (byte) sprites_irq::ypos#0 -- _deref_pbuc1=vbuz1 
    lda.z ypos
    sta SPRITES_YPOS
    // [75] *((const byte*) SPRITES_YPOS+(byte) 2) ← (byte) sprites_irq::ypos#0 -- _deref_pbuc1=vbuz1 
    lda.z ypos
    sta SPRITES_YPOS+2
    // [76] *((const byte*) SPRITES_YPOS+(byte) 4) ← (byte) sprites_irq::ypos#0 -- _deref_pbuc1=vbuz1 
    lda.z ypos
    sta SPRITES_YPOS+4
    // [77] *((const byte*) SPRITES_YPOS+(byte) 6) ← (byte) sprites_irq::ypos#0 -- _deref_pbuc1=vbuz1 
    lda.z ypos
    sta SPRITES_YPOS+6
    // [78] (byte~) sprites_irq::$0 ← (byte) irq_raster_next + (byte) 1 -- vbuz1=vbuz2_plus_1 
    ldy.z irq_raster_next
    iny
    sty.z __0
    // [79] (byte) sprites_irq::raster_sprite_gfx_modify ← (byte~) sprites_irq::$0 -- vbuz1=vbuz2 
    // Wait for the y-position before changing sprite pointers
    lda.z __0
    sta.z raster_sprite_gfx_modify
    jmp __b8
    // sprites_irq::@8
  __b8:
    // [80] if(*((const byte*) RASTER)<(byte) sprites_irq::raster_sprite_gfx_modify) goto sprites_irq::@8 -- _deref_pbuc1_lt_vbuz1_then_la1 
    lda RASTER
    cmp.z raster_sprite_gfx_modify
    bcc __b8
    jmp __b9
    // sprites_irq::@9
  __b9:
    // [81] (byte) sprites_irq::ptr#0 ← (byte) irq_sprite_ptr -- vbuz1=vbuz2 
    lda.z irq_sprite_ptr
    sta.z ptr
    // [82] if((byte) render_screen_showing==(byte) 0) goto sprites_irq::@1 -- vbuz1_eq_0_then_la1 
    lda.z render_screen_showing
    cmp #0
    beq __b1
    jmp __b10
    // sprites_irq::@10
  __b10:
    // [83] *((const byte*) PLAYFIELD_SPRITE_PTRS_2) ← (byte) sprites_irq::ptr#0 -- _deref_pbuc1=vbuz1 
    lda.z ptr
    sta PLAYFIELD_SPRITE_PTRS_2
    // [84] (byte) sprites_irq::ptr#3 ← ++ (byte) sprites_irq::ptr#0 -- vbuz1=_inc_vbuz2 
    ldy.z ptr
    iny
    sty.z ptr_3
    // [85] *((const byte*) PLAYFIELD_SPRITE_PTRS_2+(byte) 1) ← (byte) sprites_irq::ptr#3 -- _deref_pbuc1=vbuz1 
    lda.z ptr_3
    sta PLAYFIELD_SPRITE_PTRS_2+1
    // [86] *((const byte*) PLAYFIELD_SPRITE_PTRS_2+(byte) 2) ← (byte) sprites_irq::ptr#3 -- _deref_pbuc1=vbuz1 
    lda.z ptr_3
    sta PLAYFIELD_SPRITE_PTRS_2+2
    // [87] (byte) sprites_irq::ptr#4 ← ++ (byte) sprites_irq::ptr#3 -- vbuz1=_inc_vbuz2 
    ldy.z ptr_3
    iny
    sty.z ptr_4
    // [88] *((const byte*) PLAYFIELD_SPRITE_PTRS_2+(byte) 3) ← (byte) sprites_irq::ptr#4 -- _deref_pbuc1=vbuz1 
    lda.z ptr_4
    sta PLAYFIELD_SPRITE_PTRS_2+3
    jmp __b2
    // sprites_irq::@2
  __b2:
    // [89] (byte) irq_cnt ← ++ (byte) irq_cnt -- vbuz1=_inc_vbuz1 
    inc.z irq_cnt
    // [90] if((byte) irq_cnt==(byte) 9) goto sprites_irq::@3 -- vbuz1_eq_vbuc1_then_la1 
    lda #9
    cmp.z irq_cnt
    beq __b3
    jmp __b6
    // sprites_irq::@6
  __b6:
    // [91] if((byte) irq_cnt==(byte) $a) goto sprites_irq::@4 -- vbuz1_eq_vbuc1_then_la1 
    lda #$a
    cmp.z irq_cnt
    beq __b4
    jmp __b7
    // sprites_irq::@7
  __b7:
    // [92] (byte) irq_raster_next ← (byte) irq_raster_next + (byte) $14 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_raster_next
    axs #-[$14]
    stx.z irq_raster_next
    // [93] (byte) irq_sprite_ypos ← (byte) irq_sprite_ypos + (byte) $15 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_sprite_ypos
    axs #-[$15]
    stx.z irq_sprite_ypos
    // [94] (byte) irq_sprite_ptr ← (byte) irq_sprite_ptr + (byte) 3 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_sprite_ptr
    axs #-[3]
    stx.z irq_sprite_ptr
    jmp __b5
    // sprites_irq::@5
  __b5:
    // [95] *((const byte*) RASTER) ← (byte) irq_raster_next -- _deref_pbuc1=vbuz1 
    // Setup next interrupt
    lda.z irq_raster_next
    sta RASTER
    // [96] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 
    // Acknowledge the IRQ and setup the next one
    lda #IRQ_RASTER
    sta IRQ_STATUS
    jmp __breturn
    // sprites_irq::@return
  __breturn:
    // [97] return  - exit interrupt(HARDWARE_CLOBBER)
  rega:
    lda #00
  regx:
    ldx #00
  regy:
    ldy #00
    rti
    // sprites_irq::@4
  __b4:
    // [98] (byte) irq_cnt ← (byte) 0 -- vbuz1=vbuc1 
    lda #0
    sta.z irq_cnt
    // [99] (byte) irq_raster_next ← (const byte) IRQ_RASTER_FIRST -- vbuz1=vbuc1 
    lda #IRQ_RASTER_FIRST
    sta.z irq_raster_next
    // [100] (byte) irq_sprite_ypos ← (byte) irq_sprite_ypos + (byte) $15 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_sprite_ypos
    axs #-[$15]
    stx.z irq_sprite_ypos
    // [101] (byte) irq_sprite_ptr ← (byte) irq_sprite_ptr + (byte) 3 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_sprite_ptr
    axs #-[3]
    stx.z irq_sprite_ptr
    jmp __b5
    // sprites_irq::@3
  __b3:
    // [102] (byte) irq_raster_next ← (byte) irq_raster_next + (byte) $15 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_raster_next
    axs #-[$15]
    stx.z irq_raster_next
    // [103] (byte) irq_sprite_ypos ← (const byte) SPRITES_FIRST_YPOS -- vbuz1=vbuc1 
    lda #SPRITES_FIRST_YPOS
    sta.z irq_sprite_ypos
    // [104] phi from sprites_irq::@3 to sprites_irq::toSpritePtr2 [phi:sprites_irq::@3->sprites_irq::toSpritePtr2]
  toSpritePtr2_from___b3:
    jmp toSpritePtr2
    // sprites_irq::toSpritePtr2
  toSpritePtr2:
    jmp __b11
    // sprites_irq::@11
  __b11:
    // [105] (byte) irq_sprite_ptr ← (const byte) sprites_irq::toSpritePtr2_return#0 -- vbuz1=vbuc1 
    lda #toSpritePtr2_return
    sta.z irq_sprite_ptr
    jmp __b5
    // sprites_irq::@1
  __b1:
    // [106] *((const byte*) PLAYFIELD_SPRITE_PTRS_1) ← (byte) sprites_irq::ptr#0 -- _deref_pbuc1=vbuz1 
    lda.z ptr
    sta PLAYFIELD_SPRITE_PTRS_1
    // [107] (byte) sprites_irq::ptr#1 ← ++ (byte) sprites_irq::ptr#0 -- vbuz1=_inc_vbuz2 
    ldy.z ptr
    iny
    sty.z ptr_1
    // [108] *((const byte*) PLAYFIELD_SPRITE_PTRS_1+(byte) 1) ← (byte) sprites_irq::ptr#1 -- _deref_pbuc1=vbuz1 
    lda.z ptr_1
    sta PLAYFIELD_SPRITE_PTRS_1+1
    // [109] *((const byte*) PLAYFIELD_SPRITE_PTRS_1+(byte) 2) ← (byte) sprites_irq::ptr#1 -- _deref_pbuc1=vbuz1 
    lda.z ptr_1
    sta PLAYFIELD_SPRITE_PTRS_1+2
    // [110] (byte) sprites_irq::ptr#2 ← ++ (byte) sprites_irq::ptr#1 -- vbuz1=_inc_vbuz2 
    ldy.z ptr_1
    iny
    sty.z ptr_2
    // [111] *((const byte*) PLAYFIELD_SPRITE_PTRS_1+(byte) 3) ← (byte) sprites_irq::ptr#2 -- _deref_pbuc1=vbuz1 
    lda.z ptr_2
    sta PLAYFIELD_SPRITE_PTRS_1+3
    jmp __b2
}
  // File Data
SIN:
.var AMPL = 200-21
    .for(var i=0; i<256; i++) {
  	  .byte 51+AMPL/2+sin(toRadians([i*360]/256))*AMPL/2
    }

.pc = PLAYFIELD_SPRITES "PLAYFIELD_SPRITES"
  .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000))
	// Put the sprites into memory 
	.for(var sy=0;sy<10;sy++) {
	    .var sprite_gfx_y = sy*20
		.for(var sx=0;sx<3;sx++) {
	    	.for (var y=0;y<21; y++) {
	    	    .var gfx_y =  sprite_gfx_y + mod(2100+y-sprite_gfx_y,21)
		    	.for (var c=0; c<3; c++) {
	            	.byte sprites.getSinglecolorByte(sx*3+c,gfx_y)
	            }
	        }
	    	.byte 0
	  	}
	}

.pc = SIN_SPRITE "SIN_SPRITE"
  .fill $40, $ff


REGISTER UPLIFT POTENTIAL REGISTERS
Statement [1] (byte) render_screen_showing ← (byte) 0 [ ] (  [ ] ) always clobbers reg byte a 
Statement [3] (byte) irq_raster_next ← (const byte) IRQ_RASTER_FIRST [ ] (  [ ] ) always clobbers reg byte a 
Statement [4] (byte) irq_sprite_ypos ← (const byte) SPRITES_FIRST_YPOS+(byte) $15 [ ] (  [ ] ) always clobbers reg byte a 
Statement [6] (byte) irq_sprite_ptr ← (const byte) toSpritePtr1_return#0+(byte) 3 [ ] (  [ ] ) always clobbers reg byte a 
Statement [7] (byte) irq_cnt ← (byte) 0 [ ] (  [ ] ) always clobbers reg byte a 
Statement [13] *((const byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ ] ( main:10 [ ] ) always clobbers reg byte a 
Statement [15] *((const byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 [ ] ( main:10 [ ] ) always clobbers reg byte a 
Statement [17] *((const byte*) D018) ← (const byte) main::toD0181_return#0 [ ] ( main:10 [ ] ) always clobbers reg byte a 
Statement [19] *((const byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:10 [ ] ) always clobbers reg byte a 
Statement [21] (byte) main::s2#0 ← (byte) main::s#2 << (byte) 1 [ main::s#2 main::xpos#2 main::ypos#2 main::s2#0 ] ( main:10 [ main::s#2 main::xpos#2 main::ypos#2 main::s2#0 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::s#2 main::s#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:3 [ main::xpos#2 main::xpos#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:4 [ main::ypos#2 main::ypos#1 ]
Statement [22] *((const byte*) SPRITES_XPOS + (byte) main::s2#0) ← (byte) main::xpos#2 [ main::s#2 main::xpos#2 main::ypos#2 main::s2#0 ] ( main:10 [ main::s#2 main::xpos#2 main::ypos#2 main::s2#0 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:15 [ main::s2#0 ]
Statement [23] *((const byte*) SPRITES_YPOS + (byte) main::s2#0) ← (byte) main::ypos#2 [ main::s#2 main::xpos#2 main::ypos#2 ] ( main:10 [ main::s#2 main::xpos#2 main::ypos#2 ] ) always clobbers reg byte a 
Statement [24] (byte~) main::$6 ← (byte) main::s#2 - (byte) 3 [ main::s#2 main::xpos#2 main::ypos#2 main::$6 ] ( main:10 [ main::s#2 main::xpos#2 main::ypos#2 main::$6 ] ) always clobbers reg byte a 
Statement [27] *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (byte) main::s#2) ← (const byte) main::toSpritePtr2_return#0 [ main::s#2 main::xpos#2 main::ypos#2 ] ( main:10 [ main::s#2 main::xpos#2 main::ypos#2 ] ) always clobbers reg byte a 
Statement [28] (byte) main::xpos#1 ← (byte) main::xpos#2 + (byte) $18 [ main::s#2 main::ypos#2 main::xpos#1 ] ( main:10 [ main::s#2 main::ypos#2 main::xpos#1 ] ) always clobbers reg byte a 
Statement [29] (byte) main::ypos#1 ← (byte) main::ypos#2 + (byte) $18 [ main::s#2 main::xpos#1 main::ypos#1 ] ( main:10 [ main::s#2 main::xpos#1 main::ypos#1 ] ) always clobbers reg byte a 
Statement [39] if(*((const byte*) RASTER)!=(byte) $ff) goto loop::@2 [ sin_idx#10 ] ( main:10::loop:35 [ sin_idx#10 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:5 [ sin_idx#10 sin_idx#3 ]
Statement [42] (byte~) loop::$1 ← (byte) loop::s#2 << (byte) 1 [ sin_idx#10 loop::s#2 loop::idx#2 loop::$1 ] ( main:10::loop:35 [ sin_idx#10 loop::s#2 loop::idx#2 loop::$1 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:6 [ loop::s#2 loop::s#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:7 [ loop::idx#2 loop::idx#0 loop::idx#1 ]
Statement [43] *((const byte*) SPRITES_YPOS + (byte~) loop::$1) ← *((const byte*) SIN + (byte) loop::idx#2) [ sin_idx#10 loop::s#2 loop::idx#2 ] ( main:10::loop:35 [ sin_idx#10 loop::s#2 loop::idx#2 ] ) always clobbers reg byte a 
Statement [44] (byte) loop::idx#1 ← (byte) loop::idx#2 + (byte) $a [ sin_idx#10 loop::s#2 loop::idx#1 ] ( main:10::loop:35 [ sin_idx#10 loop::s#2 loop::idx#1 ] ) always clobbers reg byte a 
Statement [49] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER [ ] ( main:10::sprites_irq_init:33 [ ] ) always clobbers reg byte a 
Statement asm { ldaCIA1_INTERRUPT  } always clobbers reg byte a 
Statement [51] *((const byte*) PROCPORT_DDR) ← (const byte) PROCPORT_DDR_MEMORY_MASK [ ] ( main:10::sprites_irq_init:33 [ ] ) always clobbers reg byte a 
Statement [52] *((const byte*) PROCPORT) ← (const byte) PROCPORT_RAM_IO [ ] ( main:10::sprites_irq_init:33 [ ] ) always clobbers reg byte a 
Statement [53] *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR [ ] ( main:10::sprites_irq_init:33 [ ] ) always clobbers reg byte a 
Statement [54] *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) & (byte) $7f [ ] ( main:10::sprites_irq_init:33 [ ] ) always clobbers reg byte a 
Statement [55] *((const byte*) RASTER) ← (const byte) IRQ_RASTER_FIRST [ ] ( main:10::sprites_irq_init:33 [ ] ) always clobbers reg byte a 
Statement [56] *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER [ ] ( main:10::sprites_irq_init:33 [ ] ) always clobbers reg byte a 
Statement [57] *((const void()**) HARDWARE_IRQ) ← &interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() [ ] ( main:10::sprites_irq_init:33 [ ] ) always clobbers reg byte a 
Statement [60] *((const byte*) SPRITES_ENABLE) ← (byte) $f [ ] ( main:10::sprites_init:18 [ ] ) always clobbers reg byte a 
Statement [61] *((const byte*) SPRITES_MC) ← (byte) 0 [ ] ( main:10::sprites_init:18 [ ] ) always clobbers reg byte a 
Statement [62] *((const byte*) SPRITES_EXPAND_Y) ← *((const byte*) SPRITES_MC) [ ] ( main:10::sprites_init:18 [ ] ) always clobbers reg byte a 
Statement [63] *((const byte*) SPRITES_EXPAND_X) ← *((const byte*) SPRITES_EXPAND_Y) [ ] ( main:10::sprites_init:18 [ ] ) always clobbers reg byte a 
Statement [65] (byte) sprites_init::s2#0 ← (byte) sprites_init::s#2 << (byte) 1 [ sprites_init::s#2 sprites_init::xpos#2 sprites_init::s2#0 ] ( main:10::sprites_init:18 [ sprites_init::s#2 sprites_init::xpos#2 sprites_init::s2#0 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:8 [ sprites_init::s#2 sprites_init::s#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:9 [ sprites_init::xpos#2 sprites_init::xpos#1 ]
Statement [66] *((const byte*) SPRITES_XPOS + (byte) sprites_init::s2#0) ← (byte) sprites_init::xpos#2 [ sprites_init::s#2 sprites_init::xpos#2 ] ( main:10::sprites_init:18 [ sprites_init::s#2 sprites_init::xpos#2 ] ) always clobbers reg byte a 
Statement [67] *((const byte*) SPRITES_COLS + (byte) sprites_init::s#2) ← (const byte) BLACK [ sprites_init::s#2 sprites_init::xpos#2 ] ( main:10::sprites_init:18 [ sprites_init::s#2 sprites_init::xpos#2 ] ) always clobbers reg byte a 
Statement [68] (byte) sprites_init::xpos#1 ← (byte) sprites_init::xpos#2 + (byte) $18 [ sprites_init::s#2 sprites_init::xpos#1 ] ( main:10::sprites_init:18 [ sprites_init::s#2 sprites_init::xpos#1 ] ) always clobbers reg byte a 
Statement [80] if(*((const byte*) RASTER)<(byte) sprites_irq::raster_sprite_gfx_modify) goto sprites_irq::@8 [ render_screen_showing irq_sprite_ptr sprites_irq::raster_sprite_gfx_modify ] (  [ render_screen_showing irq_sprite_ptr sprites_irq::raster_sprite_gfx_modify ] ) always clobbers reg byte a 
Statement [82] if((byte) render_screen_showing==(byte) 0) goto sprites_irq::@1 [ sprites_irq::ptr#0 ] (  [ sprites_irq::ptr#0 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:22 [ sprites_irq::ptr#0 ]
Statement [90] if((byte) irq_cnt==(byte) 9) goto sprites_irq::@3 [ irq_cnt ] (  [ irq_cnt ] ) always clobbers reg byte a 
Statement [91] if((byte) irq_cnt==(byte) $a) goto sprites_irq::@4 [ ] (  [ ] ) always clobbers reg byte a 
Statement [92] (byte) irq_raster_next ← (byte) irq_raster_next + (byte) $14 [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a reg byte x 
Statement [93] (byte) irq_sprite_ypos ← (byte) irq_sprite_ypos + (byte) $15 [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a reg byte x 
Statement [94] (byte) irq_sprite_ptr ← (byte) irq_sprite_ptr + (byte) 3 [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a reg byte x 
Statement [95] *((const byte*) RASTER) ← (byte) irq_raster_next [ ] (  [ ] ) always clobbers reg byte a 
Statement [96] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER [ ] (  [ ] ) always clobbers reg byte a 
Statement [97] return  [ ] (  [ ] ) always clobbers reg byte a reg byte x reg byte y 
Statement [98] (byte) irq_cnt ← (byte) 0 [ ] (  [ ] ) always clobbers reg byte a 
Statement [99] (byte) irq_raster_next ← (const byte) IRQ_RASTER_FIRST [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a 
Statement [100] (byte) irq_sprite_ypos ← (byte) irq_sprite_ypos + (byte) $15 [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a reg byte x 
Statement [101] (byte) irq_sprite_ptr ← (byte) irq_sprite_ptr + (byte) 3 [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a reg byte x 
Statement [102] (byte) irq_raster_next ← (byte) irq_raster_next + (byte) $15 [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a reg byte x 
Statement [103] (byte) irq_sprite_ypos ← (const byte) SPRITES_FIRST_YPOS [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a 
Statement [105] (byte) irq_sprite_ptr ← (const byte) sprites_irq::toSpritePtr2_return#0 [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a 
Statement [1] (byte) render_screen_showing ← (byte) 0 [ ] (  [ ] ) always clobbers reg byte a 
Statement [3] (byte) irq_raster_next ← (const byte) IRQ_RASTER_FIRST [ ] (  [ ] ) always clobbers reg byte a 
Statement [4] (byte) irq_sprite_ypos ← (const byte) SPRITES_FIRST_YPOS+(byte) $15 [ ] (  [ ] ) always clobbers reg byte a 
Statement [6] (byte) irq_sprite_ptr ← (const byte) toSpritePtr1_return#0+(byte) 3 [ ] (  [ ] ) always clobbers reg byte a 
Statement [7] (byte) irq_cnt ← (byte) 0 [ ] (  [ ] ) always clobbers reg byte a 
Statement [13] *((const byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ ] ( main:10 [ ] ) always clobbers reg byte a 
Statement [15] *((const byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 [ ] ( main:10 [ ] ) always clobbers reg byte a 
Statement [17] *((const byte*) D018) ← (const byte) main::toD0181_return#0 [ ] ( main:10 [ ] ) always clobbers reg byte a 
Statement [19] *((const byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:10 [ ] ) always clobbers reg byte a 
Statement [21] (byte) main::s2#0 ← (byte) main::s#2 << (byte) 1 [ main::s#2 main::xpos#2 main::ypos#2 main::s2#0 ] ( main:10 [ main::s#2 main::xpos#2 main::ypos#2 main::s2#0 ] ) always clobbers reg byte a 
Statement [22] *((const byte*) SPRITES_XPOS + (byte) main::s2#0) ← (byte) main::xpos#2 [ main::s#2 main::xpos#2 main::ypos#2 main::s2#0 ] ( main:10 [ main::s#2 main::xpos#2 main::ypos#2 main::s2#0 ] ) always clobbers reg byte a 
Statement [23] *((const byte*) SPRITES_YPOS + (byte) main::s2#0) ← (byte) main::ypos#2 [ main::s#2 main::xpos#2 main::ypos#2 ] ( main:10 [ main::s#2 main::xpos#2 main::ypos#2 ] ) always clobbers reg byte a 
Statement [24] (byte~) main::$6 ← (byte) main::s#2 - (byte) 3 [ main::s#2 main::xpos#2 main::ypos#2 main::$6 ] ( main:10 [ main::s#2 main::xpos#2 main::ypos#2 main::$6 ] ) always clobbers reg byte a 
Statement [27] *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (byte) main::s#2) ← (const byte) main::toSpritePtr2_return#0 [ main::s#2 main::xpos#2 main::ypos#2 ] ( main:10 [ main::s#2 main::xpos#2 main::ypos#2 ] ) always clobbers reg byte a 
Statement [28] (byte) main::xpos#1 ← (byte) main::xpos#2 + (byte) $18 [ main::s#2 main::ypos#2 main::xpos#1 ] ( main:10 [ main::s#2 main::ypos#2 main::xpos#1 ] ) always clobbers reg byte a 
Statement [29] (byte) main::ypos#1 ← (byte) main::ypos#2 + (byte) $18 [ main::s#2 main::xpos#1 main::ypos#1 ] ( main:10 [ main::s#2 main::xpos#1 main::ypos#1 ] ) always clobbers reg byte a 
Statement [39] if(*((const byte*) RASTER)!=(byte) $ff) goto loop::@2 [ sin_idx#10 ] ( main:10::loop:35 [ sin_idx#10 ] ) always clobbers reg byte a 
Statement [42] (byte~) loop::$1 ← (byte) loop::s#2 << (byte) 1 [ sin_idx#10 loop::s#2 loop::idx#2 loop::$1 ] ( main:10::loop:35 [ sin_idx#10 loop::s#2 loop::idx#2 loop::$1 ] ) always clobbers reg byte a 
Statement [43] *((const byte*) SPRITES_YPOS + (byte~) loop::$1) ← *((const byte*) SIN + (byte) loop::idx#2) [ sin_idx#10 loop::s#2 loop::idx#2 ] ( main:10::loop:35 [ sin_idx#10 loop::s#2 loop::idx#2 ] ) always clobbers reg byte a 
Statement [44] (byte) loop::idx#1 ← (byte) loop::idx#2 + (byte) $a [ sin_idx#10 loop::s#2 loop::idx#1 ] ( main:10::loop:35 [ sin_idx#10 loop::s#2 loop::idx#1 ] ) always clobbers reg byte a 
Statement [49] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER [ ] ( main:10::sprites_irq_init:33 [ ] ) always clobbers reg byte a 
Statement asm { ldaCIA1_INTERRUPT  } always clobbers reg byte a 
Statement [51] *((const byte*) PROCPORT_DDR) ← (const byte) PROCPORT_DDR_MEMORY_MASK [ ] ( main:10::sprites_irq_init:33 [ ] ) always clobbers reg byte a 
Statement [52] *((const byte*) PROCPORT) ← (const byte) PROCPORT_RAM_IO [ ] ( main:10::sprites_irq_init:33 [ ] ) always clobbers reg byte a 
Statement [53] *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR [ ] ( main:10::sprites_irq_init:33 [ ] ) always clobbers reg byte a 
Statement [54] *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) & (byte) $7f [ ] ( main:10::sprites_irq_init:33 [ ] ) always clobbers reg byte a 
Statement [55] *((const byte*) RASTER) ← (const byte) IRQ_RASTER_FIRST [ ] ( main:10::sprites_irq_init:33 [ ] ) always clobbers reg byte a 
Statement [56] *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER [ ] ( main:10::sprites_irq_init:33 [ ] ) always clobbers reg byte a 
Statement [57] *((const void()**) HARDWARE_IRQ) ← &interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() [ ] ( main:10::sprites_irq_init:33 [ ] ) always clobbers reg byte a 
Statement [60] *((const byte*) SPRITES_ENABLE) ← (byte) $f [ ] ( main:10::sprites_init:18 [ ] ) always clobbers reg byte a 
Statement [61] *((const byte*) SPRITES_MC) ← (byte) 0 [ ] ( main:10::sprites_init:18 [ ] ) always clobbers reg byte a 
Statement [62] *((const byte*) SPRITES_EXPAND_Y) ← *((const byte*) SPRITES_MC) [ ] ( main:10::sprites_init:18 [ ] ) always clobbers reg byte a 
Statement [63] *((const byte*) SPRITES_EXPAND_X) ← *((const byte*) SPRITES_EXPAND_Y) [ ] ( main:10::sprites_init:18 [ ] ) always clobbers reg byte a 
Statement [65] (byte) sprites_init::s2#0 ← (byte) sprites_init::s#2 << (byte) 1 [ sprites_init::s#2 sprites_init::xpos#2 sprites_init::s2#0 ] ( main:10::sprites_init:18 [ sprites_init::s#2 sprites_init::xpos#2 sprites_init::s2#0 ] ) always clobbers reg byte a 
Statement [66] *((const byte*) SPRITES_XPOS + (byte) sprites_init::s2#0) ← (byte) sprites_init::xpos#2 [ sprites_init::s#2 sprites_init::xpos#2 ] ( main:10::sprites_init:18 [ sprites_init::s#2 sprites_init::xpos#2 ] ) always clobbers reg byte a 
Statement [67] *((const byte*) SPRITES_COLS + (byte) sprites_init::s#2) ← (const byte) BLACK [ sprites_init::s#2 sprites_init::xpos#2 ] ( main:10::sprites_init:18 [ sprites_init::s#2 sprites_init::xpos#2 ] ) always clobbers reg byte a 
Statement [68] (byte) sprites_init::xpos#1 ← (byte) sprites_init::xpos#2 + (byte) $18 [ sprites_init::s#2 sprites_init::xpos#1 ] ( main:10::sprites_init:18 [ sprites_init::s#2 sprites_init::xpos#1 ] ) always clobbers reg byte a 
Statement [80] if(*((const byte*) RASTER)<(byte) sprites_irq::raster_sprite_gfx_modify) goto sprites_irq::@8 [ render_screen_showing irq_sprite_ptr sprites_irq::raster_sprite_gfx_modify ] (  [ render_screen_showing irq_sprite_ptr sprites_irq::raster_sprite_gfx_modify ] ) always clobbers reg byte a 
Statement [82] if((byte) render_screen_showing==(byte) 0) goto sprites_irq::@1 [ sprites_irq::ptr#0 ] (  [ sprites_irq::ptr#0 ] ) always clobbers reg byte a 
Statement [90] if((byte) irq_cnt==(byte) 9) goto sprites_irq::@3 [ irq_cnt ] (  [ irq_cnt ] ) always clobbers reg byte a 
Statement [91] if((byte) irq_cnt==(byte) $a) goto sprites_irq::@4 [ ] (  [ ] ) always clobbers reg byte a 
Statement [92] (byte) irq_raster_next ← (byte) irq_raster_next + (byte) $14 [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a reg byte x 
Statement [93] (byte) irq_sprite_ypos ← (byte) irq_sprite_ypos + (byte) $15 [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a reg byte x 
Statement [94] (byte) irq_sprite_ptr ← (byte) irq_sprite_ptr + (byte) 3 [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a reg byte x 
Statement [95] *((const byte*) RASTER) ← (byte) irq_raster_next [ ] (  [ ] ) always clobbers reg byte a 
Statement [96] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER [ ] (  [ ] ) always clobbers reg byte a 
Statement [97] return  [ ] (  [ ] ) always clobbers reg byte a reg byte x reg byte y 
Statement [98] (byte) irq_cnt ← (byte) 0 [ ] (  [ ] ) always clobbers reg byte a 
Statement [99] (byte) irq_raster_next ← (const byte) IRQ_RASTER_FIRST [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a 
Statement [100] (byte) irq_sprite_ypos ← (byte) irq_sprite_ypos + (byte) $15 [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a reg byte x 
Statement [101] (byte) irq_sprite_ptr ← (byte) irq_sprite_ptr + (byte) 3 [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a reg byte x 
Statement [102] (byte) irq_raster_next ← (byte) irq_raster_next + (byte) $15 [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a reg byte x 
Statement [103] (byte) irq_sprite_ypos ← (const byte) SPRITES_FIRST_YPOS [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a 
Statement [105] (byte) irq_sprite_ptr ← (const byte) sprites_irq::toSpritePtr2_return#0 [ irq_raster_next ] (  [ irq_raster_next ] ) always clobbers reg byte a 
Potential registers zp[1]:2 [ main::s#2 main::s#1 ] : zp[1]:2 , reg byte x , reg byte y , 
Potential registers zp[1]:3 [ main::xpos#2 main::xpos#1 ] : zp[1]:3 , reg byte x , reg byte y , 
Potential registers zp[1]:4 [ main::ypos#2 main::ypos#1 ] : zp[1]:4 , reg byte x , reg byte y , 
Potential registers zp[1]:5 [ sin_idx#10 sin_idx#3 ] : zp[1]:5 , reg byte x , reg byte y , 
Potential registers zp[1]:6 [ loop::s#2 loop::s#1 ] : zp[1]:6 , reg byte x , reg byte y , 
Potential registers zp[1]:7 [ loop::idx#2 loop::idx#0 loop::idx#1 ] : zp[1]:7 , reg byte x , reg byte y , 
Potential registers zp[1]:8 [ sprites_init::s#2 sprites_init::s#1 ] : zp[1]:8 , reg byte x , reg byte y , 
Potential registers zp[1]:9 [ sprites_init::xpos#2 sprites_init::xpos#1 ] : zp[1]:9 , reg byte x , reg byte y , 
Potential registers zp[1]:10 [ render_screen_showing ] : zp[1]:10 , 
Potential registers zp[1]:11 [ irq_raster_next ] : zp[1]:11 , 
Potential registers zp[1]:12 [ irq_sprite_ypos ] : zp[1]:12 , 
Potential registers zp[1]:13 [ irq_sprite_ptr ] : zp[1]:13 , 
Potential registers zp[1]:14 [ irq_cnt ] : zp[1]:14 , 
Potential registers zp[1]:15 [ main::s2#0 ] : zp[1]:15 , reg byte x , reg byte y , 
Potential registers zp[1]:16 [ main::$6 ] : zp[1]:16 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:17 [ loop::$1 ] : zp[1]:17 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:18 [ sprites_init::s2#0 ] : zp[1]:18 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:19 [ sprites_irq::ypos#0 ] : zp[1]:19 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:20 [ sprites_irq::$0 ] : zp[1]:20 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:21 [ sprites_irq::raster_sprite_gfx_modify ] : zp[1]:21 , 
Potential registers zp[1]:22 [ sprites_irq::ptr#0 ] : zp[1]:22 , reg byte x , reg byte y , 
Potential registers zp[1]:23 [ sprites_irq::ptr#3 ] : zp[1]:23 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:24 [ sprites_irq::ptr#4 ] : zp[1]:24 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:25 [ sprites_irq::ptr#1 ] : zp[1]:25 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:26 [ sprites_irq::ptr#2 ] : zp[1]:26 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [loop] 227.25: zp[1]:6 [ loop::s#2 loop::s#1 ] 202: zp[1]:17 [ loop::$1 ] 194: zp[1]:7 [ loop::idx#2 loop::idx#0 loop::idx#1 ] 
Uplift Scope [main] 23.1: zp[1]:2 [ main::s#2 main::s#1 ] 22: zp[1]:16 [ main::$6 ] 16.5: zp[1]:15 [ main::s2#0 ] 11: zp[1]:4 [ main::ypos#2 main::ypos#1 ] 9.62: zp[1]:3 [ main::xpos#2 main::xpos#1 ] 
Uplift Scope [sprites_init] 25.3: zp[1]:8 [ sprites_init::s#2 sprites_init::s#1 ] 22: zp[1]:18 [ sprites_init::s2#0 ] 15.58: zp[1]:9 [ sprites_init::xpos#2 sprites_init::xpos#1 ] 
Uplift Scope [] 25.67: zp[1]:5 [ sin_idx#10 sin_idx#3 ] 14: zp[1]:12 [ irq_sprite_ypos ] 6: zp[1]:14 [ irq_cnt ] 1.56: zp[1]:13 [ irq_sprite_ptr ] 1: zp[1]:11 [ irq_raster_next ] 0.4: zp[1]:10 [ render_screen_showing ] 
Uplift Scope [sprites_irq] 6.5: zp[1]:21 [ sprites_irq::raster_sprite_gfx_modify ] 4: zp[1]:20 [ sprites_irq::$0 ] 4: zp[1]:24 [ sprites_irq::ptr#4 ] 4: zp[1]:26 [ sprites_irq::ptr#2 ] 2.67: zp[1]:23 [ sprites_irq::ptr#3 ] 2.67: zp[1]:25 [ sprites_irq::ptr#1 ] 2.5: zp[1]:19 [ sprites_irq::ypos#0 ] 2.5: zp[1]:22 [ sprites_irq::ptr#0 ] 
Uplift Scope [sprites_irq_init] 

Uplifting [loop] best 13962 combination zp[1]:6 [ loop::s#2 loop::s#1 ] reg byte a [ loop::$1 ] reg byte x [ loop::idx#2 loop::idx#0 loop::idx#1 ] 
Uplifting [main] best 13682 combination reg byte y [ main::s#2 main::s#1 ] reg byte a [ main::$6 ] reg byte x [ main::s2#0 ] zp[1]:4 [ main::ypos#2 main::ypos#1 ] zp[1]:3 [ main::xpos#2 main::xpos#1 ] 
Limited combination testing to 100 combinations of 324 possible.
Uplifting [sprites_init] best 13512 combination reg byte y [ sprites_init::s#2 sprites_init::s#1 ] reg byte x [ sprites_init::s2#0 ] zp[1]:9 [ sprites_init::xpos#2 sprites_init::xpos#1 ] 
Uplifting [] best 13512 combination zp[1]:5 [ sin_idx#10 sin_idx#3 ] zp[1]:12 [ irq_sprite_ypos ] zp[1]:14 [ irq_cnt ] zp[1]:13 [ irq_sprite_ptr ] zp[1]:11 [ irq_raster_next ] zp[1]:10 [ render_screen_showing ] 
Uplifting [sprites_irq] best 13488 combination zp[1]:21 [ sprites_irq::raster_sprite_gfx_modify ] reg byte x [ sprites_irq::$0 ] reg byte a [ sprites_irq::ptr#4 ] reg byte a [ sprites_irq::ptr#2 ] reg byte a [ sprites_irq::ptr#3 ] zp[1]:25 [ sprites_irq::ptr#1 ] zp[1]:19 [ sprites_irq::ypos#0 ] zp[1]:22 [ sprites_irq::ptr#0 ] 
Limited combination testing to 100 combinations of 12288 possible.
Uplifting [sprites_irq_init] best 13488 combination 
Attempting to uplift remaining variables inzp[1]:6 [ loop::s#2 loop::s#1 ]
Uplifting [loop] best 13488 combination zp[1]:6 [ loop::s#2 loop::s#1 ] 
Attempting to uplift remaining variables inzp[1]:5 [ sin_idx#10 sin_idx#3 ]
Uplifting [] best 13488 combination zp[1]:5 [ sin_idx#10 sin_idx#3 ] 
Attempting to uplift remaining variables inzp[1]:9 [ sprites_init::xpos#2 sprites_init::xpos#1 ]
Uplifting [sprites_init] best 13488 combination zp[1]:9 [ sprites_init::xpos#2 sprites_init::xpos#1 ] 
Attempting to uplift remaining variables inzp[1]:12 [ irq_sprite_ypos ]
Uplifting [] best 13488 combination zp[1]:12 [ irq_sprite_ypos ] 
Attempting to uplift remaining variables inzp[1]:4 [ main::ypos#2 main::ypos#1 ]
Uplifting [main] best 13488 combination zp[1]:4 [ main::ypos#2 main::ypos#1 ] 
Attempting to uplift remaining variables inzp[1]:3 [ main::xpos#2 main::xpos#1 ]
Uplifting [main] best 13488 combination zp[1]:3 [ main::xpos#2 main::xpos#1 ] 
Attempting to uplift remaining variables inzp[1]:21 [ sprites_irq::raster_sprite_gfx_modify ]
Uplifting [sprites_irq] best 13488 combination zp[1]:21 [ sprites_irq::raster_sprite_gfx_modify ] 
Attempting to uplift remaining variables inzp[1]:14 [ irq_cnt ]
Uplifting [] best 13488 combination zp[1]:14 [ irq_cnt ] 
Attempting to uplift remaining variables inzp[1]:25 [ sprites_irq::ptr#1 ]
Uplifting [sprites_irq] best 13476 combination reg byte x [ sprites_irq::ptr#1 ] 
Attempting to uplift remaining variables inzp[1]:19 [ sprites_irq::ypos#0 ]
Uplifting [sprites_irq] best 13461 combination reg byte a [ sprites_irq::ypos#0 ] 
Attempting to uplift remaining variables inzp[1]:22 [ sprites_irq::ptr#0 ]
Uplifting [sprites_irq] best 13446 combination reg byte x [ sprites_irq::ptr#0 ] 
Attempting to uplift remaining variables inzp[1]:13 [ irq_sprite_ptr ]
Uplifting [] best 13446 combination zp[1]:13 [ irq_sprite_ptr ] 
Attempting to uplift remaining variables inzp[1]:11 [ irq_raster_next ]
Uplifting [] best 13446 combination zp[1]:11 [ irq_raster_next ] 
Attempting to uplift remaining variables inzp[1]:10 [ render_screen_showing ]
Uplifting [] best 13446 combination zp[1]:10 [ render_screen_showing ] 
Coalescing zero page register [ zp[1]:5 [ sin_idx#10 sin_idx#3 ] ] with [ zp[1]:3 [ main::xpos#2 main::xpos#1 ] ]
Coalescing zero page register [ zp[1]:6 [ loop::s#2 loop::s#1 ] ] with [ zp[1]:4 [ main::ypos#2 main::ypos#1 ] ]
Coalescing zero page register [ zp[1]:9 [ sprites_init::xpos#2 sprites_init::xpos#1 ] ] with [ zp[1]:5 [ sin_idx#10 sin_idx#3 main::xpos#2 main::xpos#1 ] ]
Allocated (was zp[1]:6) zp[1]:2 [ loop::s#2 loop::s#1 main::ypos#2 main::ypos#1 ]
Allocated (was zp[1]:9) zp[1]:3 [ sprites_init::xpos#2 sprites_init::xpos#1 sin_idx#10 sin_idx#3 main::xpos#2 main::xpos#1 ]
Allocated (was zp[1]:10) zp[1]:4 [ render_screen_showing ]
Allocated (was zp[1]:11) zp[1]:5 [ irq_raster_next ]
Allocated (was zp[1]:12) zp[1]:6 [ irq_sprite_ypos ]
Allocated (was zp[1]:13) zp[1]:7 [ irq_sprite_ptr ]
Allocated (was zp[1]:14) zp[1]:8 [ irq_cnt ]
Allocated (was zp[1]:21) zp[1]:9 [ sprites_irq::raster_sprite_gfx_modify ]
Interrupt procedure sprites_irq clobbers AXCNZV
Removing interrupt register storage sty regy+1 in CHU127 entry interrupt(HARDWARE_CLOBBER)
Removing interrupt register storage regy: in CHU161 [97] return  - exit interrupt(HARDWARE_CLOBBER)
Removing interrupt register storage ldy #00 in CHU161 [97] return  - exit interrupt(HARDWARE_CLOBBER)

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  // Processor port data direction register
  .label PROCPORT_DDR = 0
  // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written
  .const PROCPORT_DDR_MEMORY_MASK = 7
  // Processor Port Register controlling RAM/ROM configuration and the datasette
  .label PROCPORT = 1
  // RAM in $A000, $E000 I/O in $D000
  .const PROCPORT_RAM_IO = 5
  // The offset of the sprite pointers from the screen start address
  .const SPRITE_PTRS = $3f8
  .label SPRITES_XPOS = $d000
  .label SPRITES_YPOS = $d001
  .label RASTER = $d012
  .label SPRITES_ENABLE = $d015
  .label SPRITES_EXPAND_Y = $d017
  .label SPRITES_MC = $d01c
  .label SPRITES_EXPAND_X = $d01d
  .label SPRITES_COLS = $d027
  .label VIC_CONTROL = $d011
  .label D018 = $d018
  // VIC II IRQ Status Register
  .label IRQ_STATUS = $d019
  // VIC II IRQ Enable Register
  .label IRQ_ENABLE = $d01a
  // Bits for the IRQ Status/Enable Registers
  .const IRQ_RASTER = 1
  // CIA#1 Interrupt Status & Control Register
  .label CIA1_INTERRUPT = $dc0d
  // CIA#2 Port A: Serial bus, RS-232, VIC memory bank
  .label CIA2_PORT_A = $dd00
  // CIA #2 Port A data direction register.
  .label CIA2_PORT_A_DDR = $dd02
  // Value that disables all CIA interrupts when stored to the CIA Interrupt registers
  .const CIA_INTERRUPT_CLEAR = $7f
  // The vector used when the HARDWARE serves IRQ interrupts
  .label HARDWARE_IRQ = $fffe
  // The colors of the C64
  .const BLACK = 0
  // Address of the first screen
  .label PLAYFIELD_SCREEN_1 = $400
  // Address of the second screen
  .label PLAYFIELD_SCREEN_2 = $2c00
  // Screen Sprite pointers on screen 1
  .label PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+SPRITE_PTRS
  // Screen Sprite pointers on screen 2
  .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS
  // Address of the sprites covering the playfield
  .label PLAYFIELD_SPRITES = $2000
  // Address of the charset
  .label PLAYFIELD_CHARSET = $2800
  // The Y-position of the first sprite row
  .const SPRITES_FIRST_YPOS = $31
  // The line of the first IRQ
  .const IRQ_RASTER_FIRST = SPRITES_FIRST_YPOS+$13
  .label SIN_SPRITE = $2800
  .const toSpritePtr1_return = PLAYFIELD_SPRITES/$40
  .label render_screen_showing = 4
  .label irq_raster_next = 5
  .label irq_sprite_ypos = 6
  .label irq_sprite_ptr = 7
  .label irq_cnt = 8
  .label sin_idx = 3
  // @begin
__bbegin:
  jmp __b1
  // @1
__b1:
  // [1] (byte) render_screen_showing ← (byte) 0 -- vbuz1=vbuc1 
  // The screen currently being showed to the user. 0x00 for screen 1 / 0x20 for screen 2.
  lda #0
  sta.z render_screen_showing
  // kickasm(location (const byte*) PLAYFIELD_SPRITES) {{ .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000)) 	// Put the sprites into memory  	.for(var sy=0;sy<10;sy++) { 	    .var sprite_gfx_y = sy*20 		.for(var sx=0;sx<3;sx++) { 	    	.for (var y=0;y<21; y++) { 	    	    .var gfx_y =  sprite_gfx_y + mod(2100+y-sprite_gfx_y,21) 		    	.for (var c=0; c<3; c++) { 	            	.byte sprites.getSinglecolorByte(sx*3+c,gfx_y) 	            } 	        } 	    	.byte 0 	  	} 	}  }}
  jmp __b2
  // @2
__b2:
  // [3] (byte) irq_raster_next ← (const byte) IRQ_RASTER_FIRST -- vbuz1=vbuc1 
  // The raster line of the next IRQ
  lda #IRQ_RASTER_FIRST
  sta.z irq_raster_next
  // [4] (byte) irq_sprite_ypos ← (const byte) SPRITES_FIRST_YPOS+(byte) $15 -- vbuz1=vbuc1 
  // Y-pos of the sprites on the next IRQ
  lda #SPRITES_FIRST_YPOS+$15
  sta.z irq_sprite_ypos
  // [5] phi from @2 to toSpritePtr1 [phi:@2->toSpritePtr1]
toSpritePtr1_from___b2:
  jmp toSpritePtr1
  // toSpritePtr1
toSpritePtr1:
  jmp __b5
  // @5
__b5:
  // [6] (byte) irq_sprite_ptr ← (const byte) toSpritePtr1_return#0+(byte) 3 -- vbuz1=vbuc1 
  // Index of the sprites to show on the next IRQ
  lda #toSpritePtr1_return+3
  sta.z irq_sprite_ptr
  // [7] (byte) irq_cnt ← (byte) 0 -- vbuz1=vbuc1 
  // Counting the 10 IRQs
  lda #0
  sta.z irq_cnt
  jmp __b3
  // @3
__b3:
  // kickasm(location (const byte*) SIN_SPRITE) {{ .fill $40, $ff  }}
  // [9] phi from @3 to @4 [phi:@3->@4]
__b4_from___b3:
  jmp __b4
  // @4
__b4:
  // [10] call main 
  // [12] phi from @4 to main [phi:@4->main]
main_from___b4:
  jsr main
  // [11] phi from @4 to @end [phi:@4->@end]
__bend_from___b4:
  jmp __bend
  // @end
__bend:
  // main
main: {
    .const toSpritePtr2_return = SIN_SPRITE/$40
    .const vicSelectGfxBank1_toDd001_return = 3
    .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)*4)|(>PLAYFIELD_CHARSET)/4&$f
    .label xpos = 3
    .label ypos = 2
    jmp vicSelectGfxBank1
    // main::vicSelectGfxBank1
  vicSelectGfxBank1:
    // [13] *((const byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2 
    lda #3
    sta CIA2_PORT_A_DDR
    // [14] phi from main::vicSelectGfxBank1 to main::vicSelectGfxBank1_toDd001 [phi:main::vicSelectGfxBank1->main::vicSelectGfxBank1_toDd001]
  vicSelectGfxBank1_toDd001_from_vicSelectGfxBank1:
    jmp vicSelectGfxBank1_toDd001
    // main::vicSelectGfxBank1_toDd001
  vicSelectGfxBank1_toDd001:
    jmp vicSelectGfxBank1___b1
    // main::vicSelectGfxBank1_@1
  vicSelectGfxBank1___b1:
    // [15] *((const byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 -- _deref_pbuc1=vbuc2 
    lda #vicSelectGfxBank1_toDd001_return
    sta CIA2_PORT_A
    // [16] phi from main::vicSelectGfxBank1_@1 to main::toD0181 [phi:main::vicSelectGfxBank1_@1->main::toD0181]
  toD0181_from_vicSelectGfxBank1___b1:
    jmp toD0181
    // main::toD0181
  toD0181:
    jmp __b3
    // main::@3
  __b3:
    // [17] *((const byte*) D018) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0181_return
    sta D018
    // [18] call sprites_init 
    jsr sprites_init
    jmp __b5
    // main::@5
  __b5:
    // [19] *((const byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2 
    lda #$ff
    sta SPRITES_ENABLE
    // [20] phi from main::@5 to main::@1 [phi:main::@5->main::@1]
  __b1_from___b5:
    // [20] phi (byte) main::ypos#2 = (byte) $32 [phi:main::@5->main::@1#0] -- vbuz1=vbuc1 
    lda #$32
    sta.z ypos
    // [20] phi (byte) main::xpos#2 = (byte) $18 [phi:main::@5->main::@1#1] -- vbuz1=vbuc1 
    lda #$18
    sta.z xpos
    // [20] phi (byte) main::s#2 = (byte) 4 [phi:main::@5->main::@1#2] -- vbuyy=vbuc1 
    ldy #4
    jmp __b1
    // [20] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
  __b1_from___b4:
    // [20] phi (byte) main::ypos#2 = (byte) main::ypos#1 [phi:main::@4->main::@1#0] -- register_copy 
    // [20] phi (byte) main::xpos#2 = (byte) main::xpos#1 [phi:main::@4->main::@1#1] -- register_copy 
    // [20] phi (byte) main::s#2 = (byte) main::s#1 [phi:main::@4->main::@1#2] -- register_copy 
    jmp __b1
    // main::@1
  __b1:
    // [21] (byte) main::s2#0 ← (byte) main::s#2 << (byte) 1 -- vbuxx=vbuyy_rol_1 
    tya
    asl
    tax
    // [22] *((const byte*) SPRITES_XPOS + (byte) main::s2#0) ← (byte) main::xpos#2 -- pbuc1_derefidx_vbuxx=vbuz1 
    lda.z xpos
    sta SPRITES_XPOS,x
    // [23] *((const byte*) SPRITES_YPOS + (byte) main::s2#0) ← (byte) main::ypos#2 -- pbuc1_derefidx_vbuxx=vbuz1 
    lda.z ypos
    sta SPRITES_YPOS,x
    // [24] (byte~) main::$6 ← (byte) main::s#2 - (byte) 3 -- vbuaa=vbuyy_minus_vbuc1 
    tya
    sec
    sbc #3
    // [25] *((const byte*) SPRITES_COLS + (byte) main::s#2) ← (byte~) main::$6 -- pbuc1_derefidx_vbuyy=vbuaa 
    sta SPRITES_COLS,y
    // [26] phi from main::@1 to main::toSpritePtr2 [phi:main::@1->main::toSpritePtr2]
  toSpritePtr2_from___b1:
    jmp toSpritePtr2
    // main::toSpritePtr2
  toSpritePtr2:
    jmp __b4
    // main::@4
  __b4:
    // [27] *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (byte) main::s#2) ← (const byte) main::toSpritePtr2_return#0 -- pbuc1_derefidx_vbuyy=vbuc2 
    lda #toSpritePtr2_return
    sta PLAYFIELD_SPRITE_PTRS_1,y
    // [28] (byte) main::xpos#1 ← (byte) main::xpos#2 + (byte) $18 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z xpos
    axs #-[$18]
    stx.z xpos
    // [29] (byte) main::ypos#1 ← (byte) main::ypos#2 + (byte) $18 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z ypos
    axs #-[$18]
    stx.z ypos
    // [30] (byte) main::s#1 ← ++ (byte) main::s#2 -- vbuyy=_inc_vbuyy 
    iny
    // [31] if((byte) main::s#1!=(byte) 8) goto main::@1 -- vbuyy_neq_vbuc1_then_la1 
    cpy #8
    bne __b1_from___b4
    // [32] phi from main::@4 to main::@2 [phi:main::@4->main::@2]
  __b2_from___b4:
    jmp __b2
    // main::@2
  __b2:
    // [33] call sprites_irq_init 
    jsr sprites_irq_init
    // [34] phi from main::@2 to main::@6 [phi:main::@2->main::@6]
  __b6_from___b2:
    jmp __b6
    // main::@6
  __b6:
    // [35] call loop 
    // [37] phi from main::@6 to loop [phi:main::@6->loop]
  loop_from___b6:
    jsr loop
    jmp __breturn
    // main::@return
  __breturn:
    // [36] return 
    rts
}
  // loop
loop: {
    .label s = 2
    // [38] phi from loop to loop::@1 [phi:loop->loop::@1]
  __b1_from_loop:
    // [38] phi (byte) sin_idx#10 = (byte) 0 [phi:loop->loop::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z sin_idx
    jmp __b1
    // loop::@1
  __b1:
    jmp __b2
    // loop::@2
  __b2:
    // [39] if(*((const byte*) RASTER)!=(byte) $ff) goto loop::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$ff
    cmp RASTER
    bne __b2
    jmp __b3
    // loop::@3
  __b3:
    // [40] (byte) loop::idx#0 ← (byte) sin_idx#10 -- vbuxx=vbuz1 
    ldx.z sin_idx
    // [41] phi from loop::@3 to loop::@4 [phi:loop::@3->loop::@4]
  __b4_from___b3:
    // [41] phi (byte) loop::idx#2 = (byte) loop::idx#0 [phi:loop::@3->loop::@4#0] -- register_copy 
    // [41] phi (byte) loop::s#2 = (byte) 4 [phi:loop::@3->loop::@4#1] -- vbuz1=vbuc1 
    lda #4
    sta.z s
    jmp __b4
    // [41] phi from loop::@4 to loop::@4 [phi:loop::@4->loop::@4]
  __b4_from___b4:
    // [41] phi (byte) loop::idx#2 = (byte) loop::idx#1 [phi:loop::@4->loop::@4#0] -- register_copy 
    // [41] phi (byte) loop::s#2 = (byte) loop::s#1 [phi:loop::@4->loop::@4#1] -- register_copy 
    jmp __b4
    // loop::@4
  __b4:
    // [42] (byte~) loop::$1 ← (byte) loop::s#2 << (byte) 1 -- vbuaa=vbuz1_rol_1 
    lda.z s
    asl
    // [43] *((const byte*) SPRITES_YPOS + (byte~) loop::$1) ← *((const byte*) SIN + (byte) loop::idx#2) -- pbuc1_derefidx_vbuaa=pbuc2_derefidx_vbuxx 
    tay
    lda SIN,x
    sta SPRITES_YPOS,y
    // [44] (byte) loop::idx#1 ← (byte) loop::idx#2 + (byte) $a -- vbuxx=vbuxx_plus_vbuc1 
    txa
    axs #-[$a]
    // [45] (byte) loop::s#1 ← ++ (byte) loop::s#2 -- vbuz1=_inc_vbuz1 
    inc.z s
    // [46] if((byte) loop::s#1!=(byte) 8) goto loop::@4 -- vbuz1_neq_vbuc1_then_la1 
    lda #8
    cmp.z s
    bne __b4_from___b4
    jmp __b5
    // loop::@5
  __b5:
    // [47] (byte) sin_idx#3 ← ++ (byte) sin_idx#10 -- vbuz1=_inc_vbuz1 
    inc.z sin_idx
    // [38] phi from loop::@5 to loop::@1 [phi:loop::@5->loop::@1]
  __b1_from___b5:
    // [38] phi (byte) sin_idx#10 = (byte) sin_idx#3 [phi:loop::@5->loop::@1#0] -- register_copy 
    jmp __b1
}
  // sprites_irq_init
// Setup the IRQ
sprites_irq_init: {
    // asm { sei  }
    sei
    // [49] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 
    // Acknowledge any IRQ and setup the next one
    lda #IRQ_RASTER
    sta IRQ_STATUS
    // asm { ldaCIA1_INTERRUPT  }
    lda CIA1_INTERRUPT
    // [51] *((const byte*) PROCPORT_DDR) ← (const byte) PROCPORT_DDR_MEMORY_MASK -- _deref_pbuc1=vbuc2 
    // Disable kernal & basic
    lda #PROCPORT_DDR_MEMORY_MASK
    sta PROCPORT_DDR
    // [52] *((const byte*) PROCPORT) ← (const byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2 
    lda #PROCPORT_RAM_IO
    sta PROCPORT
    // [53] *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 
    // Disable CIA 1 Timer IRQ
    lda #CIA_INTERRUPT_CLEAR
    sta CIA1_INTERRUPT
    // [54] *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 
    // Set raster line
    lda #$7f
    and VIC_CONTROL
    sta VIC_CONTROL
    // [55] *((const byte*) RASTER) ← (const byte) IRQ_RASTER_FIRST -- _deref_pbuc1=vbuc2 
    lda #IRQ_RASTER_FIRST
    sta RASTER
    // [56] *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 
    // Enable Raster Interrupt
    lda #IRQ_RASTER
    sta IRQ_ENABLE
    // [57] *((const void()**) HARDWARE_IRQ) ← &interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() -- _deref_pptc1=pprc2 
    // Set the IRQ routine
    lda #<sprites_irq
    sta HARDWARE_IRQ
    lda #>sprites_irq
    sta HARDWARE_IRQ+1
    // asm { cli  }
    cli
    jmp __breturn
    // sprites_irq_init::@return
  __breturn:
    // [59] return 
    rts
}
  // sprites_init
// Setup the sprites
sprites_init: {
    .label xpos = 3
    // [60] *((const byte*) SPRITES_ENABLE) ← (byte) $f -- _deref_pbuc1=vbuc2 
    lda #$f
    sta SPRITES_ENABLE
    // [61] *((const byte*) SPRITES_MC) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SPRITES_MC
    // [62] *((const byte*) SPRITES_EXPAND_Y) ← *((const byte*) SPRITES_MC) -- _deref_pbuc1=_deref_pbuc2 
    lda SPRITES_MC
    sta SPRITES_EXPAND_Y
    // [63] *((const byte*) SPRITES_EXPAND_X) ← *((const byte*) SPRITES_EXPAND_Y) -- _deref_pbuc1=_deref_pbuc2 
    lda SPRITES_EXPAND_Y
    sta SPRITES_EXPAND_X
    // [64] phi from sprites_init to sprites_init::@1 [phi:sprites_init->sprites_init::@1]
  __b1_from_sprites_init:
    // [64] phi (byte) sprites_init::xpos#2 = (byte)(number) $18+(number) $f*(number) 8 [phi:sprites_init->sprites_init::@1#0] -- vbuz1=vbuc1 
    lda #$18+$f*8
    sta.z xpos
    // [64] phi (byte) sprites_init::s#2 = (byte) 0 [phi:sprites_init->sprites_init::@1#1] -- vbuyy=vbuc1 
    ldy #0
    jmp __b1
    // [64] phi from sprites_init::@1 to sprites_init::@1 [phi:sprites_init::@1->sprites_init::@1]
  __b1_from___b1:
    // [64] phi (byte) sprites_init::xpos#2 = (byte) sprites_init::xpos#1 [phi:sprites_init::@1->sprites_init::@1#0] -- register_copy 
    // [64] phi (byte) sprites_init::s#2 = (byte) sprites_init::s#1 [phi:sprites_init::@1->sprites_init::@1#1] -- register_copy 
    jmp __b1
    // sprites_init::@1
  __b1:
    // [65] (byte) sprites_init::s2#0 ← (byte) sprites_init::s#2 << (byte) 1 -- vbuxx=vbuyy_rol_1 
    tya
    asl
    tax
    // [66] *((const byte*) SPRITES_XPOS + (byte) sprites_init::s2#0) ← (byte) sprites_init::xpos#2 -- pbuc1_derefidx_vbuxx=vbuz1 
    lda.z xpos
    sta SPRITES_XPOS,x
    // [67] *((const byte*) SPRITES_COLS + (byte) sprites_init::s#2) ← (const byte) BLACK -- pbuc1_derefidx_vbuyy=vbuc2 
    lda #BLACK
    sta SPRITES_COLS,y
    // [68] (byte) sprites_init::xpos#1 ← (byte) sprites_init::xpos#2 + (byte) $18 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z xpos
    axs #-[$18]
    stx.z xpos
    // [69] (byte) sprites_init::s#1 ← ++ (byte) sprites_init::s#2 -- vbuyy=_inc_vbuyy 
    iny
    // [70] if((byte) sprites_init::s#1!=(byte) 4) goto sprites_init::@1 -- vbuyy_neq_vbuc1_then_la1 
    cpy #4
    bne __b1_from___b1
    jmp __breturn
    // sprites_init::@return
  __breturn:
    // [71] return 
    rts
}
  // sprites_irq
// Raster Interrupt Routine - sets up the sprites covering the playfield
// Repeats 10 timers every 2 lines from line IRQ_RASTER_FIRST
// Utilizes duplicated gfx in the sprites to allow for some leeway in updating the sprite pointers
sprites_irq: {
    .const toSpritePtr2_return = PLAYFIELD_SPRITES/$40
    .label raster_sprite_gfx_modify = 9
    // entry interrupt(HARDWARE_CLOBBER)
    sta rega+1
    stx regx+1
    // asm { cld  }
    //(*BGCOL)++;
    // Clear decimal flag (because it is used by the score algorithm)
    cld
    // [73] (byte) sprites_irq::ypos#0 ← (byte) irq_sprite_ypos -- vbuaa=vbuz1 
    // Place the sprites
    lda.z irq_sprite_ypos
    // [74] *((const byte*) SPRITES_YPOS) ← (byte) sprites_irq::ypos#0 -- _deref_pbuc1=vbuaa 
    sta SPRITES_YPOS
    // [75] *((const byte*) SPRITES_YPOS+(byte) 2) ← (byte) sprites_irq::ypos#0 -- _deref_pbuc1=vbuaa 
    sta SPRITES_YPOS+2
    // [76] *((const byte*) SPRITES_YPOS+(byte) 4) ← (byte) sprites_irq::ypos#0 -- _deref_pbuc1=vbuaa 
    sta SPRITES_YPOS+4
    // [77] *((const byte*) SPRITES_YPOS+(byte) 6) ← (byte) sprites_irq::ypos#0 -- _deref_pbuc1=vbuaa 
    sta SPRITES_YPOS+6
    // [78] (byte~) sprites_irq::$0 ← (byte) irq_raster_next + (byte) 1 -- vbuxx=vbuz1_plus_1 
    ldx.z irq_raster_next
    inx
    // [79] (byte) sprites_irq::raster_sprite_gfx_modify ← (byte~) sprites_irq::$0 -- vbuz1=vbuxx 
    // Wait for the y-position before changing sprite pointers
    stx.z raster_sprite_gfx_modify
    jmp __b8
    // sprites_irq::@8
  __b8:
    // [80] if(*((const byte*) RASTER)<(byte) sprites_irq::raster_sprite_gfx_modify) goto sprites_irq::@8 -- _deref_pbuc1_lt_vbuz1_then_la1 
    lda RASTER
    cmp.z raster_sprite_gfx_modify
    bcc __b8
    jmp __b9
    // sprites_irq::@9
  __b9:
    // [81] (byte) sprites_irq::ptr#0 ← (byte) irq_sprite_ptr -- vbuxx=vbuz1 
    ldx.z irq_sprite_ptr
    // [82] if((byte) render_screen_showing==(byte) 0) goto sprites_irq::@1 -- vbuz1_eq_0_then_la1 
    lda.z render_screen_showing
    cmp #0
    beq __b1
    jmp __b10
    // sprites_irq::@10
  __b10:
    // [83] *((const byte*) PLAYFIELD_SPRITE_PTRS_2) ← (byte) sprites_irq::ptr#0 -- _deref_pbuc1=vbuxx 
    stx PLAYFIELD_SPRITE_PTRS_2
    // [84] (byte) sprites_irq::ptr#3 ← ++ (byte) sprites_irq::ptr#0 -- vbuaa=_inc_vbuxx 
    inx
    txa
    // [85] *((const byte*) PLAYFIELD_SPRITE_PTRS_2+(byte) 1) ← (byte) sprites_irq::ptr#3 -- _deref_pbuc1=vbuaa 
    sta PLAYFIELD_SPRITE_PTRS_2+1
    // [86] *((const byte*) PLAYFIELD_SPRITE_PTRS_2+(byte) 2) ← (byte) sprites_irq::ptr#3 -- _deref_pbuc1=vbuaa 
    sta PLAYFIELD_SPRITE_PTRS_2+2
    // [87] (byte) sprites_irq::ptr#4 ← ++ (byte) sprites_irq::ptr#3 -- vbuaa=_inc_vbuaa 
    clc
    adc #1
    // [88] *((const byte*) PLAYFIELD_SPRITE_PTRS_2+(byte) 3) ← (byte) sprites_irq::ptr#4 -- _deref_pbuc1=vbuaa 
    sta PLAYFIELD_SPRITE_PTRS_2+3
    jmp __b2
    // sprites_irq::@2
  __b2:
    // [89] (byte) irq_cnt ← ++ (byte) irq_cnt -- vbuz1=_inc_vbuz1 
    inc.z irq_cnt
    // [90] if((byte) irq_cnt==(byte) 9) goto sprites_irq::@3 -- vbuz1_eq_vbuc1_then_la1 
    lda #9
    cmp.z irq_cnt
    beq __b3
    jmp __b6
    // sprites_irq::@6
  __b6:
    // [91] if((byte) irq_cnt==(byte) $a) goto sprites_irq::@4 -- vbuz1_eq_vbuc1_then_la1 
    lda #$a
    cmp.z irq_cnt
    beq __b4
    jmp __b7
    // sprites_irq::@7
  __b7:
    // [92] (byte) irq_raster_next ← (byte) irq_raster_next + (byte) $14 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_raster_next
    axs #-[$14]
    stx.z irq_raster_next
    // [93] (byte) irq_sprite_ypos ← (byte) irq_sprite_ypos + (byte) $15 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_sprite_ypos
    axs #-[$15]
    stx.z irq_sprite_ypos
    // [94] (byte) irq_sprite_ptr ← (byte) irq_sprite_ptr + (byte) 3 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_sprite_ptr
    axs #-[3]
    stx.z irq_sprite_ptr
    jmp __b5
    // sprites_irq::@5
  __b5:
    // [95] *((const byte*) RASTER) ← (byte) irq_raster_next -- _deref_pbuc1=vbuz1 
    // Setup next interrupt
    lda.z irq_raster_next
    sta RASTER
    // [96] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 
    // Acknowledge the IRQ and setup the next one
    lda #IRQ_RASTER
    sta IRQ_STATUS
    jmp __breturn
    // sprites_irq::@return
  __breturn:
    // [97] return  - exit interrupt(HARDWARE_CLOBBER)
  rega:
    lda #00
  regx:
    ldx #00
    rti
    // sprites_irq::@4
  __b4:
    // [98] (byte) irq_cnt ← (byte) 0 -- vbuz1=vbuc1 
    lda #0
    sta.z irq_cnt
    // [99] (byte) irq_raster_next ← (const byte) IRQ_RASTER_FIRST -- vbuz1=vbuc1 
    lda #IRQ_RASTER_FIRST
    sta.z irq_raster_next
    // [100] (byte) irq_sprite_ypos ← (byte) irq_sprite_ypos + (byte) $15 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_sprite_ypos
    axs #-[$15]
    stx.z irq_sprite_ypos
    // [101] (byte) irq_sprite_ptr ← (byte) irq_sprite_ptr + (byte) 3 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_sprite_ptr
    axs #-[3]
    stx.z irq_sprite_ptr
    jmp __b5
    // sprites_irq::@3
  __b3:
    // [102] (byte) irq_raster_next ← (byte) irq_raster_next + (byte) $15 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_raster_next
    axs #-[$15]
    stx.z irq_raster_next
    // [103] (byte) irq_sprite_ypos ← (const byte) SPRITES_FIRST_YPOS -- vbuz1=vbuc1 
    lda #SPRITES_FIRST_YPOS
    sta.z irq_sprite_ypos
    // [104] phi from sprites_irq::@3 to sprites_irq::toSpritePtr2 [phi:sprites_irq::@3->sprites_irq::toSpritePtr2]
  toSpritePtr2_from___b3:
    jmp toSpritePtr2
    // sprites_irq::toSpritePtr2
  toSpritePtr2:
    jmp __b11
    // sprites_irq::@11
  __b11:
    // [105] (byte) irq_sprite_ptr ← (const byte) sprites_irq::toSpritePtr2_return#0 -- vbuz1=vbuc1 
    lda #toSpritePtr2_return
    sta.z irq_sprite_ptr
    jmp __b5
    // sprites_irq::@1
  __b1:
    // [106] *((const byte*) PLAYFIELD_SPRITE_PTRS_1) ← (byte) sprites_irq::ptr#0 -- _deref_pbuc1=vbuxx 
    stx PLAYFIELD_SPRITE_PTRS_1
    // [107] (byte) sprites_irq::ptr#1 ← ++ (byte) sprites_irq::ptr#0 -- vbuxx=_inc_vbuxx 
    inx
    // [108] *((const byte*) PLAYFIELD_SPRITE_PTRS_1+(byte) 1) ← (byte) sprites_irq::ptr#1 -- _deref_pbuc1=vbuxx 
    stx PLAYFIELD_SPRITE_PTRS_1+1
    // [109] *((const byte*) PLAYFIELD_SPRITE_PTRS_1+(byte) 2) ← (byte) sprites_irq::ptr#1 -- _deref_pbuc1=vbuxx 
    stx PLAYFIELD_SPRITE_PTRS_1+2
    // [110] (byte) sprites_irq::ptr#2 ← ++ (byte) sprites_irq::ptr#1 -- vbuaa=_inc_vbuxx 
    inx
    txa
    // [111] *((const byte*) PLAYFIELD_SPRITE_PTRS_1+(byte) 3) ← (byte) sprites_irq::ptr#2 -- _deref_pbuc1=vbuaa 
    sta PLAYFIELD_SPRITE_PTRS_1+3
    jmp __b2
}
  // File Data
SIN:
.var AMPL = 200-21
    .for(var i=0; i<256; i++) {
  	  .byte 51+AMPL/2+sin(toRadians([i*360]/256))*AMPL/2
    }

.pc = PLAYFIELD_SPRITES "PLAYFIELD_SPRITES"
  .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000))
	// Put the sprites into memory 
	.for(var sy=0;sy<10;sy++) {
	    .var sprite_gfx_y = sy*20
		.for(var sx=0;sx<3;sx++) {
	    	.for (var y=0;y<21; y++) {
	    	    .var gfx_y =  sprite_gfx_y + mod(2100+y-sprite_gfx_y,21)
		    	.for (var c=0; c<3; c++) {
	            	.byte sprites.getSinglecolorByte(sx*3+c,gfx_y)
	            }
	        }
	    	.byte 0
	  	}
	}

.pc = SIN_SPRITE "SIN_SPRITE"
  .fill $40, $ff


ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp toSpritePtr1
Removing instruction jmp __b5
Removing instruction jmp __b3
Removing instruction jmp __b4
Removing instruction jmp __bend
Removing instruction jmp vicSelectGfxBank1
Removing instruction jmp vicSelectGfxBank1_toDd001
Removing instruction jmp vicSelectGfxBank1___b1
Removing instruction jmp toD0181
Removing instruction jmp __b3
Removing instruction jmp __b5
Removing instruction jmp __b1
Removing instruction jmp toSpritePtr2
Removing instruction jmp __b4
Removing instruction jmp __b2
Removing instruction jmp __b6
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b3
Removing instruction jmp __b4
Removing instruction jmp __b5
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b8
Removing instruction jmp __b9
Removing instruction jmp __b10
Removing instruction jmp __b2
Removing instruction jmp __b6
Removing instruction jmp __b7
Removing instruction jmp __b5
Removing instruction jmp __breturn
Removing instruction jmp toSpritePtr2
Removing instruction jmp __b11
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda SPRITES_MC
Removing instruction lda SPRITES_EXPAND_Y
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label __bbegin with __b1
Replacing label __b1_from___b4 with __b1
Replacing label __b4_from___b4 with __b4
Replacing label __b1 with __b2
Replacing label __b1_from___b1 with __b1
Removing instruction __bbegin:
Removing instruction toSpritePtr1_from___b2:
Removing instruction toSpritePtr1:
Removing instruction __b3:
Removing instruction __b4_from___b3:
Removing instruction main_from___b4:
Removing instruction __bend_from___b4:
Removing instruction vicSelectGfxBank1_toDd001_from_vicSelectGfxBank1:
Removing instruction vicSelectGfxBank1_toDd001:
Removing instruction toD0181_from_vicSelectGfxBank1___b1:
Removing instruction toD0181:
Removing instruction __b1_from___b4:
Removing instruction toSpritePtr2_from___b1:
Removing instruction toSpritePtr2:
Removing instruction __b2_from___b4:
Removing instruction __b6_from___b2:
Removing instruction loop_from___b6:
Removing instruction __b1:
Removing instruction __b4_from___b4:
Removing instruction __b1_from___b1:
Removing instruction __breturn:
Removing instruction toSpritePtr2_from___b3:
Removing instruction toSpritePtr2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __b2:
Removing instruction __b5:
Removing instruction __b4:
Removing instruction __bend:
Removing instruction vicSelectGfxBank1:
Removing instruction vicSelectGfxBank1___b1:
Removing instruction __b3:
Removing instruction __b5:
Removing instruction __b1_from___b5:
Removing instruction __b4:
Removing instruction __b2:
Removing instruction __b6:
Removing instruction __breturn:
Removing instruction __b1_from_loop:
Removing instruction __b3:
Removing instruction __b4_from___b3:
Removing instruction __b5:
Removing instruction __b1_from___b5:
Removing instruction __breturn:
Removing instruction __b1_from_sprites_init:
Removing instruction __breturn:
Removing instruction __b9:
Removing instruction __b10:
Removing instruction __b6:
Removing instruction __b7:
Removing instruction __b11:
Succesful ASM optimization Pass5UnusedLabelElimination
Adding RTS to root block 
Succesful ASM optimization Pass5AddMainRts
Removing instruction jmp __b1
Removing instruction jmp __b4
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination

FINAL SYMBOL TABLE
(label) @1
(label) @2
(label) @3
(label) @4
(label) @5
(label) @begin
(label) @end
(const byte) BLACK = (byte) 0
(const byte*) CIA1_INTERRUPT = (byte*) 56333
(const byte*) CIA2_PORT_A = (byte*) 56576
(const byte*) CIA2_PORT_A_DDR = (byte*) 56578
(const byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const byte*) D018 = (byte*) 53272
(const void()**) HARDWARE_IRQ = (void()**) 65534
(const byte*) IRQ_ENABLE = (byte*) 53274
(const byte) IRQ_RASTER = (byte) 1
(const byte) IRQ_RASTER_FIRST = (const byte) SPRITES_FIRST_YPOS+(byte) $13
(const byte*) IRQ_STATUS = (byte*) 53273
(const byte*) PLAYFIELD_CHARSET = (byte*) 10240
(const byte*) PLAYFIELD_SCREEN_1 = (byte*) 1024
(const byte*) PLAYFIELD_SCREEN_2 = (byte*) 11264
(const byte*) PLAYFIELD_SPRITES = (byte*) 8192
(const byte*) PLAYFIELD_SPRITE_PTRS_1 = (const byte*) PLAYFIELD_SCREEN_1+(const word) SPRITE_PTRS
(const byte*) PLAYFIELD_SPRITE_PTRS_2 = (const byte*) PLAYFIELD_SCREEN_2+(const word) SPRITE_PTRS
(const byte*) PROCPORT = (byte*) 1
(const byte*) PROCPORT_DDR = (byte*) 0
(const byte) PROCPORT_DDR_MEMORY_MASK = (byte) 7
(const byte) PROCPORT_RAM_IO = (byte) 5
(const byte*) RASTER = (byte*) 53266
(const byte*) SIN[(number) $100]  = kickasm {{ .var AMPL = 200-21
    .for(var i=0; i<256; i++) {
  	  .byte 51+AMPL/2+sin(toRadians([i*360]/256))*AMPL/2
    }
 }}
(const byte*) SIN_SPRITE = (byte*) 10240
(const byte*) SPRITES_COLS = (byte*) 53287
(const byte*) SPRITES_ENABLE = (byte*) 53269
(const byte*) SPRITES_EXPAND_X = (byte*) 53277
(const byte*) SPRITES_EXPAND_Y = (byte*) 53271
(const byte) SPRITES_FIRST_YPOS = (byte) $31
(const byte*) SPRITES_MC = (byte*) 53276
(const byte*) SPRITES_XPOS = (byte*) 53248
(const byte*) SPRITES_YPOS = (byte*) 53249
(const word) SPRITE_PTRS = (word) $3f8
(const byte*) VIC_CONTROL = (byte*) 53265
(byte) irq_cnt loadstore zp[1]:8 6.0
(byte) irq_raster_next loadstore zp[1]:5 1.0
(byte) irq_sprite_ptr loadstore zp[1]:7 1.5555555555555558
(byte) irq_sprite_ypos loadstore zp[1]:6 14.0
(void()) loop()
(byte~) loop::$1 reg byte a 202.0
(label) loop::@1
(label) loop::@2
(label) loop::@3
(label) loop::@4
(label) loop::@5
(byte) loop::idx
(byte) loop::idx#0 reg byte x 22.0
(byte) loop::idx#1 reg byte x 67.33333333333333
(byte) loop::idx#2 reg byte x 104.66666666666666
(byte) loop::s
(byte) loop::s#1 s zp[1]:2 151.5
(byte) loop::s#2 s zp[1]:2 75.75
(void()) main()
(byte~) main::$6 reg byte a 22.0
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@return
(byte) main::s
(byte) main::s#1 reg byte y 16.5
(byte) main::s#2 reg byte y 6.6
(byte) main::s2
(byte) main::s2#0 reg byte x 16.5
(label) main::toD0181
(byte*) main::toD0181_gfx
(byte) main::toD0181_return
(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) PLAYFIELD_SCREEN_1&(word) $3fff*(byte) 4|>(word)(const byte*) PLAYFIELD_CHARSET/(byte) 4&(byte) $f
(byte*) main::toD0181_screen
(label) main::toSpritePtr2
(byte) main::toSpritePtr2_return
(const byte) main::toSpritePtr2_return#0 toSpritePtr2_return = (byte)(word)(const byte*) SIN_SPRITE/(byte) $40
(byte*) main::toSpritePtr2_sprite
(label) main::vicSelectGfxBank1
(label) main::vicSelectGfxBank1_@1
(byte*) main::vicSelectGfxBank1_gfx
(label) main::vicSelectGfxBank1_toDd001
(byte*) main::vicSelectGfxBank1_toDd001_gfx
(byte) main::vicSelectGfxBank1_toDd001_return
(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte) 3
(byte) main::xpos
(byte) main::xpos#1 xpos zp[1]:3 5.5
(byte) main::xpos#2 xpos zp[1]:3 4.125
(byte) main::ypos
(byte) main::ypos#1 ypos zp[1]:2 7.333333333333333
(byte) main::ypos#2 ypos zp[1]:2 3.666666666666667
(byte) render_screen_showing loadstore zp[1]:4 0.4
(byte) sin_idx
(byte) sin_idx#10 sin_idx zp[1]:3 3.666666666666667
(byte) sin_idx#3 sin_idx zp[1]:3 22.0
(void()) sprites_init()
(label) sprites_init::@1
(label) sprites_init::@return
(byte) sprites_init::s
(byte) sprites_init::s#1 reg byte y 16.5
(byte) sprites_init::s#2 reg byte y 8.8
(byte) sprites_init::s2
(byte) sprites_init::s2#0 reg byte x 22.0
(byte) sprites_init::xpos
(byte) sprites_init::xpos#1 xpos zp[1]:3 7.333333333333333
(byte) sprites_init::xpos#2 xpos zp[1]:3 8.25
interrupt(HARDWARE_CLOBBER)(void()) sprites_irq()
(byte~) sprites_irq::$0 reg byte x 4.0
(label) sprites_irq::@1
(label) sprites_irq::@10
(label) sprites_irq::@11
(label) sprites_irq::@2
(label) sprites_irq::@3
(label) sprites_irq::@4
(label) sprites_irq::@5
(label) sprites_irq::@6
(label) sprites_irq::@7
(label) sprites_irq::@8
(label) sprites_irq::@9
(label) sprites_irq::@return
(byte) sprites_irq::ptr
(byte) sprites_irq::ptr#0 reg byte x 2.5
(byte) sprites_irq::ptr#1 reg byte x 2.6666666666666665
(byte) sprites_irq::ptr#2 reg byte a 4.0
(byte) sprites_irq::ptr#3 reg byte a 2.6666666666666665
(byte) sprites_irq::ptr#4 reg byte a 4.0
(byte) sprites_irq::raster_sprite_gfx_modify loadstore zp[1]:9 6.5
(label) sprites_irq::toSpritePtr2
(byte) sprites_irq::toSpritePtr2_return
(const byte) sprites_irq::toSpritePtr2_return#0 toSpritePtr2_return = (byte)(word)(const byte*) PLAYFIELD_SPRITES/(byte) $40
(byte*) sprites_irq::toSpritePtr2_sprite
(byte) sprites_irq::ypos
(byte) sprites_irq::ypos#0 reg byte a 2.5
(void()) sprites_irq_init()
(label) sprites_irq_init::@return
(label) toSpritePtr1
(byte) toSpritePtr1_return
(const byte) toSpritePtr1_return#0 toSpritePtr1_return = (byte)(word)(const byte*) PLAYFIELD_SPRITES/(byte) $40
(byte*) toSpritePtr1_sprite

reg byte y [ main::s#2 main::s#1 ]
zp[1]:2 [ loop::s#2 loop::s#1 main::ypos#2 main::ypos#1 ]
reg byte x [ loop::idx#2 loop::idx#0 loop::idx#1 ]
reg byte y [ sprites_init::s#2 sprites_init::s#1 ]
zp[1]:3 [ sprites_init::xpos#2 sprites_init::xpos#1 sin_idx#10 sin_idx#3 main::xpos#2 main::xpos#1 ]
zp[1]:4 [ render_screen_showing ]
zp[1]:5 [ irq_raster_next ]
zp[1]:6 [ irq_sprite_ypos ]
zp[1]:7 [ irq_sprite_ptr ]
zp[1]:8 [ irq_cnt ]
reg byte x [ main::s2#0 ]
reg byte a [ main::$6 ]
reg byte a [ loop::$1 ]
reg byte x [ sprites_init::s2#0 ]
reg byte a [ sprites_irq::ypos#0 ]
reg byte x [ sprites_irq::$0 ]
zp[1]:9 [ sprites_irq::raster_sprite_gfx_modify ]
reg byte x [ sprites_irq::ptr#0 ]
reg byte a [ sprites_irq::ptr#3 ]
reg byte a [ sprites_irq::ptr#4 ]
reg byte x [ sprites_irq::ptr#1 ]
reg byte a [ sprites_irq::ptr#2 ]


FINAL ASSEMBLER
Score: 11662

  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__b1)
.pc = $80d "Program"
  // Global Constants & labels
  // Processor port data direction register
  .label PROCPORT_DDR = 0
  // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written
  .const PROCPORT_DDR_MEMORY_MASK = 7
  // Processor Port Register controlling RAM/ROM configuration and the datasette
  .label PROCPORT = 1
  // RAM in $A000, $E000 I/O in $D000
  .const PROCPORT_RAM_IO = 5
  // The offset of the sprite pointers from the screen start address
  .const SPRITE_PTRS = $3f8
  .label SPRITES_XPOS = $d000
  .label SPRITES_YPOS = $d001
  .label RASTER = $d012
  .label SPRITES_ENABLE = $d015
  .label SPRITES_EXPAND_Y = $d017
  .label SPRITES_MC = $d01c
  .label SPRITES_EXPAND_X = $d01d
  .label SPRITES_COLS = $d027
  .label VIC_CONTROL = $d011
  .label D018 = $d018
  // VIC II IRQ Status Register
  .label IRQ_STATUS = $d019
  // VIC II IRQ Enable Register
  .label IRQ_ENABLE = $d01a
  // Bits for the IRQ Status/Enable Registers
  .const IRQ_RASTER = 1
  // CIA#1 Interrupt Status & Control Register
  .label CIA1_INTERRUPT = $dc0d
  // CIA#2 Port A: Serial bus, RS-232, VIC memory bank
  .label CIA2_PORT_A = $dd00
  // CIA #2 Port A data direction register.
  .label CIA2_PORT_A_DDR = $dd02
  // Value that disables all CIA interrupts when stored to the CIA Interrupt registers
  .const CIA_INTERRUPT_CLEAR = $7f
  // The vector used when the HARDWARE serves IRQ interrupts
  .label HARDWARE_IRQ = $fffe
  // The colors of the C64
  .const BLACK = 0
  // Address of the first screen
  .label PLAYFIELD_SCREEN_1 = $400
  // Address of the second screen
  .label PLAYFIELD_SCREEN_2 = $2c00
  // Screen Sprite pointers on screen 1
  .label PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+SPRITE_PTRS
  // Screen Sprite pointers on screen 2
  .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS
  // Address of the sprites covering the playfield
  .label PLAYFIELD_SPRITES = $2000
  // Address of the charset
  .label PLAYFIELD_CHARSET = $2800
  // The Y-position of the first sprite row
  .const SPRITES_FIRST_YPOS = $31
  // The line of the first IRQ
  .const IRQ_RASTER_FIRST = SPRITES_FIRST_YPOS+$13
  .label SIN_SPRITE = $2800
  .const toSpritePtr1_return = PLAYFIELD_SPRITES/$40
  .label render_screen_showing = 4
  .label irq_raster_next = 5
  .label irq_sprite_ypos = 6
  .label irq_sprite_ptr = 7
  .label irq_cnt = 8
  .label sin_idx = 3
  // @begin
  // @1
__b1:
  // render_screen_showing = 0
  // [1] (byte) render_screen_showing ← (byte) 0 -- vbuz1=vbuc1 
  // The screen currently being showed to the user. 0x00 for screen 1 / 0x20 for screen 2.
  lda #0
  sta.z render_screen_showing
  // kickasm
  // kickasm(location (const byte*) PLAYFIELD_SPRITES) {{ .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000)) 	// Put the sprites into memory  	.for(var sy=0;sy<10;sy++) { 	    .var sprite_gfx_y = sy*20 		.for(var sx=0;sx<3;sx++) { 	    	.for (var y=0;y<21; y++) { 	    	    .var gfx_y =  sprite_gfx_y + mod(2100+y-sprite_gfx_y,21) 		    	.for (var c=0; c<3; c++) { 	            	.byte sprites.getSinglecolorByte(sx*3+c,gfx_y) 	            } 	        } 	    	.byte 0 	  	} 	}  }}
  // @2
  // irq_raster_next = IRQ_RASTER_FIRST
  // [3] (byte) irq_raster_next ← (const byte) IRQ_RASTER_FIRST -- vbuz1=vbuc1 
  // The raster line of the next IRQ
  lda #IRQ_RASTER_FIRST
  sta.z irq_raster_next
  // irq_sprite_ypos = SPRITES_FIRST_YPOS + 21
  // [4] (byte) irq_sprite_ypos ← (const byte) SPRITES_FIRST_YPOS+(byte) $15 -- vbuz1=vbuc1 
  // Y-pos of the sprites on the next IRQ
  lda #SPRITES_FIRST_YPOS+$15
  sta.z irq_sprite_ypos
  // [5] phi from @2 to toSpritePtr1 [phi:@2->toSpritePtr1]
  // toSpritePtr1
  // @5
  // irq_sprite_ptr = toSpritePtr(PLAYFIELD_SPRITES) + 3
  // [6] (byte) irq_sprite_ptr ← (const byte) toSpritePtr1_return#0+(byte) 3 -- vbuz1=vbuc1 
  // Index of the sprites to show on the next IRQ
  lda #toSpritePtr1_return+3
  sta.z irq_sprite_ptr
  // irq_cnt = 0
  // [7] (byte) irq_cnt ← (byte) 0 -- vbuz1=vbuc1 
  // Counting the 10 IRQs
  lda #0
  sta.z irq_cnt
  // @3
  // kickasm
  // kickasm(location (const byte*) SIN_SPRITE) {{ .fill $40, $ff  }}
  // [9] phi from @3 to @4 [phi:@3->@4]
  // @4
  // [10] call main 
  // [12] phi from @4 to main [phi:@4->main]
  jsr main
  rts
  // [11] phi from @4 to @end [phi:@4->@end]
  // @end
  // main
main: {
    .const toSpritePtr2_return = SIN_SPRITE/$40
    .const vicSelectGfxBank1_toDd001_return = 3
    .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)*4)|(>PLAYFIELD_CHARSET)/4&$f
    .label xpos = 3
    .label ypos = 2
    // main::vicSelectGfxBank1
    // *CIA2_PORT_A_DDR = %00000011
    // [13] *((const byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2 
    lda #3
    sta CIA2_PORT_A_DDR
    // [14] phi from main::vicSelectGfxBank1 to main::vicSelectGfxBank1_toDd001 [phi:main::vicSelectGfxBank1->main::vicSelectGfxBank1_toDd001]
    // main::vicSelectGfxBank1_toDd001
    // main::vicSelectGfxBank1_@1
    // *CIA2_PORT_A = toDd00(gfx)
    // [15] *((const byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 -- _deref_pbuc1=vbuc2 
    lda #vicSelectGfxBank1_toDd001_return
    sta CIA2_PORT_A
    // [16] phi from main::vicSelectGfxBank1_@1 to main::toD0181 [phi:main::vicSelectGfxBank1_@1->main::toD0181]
    // main::toD0181
    // main::@3
    // *D018 = toD018(PLAYFIELD_SCREEN_1, PLAYFIELD_CHARSET)
    // [17] *((const byte*) D018) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0181_return
    sta D018
    // sprites_init()
    // [18] call sprites_init 
    jsr sprites_init
    // main::@5
    // *SPRITES_ENABLE = 0xff
    // [19] *((const byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2 
    lda #$ff
    sta SPRITES_ENABLE
    // [20] phi from main::@5 to main::@1 [phi:main::@5->main::@1]
    // [20] phi (byte) main::ypos#2 = (byte) $32 [phi:main::@5->main::@1#0] -- vbuz1=vbuc1 
    lda #$32
    sta.z ypos
    // [20] phi (byte) main::xpos#2 = (byte) $18 [phi:main::@5->main::@1#1] -- vbuz1=vbuc1 
    lda #$18
    sta.z xpos
    // [20] phi (byte) main::s#2 = (byte) 4 [phi:main::@5->main::@1#2] -- vbuyy=vbuc1 
    ldy #4
    // [20] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
    // [20] phi (byte) main::ypos#2 = (byte) main::ypos#1 [phi:main::@4->main::@1#0] -- register_copy 
    // [20] phi (byte) main::xpos#2 = (byte) main::xpos#1 [phi:main::@4->main::@1#1] -- register_copy 
    // [20] phi (byte) main::s#2 = (byte) main::s#1 [phi:main::@4->main::@1#2] -- register_copy 
    // main::@1
  __b1:
    // s2 = s*2
    // [21] (byte) main::s2#0 ← (byte) main::s#2 << (byte) 1 -- vbuxx=vbuyy_rol_1 
    tya
    asl
    tax
    // SPRITES_XPOS[s2] = xpos
    // [22] *((const byte*) SPRITES_XPOS + (byte) main::s2#0) ← (byte) main::xpos#2 -- pbuc1_derefidx_vbuxx=vbuz1 
    lda.z xpos
    sta SPRITES_XPOS,x
    // SPRITES_YPOS[s2] = ypos
    // [23] *((const byte*) SPRITES_YPOS + (byte) main::s2#0) ← (byte) main::ypos#2 -- pbuc1_derefidx_vbuxx=vbuz1 
    lda.z ypos
    sta SPRITES_YPOS,x
    // s-3
    // [24] (byte~) main::$6 ← (byte) main::s#2 - (byte) 3 -- vbuaa=vbuyy_minus_vbuc1 
    tya
    sec
    sbc #3
    // SPRITES_COLS[s] = s-3
    // [25] *((const byte*) SPRITES_COLS + (byte) main::s#2) ← (byte~) main::$6 -- pbuc1_derefidx_vbuyy=vbuaa 
    sta SPRITES_COLS,y
    // [26] phi from main::@1 to main::toSpritePtr2 [phi:main::@1->main::toSpritePtr2]
    // main::toSpritePtr2
    // main::@4
    // PLAYFIELD_SPRITE_PTRS_1[s] = toSpritePtr(SIN_SPRITE)
    // [27] *((const byte*) PLAYFIELD_SPRITE_PTRS_1 + (byte) main::s#2) ← (const byte) main::toSpritePtr2_return#0 -- pbuc1_derefidx_vbuyy=vbuc2 
    lda #toSpritePtr2_return
    sta PLAYFIELD_SPRITE_PTRS_1,y
    // xpos +=  24
    // [28] (byte) main::xpos#1 ← (byte) main::xpos#2 + (byte) $18 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z xpos
    axs #-[$18]
    stx.z xpos
    // ypos +=  24
    // [29] (byte) main::ypos#1 ← (byte) main::ypos#2 + (byte) $18 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z ypos
    axs #-[$18]
    stx.z ypos
    // for(char s:4..7)
    // [30] (byte) main::s#1 ← ++ (byte) main::s#2 -- vbuyy=_inc_vbuyy 
    iny
    // [31] if((byte) main::s#1!=(byte) 8) goto main::@1 -- vbuyy_neq_vbuc1_then_la1 
    cpy #8
    bne __b1
    // [32] phi from main::@4 to main::@2 [phi:main::@4->main::@2]
    // main::@2
    // sprites_irq_init()
    // [33] call sprites_irq_init 
    jsr sprites_irq_init
    // [34] phi from main::@2 to main::@6 [phi:main::@2->main::@6]
    // main::@6
    // loop()
    // [35] call loop 
    // [37] phi from main::@6 to loop [phi:main::@6->loop]
    jsr loop
    // main::@return
    // }
    // [36] return 
    rts
}
  // loop
loop: {
    .label s = 2
    // [38] phi from loop to loop::@1 [phi:loop->loop::@1]
    // [38] phi (byte) sin_idx#10 = (byte) 0 [phi:loop->loop::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z sin_idx
    // loop::@1
    // loop::@2
  __b2:
    // while (*RASTER!=0xff)
    // [39] if(*((const byte*) RASTER)!=(byte) $ff) goto loop::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$ff
    cmp RASTER
    bne __b2
    // loop::@3
    // idx = sin_idx
    // [40] (byte) loop::idx#0 ← (byte) sin_idx#10 -- vbuxx=vbuz1 
    ldx.z sin_idx
    // [41] phi from loop::@3 to loop::@4 [phi:loop::@3->loop::@4]
    // [41] phi (byte) loop::idx#2 = (byte) loop::idx#0 [phi:loop::@3->loop::@4#0] -- register_copy 
    // [41] phi (byte) loop::s#2 = (byte) 4 [phi:loop::@3->loop::@4#1] -- vbuz1=vbuc1 
    lda #4
    sta.z s
    // [41] phi from loop::@4 to loop::@4 [phi:loop::@4->loop::@4]
    // [41] phi (byte) loop::idx#2 = (byte) loop::idx#1 [phi:loop::@4->loop::@4#0] -- register_copy 
    // [41] phi (byte) loop::s#2 = (byte) loop::s#1 [phi:loop::@4->loop::@4#1] -- register_copy 
    // loop::@4
  __b4:
    // s*2
    // [42] (byte~) loop::$1 ← (byte) loop::s#2 << (byte) 1 -- vbuaa=vbuz1_rol_1 
    lda.z s
    asl
    // SPRITES_YPOS[s*2] = SIN[idx]
    // [43] *((const byte*) SPRITES_YPOS + (byte~) loop::$1) ← *((const byte*) SIN + (byte) loop::idx#2) -- pbuc1_derefidx_vbuaa=pbuc2_derefidx_vbuxx 
    tay
    lda SIN,x
    sta SPRITES_YPOS,y
    // idx += 10
    // [44] (byte) loop::idx#1 ← (byte) loop::idx#2 + (byte) $a -- vbuxx=vbuxx_plus_vbuc1 
    txa
    axs #-[$a]
    // for(char s:4..7)
    // [45] (byte) loop::s#1 ← ++ (byte) loop::s#2 -- vbuz1=_inc_vbuz1 
    inc.z s
    // [46] if((byte) loop::s#1!=(byte) 8) goto loop::@4 -- vbuz1_neq_vbuc1_then_la1 
    lda #8
    cmp.z s
    bne __b4
    // loop::@5
    // sin_idx++;
    // [47] (byte) sin_idx#3 ← ++ (byte) sin_idx#10 -- vbuz1=_inc_vbuz1 
    inc.z sin_idx
    // [38] phi from loop::@5 to loop::@1 [phi:loop::@5->loop::@1]
    // [38] phi (byte) sin_idx#10 = (byte) sin_idx#3 [phi:loop::@5->loop::@1#0] -- register_copy 
    jmp __b2
}
  // sprites_irq_init
// Setup the IRQ
sprites_irq_init: {
    // asm
    // asm { sei  }
    sei
    // *IRQ_STATUS = IRQ_RASTER
    // [49] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 
    // Acknowledge any IRQ and setup the next one
    lda #IRQ_RASTER
    sta IRQ_STATUS
    // asm
    // asm { ldaCIA1_INTERRUPT  }
    lda CIA1_INTERRUPT
    // *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK
    // [51] *((const byte*) PROCPORT_DDR) ← (const byte) PROCPORT_DDR_MEMORY_MASK -- _deref_pbuc1=vbuc2 
    // Disable kernal & basic
    lda #PROCPORT_DDR_MEMORY_MASK
    sta PROCPORT_DDR
    // *PROCPORT = PROCPORT_RAM_IO
    // [52] *((const byte*) PROCPORT) ← (const byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2 
    lda #PROCPORT_RAM_IO
    sta PROCPORT
    // *CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR
    // [53] *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 
    // Disable CIA 1 Timer IRQ
    lda #CIA_INTERRUPT_CLEAR
    sta CIA1_INTERRUPT
    // *VIC_CONTROL &=0x7f
    // [54] *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 
    // Set raster line
    lda #$7f
    and VIC_CONTROL
    sta VIC_CONTROL
    // *RASTER = IRQ_RASTER_FIRST
    // [55] *((const byte*) RASTER) ← (const byte) IRQ_RASTER_FIRST -- _deref_pbuc1=vbuc2 
    lda #IRQ_RASTER_FIRST
    sta RASTER
    // *IRQ_ENABLE = IRQ_RASTER
    // [56] *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 
    // Enable Raster Interrupt
    lda #IRQ_RASTER
    sta IRQ_ENABLE
    // *HARDWARE_IRQ = &sprites_irq
    // [57] *((const void()**) HARDWARE_IRQ) ← &interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() -- _deref_pptc1=pprc2 
    // Set the IRQ routine
    lda #<sprites_irq
    sta HARDWARE_IRQ
    lda #>sprites_irq
    sta HARDWARE_IRQ+1
    // asm
    // asm { cli  }
    cli
    // sprites_irq_init::@return
    // }
    // [59] return 
    rts
}
  // sprites_init
// Setup the sprites
sprites_init: {
    .label xpos = 3
    // *SPRITES_ENABLE = %00001111
    // [60] *((const byte*) SPRITES_ENABLE) ← (byte) $f -- _deref_pbuc1=vbuc2 
    lda #$f
    sta SPRITES_ENABLE
    // *SPRITES_MC = 0
    // [61] *((const byte*) SPRITES_MC) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SPRITES_MC
    // *SPRITES_EXPAND_Y = *SPRITES_MC = 0
    // [62] *((const byte*) SPRITES_EXPAND_Y) ← *((const byte*) SPRITES_MC) -- _deref_pbuc1=_deref_pbuc2 
    sta SPRITES_EXPAND_Y
    // *SPRITES_EXPAND_X = *SPRITES_EXPAND_Y = *SPRITES_MC = 0
    // [63] *((const byte*) SPRITES_EXPAND_X) ← *((const byte*) SPRITES_EXPAND_Y) -- _deref_pbuc1=_deref_pbuc2 
    sta SPRITES_EXPAND_X
    // [64] phi from sprites_init to sprites_init::@1 [phi:sprites_init->sprites_init::@1]
    // [64] phi (byte) sprites_init::xpos#2 = (byte)(number) $18+(number) $f*(number) 8 [phi:sprites_init->sprites_init::@1#0] -- vbuz1=vbuc1 
    lda #$18+$f*8
    sta.z xpos
    // [64] phi (byte) sprites_init::s#2 = (byte) 0 [phi:sprites_init->sprites_init::@1#1] -- vbuyy=vbuc1 
    ldy #0
    // [64] phi from sprites_init::@1 to sprites_init::@1 [phi:sprites_init::@1->sprites_init::@1]
    // [64] phi (byte) sprites_init::xpos#2 = (byte) sprites_init::xpos#1 [phi:sprites_init::@1->sprites_init::@1#0] -- register_copy 
    // [64] phi (byte) sprites_init::s#2 = (byte) sprites_init::s#1 [phi:sprites_init::@1->sprites_init::@1#1] -- register_copy 
    // sprites_init::@1
  __b1:
    // s2 = s*2
    // [65] (byte) sprites_init::s2#0 ← (byte) sprites_init::s#2 << (byte) 1 -- vbuxx=vbuyy_rol_1 
    tya
    asl
    tax
    // SPRITES_XPOS[s2] = xpos
    // [66] *((const byte*) SPRITES_XPOS + (byte) sprites_init::s2#0) ← (byte) sprites_init::xpos#2 -- pbuc1_derefidx_vbuxx=vbuz1 
    lda.z xpos
    sta SPRITES_XPOS,x
    // SPRITES_COLS[s] = BLACK
    // [67] *((const byte*) SPRITES_COLS + (byte) sprites_init::s#2) ← (const byte) BLACK -- pbuc1_derefidx_vbuyy=vbuc2 
    lda #BLACK
    sta SPRITES_COLS,y
    // xpos = xpos+24
    // [68] (byte) sprites_init::xpos#1 ← (byte) sprites_init::xpos#2 + (byte) $18 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z xpos
    axs #-[$18]
    stx.z xpos
    // for(char s:0..3)
    // [69] (byte) sprites_init::s#1 ← ++ (byte) sprites_init::s#2 -- vbuyy=_inc_vbuyy 
    iny
    // [70] if((byte) sprites_init::s#1!=(byte) 4) goto sprites_init::@1 -- vbuyy_neq_vbuc1_then_la1 
    cpy #4
    bne __b1
    // sprites_init::@return
    // }
    // [71] return 
    rts
}
  // sprites_irq
// Raster Interrupt Routine - sets up the sprites covering the playfield
// Repeats 10 timers every 2 lines from line IRQ_RASTER_FIRST
// Utilizes duplicated gfx in the sprites to allow for some leeway in updating the sprite pointers
sprites_irq: {
    .const toSpritePtr2_return = PLAYFIELD_SPRITES/$40
    .label raster_sprite_gfx_modify = 9
    // entry interrupt(HARDWARE_CLOBBER)
    sta rega+1
    stx regx+1
    // asm
    // asm { cld  }
    //(*BGCOL)++;
    // Clear decimal flag (because it is used by the score algorithm)
    cld
    // ypos = irq_sprite_ypos
    // [73] (byte) sprites_irq::ypos#0 ← (byte) irq_sprite_ypos -- vbuaa=vbuz1 
    // Place the sprites
    lda.z irq_sprite_ypos
    // SPRITES_YPOS[0] = ypos
    // [74] *((const byte*) SPRITES_YPOS) ← (byte) sprites_irq::ypos#0 -- _deref_pbuc1=vbuaa 
    sta SPRITES_YPOS
    // SPRITES_YPOS[2] = ypos
    // [75] *((const byte*) SPRITES_YPOS+(byte) 2) ← (byte) sprites_irq::ypos#0 -- _deref_pbuc1=vbuaa 
    sta SPRITES_YPOS+2
    // SPRITES_YPOS[4] = ypos
    // [76] *((const byte*) SPRITES_YPOS+(byte) 4) ← (byte) sprites_irq::ypos#0 -- _deref_pbuc1=vbuaa 
    sta SPRITES_YPOS+4
    // SPRITES_YPOS[6] = ypos
    // [77] *((const byte*) SPRITES_YPOS+(byte) 6) ← (byte) sprites_irq::ypos#0 -- _deref_pbuc1=vbuaa 
    sta SPRITES_YPOS+6
    // irq_raster_next+1
    // [78] (byte~) sprites_irq::$0 ← (byte) irq_raster_next + (byte) 1 -- vbuxx=vbuz1_plus_1 
    ldx.z irq_raster_next
    inx
    // raster_sprite_gfx_modify = irq_raster_next+1
    // [79] (byte) sprites_irq::raster_sprite_gfx_modify ← (byte~) sprites_irq::$0 -- vbuz1=vbuxx 
    // Wait for the y-position before changing sprite pointers
    stx.z raster_sprite_gfx_modify
    // sprites_irq::@8
  __b8:
    // while(*RASTER<raster_sprite_gfx_modify)
    // [80] if(*((const byte*) RASTER)<(byte) sprites_irq::raster_sprite_gfx_modify) goto sprites_irq::@8 -- _deref_pbuc1_lt_vbuz1_then_la1 
    lda RASTER
    cmp.z raster_sprite_gfx_modify
    bcc __b8
    // sprites_irq::@9
    // ptr = irq_sprite_ptr
    // [81] (byte) sprites_irq::ptr#0 ← (byte) irq_sprite_ptr -- vbuxx=vbuz1 
    ldx.z irq_sprite_ptr
    // if(render_screen_showing==0)
    // [82] if((byte) render_screen_showing==(byte) 0) goto sprites_irq::@1 -- vbuz1_eq_0_then_la1 
    lda.z render_screen_showing
    cmp #0
    beq __b1
    // sprites_irq::@10
    // PLAYFIELD_SPRITE_PTRS_2[0] = ptr++
    // [83] *((const byte*) PLAYFIELD_SPRITE_PTRS_2) ← (byte) sprites_irq::ptr#0 -- _deref_pbuc1=vbuxx 
    stx PLAYFIELD_SPRITE_PTRS_2
    // PLAYFIELD_SPRITE_PTRS_2[0] = ptr++;
    // [84] (byte) sprites_irq::ptr#3 ← ++ (byte) sprites_irq::ptr#0 -- vbuaa=_inc_vbuxx 
    inx
    txa
    // PLAYFIELD_SPRITE_PTRS_2[1] = ptr
    // [85] *((const byte*) PLAYFIELD_SPRITE_PTRS_2+(byte) 1) ← (byte) sprites_irq::ptr#3 -- _deref_pbuc1=vbuaa 
    sta PLAYFIELD_SPRITE_PTRS_2+1
    // PLAYFIELD_SPRITE_PTRS_2[2] = ptr++
    // [86] *((const byte*) PLAYFIELD_SPRITE_PTRS_2+(byte) 2) ← (byte) sprites_irq::ptr#3 -- _deref_pbuc1=vbuaa 
    sta PLAYFIELD_SPRITE_PTRS_2+2
    // PLAYFIELD_SPRITE_PTRS_2[2] = ptr++;
    // [87] (byte) sprites_irq::ptr#4 ← ++ (byte) sprites_irq::ptr#3 -- vbuaa=_inc_vbuaa 
    clc
    adc #1
    // PLAYFIELD_SPRITE_PTRS_2[3] = ptr
    // [88] *((const byte*) PLAYFIELD_SPRITE_PTRS_2+(byte) 3) ← (byte) sprites_irq::ptr#4 -- _deref_pbuc1=vbuaa 
    sta PLAYFIELD_SPRITE_PTRS_2+3
    // sprites_irq::@2
  __b2:
    // ++irq_cnt;
    // [89] (byte) irq_cnt ← ++ (byte) irq_cnt -- vbuz1=_inc_vbuz1 
    inc.z irq_cnt
    // if(irq_cnt==9)
    // [90] if((byte) irq_cnt==(byte) 9) goto sprites_irq::@3 -- vbuz1_eq_vbuc1_then_la1 
    lda #9
    cmp.z irq_cnt
    beq __b3
    // sprites_irq::@6
    // if(irq_cnt==10)
    // [91] if((byte) irq_cnt==(byte) $a) goto sprites_irq::@4 -- vbuz1_eq_vbuc1_then_la1 
    lda #$a
    cmp.z irq_cnt
    beq __b4
    // sprites_irq::@7
    // irq_raster_next += 20
    // [92] (byte) irq_raster_next ← (byte) irq_raster_next + (byte) $14 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_raster_next
    axs #-[$14]
    stx.z irq_raster_next
    // irq_sprite_ypos += 21
    // [93] (byte) irq_sprite_ypos ← (byte) irq_sprite_ypos + (byte) $15 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_sprite_ypos
    axs #-[$15]
    stx.z irq_sprite_ypos
    // irq_sprite_ptr += 3
    // [94] (byte) irq_sprite_ptr ← (byte) irq_sprite_ptr + (byte) 3 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_sprite_ptr
    axs #-[3]
    stx.z irq_sprite_ptr
    // sprites_irq::@5
  __b5:
    // *RASTER = irq_raster_next
    // [95] *((const byte*) RASTER) ← (byte) irq_raster_next -- _deref_pbuc1=vbuz1 
    // Setup next interrupt
    lda.z irq_raster_next
    sta RASTER
    // *IRQ_STATUS = IRQ_RASTER
    // [96] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 
    // Acknowledge the IRQ and setup the next one
    lda #IRQ_RASTER
    sta IRQ_STATUS
    // sprites_irq::@return
    // }
    // [97] return  - exit interrupt(HARDWARE_CLOBBER)
  rega:
    lda #00
  regx:
    ldx #00
    rti
    // sprites_irq::@4
  __b4:
    // irq_cnt = 0
    // [98] (byte) irq_cnt ← (byte) 0 -- vbuz1=vbuc1 
    lda #0
    sta.z irq_cnt
    // irq_raster_next = IRQ_RASTER_FIRST
    // [99] (byte) irq_raster_next ← (const byte) IRQ_RASTER_FIRST -- vbuz1=vbuc1 
    lda #IRQ_RASTER_FIRST
    sta.z irq_raster_next
    // irq_sprite_ypos += 21
    // [100] (byte) irq_sprite_ypos ← (byte) irq_sprite_ypos + (byte) $15 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_sprite_ypos
    axs #-[$15]
    stx.z irq_sprite_ypos
    // irq_sprite_ptr += 3
    // [101] (byte) irq_sprite_ptr ← (byte) irq_sprite_ptr + (byte) 3 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_sprite_ptr
    axs #-[3]
    stx.z irq_sprite_ptr
    jmp __b5
    // sprites_irq::@3
  __b3:
    // irq_raster_next += 21
    // [102] (byte) irq_raster_next ← (byte) irq_raster_next + (byte) $15 -- vbuz1=vbuz1_plus_vbuc1 
    lax.z irq_raster_next
    axs #-[$15]
    stx.z irq_raster_next
    // irq_sprite_ypos = SPRITES_FIRST_YPOS
    // [103] (byte) irq_sprite_ypos ← (const byte) SPRITES_FIRST_YPOS -- vbuz1=vbuc1 
    lda #SPRITES_FIRST_YPOS
    sta.z irq_sprite_ypos
    // [104] phi from sprites_irq::@3 to sprites_irq::toSpritePtr2 [phi:sprites_irq::@3->sprites_irq::toSpritePtr2]
    // sprites_irq::toSpritePtr2
    // sprites_irq::@11
    // irq_sprite_ptr = toSpritePtr(PLAYFIELD_SPRITES)
    // [105] (byte) irq_sprite_ptr ← (const byte) sprites_irq::toSpritePtr2_return#0 -- vbuz1=vbuc1 
    lda #toSpritePtr2_return
    sta.z irq_sprite_ptr
    jmp __b5
    // sprites_irq::@1
  __b1:
    // PLAYFIELD_SPRITE_PTRS_1[0] = ptr++
    // [106] *((const byte*) PLAYFIELD_SPRITE_PTRS_1) ← (byte) sprites_irq::ptr#0 -- _deref_pbuc1=vbuxx 
    stx PLAYFIELD_SPRITE_PTRS_1
    // PLAYFIELD_SPRITE_PTRS_1[0] = ptr++;
    // [107] (byte) sprites_irq::ptr#1 ← ++ (byte) sprites_irq::ptr#0 -- vbuxx=_inc_vbuxx 
    inx
    // PLAYFIELD_SPRITE_PTRS_1[1] = ptr
    // [108] *((const byte*) PLAYFIELD_SPRITE_PTRS_1+(byte) 1) ← (byte) sprites_irq::ptr#1 -- _deref_pbuc1=vbuxx 
    stx PLAYFIELD_SPRITE_PTRS_1+1
    // PLAYFIELD_SPRITE_PTRS_1[2] = ptr++
    // [109] *((const byte*) PLAYFIELD_SPRITE_PTRS_1+(byte) 2) ← (byte) sprites_irq::ptr#1 -- _deref_pbuc1=vbuxx 
    stx PLAYFIELD_SPRITE_PTRS_1+2
    // PLAYFIELD_SPRITE_PTRS_1[2] = ptr++;
    // [110] (byte) sprites_irq::ptr#2 ← ++ (byte) sprites_irq::ptr#1 -- vbuaa=_inc_vbuxx 
    inx
    txa
    // PLAYFIELD_SPRITE_PTRS_1[3] = ptr
    // [111] *((const byte*) PLAYFIELD_SPRITE_PTRS_1+(byte) 3) ← (byte) sprites_irq::ptr#2 -- _deref_pbuc1=vbuaa 
    sta PLAYFIELD_SPRITE_PTRS_1+3
    jmp __b2
}
  // File Data
SIN:
.var AMPL = 200-21
    .for(var i=0; i<256; i++) {
  	  .byte 51+AMPL/2+sin(toRadians([i*360]/256))*AMPL/2
    }

.pc = PLAYFIELD_SPRITES "PLAYFIELD_SPRITES"
  .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000))
	// Put the sprites into memory 
	.for(var sy=0;sy<10;sy++) {
	    .var sprite_gfx_y = sy*20
		.for(var sx=0;sx<3;sx++) {
	    	.for (var y=0;y<21; y++) {
	    	    .var gfx_y =  sprite_gfx_y + mod(2100+y-sprite_gfx_y,21)
		    	.for (var c=0; c<3; c++) {
	            	.byte sprites.getSinglecolorByte(sx*3+c,gfx_y)
	            }
	        }
	    	.byte 0
	  	}
	}

.pc = SIN_SPRITE "SIN_SPRITE"
  .fill $40, $ff


