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

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  (byte*) SPRITES_XPOS#0 ← ((byte*)) (number) $d000
  (byte*) SPRITES_YPOS#0 ← ((byte*)) (number) $d001
  (byte*) SPRITES_XMSB#0 ← ((byte*)) (number) $d010
  (byte*) RASTER#0 ← ((byte*)) (number) $d012
  (byte*) SPRITES_ENABLE#0 ← ((byte*)) (number) $d015
  (byte*) SPRITES_EXPAND_Y#0 ← ((byte*)) (number) $d017
  (byte*) SPRITES_EXPAND_X#0 ← ((byte*)) (number) $d01d
  (byte*) SPRITES_COLS#0 ← ((byte*)) (number) $d027
  (byte) WHITE#0 ← (number) 1
  to:@4
@4: scope:[]  from @begin
  (byte*) SCREEN#0 ← ((byte*)) (number) $400
  (byte*~) $0 ← (byte*) SCREEN#0 + (number) $3f8
  (byte*) SPRITES_PTR#0 ← (byte*~) $0
  (byte*) SPRITE#0 ← ((byte*)) (number) $2000
  to:@6
main: scope:[main]  from @7
  (signed word) yvel_init#19 ← phi( @7/(signed word) yvel_init#16 )
  (signed word) xvel#19 ← phi( @7/(signed word) xvel#15 )
  (signed word) ypos#19 ← phi( @7/(signed word) ypos#15 )
  (signed word) xpos#19 ← phi( @7/(signed word) xpos#15 )
  (signed word) yvel#17 ← phi( @7/(signed word) yvel#14 )
  call init 
  to:main::@5
main::@5: scope:[main]  from main
  (signed word) yvel_init#18 ← phi( main/(signed word) yvel_init#19 )
  (signed word) xvel#18 ← phi( main/(signed word) xvel#19 )
  (signed word) ypos#18 ← phi( main/(signed word) ypos#19 )
  (signed word) xpos#18 ← phi( main/(signed word) xpos#19 )
  (signed word) yvel#16 ← phi( main/(signed word) yvel#17 )
  to:main::@2
