Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx 
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) @4
Culled Empty Block (label) main::@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
  to:@6

(void()) main()
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 ← *((const byte*) RASTER) != (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

(void()) init()
init: scope:[init]  from main
  *((const byte*) SPRITES_ENABLE) ← (number) 1
  *((const byte*) SPRITES_EXPAND_X) ← (number) 0
  *((const byte*) SPRITES_EXPAND_Y) ← (number) 0
  *((const byte*) SPRITES_XPOS + (number) 0) ← (number) $64
  *((const byte*) SPRITES_YPOS + (number) 0) ← (number) $64
  *((const byte*) SPRITES_COLS + (number) 0) ← (const byte) WHITE
  *((const byte*) SPRITES_PTR + (number) 0) ← (byte)(const byte*) SPRITE/(number) $40
  (byte*) init::sc#0 ← (const byte*) SCREEN
  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 )
  (bool~) init::$0 ← (byte*) init::sc#2 != (const byte*) SCREEN+(number) $3e8
  if((bool~) init::$0) 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 )
  *((const byte*) SPRITE + (byte) init::i#2) ← (number) $ff
  (byte) init::i#1 ← (byte) init::i#2 + rangenext(0,$3f)
  (bool~) init::$1 ← (byte) init::i#1 != rangelast(0,$3f)
  if((bool~) init::$1) goto init::@7
  to:init::@return
init::@return: scope:[init]  from init::@7
  return 
  to:@return
@6: scope:[]  from @begin
  (signed word) xpos#2 ← (signed word) 0
  (signed word) ypos#2 ← (signed word) 0
  (signed word) yvel_init#2 ← (signed word) $64
  (signed word) xvel#2 ← (signed word) $c8
  (signed word) yvel#2 ← (signed word) yvel_init#2
  to:@7

(void()) anim()
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 + (const signed word) g
  (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
  *((const byte*) SPRITES_XPOS + (number) 0) ← (byte~) anim::$9
  (byte~) anim::$10 ← ((byte)) (signed word) anim::sprite_y#0
  *((const byte*) SPRITES_YPOS + (number) 0) ← (byte~) anim::$10
  (byte~) anim::$11 ← > (signed word) anim::sprite_x#0
  *((const byte*) SPRITES_XMSB) ← (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
(label) @6
(label) @7
(label) @8
(label) @begin
(label) @end
(const byte*) RASTER = (byte*)(number) $d012
(const byte*) SCREEN = (byte*)(number) $400
(const byte*) SPRITE = (byte*)(number) $2000
(const byte*) SPRITES_COLS = (byte*)(number) $d027
(const byte*) SPRITES_ENABLE = (byte*)(number) $d015
(const byte*) SPRITES_EXPAND_X = (byte*)(number) $d01d
(const byte*) SPRITES_EXPAND_Y = (byte*)(number) $d017
(const byte*) SPRITES_PTR = (const byte*) SCREEN+(number) $3f8
(const byte*) SPRITES_XMSB = (byte*)(number) $d010
(const byte*) SPRITES_XPOS = (byte*)(number) $d000
(const byte*) SPRITES_YPOS = (byte*)(number) $d001
(const byte) WHITE = (byte) 1
(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
(const signed word) g = (signed word) -5
(void()) init()
(bool~) init::$0
(bool~) init::$1
(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) $3f8 in 
Adding number conversion cast (unumber) $ff in (bool~) main::$1 ← *((const byte*) RASTER) != (number) $ff
Adding number conversion cast (unumber) 1 in *((const byte*) SPRITES_ENABLE) ← (number) 1
Adding number conversion cast (unumber) 0 in *((const byte*) SPRITES_EXPAND_X) ← (number) 0
Adding number conversion cast (unumber) 0 in *((const byte*) SPRITES_EXPAND_Y) ← (number) 0
Adding number conversion cast (unumber) $64 in *((const byte*) SPRITES_XPOS + (number) 0) ← (number) $64
Adding number conversion cast (unumber) 0 in *((const byte*) SPRITES_XPOS + (number) 0) ← ((unumber)) (number) $64
Adding number conversion cast (unumber) $64 in *((const byte*) SPRITES_YPOS + (number) 0) ← (number) $64
Adding number conversion cast (unumber) 0 in *((const byte*) SPRITES_YPOS + (number) 0) ← ((unumber)) (number) $64
Adding number conversion cast (unumber) 0 in *((const byte*) SPRITES_COLS + (number) 0) ← (const byte) WHITE
Adding number conversion cast (unumber) $40 in *((const byte*) SPRITES_PTR + (number) 0) ← (byte)(const byte*) SPRITE/(number) $40
Adding number conversion cast (unumber) 0 in *((const byte*) SPRITES_PTR + (number) 0) ← (byte)(const byte*) SPRITE/(unumber)(number) $40
Adding number conversion cast (unumber) $3e8 in (bool~) init::$0 ← (byte*) init::sc#2 != (const byte*) SCREEN+(number) $3e8
Adding number conversion cast (unumber) $ff in *((const byte*) SPRITE + (byte) init::i#2) ← (number) $ff
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 *((const byte*) SPRITES_XPOS + (number) 0) ← (byte~) anim::$9
Adding number conversion cast (unumber) 0 in *((const byte*) SPRITES_YPOS + (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 *((const byte*) SPRITES_ENABLE) ← (unumber)(number) 1
Inlining cast *((const byte*) SPRITES_EXPAND_X) ← (unumber)(number) 0
Inlining cast *((const byte*) SPRITES_EXPAND_Y) ← (unumber)(number) 0
Inlining cast *((const byte*) SPRITES_XPOS + (unumber)(number) 0) ← (unumber)(number) $64
Inlining cast *((const byte*) SPRITES_YPOS + (unumber)(number) 0) ← (unumber)(number) $64
Inlining cast *((const byte*) SPRITE + (byte) init::i#2) ← (unumber)(number) $ff
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 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 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 (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) 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 [50] (bool~) anim::$1 ← (signed word) ypos#9 >= (signed byte) 0 from [49] (bool~) anim::$0 ← (signed word) ypos#9 < (signed byte) 0
Inversing boolean not [79] (bool~) anim::$15 ← (signed word) yvel_init#3 >= (signed word) -$c8 from [78] (bool~) anim::$14 ← (signed word) yvel_init#3 < (signed word) -$c8
Successful SSA optimization Pass2UnaryNotSimplification
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 [5] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2
Simple Condition (bool~) init::$0 [32] if((byte*) init::sc#2!=(const byte*) SCREEN+(word) $3e8) goto init::@2
Simple Condition (bool~) init::$1 [41] if((byte) init::i#1!=rangelast(0,$3f)) goto init::@7
Simple Condition (bool~) anim::$1 [51] if((signed word) ypos#13>=(signed byte) 0) goto anim::@1
Simple Condition (bool~) anim::$15 [80] if((signed word) yvel_init#3>=(signed word) -$c8) goto anim::@4
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) init::sc#0 = SCREEN
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) xpos#14 = 0
Constant (const signed word) ypos#14 = 0
Constant (const signed word) yvel_init#4 = $c8
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [14] if(true) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [39] init::i#1 ← ++ init::i#2 to ++
Resolved ranged comparison value [41] if(init::i#1!=rangelast(0,$3f)) goto init::@7 to (number) $40
Simplifying expression containing zero SPRITES_XPOS in [25] *((const byte*) SPRITES_XPOS + (byte) 0) ← (byte) $64
Simplifying expression containing zero SPRITES_YPOS in [26] *((const byte*) SPRITES_YPOS + (byte) 0) ← (byte) $64
Simplifying expression containing zero SPRITES_COLS in [27] *((const byte*) SPRITES_COLS + (byte) 0) ← (const byte) WHITE
Simplifying expression containing zero SPRITES_PTR in [28] *((const byte*) SPRITES_PTR + (byte) 0) ← (byte)(const byte*) SPRITE/(byte) $40
Simplifying expression containing zero SPRITES_XPOS in [66] *((const byte*) SPRITES_XPOS + (byte) 0) ← (byte~) anim::$9
Simplifying expression containing zero SPRITES_YPOS in [68] *((const byte*) SPRITES_YPOS + (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
Inlining constant with var siblings (const byte*) init::sc#0
Inlining constant with var siblings (const byte) init::i#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 word) 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
Constant inlined xvel#15 = (signed word) $c8
Constant inlined ypos#14 = (signed byte) 0
Constant inlined yvel#14 = (signed word) $64
Constant inlined ypos#15 = (signed word) 0
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::@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 @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::@3
CALL GRAPH
Calls in [] to main:3 
Calls in [main] to init:7 anim:12 

Created 13 initial phi equivalence classes
Coalesced [13] yvel#19 ← yvel#10
Coalesced [14] xpos#21 ← xpos#10
Coalesced [15] ypos#21 ← ypos#11
Coalesced [16] xvel#21 ← xvel#10
Coalesced [17] yvel_init#21 ← yvel_init#11
Coalesced (already) [18] yvel#18 ← yvel#12
Coalesced (already) [19] xpos#20 ← xpos#12
Coalesced (already) [20] ypos#20 ← ypos#13
Coalesced (already) [21] xvel#20 ← xvel#12
Coalesced (already) [22] yvel_init#20 ← yvel_init#13
Not coalescing [29] yvel#21 ← yvel#4
Coalesced [30] xvel#23 ← xvel#14
Coalesced [31] yvel_init#23 ← yvel#4
Coalesced [47] yvel#22 ← yvel_init#3
Coalesced [48] yvel#20 ← yvel#12
Coalesced [49] xpos#22 ← xpos#12
Coalesced (already) [50] xvel#22 ← xvel#12
Coalesced [51] ypos#22 ← ypos#13
Coalesced (already) [52] yvel_init#22 ← yvel_init#13
Coalesced [68] init::i#3 ← init::i#1
Coalesced [71] init::sc#4 ← init::sc#1
Coalesced down to 7 phi equivalence classes
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::@3
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()

(void()) main()
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 word) $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 word) 0 main::@2/(signed word) ypos#11 )
  [6] (signed word) xpos#12 ← phi( main::@1/(signed word) xpos#12 main/(signed word) 0 main::@2/(signed word) xpos#10 )
  [6] (signed word) yvel#12 ← phi( main::@1/(signed word) yvel#12 main/(signed word) $64 main::@2/(signed word) yvel#10 )
  [7] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@1
  [8] phi()
  [9] call anim 
  to:main::@1

(void()) anim()
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
  [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) ← (byte~) anim::$9
  [27] (byte~) anim::$10 ← (byte)(signed word) anim::sprite_y#0
  [28] *((const byte*) SPRITES_YPOS) ← (byte~) anim::$10
  [29] (byte~) anim::$11 ← > (signed word) anim::sprite_x#0
  [30] *((const byte*) SPRITES_XMSB) ← (byte~) anim::$11
  to:anim::@return
anim::@return: scope:[anim]  from anim::@1
  [31] return 
  to:@return

(void()) init()
init: scope:[init]  from main
  [32] *((const byte*) SPRITES_ENABLE) ← (byte) 1
  [33] *((const byte*) SPRITES_EXPAND_X) ← (byte) 0
  [34] *((const byte*) SPRITES_EXPAND_Y) ← (byte) 0
  [35] *((const byte*) SPRITES_XPOS) ← (byte) $64
  [36] *((const byte*) SPRITES_YPOS) ← (byte) $64
  [37] *((const byte*) SPRITES_COLS) ← (const byte) WHITE
  [38] *((const byte*) SPRITES_PTR) ← (byte)(const byte*) SPRITE/(byte) $40
  to:init::@1
init::@1: scope:[init]  from init init::@2
  [39] (byte*) init::sc#2 ← phi( init/(const byte*) SCREEN init::@2/(byte*) init::sc#1 )
  [40] if((byte*) init::sc#2!=(const byte*) SCREEN+(word) $3e8) goto init::@2
  to:init::@3
init::@3: scope:[init]  from init::@1 init::@3
  [41] (byte) init::i#2 ← phi( init::@1/(byte) 0 init::@3/(byte) init::i#1 )
  [42] *((const byte*) SPRITE + (byte) init::i#2) ← (byte) $ff
  [43] (byte) init::i#1 ← ++ (byte) init::i#2
  [44] if((byte) init::i#1!=(byte) $40) goto init::@3
  to:init::@return
init::@return: scope:[init]  from init::@3
  [45] return 
  to:@return
init::@2: scope:[init]  from init::@1
  [46] *((byte*) init::sc#2) ← (byte) ' '
  [47] (byte*) init::sc#1 ← ++ (byte*) init::sc#2
  to:init::@1


VARIABLE REGISTER WEIGHTS
(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
(void()) init()
(byte) init::i
(byte) init::i#1 16.5
(byte) init::i#2 16.5
(byte*) init::sc
(byte*) init::sc#1 22.0
(byte*) init::sc#2 14.666666666666666
(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#2 init::sc#1 ]
[ init::i#2 init::i#1 ]
Added variable anim::$5 to live range equivalence class [ anim::$5 ]
Added variable anim::sprite_x#0 to live range equivalence class [ anim::sprite_x#0 ]
Added variable anim::$7 to live range equivalence class [ anim::$7 ]
Added variable anim::sprite_y#0 to live range equivalence class [ anim::sprite_y#0 ]
Added variable anim::$9 to live range equivalence class [ anim::$9 ]
Added variable anim::$10 to live range equivalence class [ anim::$10 ]
Added variable anim::$11 to live range 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#2 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[2]:2 [ xvel#12 xvel#10 xvel#14 ]
Allocated zp[2]:4 [ yvel_init#13 yvel_init#11 yvel#4 yvel_init#3 ]
Allocated zp[2]:6 [ yvel#9 yvel#12 yvel#10 yvel#21 ]
Allocated zp[2]:8 [ xpos#9 xpos#12 xpos#10 ]
Allocated zp[2]:10 [ ypos#10 ypos#13 ypos#11 ]
Allocated zp[2]:12 [ init::sc#2 init::sc#1 ]
Allocated zp[1]:14 [ init::i#2 init::i#1 ]
Allocated zp[2]:15 [ anim::$5 ]
Allocated zp[2]:17 [ anim::sprite_x#0 ]
Allocated zp[2]:19 [ anim::$7 ]
Allocated zp[2]:21 [ anim::sprite_y#0 ]
Allocated zp[1]:23 [ anim::$9 ]
Allocated zp[1]:24 [ anim::$10 ]
Allocated zp[1]:25 [ anim::$11 ]

INITIAL ASM
Target platform is c64basic / MOS6502X
  // 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 SPRITES_PTR = SCREEN+$3f8
  .label SPRITE = $2000
  .const g = -5
  // Reset y velocity
  .label yvel_init = 4
  .label yvel = 4
  .label yvel_1 = 6
  // Reset position
  .label xpos = 8
  .label ypos = $a
  .label xvel = 2
  // @begin
__bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
__b1_from___bbegin:
  jmp __b1
  // @1
__b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from___b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
__bend_from___b1:
  jmp __bend
  // @end
__bend:
  // main
main: {
    // [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 word) $64 [phi:main->main::@1#0] -- vwsz1=vwsc1 
    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 word) 0 [phi:main->main::@1#2] -- vwsz1=vwsc1 
    lda #<0
    sta.z ypos
    lda #>0
    sta.z ypos+1
    // [6] phi (signed word) xpos#12 = (signed word) 0 [phi:main->main::@1#3] -- vwsz1=vwsc1 
    lda #<0
    sta.z xpos
    lda #>0
    sta.z xpos+1
    // [6] phi (signed word) yvel#12 = (signed word) $64 [phi:main->main::@1#4] -- vwsz1=vwsc1 
    lda #<$64
    sta.z yvel_1
    lda #>$64
    sta.z yvel_1+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)!=(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_1
    lda.z yvel+1
    sta.z yvel_1+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 -- vwsz1=vwsz1_plus_vwsc1 
    clc
    lda.z yvel_1
    adc #<g
    sta.z yvel_1
    lda.z yvel_1+1
    adc #>g
    sta.z yvel_1+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_1
    sta.z ypos
    lda.z ypos+1
    adc.z yvel_1+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) ← (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) ← (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) ← (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) ← (byte) 1 -- _deref_pbuc1=vbuc2 
    lda #1
    sta SPRITES_ENABLE
    // [33] *((const byte*) SPRITES_EXPAND_X) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SPRITES_EXPAND_X
    // [34] *((const byte*) SPRITES_EXPAND_Y) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SPRITES_EXPAND_Y
    // [35] *((const byte*) SPRITES_XPOS) ← (byte) $64 -- _deref_pbuc1=vbuc2 
    lda #$64
    sta SPRITES_XPOS
    // [36] *((const byte*) SPRITES_YPOS) ← (byte) $64 -- _deref_pbuc1=vbuc2 
    lda #$64
    sta SPRITES_YPOS
    // [37] *((const byte*) SPRITES_COLS) ← (const byte) WHITE -- _deref_pbuc1=vbuc2 
    lda #WHITE
    sta SPRITES_COLS
    // [38] *((const byte*) SPRITES_PTR) ← (byte)(const byte*) SPRITE/(byte) $40 -- _deref_pbuc1=vbuc2 
    lda #SPRITE/$40
    sta SPRITES_PTR
    // [39] phi from init to init::@1 [phi:init->init::@1]
  __b1_from_init:
    // [39] phi (byte*) init::sc#2 = (const byte*) SCREEN [phi:init->init::@1#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z sc
    lda #>SCREEN
    sta.z sc+1
    jmp __b1
    // init::@1
  __b1:
    // [40] if((byte*) init::sc#2!=(const byte*) SCREEN+(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
    // [41] phi from init::@1 to init::@3 [phi:init::@1->init::@3]
  __b3_from___b1:
    // [41] phi (byte) init::i#2 = (byte) 0 [phi:init::@1->init::@3#0] -- vbuz1=vbuc1 
    lda #0
    sta.z i
    jmp __b3
    // [41] phi from init::@3 to init::@3 [phi:init::@3->init::@3]
  __b3_from___b3:
    // [41] phi (byte) init::i#2 = (byte) init::i#1 [phi:init::@3->init::@3#0] -- register_copy 
    jmp __b3
    // init::@3
  __b3:
    // [42] *((const byte*) SPRITE + (byte) init::i#2) ← (byte) $ff -- pbuc1_derefidx_vbuz1=vbuc2 
    lda #$ff
    ldy.z i
    sta SPRITE,y
    // [43] (byte) init::i#1 ← ++ (byte) init::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [44] 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:
    // [45] return 
    rts
    // init::@2
  __b2:
    // [46] *((byte*) init::sc#2) ← (byte) ' ' -- _deref_pbuz1=vbuc1 
    lda #' '
    ldy #0
    sta (sc),y
    // [47] (byte*) init::sc#1 ← ++ (byte*) init::sc#2 -- pbuz1=_inc_pbuz1 
    inc.z sc
    bne !+
    inc.z sc+1
  !:
    // [39] phi from init::@2 to init::@1 [phi:init::@2->init::@1]
  __b1_from___b2:
    // [39] phi (byte*) init::sc#2 = (byte*) init::sc#1 [phi:init::@2->init::@1#0] -- register_copy 
    jmp __b1
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] if(*((const byte*) RASTER)!=(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 [ 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) ← (byte) 1 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [33] *((const byte*) SPRITES_EXPAND_X) ← (byte) 0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [34] *((const byte*) SPRITES_EXPAND_Y) ← (byte) 0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [35] *((const byte*) SPRITES_XPOS) ← (byte) $64 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [36] *((const byte*) SPRITES_YPOS) ← (byte) $64 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [37] *((const byte*) SPRITES_COLS) ← (const byte) WHITE [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [38] *((const byte*) SPRITES_PTR) ← (byte)(const byte*) SPRITE/(byte) $40 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [40] if((byte*) init::sc#2!=(const byte*) SCREEN+(word) $3e8) goto init::@2 [ init::sc#2 ] ( main:2::init:5 [ init::sc#2 ] ) always clobbers reg byte a 
Statement [42] *((const byte*) SPRITE + (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[1]:14 [ init::i#2 init::i#1 ]
Statement [46] *((byte*) init::sc#2) ← (byte) ' ' [ init::sc#2 ] ( main:2::init:5 [ init::sc#2 ] ) always clobbers reg byte a reg byte y 
Statement [7] if(*((const byte*) RASTER)!=(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 [ 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) ← (byte) 1 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [33] *((const byte*) SPRITES_EXPAND_X) ← (byte) 0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [34] *((const byte*) SPRITES_EXPAND_Y) ← (byte) 0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [35] *((const byte*) SPRITES_XPOS) ← (byte) $64 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [36] *((const byte*) SPRITES_YPOS) ← (byte) $64 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [37] *((const byte*) SPRITES_COLS) ← (const byte) WHITE [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [38] *((const byte*) SPRITES_PTR) ← (byte)(const byte*) SPRITE/(byte) $40 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a 
Statement [40] if((byte*) init::sc#2!=(const byte*) SCREEN+(word) $3e8) goto init::@2 [ init::sc#2 ] ( main:2::init:5 [ init::sc#2 ] ) always clobbers reg byte a 
Statement [42] *((const byte*) SPRITE + (byte) init::i#2) ← (byte) $ff [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] ) always clobbers reg byte a 
Statement [46] *((byte*) init::sc#2) ← (byte) ' ' [ init::sc#2 ] ( main:2::init:5 [ init::sc#2 ] ) always clobbers reg byte a reg byte y 
Potential registers zp[2]:2 [ xvel#12 xvel#10 xvel#14 ] : zp[2]:2 , 
Potential registers zp[2]:4 [ yvel_init#13 yvel_init#11 yvel#4 yvel_init#3 ] : zp[2]:4 , 
Potential registers zp[2]:6 [ yvel#9 yvel#12 yvel#10 yvel#21 ] : zp[2]:6 , 
Potential registers zp[2]:8 [ xpos#9 xpos#12 xpos#10 ] : zp[2]:8 , 
Potential registers zp[2]:10 [ ypos#10 ypos#13 ypos#11 ] : zp[2]:10 , 
Potential registers zp[2]:12 [ init::sc#2 init::sc#1 ] : zp[2]:12 , 
Potential registers zp[1]:14 [ init::i#2 init::i#1 ] : zp[1]:14 , reg byte x , reg byte y , 
Potential registers zp[2]:15 [ anim::$5 ] : zp[2]:15 , 
Potential registers zp[2]:17 [ anim::sprite_x#0 ] : zp[2]:17 , 
Potential registers zp[2]:19 [ anim::$7 ] : zp[2]:19 , 
Potential registers zp[2]:21 [ anim::sprite_y#0 ] : zp[2]:21 , 
Potential registers zp[1]:23 [ anim::$9 ] : zp[1]:23 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:24 [ anim::$10 ] : zp[1]:24 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:25 [ anim::$11 ] : zp[1]:25 , reg byte a , reg byte x , reg byte y , 

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

Uplifting [] best 7904 combination zp[2]:6 [ yvel#9 yvel#12 yvel#10 yvel#21 ] zp[2]:8 [ xpos#9 xpos#12 xpos#10 ] zp[2]:10 [ ypos#10 ypos#13 ypos#11 ] zp[2]:2 [ xvel#12 xvel#10 xvel#14 ] zp[2]:4 [ yvel_init#13 yvel_init#11 yvel#4 yvel_init#3 ] 
Uplifting [init] best 7784 combination zp[2]:12 [ init::sc#2 init::sc#1 ] reg byte x [ init::i#2 init::i#1 ] 
Uplifting [anim] best 7766 combination zp[2]:15 [ anim::$5 ] zp[2]:19 [ anim::$7 ] reg byte a [ anim::$9 ] reg byte a [ anim::$10 ] reg byte a [ anim::$11 ] zp[2]:21 [ anim::sprite_y#0 ] zp[2]:17 [ anim::sprite_x#0 ] 
Uplifting [main] best 7766 combination 
Coalescing zero page register [ zp[2]:15 [ anim::$5 ] ] with [ zp[2]:17 [ anim::sprite_x#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:19 [ anim::$7 ] ] with [ zp[2]:21 [ anim::sprite_y#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:12 [ init::sc#2 init::sc#1 ] ] with [ zp[2]:2 [ xvel#12 xvel#10 xvel#14 ] ]
Allocated (was zp[2]:4) zp[2]:2 [ yvel_init#13 yvel_init#11 yvel#4 yvel_init#3 ]
Allocated (was zp[2]:6) zp[2]:4 [ yvel#9 yvel#12 yvel#10 yvel#21 ]
Allocated (was zp[2]:8) zp[2]:6 [ xpos#9 xpos#12 xpos#10 ]
Allocated (was zp[2]:10) zp[2]:8 [ ypos#10 ypos#13 ypos#11 ]
Allocated (was zp[2]:12) zp[2]:10 [ init::sc#2 init::sc#1 xvel#12 xvel#10 xvel#14 ]
Allocated (was zp[2]:15) zp[2]:12 [ anim::$5 anim::sprite_x#0 ]
Allocated (was zp[2]:19) zp[2]: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 SPRITES_PTR = SCREEN+$3f8
  .label SPRITE = $2000
  .const g = -5
  // Reset y velocity
  .label yvel_init = 2
  .label yvel = 2
  .label yvel_1 = 4
  // Reset position
  .label xpos = 6
  .label ypos = 8
  .label xvel = $a
  // @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 word) $64 [phi:main->main::@1#0] -- vwsz1=vwsc1 
    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 word) 0 [phi:main->main::@1#2] -- vwsz1=vwsc1 
    lda #<0
    sta.z ypos
    lda #>0
    sta.z ypos+1
    // [6] phi (signed word) xpos#12 = (signed word) 0 [phi:main->main::@1#3] -- vwsz1=vwsc1 
    lda #<0
    sta.z xpos
    lda #>0
    sta.z xpos+1
    // [6] phi (signed word) yvel#12 = (signed word) $64 [phi:main->main::@1#4] -- vwsz1=vwsc1 
    lda #<$64
    sta.z yvel_1
    lda #>$64
    sta.z yvel_1+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)!=(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_1
    lda.z yvel+1
    sta.z yvel_1+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 -- vwsz1=vwsz1_plus_vwsc1 
    clc
    lda.z yvel_1
    adc #<g
    sta.z yvel_1
    lda.z yvel_1+1
    adc #>g
    sta.z yvel_1+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_1
    sta.z ypos
    lda.z ypos+1
    adc.z yvel_1+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) ← (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) ← (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) ← (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) ← (byte) 1 -- _deref_pbuc1=vbuc2 
    lda #1
    sta SPRITES_ENABLE
    // [33] *((const byte*) SPRITES_EXPAND_X) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SPRITES_EXPAND_X
    // [34] *((const byte*) SPRITES_EXPAND_Y) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SPRITES_EXPAND_Y
    // [35] *((const byte*) SPRITES_XPOS) ← (byte) $64 -- _deref_pbuc1=vbuc2 
    lda #$64
    sta SPRITES_XPOS
    // [36] *((const byte*) SPRITES_YPOS) ← (byte) $64 -- _deref_pbuc1=vbuc2 
    lda #$64
    sta SPRITES_YPOS
    // [37] *((const byte*) SPRITES_COLS) ← (const byte) WHITE -- _deref_pbuc1=vbuc2 
    lda #WHITE
    sta SPRITES_COLS
    // [38] *((const byte*) SPRITES_PTR) ← (byte)(const byte*) SPRITE/(byte) $40 -- _deref_pbuc1=vbuc2 
    lda #SPRITE/$40
    sta SPRITES_PTR
    // [39] phi from init to init::@1 [phi:init->init::@1]
  __b1_from_init:
    // [39] phi (byte*) init::sc#2 = (const byte*) SCREEN [phi:init->init::@1#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z sc
    lda #>SCREEN
    sta.z sc+1
    jmp __b1
    // init::@1
  __b1:
    // [40] if((byte*) init::sc#2!=(const byte*) SCREEN+(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
    // [41] phi from init::@1 to init::@3 [phi:init::@1->init::@3]
  __b3_from___b1:
    // [41] phi (byte) init::i#2 = (byte) 0 [phi:init::@1->init::@3#0] -- vbuxx=vbuc1 
    ldx #0
    jmp __b3
    // [41] phi from init::@3 to init::@3 [phi:init::@3->init::@3]
  __b3_from___b3:
    // [41] phi (byte) init::i#2 = (byte) init::i#1 [phi:init::@3->init::@3#0] -- register_copy 
    jmp __b3
    // init::@3
  __b3:
    // [42] *((const byte*) SPRITE + (byte) init::i#2) ← (byte) $ff -- pbuc1_derefidx_vbuxx=vbuc2 
    lda #$ff
    sta SPRITE,x
    // [43] (byte) init::i#1 ← ++ (byte) init::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [44] 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:
    // [45] return 
    rts
    // init::@2
  __b2:
    // [46] *((byte*) init::sc#2) ← (byte) ' ' -- _deref_pbuz1=vbuc1 
    lda #' '
    ldy #0
    sta (sc),y
    // [47] (byte*) init::sc#1 ← ++ (byte*) init::sc#2 -- pbuz1=_inc_pbuz1 
    inc.z sc
    bne !+
    inc.z sc+1
  !:
    // [39] phi from init::@2 to init::@1 [phi:init::@2->init::@1]
  __b1_from___b2:
    // [39] phi (byte*) init::sc#2 = (byte*) init::sc#1 [phi:init::@2->init::@1#0] -- register_copy 
    jmp __b1
}
  // 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 __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 __bbegin with __b1
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 __b3_from___b3 with __b3
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
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 __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 __b1_from_init:
Removing instruction __b3_from___b1:
Removing instruction __breturn:
Removing instruction __b1_from___b2:
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 __b3
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __b1:
Succesful ASM optimization Pass5UnusedLabelElimination

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

zp[2]:2 [ yvel_init#13 yvel_init#11 yvel#4 yvel_init#3 ]
zp[2]:4 [ yvel#9 yvel#12 yvel#10 yvel#21 ]
zp[2]:6 [ xpos#9 xpos#12 xpos#10 ]
zp[2]:8 [ ypos#10 ypos#13 ypos#11 ]
zp[2]:10 [ init::sc#2 init::sc#1 xvel#12 xvel#10 xvel#14 ]
reg byte x [ init::i#2 init::i#1 ]
zp[2]:12 [ anim::$5 anim::sprite_x#0 ]
zp[2]: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: 6373

  // 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 SPRITES_PTR = SCREEN+$3f8
  .label SPRITE = $2000
  .const g = -5
  // Reset y velocity
  .label yvel_init = 2
  .label yvel = 2
  .label yvel_1 = 4
  // Reset position
  .label xpos = 6
  .label ypos = 8
  .label xvel = $a
  // @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 word) $64 [phi:main->main::@1#0] -- vwsz1=vwsc1 
    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 word) 0 [phi:main->main::@1#2] -- vwsz1=vwsc1 
    lda #<0
    sta.z ypos
    sta.z ypos+1
    // [6] phi (signed word) xpos#12 = (signed word) 0 [phi:main->main::@1#3] -- vwsz1=vwsc1 
    sta.z xpos
    sta.z xpos+1
    // [6] phi (signed word) yvel#12 = (signed word) $64 [phi:main->main::@1#4] -- vwsz1=vwsc1 
    lda #<$64
    sta.z yvel_1
    lda #>$64
    sta.z yvel_1+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)!=(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_1
    lda.z yvel+1
    sta.z yvel_1+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 -- vwsz1=vwsz1_plus_vwsc1 
    clc
    lda.z yvel_1
    adc #<g
    sta.z yvel_1
    lda.z yvel_1+1
    adc #>g
    sta.z yvel_1+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_1
    sta.z ypos
    lda.z ypos+1
    adc.z yvel_1+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) ← (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) ← (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) ← (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) ← (byte) 1 -- _deref_pbuc1=vbuc2 
    lda #1
    sta SPRITES_ENABLE
    // *SPRITES_EXPAND_X = 0
    // [33] *((const byte*) SPRITES_EXPAND_X) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SPRITES_EXPAND_X
    // *SPRITES_EXPAND_Y = 0
    // [34] *((const byte*) SPRITES_EXPAND_Y) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    sta SPRITES_EXPAND_Y
    // SPRITES_XPOS[0] = 100
    // [35] *((const byte*) SPRITES_XPOS) ← (byte) $64 -- _deref_pbuc1=vbuc2 
    lda #$64
    sta SPRITES_XPOS
    // SPRITES_YPOS[0] = 100
    // [36] *((const byte*) SPRITES_YPOS) ← (byte) $64 -- _deref_pbuc1=vbuc2 
    sta SPRITES_YPOS
    // SPRITES_COLS[0] = WHITE
    // [37] *((const byte*) SPRITES_COLS) ← (const byte) WHITE -- _deref_pbuc1=vbuc2 
    lda #WHITE
    sta SPRITES_COLS
    // SPRITES_PTR[0] = (byte)(SPRITE/$40)
    // [38] *((const byte*) SPRITES_PTR) ← (byte)(const byte*) SPRITE/(byte) $40 -- _deref_pbuc1=vbuc2 
    lda #SPRITE/$40
    sta SPRITES_PTR
    // [39] phi from init to init::@1 [phi:init->init::@1]
    // [39] phi (byte*) init::sc#2 = (const byte*) SCREEN [phi:init->init::@1#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z sc
    lda #>SCREEN
    sta.z sc+1
    // init::@1
  __b1:
    // for(byte* sc=SCREEN; sc!=SCREEN+1000; sc++ )
    // [40] if((byte*) init::sc#2!=(const byte*) SCREEN+(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
    // [41] phi from init::@1 to init::@3 [phi:init::@1->init::@3]
    // [41] phi (byte) init::i#2 = (byte) 0 [phi:init::@1->init::@3#0] -- vbuxx=vbuc1 
    ldx #0
    // [41] phi from init::@3 to init::@3 [phi:init::@3->init::@3]
    // [41] phi (byte) init::i#2 = (byte) init::i#1 [phi:init::@3->init::@3#0] -- register_copy 
    // init::@3
  __b3:
    // SPRITE[i] = $ff
    // [42] *((const byte*) SPRITE + (byte) init::i#2) ← (byte) $ff -- pbuc1_derefidx_vbuxx=vbuc2 
    lda #$ff
    sta SPRITE,x
    // for(byte i : 0..63)
    // [43] (byte) init::i#1 ← ++ (byte) init::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [44] if((byte) init::i#1!=(byte) $40) goto init::@3 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$40
    bne __b3
    // init::@return
    // }
    // [45] return 
    rts
    // init::@2
  __b2:
    // *sc = ' '
    // [46] *((byte*) init::sc#2) ← (byte) ' ' -- _deref_pbuz1=vbuc1 
    lda #' '
    ldy #0
    sta (sc),y
    // for(byte* sc=SCREEN; sc!=SCREEN+1000; sc++ )
    // [47] (byte*) init::sc#1 ← ++ (byte*) init::sc#2 -- pbuz1=_inc_pbuz1 
    inc.z sc
    bne !+
    inc.z sc+1
  !:
    // [39] phi from init::@2 to init::@1 [phi:init::@2->init::@1]
    // [39] phi (byte*) init::sc#2 = (byte*) init::sc#1 [phi:init::@2->init::@1#0] -- register_copy 
    jmp __b1
}
  // File Data