main::@2: scope:[main]  from main::@2 main::@5 main::@6
  (signed word) yvel_init#17 ← phi( main::@2/(signed word) yvel_init#17 main::@5/(signed word) yvel_init#18 main::@6/(signed word) yvel_init#0 )
  (signed word) xvel#16 ← phi( main::@2/(signed word) xvel#16 main::@5/(signed word) xvel#18 main::@6/(signed word) xvel#0 )
  (signed word) ypos#16 ← phi( main::@2/(signed word) ypos#16 main::@5/(signed word) ypos#18 main::@6/(signed word) ypos#0 )
  (signed word) xpos#16 ← phi( main::@2/(signed word) xpos#16 main::@5/(signed word) xpos#18 main::@6/(signed word) xpos#0 )
  (signed word) yvel#15 ← phi( main::@2/(signed word) yvel#15 main::@5/(signed word) yvel#16 main::@6/(signed word) yvel#0 )
  (bool~) main::$1 ← *((byte*) RASTER#0) != (number) $ff
  if((bool~) main::$1) goto main::@2
  to:main::@3
main::@3: scope:[main]  from main::@2
  (signed word) yvel_init#13 ← phi( main::@2/(signed word) yvel_init#17 )
  (signed word) xvel#12 ← phi( main::@2/(signed word) xvel#16 )
  (signed word) ypos#13 ← phi( main::@2/(signed word) ypos#16 )
  (signed word) xpos#12 ← phi( main::@2/(signed word) xpos#16 )
  (signed word) yvel#12 ← phi( main::@2/(signed word) yvel#15 )
  call anim 
  to:main::@6
main::@6: scope:[main]  from main::@3
  (signed word) yvel_init#7 ← phi( main::@3/(signed word) yvel_init#5 )
  (signed word) xvel#6 ← phi( main::@3/(signed word) xvel#4 )
  (signed word) ypos#7 ← phi( main::@3/(signed word) ypos#5 )
  (signed word) xpos#7 ← phi( main::@3/(signed word) xpos#5 )
  (signed word) yvel#7 ← phi( main::@3/(signed word) yvel#5 )
  (signed word) yvel#0 ← (signed word) yvel#7
  (signed word) xpos#0 ← (signed word) xpos#7
  (signed word) ypos#0 ← (signed word) ypos#7
  (signed word) xvel#0 ← (signed word) xvel#6
  (signed word) yvel_init#0 ← (signed word) yvel_init#7
  if(true) goto main::@2
  to:main::@return
main::@return: scope:[main]  from main::@6
  (signed word) yvel_init#8 ← phi( main::@6/(signed word) yvel_init#0 )
  (signed word) xvel#7 ← phi( main::@6/(signed word) xvel#0 )
  (signed word) ypos#8 ← phi( main::@6/(signed word) ypos#0 )
  (signed word) xpos#8 ← phi( main::@6/(signed word) xpos#0 )
  (signed word) yvel#8 ← phi( main::@6/(signed word) yvel#0 )
  (signed word) yvel#1 ← (signed word) yvel#8
  (signed word) xpos#1 ← (signed word) xpos#8
  (signed word) ypos#1 ← (signed word) ypos#8
  (signed word) xvel#1 ← (signed word) xvel#7
  (signed word) yvel_init#1 ← (signed word) yvel_init#8
  return 
  to:@return
init: scope:[init]  from main
  *((byte*) SPRITES_ENABLE#0) ← (number) 1
  *((byte*) SPRITES_EXPAND_X#0) ← (number) 0
  *((byte*) SPRITES_EXPAND_Y#0) ← (number) 0
  *((byte*) SPRITES_XPOS#0 + (number) 0) ← (number) $64
  *((byte*) SPRITES_YPOS#0 + (number) 0) ← (number) $64
  *((byte*) SPRITES_COLS#0 + (number) 0) ← (byte) WHITE#0
  (byte*~) init::$0 ← (byte*) SPRITE#0 / (number) $40
  (byte~) init::$1 ← ((byte)) (byte*~) init::$0
  *((byte*) SPRITES_PTR#0 + (number) 0) ← (byte~) init::$1
  (byte*) init::sc#0 ← (byte*) SCREEN#0
  to:init::@1
init::@1: scope:[init]  from init init::@2
  (byte*) init::sc#2 ← phi( init/(byte*) init::sc#0 init::@2/(byte*) init::sc#1 )
  (byte*~) init::$2 ← (byte*) SCREEN#0 + (number) $3e8
  (bool~) init::$3 ← (byte*) init::sc#2 != (byte*~) init::$2
  if((bool~) init::$3) goto init::@2
  to:init::@3
init::@2: scope:[init]  from init::@1
  (byte*) init::sc#3 ← phi( init::@1/(byte*) init::sc#2 )
  *((byte*) init::sc#3) ← (byte) ' '
  (byte*) init::sc#1 ← ++ (byte*) init::sc#3
  to:init::@1
init::@3: scope:[init]  from init::@1
  (byte) init::i#0 ← (byte) 0
  to:init::@7
init::@7: scope:[init]  from init::@3 init::@7
  (byte) init::i#2 ← phi( init::@3/(byte) init::i#0 init::@7/(byte) init::i#1 )
  *((byte*) SPRITE#0 + (byte) init::i#2) ← (number) $ff
  (byte) init::i#1 ← (byte) init::i#2 + rangenext(0,$3f)
  (bool~) init::$4 ← (byte) init::i#1 != rangelast(0,$3f)
  if((bool~) init::$4) goto init::@7
  to:init::@return
init::@return: scope:[init]  from init::@7
  return 
  to:@return
@6: scope:[]  from @4
  (signed word) xpos#2 ← (number) 0
  (signed word) ypos#2 ← (number) 0
  (signed word) yvel_init#2 ← (number) $64
  (signed word) xvel#2 ← (number) $c8
  (signed word) yvel#2 ← (signed word) yvel_init#2
  (signed word) g#0 ← (number) -5
  to:@7
anim: scope:[anim]  from main::@3
  (signed word) yvel_init#14 ← phi( main::@3/(signed word) yvel_init#13 )
  (signed word) xvel#13 ← phi( main::@3/(signed word) xvel#12 )
  (signed word) xpos#13 ← phi( main::@3/(signed word) xpos#12 )
  (signed word) yvel#13 ← phi( main::@3/(signed word) yvel#12 )
  (signed word) ypos#9 ← phi( main::@3/(signed word) ypos#13 )
  (bool~) anim::$0 ← (signed word) ypos#9 < (number) 0
  (bool~) anim::$1 ← ! (bool~) anim::$0
  if((bool~) anim::$1) goto anim::@1
  to:anim::@2
anim::@1: scope:[anim]  from anim anim::@4
  (signed word) yvel_init#15 ← phi( anim/(signed word) yvel_init#14 anim::@4/(signed word) yvel_init#10 )
  (signed word) ypos#10 ← phi( anim/(signed word) ypos#9 anim::@4/(signed word) ypos#14 )
  (signed word) xvel#8 ← phi( anim/(signed word) xvel#13 anim::@4/(signed word) xvel#14 )
  (signed word) xpos#9 ← phi( anim/(signed word) xpos#13 anim::@4/(signed word) xpos#14 )
  (signed word) yvel#9 ← phi( anim/(signed word) yvel#13 anim::@4/(signed word) yvel#4 )
  (signed word~) anim::$2 ← (signed word) yvel#9 + (signed word) g#0
  (signed word) yvel#3 ← (signed word~) anim::$2
  (signed word~) anim::$3 ← (signed word) xpos#9 + (signed word) xvel#8
  (signed word) xpos#3 ← (signed word~) anim::$3
  (signed word~) anim::$4 ← (signed word) ypos#10 + (signed word) yvel#3
  (signed word) ypos#3 ← (signed word~) anim::$4
  (signed word~) anim::$5 ← (signed word) xpos#3 >> (number) 7
  (number~) anim::$6 ← (signed word~) anim::$5 + (number) $a0
  (signed word) anim::sprite_x#0 ← (number~) anim::$6
  (signed word~) anim::$7 ← (signed word) ypos#3 >> (number) 5
  (number~) anim::$8 ← (number) $e6 - (signed word~) anim::$7
  (signed word) anim::sprite_y#0 ← (number~) anim::$8
  (byte~) anim::$9 ← ((byte)) (signed word) anim::sprite_x#0
  *((byte*) SPRITES_XPOS#0 + (number) 0) ← (byte~) anim::$9
  (byte~) anim::$10 ← ((byte)) (signed word) anim::sprite_y#0
  *((byte*) SPRITES_YPOS#0 + (number) 0) ← (byte~) anim::$10
  (byte~) anim::$11 ← > (signed word) anim::sprite_x#0
  *((byte*) SPRITES_XMSB#0) ← (byte~) anim::$11
  to:anim::@return
anim::@2: scope:[anim]  from anim
  (signed word) yvel_init#9 ← phi( anim/(signed word) yvel_init#14 )
  (signed word) xvel#9 ← phi( anim/(signed word) xvel#13 )
  (signed word) xpos#4 ← (number) 0
  (signed word) ypos#4 ← (number) 0
  (signed word~) anim::$12 ← - (signed word) xvel#9
  (signed word) xvel#3 ← (signed word~) anim::$12
  (number~) anim::$13 ← (signed word) yvel_init#9 - (number) $a
  (signed word) yvel_init#3 ← (number~) anim::$13
  (bool~) anim::$14 ← (signed word) yvel_init#3 < (number) -$c8
  (bool~) anim::$15 ← ! (bool~) anim::$14
  if((bool~) anim::$15) goto anim::@4
  to:anim::@3
anim::@4: scope:[anim]  from anim::@2 anim::@3
  (signed word) ypos#14 ← phi( anim::@2/(signed word) ypos#4 anim::@3/(signed word) ypos#17 )
  (signed word) xvel#14 ← phi( anim::@2/(signed word) xvel#3 anim::@3/(signed word) xvel#17 )
  (signed word) xpos#14 ← phi( anim::@2/(signed word) xpos#4 anim::@3/(signed word) xpos#17 )
  (signed word) yvel_init#10 ← phi( anim::@2/(signed word) yvel_init#3 anim::@3/(signed word) yvel_init#4 )
  (signed word) yvel#4 ← (signed word) yvel_init#10
  to:anim::@1
anim::@3: scope:[anim]  from anim::@2
  (signed word) ypos#17 ← phi( anim::@2/(signed word) ypos#4 )
  (signed word) xvel#17 ← phi( anim::@2/(signed word) xvel#3 )
  (signed word) xpos#17 ← phi( anim::@2/(signed word) xpos#4 )
  (signed word) yvel_init#4 ← (number) $c8
  to:anim::@4
anim::@return: scope:[anim]  from anim::@1
  (signed word) yvel_init#11 ← phi( anim::@1/(signed word) yvel_init#15 )
  (signed word) xvel#10 ← phi( anim::@1/(signed word) xvel#8 )
  (signed word) ypos#11 ← phi( anim::@1/(signed word) ypos#3 )
  (signed word) xpos#10 ← phi( anim::@1/(signed word) xpos#3 )
  (signed word) yvel#10 ← phi( anim::@1/(signed word) yvel#3 )
  (signed word) yvel#5 ← (signed word) yvel#10
  (signed word) xpos#5 ← (signed word) xpos#10
  (signed word) ypos#5 ← (signed word) ypos#11
  (signed word) xvel#4 ← (signed word) xvel#10
  (signed word) yvel_init#5 ← (signed word) yvel_init#11
  return 
  to:@return
@7: scope:[]  from @6
  (signed word) yvel_init#16 ← phi( @6/(signed word) yvel_init#2 )
  (signed word) xvel#15 ← phi( @6/(signed word) xvel#2 )
  (signed word) ypos#15 ← phi( @6/(signed word) ypos#2 )
  (signed word) xpos#15 ← phi( @6/(signed word) xpos#2 )
  (signed word) yvel#14 ← phi( @6/(signed word) yvel#2 )
  call main 
  to:@8
@8: scope:[]  from @7
  (signed word) yvel_init#12 ← phi( @7/(signed word) yvel_init#1 )
  (signed word) xvel#11 ← phi( @7/(signed word) xvel#1 )
  (signed word) ypos#12 ← phi( @7/(signed word) ypos#1 )
  (signed word) xpos#11 ← phi( @7/(signed word) xpos#1 )
  (signed word) yvel#11 ← phi( @7/(signed word) yvel#1 )
  (signed word) yvel#6 ← (signed word) yvel#11
  (signed word) xpos#6 ← (signed word) xpos#11
  (signed word) ypos#6 ← (signed word) ypos#12
  (signed word) xvel#5 ← (signed word) xvel#11
  (signed word) yvel_init#6 ← (signed word) yvel_init#12
  to:@end
@end: scope:[]  from @8

SYMBOL TABLE SSA
(byte*~) $0
(label) @4
(label) @6
(label) @7
(label) @8
(label) @begin
(label) @end
(byte*) RASTER
(byte*) RASTER#0
(byte*) SCREEN
(byte*) SCREEN#0
(byte*) SPRITE
(byte*) SPRITE#0
(byte*) SPRITES_COLS
(byte*) SPRITES_COLS#0
(byte*) SPRITES_ENABLE
(byte*) SPRITES_ENABLE#0
(byte*) SPRITES_EXPAND_X
(byte*) SPRITES_EXPAND_X#0
(byte*) SPRITES_EXPAND_Y
(byte*) SPRITES_EXPAND_Y#0
(byte*) SPRITES_PTR
(byte*) SPRITES_PTR#0
(byte*) SPRITES_XMSB
(byte*) SPRITES_XMSB#0
(byte*) SPRITES_XPOS
(byte*) SPRITES_XPOS#0
(byte*) SPRITES_YPOS
(byte*) SPRITES_YPOS#0
(byte) WHITE
(byte) WHITE#0
(void()) anim()
(bool~) anim::$0
(bool~) anim::$1
(byte~) anim::$10
(byte~) anim::$11
(signed word~) anim::$12
(number~) anim::$13
(bool~) anim::$14
(bool~) anim::$15
(signed word~) anim::$2
(signed word~) anim::$3
(signed word~) anim::$4
(signed word~) anim::$5
(number~) anim::$6
(signed word~) anim::$7
(number~) anim::$8
(byte~) anim::$9
(label) anim::@1
(label) anim::@2
(label) anim::@3
(label) anim::@4
(label) anim::@return
(signed word) anim::sprite_x
(signed word) anim::sprite_x#0
(signed word) anim::sprite_y
(signed word) anim::sprite_y#0
(signed word) g
(signed word) g#0
(void()) init()
(byte*~) init::$0
(byte~) init::$1
(byte*~) init::$2
(bool~) init::$3
(bool~) init::$4
(label) init::@1
(label) init::@2
(label) init::@3
(label) init::@7
(label) init::@return
(byte) init::i
(byte) init::i#0
(byte) init::i#1
(byte) init::i#2
(byte*) init::sc
(byte*) init::sc#0
(byte*) init::sc#1
(byte*) init::sc#2
(byte*) init::sc#3
(void()) main()
(bool~) main::$1
(label) main::@2
(label) main::@3
(label) main::@5
(label) main::@6
(label) main::@return
(signed word) xpos
(signed word) xpos#0
(signed word) xpos#1
(signed word) xpos#10
(signed word) xpos#11
(signed word) xpos#12
(signed word) xpos#13
(signed word) xpos#14
(signed word) xpos#15
(signed word) xpos#16
(signed word) xpos#17
(signed word) xpos#18
(signed word) xpos#19
(signed word) xpos#2
(signed word) xpos#3
(signed word) xpos#4
(signed word) xpos#5
(signed word) xpos#6
(signed word) xpos#7
(signed word) xpos#8
(signed word) xpos#9
(signed word) xvel
(signed word) xvel#0
(signed word) xvel#1
(signed word) xvel#10
(signed word) xvel#11
(signed word) xvel#12
(signed word) xvel#13
(signed word) xvel#14
(signed word) xvel#15
(signed word) xvel#16
(signed word) xvel#17
(signed word) xvel#18
(signed word) xvel#19
(signed word) xvel#2
(signed word) xvel#3
(signed word) xvel#4
(signed word) xvel#5
(signed word) xvel#6
(signed word) xvel#7
(signed word) xvel#8
(signed word) xvel#9
(signed word) ypos
(signed word) ypos#0
(signed word) ypos#1
(signed word) ypos#10
(signed word) ypos#11
(signed word) ypos#12
(signed word) ypos#13
(signed word) ypos#14
(signed word) ypos#15
(signed word) ypos#16
(signed word) ypos#17
(signed word) ypos#18
(signed word) ypos#19
(signed word) ypos#2
(signed word) ypos#3
(signed word) ypos#4
(signed word) ypos#5
(signed word) ypos#6
(signed word) ypos#7
(signed word) ypos#8
(signed word) ypos#9
(signed word) yvel
(signed word) yvel#0
(signed word) yvel#1
(signed word) yvel#10
(signed word) yvel#11
(signed word) yvel#12
(signed word) yvel#13
(signed word) yvel#14
(signed word) yvel#15
(signed word) yvel#16
(signed word) yvel#17
(signed word) yvel#2
(signed word) yvel#3
(signed word) yvel#4
(signed word) yvel#5
(signed word) yvel#6
(signed word) yvel#7
(signed word) yvel#8
(signed word) yvel#9
(signed word) yvel_init
(signed word) yvel_init#0
(signed word) yvel_init#1
(signed word) yvel_init#10
(signed word) yvel_init#11
(signed word) yvel_init#12
(signed word) yvel_init#13
(signed word) yvel_init#14
(signed word) yvel_init#15
(signed word) yvel_init#16
(signed word) yvel_init#17
(signed word) yvel_init#18
(signed word) yvel_init#19
(signed word) yvel_init#2
(signed word) yvel_init#3
(signed word) yvel_init#4
(signed word) yvel_init#5
(signed word) yvel_init#6
(signed word) yvel_init#7
(signed word) yvel_init#8
(signed word) yvel_init#9

Adding number conversion cast (unumber) 1 in (byte) WHITE#0 ← (number) 1
Adding number conversion cast (unumber) $3f8 in (byte*~) $0 ← (byte*) SCREEN#0 + (number) $3f8
Adding number conversion cast (unumber) $ff in (bool~) main::$1 ← *((byte*) RASTER#0) != (number) $ff
Adding number conversion cast (unumber) 1 in *((byte*) SPRITES_ENABLE#0) ← (number) 1
Adding number conversion cast (unumber) 0 in *((byte*) SPRITES_EXPAND_X#0) ← (number) 0
Adding number conversion cast (unumber) 0 in *((byte*) SPRITES_EXPAND_Y#0) ← (number) 0
Adding number conversion cast (unumber) $64 in *((byte*) SPRITES_XPOS#0 + (number) 0) ← (number) $64
Adding number conversion cast (unumber) 0 in *((byte*) SPRITES_XPOS#0 + (number) 0) ← ((unumber)) (number) $64
Adding number conversion cast (unumber) $64 in *((byte*) SPRITES_YPOS#0 + (number) 0) ← (number) $64
Adding number conversion cast (unumber) 0 in *((byte*) SPRITES_YPOS#0 + (number) 0) ← ((unumber)) (number) $64
Adding number conversion cast (unumber) 0 in *((byte*) SPRITES_COLS#0 + (number) 0) ← (byte) WHITE#0
Adding number conversion cast (unumber) $40 in (byte*~) init::$0 ← (byte*) SPRITE#0 / (number) $40
Adding number conversion cast (unumber) 0 in *((byte*) SPRITES_PTR#0 + (number) 0) ← (byte~) init::$1
Adding number conversion cast (unumber) $3e8 in (byte*~) init::$2 ← (byte*) SCREEN#0 + (number) $3e8
Adding number conversion cast (unumber) $ff in *((byte*) SPRITE#0 + (byte) init::i#2) ← (number) $ff
Adding number conversion cast (snumber) 0 in (signed word) xpos#2 ← (number) 0
Adding number conversion cast (snumber) 0 in (signed word) ypos#2 ← (number) 0
Adding number conversion cast (snumber) $64 in (signed word) yvel_init#2 ← (number) $64
Adding number conversion cast (snumber) $c8 in (signed word) xvel#2 ← (number) $c8
Adding number conversion cast (snumber) -5 in (signed word) g#0 ← (number) -5
Adding number conversion cast (snumber) 0 in (bool~) anim::$0 ← (signed word) ypos#9 < (number) 0
Adding number conversion cast (snumber) 7 in (signed word~) anim::$5 ← (signed word) xpos#3 >> (number) 7
Adding number conversion cast (snumber) $a0 in (number~) anim::$6 ← (signed word~) anim::$5 + (number) $a0
Adding number conversion cast (snumber) anim::$6 in (number~) anim::$6 ← (signed word~) anim::$5 + (snumber)(number) $a0
Adding number conversion cast (snumber) 5 in (signed word~) anim::$7 ← (signed word) ypos#3 >> (number) 5
Adding number conversion cast (snumber) $e6 in (number~) anim::$8 ← (number) $e6 - (signed word~) anim::$7
Adding number conversion cast (snumber) anim::$8 in (number~) anim::$8 ← (snumber)(number) $e6 - (signed word~) anim::$7
Adding number conversion cast (unumber) 0 in *((byte*) SPRITES_XPOS#0 + (number) 0) ← (byte~) anim::$9
Adding number conversion cast (unumber) 0 in *((byte*) SPRITES_YPOS#0 + (number) 0) ← (byte~) anim::$10
Adding number conversion cast (snumber) 0 in (signed word) xpos#4 ← (number) 0
Adding number conversion cast (snumber) 0 in (signed word) ypos#4 ← (number) 0
Adding number conversion cast (snumber) $a in (number~) anim::$13 ← (signed word) yvel_init#9 - (number) $a
Adding number conversion cast (snumber) anim::$13 in (number~) anim::$13 ← (signed word) yvel_init#9 - (snumber)(number) $a
Adding number conversion cast (snumber) -$c8 in (bool~) anim::$14 ← (signed word) yvel_init#3 < (number) -$c8
Adding number conversion cast (snumber) $c8 in (signed word) yvel_init#4 ← (number) $c8
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) SPRITES_XPOS#0 ← (byte*)(number) $d000
Inlining cast (byte*) SPRITES_YPOS#0 ← (byte*)(number) $d001
Inlining cast (byte*) SPRITES_XMSB#0 ← (byte*)(number) $d010
Inlining cast (byte*) RASTER#0 ← (byte*)(number) $d012
Inlining cast (byte*) SPRITES_ENABLE#0 ← (byte*)(number) $d015
Inlining cast (byte*) SPRITES_EXPAND_Y#0 ← (byte*)(number) $d017
Inlining cast (byte*) SPRITES_EXPAND_X#0 ← (byte*)(number) $d01d
Inlining cast (byte*) SPRITES_COLS#0 ← (byte*)(number) $d027
Inlining cast (byte) WHITE#0 ← (unumber)(number) 1
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400
Inlining cast (byte*) SPRITE#0 ← (byte*)(number) $2000
Inlining cast *((byte*) SPRITES_ENABLE#0) ← (unumber)(number) 1
Inlining cast *((byte*) SPRITES_EXPAND_X#0) ← (unumber)(number) 0
Inlining cast *((byte*) SPRITES_EXPAND_Y#0) ← (unumber)(number) 0
Inlining cast *((byte*) SPRITES_XPOS#0 + (unumber)(number) 0) ← (unumber)(number) $64
Inlining cast *((byte*) SPRITES_YPOS#0 + (unumber)(number) 0) ← (unumber)(number) $64
Inlining cast (byte~) init::$1 ← (byte)(byte*~) init::$0
Inlining cast *((byte*) SPRITE#0 + (byte) init::i#2) ← (unumber)(number) $ff
Inlining cast (signed word) xpos#2 ← (snumber)(number) 0
Inlining cast (signed word) ypos#2 ← (snumber)(number) 0
Inlining cast (signed word) yvel_init#2 ← (snumber)(number) $64
Inlining cast (signed word) xvel#2 ← (snumber)(number) $c8
Inlining cast (signed word) g#0 ← (snumber)(number) -5
Inlining cast (byte~) anim::$9 ← (byte)(signed word) anim::sprite_x#0
Inlining cast (byte~) anim::$10 ← (byte)(signed word) anim::sprite_y#0
Inlining cast (signed word) xpos#4 ← (snumber)(number) 0
Inlining cast (signed word) ypos#4 ← (snumber)(number) 0
Inlining cast (signed word) yvel_init#4 ← (snumber)(number) $c8
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53248
Simplifying constant pointer cast (byte*) 53249
Simplifying constant pointer cast (byte*) 53264
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 53269
Simplifying constant pointer cast (byte*) 53271
Simplifying constant pointer cast (byte*) 53277
Simplifying constant pointer cast (byte*) 53287
Simplifying constant integer cast 1
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $3f8
Simplifying constant pointer cast (byte*) 8192
Simplifying constant integer cast $ff
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast $64
Simplifying constant integer cast 0
Simplifying constant integer cast $64
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast $40
Simplifying constant integer cast 0
Simplifying constant integer cast $3e8
Simplifying constant integer cast $ff
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast $64
Simplifying constant integer cast $c8
Simplifying constant integer cast -5
Simplifying constant integer cast 0
Simplifying constant integer cast 7
Simplifying constant integer cast $a0
Simplifying constant integer cast 5
Simplifying constant integer cast $e6
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast $a
Simplifying constant integer cast -$c8
Simplifying constant integer cast $c8
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Finalized unsigned number type (word) $3f8
Finalized unsigned number type (byte) $ff
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $64
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $64
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $40
Finalized unsigned number type (byte) 0
Finalized unsigned number type (word) $3e8
Finalized unsigned number type (byte) $ff
Finalized signed number type (signed byte) 0
Finalized signed number type (signed byte) 0
Finalized signed number type (signed byte) $64
Finalized signed number type (signed word) $c8
Finalized signed number type (signed byte) -5
Finalized signed number type (signed byte) 0
Finalized signed number type (signed byte) 7
Finalized signed number type (signed word) $a0
Finalized signed number type (signed byte) 5
Finalized signed number type (signed word) $e6
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized signed number type (signed byte) 0
Finalized signed number type (signed byte) 0
Finalized signed number type (signed byte) $a
Finalized signed number type (signed word) -$c8
Finalized signed number type (signed word) $c8
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to signed word in (snumber~) anim::$6 ← (signed word~) anim::$5 + (signed word) $a0
Inferred type updated to signed word in (snumber~) anim::$8 ← (signed word) $e6 - (signed word~) anim::$7
Inferred type updated to signed word in (snumber~) anim::$13 ← (signed word) yvel_init#9 - (signed byte) $a
Inversing boolean not [67] (bool~) anim::$1 ← (signed word) ypos#9 >= (signed byte) 0 from [66] (bool~) anim::$0 ← (signed word) ypos#9 < (signed byte) 0
Inversing boolean not [96] (bool~) anim::$15 ← (signed word) yvel_init#3 >= (signed word) -$c8 from [95] (bool~) anim::$14 ← (signed word) yvel_init#3 < (signed word) -$c8
Successful SSA optimization Pass2UnaryNotSimplification
Alias (byte*) SPRITES_PTR#0 = (byte*~) $0 
Alias (signed word) yvel#16 = (signed word) yvel#17 
Alias (signed word) xpos#18 = (signed word) xpos#19 
Alias (signed word) ypos#18 = (signed word) ypos#19 
Alias (signed word) xvel#18 = (signed word) xvel#19 
Alias (signed word) yvel_init#18 = (signed word) yvel_init#19 
Alias (signed word) yvel#12 = (signed word) yvel#15 
Alias (signed word) xpos#12 = (signed word) xpos#16 
Alias (signed word) ypos#13 = (signed word) ypos#16 
Alias (signed word) xvel#12 = (signed word) xvel#16 
Alias (signed word) yvel_init#13 = (signed word) yvel_init#17 
Alias (signed word) yvel#0 = (signed word) yvel#7 (signed word) yvel#8 (signed word) yvel#1 
Alias (signed word) xpos#0 = (signed word) xpos#7 (signed word) xpos#8 (signed word) xpos#1 
Alias (signed word) ypos#0 = (signed word) ypos#7 (signed word) ypos#8 (signed word) ypos#1 
Alias (signed word) xvel#0 = (signed word) xvel#6 (signed word) xvel#7 (signed word) xvel#1 
Alias (signed word) yvel_init#0 = (signed word) yvel_init#7 (signed word) yvel_init#8 (signed word) yvel_init#1 
Alias (byte*) init::sc#2 = (byte*) init::sc#3 
Alias (signed word) yvel#14 = (signed word) yvel#2 (signed word) yvel_init#2 (signed word) yvel_init#16 
Alias (signed word) yvel#10 = (signed word) yvel#3 (signed word~) anim::$2 (signed word) yvel#5 
Alias (signed word) xpos#10 = (signed word) xpos#3 (signed word~) anim::$3 (signed word) xpos#5 
Alias (signed word) ypos#11 = (signed word) ypos#3 (signed word~) anim::$4 (signed word) ypos#5 
Alias (signed word) anim::sprite_x#0 = (signed word~) anim::$6 
Alias (signed word) anim::sprite_y#0 = (signed word~) anim::$8 
Alias (signed word) xvel#13 = (signed word) xvel#9 
Alias (signed word) yvel_init#14 = (signed word) yvel_init#9 
Alias (signed word) xvel#17 = (signed word) xvel#3 (signed word~) anim::$12 
Alias (signed word) yvel_init#3 = (signed word~) anim::$13 
Alias (signed word) yvel#4 = (signed word) yvel_init#10 
Alias (signed word) xpos#17 = (signed word) xpos#4 
Alias (signed word) ypos#17 = (signed word) ypos#4 
Alias (signed word) xvel#10 = (signed word) xvel#8 (signed word) xvel#4 
Alias (signed word) yvel_init#11 = (signed word) yvel_init#15 (signed word) yvel_init#5 
Alias (signed word) xpos#15 = (signed word) xpos#2 
Alias (signed word) ypos#15 = (signed word) ypos#2 
Alias (signed word) xvel#15 = (signed word) xvel#2 
Alias (signed word) yvel#11 = (signed word) yvel#6 
Alias (signed word) xpos#11 = (signed word) xpos#6 
Alias (signed word) ypos#12 = (signed word) ypos#6 
Alias (signed word) xvel#11 = (signed word) xvel#5 
Alias (signed word) yvel_init#12 = (signed word) yvel_init#6 
Successful SSA optimization Pass2AliasElimination
Alias (signed word) xpos#14 = (signed word) xpos#17 
Alias (signed word) xvel#14 = (signed word) xvel#17 
Alias (signed word) ypos#14 = (signed word) ypos#17 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (signed word) yvel#16 (signed word) yvel#14
Identical Phi Values (signed word) xpos#18 (signed word) xpos#15
Identical Phi Values (signed word) ypos#18 (signed word) ypos#15
Identical Phi Values (signed word) xvel#18 (signed word) xvel#15
Identical Phi Values (signed word) yvel_init#18 (signed word) yvel#14
Identical Phi Values (signed word) yvel#0 (signed word) yvel#10
Identical Phi Values (signed word) xpos#0 (signed word) xpos#10
Identical Phi Values (signed word) ypos#0 (signed word) ypos#11
Identical Phi Values (signed word) xvel#0 (signed word) xvel#10
Identical Phi Values (signed word) yvel_init#0 (signed word) yvel_init#11
Identical Phi Values (signed word) ypos#9 (signed word) ypos#13
Identical Phi Values (signed word) yvel#13 (signed word) yvel#12
Identical Phi Values (signed word) xpos#13 (signed word) xpos#12
Identical Phi Values (signed word) xvel#13 (signed word) xvel#12
Identical Phi Values (signed word) yvel_init#14 (signed word) yvel_init#13
Identical Phi Values (signed word) yvel#11 (signed word) yvel#0
Identical Phi Values (signed word) xpos#11 (signed word) xpos#0
Identical Phi Values (signed word) ypos#12 (signed word) ypos#0
Identical Phi Values (signed word) xvel#11 (signed word) xvel#0
Identical Phi Values (signed word) yvel_init#12 (signed word) yvel_init#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::$1 [18] if(*((byte*) RASTER#0)!=(byte) $ff) goto main::@2
Simple Condition (bool~) init::$3 [48] if((byte*) init::sc#2!=(byte*~) init::$2) goto init::@2
Simple Condition (bool~) init::$4 [57] if((byte) init::i#1!=rangelast(0,$3f)) goto init::@7
Simple Condition (bool~) anim::$1 [68] if((signed word) ypos#13>=(signed byte) 0) goto anim::@1
Simple Condition (bool~) anim::$15 [97] if((signed word) yvel_init#3>=(signed word) -$c8) goto anim::@4
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) SPRITES_XPOS#0 = (byte*) 53248
Constant (const byte*) SPRITES_YPOS#0 = (byte*) 53249
Constant (const byte*) SPRITES_XMSB#0 = (byte*) 53264
Constant (const byte*) RASTER#0 = (byte*) 53266
Constant (const byte*) SPRITES_ENABLE#0 = (byte*) 53269
Constant (const byte*) SPRITES_EXPAND_Y#0 = (byte*) 53271
Constant (const byte*) SPRITES_EXPAND_X#0 = (byte*) 53277
Constant (const byte*) SPRITES_COLS#0 = (byte*) 53287
Constant (const byte) WHITE#0 = 1
Constant (const byte*) SCREEN#0 = (byte*) 1024
Constant (const byte*) SPRITE#0 = (byte*) 8192
Constant (const byte) init::i#0 = 0
Constant (const signed word) xpos#15 = 0
Constant (const signed word) ypos#15 = 0
Constant (const signed word) yvel#14 = $64
Constant (const signed word) xvel#15 = $c8
Constant (const signed word) g#0 = -5
Constant (const signed word) xpos#14 = 0
Constant (const signed word) ypos#14 = 0
Constant (const signed word) yvel_init#4 = $c8
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) init::sc#0 = SCREEN#0
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [27] if(true) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [55] init::i#1 ← ++ init::i#2 to ++
Resolved ranged comparison value [57] if(init::i#1!=rangelast(0,$3f)) goto init::@7 to (number) $40
Simplifying expression containing zero SPRITES_XPOS#0 in [38] *((const byte*) SPRITES_XPOS#0 + (byte) 0) ← (byte) $64
Simplifying expression containing zero SPRITES_YPOS#0 in [39] *((const byte*) SPRITES_YPOS#0 + (byte) 0) ← (byte) $64
Simplifying expression containing zero SPRITES_COLS#0 in [40] *((const byte*) SPRITES_COLS#0 + (byte) 0) ← (const byte) WHITE#0
Simplifying expression containing zero SPRITES_PTR#0 in [43] *((byte*) SPRITES_PTR#0 + (byte) 0) ← (byte~) init::$1
Simplifying expression containing zero SPRITES_XPOS#0 in [83] *((const byte*) SPRITES_XPOS#0 + (byte) 0) ← (byte~) anim::$9
Simplifying expression containing zero SPRITES_YPOS#0 in [85] *((const byte*) SPRITES_YPOS#0 + (byte) 0) ← (byte~) anim::$10
Successful SSA optimization PassNSimplifyExpressionWithZero
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Adding number conversion cast (unumber) $40 in if((byte) init::i#1!=(number) $40) goto init::@7
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast $40
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $40
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [0] (byte*) SPRITES_PTR#0 ← (const byte*) SCREEN#0 + (word) $3f8
Constant right-side identified [11] (byte*~) init::$0 ← (const byte*) SPRITE#0 / (byte) $40
Constant right-side identified [15] (byte*~) init::$2 ← (const byte*) SCREEN#0 + (word) $3e8
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) SPRITES_PTR#0 = SCREEN#0+$3f8
Constant (const byte*) init::$0 = SPRITE#0/$40
Constant (const byte*) init::$2 = SCREEN#0+$3e8
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (byte)init::$0 in [12] (byte~) init::$1 ← (byte)(const byte*) init::$0
Successful SSA optimization Pass2ConstantValues
Successful SSA optimization Pass2LoopHeadConstantIdentification
Alias (byte*) init::sc#1 = (byte*) init::sc#2 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte*) init::sc#5 (const byte*) init::sc#0
Successful SSA optimization Pass2IdenticalPhiElimination
Constant (const byte) init::$1 = (byte)init::$0
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [45] if((const byte*) init::sc#0!=(const byte*) init::$2) goto init::@2
Successful SSA optimization Pass2ConstantIfs
Inlining constant with var siblings (const byte) init::i#0
Inlining constant with var siblings (const byte*) init::sc#0
Inlining constant with var siblings (const signed word) xpos#15
Inlining constant with var siblings (const signed word) ypos#15
Inlining constant with var siblings (const signed word) yvel#14
Inlining constant with var siblings (const signed word) xvel#15
Inlining constant with var siblings (const signed word) xpos#14
Inlining constant with var siblings (const signed word) ypos#14
Inlining constant with var siblings (const signed word) yvel_init#4
Constant inlined xpos#15 = (signed byte) 0
Constant inlined xpos#14 = (signed byte) 0
Constant inlined yvel_init#4 = (signed word) $c8
Constant inlined init::i#0 = (byte) 0
Constant inlined init::sc#0 = (const byte*) SCREEN#0
Constant inlined xvel#15 = (signed word) $c8
Constant inlined ypos#14 = (signed byte) 0
Constant inlined yvel#14 = (signed byte) $64
Constant inlined init::$2 = (const byte*) SCREEN#0+(word) $3e8
Constant inlined ypos#15 = (signed byte) 0
Constant inlined init::$1 = (byte)(const byte*) SPRITE#0/(byte) $40
Constant inlined init::$0 = (const byte*) SPRITE#0/(byte) $40
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@7(between main::@2 and main::@2)
Added new block during phi lifting init::@9(between init::@1 and init::@2)
Added new block during phi lifting init::@10(between init::@7 and init::@7)
Added new block during phi lifting anim::@5(between anim and anim::@1)
Added new block during phi lifting anim::@6(between anim::@2 and anim::@4)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @4
Adding NOP phi() at start of @6
Adding NOP phi() at start of @7
Adding NOP phi() at start of @8
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@5
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of anim::@3
Adding NOP phi() at start of init::@1_1
Adding NOP phi() at start of init::@3
CALL GRAPH
Calls in [] to main:4 
Calls in [main] to init:8 anim:13 

Created 13 initial phi equivalence classes
Coalesced [14] yvel#19 ← yvel#10
Coalesced [15] xpos#21 ← xpos#10
Coalesced [16] ypos#21 ← ypos#11
Coalesced [17] xvel#21 ← xvel#10
Coalesced [18] yvel_init#21 ← yvel_init#11
Coalesced (already) [19] yvel#18 ← yvel#12
Coalesced (already) [20] xpos#20 ← xpos#12
Coalesced (already) [21] ypos#20 ← ypos#13
Coalesced (already) [22] xvel#20 ← xvel#12
Coalesced (already) [23] yvel_init#20 ← yvel_init#13
Not coalescing [30] yvel#21 ← yvel#4
Coalesced [31] xvel#23 ← xvel#14
Coalesced [32] yvel_init#23 ← yvel#4
Coalesced [48] yvel#22 ← yvel_init#3
Coalesced [49] yvel#20 ← yvel#12
Coalesced [50] xpos#22 ← xpos#12
Coalesced (already) [51] xvel#22 ← xvel#12
Coalesced [52] ypos#22 ← ypos#13
Coalesced (already) [53] yvel_init#22 ← yvel_init#13
Coalesced [72] init::i#3 ← init::i#1
Coalesced [73] init::sc#6 ← init::sc#1
Coalesced down to 7 phi equivalence classes
Culled Empty Block (label) @4
Culled Empty Block (label) @6
Culled Empty Block (label) @8
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@6
Culled Empty Block (label) main::@7
Culled Empty Block (label) anim::@3
Culled Empty Block (label) anim::@5
Culled Empty Block (label) init::@1_1
Culled Empty Block (label) init::@3
Culled Empty Block (label) init::@10
Culled Empty Block (label) init::@9
Renumbering block @7 to @1
Renumbering block main::@2 to main::@1
Renumbering block main::@3 to main::@2
Renumbering block init::@7 to init::@3
Renumbering block anim::@4 to anim::@3
Renumbering block anim::@6 to anim::@4
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of anim::@4

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  [1] phi()
  [2] call main 
  to:@end
@end: scope:[]  from @1
  [3] phi()
main: scope:[main]  from @1
  [4] phi()
  [5] call init 
  to:main::@1
main::@1: scope:[main]  from main main::@1 main::@2
  [6] (signed word) yvel_init#13 ← phi( main::@1/(signed word) yvel_init#13 main/(signed byte) $64 main::@2/(signed word) yvel_init#11 )
  [6] (signed word) xvel#12 ← phi( main::@1/(signed word) xvel#12 main/(signed word) $c8 main::@2/(signed word) xvel#10 )
  [6] (signed word) ypos#13 ← phi( main::@1/(signed word) ypos#13 main/(signed byte) 0 main::@2/(signed word) ypos#11 )
  [6] (signed word) xpos#12 ← phi( main::@1/(signed word) xpos#12 main/(signed byte) 0 main::@2/(signed word) xpos#10 )
  [6] (signed word) yvel#12 ← phi( main::@1/(signed word) yvel#12 main/(signed byte) $64 main::@2/(signed word) yvel#10 )
  [7] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@1
  [8] phi()
  [9] call anim 
  to:main::@1
anim: scope:[anim]  from main::@2
  [10] if((signed word) ypos#13>=(signed byte) 0) goto anim::@1
  to:anim::@2
anim::@2: scope:[anim]  from anim
  [11] (signed word) xvel#14 ← - (signed word) xvel#12
  [12] (signed word) yvel_init#3 ← (signed word) yvel_init#13 - (signed byte) $a
  [13] if((signed word) yvel_init#3>=(signed word) -$c8) goto anim::@4
  to:anim::@3
anim::@4: scope:[anim]  from anim::@2
  [14] phi()
  to:anim::@3
anim::@3: scope:[anim]  from anim::@2 anim::@4
  [15] (signed word) yvel#4 ← phi( anim::@4/(signed word) yvel_init#3 anim::@2/(signed word) $c8 )
  [16] (signed word~) yvel#21 ← (signed word) yvel#4
  to:anim::@1
anim::@1: scope:[anim]  from anim anim::@3
  [17] (signed word) yvel_init#11 ← phi( anim/(signed word) yvel_init#13 anim::@3/(signed word) yvel#4 )
  [17] (signed word) ypos#10 ← phi( anim/(signed word) ypos#13 anim::@3/(signed byte) 0 )
  [17] (signed word) xvel#10 ← phi( anim/(signed word) xvel#12 anim::@3/(signed word) xvel#14 )
  [17] (signed word) xpos#9 ← phi( anim/(signed word) xpos#12 anim::@3/(signed byte) 0 )
  [17] (signed word) yvel#9 ← phi( anim/(signed word) yvel#12 anim::@3/(signed word~) yvel#21 )
  [18] (signed word) yvel#10 ← (signed word) yvel#9 + (const signed word) g#0
  [19] (signed word) xpos#10 ← (signed word) xpos#9 + (signed word) xvel#10
  [20] (signed word) ypos#11 ← (signed word) ypos#10 + (signed word) yvel#10
  [21] (signed word~) anim::$5 ← (signed word) xpos#10 >> (signed byte) 7
  [22] (signed word) anim::sprite_x#0 ← (signed word~) anim::$5 + (signed word) $a0
  [23] (signed word~) anim::$7 ← (signed word) ypos#11 >> (signed byte) 5
  [24] (signed word) anim::sprite_y#0 ← (signed word) $e6 - (signed word~) anim::$7
  [25] (byte~) anim::$9 ← (byte)(signed word) anim::sprite_x#0
  [26] *((const byte*) SPRITES_XPOS#0) ← (byte~) anim::$9
  [27] (byte~) anim::$10 ← (byte)(signed word) anim::sprite_y#0
  [28] *((const byte*) SPRITES_YPOS#0) ← (byte~) anim::$10
  [29] (byte~) anim::$11 ← > (signed word) anim::sprite_x#0
  [30] *((const byte*) SPRITES_XMSB#0) ← (byte~) anim::$11
  to:anim::@return
anim::@return: scope:[anim]  from anim::@1
  [31] return 
  to:@return
init: scope:[init]  from main
  [32] *((const byte*) SPRITES_ENABLE#0) ← (byte) 1
  [33] *((const byte*) SPRITES_EXPAND_X#0) ← (byte) 0
  [34] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte) 0
  [35] *((const byte*) SPRITES_XPOS#0) ← (byte) $64
  [36] *((const byte*) SPRITES_YPOS#0) ← (byte) $64
  [37] *((const byte*) SPRITES_COLS#0) ← (const byte) WHITE#0
  [38] *((const byte*) SPRITES_PTR#0) ← (byte)(const byte*) SPRITE#0/(byte) $40
  to:init::@2
init::@2: scope:[init]  from init init::@1
  [39] (byte*) init::sc#4 ← phi( init::@1/(byte*) init::sc#1 init/(const byte*) SCREEN#0 )
  [40] *((byte*) init::sc#4) ← (byte) ' '
  [41] (byte*) init::sc#1 ← ++ (byte*) init::sc#4
  to:init::@1
init::@1: scope:[init]  from init::@2
  [42] if((byte*) init::sc#1!=(const byte*) SCREEN#0+(word) $3e8) goto init::@2
  to:init::@3
init::@3: scope:[init]  from init::@1 init::@3
  [43] (byte) init::i#2 ← phi( init::@1/(byte) 0 init::@3/(byte) init::i#1 )
  [44] *((const byte*) SPRITE#0 + (byte) init::i#2) ← (byte) $ff
  [45] (byte) init::i#1 ← ++ (byte) init::i#2
  [46] if((byte) init::i#1!=(byte) $40) goto init::@3
  to:init::@return
init::@return: scope:[init]  from init::@3
  [47] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(byte*) RASTER
(byte*) SCREEN
(byte*) SPRITE
(byte*) SPRITES_COLS
(byte*) SPRITES_ENABLE
(byte*) SPRITES_EXPAND_X
(byte*) SPRITES_EXPAND_Y
(byte*) SPRITES_PTR
(byte*) SPRITES_XMSB
(byte*) SPRITES_XPOS
(byte*) SPRITES_YPOS
(byte) WHITE
(void()) anim()
(byte~) anim::$10 4.0
(byte~) anim::$11 4.0
(signed word~) anim::$5 4.0
(signed word~) anim::$7 4.0
(byte~) anim::$9 4.0
(signed word) anim::sprite_x
(signed word) anim::sprite_x#0 0.5714285714285714
(signed word) anim::sprite_y
(signed word) anim::sprite_y#0 0.6666666666666666
(signed word) g
(void()) init()
(byte) init::i
(byte) init::i#1 16.5
(byte) init::i#2 16.5
(byte*) init::sc
(byte*) init::sc#1 16.5
(byte*) init::sc#4 16.5
(void()) main()
(signed word) xpos
(signed word) xpos#10 1.0714285714285714
(signed word) xpos#12 53.75
(signed word) xpos#9 2.0
(signed word) xvel
(signed word) xvel#10 1.0625
(signed word) xvel#12 54.25
(signed word) xvel#14 0.6666666666666666
(signed word) ypos
(signed word) ypos#10 1.3333333333333333
(signed word) ypos#11 1.1538461538461537
(signed word) ypos#13 54.25
(signed word) yvel
(signed word) yvel#10 0.9999999999999999
(signed word) yvel#12 53.75
(signed word~) yvel#21 4.0
(signed word) yvel#4 3.0
(signed word) yvel#9 6.0
(signed word) yvel_init
(signed word) yvel_init#11 0.9375
(signed word) yvel_init#13 43.39999999999999
(signed word) yvel_init#3 2.0

Initial phi equivalence classes
[ xvel#12 xvel#10 xvel#14 ]
[ yvel_init#13 yvel_init#11 yvel#4 yvel_init#3 ]
[ yvel#9 yvel#12 yvel#10 yvel#21 ]
[ xpos#9 xpos#12 xpos#10 ]
[ ypos#10 ypos#13 ypos#11 ]
[ init::sc#4 init::sc#1 ]
[ init::i#2 init::i#1 ]
Added variable anim::$5 to zero page equivalence class [ anim::$5 ]
Added variable anim::sprite_x#0 to zero page equivalence class [ anim::sprite_x#0 ]
Added variable anim::$7 to zero page equivalence class [ anim::$7 ]
Added variable anim::sprite_y#0 to zero page equivalence class [ anim::sprite_y#0 ]
Added variable anim::$9 to zero page equivalence class [ anim::$9 ]
Added variable anim::$10 to zero page equivalence class [ anim::$10 ]
Added variable anim::$11 to zero page equivalence class [ anim::$11 ]
Complete equivalence classes
[ xvel#12 xvel#10 xvel#14 ]
[ yvel_init#13 yvel_init#11 yvel#4 yvel_init#3 ]
[ yvel#9 yvel#12 yvel#10 yvel#21 ]
[ xpos#9 xpos#12 xpos#10 ]
[ ypos#10 ypos#13 ypos#11 ]
[ init::sc#4 init::sc#1 ]
[ init::i#2 init::i#1 ]
[ anim::$5 ]
[ anim::sprite_x#0 ]
[ anim::$7 ]
[ anim::sprite_y#0 ]
[ anim::$9 ]
[ anim::$10 ]
[ anim::$11 ]
Allocated zp ZP_WORD:2 [ xvel#12 xvel#10 xvel#14 ]
Allocated zp ZP_WORD:4 [ yvel_init#13 yvel_init#11 yvel#4 yvel_init#3 ]
Allocated zp ZP_WORD:6 [ yvel#9 yvel#12 yvel#10 yvel#21 ]
Allocated zp ZP_WORD:8 [ xpos#9 xpos#12 xpos#10 ]
Allocated zp ZP_WORD:10 [ ypos#10 ypos#13 ypos#11 ]
Allocated zp ZP_WORD:12 [ init::sc#4 init::sc#1 ]
Allocated zp ZP_BYTE:14 [ init::i#2 init::i#1 ]
Allocated zp ZP_WORD:15 [ anim::$5 ]
Allocated zp ZP_WORD:17 [ anim::sprite_x#0 ]
Allocated zp ZP_WORD:19 [ anim::$7 ]
Allocated zp ZP_WORD:21 [ anim::sprite_y#0 ]
Allocated zp ZP_BYTE:23 [ anim::$9 ]
Allocated zp ZP_BYTE:24 [ anim::$10 ]
Allocated zp ZP_BYTE:25 [ anim::$11 ]

INITIAL ASM
Target platform is c64basic
  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label SPRITES_XPOS = $d000
  .label SPRITES_YPOS = $d001
  .label SPRITES_XMSB = $d010
  .label RASTER = $d012
  .label SPRITES_ENABLE = $d015
  .label SPRITES_EXPAND_Y = $d017
  .label SPRITES_EXPAND_X = $d01d
  .label SPRITES_COLS = $d027
  .const WHITE = 1
  .label SCREEN = $400
  .label SPRITE = $2000
  .const g = -5
  .label SPRITES_PTR = SCREEN+$3f8
  .label yvel_init = 4
  .label yvel = 4
  .label yvel_9 = 6
  .label xpos = 8
  .label ypos = $a
  .label yvel_10 = 6
  .label xvel = 2
  .label yvel_12 = 6
  .label yvel_21 = 6
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from_b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    // [5] call init 
    jsr init
    // [6] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    // [6] phi (signed word) yvel_init#13 = (signed byte) $64 [phi:main->main::@1#0] -- vwsz1=vbsc1 
    lda #<$64
    sta.z yvel_init
    lda #>$64
    sta.z yvel_init+1
    // [6] phi (signed word) xvel#12 = (signed word) $c8 [phi:main->main::@1#1] -- vwsz1=vwsc1 
    lda #<$c8
    sta.z xvel
    lda #>$c8
    sta.z xvel+1
    // [6] phi (signed word) ypos#13 = (signed byte) 0 [phi:main->main::@1#2] -- vwsz1=vbsc1 
    lda #<0
    sta.z ypos
    lda #>0
    sta.z ypos+1
    // [6] phi (signed word) xpos#12 = (signed byte) 0 [phi:main->main::@1#3] -- vwsz1=vbsc1 
    lda #<0
    sta.z xpos
    lda #>0
    sta.z xpos+1
    // [6] phi (signed word) yvel#12 = (signed byte) $64 [phi:main->main::@1#4] -- vwsz1=vbsc1 
    lda #<$64
    sta.z yvel_12
    lda #>$64
    sta.z yvel_12+1
    jmp b1
    // [6] phi from main::@1 main::@2 to main::@1 [phi:main::@1/main::@2->main::@1]
  b1_from_b1:
  b1_from_b2:
    // [6] phi (signed word) yvel_init#13 = (signed word) yvel_init#13 [phi:main::@1/main::@2->main::@1#0] -- register_copy 
    // [6] phi (signed word) xvel#12 = (signed word) xvel#12 [phi:main::@1/main::@2->main::@1#1] -- register_copy 
    // [6] phi (signed word) ypos#13 = (signed word) ypos#13 [phi:main::@1/main::@2->main::@1#2] -- register_copy 
    // [6] phi (signed word) xpos#12 = (signed word) xpos#12 [phi:main::@1/main::@2->main::@1#3] -- register_copy 
    // [6] phi (signed word) yvel#12 = (signed word) yvel#12 [phi:main::@1/main::@2->main::@1#4] -- register_copy 
    jmp b1
    // main::@1
  b1:
    // [7] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$ff
    cmp RASTER
    bne b1_from_b1
    // [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  b2_from_b1:
    jmp b2
    // main::@2
  b2:
    // [9] call anim 
    jsr anim
    jmp b1_from_b2
}
  // anim
anim: {
    .label _5 = $f
    .label _7 = $13
    .label _9 = $17
    .label _10 = $18
    .label _11 = $19
    .label sprite_x = $11
    .label sprite_y = $15
    // [10] if((signed word) ypos#13>=(signed byte) 0) goto anim::@1 -- vwsz1_ge_0_then_la1 
    lda.z ypos+1
    bpl b1_from_anim
    jmp b2
    // anim::@2
  b2:
    // [11] (signed word) xvel#14 ← - (signed word) xvel#12 -- vwsz1=_neg_vwsz1 
    sec
    lda #0
    sbc.z xvel
    sta.z xvel
    lda #0
    sbc.z xvel+1
    sta.z xvel+1
    // [12] (signed word) yvel_init#3 ← (signed word) yvel_init#13 - (signed byte) $a -- vwsz1=vwsz1_minus_vbsc1 
    lda.z yvel_init
    sec
    sbc #$a
    sta.z yvel_init
    lda.z yvel_init+1
    sbc #>$a
    sta.z yvel_init+1
    // [13] if((signed word) yvel_init#3>=(signed word) -$c8) goto anim::@4 -- vwsz1_ge_vwsc1_then_la1 
    lda.z yvel_init
    cmp #<-$c8
    lda.z yvel_init+1
    sbc #>-$c8
    bvc !+
    eor #$80
  !:
    bpl b4_from_b2
    // [15] phi from anim::@2 to anim::@3 [phi:anim::@2->anim::@3]
  b3_from_b2:
    // [15] phi (signed word) yvel#4 = (signed word) $c8 [phi:anim::@2->anim::@3#0] -- vwsz1=vwsc1 
    lda #<$c8
    sta.z yvel
    lda #>$c8
    sta.z yvel+1
    jmp b3
    // [14] phi from anim::@2 to anim::@4 [phi:anim::@2->anim::@4]
  b4_from_b2:
    jmp b4
    // anim::@4
  b4:
    // [15] phi from anim::@4 to anim::@3 [phi:anim::@4->anim::@3]
  b3_from_b4:
    // [15] phi (signed word) yvel#4 = (signed word) yvel_init#3 [phi:anim::@4->anim::@3#0] -- register_copy 
    jmp b3
    // anim::@3
  b3:
    // [16] (signed word~) yvel#21 ← (signed word) yvel#4 -- vwsz1=vwsz2 
    lda.z yvel
    sta.z yvel_21
    lda.z yvel+1
    sta.z yvel_21+1
    // [17] phi from anim::@3 to anim::@1 [phi:anim::@3->anim::@1]
  b1_from_b3:
    // [17] phi (signed word) yvel_init#11 = (signed word) yvel#4 [phi:anim::@3->anim::@1#0] -- register_copy 
    // [17] phi (signed word) ypos#10 = (signed byte) 0 [phi:anim::@3->anim::@1#1] -- vwsz1=vbsc1 
    lda #<0
    sta.z ypos
    lda #>0
    sta.z ypos+1
    // [17] phi (signed word) xvel#10 = (signed word) xvel#14 [phi:anim::@3->anim::@1#2] -- register_copy 
    // [17] phi (signed word) xpos#9 = (signed byte) 0 [phi:anim::@3->anim::@1#3] -- vwsz1=vbsc1 
    lda #<0
    sta.z xpos
    lda #>0
    sta.z xpos+1
    // [17] phi (signed word) yvel#9 = (signed word~) yvel#21 [phi:anim::@3->anim::@1#4] -- register_copy 
    jmp b1
    // [17] phi from anim to anim::@1 [phi:anim->anim::@1]
  b1_from_anim:
    // [17] phi (signed word) yvel_init#11 = (signed word) yvel_init#13 [phi:anim->anim::@1#0] -- register_copy 
    // [17] phi (signed word) ypos#10 = (signed word) ypos#13 [phi:anim->anim::@1#1] -- register_copy 
    // [17] phi (signed word) xvel#10 = (signed word) xvel#12 [phi:anim->anim::@1#2] -- register_copy 
    // [17] phi (signed word) xpos#9 = (signed word) xpos#12 [phi:anim->anim::@1#3] -- register_copy 
    // [17] phi (signed word) yvel#9 = (signed word) yvel#12 [phi:anim->anim::@1#4] -- register_copy 
    jmp b1
    // anim::@1
  b1:
    // [18] (signed word) yvel#10 ← (signed word) yvel#9 + (const signed word) g#0 -- vwsz1=vwsz1_plus_vwsc1 
    clc
    lda.z yvel_10
    adc #<g
    sta.z yvel_10
    lda.z yvel_10+1
    adc #>g
    sta.z yvel_10+1
    // [19] (signed word) xpos#10 ← (signed word) xpos#9 + (signed word) xvel#10 -- vwsz1=vwsz1_plus_vwsz2 
    lda.z xpos
    clc
    adc.z xvel
    sta.z xpos
    lda.z xpos+1
    adc.z xvel+1
    sta.z xpos+1
    // [20] (signed word) ypos#11 ← (signed word) ypos#10 + (signed word) yvel#10 -- vwsz1=vwsz1_plus_vwsz2 
    lda.z ypos
    clc
    adc.z yvel_10
    sta.z ypos
    lda.z ypos+1
    adc.z yvel_10+1
    sta.z ypos+1
    // [21] (signed word~) anim::$5 ← (signed word) xpos#10 >> (signed byte) 7 -- vwsz1=vwsz2_ror_7 
    lda.z xpos
    sta.z $ff
    lda.z xpos+1
    sta.z _5
    lda #0
    bit.z xpos+1
    bpl !+
    lda #$ff
  !:
    sta.z _5+1
    rol.z $ff
    rol.z _5
    rol.z _5+1
    // [22] (signed word) anim::sprite_x#0 ← (signed word~) anim::$5 + (signed word) $a0 -- vwsz1=vwsz2_plus_vwsc1 
    lda.z _5
    clc
    adc #<$a0
    sta.z sprite_x
    lda.z _5+1
    adc #>$a0
    sta.z sprite_x+1
    // [23] (signed word~) anim::$7 ← (signed word) ypos#11 >> (signed byte) 5 -- vwsz1=vwsz2_ror_5 
    lda.z ypos
    sta.z $ff
    lda.z ypos+1
    sta.z _7
    lda #0
    bit.z ypos+1
    bpl !+
    lda #$ff
  !:
    sta.z _7+1
    rol.z $ff
    rol.z _7
    rol.z _7+1
    rol.z $ff
    rol.z _7
    rol.z _7+1
    rol.z $ff
    rol.z _7
    rol.z _7+1
    // [24] (signed word) anim::sprite_y#0 ← (signed word) $e6 - (signed word~) anim::$7 -- vwsz1=vwsc1_minus_vwsz2 
    lda #<$e6
    sec
    sbc.z _7
    sta.z sprite_y
    lda #>$e6
    sbc.z _7+1
    sta.z sprite_y+1
    // [25] (byte~) anim::$9 ← (byte)(signed word) anim::sprite_x#0 -- vbuz1=_byte_vwsz2 
    lda.z sprite_x
    sta.z _9
    // [26] *((const byte*) SPRITES_XPOS#0) ← (byte~) anim::$9 -- _deref_pbuc1=vbuz1 
    lda.z _9
    sta SPRITES_XPOS
    // [27] (byte~) anim::$10 ← (byte)(signed word) anim::sprite_y#0 -- vbuz1=_byte_vwsz2 
    lda.z sprite_y
    sta.z _10
    // [28] *((const byte*) SPRITES_YPOS#0) ← (byte~) anim::$10 -- _deref_pbuc1=vbuz1 
    lda.z _10
    sta SPRITES_YPOS
    // [29] (byte~) anim::$11 ← > (signed word) anim::sprite_x#0 -- vbuz1=_hi_vwsz2 
    lda.z sprite_x+1
    sta.z _11
    // [30] *((const byte*) SPRITES_XMSB#0) ← (byte~) anim::$11 -- _deref_pbuc1=vbuz1 
    lda.z _11
    sta SPRITES_XMSB
    jmp breturn
    // anim::@return
  breturn:
    // [31] return 
    rts
}
  // init
// Fill and show a sprite, clear the screen
init: {
    .label sc = $c
    .label i = $e
    // [32] *((const byte*) SPRITES_ENABLE#0) ← (byte) 1 -- _deref_pbuc1=vbuc2 
    lda #1
    sta SPRITES_ENABLE
    // [33] *((const byte*) SPRITES_EXPAND_X#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SPRITES_EXPAND_X
    // [34] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SPRITES_EXPAND_Y
    // [35] *((const byte*) SPRITES_XPOS#0) ← (byte) $64 -- _deref_pbuc1=vbuc2 
    lda #$64
    sta SPRITES_XPOS
    // [36] *((const byte*) SPRITES_YPOS#0) ← (byte) $64 -- _deref_pbuc1=vbuc2 
    lda #$64
    sta SPRITES_YPOS
    // [37] *((const byte*) SPRITES_COLS#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 
    lda #WHITE
    sta SPRITES_COLS
    // [38] *((const byte*) SPRITES_PTR#0) ← (byte)(const byte*) SPRITE#0/(byte) $40 -- _deref_pbuc1=vbuc2 
    lda #SPRITE/$40
    sta SPRITES_PTR
    // [39] phi from init to init::@2 [phi:init->init::@2]
  b2_from_init:
    // [39] phi (byte*) init::sc#4 = (const byte*) SCREEN#0 [phi:init->init::@2#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z sc
    lda #>SCREEN
    sta.z sc+1
    jmp b2
    // [39] phi from init::@1 to init::@2 [phi:init::@1->init::@2]
  b2_from_b1:
    // [39] phi (byte*) init::sc#4 = (byte*) init::sc#1 [phi:init::@1->init::@2#0] -- register_copy 
    jmp b2
    // init::@2
  b2:
    // [40] *((byte*) init::sc#4) ← (byte) ' ' -- _deref_pbuz1=vbuc1 
    lda #' '
    ldy #0
    sta (sc),y
    // [41] (byte*) init::sc#1 ← ++ (byte*) init::sc#4 -- pbuz1=_inc_pbuz1 
    inc.z sc
    bne !+
    inc.z sc+1
  !:
    jmp b1
    // init::@1
  b1:
    // [42] if((byte*) init::sc#1!=(const byte*) SCREEN#0+(word) $3e8) goto init::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda.z sc+1
    cmp #>SCREEN+$3e8
    bne b2_from_b1
    lda.z sc
    cmp #<SCREEN+$3e8
    bne b2_from_b1
    // [43] phi from init::@1 to init::@3 [phi:init::@1->init::@3]
  b3_from_b1:
    // [43] phi (byte) init::i#2 = (byte) 0 [phi:init::@1->init::@3#0] -- vbuz1=vbuc1 
    lda #0
    sta.z i
    jmp b3
    // [43] phi from init::@3 to init::@3 [phi:init::@3->init::@3]
  b3_from_b3:
    // [43] phi (byte) init::i#2 = (byte) init::i#1 [phi:init::@3->init::@3#0] -- register_copy 
    jmp b3
    // init::@3
  b3:
    // [44] *((const byte*) SPRITE#0 + (byte) init::i#2) ← (byte) $ff -- pbuc1_derefidx_vbuz1=vbuc2 
    lda #$ff
    ldy.z i
    sta SPRITE,y
    // [45] (byte) init::i#1 ← ++ (byte) init::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [46] if((byte) init::i#1!=(byte) $40) goto init::@3 -- vbuz1_neq_vbuc1_then_la1 
    lda #$40
    cmp.z i
    bne b3_from_b3
    jmp breturn
    // init::@return
  breturn:
    // [47] return 
    rts
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 [ yvel#12 xpos#12 ypos#13 xvel#12 yvel_init#13 ] ( main:2 [ yvel#12 xpos#12 ypos#13 xvel#12 yvel_init#13 ] ) always clobbers reg byte a 
Statement [10] if((signed word) ypos#13>=(signed byte) 0) goto anim::@1 [ yvel#12 xpos#12 ypos#13 xvel#12 yvel_init#13 ] ( main:2::anim:9 [ yvel#12 xpos#12 ypos#13 xvel#12 yvel_init#13 ] ) always clobbers reg byte a 
Statement [11] (signed word) xvel#14 ← - (signed word) xvel#12 [ yvel_init#13 xvel#14 ] ( main:2::anim:9 [ yvel_init#13 xvel#14 ] ) always clobbers reg byte a 
Statement [12] (signed word) yvel_init#3 ← (signed word) yvel_init#13 - (signed byte) $a [ xvel#14 yvel_init#3 ] ( main:2::anim:9 [ xvel#14 yvel_init#3 ] ) always clobbers reg byte a 
Statement [13] if((signed word) yvel_init#3>=(signed word) -$c8) goto anim::@4 [ xvel#14 yvel_init#3 ] ( main:2::anim:9 [ xvel#14 yvel_init#3 ] ) always clobbers reg byte a 
Statement [16] (signed word~) yvel#21 ← (signed word) yvel#4 [ xvel#14 yvel#4 yvel#21 ] ( main:2::anim:9 [ xvel#14 yvel#4 yvel#21 ] ) always clobbers reg byte a 
Statement [18] (signed word) yvel#10 ← (signed word) yvel#9 + (const signed word) g#0 [ yvel#10 xvel#10 yvel_init#11 xpos#9 ypos#10 ] ( main:2::anim:9 [ yvel#10 xvel#10 yvel_init#11 xpos#9 ypos#10 ] ) always clobbers reg byte a 
Statement [19] (signed word) xpos#10 ← (signed word) xpos#9 + (signed word) xvel#10 [ yvel#10 xpos#10 xvel#10 yvel_init#11 ypos#10 ] ( main:2::anim:9 [ yvel#10 xpos#10 xvel#10 yvel_init#11 ypos#10 ] ) always clobbers reg byte a 
Statement [20] (signed word) ypos#11 ← (signed word) ypos#10 + (signed word) yvel#10 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 ] ) always clobbers reg byte a 
Statement [21] (signed word~) anim::$5 ← (signed word) xpos#10 >> (signed byte) 7 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$5 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$5 ] ) always clobbers reg byte a 
Statement [22] (signed word) anim::sprite_x#0 ← (signed word~) anim::$5 + (signed word) $a0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ) always clobbers reg byte a 
Statement [23] (signed word~) anim::$7 ← (signed word) ypos#11 >> (signed byte) 5 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$7 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$7 ] ) always clobbers reg byte a 
Statement [24] (signed word) anim::sprite_y#0 ← (signed word) $e6 - (signed word~) anim::$7 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ) always clobbers reg byte a 
Statement [25] (byte~) anim::$9 ← (byte)(signed word) anim::sprite_x#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 anim::$9 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 anim::$9 ] ) always clobbers reg byte a 
Statement [27] (byte~) anim::$10 ← (byte)(signed word) anim::sprite_y#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$10 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$10 ] ) always clobbers reg byte a 
Statement [29] (byte~) anim::$11 ← > (signed word) anim::sprite_x#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$11 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$11 ] ) always clobbers reg byte a 
Statement [32] *((const byte*) SPRITES_ENABLE#0) ← (byte) 1 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [33] *((const byte*) SPRITES_EXPAND_X#0) ← (byte) 0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [34] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte) 0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [35] *((const byte*) SPRITES_XPOS#0) ← (byte) $64 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [36] *((const byte*) SPRITES_YPOS#0) ← (byte) $64 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [37] *((const byte*) SPRITES_COLS#0) ← (const byte) WHITE#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [38] *((const byte*) SPRITES_PTR#0) ← (byte)(const byte*) SPRITE#0/(byte) $40 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [40] *((byte*) init::sc#4) ← (byte) ' ' [ init::sc#4 ] ( main:2::init:5 [ init::sc#4 ] ) always clobbers reg byte a reg byte y 
Statement [42] if((byte*) init::sc#1!=(const byte*) SCREEN#0+(word) $3e8) goto init::@2 [ init::sc#1 ] ( main:2::init:5 [ init::sc#1 ] ) always clobbers reg byte a 
Statement [44] *((const byte*) SPRITE#0 + (byte) init::i#2) ← (byte) $ff [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:14 [ init::i#2 init::i#1 ]
Statement [7] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 [ yvel#12 xpos#12 ypos#13 xvel#12 yvel_init#13 ] ( main:2 [ yvel#12 xpos#12 ypos#13 xvel#12 yvel_init#13 ] ) always clobbers reg byte a 
Statement [10] if((signed word) ypos#13>=(signed byte) 0) goto anim::@1 [ yvel#12 xpos#12 ypos#13 xvel#12 yvel_init#13 ] ( main:2::anim:9 [ yvel#12 xpos#12 ypos#13 xvel#12 yvel_init#13 ] ) always clobbers reg byte a 
Statement [11] (signed word) xvel#14 ← - (signed word) xvel#12 [ yvel_init#13 xvel#14 ] ( main:2::anim:9 [ yvel_init#13 xvel#14 ] ) always clobbers reg byte a 
Statement [12] (signed word) yvel_init#3 ← (signed word) yvel_init#13 - (signed byte) $a [ xvel#14 yvel_init#3 ] ( main:2::anim:9 [ xvel#14 yvel_init#3 ] ) always clobbers reg byte a 
Statement [13] if((signed word) yvel_init#3>=(signed word) -$c8) goto anim::@4 [ xvel#14 yvel_init#3 ] ( main:2::anim:9 [ xvel#14 yvel_init#3 ] ) always clobbers reg byte a 
Statement [16] (signed word~) yvel#21 ← (signed word) yvel#4 [ xvel#14 yvel#4 yvel#21 ] ( main:2::anim:9 [ xvel#14 yvel#4 yvel#21 ] ) always clobbers reg byte a 
Statement [18] (signed word) yvel#10 ← (signed word) yvel#9 + (const signed word) g#0 [ yvel#10 xvel#10 yvel_init#11 xpos#9 ypos#10 ] ( main:2::anim:9 [ yvel#10 xvel#10 yvel_init#11 xpos#9 ypos#10 ] ) always clobbers reg byte a 
Statement [19] (signed word) xpos#10 ← (signed word) xpos#9 + (signed word) xvel#10 [ yvel#10 xpos#10 xvel#10 yvel_init#11 ypos#10 ] ( main:2::anim:9 [ yvel#10 xpos#10 xvel#10 yvel_init#11 ypos#10 ] ) always clobbers reg byte a 
Statement [20] (signed word) ypos#11 ← (signed word) ypos#10 + (signed word) yvel#10 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 ] ) always clobbers reg byte a 
Statement [21] (signed word~) anim::$5 ← (signed word) xpos#10 >> (signed byte) 7 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$5 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$5 ] ) always clobbers reg byte a 
Statement [22] (signed word) anim::sprite_x#0 ← (signed word~) anim::$5 + (signed word) $a0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ) always clobbers reg byte a 
Statement [23] (signed word~) anim::$7 ← (signed word) ypos#11 >> (signed byte) 5 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$7 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$7 ] ) always clobbers reg byte a 
Statement [24] (signed word) anim::sprite_y#0 ← (signed word) $e6 - (signed word~) anim::$7 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ) always clobbers reg byte a 
Statement [25] (byte~) anim::$9 ← (byte)(signed word) anim::sprite_x#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 anim::$9 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 anim::$9 ] ) always clobbers reg byte a 
Statement [27] (byte~) anim::$10 ← (byte)(signed word) anim::sprite_y#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$10 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$10 ] ) always clobbers reg byte a 
Statement [29] (byte~) anim::$11 ← > (signed word) anim::sprite_x#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$11 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$11 ] ) always clobbers reg byte a 
Statement [32] *((const byte*) SPRITES_ENABLE#0) ← (byte) 1 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [33] *((const byte*) SPRITES_EXPAND_X#0) ← (byte) 0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [34] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte) 0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [35] *((const byte*) SPRITES_XPOS#0) ← (byte) $64 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [36] *((const byte*) SPRITES_YPOS#0) ← (byte) $64 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [37] *((const byte*) SPRITES_COLS#0) ← (const byte) WHITE#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [38] *((const byte*) SPRITES_PTR#0) ← (byte)(const byte*) SPRITE#0/(byte) $40 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [40] *((byte*) init::sc#4) ← (byte) ' ' [ init::sc#4 ] ( main:2::init:5 [ init::sc#4 ] ) always clobbers reg byte a reg byte y 
Statement [42] if((byte*) init::sc#1!=(const byte*) SCREEN#0+(word) $3e8) goto init::@2 [ init::sc#1 ] ( main:2::init:5 [ init::sc#1 ] ) always clobbers reg byte a 
Statement [44] *((const byte*) SPRITE#0 + (byte) init::i#2) ← (byte) $ff [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] ) always clobbers reg byte a 
Potential registers zp ZP_WORD:2 [ xvel#12 xvel#10 xvel#14 ] : zp ZP_WORD:2 , 
Potential registers zp ZP_WORD:4 [ yvel_init#13 yvel_init#11 yvel#4 yvel_init#3 ] : zp ZP_WORD:4 , 
Potential registers zp ZP_WORD:6 [ yvel#9 yvel#12 yvel#10 yvel#21 ] : zp ZP_WORD:6 , 
Potential registers zp ZP_WORD:8 [ xpos#9 xpos#12 xpos#10 ] : zp ZP_WORD:8 , 
Potential registers zp ZP_WORD:10 [ ypos#10 ypos#13 ypos#11 ] : zp ZP_WORD:10 , 
Potential registers zp ZP_WORD:12 [ init::sc#4 init::sc#1 ] : zp ZP_WORD:12 , 
Potential registers zp ZP_BYTE:14 [ init::i#2 init::i#1 ] : zp ZP_BYTE:14 , reg byte x , reg byte y , 
Potential registers zp ZP_WORD:15 [ anim::$5 ] : zp ZP_WORD:15 , 
Potential registers zp ZP_WORD:17 [ anim::sprite_x#0 ] : zp ZP_WORD:17 , 
Potential registers zp ZP_WORD:19 [ anim::$7 ] : zp ZP_WORD:19 , 
Potential registers zp ZP_WORD:21 [ anim::sprite_y#0 ] : zp ZP_WORD:21 , 
Potential registers zp ZP_BYTE:23 [ anim::$9 ] : zp ZP_BYTE:23 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:24 [ anim::$10 ] : zp ZP_BYTE:24 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:25 [ anim::$11 ] : zp ZP_BYTE:25 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [] 64.75: zp ZP_WORD:6 [ yvel#9 yvel#12 yvel#10 yvel#21 ] 56.82: zp ZP_WORD:8 [ xpos#9 xpos#12 xpos#10 ] 56.74: zp ZP_WORD:10 [ ypos#10 ypos#13 ypos#11 ] 55.98: zp ZP_WORD:2 [ xvel#12 xvel#10 xvel#14 ] 49.34: zp ZP_WORD:4 [ yvel_init#13 yvel_init#11 yvel#4 yvel_init#3 ] 
Uplift Scope [init] 33: zp ZP_WORD:12 [ init::sc#4 init::sc#1 ] 33: zp ZP_BYTE:14 [ init::i#2 init::i#1 ] 
Uplift Scope [anim] 4: zp ZP_WORD:15 [ anim::$5 ] 4: zp ZP_WORD:19 [ anim::$7 ] 4: zp ZP_BYTE:23 [ anim::$9 ] 4: zp ZP_BYTE:24 [ anim::$10 ] 4: zp ZP_BYTE:25 [ anim::$11 ] 0.67: zp ZP_WORD:21 [ anim::sprite_y#0 ] 0.57: zp ZP_WORD:17 [ anim::sprite_x#0 ] 
Uplift Scope [main] 

Uplifting [] best 7934 combination zp ZP_WORD:6 [ yvel#9 yvel#12 yvel#10 yvel#21 ] zp ZP_WORD:8 [ xpos#9 xpos#12 xpos#10 ] zp ZP_WORD:10 [ ypos#10 ypos#13 ypos#11 ] zp ZP_WORD:2 [ xvel#12 xvel#10 xvel#14 ] zp ZP_WORD:4 [ yvel_init#13 yvel_init#11 yvel#4 yvel_init#3 ] 
Uplifting [init] best 7814 combination zp ZP_WORD:12 [ init::sc#4 init::sc#1 ] reg byte x [ init::i#2 init::i#1 ] 
Uplifting [anim] best 7796 combination zp ZP_WORD:15 [ anim::$5 ] zp ZP_WORD:19 [ anim::$7 ] reg byte a [ anim::$9 ] reg byte a [ anim::$10 ] reg byte a [ anim::$11 ] zp ZP_WORD:21 [ anim::sprite_y#0 ] zp ZP_WORD:17 [ anim::sprite_x#0 ] 
Uplifting [main] best 7796 combination 
Coalescing zero page register [ zp ZP_WORD:15 [ anim::$5 ] ] with [ zp ZP_WORD:17 [ anim::sprite_x#0 ] ] - score: 1
Coalescing zero page register [ zp ZP_WORD:19 [ anim::$7 ] ] with [ zp ZP_WORD:21 [ anim::sprite_y#0 ] ] - score: 1
Coalescing zero page register [ zp ZP_WORD:12 [ init::sc#4 init::sc#1 ] ] with [ zp ZP_WORD:2 [ xvel#12 xvel#10 xvel#14 ] ]
Allocated (was zp ZP_WORD:4) zp ZP_WORD:2 [ yvel_init#13 yvel_init#11 yvel#4 yvel_init#3 ]
Allocated (was zp ZP_WORD:6) zp ZP_WORD:4 [ yvel#9 yvel#12 yvel#10 yvel#21 ]
Allocated (was zp ZP_WORD:8) zp ZP_WORD:6 [ xpos#9 xpos#12 xpos#10 ]
Allocated (was zp ZP_WORD:10) zp ZP_WORD:8 [ ypos#10 ypos#13 ypos#11 ]
Allocated (was zp ZP_WORD:12) zp ZP_WORD:10 [ init::sc#4 init::sc#1 xvel#12 xvel#10 xvel#14 ]
Allocated (was zp ZP_WORD:15) zp ZP_WORD:12 [ anim::$5 anim::sprite_x#0 ]
Allocated (was zp ZP_WORD:19) zp ZP_WORD:14 [ anim::$7 anim::sprite_y#0 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label SPRITES_XPOS = $d000
  .label SPRITES_YPOS = $d001
  .label SPRITES_XMSB = $d010
  .label RASTER = $d012
  .label SPRITES_ENABLE = $d015
  .label SPRITES_EXPAND_Y = $d017
  .label SPRITES_EXPAND_X = $d01d
  .label SPRITES_COLS = $d027
  .const WHITE = 1
  .label SCREEN = $400
  .label SPRITE = $2000
  .const g = -5
  .label SPRITES_PTR = SCREEN+$3f8
  .label yvel_init = 2
  .label yvel = 2
  .label yvel_9 = 4
  .label xpos = 6
  .label ypos = 8
  .label yvel_10 = 4
  .label xvel = $a
  .label yvel_12 = 4
  .label yvel_21 = 4
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from_b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    // [5] call init 
    jsr init
    // [6] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    // [6] phi (signed word) yvel_init#13 = (signed byte) $64 [phi:main->main::@1#0] -- vwsz1=vbsc1 
    lda #<$64
    sta.z yvel_init
    lda #>$64
    sta.z yvel_init+1
    // [6] phi (signed word) xvel#12 = (signed word) $c8 [phi:main->main::@1#1] -- vwsz1=vwsc1 
    lda #<$c8
    sta.z xvel
    lda #>$c8
    sta.z xvel+1
    // [6] phi (signed word) ypos#13 = (signed byte) 0 [phi:main->main::@1#2] -- vwsz1=vbsc1 
    lda #<0
    sta.z ypos
    lda #>0
    sta.z ypos+1
    // [6] phi (signed word) xpos#12 = (signed byte) 0 [phi:main->main::@1#3] -- vwsz1=vbsc1 
    lda #<0
    sta.z xpos
    lda #>0
    sta.z xpos+1
    // [6] phi (signed word) yvel#12 = (signed byte) $64 [phi:main->main::@1#4] -- vwsz1=vbsc1 
    lda #<$64
    sta.z yvel_12
    lda #>$64
    sta.z yvel_12+1
    jmp b1
    // [6] phi from main::@1 main::@2 to main::@1 [phi:main::@1/main::@2->main::@1]
  b1_from_b1:
  b1_from_b2:
    // [6] phi (signed word) yvel_init#13 = (signed word) yvel_init#13 [phi:main::@1/main::@2->main::@1#0] -- register_copy 
    // [6] phi (signed word) xvel#12 = (signed word) xvel#12 [phi:main::@1/main::@2->main::@1#1] -- register_copy 
    // [6] phi (signed word) ypos#13 = (signed word) ypos#13 [phi:main::@1/main::@2->main::@1#2] -- register_copy 
    // [6] phi (signed word) xpos#12 = (signed word) xpos#12 [phi:main::@1/main::@2->main::@1#3] -- register_copy 
    // [6] phi (signed word) yvel#12 = (signed word) yvel#12 [phi:main::@1/main::@2->main::@1#4] -- register_copy 
    jmp b1
    // main::@1
  b1:
    // [7] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$ff
    cmp RASTER
    bne b1_from_b1
    // [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  b2_from_b1:
    jmp b2
    // main::@2
  b2:
    // [9] call anim 
    jsr anim
    jmp b1_from_b2
}
  // anim
anim: {
    .label _5 = $c
    .label _7 = $e
    .label sprite_x = $c
    .label sprite_y = $e
    // [10] if((signed word) ypos#13>=(signed byte) 0) goto anim::@1 -- vwsz1_ge_0_then_la1 
    lda.z ypos+1
    bpl b1_from_anim
    jmp b2
    // anim::@2
  b2:
    // [11] (signed word) xvel#14 ← - (signed word) xvel#12 -- vwsz1=_neg_vwsz1 
    sec
    lda #0
    sbc.z xvel
    sta.z xvel
    lda #0
    sbc.z xvel+1
    sta.z xvel+1
    // [12] (signed word) yvel_init#3 ← (signed word) yvel_init#13 - (signed byte) $a -- vwsz1=vwsz1_minus_vbsc1 
    lda.z yvel_init
    sec
    sbc #$a
    sta.z yvel_init
    lda.z yvel_init+1
    sbc #>$a
    sta.z yvel_init+1
    // [13] if((signed word) yvel_init#3>=(signed word) -$c8) goto anim::@4 -- vwsz1_ge_vwsc1_then_la1 
    lda.z yvel_init
    cmp #<-$c8
    lda.z yvel_init+1
    sbc #>-$c8
    bvc !+
    eor #$80
  !:
    bpl b4_from_b2
    // [15] phi from anim::@2 to anim::@3 [phi:anim::@2->anim::@3]
  b3_from_b2:
    // [15] phi (signed word) yvel#4 = (signed word) $c8 [phi:anim::@2->anim::@3#0] -- vwsz1=vwsc1 
    lda #<$c8
    sta.z yvel
    lda #>$c8
    sta.z yvel+1
    jmp b3
    // [14] phi from anim::@2 to anim::@4 [phi:anim::@2->anim::@4]
  b4_from_b2:
    jmp b4
    // anim::@4
  b4:
    // [15] phi from anim::@4 to anim::@3 [phi:anim::@4->anim::@3]
  b3_from_b4:
    // [15] phi (signed word) yvel#4 = (signed word) yvel_init#3 [phi:anim::@4->anim::@3#0] -- register_copy 
    jmp b3
    // anim::@3
  b3:
    // [16] (signed word~) yvel#21 ← (signed word) yvel#4 -- vwsz1=vwsz2 
    lda.z yvel
    sta.z yvel_21
    lda.z yvel+1
    sta.z yvel_21+1
    // [17] phi from anim::@3 to anim::@1 [phi:anim::@3->anim::@1]
  b1_from_b3:
    // [17] phi (signed word) yvel_init#11 = (signed word) yvel#4 [phi:anim::@3->anim::@1#0] -- register_copy 
    // [17] phi (signed word) ypos#10 = (signed byte) 0 [phi:anim::@3->anim::@1#1] -- vwsz1=vbsc1 
    lda #<0
    sta.z ypos
    lda #>0
    sta.z ypos+1
    // [17] phi (signed word) xvel#10 = (signed word) xvel#14 [phi:anim::@3->anim::@1#2] -- register_copy 
    // [17] phi (signed word) xpos#9 = (signed byte) 0 [phi:anim::@3->anim::@1#3] -- vwsz1=vbsc1 
    lda #<0
    sta.z xpos
    lda #>0
    sta.z xpos+1
    // [17] phi (signed word) yvel#9 = (signed word~) yvel#21 [phi:anim::@3->anim::@1#4] -- register_copy 
    jmp b1
    // [17] phi from anim to anim::@1 [phi:anim->anim::@1]
  b1_from_anim:
    // [17] phi (signed word) yvel_init#11 = (signed word) yvel_init#13 [phi:anim->anim::@1#0] -- register_copy 
    // [17] phi (signed word) ypos#10 = (signed word) ypos#13 [phi:anim->anim::@1#1] -- register_copy 
    // [17] phi (signed word) xvel#10 = (signed word) xvel#12 [phi:anim->anim::@1#2] -- register_copy 
    // [17] phi (signed word) xpos#9 = (signed word) xpos#12 [phi:anim->anim::@1#3] -- register_copy 
    // [17] phi (signed word) yvel#9 = (signed word) yvel#12 [phi:anim->anim::@1#4] -- register_copy 
    jmp b1
    // anim::@1
  b1:
    // [18] (signed word) yvel#10 ← (signed word) yvel#9 + (const signed word) g#0 -- vwsz1=vwsz1_plus_vwsc1 
    clc
    lda.z yvel_10
    adc #<g
    sta.z yvel_10
    lda.z yvel_10+1
    adc #>g
    sta.z yvel_10+1
    // [19] (signed word) xpos#10 ← (signed word) xpos#9 + (signed word) xvel#10 -- vwsz1=vwsz1_plus_vwsz2 
    lda.z xpos
    clc
    adc.z xvel
    sta.z xpos
    lda.z xpos+1
    adc.z xvel+1
    sta.z xpos+1
    // [20] (signed word) ypos#11 ← (signed word) ypos#10 + (signed word) yvel#10 -- vwsz1=vwsz1_plus_vwsz2 
    lda.z ypos
    clc
    adc.z yvel_10
    sta.z ypos
    lda.z ypos+1
    adc.z yvel_10+1
    sta.z ypos+1
    // [21] (signed word~) anim::$5 ← (signed word) xpos#10 >> (signed byte) 7 -- vwsz1=vwsz2_ror_7 
    lda.z xpos
    sta.z $ff
    lda.z xpos+1
    sta.z _5
    lda #0
    bit.z xpos+1
    bpl !+
    lda #$ff
  !:
    sta.z _5+1
    rol.z $ff
    rol.z _5
    rol.z _5+1
    // [22] (signed word) anim::sprite_x#0 ← (signed word~) anim::$5 + (signed word) $a0 -- vwsz1=vwsz1_plus_vwsc1 
    clc
    lda.z sprite_x
    adc #<$a0
    sta.z sprite_x
    lda.z sprite_x+1
    adc #>$a0
    sta.z sprite_x+1
    // [23] (signed word~) anim::$7 ← (signed word) ypos#11 >> (signed byte) 5 -- vwsz1=vwsz2_ror_5 
    lda.z ypos
    sta.z $ff
    lda.z ypos+1
    sta.z _7
    lda #0
    bit.z ypos+1
    bpl !+
    lda #$ff
  !:
    sta.z _7+1
    rol.z $ff
    rol.z _7
    rol.z _7+1
    rol.z $ff
    rol.z _7
    rol.z _7+1
    rol.z $ff
    rol.z _7
    rol.z _7+1
    // [24] (signed word) anim::sprite_y#0 ← (signed word) $e6 - (signed word~) anim::$7 -- vwsz1=vwsc1_minus_vwsz1 
    lda #<$e6
    sec
    sbc.z sprite_y
    sta.z sprite_y
    lda #>$e6
    sbc.z sprite_y+1
    sta.z sprite_y+1
    // [25] (byte~) anim::$9 ← (byte)(signed word) anim::sprite_x#0 -- vbuaa=_byte_vwsz1 
    lda.z sprite_x
    // [26] *((const byte*) SPRITES_XPOS#0) ← (byte~) anim::$9 -- _deref_pbuc1=vbuaa 
    sta SPRITES_XPOS
    // [27] (byte~) anim::$10 ← (byte)(signed word) anim::sprite_y#0 -- vbuaa=_byte_vwsz1 
    lda.z sprite_y
    // [28] *((const byte*) SPRITES_YPOS#0) ← (byte~) anim::$10 -- _deref_pbuc1=vbuaa 
    sta SPRITES_YPOS
    // [29] (byte~) anim::$11 ← > (signed word) anim::sprite_x#0 -- vbuaa=_hi_vwsz1 
    lda.z sprite_x+1
    // [30] *((const byte*) SPRITES_XMSB#0) ← (byte~) anim::$11 -- _deref_pbuc1=vbuaa 
    sta SPRITES_XMSB
    jmp breturn
    // anim::@return
  breturn:
    // [31] return 
    rts
}
  // init
// Fill and show a sprite, clear the screen
init: {
    .label sc = $a
    // [32] *((const byte*) SPRITES_ENABLE#0) ← (byte) 1 -- _deref_pbuc1=vbuc2 
    lda #1
    sta SPRITES_ENABLE
    // [33] *((const byte*) SPRITES_EXPAND_X#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SPRITES_EXPAND_X
    // [34] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SPRITES_EXPAND_Y
    // [35] *((const byte*) SPRITES_XPOS#0) ← (byte) $64 -- _deref_pbuc1=vbuc2 
    lda #$64
    sta SPRITES_XPOS
    // [36] *((const byte*) SPRITES_YPOS#0) ← (byte) $64 -- _deref_pbuc1=vbuc2 
    lda #$64
    sta SPRITES_YPOS
    // [37] *((const byte*) SPRITES_COLS#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 
    lda #WHITE
    sta SPRITES_COLS
    // [38] *((const byte*) SPRITES_PTR#0) ← (byte)(const byte*) SPRITE#0/(byte) $40 -- _deref_pbuc1=vbuc2 
    lda #SPRITE/$40
    sta SPRITES_PTR
    // [39] phi from init to init::@2 [phi:init->init::@2]
  b2_from_init:
    // [39] phi (byte*) init::sc#4 = (const byte*) SCREEN#0 [phi:init->init::@2#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z sc
    lda #>SCREEN
    sta.z sc+1
    jmp b2
    // [39] phi from init::@1 to init::@2 [phi:init::@1->init::@2]
  b2_from_b1:
    // [39] phi (byte*) init::sc#4 = (byte*) init::sc#1 [phi:init::@1->init::@2#0] -- register_copy 
    jmp b2
    // init::@2
  b2:
    // [40] *((byte*) init::sc#4) ← (byte) ' ' -- _deref_pbuz1=vbuc1 
    lda #' '
    ldy #0
    sta (sc),y
    // [41] (byte*) init::sc#1 ← ++ (byte*) init::sc#4 -- pbuz1=_inc_pbuz1 
    inc.z sc
    bne !+
    inc.z sc+1
  !:
    jmp b1
    // init::@1
  b1:
    // [42] if((byte*) init::sc#1!=(const byte*) SCREEN#0+(word) $3e8) goto init::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda.z sc+1
    cmp #>SCREEN+$3e8
    bne b2_from_b1
    lda.z sc
    cmp #<SCREEN+$3e8
    bne b2_from_b1
    // [43] phi from init::@1 to init::@3 [phi:init::@1->init::@3]
  b3_from_b1:
    // [43] phi (byte) init::i#2 = (byte) 0 [phi:init::@1->init::@3#0] -- vbuxx=vbuc1 
    ldx #0
    jmp b3
    // [43] phi from init::@3 to init::@3 [phi:init::@3->init::@3]
  b3_from_b3:
    // [43] phi (byte) init::i#2 = (byte) init::i#1 [phi:init::@3->init::@3#0] -- register_copy 
    jmp b3
    // init::@3
  b3:
    // [44] *((const byte*) SPRITE#0 + (byte) init::i#2) ← (byte) $ff -- pbuc1_derefidx_vbuxx=vbuc2 
    lda #$ff
    sta SPRITE,x
    // [45] (byte) init::i#1 ← ++ (byte) init::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [46] if((byte) init::i#1!=(byte) $40) goto init::@3 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$40
    bne b3_from_b3
    jmp breturn
    // init::@return
  breturn:
    // [47] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b2
Removing instruction jmp b4
Removing instruction jmp b3
Removing instruction jmp b1
Removing instruction jmp breturn
Removing instruction jmp b2
Removing instruction jmp b1
Removing instruction jmp b3
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #>0
Removing instruction lda #<0
Removing instruction lda #>0
Removing instruction lda #>0
Removing instruction lda #<0
Removing instruction lda #>0
Removing instruction lda #0
Removing instruction lda #$64
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label b1_from_b1 with b1
Replacing label b1_from_b2 with b1
Replacing label b1_from_anim with b1
Replacing label b4_from_b2 with b3
Replacing label b2_from_b1 with b2
Replacing label b2_from_b1 with b2
Replacing label b3_from_b3 with b3
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Removing instruction b1_from_b1:
Removing instruction b1_from_b2:
Removing instruction b2_from_b1:
Removing instruction b4_from_b2:
Removing instruction b4:
Removing instruction b3_from_b4:
Removing instruction b1_from_anim:
Removing instruction b2_from_b1:
Removing instruction b3_from_b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction b1_from_main:
Removing instruction b2:
Removing instruction b2:
Removing instruction b3_from_b2:
Removing instruction b1_from_b3:
Removing instruction breturn:
Removing instruction b2_from_init:
Removing instruction b1:
Removing instruction b3_from_b1:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp b1
Removing instruction jmp b3
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(byte*) RASTER
(const byte*) RASTER#0 RASTER = (byte*) 53266
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
(byte*) SPRITE
(const byte*) SPRITE#0 SPRITE = (byte*) 8192
(byte*) SPRITES_COLS
(const byte*) SPRITES_COLS#0 SPRITES_COLS = (byte*) 53287
(byte*) SPRITES_ENABLE
(const byte*) SPRITES_ENABLE#0 SPRITES_ENABLE = (byte*) 53269
(byte*) SPRITES_EXPAND_X
(const byte*) SPRITES_EXPAND_X#0 SPRITES_EXPAND_X = (byte*) 53277
(byte*) SPRITES_EXPAND_Y
(const byte*) SPRITES_EXPAND_Y#0 SPRITES_EXPAND_Y = (byte*) 53271
(byte*) SPRITES_PTR
(const byte*) SPRITES_PTR#0 SPRITES_PTR = (const byte*) SCREEN#0+(word) $3f8
(byte*) SPRITES_XMSB
(const byte*) SPRITES_XMSB#0 SPRITES_XMSB = (byte*) 53264
(byte*) SPRITES_XPOS
(const byte*) SPRITES_XPOS#0 SPRITES_XPOS = (byte*) 53248
(byte*) SPRITES_YPOS
(const byte*) SPRITES_YPOS#0 SPRITES_YPOS = (byte*) 53249
(byte) WHITE
(const byte) WHITE#0 WHITE = (byte) 1
(void()) anim()
(byte~) anim::$10 reg byte a 4.0
(byte~) anim::$11 reg byte a 4.0
(signed word~) anim::$5 $5 zp ZP_WORD:12 4.0
(signed word~) anim::$7 $7 zp ZP_WORD:14 4.0
(byte~) anim::$9 reg byte a 4.0
(label) anim::@1
(label) anim::@2
(label) anim::@3
(label) anim::@4
(label) anim::@return
(signed word) anim::sprite_x
(signed word) anim::sprite_x#0 sprite_x zp ZP_WORD:12 0.5714285714285714
(signed word) anim::sprite_y
(signed word) anim::sprite_y#0 sprite_y zp ZP_WORD:14 0.6666666666666666
(signed word) g
(const signed word) g#0 g = (signed byte) -5
(void()) init()
(label) init::@1
(label) init::@2
(label) init::@3
(label) init::@return
(byte) init::i
(byte) init::i#1 reg byte x 16.5
(byte) init::i#2 reg byte x 16.5
(byte*) init::sc
(byte*) init::sc#1 sc zp ZP_WORD:10 16.5
(byte*) init::sc#4 sc zp ZP_WORD:10 16.5
(void()) main()
(label) main::@1
(label) main::@2
(signed word) xpos
(signed word) xpos#10 xpos zp ZP_WORD:6 1.0714285714285714
(signed word) xpos#12 xpos zp ZP_WORD:6 53.75
(signed word) xpos#9 xpos zp ZP_WORD:6 2.0
(signed word) xvel
(signed word) xvel#10 xvel zp ZP_WORD:10 1.0625
(signed word) xvel#12 xvel zp ZP_WORD:10 54.25
(signed word) xvel#14 xvel zp ZP_WORD:10 0.6666666666666666
(signed word) ypos
(signed word) ypos#10 ypos zp ZP_WORD:8 1.3333333333333333
(signed word) ypos#11 ypos zp ZP_WORD:8 1.1538461538461537
(signed word) ypos#13 ypos zp ZP_WORD:8 54.25
(signed word) yvel
(signed word) yvel#10 yvel#10 zp ZP_WORD:4 0.9999999999999999
(signed word) yvel#12 yvel#12 zp ZP_WORD:4 53.75
(signed word~) yvel#21 yvel#21 zp ZP_WORD:4 4.0
(signed word) yvel#4 yvel zp ZP_WORD:2 3.0
(signed word) yvel#9 yvel#9 zp ZP_WORD:4 6.0
(signed word) yvel_init
(signed word) yvel_init#11 yvel_init zp ZP_WORD:2 0.9375
(signed word) yvel_init#13 yvel_init zp ZP_WORD:2 43.39999999999999
(signed word) yvel_init#3 yvel_init zp ZP_WORD:2 2.0

zp ZP_WORD:2 [ yvel_init#13 yvel_init#11 yvel#4 yvel_init#3 ]
zp ZP_WORD:4 [ yvel#9 yvel#12 yvel#10 yvel#21 ]
zp ZP_WORD:6 [ xpos#9 xpos#12 xpos#10 ]
zp ZP_WORD:8 [ ypos#10 ypos#13 ypos#11 ]
zp ZP_WORD:10 [ init::sc#4 init::sc#1 xvel#12 xvel#10 xvel#14 ]
reg byte x [ init::i#2 init::i#1 ]
zp ZP_WORD:12 [ anim::$5 anim::sprite_x#0 ]
zp ZP_WORD:14 [ anim::$7 anim::sprite_y#0 ]
reg byte a [ anim::$9 ]
reg byte a [ anim::$10 ]
reg byte a [ anim::$11 ]


FINAL ASSEMBLER
Score: 6343

  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .label SPRITES_XPOS = $d000
  .label SPRITES_YPOS = $d001
  .label SPRITES_XMSB = $d010
  .label RASTER = $d012
  .label SPRITES_ENABLE = $d015
  .label SPRITES_EXPAND_Y = $d017
  .label SPRITES_EXPAND_X = $d01d
  .label SPRITES_COLS = $d027
  .const WHITE = 1
  .label SCREEN = $400
  .label SPRITE = $2000
  .const g = -5
  .label SPRITES_PTR = SCREEN+$3f8
  .label yvel_init = 2
  .label yvel = 2
  .label yvel_9 = 4
  .label xpos = 6
  .label ypos = 8
  .label yvel_10 = 4
  .label xvel = $a
  .label yvel_12 = 4
  .label yvel_21 = 4
  // @begin
  // [1] phi from @begin to @1 [phi:@begin->@1]
  // @1
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
  // [3] phi from @1 to @end [phi:@1->@end]
  // @end
  // main
main: {
    // init()
    // [5] call init 
    jsr init
    // [6] phi from main to main::@1 [phi:main->main::@1]
    // [6] phi (signed word) yvel_init#13 = (signed byte) $64 [phi:main->main::@1#0] -- vwsz1=vbsc1 
    lda #<$64
    sta.z yvel_init
    lda #>$64
    sta.z yvel_init+1
    // [6] phi (signed word) xvel#12 = (signed word) $c8 [phi:main->main::@1#1] -- vwsz1=vwsc1 
    lda #<$c8
    sta.z xvel
    lda #>$c8
    sta.z xvel+1
    // [6] phi (signed word) ypos#13 = (signed byte) 0 [phi:main->main::@1#2] -- vwsz1=vbsc1 
    lda #<0
    sta.z ypos
    sta.z ypos+1
    // [6] phi (signed word) xpos#12 = (signed byte) 0 [phi:main->main::@1#3] -- vwsz1=vbsc1 
    sta.z xpos
    sta.z xpos+1
    // [6] phi (signed word) yvel#12 = (signed byte) $64 [phi:main->main::@1#4] -- vwsz1=vbsc1 
    lda #<$64
    sta.z yvel_12
    lda #>$64
    sta.z yvel_12+1
    // [6] phi from main::@1 main::@2 to main::@1 [phi:main::@1/main::@2->main::@1]
    // [6] phi (signed word) yvel_init#13 = (signed word) yvel_init#13 [phi:main::@1/main::@2->main::@1#0] -- register_copy 
    // [6] phi (signed word) xvel#12 = (signed word) xvel#12 [phi:main::@1/main::@2->main::@1#1] -- register_copy 
    // [6] phi (signed word) ypos#13 = (signed word) ypos#13 [phi:main::@1/main::@2->main::@1#2] -- register_copy 
    // [6] phi (signed word) xpos#12 = (signed word) xpos#12 [phi:main::@1/main::@2->main::@1#3] -- register_copy 
    // [6] phi (signed word) yvel#12 = (signed word) yvel#12 [phi:main::@1/main::@2->main::@1#4] -- register_copy 
    // main::@1
  b1:
    // while (*RASTER!=$ff)
    // [7] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$ff
    cmp RASTER
    bne b1
    // [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
    // main::@2
    // anim()
    // [9] call anim 
    jsr anim
    jmp b1
}
  // anim
anim: {
    .label _5 = $c
    .label _7 = $e
    .label sprite_x = $c
    .label sprite_y = $e
    // if(ypos<0)
    // [10] if((signed word) ypos#13>=(signed byte) 0) goto anim::@1 -- vwsz1_ge_0_then_la1 
    lda.z ypos+1
    bpl b1
    // anim::@2
    // xvel = -xvel
    // [11] (signed word) xvel#14 ← - (signed word) xvel#12 -- vwsz1=_neg_vwsz1 
    sec
    lda #0
    sbc.z xvel
    sta.z xvel
    lda #0
    sbc.z xvel+1
    sta.z xvel+1
    // yvel_init = yvel_init-10
    // [12] (signed word) yvel_init#3 ← (signed word) yvel_init#13 - (signed byte) $a -- vwsz1=vwsz1_minus_vbsc1 
    lda.z yvel_init
    sec
    sbc #$a
    sta.z yvel_init
    lda.z yvel_init+1
    sbc #>$a
    sta.z yvel_init+1
    // if(yvel_init<-200)
    // [13] if((signed word) yvel_init#3>=(signed word) -$c8) goto anim::@4 -- vwsz1_ge_vwsc1_then_la1 
    lda.z yvel_init
    cmp #<-$c8
    lda.z yvel_init+1
    sbc #>-$c8
    bvc !+
    eor #$80
  !:
    bpl b3
    // [15] phi from anim::@2 to anim::@3 [phi:anim::@2->anim::@3]
    // [15] phi (signed word) yvel#4 = (signed word) $c8 [phi:anim::@2->anim::@3#0] -- vwsz1=vwsc1 
    lda #<$c8
    sta.z yvel
    lda #>$c8
    sta.z yvel+1
    // [14] phi from anim::@2 to anim::@4 [phi:anim::@2->anim::@4]
    // anim::@4
    // [15] phi from anim::@4 to anim::@3 [phi:anim::@4->anim::@3]
    // [15] phi (signed word) yvel#4 = (signed word) yvel_init#3 [phi:anim::@4->anim::@3#0] -- register_copy 
    // anim::@3
  b3:
    // [16] (signed word~) yvel#21 ← (signed word) yvel#4 -- vwsz1=vwsz2 
    lda.z yvel
    sta.z yvel_21
    lda.z yvel+1
    sta.z yvel_21+1
    // [17] phi from anim::@3 to anim::@1 [phi:anim::@3->anim::@1]
    // [17] phi (signed word) yvel_init#11 = (signed word) yvel#4 [phi:anim::@3->anim::@1#0] -- register_copy 
    // [17] phi (signed word) ypos#10 = (signed byte) 0 [phi:anim::@3->anim::@1#1] -- vwsz1=vbsc1 
    lda #<0
    sta.z ypos
    sta.z ypos+1
    // [17] phi (signed word) xvel#10 = (signed word) xvel#14 [phi:anim::@3->anim::@1#2] -- register_copy 
    // [17] phi (signed word) xpos#9 = (signed byte) 0 [phi:anim::@3->anim::@1#3] -- vwsz1=vbsc1 
    sta.z xpos
    sta.z xpos+1
    // [17] phi (signed word) yvel#9 = (signed word~) yvel#21 [phi:anim::@3->anim::@1#4] -- register_copy 
    // [17] phi from anim to anim::@1 [phi:anim->anim::@1]
    // [17] phi (signed word) yvel_init#11 = (signed word) yvel_init#13 [phi:anim->anim::@1#0] -- register_copy 
    // [17] phi (signed word) ypos#10 = (signed word) ypos#13 [phi:anim->anim::@1#1] -- register_copy 
    // [17] phi (signed word) xvel#10 = (signed word) xvel#12 [phi:anim->anim::@1#2] -- register_copy 
    // [17] phi (signed word) xpos#9 = (signed word) xpos#12 [phi:anim->anim::@1#3] -- register_copy 
    // [17] phi (signed word) yvel#9 = (signed word) yvel#12 [phi:anim->anim::@1#4] -- register_copy 
    // anim::@1
  b1:
    // yvel + g
    // [18] (signed word) yvel#10 ← (signed word) yvel#9 + (const signed word) g#0 -- vwsz1=vwsz1_plus_vwsc1 
    clc
    lda.z yvel_10
    adc #<g
    sta.z yvel_10
    lda.z yvel_10+1
    adc #>g
    sta.z yvel_10+1
    // xpos + xvel
    // [19] (signed word) xpos#10 ← (signed word) xpos#9 + (signed word) xvel#10 -- vwsz1=vwsz1_plus_vwsz2 
    lda.z xpos
    clc
    adc.z xvel
    sta.z xpos
    lda.z xpos+1
    adc.z xvel+1
    sta.z xpos+1
    // ypos + yvel
    // [20] (signed word) ypos#11 ← (signed word) ypos#10 + (signed word) yvel#10 -- vwsz1=vwsz1_plus_vwsz2 
    lda.z ypos
    clc
    adc.z yvel_10
    sta.z ypos
    lda.z ypos+1
    adc.z yvel_10+1
    sta.z ypos+1
    // xpos>>7
    // [21] (signed word~) anim::$5 ← (signed word) xpos#10 >> (signed byte) 7 -- vwsz1=vwsz2_ror_7 
    lda.z xpos
    sta.z $ff
    lda.z xpos+1
    sta.z _5
    lda #0
    bit.z xpos+1
    bpl !+
    lda #$ff
  !:
    sta.z _5+1
    rol.z $ff
    rol.z _5
    rol.z _5+1
    // sprite_x = xpos>>7 + 160
    // [22] (signed word) anim::sprite_x#0 ← (signed word~) anim::$5 + (signed word) $a0 -- vwsz1=vwsz1_plus_vwsc1 
    clc
    lda.z sprite_x
    adc #<$a0
    sta.z sprite_x
    lda.z sprite_x+1
    adc #>$a0
    sta.z sprite_x+1
    // ypos>>5
    // [23] (signed word~) anim::$7 ← (signed word) ypos#11 >> (signed byte) 5 -- vwsz1=vwsz2_ror_5 
    lda.z ypos
    sta.z $ff
    lda.z ypos+1
    sta.z _7
    lda #0
    bit.z ypos+1
    bpl !+
    lda #$ff
  !:
    sta.z _7+1
    rol.z $ff
    rol.z _7
    rol.z _7+1
    rol.z $ff
    rol.z _7
    rol.z _7+1
    rol.z $ff
    rol.z _7
    rol.z _7+1
    // sprite_y = 230 - ypos>>5
    // [24] (signed word) anim::sprite_y#0 ← (signed word) $e6 - (signed word~) anim::$7 -- vwsz1=vwsc1_minus_vwsz1 
    lda #<$e6
    sec
    sbc.z sprite_y
    sta.z sprite_y
    lda #>$e6
    sbc.z sprite_y+1
    sta.z sprite_y+1
    // (byte)sprite_x
    // [25] (byte~) anim::$9 ← (byte)(signed word) anim::sprite_x#0 -- vbuaa=_byte_vwsz1 
    lda.z sprite_x
    // SPRITES_XPOS[0] = (byte)sprite_x
    // [26] *((const byte*) SPRITES_XPOS#0) ← (byte~) anim::$9 -- _deref_pbuc1=vbuaa 
    sta SPRITES_XPOS
    // (byte)sprite_y
    // [27] (byte~) anim::$10 ← (byte)(signed word) anim::sprite_y#0 -- vbuaa=_byte_vwsz1 
    lda.z sprite_y
    // SPRITES_YPOS[0] = (byte)sprite_y
    // [28] *((const byte*) SPRITES_YPOS#0) ← (byte~) anim::$10 -- _deref_pbuc1=vbuaa 
    sta SPRITES_YPOS
    // >sprite_x
    // [29] (byte~) anim::$11 ← > (signed word) anim::sprite_x#0 -- vbuaa=_hi_vwsz1 
    lda.z sprite_x+1
    // *SPRITES_XMSB = >sprite_x
    // [30] *((const byte*) SPRITES_XMSB#0) ← (byte~) anim::$11 -- _deref_pbuc1=vbuaa 
    sta SPRITES_XMSB
    // anim::@return
    // }
    // [31] return 
    rts
}
  // init
// Fill and show a sprite, clear the screen
init: {
    .label sc = $a
    // *SPRITES_ENABLE = %00000001
    // [32] *((const byte*) SPRITES_ENABLE#0) ← (byte) 1 -- _deref_pbuc1=vbuc2 
    lda #1
    sta SPRITES_ENABLE
    // *SPRITES_EXPAND_X = 0
    // [33] *((const byte*) SPRITES_EXPAND_X#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SPRITES_EXPAND_X
    // *SPRITES_EXPAND_Y = 0
    // [34] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    sta SPRITES_EXPAND_Y
    // SPRITES_XPOS[0] = 100
    // [35] *((const byte*) SPRITES_XPOS#0) ← (byte) $64 -- _deref_pbuc1=vbuc2 
    lda #$64
    sta SPRITES_XPOS
    // SPRITES_YPOS[0] = 100
    // [36] *((const byte*) SPRITES_YPOS#0) ← (byte) $64 -- _deref_pbuc1=vbuc2 
    sta SPRITES_YPOS
    // SPRITES_COLS[0] = WHITE
    // [37] *((const byte*) SPRITES_COLS#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 
    lda #WHITE
    sta SPRITES_COLS
    // SPRITES_PTR[0] = (byte)(SPRITE/$40)
    // [38] *((const byte*) SPRITES_PTR#0) ← (byte)(const byte*) SPRITE#0/(byte) $40 -- _deref_pbuc1=vbuc2 
    lda #SPRITE/$40
    sta SPRITES_PTR
    // [39] phi from init to init::@2 [phi:init->init::@2]
    // [39] phi (byte*) init::sc#4 = (const byte*) SCREEN#0 [phi:init->init::@2#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z sc
    lda #>SCREEN
    sta.z sc+1
    // [39] phi from init::@1 to init::@2 [phi:init::@1->init::@2]
    // [39] phi (byte*) init::sc#4 = (byte*) init::sc#1 [phi:init::@1->init::@2#0] -- register_copy 
    // init::@2
  b2:
    // *sc = ' '
    // [40] *((byte*) init::sc#4) ← (byte) ' ' -- _deref_pbuz1=vbuc1 
    lda #' '
    ldy #0
    sta (sc),y
    // for(byte* sc=SCREEN; sc!=SCREEN+1000; sc++ )
    // [41] (byte*) init::sc#1 ← ++ (byte*) init::sc#4 -- pbuz1=_inc_pbuz1 
    inc.z sc
    bne !+
    inc.z sc+1
  !:
    // init::@1
    // [42] if((byte*) init::sc#1!=(const byte*) SCREEN#0+(word) $3e8) goto init::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda.z sc+1
    cmp #>SCREEN+$3e8
    bne b2
    lda.z sc
    cmp #<SCREEN+$3e8
    bne b2
    // [43] phi from init::@1 to init::@3 [phi:init::@1->init::@3]
    // [43] phi (byte) init::i#2 = (byte) 0 [phi:init::@1->init::@3#0] -- vbuxx=vbuc1 
    ldx #0
    // [43] phi from init::@3 to init::@3 [phi:init::@3->init::@3]
    // [43] phi (byte) init::i#2 = (byte) init::i#1 [phi:init::@3->init::@3#0] -- register_copy 
    // init::@3
  b3:
    // SPRITE[i] = $ff
    // [44] *((const byte*) SPRITE#0 + (byte) init::i#2) ← (byte) $ff -- pbuc1_derefidx_vbuxx=vbuc2 
    lda #$ff
    sta SPRITE,x
    // for(byte i : 0..63)
    // [45] (byte) init::i#1 ← ++ (byte) init::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [46] if((byte) init::i#1!=(byte) $40) goto init::@3 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$40
    bne b3
    // init::@return
    // }
    // [47] return 
    rts
}
  // File Data

