Resolved forward reference frame_cnt to (byte) frame_cnt
Resolved forward reference frame_cnt to (byte) frame_cnt
Resolved forward reference frame_cnt to (byte) frame_cnt
Resolved forward reference irq to interrupt(HARDWARE_CLOBBER)(void()) irq()
Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src)
Warning! Adding boolean cast to non-boolean condition *((byte*) strlen::str)
Warning! Adding boolean cast to non-boolean condition (number~) abs_u16::$1
Warning! Adding boolean cast to non-boolean condition (number~) sgn_u16::$1
Warning! Adding boolean cast to non-boolean sub-expression (byte) frame_cnt
Identified constant variable (byte*) BITMAP
Identified constant variable (byte*) SCREEN
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx 
Inlined call (byte~) main::$2 ← call toD018 (const byte*) SCREEN (const byte*) BITMAP 
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) @4
Culled Empty Block (label) @5
Culled Empty Block (label) @6
Culled Empty Block (label) memset::@7
Culled Empty Block (label) memset::@6
Culled Empty Block (label) memset::@8
Culled Empty Block (label) memset::@9
Culled Empty Block (label) memset::@3
Culled Empty Block (label) @7
Culled Empty Block (label) @8
Culled Empty Block (label) bitmap_init::@8
Culled Empty Block (label) @10
Culled Empty Block (label) @11
Culled Empty Block (label) @12
Culled Empty Block (label) @13
Culled Empty Block (label) @14
Culled Empty Block (label) @15
Culled Empty Block (label) main::toD0181_@1
Culled Empty Block (label) main::@6
Culled Empty Block (label) main::@3
Culled Empty Block (label) main::@7
Culled Empty Block (label) main::@10
Culled Empty Block (label) @17

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@9

(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
memset: scope:[memset]  from bitmap_clear bitmap_clear::@1
  (byte) memset::c#5 ← phi( bitmap_clear/(byte) memset::c#0 bitmap_clear::@1/(byte) memset::c#1 )
  (void*) memset::str#4 ← phi( bitmap_clear/(void*) memset::str#0 bitmap_clear::@1/(void*) memset::str#1 )
  (word) memset::num#2 ← phi( bitmap_clear/(word) memset::num#0 bitmap_clear::@1/(word) memset::num#1 )
  (bool~) memset::$0 ← (word) memset::num#2 > (number) 0
  (bool~) memset::$1 ← ! (bool~) memset::$0
  if((bool~) memset::$1) goto memset::@1
  to:memset::@2
memset::@1: scope:[memset]  from memset memset::@4
  (void*) memset::str#2 ← phi( memset/(void*) memset::str#4 memset::@4/(void*) memset::str#5 )
  (void*) memset::return#0 ← (void*) memset::str#2
  to:memset::@return
memset::@2: scope:[memset]  from memset
  (byte) memset::c#4 ← phi( memset/(byte) memset::c#5 )
  (word) memset::num#3 ← phi( memset/(word) memset::num#2 )
  (void*) memset::str#3 ← phi( memset/(void*) memset::str#4 )
  (byte*~) memset::$2 ← ((byte*)) (void*) memset::str#3
  (byte*~) memset::$3 ← (byte*~) memset::$2 + (word) memset::num#3
  (byte*) memset::end#0 ← (byte*~) memset::$3
  (byte*) memset::dst#0 ← ((byte*)) (void*) memset::str#3
  to:memset::@4
memset::@4: scope:[memset]  from memset::@2 memset::@5
  (byte) memset::c#3 ← phi( memset::@2/(byte) memset::c#4 memset::@5/(byte) memset::c#2 )
  (void*) memset::str#5 ← phi( memset::@2/(void*) memset::str#3 memset::@5/(void*) memset::str#6 )
  (byte*) memset::end#1 ← phi( memset::@2/(byte*) memset::end#0 memset::@5/(byte*) memset::end#2 )
  (byte*) memset::dst#2 ← phi( memset::@2/(byte*) memset::dst#0 memset::@5/(byte*) memset::dst#1 )
  (bool~) memset::$4 ← (byte*) memset::dst#2 != (byte*) memset::end#1
  if((bool~) memset::$4) goto memset::@5
  to:memset::@1
memset::@5: scope:[memset]  from memset::@4
  (void*) memset::str#6 ← phi( memset::@4/(void*) memset::str#5 )
  (byte*) memset::end#2 ← phi( memset::@4/(byte*) memset::end#1 )
  (byte*) memset::dst#3 ← phi( memset::@4/(byte*) memset::dst#2 )
  (byte) memset::c#2 ← phi( memset::@4/(byte) memset::c#3 )
  *((byte*) memset::dst#3) ← (byte) memset::c#2
  (byte*) memset::dst#1 ← ++ (byte*) memset::dst#3
  to:memset::@4
memset::@return: scope:[memset]  from memset::@1
  (void*) memset::return#4 ← phi( memset::@1/(void*) memset::return#0 )
  (void*) memset::return#1 ← (void*) memset::return#4
  return 
  to:@return
@9: scope:[]  from @begin
  (byte*) bitmap_screen#0 ← (byte*) 0
  (byte*) bitmap_gfx#0 ← (byte*) 0
  to:@16

(void()) bitmap_init((byte*) bitmap_init::gfx , (byte*) bitmap_init::screen)
bitmap_init: scope:[bitmap_init]  from main
  (byte*) bitmap_init::screen#1 ← phi( main/(byte*) bitmap_init::screen#0 )
  (byte*) bitmap_init::gfx#1 ← phi( main/(byte*) bitmap_init::gfx#0 )
  (byte*) bitmap_gfx#1 ← (byte*) bitmap_init::gfx#1
  (byte*) bitmap_screen#1 ← (byte*) bitmap_init::screen#1
  (byte) bitmap_init::bits#0 ← (byte) $80
  (byte) bitmap_init::x#0 ← (byte) 0
  to:bitmap_init::@1
bitmap_init::@1: scope:[bitmap_init]  from bitmap_init bitmap_init::@2
  (byte*) bitmap_screen#28 ← phi( bitmap_init/(byte*) bitmap_screen#1 bitmap_init::@2/(byte*) bitmap_screen#24 )
  (byte*) bitmap_gfx#29 ← phi( bitmap_init/(byte*) bitmap_gfx#1 bitmap_init::@2/(byte*) bitmap_gfx#25 )
  (byte*) bitmap_init::gfx#4 ← phi( bitmap_init/(byte*) bitmap_init::gfx#1 bitmap_init::@2/(byte*) bitmap_init::gfx#3 )
  (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) bitmap_init::x#0 bitmap_init::@2/(byte) bitmap_init::x#1 )
  (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) bitmap_init::bits#0 bitmap_init::@2/(byte) bitmap_init::bits#4 )
  *((const byte*) bitmap_plot_bit + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3
  (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (number) 1
  (bool~) bitmap_init::$0 ← (byte) bitmap_init::bits#1 == (number) 0
  (bool~) bitmap_init::$1 ← ! (bool~) bitmap_init::$0
  if((bool~) bitmap_init::$1) goto bitmap_init::@2
  to:bitmap_init::@3
bitmap_init::@2: scope:[bitmap_init]  from bitmap_init::@1 bitmap_init::@3
  (byte*) bitmap_screen#24 ← phi( bitmap_init::@1/(byte*) bitmap_screen#28 bitmap_init::@3/(byte*) bitmap_screen#29 )
  (byte*) bitmap_gfx#25 ← phi( bitmap_init::@1/(byte*) bitmap_gfx#29 bitmap_init::@3/(byte*) bitmap_gfx#30 )
  (byte*) bitmap_init::gfx#3 ← phi( bitmap_init::@1/(byte*) bitmap_init::gfx#4 bitmap_init::@3/(byte*) bitmap_init::gfx#5 )
  (byte) bitmap_init::bits#4 ← phi( bitmap_init::@1/(byte) bitmap_init::bits#1 bitmap_init::@3/(byte) bitmap_init::bits#2 )
  (byte) bitmap_init::x#3 ← phi( bitmap_init::@1/(byte) bitmap_init::x#2 bitmap_init::@3/(byte) bitmap_init::x#4 )
  (byte) bitmap_init::x#1 ← (byte) bitmap_init::x#3 + rangenext(0,$ff)
  (bool~) bitmap_init::$2 ← (byte) bitmap_init::x#1 != rangelast(0,$ff)
  if((bool~) bitmap_init::$2) goto bitmap_init::@1
  to:bitmap_init::@4
bitmap_init::@3: scope:[bitmap_init]  from bitmap_init::@1
  (byte*) bitmap_screen#29 ← phi( bitmap_init::@1/(byte*) bitmap_screen#28 )
  (byte*) bitmap_gfx#30 ← phi( bitmap_init::@1/(byte*) bitmap_gfx#29 )
  (byte*) bitmap_init::gfx#5 ← phi( bitmap_init::@1/(byte*) bitmap_init::gfx#4 )
  (byte) bitmap_init::x#4 ← phi( bitmap_init::@1/(byte) bitmap_init::x#2 )
  (byte) bitmap_init::bits#2 ← (number) $80
  to:bitmap_init::@2
bitmap_init::@4: scope:[bitmap_init]  from bitmap_init::@2
  (byte*) bitmap_screen#20 ← phi( bitmap_init::@2/(byte*) bitmap_screen#24 )
  (byte*) bitmap_gfx#21 ← phi( bitmap_init::@2/(byte*) bitmap_gfx#25 )
  (byte*) bitmap_init::gfx#2 ← phi( bitmap_init::@2/(byte*) bitmap_init::gfx#3 )
  (byte*) bitmap_init::yoffs#0 ← (byte*) bitmap_init::gfx#2
  (byte) bitmap_init::y#0 ← (byte) 0
  to:bitmap_init::@5
bitmap_init::@5: scope:[bitmap_init]  from bitmap_init::@4 bitmap_init::@6
  (byte*) bitmap_screen#15 ← phi( bitmap_init::@4/(byte*) bitmap_screen#20 bitmap_init::@6/(byte*) bitmap_screen#11 )
  (byte*) bitmap_gfx#16 ← phi( bitmap_init::@4/(byte*) bitmap_gfx#21 bitmap_init::@6/(byte*) bitmap_gfx#11 )
  (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@4/(byte*) bitmap_init::yoffs#0 bitmap_init::@6/(byte*) bitmap_init::yoffs#4 )
  (byte) bitmap_init::y#2 ← phi( bitmap_init::@4/(byte) bitmap_init::y#0 bitmap_init::@6/(byte) bitmap_init::y#1 )
  (number~) bitmap_init::$3 ← (byte) bitmap_init::y#2 & (number) 7
  (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2
  (number~) bitmap_init::$5 ← (number~) bitmap_init::$3 | (byte~) bitmap_init::$4
  *((const byte*) bitmap_plot_ylo + (byte) bitmap_init::y#2) ← (number~) bitmap_init::$5
  (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2
  *((const byte*) bitmap_plot_yhi + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6
  (number~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (number) 7
  (bool~) bitmap_init::$8 ← (number~) bitmap_init::$7 == (number) 7
  (bool~) bitmap_init::$9 ← ! (bool~) bitmap_init::$8
  if((bool~) bitmap_init::$9) goto bitmap_init::@6
  to:bitmap_init::@7
bitmap_init::@6: scope:[bitmap_init]  from bitmap_init::@5 bitmap_init::@7
  (byte*) bitmap_screen#11 ← phi( bitmap_init::@5/(byte*) bitmap_screen#15 bitmap_init::@7/(byte*) bitmap_screen#16 )
  (byte*) bitmap_gfx#11 ← phi( bitmap_init::@5/(byte*) bitmap_gfx#16 bitmap_init::@7/(byte*) bitmap_gfx#17 )
  (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@5/(byte*) bitmap_init::yoffs#2 bitmap_init::@7/(byte*) bitmap_init::yoffs#1 )
  (byte) bitmap_init::y#3 ← phi( bitmap_init::@5/(byte) bitmap_init::y#2 bitmap_init::@7/(byte) bitmap_init::y#4 )
  (byte) bitmap_init::y#1 ← (byte) bitmap_init::y#3 + rangenext(0,$ff)
  (bool~) bitmap_init::$11 ← (byte) bitmap_init::y#1 != rangelast(0,$ff)
  if((bool~) bitmap_init::$11) goto bitmap_init::@5
  to:bitmap_init::@return
bitmap_init::@7: scope:[bitmap_init]  from bitmap_init::@5
  (byte*) bitmap_screen#16 ← phi( bitmap_init::@5/(byte*) bitmap_screen#15 )
  (byte*) bitmap_gfx#17 ← phi( bitmap_init::@5/(byte*) bitmap_gfx#16 )
  (byte) bitmap_init::y#4 ← phi( bitmap_init::@5/(byte) bitmap_init::y#2 )
  (byte*) bitmap_init::yoffs#3 ← phi( bitmap_init::@5/(byte*) bitmap_init::yoffs#2 )
  (byte*~) bitmap_init::$10 ← (byte*) bitmap_init::yoffs#3 + (number) $28*(number) 8
  (byte*) bitmap_init::yoffs#1 ← (byte*~) bitmap_init::$10
  to:bitmap_init::@6
bitmap_init::@return: scope:[bitmap_init]  from bitmap_init::@6
  (byte*) bitmap_screen#6 ← phi( bitmap_init::@6/(byte*) bitmap_screen#11 )
  (byte*) bitmap_gfx#6 ← phi( bitmap_init::@6/(byte*) bitmap_gfx#11 )
  (byte*) bitmap_gfx#2 ← (byte*) bitmap_gfx#6
  (byte*) bitmap_screen#2 ← (byte*) bitmap_screen#6
  return 
  to:@return

(void()) bitmap_clear((byte) bitmap_clear::bgcol , (byte) bitmap_clear::fgcol)
bitmap_clear: scope:[bitmap_clear]  from main::@12
  (byte*) bitmap_gfx#12 ← phi( main::@12/(byte*) bitmap_gfx#3 )
  (byte*) bitmap_screen#7 ← phi( main::@12/(byte*) bitmap_screen#3 )
  (byte) bitmap_clear::bgcol#1 ← phi( main::@12/(byte) bitmap_clear::bgcol#0 )
  (byte) bitmap_clear::fgcol#1 ← phi( main::@12/(byte) bitmap_clear::fgcol#0 )
  (number~) bitmap_clear::$0 ← (byte) bitmap_clear::fgcol#1 * (number) $10
  (number~) bitmap_clear::$1 ← (number~) bitmap_clear::$0 + (byte) bitmap_clear::bgcol#1
  (byte) bitmap_clear::col#0 ← (number~) bitmap_clear::$1
  (void*) memset::str#0 ← (void*)(byte*) bitmap_screen#7
  (byte) memset::c#0 ← (byte) bitmap_clear::col#0
  (word) memset::num#0 ← (word) $3e8
  call memset 
  (void*) memset::return#2 ← (void*) memset::return#1
  to:bitmap_clear::@1
bitmap_clear::@1: scope:[bitmap_clear]  from bitmap_clear
  (byte*) bitmap_gfx#7 ← phi( bitmap_clear/(byte*) bitmap_gfx#12 )
  (void*) memset::str#1 ← (void*)(byte*) bitmap_gfx#7
  (byte) memset::c#1 ← (number) 0
  (word) memset::num#1 ← (word) $1f40
  call memset 
  (void*) memset::return#3 ← (void*) memset::return#1
  to:bitmap_clear::@2
bitmap_clear::@2: scope:[bitmap_clear]  from bitmap_clear::@1
  to:bitmap_clear::@return
bitmap_clear::@return: scope:[bitmap_clear]  from bitmap_clear::@2
  return 
  to:@return

(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y)
bitmap_plot: scope:[bitmap_plot]  from main::@2
  (word) bitmap_plot::x#1 ← phi( main::@2/(word) bitmap_plot::x#0 )
  (byte) bitmap_plot::y#1 ← phi( main::@2/(byte) bitmap_plot::y#0 )
  (byte*~) bitmap_plot::$0 ← ((byte*)) { *((const byte*) bitmap_plot_yhi + (byte) bitmap_plot::y#1), *((const byte*) bitmap_plot_ylo + (byte) bitmap_plot::y#1) }
  (byte*) bitmap_plot::plotter#0 ← (byte*~) bitmap_plot::$0
  (number~) bitmap_plot::$1 ← (word) bitmap_plot::x#1 & (number) $fff8
  (byte*) bitmap_plot::plotter#1 ← (byte*) bitmap_plot::plotter#0 + (number~) bitmap_plot::$1
  (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#1
  *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte*) bitmap_plot_bit + (byte~) bitmap_plot::$2)
  to:bitmap_plot::@return
bitmap_plot::@return: scope:[bitmap_plot]  from bitmap_plot
  return 
  to:@return

(void()) main()
main: scope:[main]  from @18
  (byte*) bitmap_screen#12 ← phi( @18/(byte*) bitmap_screen#14 )
  (byte*) bitmap_gfx#13 ← phi( @18/(byte*) bitmap_gfx#15 )
  (byte*) bitmap_init::gfx#0 ← (const byte*) BITMAP
  (byte*) bitmap_init::screen#0 ← (const byte*) SCREEN
  call bitmap_init 
  to:main::@12
main::@12: scope:[main]  from main
  (byte*) bitmap_screen#8 ← phi( main/(byte*) bitmap_screen#2 )
  (byte*) bitmap_gfx#8 ← phi( main/(byte*) bitmap_gfx#2 )
  (byte*) bitmap_gfx#3 ← (byte*) bitmap_gfx#8
  (byte*) bitmap_screen#3 ← (byte*) bitmap_screen#8
  (byte) bitmap_clear::bgcol#0 ← (const byte) BLACK
  (byte) bitmap_clear::fgcol#0 ← (const byte) WHITE
  call bitmap_clear 
  to:main::@13
main::@13: scope:[main]  from main::@12
  (byte*) bitmap_screen#32 ← phi( main::@12/(byte*) bitmap_screen#3 )
  (byte*) bitmap_gfx#33 ← phi( main::@12/(byte*) bitmap_gfx#3 )
  *((const byte*) D011) ← (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(number) 3
  (byte*) main::toD0181_screen#0 ← (const byte*) SCREEN
  (byte*) main::toD0181_gfx#0 ← (const byte*) BITMAP
  to:main::toD0181
main::toD0181: scope:[main]  from main::@13
  (byte*) bitmap_screen#30 ← phi( main::@13/(byte*) bitmap_screen#32 )
  (byte*) bitmap_gfx#31 ← phi( main::@13/(byte*) bitmap_gfx#33 )
  (byte*) main::toD0181_gfx#1 ← phi( main::@13/(byte*) main::toD0181_gfx#0 )
  (byte*) main::toD0181_screen#1 ← phi( main::@13/(byte*) main::toD0181_screen#0 )
  (word~) main::toD0181_$0 ← ((word)) (byte*) main::toD0181_screen#1
  (number~) main::toD0181_$1 ← (word~) main::toD0181_$0 & (number) $3fff
  (number~) main::toD0181_$2 ← (number~) main::toD0181_$1 * (number) 4
  (number~) main::toD0181_$3 ← > (number~) main::toD0181_$2
  (word~) main::toD0181_$4 ← ((word)) (byte*) main::toD0181_gfx#1
  (byte~) main::toD0181_$5 ← > (word~) main::toD0181_$4
  (number~) main::toD0181_$6 ← (byte~) main::toD0181_$5 / (number) 4
  (number~) main::toD0181_$7 ← (number~) main::toD0181_$6 & (number) $f
  (number~) main::toD0181_$8 ← (number~) main::toD0181_$3 | (number~) main::toD0181_$7
  (byte) main::toD0181_return#0 ← (number~) main::toD0181_$8
  to:main::toD0181_@return
main::toD0181_@return: scope:[main]  from main::toD0181
  (byte*) bitmap_screen#25 ← phi( main::toD0181/(byte*) bitmap_screen#30 )
  (byte*) bitmap_gfx#26 ← phi( main::toD0181/(byte*) bitmap_gfx#31 )
  (byte) main::toD0181_return#2 ← phi( main::toD0181/(byte) main::toD0181_return#0 )
  (byte) main::toD0181_return#1 ← (byte) main::toD0181_return#2
  to:main::@11
main::@11: scope:[main]  from main::toD0181_@return
  (byte*) bitmap_screen#21 ← phi( main::toD0181_@return/(byte*) bitmap_screen#25 )
  (byte*) bitmap_gfx#22 ← phi( main::toD0181_@return/(byte*) bitmap_gfx#26 )
  (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 )
  (byte~) main::$2 ← (byte) main::toD0181_return#3
  *((const byte*) D018) ← (byte~) main::$2
  call init_irq 
  to:main::@14
main::@14: scope:[main]  from main::@11
  (byte*) bitmap_screen#17 ← phi( main::@11/(byte*) bitmap_screen#21 )
  (byte*) bitmap_gfx#18 ← phi( main::@11/(byte*) bitmap_gfx#22 )
  (word) main::x#0 ← (word) 0
  (byte) main::y#0 ← (byte) 0
  (word) main::vx#0 ← (word) 1
  (byte) main::vy#0 ← (byte) 1
  to:main::@1
main::@1: scope:[main]  from main::@14 main::@5
  (byte) main::vy#6 ← phi( main::@14/(byte) main::vy#0 main::@5/(byte) main::vy#8 )
  (word) main::vx#5 ← phi( main::@14/(word) main::vx#0 main::@5/(word) main::vx#6 )
  (byte*) bitmap_screen#13 ← phi( main::@14/(byte*) bitmap_screen#17 main::@5/(byte*) bitmap_screen#18 )
  (byte*) bitmap_gfx#14 ← phi( main::@14/(byte*) bitmap_gfx#18 main::@5/(byte*) bitmap_gfx#19 )
  (byte) main::y#5 ← phi( main::@14/(byte) main::y#0 main::@5/(byte) main::y#7 )
  (word) main::x#4 ← phi( main::@14/(word) main::x#0 main::@5/(word) main::x#5 )
  if(true) goto main::@2
  to:main::@return
main::@2: scope:[main]  from main::@1
  (byte*) bitmap_screen#31 ← phi( main::@1/(byte*) bitmap_screen#13 )
  (byte*) bitmap_gfx#32 ← phi( main::@1/(byte*) bitmap_gfx#14 )
  (byte) main::vy#4 ← phi( main::@1/(byte) main::vy#6 )
  (word) main::vx#4 ← phi( main::@1/(word) main::vx#5 )
  (byte) main::y#2 ← phi( main::@1/(byte) main::y#5 )
  (word) main::x#2 ← phi( main::@1/(word) main::x#4 )
  (word) bitmap_plot::x#0 ← (word) main::x#2
  (byte) bitmap_plot::y#0 ← (byte) main::y#2
  call bitmap_plot 
  to:main::@15
main::@15: scope:[main]  from main::@2
  (byte*) bitmap_screen#26 ← phi( main::@2/(byte*) bitmap_screen#31 )
  (byte*) bitmap_gfx#27 ← phi( main::@2/(byte*) bitmap_gfx#32 )
  (byte) main::vy#2 ← phi( main::@2/(byte) main::vy#4 )
  (byte) main::y#3 ← phi( main::@2/(byte) main::y#2 )
  (word) main::vx#2 ← phi( main::@2/(word) main::vx#4 )
  (word) main::x#3 ← phi( main::@2/(word) main::x#2 )
  (word) main::x#1 ← (word) main::x#3 + (word) main::vx#2
  (byte) main::y#1 ← (byte) main::y#3 + (byte) main::vy#2
  (bool~) main::$5 ← (word) main::x#1 == (number) $13f
  (bool~) main::$6 ← (word) main::x#1 == (number) 0
  (bool~) main::$7 ← (bool~) main::$5 || (bool~) main::$6
  (bool~) main::$8 ← ! (bool~) main::$7
  if((bool~) main::$8) goto main::@4
  to:main::@8
main::@4: scope:[main]  from main::@15 main::@8
  (word) main::vx#7 ← phi( main::@15/(word) main::vx#2 main::@8/(word) main::vx#1 )
  (byte*) bitmap_screen#22 ← phi( main::@15/(byte*) bitmap_screen#26 main::@8/(byte*) bitmap_screen#27 )
  (byte*) bitmap_gfx#23 ← phi( main::@15/(byte*) bitmap_gfx#27 main::@8/(byte*) bitmap_gfx#28 )
  (word) main::x#6 ← phi( main::@15/(word) main::x#1 main::@8/(word) main::x#8 )
  (byte) main::vy#5 ← phi( main::@15/(byte) main::vy#2 main::@8/(byte) main::vy#7 )
  (byte) main::y#4 ← phi( main::@15/(byte) main::y#1 main::@8/(byte) main::y#6 )
  (bool~) main::$10 ← (byte) main::y#4 == (number) $c7
  (bool~) main::$11 ← (byte) main::y#4 == (number) 0
  (bool~) main::$12 ← (bool~) main::$10 || (bool~) main::$11
  (bool~) main::$13 ← ! (bool~) main::$12
  if((bool~) main::$13) goto main::@5
  to:main::@9
main::@8: scope:[main]  from main::@15
  (byte*) bitmap_screen#27 ← phi( main::@15/(byte*) bitmap_screen#26 )
  (byte*) bitmap_gfx#28 ← phi( main::@15/(byte*) bitmap_gfx#27 )
  (word) main::x#8 ← phi( main::@15/(word) main::x#1 )
  (byte) main::vy#7 ← phi( main::@15/(byte) main::vy#2 )
  (byte) main::y#6 ← phi( main::@15/(byte) main::y#1 )
  (word) main::vx#3 ← phi( main::@15/(word) main::vx#2 )
  (word~) main::$9 ← - (word) main::vx#3
  (word) main::vx#1 ← (word~) main::$9
  to:main::@4
main::@5: scope:[main]  from main::@4 main::@9
  (byte) main::vy#8 ← phi( main::@4/(byte) main::vy#5 main::@9/(byte) main::vy#1 )
  (word) main::vx#6 ← phi( main::@4/(word) main::vx#7 main::@9/(word) main::vx#8 )
  (byte*) bitmap_screen#18 ← phi( main::@4/(byte*) bitmap_screen#22 main::@9/(byte*) bitmap_screen#23 )
  (byte*) bitmap_gfx#19 ← phi( main::@4/(byte*) bitmap_gfx#23 main::@9/(byte*) bitmap_gfx#24 )
  (byte) main::y#7 ← phi( main::@4/(byte) main::y#4 main::@9/(byte) main::y#8 )
  (word) main::x#5 ← phi( main::@4/(word) main::x#6 main::@9/(word) main::x#7 )
  *((const byte*) plots_per_frame + (byte) frame_cnt) ← ++ *((const byte*) plots_per_frame + (byte) frame_cnt)
  to:main::@1
main::@9: scope:[main]  from main::@4
  (word) main::vx#8 ← phi( main::@4/(word) main::vx#7 )
  (byte*) bitmap_screen#23 ← phi( main::@4/(byte*) bitmap_screen#22 )
  (byte*) bitmap_gfx#24 ← phi( main::@4/(byte*) bitmap_gfx#23 )
  (byte) main::y#8 ← phi( main::@4/(byte) main::y#4 )
  (word) main::x#7 ← phi( main::@4/(word) main::x#6 )
  (byte) main::vy#3 ← phi( main::@4/(byte) main::vy#5 )
  (byte~) main::$14 ← - (byte) main::vy#3
  (byte) main::vy#1 ← (byte~) main::$14
  to:main::@5
main::@return: scope:[main]  from main::@1
  (byte*) bitmap_screen#9 ← phi( main::@1/(byte*) bitmap_screen#13 )
  (byte*) bitmap_gfx#9 ← phi( main::@1/(byte*) bitmap_gfx#14 )
  (byte*) bitmap_gfx#4 ← (byte*) bitmap_gfx#9
  (byte*) bitmap_screen#4 ← (byte*) bitmap_screen#9
  return 
  to:@return
@16: scope:[]  from @9
  (byte*) bitmap_screen#19 ← phi( @9/(byte*) bitmap_screen#0 )
  (byte*) bitmap_gfx#20 ← phi( @9/(byte*) bitmap_gfx#0 )
  (byte) frame_cnt ← (byte) 1
  to:@18

(void()) init_irq()
init_irq: scope:[init_irq]  from main::@11
  asm { sei  }
  *((const byte*) PROCPORT_DDR) ← (const byte) PROCPORT_DDR_MEMORY_MASK
  *((const byte*) PROCPORT) ← (const byte) PROCPORT_RAM_IO
  *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR
  *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) | (number) $80
  *((const byte*) RASTER) ← (number) 0
  *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER
  *((const void()**) HARDWARE_IRQ) ← &interrupt(HARDWARE_CLOBBER)(void()) irq()
  asm { cli  }
  to:init_irq::@return
init_irq::@return: scope:[init_irq]  from init_irq
  return 
  to:@return

interrupt(HARDWARE_CLOBBER)(void()) irq()
irq: scope:[irq]  from
  *((const byte*) BGCOL) ← (const byte) WHITE
  (bool~) irq::$1 ← (number) 0 != (byte) frame_cnt
  (bool~) irq::$0 ← ! (bool~) irq::$1
  if((bool~) irq::$0) goto irq::@1
  to:irq::@2
irq::@1: scope:[irq]  from irq irq::@2
  *((const byte*) BGCOL) ← (const byte) BLACK
  *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER
  to:irq::@return
irq::@2: scope:[irq]  from irq
  (byte) frame_cnt ← ++ (byte) frame_cnt
  to:irq::@1
irq::@return: scope:[irq]  from irq::@1
  return 
  to:@return
@18: scope:[]  from @16
  (byte*) bitmap_screen#14 ← phi( @16/(byte*) bitmap_screen#19 )
  (byte*) bitmap_gfx#15 ← phi( @16/(byte*) bitmap_gfx#20 )
  call main 
  to:@19
@19: scope:[]  from @18
  (byte*) bitmap_screen#10 ← phi( @18/(byte*) bitmap_screen#4 )
  (byte*) bitmap_gfx#10 ← phi( @18/(byte*) bitmap_gfx#4 )
  (byte*) bitmap_gfx#5 ← (byte*) bitmap_gfx#10
  (byte*) bitmap_screen#5 ← (byte*) bitmap_screen#10
  to:@end
@end: scope:[]  from @19

SYMBOL TABLE SSA
(label) @16
(label) @18
(label) @19
(label) @9
(label) @begin
(label) @end
(const byte*) BGCOL = (byte*)(number) $d021
(const byte*) BITMAP = (byte*)(number) $2000
(const byte) BLACK = (byte) 0
(const byte*) CIA1_INTERRUPT = (byte*)(number) $dc0d
(const byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const byte*) D011 = (byte*)(number) $d011
(const byte*) D018 = (byte*)(number) $d018
(const void()**) HARDWARE_IRQ = (void()**)(number) $fffe
(const byte*) IRQ_ENABLE = (byte*)(number) $d01a
(const byte) IRQ_RASTER = (byte) 1
(const byte*) IRQ_STATUS = (byte*)(number) $d019
(const byte*) PROCPORT = (byte*)(number) 1
(const byte*) PROCPORT_DDR = (byte*)(number) 0
(const byte) PROCPORT_DDR_MEMORY_MASK = (byte) 7
(const byte) PROCPORT_RAM_IO = (byte) 5
(const byte*) RASTER = (byte*)(number) $d012
(const byte*) SCREEN = (byte*)(number) $400
(const byte) VIC_BMM = (byte) $20
(const byte*) VIC_CONTROL = (byte*)(number) $d011
(const byte) VIC_DEN = (byte) $10
(const byte) VIC_RSEL = (byte) 8
(const byte) WHITE = (byte) 1
(void()) bitmap_clear((byte) bitmap_clear::bgcol , (byte) bitmap_clear::fgcol)
(number~) bitmap_clear::$0
(number~) bitmap_clear::$1
(label) bitmap_clear::@1
(label) bitmap_clear::@2
(label) bitmap_clear::@return
(byte) bitmap_clear::bgcol
(byte) bitmap_clear::bgcol#0
(byte) bitmap_clear::bgcol#1
(byte) bitmap_clear::col
(byte) bitmap_clear::col#0
(byte) bitmap_clear::fgcol
(byte) bitmap_clear::fgcol#0
(byte) bitmap_clear::fgcol#1
(byte*) bitmap_gfx
(byte*) bitmap_gfx#0
(byte*) bitmap_gfx#1
(byte*) bitmap_gfx#10
(byte*) bitmap_gfx#11
(byte*) bitmap_gfx#12
(byte*) bitmap_gfx#13
(byte*) bitmap_gfx#14
(byte*) bitmap_gfx#15
(byte*) bitmap_gfx#16
(byte*) bitmap_gfx#17
(byte*) bitmap_gfx#18
(byte*) bitmap_gfx#19
(byte*) bitmap_gfx#2
(byte*) bitmap_gfx#20
(byte*) bitmap_gfx#21
(byte*) bitmap_gfx#22
(byte*) bitmap_gfx#23
(byte*) bitmap_gfx#24
(byte*) bitmap_gfx#25
(byte*) bitmap_gfx#26
(byte*) bitmap_gfx#27
(byte*) bitmap_gfx#28
(byte*) bitmap_gfx#29
(byte*) bitmap_gfx#3
(byte*) bitmap_gfx#30
(byte*) bitmap_gfx#31
(byte*) bitmap_gfx#32
(byte*) bitmap_gfx#33
(byte*) bitmap_gfx#4
(byte*) bitmap_gfx#5
(byte*) bitmap_gfx#6
(byte*) bitmap_gfx#7
(byte*) bitmap_gfx#8
(byte*) bitmap_gfx#9
(void()) bitmap_init((byte*) bitmap_init::gfx , (byte*) bitmap_init::screen)
(bool~) bitmap_init::$0
(bool~) bitmap_init::$1
(byte*~) bitmap_init::$10
(bool~) bitmap_init::$11
(bool~) bitmap_init::$2
(number~) bitmap_init::$3
(byte~) bitmap_init::$4
(number~) bitmap_init::$5
(byte~) bitmap_init::$6
(number~) bitmap_init::$7
(bool~) bitmap_init::$8
(bool~) bitmap_init::$9
(label) bitmap_init::@1
(label) bitmap_init::@2
(label) bitmap_init::@3
(label) bitmap_init::@4
(label) bitmap_init::@5
(label) bitmap_init::@6
(label) bitmap_init::@7
(label) bitmap_init::@return
(byte) bitmap_init::bits
(byte) bitmap_init::bits#0
(byte) bitmap_init::bits#1
(byte) bitmap_init::bits#2
(byte) bitmap_init::bits#3
(byte) bitmap_init::bits#4
(byte*) bitmap_init::gfx
(byte*) bitmap_init::gfx#0
(byte*) bitmap_init::gfx#1
(byte*) bitmap_init::gfx#2
(byte*) bitmap_init::gfx#3
(byte*) bitmap_init::gfx#4
(byte*) bitmap_init::gfx#5
(byte*) bitmap_init::screen
(byte*) bitmap_init::screen#0
(byte*) bitmap_init::screen#1
(byte) bitmap_init::x
(byte) bitmap_init::x#0
(byte) bitmap_init::x#1
(byte) bitmap_init::x#2
(byte) bitmap_init::x#3
(byte) bitmap_init::x#4
(byte) bitmap_init::y
(byte) bitmap_init::y#0
(byte) bitmap_init::y#1
(byte) bitmap_init::y#2
(byte) bitmap_init::y#3
(byte) bitmap_init::y#4
(byte*) bitmap_init::yoffs
(byte*) bitmap_init::yoffs#0
(byte*) bitmap_init::yoffs#1
(byte*) bitmap_init::yoffs#2
(byte*) bitmap_init::yoffs#3
(byte*) bitmap_init::yoffs#4
(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y)
(byte*~) bitmap_plot::$0
(number~) bitmap_plot::$1
(byte~) bitmap_plot::$2
(label) bitmap_plot::@return
(byte*) bitmap_plot::plotter
(byte*) bitmap_plot::plotter#0
(byte*) bitmap_plot::plotter#1
(word) bitmap_plot::x
(word) bitmap_plot::x#0
(word) bitmap_plot::x#1
(byte) bitmap_plot::y
(byte) bitmap_plot::y#0
(byte) bitmap_plot::y#1
(const byte*) bitmap_plot_bit[(number) $100]  = { fill( $100, 0) }
(const byte*) bitmap_plot_yhi[(number) $100]  = { fill( $100, 0) }
(const byte*) bitmap_plot_ylo[(number) $100]  = { fill( $100, 0) }
(byte*) bitmap_screen
(byte*) bitmap_screen#0
(byte*) bitmap_screen#1
(byte*) bitmap_screen#10
(byte*) bitmap_screen#11
(byte*) bitmap_screen#12
(byte*) bitmap_screen#13
(byte*) bitmap_screen#14
(byte*) bitmap_screen#15
(byte*) bitmap_screen#16
(byte*) bitmap_screen#17
(byte*) bitmap_screen#18
(byte*) bitmap_screen#19
(byte*) bitmap_screen#2
(byte*) bitmap_screen#20
(byte*) bitmap_screen#21
(byte*) bitmap_screen#22
(byte*) bitmap_screen#23
(byte*) bitmap_screen#24
(byte*) bitmap_screen#25
(byte*) bitmap_screen#26
(byte*) bitmap_screen#27
(byte*) bitmap_screen#28
(byte*) bitmap_screen#29
(byte*) bitmap_screen#3
(byte*) bitmap_screen#30
(byte*) bitmap_screen#31
(byte*) bitmap_screen#32
(byte*) bitmap_screen#4
(byte*) bitmap_screen#5
(byte*) bitmap_screen#6
(byte*) bitmap_screen#7
(byte*) bitmap_screen#8
(byte*) bitmap_screen#9
(byte) frame_cnt loadstore
(void()) init_irq()
(label) init_irq::@return
interrupt(HARDWARE_CLOBBER)(void()) irq()
(bool~) irq::$0
(bool~) irq::$1
(label) irq::@1
(label) irq::@2
(label) irq::@return
(void()) main()
(bool~) main::$10
(bool~) main::$11
(bool~) main::$12
(bool~) main::$13
(byte~) main::$14
(byte~) main::$2
(bool~) main::$5
(bool~) main::$6
(bool~) main::$7
(bool~) main::$8
(word~) main::$9
(label) main::@1
(label) main::@11
(label) main::@12
(label) main::@13
(label) main::@14
(label) main::@15
(label) main::@2
(label) main::@4
(label) main::@5
(label) main::@8
(label) main::@9
(label) main::@return
(label) main::toD0181
(word~) main::toD0181_$0
(number~) main::toD0181_$1
(number~) main::toD0181_$2
(number~) main::toD0181_$3
(word~) main::toD0181_$4
(byte~) main::toD0181_$5
(number~) main::toD0181_$6
(number~) main::toD0181_$7
(number~) main::toD0181_$8
(label) main::toD0181_@return
(byte*) main::toD0181_gfx
(byte*) main::toD0181_gfx#0
(byte*) main::toD0181_gfx#1
(byte) main::toD0181_return
(byte) main::toD0181_return#0
(byte) main::toD0181_return#1
(byte) main::toD0181_return#2
(byte) main::toD0181_return#3
(byte*) main::toD0181_screen
(byte*) main::toD0181_screen#0
(byte*) main::toD0181_screen#1
(word) main::vx
(word) main::vx#0
(word) main::vx#1
(word) main::vx#2
(word) main::vx#3
(word) main::vx#4
(word) main::vx#5
(word) main::vx#6
(word) main::vx#7
(word) main::vx#8
(byte) main::vy
(byte) main::vy#0
(byte) main::vy#1
(byte) main::vy#2
(byte) main::vy#3
(byte) main::vy#4
(byte) main::vy#5
(byte) main::vy#6
(byte) main::vy#7
(byte) main::vy#8
(word) main::x
(word) main::x#0
(word) main::x#1
(word) main::x#2
(word) main::x#3
(word) main::x#4
(word) main::x#5
(word) main::x#6
(word) main::x#7
(word) main::x#8
(byte) main::y
(byte) main::y#0
(byte) main::y#1
(byte) main::y#2
(byte) main::y#3
(byte) main::y#4
(byte) main::y#5
(byte) main::y#6
(byte) main::y#7
(byte) main::y#8
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(bool~) memset::$0
(bool~) memset::$1
(byte*~) memset::$2
(byte*~) memset::$3
(bool~) memset::$4
(label) memset::@1
(label) memset::@2
(label) memset::@4
(label) memset::@5
(label) memset::@return
(byte) memset::c
(byte) memset::c#0
(byte) memset::c#1
(byte) memset::c#2
(byte) memset::c#3
(byte) memset::c#4
(byte) memset::c#5
(byte*) memset::dst
(byte*) memset::dst#0
(byte*) memset::dst#1
(byte*) memset::dst#2
(byte*) memset::dst#3
(byte*) memset::end
(byte*) memset::end#0
(byte*) memset::end#1
(byte*) memset::end#2
(word) memset::num
(word) memset::num#0
(word) memset::num#1
(word) memset::num#2
(word) memset::num#3
(void*) memset::return
(void*) memset::return#0
(void*) memset::return#1
(void*) memset::return#2
(void*) memset::return#3
(void*) memset::return#4
(void*) memset::str
(void*) memset::str#0
(void*) memset::str#1
(void*) memset::str#2
(void*) memset::str#3
(void*) memset::str#4
(void*) memset::str#5
(void*) memset::str#6
(const byte*) plots_per_frame[(number) $100]  = { fill( $100, 0) }

Fixing inline constructor with bitmap_plot::$3 ← (byte)*(bitmap_plot_yhi + bitmap_plot::y#1) w= (byte)*(bitmap_plot_ylo + bitmap_plot::y#1)
Successful SSA optimization Pass2FixInlineConstructors
Adding number conversion cast (unumber) 0 in (bool~) memset::$0 ← (word) memset::num#2 > (number) 0
Adding number conversion cast (unumber) 1 in (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (number) 1
Adding number conversion cast (unumber) 0 in (bool~) bitmap_init::$0 ← (byte) bitmap_init::bits#1 == (number) 0
Adding number conversion cast (unumber) $80 in (byte) bitmap_init::bits#2 ← (number) $80
Adding number conversion cast (unumber) 7 in (number~) bitmap_init::$3 ← (byte) bitmap_init::y#2 & (number) 7
Adding number conversion cast (unumber) bitmap_init::$3 in (number~) bitmap_init::$3 ← (byte) bitmap_init::y#2 & (unumber)(number) 7
Adding number conversion cast (unumber) bitmap_init::$5 in (number~) bitmap_init::$5 ← (unumber~) bitmap_init::$3 | (byte~) bitmap_init::$4
Adding number conversion cast (unumber) 7 in (number~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (number) 7
Adding number conversion cast (unumber) bitmap_init::$7 in (number~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (unumber)(number) 7
Adding number conversion cast (unumber) 7 in (bool~) bitmap_init::$8 ← (unumber~) bitmap_init::$7 == (number) 7
Adding number conversion cast (unumber) $28*8 in (byte*~) bitmap_init::$10 ← (byte*) bitmap_init::yoffs#3 + (number) $28*(number) 8
Adding number conversion cast (unumber) $10 in (number~) bitmap_clear::$0 ← (byte) bitmap_clear::fgcol#1 * (number) $10
Adding number conversion cast (unumber) bitmap_clear::$0 in (number~) bitmap_clear::$0 ← (byte) bitmap_clear::fgcol#1 * (unumber)(number) $10
Adding number conversion cast (unumber) bitmap_clear::$1 in (number~) bitmap_clear::$1 ← (unumber~) bitmap_clear::$0 + (byte) bitmap_clear::bgcol#1
Adding number conversion cast (unumber) 0 in (byte) memset::c#1 ← (number) 0
Adding number conversion cast (unumber) $fff8 in (number~) bitmap_plot::$1 ← (word) bitmap_plot::x#1 & (number) $fff8
Adding number conversion cast (unumber) bitmap_plot::$1 in (number~) bitmap_plot::$1 ← (word) bitmap_plot::x#1 & (unumber)(number) $fff8
Adding number conversion cast (unumber) VIC_BMM|VIC_DEN|VIC_RSEL|3 in *((const byte*) D011) ← (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(number) 3
Adding number conversion cast (unumber) 3 in *((const byte*) D011) ← ((unumber)) (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(number) 3
Adding number conversion cast (unumber) $3fff in (number~) main::toD0181_$1 ← (word~) main::toD0181_$0 & (number) $3fff
Adding number conversion cast (unumber) main::toD0181_$1 in (number~) main::toD0181_$1 ← (word~) main::toD0181_$0 & (unumber)(number) $3fff
Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$2 ← (unumber~) main::toD0181_$1 * (number) 4
Adding number conversion cast (unumber) main::toD0181_$2 in (number~) main::toD0181_$2 ← (unumber~) main::toD0181_$1 * (unumber)(number) 4
Adding number conversion cast (unumber) main::toD0181_$3 in (number~) main::toD0181_$3 ← > (unumber~) main::toD0181_$2
Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$6 ← (byte~) main::toD0181_$5 / (number) 4
Adding number conversion cast (unumber) main::toD0181_$6 in (number~) main::toD0181_$6 ← (byte~) main::toD0181_$5 / (unumber)(number) 4
Adding number conversion cast (unumber) $f in (number~) main::toD0181_$7 ← (unumber~) main::toD0181_$6 & (number) $f
Adding number conversion cast (unumber) main::toD0181_$7 in (number~) main::toD0181_$7 ← (unumber~) main::toD0181_$6 & (unumber)(number) $f
Adding number conversion cast (unumber) main::toD0181_$8 in (number~) main::toD0181_$8 ← (unumber~) main::toD0181_$3 | (unumber~) main::toD0181_$7
Adding number conversion cast (unumber) $13f in (bool~) main::$5 ← (word) main::x#1 == (number) $13f
Adding number conversion cast (unumber) 0 in (bool~) main::$6 ← (word) main::x#1 == (number) 0
Adding number conversion cast (unumber) $c7 in (bool~) main::$10 ← (byte) main::y#4 == (number) $c7
Adding number conversion cast (unumber) 0 in (bool~) main::$11 ← (byte) main::y#4 == (number) 0
Adding number conversion cast (unumber) $80 in *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) | (number) $80
Adding number conversion cast (unumber) 0 in *((const byte*) RASTER) ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) irq::$1 ← (number) 0 != (byte) frame_cnt
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#3
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3
Inlining cast (byte) bitmap_init::bits#2 ← (unumber)(number) $80
Inlining cast (byte) memset::c#1 ← (unumber)(number) 0
Inlining cast *((const byte*) D011) ← (unumber)(const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(unumber)(number) 3
Inlining cast (word~) main::toD0181_$0 ← (word)(byte*) main::toD0181_screen#1
Inlining cast (word~) main::toD0181_$4 ← (word)(byte*) main::toD0181_gfx#1
Inlining cast *((const byte*) RASTER) ← (unumber)(number) 0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 0
Simplifying constant pointer cast (byte*) 1
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 53281
Simplifying constant pointer cast (byte*) 53265
Simplifying constant pointer cast (byte*) 53265
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (byte*) 53273
Simplifying constant pointer cast (byte*) 53274
Simplifying constant pointer cast (byte*) 56333
Simplifying constant pointer cast (void()**) 65534
Simplifying constant pointer cast (byte*) 8192
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast $80
Simplifying constant integer cast 7
Simplifying constant integer cast 7
Simplifying constant integer cast 7
Simplifying constant integer cast $10
Simplifying constant integer cast 0
Simplifying constant integer cast *((const byte*) bitmap_plot_yhi + (byte) bitmap_plot::y#1)
Simplifying constant integer cast *((const byte*) bitmap_plot_ylo + (byte) bitmap_plot::y#1)
Simplifying constant integer cast $fff8
Simplifying constant integer cast (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(unumber)(number) 3
Simplifying constant integer cast 3
Simplifying constant integer cast $3fff
Simplifying constant integer cast 4
Simplifying constant integer cast 4
Simplifying constant integer cast $f
Simplifying constant integer cast $13f
Simplifying constant integer cast 0
Simplifying constant integer cast $c7
Simplifying constant integer cast 0
Simplifying constant integer cast $80
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $80
Finalized unsigned number type (byte) 7
Finalized unsigned number type (byte) 7
Finalized unsigned number type (byte) 7
Finalized unsigned number type (byte) $10
Finalized unsigned number type (byte) 0
Finalized unsigned number type (word) $fff8
Finalized unsigned number type (byte) 3
Finalized unsigned number type (word) $3fff
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) $f
Finalized unsigned number type (word) $13f
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $c7
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $80
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) bitmap_init::$3 ← (byte) bitmap_init::y#2 & (byte) 7
Inferred type updated to byte in (unumber~) bitmap_init::$5 ← (byte~) bitmap_init::$3 | (byte~) bitmap_init::$4
Inferred type updated to byte in (unumber~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7
Inferred type updated to byte in (unumber~) bitmap_clear::$0 ← (byte) bitmap_clear::fgcol#1 * (byte) $10
Inferred type updated to byte in (unumber~) bitmap_clear::$1 ← (byte~) bitmap_clear::$0 + (byte) bitmap_clear::bgcol#1
Inferred type updated to word in (unumber~) bitmap_plot::$1 ← (word) bitmap_plot::x#1 & (word) $fff8
Inferred type updated to word in (unumber~) main::toD0181_$1 ← (word~) main::toD0181_$0 & (word) $3fff
Inferred type updated to word in (unumber~) main::toD0181_$2 ← (word~) main::toD0181_$1 * (byte) 4
Inferred type updated to byte in (unumber~) main::toD0181_$3 ← > (word~) main::toD0181_$2
Inferred type updated to byte in (unumber~) main::toD0181_$6 ← (byte~) main::toD0181_$5 / (byte) 4
Inferred type updated to byte in (unumber~) main::toD0181_$7 ← (byte~) main::toD0181_$6 & (byte) $f
Inferred type updated to byte in (unumber~) main::toD0181_$8 ← (byte~) main::toD0181_$3 | (byte~) main::toD0181_$7
Adding pointer type conversion cast (byte*) bitmap_plot::$0 in (byte*~) bitmap_plot::$0 ← (word~) bitmap_plot::$3
Successful SSA optimization PassNAddTypeConversionAssignment
Inversing boolean not [2] (bool~) memset::$1 ← (word) memset::num#2 <= (byte) 0 from [1] (bool~) memset::$0 ← (word) memset::num#2 > (byte) 0
Inversing boolean not [31] (bool~) bitmap_init::$1 ← (byte) bitmap_init::bits#1 != (byte) 0 from [30] (bool~) bitmap_init::$0 ← (byte) bitmap_init::bits#1 == (byte) 0
Inversing boolean not [51] (bool~) bitmap_init::$9 ← (byte~) bitmap_init::$7 != (byte) 7 from [50] (bool~) bitmap_init::$8 ← (byte~) bitmap_init::$7 == (byte) 7
Inversing boolean not [171] (bool~) irq::$0 ← (byte) 0 == (byte) frame_cnt from [170] (bool~) irq::$1 ← (byte) 0 != (byte) frame_cnt
Successful SSA optimization Pass2UnaryNotSimplification
Alias (void*) memset::return#0 = (void*) memset::str#2 (void*) memset::return#4 (void*) memset::return#1 
Alias (void*) memset::str#3 = (void*) memset::str#4 
Alias (word) memset::num#2 = (word) memset::num#3 
Alias (byte) memset::c#4 = (byte) memset::c#5 
Alias (byte*) memset::end#0 = (byte*~) memset::$3 
Alias (byte) memset::c#2 = (byte) memset::c#3 
Alias (byte*) memset::dst#2 = (byte*) memset::dst#3 
Alias (byte*) memset::end#1 = (byte*) memset::end#2 
Alias (void*) memset::str#5 = (void*) memset::str#6 
Alias (byte) bitmap_init::x#2 = (byte) bitmap_init::x#4 
Alias (byte*) bitmap_init::gfx#4 = (byte*) bitmap_init::gfx#5 
Alias (byte*) bitmap_gfx#29 = (byte*) bitmap_gfx#30 
Alias (byte*) bitmap_screen#28 = (byte*) bitmap_screen#29 
Alias (byte*) bitmap_init::gfx#2 = (byte*) bitmap_init::gfx#3 (byte*) bitmap_init::yoffs#0 
Alias (byte*) bitmap_gfx#21 = (byte*) bitmap_gfx#25 
Alias (byte*) bitmap_screen#20 = (byte*) bitmap_screen#24 
Alias (byte*) bitmap_init::yoffs#2 = (byte*) bitmap_init::yoffs#3 
Alias (byte) bitmap_init::y#2 = (byte) bitmap_init::y#4 
Alias (byte*) bitmap_gfx#16 = (byte*) bitmap_gfx#17 
Alias (byte*) bitmap_screen#15 = (byte*) bitmap_screen#16 
Alias (byte*) bitmap_init::yoffs#1 = (byte*~) bitmap_init::$10 
Alias (byte*) bitmap_gfx#11 = (byte*) bitmap_gfx#6 (byte*) bitmap_gfx#2 
Alias (byte*) bitmap_screen#11 = (byte*) bitmap_screen#6 (byte*) bitmap_screen#2 
Alias (byte) bitmap_clear::col#0 = (byte~) bitmap_clear::$1 
Alias (byte*) bitmap_gfx#12 = (byte*) bitmap_gfx#7 
Alias (byte*) bitmap_plot::plotter#0 = (byte*~) bitmap_plot::$0 
Alias (byte*) bitmap_gfx#18 = (byte*) bitmap_gfx#3 (byte*) bitmap_gfx#8 (byte*) bitmap_gfx#33 (byte*) bitmap_gfx#31 (byte*) bitmap_gfx#26 (byte*) bitmap_gfx#22 
Alias (byte*) bitmap_screen#17 = (byte*) bitmap_screen#3 (byte*) bitmap_screen#8 (byte*) bitmap_screen#32 (byte*) bitmap_screen#30 (byte*) bitmap_screen#25 (byte*) bitmap_screen#21 
Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 
Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 
Alias (byte) main::toD0181_return#0 = (byte~) main::toD0181_$8 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$2 
Alias (word) main::x#2 = (word) main::x#4 (word) main::x#3 
Alias (byte) main::y#2 = (byte) main::y#5 (byte) main::y#3 
Alias (word) main::vx#2 = (word) main::vx#4 (word) main::vx#5 (word) main::vx#3 
Alias (byte) main::vy#2 = (byte) main::vy#4 (byte) main::vy#6 (byte) main::vy#7 
Alias (byte*) bitmap_gfx#14 = (byte*) bitmap_gfx#32 (byte*) bitmap_gfx#27 (byte*) bitmap_gfx#28 (byte*) bitmap_gfx#9 (byte*) bitmap_gfx#4 
Alias (byte*) bitmap_screen#13 = (byte*) bitmap_screen#31 (byte*) bitmap_screen#26 (byte*) bitmap_screen#27 (byte*) bitmap_screen#9 (byte*) bitmap_screen#4 
Alias (byte) main::y#1 = (byte) main::y#6 
Alias (word) main::x#1 = (word) main::x#8 
Alias (word) main::vx#1 = (word~) main::$9 
Alias (byte) main::vy#3 = (byte) main::vy#5 
Alias (word) main::x#6 = (word) main::x#7 
Alias (byte) main::y#4 = (byte) main::y#8 
Alias (byte*) bitmap_gfx#23 = (byte*) bitmap_gfx#24 
Alias (byte*) bitmap_screen#22 = (byte*) bitmap_screen#23 
Alias (word) main::vx#7 = (word) main::vx#8 
Alias (byte) main::vy#1 = (byte~) main::$14 
Alias (byte*) bitmap_gfx#0 = (byte*) bitmap_gfx#20 (byte*) bitmap_gfx#15 
Alias (byte*) bitmap_screen#0 = (byte*) bitmap_screen#19 (byte*) bitmap_screen#14 
Alias (byte*) bitmap_gfx#10 = (byte*) bitmap_gfx#5 
Alias (byte*) bitmap_screen#10 = (byte*) bitmap_screen#5 
Successful SSA optimization Pass2AliasElimination
Alias (byte) bitmap_init::x#2 = (byte) bitmap_init::x#3 
Alias (byte*) bitmap_init::gfx#2 = (byte*) bitmap_init::gfx#4 
Alias (byte*) bitmap_gfx#21 = (byte*) bitmap_gfx#29 
Alias (byte*) bitmap_screen#20 = (byte*) bitmap_screen#28 
Alias (byte) bitmap_init::y#2 = (byte) bitmap_init::y#3 
Alias (byte*) bitmap_gfx#11 = (byte*) bitmap_gfx#16 
Alias (byte*) bitmap_screen#11 = (byte*) bitmap_screen#15 
Alias (byte) main::y#1 = (byte) main::y#4 (byte) main::y#7 
Alias (byte) main::vy#2 = (byte) main::vy#3 
Alias (word) main::x#1 = (word) main::x#6 (word) main::x#5 
Alias (byte*) bitmap_gfx#14 = (byte*) bitmap_gfx#23 (byte*) bitmap_gfx#19 
Alias (byte*) bitmap_screen#13 = (byte*) bitmap_screen#22 (byte*) bitmap_screen#18 
Alias (word) main::vx#6 = (word) main::vx#7 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte*) memset::end#1 (byte*) memset::end#0
Identical Phi Values (void*) memset::str#5 (void*) memset::str#3
Identical Phi Values (byte) memset::c#2 (byte) memset::c#4
Identical Phi Values (byte*) bitmap_init::gfx#1 (byte*) bitmap_init::gfx#0
Identical Phi Values (byte*) bitmap_init::screen#1 (byte*) bitmap_init::screen#0
Identical Phi Values (byte*) bitmap_init::gfx#2 (byte*) bitmap_init::gfx#1
Identical Phi Values (byte*) bitmap_gfx#21 (byte*) bitmap_gfx#1
Identical Phi Values (byte*) bitmap_screen#20 (byte*) bitmap_screen#1
Identical Phi Values (byte*) bitmap_gfx#11 (byte*) bitmap_gfx#21
Identical Phi Values (byte*) bitmap_screen#11 (byte*) bitmap_screen#20
Identical Phi Values (byte) bitmap_clear::fgcol#1 (byte) bitmap_clear::fgcol#0
Identical Phi Values (byte) bitmap_clear::bgcol#1 (byte) bitmap_clear::bgcol#0
Identical Phi Values (byte*) bitmap_screen#7 (byte*) bitmap_screen#17
Identical Phi Values (byte*) bitmap_gfx#12 (byte*) bitmap_gfx#18
Identical Phi Values (byte) bitmap_plot::y#1 (byte) bitmap_plot::y#0
Identical Phi Values (word) bitmap_plot::x#1 (word) bitmap_plot::x#0
Identical Phi Values (byte*) bitmap_gfx#13 (byte*) bitmap_gfx#0
Identical Phi Values (byte*) bitmap_screen#12 (byte*) bitmap_screen#0
Identical Phi Values (byte*) bitmap_gfx#18 (byte*) bitmap_gfx#11
Identical Phi Values (byte*) bitmap_screen#17 (byte*) bitmap_screen#11
Identical Phi Values (byte*) bitmap_gfx#14 (byte*) bitmap_gfx#18
Identical Phi Values (byte*) bitmap_screen#13 (byte*) bitmap_screen#17
Identical Phi Values (byte*) bitmap_gfx#10 (byte*) bitmap_gfx#14
Identical Phi Values (byte*) bitmap_screen#10 (byte*) bitmap_screen#13
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values (void*) memset::return#0 (void*) memset::str#3
Successful SSA optimization Pass2IdenticalPhiElimination
Identified duplicate assignment right side [49] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7
Successful SSA optimization Pass2DuplicateRValueIdentification
Simple Condition (bool~) memset::$1 [3] if((word) memset::num#2<=(byte) 0) goto memset::@1
Simple Condition (bool~) memset::$4 [13] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@5
Simple Condition (bool~) bitmap_init::$1 [32] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@2
Simple Condition (bool~) bitmap_init::$2 [36] if((byte) bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1
Simple Condition (bool~) bitmap_init::$9 [52] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@6
Simple Condition (bool~) bitmap_init::$11 [56] if((byte) bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5
Simple Condition (bool~) irq::$0 [172] if((byte) 0==(byte) frame_cnt) goto irq::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting ! if()-condition to reversed if() [137] (bool~) main::$8 ← ! (bool~) main::$7
Rewriting || if()-condition to two if()s [136] (bool~) main::$7 ← (bool~) main::$5 || (bool~) main::$6
Rewriting ! if()-condition to reversed if() [143] (bool~) main::$13 ← ! (bool~) main::$12
Rewriting || if()-condition to two if()s [142] (bool~) main::$12 ← (bool~) main::$10 || (bool~) main::$11
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant (const byte*) bitmap_screen#0 = (byte*) 0
Constant (const byte*) bitmap_gfx#0 = (byte*) 0
Constant (const byte) bitmap_init::bits#0 = $80
Constant (const byte) bitmap_init::x#0 = 0
Constant (const byte) bitmap_init::bits#2 = $80
Constant (const byte) bitmap_init::y#0 = 0
Constant (const word) memset::num#0 = $3e8
Constant (const byte) memset::c#1 = 0
Constant (const word) memset::num#1 = $1f40
Constant (const byte*) bitmap_init::gfx#0 = BITMAP
Constant (const byte*) bitmap_init::screen#0 = SCREEN
Constant (const byte) bitmap_clear::bgcol#0 = BLACK
Constant (const byte) bitmap_clear::fgcol#0 = WHITE
Constant (const byte*) main::toD0181_screen#0 = SCREEN
Constant (const byte*) main::toD0181_gfx#0 = BITMAP
Constant (const word) main::x#0 = 0
Constant (const byte) main::y#0 = 0
Constant (const word) main::vx#0 = 1
Constant (const byte) main::vy#0 = 1
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) bitmap_gfx#1 = bitmap_init::gfx#0
Constant (const byte*) bitmap_screen#1 = bitmap_init::screen#0
Constant (const word) main::toD0181_$0 = (word)main::toD0181_screen#0
Constant (const word) main::toD0181_$4 = (word)main::toD0181_gfx#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const void*) memset::str#0 = (void*)bitmap_screen#1
Constant (const void*) memset::str#1 = (void*)bitmap_gfx#1
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [126] if(true) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [34] bitmap_init::x#1 ← ++ bitmap_init::x#2 to ++
Resolved ranged comparison value [36] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1 to (number) 0
Resolved ranged next value [54] bitmap_init::y#1 ← ++ bitmap_init::y#2 to ++
Resolved ranged comparison value [56] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5 to (number) 0
Simplifying expression containing zero bitmap_clear::$0 in [66] (byte) bitmap_clear::col#0 ← (byte~) bitmap_clear::$0 + (const byte) bitmap_clear::bgcol#0
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (void*) memset::return#2 and assignment [35] (void*) memset::return#2 ← (void*) memset::str#3
Eliminating unused variable (void*) memset::return#3 and assignment [37] (void*) memset::return#3 ← (void*) memset::str#3
Eliminating unused constant (const byte) bitmap_clear::bgcol#0
Eliminating unused constant (const byte*) bitmap_screen#0
Eliminating unused constant (const byte*) bitmap_gfx#0
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Adding number conversion cast (unumber) 0 in if((byte) bitmap_init::x#1!=(number) 0) goto bitmap_init::@1
Adding number conversion cast (unumber) 0 in if((byte) bitmap_init::y#1!=(number) 0) goto bitmap_init::@5
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) bitmap_plot::plotter#0 ← (byte*)(word~) bitmap_plot::$3
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte~) bitmap_init::$7 = (byte~) bitmap_init::$3 
Alias (byte) bitmap_clear::col#0 = (byte~) bitmap_clear::$0 
Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) main::$5 [64] if((word) main::x#1==(word) $13f) goto main::@8
Simple Condition (bool~) main::$10 [68] if((byte) main::y#1==(byte) $c7) goto main::@9
Simple Condition (bool~) main::$6 [91] if((word) main::x#1==(byte) 0) goto main::@8
Simple Condition (bool~) main::$11 [92] if((byte) main::y#1==(byte) 0) goto main::@9
Successful SSA optimization Pass2ConditionalJumpSimplification
Negating conditional jump and destination [91] if((word) main::x#1!=(byte) 0) goto main::@4
Negating conditional jump and destination [92] if((byte) main::y#1!=(byte) 0) goto main::@5
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [31] (byte) bitmap_clear::col#0 ← (const byte) bitmap_clear::fgcol#0 * (byte) $10
Constant right-side identified [47] (word~) main::toD0181_$1 ← (const word) main::toD0181_$0 & (word) $3fff
Constant right-side identified [50] (byte~) main::toD0181_$5 ← > (const word) main::toD0181_$4
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) bitmap_clear::col#0 = bitmap_clear::fgcol#0*$10
Constant (const word) main::toD0181_$1 = main::toD0181_$0&$3fff
Constant (const byte) main::toD0181_$5 = >main::toD0181_$4
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) memset::c#0 = bitmap_clear::col#0
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [43] (word~) main::toD0181_$2 ← (const word) main::toD0181_$1 * (byte) 4
Constant right-side identified [45] (byte~) main::toD0181_$6 ← (const byte) main::toD0181_$5 / (byte) 4
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) main::toD0181_$2 = main::toD0181_$1*4
Constant (const byte) main::toD0181_$6 = main::toD0181_$5/4
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [43] (byte~) main::toD0181_$3 ← > (const word) main::toD0181_$2
Constant right-side identified [44] (byte~) main::toD0181_$7 ← (const byte) main::toD0181_$6 & (byte) $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::toD0181_$3 = >main::toD0181_$2
Constant (const byte) main::toD0181_$7 = main::toD0181_$6&$f
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [43] (byte) main::toD0181_return#0 ← (const byte) main::toD0181_$3 | (const byte) main::toD0181_$7
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::toD0181_return#0 = main::toD0181_$3|main::toD0181_$7
Successful SSA optimization Pass2ConstantIdentification
Inlining Noop Cast [2] (byte*~) memset::$2 ← (byte*)(void*) memset::str#3 keeping memset::str#3
Inlining Noop Cast [4] (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3 keeping memset::str#3
Successful SSA optimization Pass2NopCastInlining
Inlining Noop Cast [34] (byte*) bitmap_plot::plotter#0 ← (byte*)(word~) bitmap_plot::$3 keeping bitmap_plot::plotter#0
Successful SSA optimization Pass2NopCastInlining
Inlining constant with var siblings (const word) memset::num#0
Inlining constant with var siblings (const byte) memset::c#1
Inlining constant with var siblings (const word) memset::num#1
Inlining constant with var siblings (const void*) memset::str#0
Inlining constant with var siblings (const void*) memset::str#1
Inlining constant with var siblings (const byte) memset::c#0
Inlining constant with var siblings (const byte) bitmap_init::bits#0
Inlining constant with var siblings (const byte) bitmap_init::x#0
Inlining constant with var siblings (const byte) bitmap_init::bits#2
Inlining constant with var siblings (const byte) bitmap_init::y#0
Inlining constant with var siblings (const word) main::x#0
Inlining constant with var siblings (const byte) main::y#0
Inlining constant with var siblings (const word) main::vx#0
Inlining constant with var siblings (const byte) main::vy#0
Constant inlined bitmap_init::screen#0 = (const byte*) SCREEN
Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN
Constant inlined main::toD0181_gfx#0 = (const byte*) BITMAP
Constant inlined bitmap_init::gfx#0 = (const byte*) BITMAP
Constant inlined memset::num#1 = (word) $1f40
Constant inlined memset::num#0 = (word) $3e8
Constant inlined bitmap_init::bits#0 = (byte) $80
Constant inlined bitmap_init::bits#2 = (byte) $80
Constant inlined memset::str#1 = (void*)(const byte*) BITMAP
Constant inlined memset::str#0 = (void*)(const byte*) SCREEN
Constant inlined main::toD0181_$7 = >(word)(const byte*) BITMAP/(byte) 4&(byte) $f
Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN&(word) $3fff*(byte) 4
Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN&(word) $3fff
Constant inlined bitmap_gfx#1 = (const byte*) BITMAP
Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN
Constant inlined main::x#0 = (word) 0
Constant inlined bitmap_clear::fgcol#0 = (const byte) WHITE
Constant inlined main::y#0 = (byte) 0
Constant inlined main::toD0181_$6 = >(word)(const byte*) BITMAP/(byte) 4
Constant inlined main::toD0181_$5 = >(word)(const byte*) BITMAP
Constant inlined main::toD0181_$4 = (word)(const byte*) BITMAP
Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4
Constant inlined bitmap_screen#1 = (const byte*) SCREEN
Constant inlined main::vy#0 = (byte) 1
Constant inlined main::vx#0 = (word) 1
Constant inlined bitmap_init::y#0 = (byte) 0
Constant inlined memset::c#0 = (const byte) bitmap_clear::col#0
Constant inlined bitmap_init::x#0 = (byte) 0
Constant inlined memset::c#1 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting bitmap_init::@9(between bitmap_init::@2 and bitmap_init::@1)
Added new block during phi lifting bitmap_init::@10(between bitmap_init::@1 and bitmap_init::@2)
Added new block during phi lifting bitmap_init::@11(between bitmap_init::@6 and bitmap_init::@5)
Added new block during phi lifting bitmap_init::@12(between bitmap_init::@5 and bitmap_init::@6)
Added new block during phi lifting main::@18(between main::@16 and main::@4)
Added new block during phi lifting main::@19(between main::@17 and main::@5)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @9
Adding NOP phi() at start of @18
Adding NOP phi() at start of @19
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@12
Adding NOP phi() at start of main::toD0181
Adding NOP phi() at start of main::toD0181_@return
Adding NOP phi() at start of main::@14
Adding NOP phi() at start of bitmap_clear
Adding NOP phi() at start of bitmap_clear::@1
Adding NOP phi() at start of bitmap_clear::@2
Adding NOP phi() at start of memset::@1
Adding NOP phi() at start of bitmap_init
Adding NOP phi() at start of bitmap_init::@3
Adding NOP phi() at start of bitmap_init::@4
CALL GRAPH
Calls in [] to main:4 
Calls in [main] to bitmap_init:8 bitmap_clear:10 init_irq:15 bitmap_plot:20 
Calls in [bitmap_clear] to memset:57 memset:59 

Created 16 initial phi equivalence classes
Coalesced [26] main::vx#11 ← main::vx#1
Coalesced [31] main::vy#11 ← main::vy#1
Coalesced [34] main::x#9 ← main::x#1
Coalesced [35] main::y#9 ← main::y#1
Coalesced [36] main::vx#9 ← main::vx#6
Coalesced [37] main::vy#9 ← main::vy#8
Coalesced (already) [38] main::vy#10 ← main::vy#2
Coalesced (already) [39] main::vx#10 ← main::vx#2
Coalesced [72] memset::dst#5 ← memset::dst#1
Coalesced [92] bitmap_init::yoffs#7 ← bitmap_init::yoffs#1
Coalesced [97] bitmap_init::y#5 ← bitmap_init::y#1
Coalesced [98] bitmap_init::yoffs#5 ← bitmap_init::yoffs#4
Coalesced (already) [99] bitmap_init::yoffs#6 ← bitmap_init::yoffs#2
Coalesced [100] bitmap_init::bits#5 ← bitmap_init::bits#4
Coalesced [101] bitmap_init::x#5 ← bitmap_init::x#1
Coalesced [102] bitmap_init::bits#6 ← bitmap_init::bits#1
Coalesced down to 12 phi equivalence classes
Culled Empty Block (label) @9
Culled Empty Block (label) @19
Culled Empty Block (label) main::toD0181_@return
Culled Empty Block (label) main::@14
Culled Empty Block (label) main::@19
Culled Empty Block (label) main::@18
Culled Empty Block (label) bitmap_clear::@2
Culled Empty Block (label) memset::@1
Culled Empty Block (label) bitmap_init::@3
Culled Empty Block (label) bitmap_init::@4
Culled Empty Block (label) bitmap_init::@11
Culled Empty Block (label) bitmap_init::@12
Culled Empty Block (label) bitmap_init::@9
Renumbering block @16 to @1
Renumbering block @18 to @2
Renumbering block memset::@2 to memset::@1
Renumbering block memset::@4 to memset::@2
Renumbering block memset::@5 to memset::@3
Renumbering block bitmap_init::@5 to bitmap_init::@3
Renumbering block bitmap_init::@6 to bitmap_init::@4
Renumbering block bitmap_init::@7 to bitmap_init::@5
Renumbering block bitmap_init::@10 to bitmap_init::@6
Renumbering block main::@4 to main::@3
Renumbering block main::@5 to main::@4
Renumbering block main::@8 to main::@5
Renumbering block main::@9 to main::@6
Renumbering block main::@11 to main::@7
Renumbering block main::@12 to main::@8
Renumbering block main::@13 to main::@9
Renumbering block main::@15 to main::@10
Renumbering block main::@16 to main::@11
Renumbering block main::@17 to main::@12
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@8
Adding NOP phi() at start of main::toD0181
Adding NOP phi() at start of bitmap_clear
Adding NOP phi() at start of bitmap_clear::@1
Adding NOP phi() at start of bitmap_init
Adding NOP phi() at start of bitmap_init::@6

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  [1] (byte) frame_cnt ← (byte) 1
  to:@2
@2: scope:[]  from @1
  [2] phi()
  [3] call main 
  to:@end
@end: scope:[]  from @2
  [4] phi()

(void()) main()
main: scope:[main]  from @2
  [5] phi()
  [6] call bitmap_init 
  to:main::@8
main::@8: scope:[main]  from main
  [7] phi()
  [8] call bitmap_clear 
  to:main::@9
main::@9: scope:[main]  from main::@8
  [9] *((const byte*) D011) ← (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3
  to:main::toD0181
main::toD0181: scope:[main]  from main::@9
  [10] phi()
  to:main::@7
main::@7: scope:[main]  from main::toD0181
  [11] *((const byte*) D018) ← (const byte) main::toD0181_return#0
  [12] call init_irq 
  to:main::@1
main::@1: scope:[main]  from main::@4 main::@7
  [13] (byte) main::vy#2 ← phi( main::@7/(byte) 1 main::@4/(byte) main::vy#8 )
  [13] (word) main::vx#2 ← phi( main::@7/(word) 1 main::@4/(word) main::vx#6 )
  [13] (byte) main::y#2 ← phi( main::@7/(byte) 0 main::@4/(byte) main::y#1 )
  [13] (word) main::x#2 ← phi( main::@7/(word) 0 main::@4/(word) main::x#1 )
  to:main::@2
main::@2: scope:[main]  from main::@1
  [14] (word) bitmap_plot::x#0 ← (word) main::x#2
  [15] (byte) bitmap_plot::y#0 ← (byte) main::y#2
  [16] call bitmap_plot 
  to:main::@10
main::@10: scope:[main]  from main::@2
  [17] (word) main::x#1 ← (word) main::x#2 + (word) main::vx#2
  [18] (byte) main::y#1 ← (byte) main::y#2 + (byte) main::vy#2
  [19] if((word) main::x#1==(word) $13f) goto main::@5
  to:main::@11
main::@11: scope:[main]  from main::@10
  [20] if((word) main::x#1!=(byte) 0) goto main::@3
  to:main::@5
main::@5: scope:[main]  from main::@10 main::@11
  [21] (word) main::vx#1 ← - (word) main::vx#2
  to:main::@3
main::@3: scope:[main]  from main::@11 main::@5
  [22] (word) main::vx#6 ← phi( main::@11/(word) main::vx#2 main::@5/(word) main::vx#1 )
  [23] if((byte) main::y#1==(byte) $c7) goto main::@6
  to:main::@12
main::@12: scope:[main]  from main::@3
  [24] if((byte) main::y#1!=(byte) 0) goto main::@4
  to:main::@6
main::@6: scope:[main]  from main::@12 main::@3
  [25] (byte) main::vy#1 ← - (byte) main::vy#2
  to:main::@4
main::@4: scope:[main]  from main::@12 main::@6
  [26] (byte) main::vy#8 ← phi( main::@12/(byte) main::vy#2 main::@6/(byte) main::vy#1 )
  [27] *((const byte*) plots_per_frame + (byte) frame_cnt) ← ++ *((const byte*) plots_per_frame + (byte) frame_cnt)
  to:main::@1

(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y)
bitmap_plot: scope:[bitmap_plot]  from main::@2
  [28] (word) bitmap_plot::plotter#0 ← *((const byte*) bitmap_plot_yhi + (byte) bitmap_plot::y#0) w= *((const byte*) bitmap_plot_ylo + (byte) bitmap_plot::y#0)
  [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8
  [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1
  [31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0
  [32] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte*) bitmap_plot_bit + (byte~) bitmap_plot::$2)
  to:bitmap_plot::@return
bitmap_plot::@return: scope:[bitmap_plot]  from bitmap_plot
  [33] return 
  to:@return

(void()) init_irq()
init_irq: scope:[init_irq]  from main::@7
  asm { sei  }
  [35] *((const byte*) PROCPORT_DDR) ← (const byte) PROCPORT_DDR_MEMORY_MASK
  [36] *((const byte*) PROCPORT) ← (const byte) PROCPORT_RAM_IO
  [37] *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR
  [38] *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) | (byte) $80
  [39] *((const byte*) RASTER) ← (byte) 0
  [40] *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER
  [41] *((const void()**) HARDWARE_IRQ) ← &interrupt(HARDWARE_CLOBBER)(void()) irq()
  asm { cli  }
  to:init_irq::@return
init_irq::@return: scope:[init_irq]  from init_irq
  [43] return 
  to:@return

(void()) bitmap_clear((byte) bitmap_clear::bgcol , (byte) bitmap_clear::fgcol)
bitmap_clear: scope:[bitmap_clear]  from main::@8
  [44] phi()
  [45] call memset 
  to:bitmap_clear::@1
bitmap_clear::@1: scope:[bitmap_clear]  from bitmap_clear
  [46] phi()
  [47] call memset 
  to:bitmap_clear::@return
bitmap_clear::@return: scope:[bitmap_clear]  from bitmap_clear::@1
  [48] return 
  to:@return

(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
memset: scope:[memset]  from bitmap_clear bitmap_clear::@1
  [49] (byte) memset::c#4 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 )
  [49] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN bitmap_clear::@1/(void*)(const byte*) BITMAP )
  [49] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 )
  [50] if((word) memset::num#2<=(byte) 0) goto memset::@return
  to:memset::@1
memset::@1: scope:[memset]  from memset
  [51] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2
  [52] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3
  to:memset::@2
memset::@2: scope:[memset]  from memset::@1 memset::@3
  [53] (byte*) memset::dst#2 ← phi( memset::@1/(byte*) memset::dst#4 memset::@3/(byte*) memset::dst#1 )
  [54] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3
  to:memset::@return
memset::@return: scope:[memset]  from memset memset::@2
  [55] return 
  to:@return
memset::@3: scope:[memset]  from memset::@2
  [56] *((byte*) memset::dst#2) ← (byte) memset::c#4
  [57] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
  to:memset::@2

(void()) bitmap_init((byte*) bitmap_init::gfx , (byte*) bitmap_init::screen)
bitmap_init: scope:[bitmap_init]  from main
  [58] phi()
  to:bitmap_init::@1
bitmap_init::@1: scope:[bitmap_init]  from bitmap_init bitmap_init::@2
  [59] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) 0 bitmap_init::@2/(byte) bitmap_init::x#1 )
  [59] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 )
  [60] *((const byte*) bitmap_plot_bit + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3
  [61] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1
  [62] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6
  to:bitmap_init::@2
bitmap_init::@6: scope:[bitmap_init]  from bitmap_init::@1
  [63] phi()
  to:bitmap_init::@2
bitmap_init::@2: scope:[bitmap_init]  from bitmap_init::@1 bitmap_init::@6
  [64] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte) $80 )
  [65] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2
  [66] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1
  to:bitmap_init::@3
bitmap_init::@3: scope:[bitmap_init]  from bitmap_init::@2 bitmap_init::@4
  [67] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP bitmap_init::@4/(byte*) bitmap_init::yoffs#4 )
  [67] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 )
  [68] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7
  [69] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2
  [70] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4
  [71] *((const byte*) bitmap_plot_ylo + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5
  [72] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2
  [73] *((const byte*) bitmap_plot_yhi + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6
  [74] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@4
  to:bitmap_init::@5
bitmap_init::@5: scope:[bitmap_init]  from bitmap_init::@3
  [75] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8
  to:bitmap_init::@4
bitmap_init::@4: scope:[bitmap_init]  from bitmap_init::@3 bitmap_init::@5
  [76] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 )
  [77] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2
  [78] if((byte) bitmap_init::y#1!=(byte) 0) goto bitmap_init::@3
  to:bitmap_init::@return
bitmap_init::@return: scope:[bitmap_init]  from bitmap_init::@4
  [79] return 
  to:@return

interrupt(HARDWARE_CLOBBER)(void()) irq()
irq: scope:[irq]  from
  [80] *((const byte*) BGCOL) ← (const byte) WHITE
  [81] if((byte) 0==(byte) frame_cnt) goto irq::@1
  to:irq::@2
irq::@2: scope:[irq]  from irq
  [82] (byte) frame_cnt ← ++ (byte) frame_cnt
  to:irq::@1
irq::@1: scope:[irq]  from irq irq::@2
  [83] *((const byte*) BGCOL) ← (const byte) BLACK
  [84] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER
  to:irq::@return
irq::@return: scope:[irq]  from irq::@1
  [85] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(void()) bitmap_clear((byte) bitmap_clear::bgcol , (byte) bitmap_clear::fgcol)
(byte) bitmap_clear::bgcol
(byte) bitmap_clear::col
(byte) bitmap_clear::fgcol
(byte*) bitmap_gfx
(void()) bitmap_init((byte*) bitmap_init::gfx , (byte*) bitmap_init::screen)
(byte~) bitmap_init::$4 22.0
(byte~) bitmap_init::$5 22.0
(byte~) bitmap_init::$6 22.0
(byte~) bitmap_init::$7 5.5
(byte) bitmap_init::bits
(byte) bitmap_init::bits#1 11.0
(byte) bitmap_init::bits#3 16.5
(byte) bitmap_init::bits#4 7.333333333333333
(byte*) bitmap_init::gfx
(byte*) bitmap_init::screen
(byte) bitmap_init::x
(byte) bitmap_init::x#1 16.5
(byte) bitmap_init::x#2 5.5
(byte) bitmap_init::y
(byte) bitmap_init::y#1 16.5
(byte) bitmap_init::y#2 5.5
(byte*) bitmap_init::yoffs
(byte*) bitmap_init::yoffs#1 22.0
(byte*) bitmap_init::yoffs#2 6.875
(byte*) bitmap_init::yoffs#4 11.0
(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y)
(word~) bitmap_plot::$1 4.0
(byte~) bitmap_plot::$2 4.0
(byte*) bitmap_plot::plotter
(word) bitmap_plot::plotter#0 1.0
(byte*) bitmap_plot::plotter#1 3.0
(word) bitmap_plot::x
(word) bitmap_plot::x#0 3.0
(byte) bitmap_plot::y
(byte) bitmap_plot::y#0 15.0
(byte*) bitmap_screen
(byte) frame_cnt loadstore 1.1538461538461537
(void()) init_irq()
interrupt(HARDWARE_CLOBBER)(void()) irq()
(void()) main()
(byte*) main::toD0181_gfx
(byte) main::toD0181_return
(byte*) main::toD0181_screen
(word) main::vx
(word) main::vx#1 22.0
(word) main::vx#2 5.5
(word) main::vx#6 5.5
(byte) main::vy
(byte) main::vy#1 22.0
(byte) main::vy#2 3.6666666666666665
(byte) main::vy#8 16.5
(word) main::x
(word) main::x#1 4.0
(word) main::x#2 8.25
(byte) main::y
(byte) main::y#1 4.4
(byte) main::y#2 6.6000000000000005
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(byte) memset::c
(byte) memset::c#4 1.375
(byte*) memset::dst
(byte*) memset::dst#1 22.0
(byte*) memset::dst#2 15.333333333333332
(byte*) memset::dst#4 4.0
(byte*) memset::end
(byte*) memset::end#0 2.1666666666666665
(word) memset::num
(word) memset::num#2 2.0
(void*) memset::return
(void*) memset::str
(void*) memset::str#3

Initial phi equivalence classes
[ main::x#2 main::x#1 ]
[ main::y#2 main::y#1 ]
[ main::vx#2 main::vx#6 main::vx#1 ]
[ main::vy#2 main::vy#8 main::vy#1 ]
[ memset::num#2 ]
[ memset::str#3 ]
[ memset::c#4 ]
[ memset::dst#2 memset::dst#4 memset::dst#1 ]
[ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ]
[ bitmap_init::x#2 bitmap_init::x#1 ]
[ bitmap_init::y#2 bitmap_init::y#1 ]
[ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ]
Added variable frame_cnt to live range equivalence class [ frame_cnt ]
Added variable bitmap_plot::x#0 to live range equivalence class [ bitmap_plot::x#0 ]
Added variable bitmap_plot::y#0 to live range equivalence class [ bitmap_plot::y#0 ]
Added variable bitmap_plot::plotter#0 to live range equivalence class [ bitmap_plot::plotter#0 ]
Added variable bitmap_plot::$1 to live range equivalence class [ bitmap_plot::$1 ]
Added variable bitmap_plot::plotter#1 to live range equivalence class [ bitmap_plot::plotter#1 ]
Added variable bitmap_plot::$2 to live range equivalence class [ bitmap_plot::$2 ]
Added variable memset::end#0 to live range equivalence class [ memset::end#0 ]
Added variable bitmap_init::$7 to live range equivalence class [ bitmap_init::$7 ]
Added variable bitmap_init::$4 to live range equivalence class [ bitmap_init::$4 ]
Added variable bitmap_init::$5 to live range equivalence class [ bitmap_init::$5 ]
Added variable bitmap_init::$6 to live range equivalence class [ bitmap_init::$6 ]
Complete equivalence classes
[ main::x#2 main::x#1 ]
[ main::y#2 main::y#1 ]
[ main::vx#2 main::vx#6 main::vx#1 ]
[ main::vy#2 main::vy#8 main::vy#1 ]
[ memset::num#2 ]
[ memset::str#3 ]
[ memset::c#4 ]
[ memset::dst#2 memset::dst#4 memset::dst#1 ]
[ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ]
[ bitmap_init::x#2 bitmap_init::x#1 ]
[ bitmap_init::y#2 bitmap_init::y#1 ]
[ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ]
[ frame_cnt ]
[ bitmap_plot::x#0 ]
[ bitmap_plot::y#0 ]
[ bitmap_plot::plotter#0 ]
[ bitmap_plot::$1 ]
[ bitmap_plot::plotter#1 ]
[ bitmap_plot::$2 ]
[ memset::end#0 ]
[ bitmap_init::$7 ]
[ bitmap_init::$4 ]
[ bitmap_init::$5 ]
[ bitmap_init::$6 ]
Allocated zp[2]:2 [ main::x#2 main::x#1 ]
Allocated zp[1]:4 [ main::y#2 main::y#1 ]
Allocated zp[2]:5 [ main::vx#2 main::vx#6 main::vx#1 ]
Allocated zp[1]:7 [ main::vy#2 main::vy#8 main::vy#1 ]
Allocated zp[2]:8 [ memset::num#2 ]
Allocated zp[2]:10 [ memset::str#3 ]
Allocated zp[1]:12 [ memset::c#4 ]
Allocated zp[2]:13 [ memset::dst#2 memset::dst#4 memset::dst#1 ]
Allocated zp[1]:15 [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ]
Allocated zp[1]:16 [ bitmap_init::x#2 bitmap_init::x#1 ]
Allocated zp[1]:17 [ bitmap_init::y#2 bitmap_init::y#1 ]
Allocated zp[2]:18 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ]
Allocated zp[1]:20 [ frame_cnt ]
Allocated zp[2]:21 [ bitmap_plot::x#0 ]
Allocated zp[1]:23 [ bitmap_plot::y#0 ]
Allocated zp[2]:24 [ bitmap_plot::plotter#0 ]
Allocated zp[2]:26 [ bitmap_plot::$1 ]
Allocated zp[2]:28 [ bitmap_plot::plotter#1 ]
Allocated zp[1]:30 [ bitmap_plot::$2 ]
Allocated zp[2]:31 [ memset::end#0 ]
Allocated zp[1]:33 [ bitmap_init::$7 ]
Allocated zp[1]:34 [ bitmap_init::$4 ]
Allocated zp[1]:35 [ bitmap_init::$5 ]
Allocated zp[1]:36 [ bitmap_init::$6 ]

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots simple plots
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  // Processor port data direction register
  .label PROCPORT_DDR = 0
  // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written
  .const PROCPORT_DDR_MEMORY_MASK = 7
  // Processor Port Register controlling RAM/ROM configuration and the datasette
  .label PROCPORT = 1
  // RAM in $A000, $E000 I/O in $D000
  .const PROCPORT_RAM_IO = 5
  .label RASTER = $d012
  .label BGCOL = $d021
  .label VIC_CONTROL = $d011
  .label D011 = $d011
  .const VIC_BMM = $20
  .const VIC_DEN = $10
  .const VIC_RSEL = 8
  .label D018 = $d018
  // VIC II IRQ Status Register
  .label IRQ_STATUS = $d019
  // VIC II IRQ Enable Register
  .label IRQ_ENABLE = $d01a
  // Bits for the IRQ Status/Enable Registers
  .const IRQ_RASTER = 1
  // CIA#1 Interrupt Status & Control Register
  .label CIA1_INTERRUPT = $dc0d
  // Value that disables all CIA interrupts when stored to the CIA Interrupt registers
  .const CIA_INTERRUPT_CLEAR = $7f
  // The vector used when the HARDWARE serves IRQ interrupts
  .label HARDWARE_IRQ = $fffe
  // The colors of the C64
  .const BLACK = 0
  .const WHITE = 1
  .label BITMAP = $2000
  .label SCREEN = $400
  .label frame_cnt = $14
  // @begin
__bbegin:
  jmp __b1
  // @1
__b1:
  // [1] (byte) frame_cnt ← (byte) 1 -- vbuz1=vbuc1 
  // Counts frames - updated by the IRQ
  lda #1
  sta.z frame_cnt
  // [2] phi from @1 to @2 [phi:@1->@2]
__b2_from___b1:
  jmp __b2
  // @2
__b2:
  // [3] call main 
  // [5] phi from @2 to main [phi:@2->main]
main_from___b2:
  jsr main
  // [4] phi from @2 to @end [phi:@2->@end]
__bend_from___b2:
  jmp __bend
  // @end
__bend:
  // main
main: {
    .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f
    .label x = 2
    .label y = 4
    .label vx = 5
    .label vy = 7
    // [6] call bitmap_init 
    // [58] phi from main to bitmap_init [phi:main->bitmap_init]
  bitmap_init_from_main:
    jsr bitmap_init
    // [7] phi from main to main::@8 [phi:main->main::@8]
  __b8_from_main:
    jmp __b8
    // main::@8
  __b8:
    // [8] call bitmap_clear 
    // [44] phi from main::@8 to bitmap_clear [phi:main::@8->bitmap_clear]
  bitmap_clear_from___b8:
    jsr bitmap_clear
    jmp __b9
    // main::@9
  __b9:
    // [9] *((const byte*) D011) ← (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3 -- _deref_pbuc1=vbuc2 
    lda #VIC_BMM|VIC_DEN|VIC_RSEL|3
    sta D011
    // [10] phi from main::@9 to main::toD0181 [phi:main::@9->main::toD0181]
  toD0181_from___b9:
    jmp toD0181
    // main::toD0181
  toD0181:
    jmp __b7
    // main::@7
  __b7:
    // [11] *((const byte*) D018) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0181_return
    sta D018
    // [12] call init_irq 
    jsr init_irq
    // [13] phi from main::@7 to main::@1 [phi:main::@7->main::@1]
  __b1_from___b7:
    // [13] phi (byte) main::vy#2 = (byte) 1 [phi:main::@7->main::@1#0] -- vbuz1=vbuc1 
    lda #1
    sta.z vy
    // [13] phi (word) main::vx#2 = (word) 1 [phi:main::@7->main::@1#1] -- vwuz1=vwuc1 
    lda #<1
    sta.z vx
    lda #>1
    sta.z vx+1
    // [13] phi (byte) main::y#2 = (byte) 0 [phi:main::@7->main::@1#2] -- vbuz1=vbuc1 
    lda #0
    sta.z y
    // [13] phi (word) main::x#2 = (word) 0 [phi:main::@7->main::@1#3] -- vwuz1=vwuc1 
    lda #<0
    sta.z x
    lda #>0
    sta.z x+1
    jmp __b1
    // main::@1
  __b1:
    jmp __b2
    // main::@2
  __b2:
    // [14] (word) bitmap_plot::x#0 ← (word) main::x#2 -- vwuz1=vwuz2 
    lda.z x
    sta.z bitmap_plot.x
    lda.z x+1
    sta.z bitmap_plot.x+1
    // [15] (byte) bitmap_plot::y#0 ← (byte) main::y#2 -- vbuz1=vbuz2 
    lda.z y
    sta.z bitmap_plot.y
    // [16] call bitmap_plot 
    jsr bitmap_plot
    jmp __b10
    // main::@10
  __b10:
    // [17] (word) main::x#1 ← (word) main::x#2 + (word) main::vx#2 -- vwuz1=vwuz1_plus_vwuz2 
    lda.z x
    clc
    adc.z vx
    sta.z x
    lda.z x+1
    adc.z vx+1
    sta.z x+1
    // [18] (byte) main::y#1 ← (byte) main::y#2 + (byte) main::vy#2 -- vbuz1=vbuz1_plus_vbuz2 
    lda.z y
    clc
    adc.z vy
    sta.z y
    // [19] if((word) main::x#1==(word) $13f) goto main::@5 -- vwuz1_eq_vwuc1_then_la1 
    lda.z x
    cmp #<$13f
    bne !+
    lda.z x+1
    cmp #>$13f
    beq __b5
  !:
    jmp __b11
    // main::@11
  __b11:
    // [20] if((word) main::x#1!=(byte) 0) goto main::@3 -- vwuz1_neq_0_then_la1 
    lda.z x
    bne __b3_from___b11
    lda.z x+1
    bne __b3_from___b11
    jmp __b5
    // main::@5
  __b5:
    // [21] (word) main::vx#1 ← - (word) main::vx#2 -- vwuz1=_neg_vwuz1 
    sec
    lda #0
    sbc.z vx
    sta.z vx
    lda #0
    sbc.z vx+1
    sta.z vx+1
    // [22] phi from main::@11 main::@5 to main::@3 [phi:main::@11/main::@5->main::@3]
  __b3_from___b11:
  __b3_from___b5:
    // [22] phi (word) main::vx#6 = (word) main::vx#2 [phi:main::@11/main::@5->main::@3#0] -- register_copy 
    jmp __b3
    // main::@3
  __b3:
    // [23] if((byte) main::y#1==(byte) $c7) goto main::@6 -- vbuz1_eq_vbuc1_then_la1 
    lda #$c7
    cmp.z y
    beq __b6
    jmp __b12
    // main::@12
  __b12:
    // [24] if((byte) main::y#1!=(byte) 0) goto main::@4 -- vbuz1_neq_0_then_la1 
    lda.z y
    cmp #0
    bne __b4_from___b12
    jmp __b6
    // main::@6
  __b6:
    // [25] (byte) main::vy#1 ← - (byte) main::vy#2 -- vbuz1=_neg_vbuz1 
    lda.z vy
    eor #$ff
    clc
    adc #1
    sta.z vy
    // [26] phi from main::@12 main::@6 to main::@4 [phi:main::@12/main::@6->main::@4]
  __b4_from___b12:
  __b4_from___b6:
    // [26] phi (byte) main::vy#8 = (byte) main::vy#2 [phi:main::@12/main::@6->main::@4#0] -- register_copy 
    jmp __b4
    // main::@4
  __b4:
    // [27] *((const byte*) plots_per_frame + (byte) frame_cnt) ← ++ *((const byte*) plots_per_frame + (byte) frame_cnt) -- pbuc1_derefidx_vbuz1=_inc_pbuc1_derefidx_vbuz1 
    ldx.z frame_cnt
    inc plots_per_frame,x
    // [13] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
  __b1_from___b4:
    // [13] phi (byte) main::vy#2 = (byte) main::vy#8 [phi:main::@4->main::@1#0] -- register_copy 
    // [13] phi (word) main::vx#2 = (word) main::vx#6 [phi:main::@4->main::@1#1] -- register_copy 
    // [13] phi (byte) main::y#2 = (byte) main::y#1 [phi:main::@4->main::@1#2] -- register_copy 
    // [13] phi (word) main::x#2 = (word) main::x#1 [phi:main::@4->main::@1#3] -- register_copy 
    jmp __b1
}
  // bitmap_plot
// Plot a single dot in the bitmap
// bitmap_plot(word zp($15) x, byte zp($17) y)
bitmap_plot: {
    .label __1 = $1a
    .label __2 = $1e
    .label plotter = $18
    .label plotter_1 = $1c
    .label x = $15
    .label y = $17
    // [28] (word) bitmap_plot::plotter#0 ← *((const byte*) bitmap_plot_yhi + (byte) bitmap_plot::y#0) w= *((const byte*) bitmap_plot_ylo + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuz2_word_pbuc2_derefidx_vbuz2 
    ldy.z y
    lda bitmap_plot_yhi,y
    sta.z plotter+1
    lda bitmap_plot_ylo,y
    sta.z plotter
    // [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 -- vwuz1=vwuz2_band_vwuc1 
    lda.z x
    and #<$fff8
    sta.z __1
    lda.z x+1
    and #>$fff8
    sta.z __1+1
    // [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 -- pbuz1=pbuz2_plus_vwuz3 
    lda.z plotter
    clc
    adc.z __1
    sta.z plotter_1
    lda.z plotter+1
    adc.z __1+1
    sta.z plotter_1+1
    // [31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 -- vbuz1=_lo_vwuz2 
    lda.z x
    sta.z __2
    // [32] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte*) bitmap_plot_bit + (byte~) bitmap_plot::$2) -- _deref_pbuz1=_deref_pbuz1_bor_pbuc1_derefidx_vbuz2 
    ldy #0
    lda (plotter_1),y
    ldy.z __2
    ora bitmap_plot_bit,y
    ldy #0
    sta (plotter_1),y
    jmp __breturn
    // bitmap_plot::@return
  __breturn:
    // [33] return 
    rts
}
  // init_irq
// Setup the IRQ
init_irq: {
    // asm { sei  }
    sei
    // [35] *((const byte*) PROCPORT_DDR) ← (const byte) PROCPORT_DDR_MEMORY_MASK -- _deref_pbuc1=vbuc2 
    // Disable kernal & basic
    lda #PROCPORT_DDR_MEMORY_MASK
    sta PROCPORT_DDR
    // [36] *((const byte*) PROCPORT) ← (const byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2 
    lda #PROCPORT_RAM_IO
    sta PROCPORT
    // [37] *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 
    // Disable CIA 1 Timer IRQ
    lda #CIA_INTERRUPT_CLEAR
    sta CIA1_INTERRUPT
    // [38] *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) | (byte) $80 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 
    // Set raster line to $100
    lda #$80
    ora VIC_CONTROL
    sta VIC_CONTROL
    // [39] *((const byte*) RASTER) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta RASTER
    // [40] *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 
    // Enable Raster Interrupt
    lda #IRQ_RASTER
    sta IRQ_ENABLE
    // [41] *((const void()**) HARDWARE_IRQ) ← &interrupt(HARDWARE_CLOBBER)(void()) irq() -- _deref_pptc1=pprc2 
    // Set the IRQ routine
    lda #<irq
    sta HARDWARE_IRQ
    lda #>irq
    sta HARDWARE_IRQ+1
    // asm { cli  }
    cli
    jmp __breturn
    // init_irq::@return
  __breturn:
    // [43] return 
    rts
}
  // bitmap_clear
// Clear all graphics on the bitmap
// bgcol - the background color to fill the screen with
// fgcol - the foreground color to fill the screen with
bitmap_clear: {
    .const col = WHITE*$10
    // [45] call memset 
    // [49] phi from bitmap_clear to memset [phi:bitmap_clear->memset]
  memset_from_bitmap_clear:
    // [49] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuz1=vbuc1 
    lda #col
    sta.z memset.c
    // [49] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 
    lda #<SCREEN
    sta.z memset.str
    lda #>SCREEN
    sta.z memset.str+1
    // [49] phi (word) memset::num#2 = (word) $3e8 [phi:bitmap_clear->memset#2] -- vwuz1=vwuc1 
    lda #<$3e8
    sta.z memset.num
    lda #>$3e8
    sta.z memset.num+1
    jsr memset
    // [46] phi from bitmap_clear to bitmap_clear::@1 [phi:bitmap_clear->bitmap_clear::@1]
  __b1_from_bitmap_clear:
    jmp __b1
    // bitmap_clear::@1
  __b1:
    // [47] call memset 
    // [49] phi from bitmap_clear::@1 to memset [phi:bitmap_clear::@1->memset]
  memset_from___b1:
    // [49] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuz1=vbuc1 
    lda #0
    sta.z memset.c
    // [49] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 
    lda #<BITMAP
    sta.z memset.str
    lda #>BITMAP
    sta.z memset.str+1
    // [49] phi (word) memset::num#2 = (word) $1f40 [phi:bitmap_clear::@1->memset#2] -- vwuz1=vwuc1 
    lda #<$1f40
    sta.z memset.num
    lda #>$1f40
    sta.z memset.num+1
    jsr memset
    jmp __breturn
    // bitmap_clear::@return
  __breturn:
    // [48] return 
    rts
}
  // memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zp($a) str, byte zp($c) c, word zp(8) num)
memset: {
    .label end = $1f
    .label dst = $d
    .label num = 8
    .label str = $a
    .label c = $c
    // [50] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1 
    lda.z num
    bne !+
    lda.z num+1
    beq __breturn
  !:
    jmp __b1
    // memset::@1
  __b1:
    // [51] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz3 
    lda.z str
    clc
    adc.z num
    sta.z end
    lda.z str+1
    adc.z num+1
    sta.z end+1
    // [52] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3 -- pbuz1=pbuz2 
    lda.z str
    sta.z dst
    lda.z str+1
    sta.z dst+1
    // [53] phi from memset::@1 memset::@3 to memset::@2 [phi:memset::@1/memset::@3->memset::@2]
  __b2_from___b1:
  __b2_from___b3:
    // [53] phi (byte*) memset::dst#2 = (byte*) memset::dst#4 [phi:memset::@1/memset::@3->memset::@2#0] -- register_copy 
    jmp __b2
    // memset::@2
  __b2:
    // [54] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 -- pbuz1_neq_pbuz2_then_la1 
    lda.z dst+1
    cmp.z end+1
    bne __b3
    lda.z dst
    cmp.z end
    bne __b3
    jmp __breturn
    // memset::@return
  __breturn:
    // [55] return 
    rts
    // memset::@3
  __b3:
    // [56] *((byte*) memset::dst#2) ← (byte) memset::c#4 -- _deref_pbuz1=vbuz2 
    lda.z c
    ldy #0
    sta (dst),y
    // [57] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 
    inc.z dst
    bne !+
    inc.z dst+1
  !:
    jmp __b2_from___b3
}
  // bitmap_init
// Initialize bitmap plotting tables
bitmap_init: {
    .label __4 = $22
    .label __5 = $23
    .label __6 = $24
    .label __7 = $21
    .label bits = $f
    .label x = $10
    .label y = $11
    .label yoffs = $12
    // [59] phi from bitmap_init to bitmap_init::@1 [phi:bitmap_init->bitmap_init::@1]
  __b1_from_bitmap_init:
    // [59] phi (byte) bitmap_init::x#2 = (byte) 0 [phi:bitmap_init->bitmap_init::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z x
    // [59] phi (byte) bitmap_init::bits#3 = (byte) $80 [phi:bitmap_init->bitmap_init::@1#1] -- vbuz1=vbuc1 
    lda #$80
    sta.z bits
    jmp __b1
    // [59] phi from bitmap_init::@2 to bitmap_init::@1 [phi:bitmap_init::@2->bitmap_init::@1]
  __b1_from___b2:
    // [59] phi (byte) bitmap_init::x#2 = (byte) bitmap_init::x#1 [phi:bitmap_init::@2->bitmap_init::@1#0] -- register_copy 
    // [59] phi (byte) bitmap_init::bits#3 = (byte) bitmap_init::bits#4 [phi:bitmap_init::@2->bitmap_init::@1#1] -- register_copy 
    jmp __b1
    // bitmap_init::@1
  __b1:
    // [60] *((const byte*) bitmap_plot_bit + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z bits
    ldy.z x
    sta bitmap_plot_bit,y
    // [61] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1 -- vbuz1=vbuz1_ror_1 
    lsr.z bits
    // [62] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6 -- vbuz1_neq_0_then_la1 
    lda.z bits
    cmp #0
    bne __b6_from___b1
    // [64] phi from bitmap_init::@1 to bitmap_init::@2 [phi:bitmap_init::@1->bitmap_init::@2]
  __b2_from___b1:
    // [64] phi (byte) bitmap_init::bits#4 = (byte) $80 [phi:bitmap_init::@1->bitmap_init::@2#0] -- vbuz1=vbuc1 
    lda #$80
    sta.z bits
    jmp __b2
    // [63] phi from bitmap_init::@1 to bitmap_init::@6 [phi:bitmap_init::@1->bitmap_init::@6]
  __b6_from___b1:
    jmp __b6
    // bitmap_init::@6
  __b6:
    // [64] phi from bitmap_init::@6 to bitmap_init::@2 [phi:bitmap_init::@6->bitmap_init::@2]
  __b2_from___b6:
    // [64] phi (byte) bitmap_init::bits#4 = (byte) bitmap_init::bits#1 [phi:bitmap_init::@6->bitmap_init::@2#0] -- register_copy 
    jmp __b2
    // bitmap_init::@2
  __b2:
    // [65] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2 -- vbuz1=_inc_vbuz1 
    inc.z x
    // [66] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 -- vbuz1_neq_0_then_la1 
    lda.z x
    cmp #0
    bne __b1_from___b2
    // [67] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3]
  __b3_from___b2:
    // [67] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 
    lda #<BITMAP
    sta.z yoffs
    lda #>BITMAP
    sta.z yoffs+1
    // [67] phi (byte) bitmap_init::y#2 = (byte) 0 [phi:bitmap_init::@2->bitmap_init::@3#1] -- vbuz1=vbuc1 
    lda #0
    sta.z y
    jmp __b3
    // [67] phi from bitmap_init::@4 to bitmap_init::@3 [phi:bitmap_init::@4->bitmap_init::@3]
  __b3_from___b4:
    // [67] phi (byte*) bitmap_init::yoffs#2 = (byte*) bitmap_init::yoffs#4 [phi:bitmap_init::@4->bitmap_init::@3#0] -- register_copy 
    // [67] phi (byte) bitmap_init::y#2 = (byte) bitmap_init::y#1 [phi:bitmap_init::@4->bitmap_init::@3#1] -- register_copy 
    jmp __b3
    // bitmap_init::@3
  __b3:
    // [68] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 -- vbuz1=vbuz2_band_vbuc1 
    lda #7
    and.z y
    sta.z __7
    // [69] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 -- vbuz1=_lo_pbuz2 
    lda.z yoffs
    sta.z __4
    // [70] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4 -- vbuz1=vbuz2_bor_vbuz3 
    lda.z __7
    ora.z __4
    sta.z __5
    // [71] *((const byte*) bitmap_plot_ylo + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __5
    ldy.z y
    sta bitmap_plot_ylo,y
    // [72] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2 -- vbuz1=_hi_pbuz2 
    lda.z yoffs+1
    sta.z __6
    // [73] *((const byte*) bitmap_plot_yhi + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __6
    ldy.z y
    sta bitmap_plot_yhi,y
    // [74] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@4 -- vbuz1_neq_vbuc1_then_la1 
    lda #7
    cmp.z __7
    bne __b4_from___b3
    jmp __b5
    // bitmap_init::@5
  __b5:
    // [75] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8 -- pbuz1=pbuz1_plus_vwuc1 
    clc
    lda.z yoffs
    adc #<$28*8
    sta.z yoffs
    lda.z yoffs+1
    adc #>$28*8
    sta.z yoffs+1
    // [76] phi from bitmap_init::@3 bitmap_init::@5 to bitmap_init::@4 [phi:bitmap_init::@3/bitmap_init::@5->bitmap_init::@4]
  __b4_from___b3:
  __b4_from___b5:
    // [76] phi (byte*) bitmap_init::yoffs#4 = (byte*) bitmap_init::yoffs#2 [phi:bitmap_init::@3/bitmap_init::@5->bitmap_init::@4#0] -- register_copy 
    jmp __b4
    // bitmap_init::@4
  __b4:
    // [77] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2 -- vbuz1=_inc_vbuz1 
    inc.z y
    // [78] if((byte) bitmap_init::y#1!=(byte) 0) goto bitmap_init::@3 -- vbuz1_neq_0_then_la1 
    lda.z y
    cmp #0
    bne __b3_from___b4
    jmp __breturn
    // bitmap_init::@return
  __breturn:
    // [79] return 
    rts
}
  // irq
// Interrupt Routine counting frames
irq: {
    // entry interrupt(HARDWARE_CLOBBER)
    sta rega+1
    stx regx+1
    sty regy+1
    // [80] *((const byte*) BGCOL) ← (const byte) WHITE -- _deref_pbuc1=vbuc2 
    lda #WHITE
    sta BGCOL
    // [81] if((byte) 0==(byte) frame_cnt) goto irq::@1 -- vbuc1_eq_vbuz1_then_la1 
    lda #0
    cmp.z frame_cnt
    beq __b1
    jmp __b2
    // irq::@2
  __b2:
    // [82] (byte) frame_cnt ← ++ (byte) frame_cnt -- vbuz1=_inc_vbuz1 
    inc.z frame_cnt
    jmp __b1
    // irq::@1
  __b1:
    // [83] *((const byte*) BGCOL) ← (const byte) BLACK -- _deref_pbuc1=vbuc2 
    lda #BLACK
    sta BGCOL
    // [84] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 
    // Acknowledge the IRQ
    lda #IRQ_RASTER
    sta IRQ_STATUS
    jmp __breturn
    // irq::@return
  __breturn:
    // [85] return  - exit interrupt(HARDWARE_CLOBBER)
  rega:
    lda #00
  regx:
    ldx #00
  regy:
    ldy #00
    rti
}
  // File Data
  // Tables for the plotter - initialized by calling bitmap_init();
  bitmap_plot_ylo: .fill $100, 0
  bitmap_plot_yhi: .fill $100, 0
  bitmap_plot_bit: .fill $100, 0
  plots_per_frame: .fill $100, 0

REGISTER UPLIFT POTENTIAL REGISTERS
Equivalence Class zp[1]:34 [ bitmap_init::$4 ] has ALU potential.
Statement [1] (byte) frame_cnt ← (byte) 1 [ frame_cnt ] (  [ frame_cnt ] ) always clobbers reg byte a 
Statement [9] *((const byte*) D011) ← (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3 [ frame_cnt ] ( main:3 [ frame_cnt ] ) always clobbers reg byte a 
Statement [11] *((const byte*) D018) ← (const byte) main::toD0181_return#0 [ frame_cnt ] ( main:3 [ frame_cnt ] ) always clobbers reg byte a 
Statement [14] (word) bitmap_plot::x#0 ← (word) main::x#2 [ frame_cnt main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 ] ( main:3 [ frame_cnt main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:4 [ main::y#2 main::y#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:7 [ main::vy#2 main::vy#8 main::vy#1 ]
Statement [17] (word) main::x#1 ← (word) main::x#2 + (word) main::vx#2 [ frame_cnt main::y#2 main::vx#2 main::vy#2 main::x#1 ] ( main:3 [ frame_cnt main::y#2 main::vx#2 main::vy#2 main::x#1 ] ) always clobbers reg byte a 
Statement [18] (byte) main::y#1 ← (byte) main::y#2 + (byte) main::vy#2 [ frame_cnt main::vx#2 main::vy#2 main::x#1 main::y#1 ] ( main:3 [ frame_cnt main::vx#2 main::vy#2 main::x#1 main::y#1 ] ) always clobbers reg byte a 
Statement [19] if((word) main::x#1==(word) $13f) goto main::@5 [ frame_cnt main::vx#2 main::vy#2 main::x#1 main::y#1 ] ( main:3 [ frame_cnt main::vx#2 main::vy#2 main::x#1 main::y#1 ] ) always clobbers reg byte a 
Statement [20] if((word) main::x#1!=(byte) 0) goto main::@3 [ frame_cnt main::vx#2 main::vy#2 main::x#1 main::y#1 ] ( main:3 [ frame_cnt main::vx#2 main::vy#2 main::x#1 main::y#1 ] ) always clobbers reg byte a 
Statement [21] (word) main::vx#1 ← - (word) main::vx#2 [ frame_cnt main::vy#2 main::x#1 main::y#1 main::vx#1 ] ( main:3 [ frame_cnt main::vy#2 main::x#1 main::y#1 main::vx#1 ] ) always clobbers reg byte a 
Statement [25] (byte) main::vy#1 ← - (byte) main::vy#2 [ frame_cnt main::x#1 main::y#1 main::vx#6 main::vy#1 ] ( main:3 [ frame_cnt main::x#1 main::y#1 main::vx#6 main::vy#1 ] ) always clobbers reg byte a 
Statement [27] *((const byte*) plots_per_frame + (byte) frame_cnt) ← ++ *((const byte*) plots_per_frame + (byte) frame_cnt) [ frame_cnt main::x#1 main::y#1 main::vx#6 main::vy#8 ] ( main:3 [ frame_cnt main::x#1 main::y#1 main::vx#6 main::vy#8 ] ) always clobbers reg byte x 
Removing always clobbered register reg byte x as potential for zp[1]:4 [ main::y#2 main::y#1 ]
Removing always clobbered register reg byte x as potential for zp[1]:7 [ main::vy#2 main::vy#8 main::vy#1 ]
Statement [28] (word) bitmap_plot::plotter#0 ← *((const byte*) bitmap_plot_yhi + (byte) bitmap_plot::y#0) w= *((const byte*) bitmap_plot_ylo + (byte) bitmap_plot::y#0) [ bitmap_plot::x#0 bitmap_plot::plotter#0 ] ( main:3::bitmap_plot:16 [ frame_cnt main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::plotter#0 ] ) always clobbers reg byte a 
Statement [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 [ bitmap_plot::x#0 bitmap_plot::plotter#0 bitmap_plot::$1 ] ( main:3::bitmap_plot:16 [ frame_cnt main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::plotter#0 bitmap_plot::$1 ] ) always clobbers reg byte a 
Statement [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 [ bitmap_plot::x#0 bitmap_plot::plotter#1 ] ( main:3::bitmap_plot:16 [ frame_cnt main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::plotter#1 ] ) always clobbers reg byte a 
Statement [31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 [ bitmap_plot::plotter#1 bitmap_plot::$2 ] ( main:3::bitmap_plot:16 [ frame_cnt main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::plotter#1 bitmap_plot::$2 ] ) always clobbers reg byte a 
Statement [32] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte*) bitmap_plot_bit + (byte~) bitmap_plot::$2) [ ] ( main:3::bitmap_plot:16 [ frame_cnt main::x#2 main::y#2 main::vx#2 main::vy#2 ] ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte y as potential for zp[1]:4 [ main::y#2 main::y#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:7 [ main::vy#2 main::vy#8 main::vy#1 ]
Statement [35] *((const byte*) PROCPORT_DDR) ← (const byte) PROCPORT_DDR_MEMORY_MASK [ ] ( main:3::init_irq:12 [ frame_cnt ] ) always clobbers reg byte a 
Statement [36] *((const byte*) PROCPORT) ← (const byte) PROCPORT_RAM_IO [ ] ( main:3::init_irq:12 [ frame_cnt ] ) always clobbers reg byte a 
Statement [37] *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR [ ] ( main:3::init_irq:12 [ frame_cnt ] ) always clobbers reg byte a 
Statement [38] *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) | (byte) $80 [ ] ( main:3::init_irq:12 [ frame_cnt ] ) always clobbers reg byte a 
Statement [39] *((const byte*) RASTER) ← (byte) 0 [ ] ( main:3::init_irq:12 [ frame_cnt ] ) always clobbers reg byte a 
Statement [40] *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER [ ] ( main:3::init_irq:12 [ frame_cnt ] ) always clobbers reg byte a 
Statement [41] *((const void()**) HARDWARE_IRQ) ← &interrupt(HARDWARE_CLOBBER)(void()) irq() [ ] ( main:3::init_irq:12 [ frame_cnt ] ) always clobbers reg byte a 
Statement [50] if((word) memset::num#2<=(byte) 0) goto memset::@return [ memset::num#2 memset::str#3 memset::c#4 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt memset::num#2 memset::str#3 memset::c#4 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt memset::num#2 memset::str#3 memset::c#4 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:12 [ memset::c#4 ]
Statement [51] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 [ memset::str#3 memset::c#4 memset::end#0 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt memset::str#3 memset::c#4 memset::end#0 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt memset::str#3 memset::c#4 memset::end#0 ] ) always clobbers reg byte a 
Statement [52] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3 [ memset::c#4 memset::end#0 memset::dst#4 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt memset::c#4 memset::end#0 memset::dst#4 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt memset::c#4 memset::end#0 memset::dst#4 ] ) always clobbers reg byte a 
Statement [54] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 [ memset::c#4 memset::end#0 memset::dst#2 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt memset::c#4 memset::end#0 memset::dst#2 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt memset::c#4 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a 
Statement [56] *((byte*) memset::dst#2) ← (byte) memset::c#4 [ memset::c#4 memset::end#0 memset::dst#2 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt memset::c#4 memset::end#0 memset::dst#2 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt memset::c#4 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte y as potential for zp[1]:12 [ memset::c#4 ]
Statement [75] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8 [ bitmap_init::y#2 bitmap_init::yoffs#1 ] ( main:3::bitmap_init:6 [ frame_cnt bitmap_init::y#2 bitmap_init::yoffs#1 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:17 [ bitmap_init::y#2 bitmap_init::y#1 ]
Statement [80] *((const byte*) BGCOL) ← (const byte) WHITE [ frame_cnt ] (  [ frame_cnt ] ) always clobbers reg byte a 
Statement [81] if((byte) 0==(byte) frame_cnt) goto irq::@1 [ ] (  [ ] ) always clobbers reg byte a 
Statement [83] *((const byte*) BGCOL) ← (const byte) BLACK [ ] (  [ ] ) always clobbers reg byte a 
Statement [84] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER [ ] (  [ ] ) always clobbers reg byte a 
Statement [85] return  [ ] (  [ ] ) always clobbers reg byte a reg byte x reg byte y 
Statement [1] (byte) frame_cnt ← (byte) 1 [ frame_cnt ] (  [ frame_cnt ] ) always clobbers reg byte a 
Statement [9] *((const byte*) D011) ← (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3 [ frame_cnt ] ( main:3 [ frame_cnt ] ) always clobbers reg byte a 
Statement [11] *((const byte*) D018) ← (const byte) main::toD0181_return#0 [ frame_cnt ] ( main:3 [ frame_cnt ] ) always clobbers reg byte a 
Statement [14] (word) bitmap_plot::x#0 ← (word) main::x#2 [ frame_cnt main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 ] ( main:3 [ frame_cnt main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 ] ) always clobbers reg byte a 
Statement [17] (word) main::x#1 ← (word) main::x#2 + (word) main::vx#2 [ frame_cnt main::y#2 main::vx#2 main::vy#2 main::x#1 ] ( main:3 [ frame_cnt main::y#2 main::vx#2 main::vy#2 main::x#1 ] ) always clobbers reg byte a 
Statement [18] (byte) main::y#1 ← (byte) main::y#2 + (byte) main::vy#2 [ frame_cnt main::vx#2 main::vy#2 main::x#1 main::y#1 ] ( main:3 [ frame_cnt main::vx#2 main::vy#2 main::x#1 main::y#1 ] ) always clobbers reg byte a 
Statement [19] if((word) main::x#1==(word) $13f) goto main::@5 [ frame_cnt main::vx#2 main::vy#2 main::x#1 main::y#1 ] ( main:3 [ frame_cnt main::vx#2 main::vy#2 main::x#1 main::y#1 ] ) always clobbers reg byte a 
Statement [20] if((word) main::x#1!=(byte) 0) goto main::@3 [ frame_cnt main::vx#2 main::vy#2 main::x#1 main::y#1 ] ( main:3 [ frame_cnt main::vx#2 main::vy#2 main::x#1 main::y#1 ] ) always clobbers reg byte a 
Statement [21] (word) main::vx#1 ← - (word) main::vx#2 [ frame_cnt main::vy#2 main::x#1 main::y#1 main::vx#1 ] ( main:3 [ frame_cnt main::vy#2 main::x#1 main::y#1 main::vx#1 ] ) always clobbers reg byte a 
Statement [23] if((byte) main::y#1==(byte) $c7) goto main::@6 [ frame_cnt main::vy#2 main::x#1 main::y#1 main::vx#6 ] ( main:3 [ frame_cnt main::vy#2 main::x#1 main::y#1 main::vx#6 ] ) always clobbers reg byte a 
Statement [24] if((byte) main::y#1!=(byte) 0) goto main::@4 [ frame_cnt main::vy#2 main::x#1 main::y#1 main::vx#6 ] ( main:3 [ frame_cnt main::vy#2 main::x#1 main::y#1 main::vx#6 ] ) always clobbers reg byte a 
Statement [25] (byte) main::vy#1 ← - (byte) main::vy#2 [ frame_cnt main::x#1 main::y#1 main::vx#6 main::vy#1 ] ( main:3 [ frame_cnt main::x#1 main::y#1 main::vx#6 main::vy#1 ] ) always clobbers reg byte a 
Statement [27] *((const byte*) plots_per_frame + (byte) frame_cnt) ← ++ *((const byte*) plots_per_frame + (byte) frame_cnt) [ frame_cnt main::x#1 main::y#1 main::vx#6 main::vy#8 ] ( main:3 [ frame_cnt main::x#1 main::y#1 main::vx#6 main::vy#8 ] ) always clobbers reg byte x 
Statement [28] (word) bitmap_plot::plotter#0 ← *((const byte*) bitmap_plot_yhi + (byte) bitmap_plot::y#0) w= *((const byte*) bitmap_plot_ylo + (byte) bitmap_plot::y#0) [ bitmap_plot::x#0 bitmap_plot::plotter#0 ] ( main:3::bitmap_plot:16 [ frame_cnt main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::plotter#0 ] ) always clobbers reg byte a 
Statement [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 [ bitmap_plot::x#0 bitmap_plot::plotter#0 bitmap_plot::$1 ] ( main:3::bitmap_plot:16 [ frame_cnt main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::plotter#0 bitmap_plot::$1 ] ) always clobbers reg byte a 
Statement [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 [ bitmap_plot::x#0 bitmap_plot::plotter#1 ] ( main:3::bitmap_plot:16 [ frame_cnt main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::plotter#1 ] ) always clobbers reg byte a 
Statement [31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 [ bitmap_plot::plotter#1 bitmap_plot::$2 ] ( main:3::bitmap_plot:16 [ frame_cnt main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::plotter#1 bitmap_plot::$2 ] ) always clobbers reg byte a 
Statement [32] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte*) bitmap_plot_bit + (byte~) bitmap_plot::$2) [ ] ( main:3::bitmap_plot:16 [ frame_cnt main::x#2 main::y#2 main::vx#2 main::vy#2 ] ) always clobbers reg byte a reg byte y 
Statement [35] *((const byte*) PROCPORT_DDR) ← (const byte) PROCPORT_DDR_MEMORY_MASK [ ] ( main:3::init_irq:12 [ frame_cnt ] ) always clobbers reg byte a 
Statement [36] *((const byte*) PROCPORT) ← (const byte) PROCPORT_RAM_IO [ ] ( main:3::init_irq:12 [ frame_cnt ] ) always clobbers reg byte a 
Statement [37] *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR [ ] ( main:3::init_irq:12 [ frame_cnt ] ) always clobbers reg byte a 
Statement [38] *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) | (byte) $80 [ ] ( main:3::init_irq:12 [ frame_cnt ] ) always clobbers reg byte a 
Statement [39] *((const byte*) RASTER) ← (byte) 0 [ ] ( main:3::init_irq:12 [ frame_cnt ] ) always clobbers reg byte a 
Statement [40] *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER [ ] ( main:3::init_irq:12 [ frame_cnt ] ) always clobbers reg byte a 
Statement [41] *((const void()**) HARDWARE_IRQ) ← &interrupt(HARDWARE_CLOBBER)(void()) irq() [ ] ( main:3::init_irq:12 [ frame_cnt ] ) always clobbers reg byte a 
Statement [50] if((word) memset::num#2<=(byte) 0) goto memset::@return [ memset::num#2 memset::str#3 memset::c#4 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt memset::num#2 memset::str#3 memset::c#4 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt memset::num#2 memset::str#3 memset::c#4 ] ) always clobbers reg byte a 
Statement [51] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 [ memset::str#3 memset::c#4 memset::end#0 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt memset::str#3 memset::c#4 memset::end#0 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt memset::str#3 memset::c#4 memset::end#0 ] ) always clobbers reg byte a 
Statement [52] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3 [ memset::c#4 memset::end#0 memset::dst#4 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt memset::c#4 memset::end#0 memset::dst#4 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt memset::c#4 memset::end#0 memset::dst#4 ] ) always clobbers reg byte a 
Statement [54] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 [ memset::c#4 memset::end#0 memset::dst#2 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt memset::c#4 memset::end#0 memset::dst#2 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt memset::c#4 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a 
Statement [56] *((byte*) memset::dst#2) ← (byte) memset::c#4 [ memset::c#4 memset::end#0 memset::dst#2 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt memset::c#4 memset::end#0 memset::dst#2 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt memset::c#4 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y 
Statement [68] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$7 ] ( main:3::bitmap_init:6 [ frame_cnt bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$7 ] ) always clobbers reg byte a 
Statement [75] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8 [ bitmap_init::y#2 bitmap_init::yoffs#1 ] ( main:3::bitmap_init:6 [ frame_cnt bitmap_init::y#2 bitmap_init::yoffs#1 ] ) always clobbers reg byte a 
Statement [80] *((const byte*) BGCOL) ← (const byte) WHITE [ frame_cnt ] (  [ frame_cnt ] ) always clobbers reg byte a 
Statement [81] if((byte) 0==(byte) frame_cnt) goto irq::@1 [ ] (  [ ] ) always clobbers reg byte a 
Statement [83] *((const byte*) BGCOL) ← (const byte) BLACK [ ] (  [ ] ) always clobbers reg byte a 
Statement [84] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER [ ] (  [ ] ) always clobbers reg byte a 
Statement [85] return  [ ] (  [ ] ) always clobbers reg byte a reg byte x reg byte y 
Potential registers zp[2]:2 [ main::x#2 main::x#1 ] : zp[2]:2 , 
Potential registers zp[1]:4 [ main::y#2 main::y#1 ] : zp[1]:4 , 
Potential registers zp[2]:5 [ main::vx#2 main::vx#6 main::vx#1 ] : zp[2]:5 , 
Potential registers zp[1]:7 [ main::vy#2 main::vy#8 main::vy#1 ] : zp[1]:7 , 
Potential registers zp[2]:8 [ memset::num#2 ] : zp[2]:8 , 
Potential registers zp[2]:10 [ memset::str#3 ] : zp[2]:10 , 
Potential registers zp[1]:12 [ memset::c#4 ] : zp[1]:12 , reg byte x , 
Potential registers zp[2]:13 [ memset::dst#2 memset::dst#4 memset::dst#1 ] : zp[2]:13 , 
Potential registers zp[1]:15 [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] : zp[1]:15 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:16 [ bitmap_init::x#2 bitmap_init::x#1 ] : zp[1]:16 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:17 [ bitmap_init::y#2 bitmap_init::y#1 ] : zp[1]:17 , reg byte x , reg byte y , 
Potential registers zp[2]:18 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] : zp[2]:18 , 
Potential registers zp[1]:20 [ frame_cnt ] : zp[1]:20 , 
Potential registers zp[2]:21 [ bitmap_plot::x#0 ] : zp[2]:21 , 
Potential registers zp[1]:23 [ bitmap_plot::y#0 ] : zp[1]:23 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:24 [ bitmap_plot::plotter#0 ] : zp[2]:24 , 
Potential registers zp[2]:26 [ bitmap_plot::$1 ] : zp[2]:26 , 
Potential registers zp[2]:28 [ bitmap_plot::plotter#1 ] : zp[2]:28 , 
Potential registers zp[1]:30 [ bitmap_plot::$2 ] : zp[1]:30 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:31 [ memset::end#0 ] : zp[2]:31 , 
Potential registers zp[1]:33 [ bitmap_init::$7 ] : zp[1]:33 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:34 [ bitmap_init::$4 ] : zp[1]:34 , reg byte a , reg byte x , reg byte y , reg byte alu , 
Potential registers zp[1]:35 [ bitmap_init::$5 ] : zp[1]:35 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:36 [ bitmap_init::$6 ] : zp[1]:36 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [bitmap_init] 39.88: zp[2]:18 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] 34.83: zp[1]:15 [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] 22: zp[1]:16 [ bitmap_init::x#2 bitmap_init::x#1 ] 22: zp[1]:17 [ bitmap_init::y#2 bitmap_init::y#1 ] 22: zp[1]:34 [ bitmap_init::$4 ] 22: zp[1]:35 [ bitmap_init::$5 ] 22: zp[1]:36 [ bitmap_init::$6 ] 5.5: zp[1]:33 [ bitmap_init::$7 ] 
Uplift Scope [main] 42.17: zp[1]:7 [ main::vy#2 main::vy#8 main::vy#1 ] 33: zp[2]:5 [ main::vx#2 main::vx#6 main::vx#1 ] 12.25: zp[2]:2 [ main::x#2 main::x#1 ] 11: zp[1]:4 [ main::y#2 main::y#1 ] 
Uplift Scope [memset] 41.33: zp[2]:13 [ memset::dst#2 memset::dst#4 memset::dst#1 ] 2.17: zp[2]:31 [ memset::end#0 ] 2: zp[2]:8 [ memset::num#2 ] 1.38: zp[1]:12 [ memset::c#4 ] 0: zp[2]:10 [ memset::str#3 ] 
Uplift Scope [bitmap_plot] 15: zp[1]:23 [ bitmap_plot::y#0 ] 4: zp[2]:26 [ bitmap_plot::$1 ] 4: zp[1]:30 [ bitmap_plot::$2 ] 3: zp[2]:21 [ bitmap_plot::x#0 ] 3: zp[2]:28 [ bitmap_plot::plotter#1 ] 1: zp[2]:24 [ bitmap_plot::plotter#0 ] 
Uplift Scope [] 1.15: zp[1]:20 [ frame_cnt ] 
Uplift Scope [bitmap_clear] 
Uplift Scope [init_irq] 
Uplift Scope [irq] 

Uplifting [bitmap_init] best 4371 combination zp[2]:18 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] reg byte a [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ] reg byte x [ bitmap_init::y#2 bitmap_init::y#1 ] reg byte a [ bitmap_init::$4 ] zp[1]:35 [ bitmap_init::$5 ] zp[1]:36 [ bitmap_init::$6 ] zp[1]:33 [ bitmap_init::$7 ] 
Limited combination testing to 100 combinations of 15360 possible.
Uplifting [main] best 4371 combination zp[1]:7 [ main::vy#2 main::vy#8 main::vy#1 ] zp[2]:5 [ main::vx#2 main::vx#6 main::vx#1 ] zp[2]:2 [ main::x#2 main::x#1 ] zp[1]:4 [ main::y#2 main::y#1 ] 
Uplifting [memset] best 4355 combination zp[2]:13 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:31 [ memset::end#0 ] zp[2]:8 [ memset::num#2 ] reg byte x [ memset::c#4 ] zp[2]:10 [ memset::str#3 ] 
Uplifting [bitmap_plot] best 4318 combination reg byte x [ bitmap_plot::y#0 ] zp[2]:26 [ bitmap_plot::$1 ] reg byte a [ bitmap_plot::$2 ] zp[2]:21 [ bitmap_plot::x#0 ] zp[2]:28 [ bitmap_plot::plotter#1 ] zp[2]:24 [ bitmap_plot::plotter#0 ] 
Uplifting [] best 4318 combination zp[1]:20 [ frame_cnt ] 
Uplifting [bitmap_clear] best 4318 combination 
Uplifting [init_irq] best 4318 combination 
Uplifting [irq] best 4318 combination 
Attempting to uplift remaining variables inzp[1]:7 [ main::vy#2 main::vy#8 main::vy#1 ]
Uplifting [main] best 4318 combination zp[1]:7 [ main::vy#2 main::vy#8 main::vy#1 ] 
Attempting to uplift remaining variables inzp[1]:35 [ bitmap_init::$5 ]
Uplifting [bitmap_init] best 4258 combination reg byte a [ bitmap_init::$5 ] 
Attempting to uplift remaining variables inzp[1]:36 [ bitmap_init::$6 ]
Uplifting [bitmap_init] best 4198 combination reg byte a [ bitmap_init::$6 ] 
Attempting to uplift remaining variables inzp[1]:4 [ main::y#2 main::y#1 ]
Uplifting [main] best 4198 combination zp[1]:4 [ main::y#2 main::y#1 ] 
Attempting to uplift remaining variables inzp[1]:33 [ bitmap_init::$7 ]
Uplifting [bitmap_init] best 4198 combination zp[1]:33 [ bitmap_init::$7 ] 
Attempting to uplift remaining variables inzp[1]:20 [ frame_cnt ]
Uplifting [] best 4198 combination zp[1]:20 [ frame_cnt ] 
Coalescing zero page register [ zp[2]:2 [ main::x#2 main::x#1 ] ] with [ zp[2]:21 [ bitmap_plot::x#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:8 [ memset::num#2 ] ] with [ zp[2]:31 [ memset::end#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:10 [ memset::str#3 ] ] with [ zp[2]:13 [ memset::dst#2 memset::dst#4 memset::dst#1 ] ] - score: 1
Coalescing zero page register [ zp[2]:24 [ bitmap_plot::plotter#0 ] ] with [ zp[2]:28 [ bitmap_plot::plotter#1 ] ] - score: 1
Coalescing zero page register [ zp[2]:8 [ memset::num#2 memset::end#0 ] ] with [ zp[2]:2 [ main::x#2 main::x#1 bitmap_plot::x#0 ] ]
Coalescing zero page register [ zp[2]:10 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ] ] with [ zp[2]:5 [ main::vx#2 main::vx#6 main::vx#1 ] ]
Coalescing zero page register [ zp[2]:24 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 ] ] with [ zp[2]:18 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] ]
Coalescing zero page register [ zp[1]:33 [ bitmap_init::$7 ] ] with [ zp[1]:4 [ main::y#2 main::y#1 ] ]
Allocated (was zp[1]:7) zp[1]:2 [ main::vy#2 main::vy#8 main::vy#1 ]
Allocated (was zp[2]:8) zp[2]:3 [ memset::num#2 memset::end#0 main::x#2 main::x#1 bitmap_plot::x#0 ]
Allocated (was zp[2]:10) zp[2]:5 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 main::vx#2 main::vx#6 main::vx#1 ]
Allocated (was zp[1]:20) zp[1]:7 [ frame_cnt ]
Allocated (was zp[2]:24) zp[2]:8 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ]
Allocated (was zp[2]:26) zp[2]:10 [ bitmap_plot::$1 ]
Allocated (was zp[1]:33) zp[1]:12 [ bitmap_init::$7 main::y#2 main::y#1 ]
Interrupt procedure irq clobbers ACNZ
Removing interrupt register storage stx regx+1 in CHU154 entry interrupt(HARDWARE_CLOBBER)
Removing interrupt register storage sty regy+1 in CHU154 entry interrupt(HARDWARE_CLOBBER)
Removing interrupt register storage regx: in CHU163 [85] return  - exit interrupt(HARDWARE_CLOBBER)
Removing interrupt register storage ldx #00 in CHU163 [85] return  - exit interrupt(HARDWARE_CLOBBER)
Removing interrupt register storage regy: in CHU163 [85] return  - exit interrupt(HARDWARE_CLOBBER)
Removing interrupt register storage ldy #00 in CHU163 [85] return  - exit interrupt(HARDWARE_CLOBBER)

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots simple plots
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  // Processor port data direction register
  .label PROCPORT_DDR = 0
  // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written
  .const PROCPORT_DDR_MEMORY_MASK = 7
  // Processor Port Register controlling RAM/ROM configuration and the datasette
  .label PROCPORT = 1
  // RAM in $A000, $E000 I/O in $D000
  .const PROCPORT_RAM_IO = 5
  .label RASTER = $d012
  .label BGCOL = $d021
  .label VIC_CONTROL = $d011
  .label D011 = $d011
  .const VIC_BMM = $20
  .const VIC_DEN = $10
  .const VIC_RSEL = 8
  .label D018 = $d018
  // VIC II IRQ Status Register
  .label IRQ_STATUS = $d019
  // VIC II IRQ Enable Register
  .label IRQ_ENABLE = $d01a
  // Bits for the IRQ Status/Enable Registers
  .const IRQ_RASTER = 1
  // CIA#1 Interrupt Status & Control Register
  .label CIA1_INTERRUPT = $dc0d
  // Value that disables all CIA interrupts when stored to the CIA Interrupt registers
  .const CIA_INTERRUPT_CLEAR = $7f
  // The vector used when the HARDWARE serves IRQ interrupts
  .label HARDWARE_IRQ = $fffe
  // The colors of the C64
  .const BLACK = 0
  .const WHITE = 1
  .label BITMAP = $2000
  .label SCREEN = $400
  .label frame_cnt = 7
  // @begin
__bbegin:
  jmp __b1
  // @1
__b1:
  // [1] (byte) frame_cnt ← (byte) 1 -- vbuz1=vbuc1 
  // Counts frames - updated by the IRQ
  lda #1
  sta.z frame_cnt
  // [2] phi from @1 to @2 [phi:@1->@2]
__b2_from___b1:
  jmp __b2
  // @2
__b2:
  // [3] call main 
  // [5] phi from @2 to main [phi:@2->main]
main_from___b2:
  jsr main
  // [4] phi from @2 to @end [phi:@2->@end]
__bend_from___b2:
  jmp __bend
  // @end
__bend:
  // main
main: {
    .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f
    .label x = 3
    .label y = $c
    .label vx = 5
    .label vy = 2
    // [6] call bitmap_init 
    // [58] phi from main to bitmap_init [phi:main->bitmap_init]
  bitmap_init_from_main:
    jsr bitmap_init
    // [7] phi from main to main::@8 [phi:main->main::@8]
  __b8_from_main:
    jmp __b8
    // main::@8
  __b8:
    // [8] call bitmap_clear 
    // [44] phi from main::@8 to bitmap_clear [phi:main::@8->bitmap_clear]
  bitmap_clear_from___b8:
    jsr bitmap_clear
    jmp __b9
    // main::@9
  __b9:
    // [9] *((const byte*) D011) ← (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3 -- _deref_pbuc1=vbuc2 
    lda #VIC_BMM|VIC_DEN|VIC_RSEL|3
    sta D011
    // [10] phi from main::@9 to main::toD0181 [phi:main::@9->main::toD0181]
  toD0181_from___b9:
    jmp toD0181
    // main::toD0181
  toD0181:
    jmp __b7
    // main::@7
  __b7:
    // [11] *((const byte*) D018) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0181_return
    sta D018
    // [12] call init_irq 
    jsr init_irq
    // [13] phi from main::@7 to main::@1 [phi:main::@7->main::@1]
  __b1_from___b7:
    // [13] phi (byte) main::vy#2 = (byte) 1 [phi:main::@7->main::@1#0] -- vbuz1=vbuc1 
    lda #1
    sta.z vy
    // [13] phi (word) main::vx#2 = (word) 1 [phi:main::@7->main::@1#1] -- vwuz1=vwuc1 
    lda #<1
    sta.z vx
    lda #>1
    sta.z vx+1
    // [13] phi (byte) main::y#2 = (byte) 0 [phi:main::@7->main::@1#2] -- vbuz1=vbuc1 
    lda #0
    sta.z y
    // [13] phi (word) main::x#2 = (word) 0 [phi:main::@7->main::@1#3] -- vwuz1=vwuc1 
    lda #<0
    sta.z x
    lda #>0
    sta.z x+1
    jmp __b1
    // main::@1
  __b1:
    jmp __b2
    // main::@2
  __b2:
    // [14] (word) bitmap_plot::x#0 ← (word) main::x#2
    // [15] (byte) bitmap_plot::y#0 ← (byte) main::y#2 -- vbuxx=vbuz1 
    ldx.z y
    // [16] call bitmap_plot 
    jsr bitmap_plot
    jmp __b10
    // main::@10
  __b10:
    // [17] (word) main::x#1 ← (word) main::x#2 + (word) main::vx#2 -- vwuz1=vwuz1_plus_vwuz2 
    lda.z x
    clc
    adc.z vx
    sta.z x
    lda.z x+1
    adc.z vx+1
    sta.z x+1
    // [18] (byte) main::y#1 ← (byte) main::y#2 + (byte) main::vy#2 -- vbuz1=vbuz1_plus_vbuz2 
    lda.z y
    clc
    adc.z vy
    sta.z y
    // [19] if((word) main::x#1==(word) $13f) goto main::@5 -- vwuz1_eq_vwuc1_then_la1 
    lda.z x
    cmp #<$13f
    bne !+
    lda.z x+1
    cmp #>$13f
    beq __b5
  !:
    jmp __b11
    // main::@11
  __b11:
    // [20] if((word) main::x#1!=(byte) 0) goto main::@3 -- vwuz1_neq_0_then_la1 
    lda.z x
    bne __b3_from___b11
    lda.z x+1
    bne __b3_from___b11
    jmp __b5
    // main::@5
  __b5:
    // [21] (word) main::vx#1 ← - (word) main::vx#2 -- vwuz1=_neg_vwuz1 
    sec
    lda #0
    sbc.z vx
    sta.z vx
    lda #0
    sbc.z vx+1
    sta.z vx+1
    // [22] phi from main::@11 main::@5 to main::@3 [phi:main::@11/main::@5->main::@3]
  __b3_from___b11:
  __b3_from___b5:
    // [22] phi (word) main::vx#6 = (word) main::vx#2 [phi:main::@11/main::@5->main::@3#0] -- register_copy 
    jmp __b3
    // main::@3
  __b3:
    // [23] if((byte) main::y#1==(byte) $c7) goto main::@6 -- vbuz1_eq_vbuc1_then_la1 
    lda #$c7
    cmp.z y
    beq __b6
    jmp __b12
    // main::@12
  __b12:
    // [24] if((byte) main::y#1!=(byte) 0) goto main::@4 -- vbuz1_neq_0_then_la1 
    lda.z y
    cmp #0
    bne __b4_from___b12
    jmp __b6
    // main::@6
  __b6:
    // [25] (byte) main::vy#1 ← - (byte) main::vy#2 -- vbuz1=_neg_vbuz1 
    lda.z vy
    eor #$ff
    clc
    adc #1
    sta.z vy
    // [26] phi from main::@12 main::@6 to main::@4 [phi:main::@12/main::@6->main::@4]
  __b4_from___b12:
  __b4_from___b6:
    // [26] phi (byte) main::vy#8 = (byte) main::vy#2 [phi:main::@12/main::@6->main::@4#0] -- register_copy 
    jmp __b4
    // main::@4
  __b4:
    // [27] *((const byte*) plots_per_frame + (byte) frame_cnt) ← ++ *((const byte*) plots_per_frame + (byte) frame_cnt) -- pbuc1_derefidx_vbuz1=_inc_pbuc1_derefidx_vbuz1 
    ldx.z frame_cnt
    inc plots_per_frame,x
    // [13] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
  __b1_from___b4:
    // [13] phi (byte) main::vy#2 = (byte) main::vy#8 [phi:main::@4->main::@1#0] -- register_copy 
    // [13] phi (word) main::vx#2 = (word) main::vx#6 [phi:main::@4->main::@1#1] -- register_copy 
    // [13] phi (byte) main::y#2 = (byte) main::y#1 [phi:main::@4->main::@1#2] -- register_copy 
    // [13] phi (word) main::x#2 = (word) main::x#1 [phi:main::@4->main::@1#3] -- register_copy 
    jmp __b1
}
  // bitmap_plot
// Plot a single dot in the bitmap
// bitmap_plot(word zp(3) x, byte register(X) y)
bitmap_plot: {
    .label __1 = $a
    .label plotter = 8
    .label x = 3
    // [28] (word) bitmap_plot::plotter#0 ← *((const byte*) bitmap_plot_yhi + (byte) bitmap_plot::y#0) w= *((const byte*) bitmap_plot_ylo + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx 
    lda bitmap_plot_yhi,x
    sta.z plotter+1
    lda bitmap_plot_ylo,x
    sta.z plotter
    // [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 -- vwuz1=vwuz2_band_vwuc1 
    lda.z x
    and #<$fff8
    sta.z __1
    lda.z x+1
    and #>$fff8
    sta.z __1+1
    // [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 -- pbuz1=pbuz1_plus_vwuz2 
    lda.z plotter
    clc
    adc.z __1
    sta.z plotter
    lda.z plotter+1
    adc.z __1+1
    sta.z plotter+1
    // [31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 -- vbuaa=_lo_vwuz1 
    lda.z x
    // [32] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte*) bitmap_plot_bit + (byte~) bitmap_plot::$2) -- _deref_pbuz1=_deref_pbuz1_bor_pbuc1_derefidx_vbuaa 
    tay
    lda bitmap_plot_bit,y
    ldy #0
    ora (plotter),y
    ldy #0
    sta (plotter),y
    jmp __breturn
    // bitmap_plot::@return
  __breturn:
    // [33] return 
    rts
}
  // init_irq
// Setup the IRQ
init_irq: {
    // asm { sei  }
    sei
    // [35] *((const byte*) PROCPORT_DDR) ← (const byte) PROCPORT_DDR_MEMORY_MASK -- _deref_pbuc1=vbuc2 
    // Disable kernal & basic
    lda #PROCPORT_DDR_MEMORY_MASK
    sta PROCPORT_DDR
    // [36] *((const byte*) PROCPORT) ← (const byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2 
    lda #PROCPORT_RAM_IO
    sta PROCPORT
    // [37] *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 
    // Disable CIA 1 Timer IRQ
    lda #CIA_INTERRUPT_CLEAR
    sta CIA1_INTERRUPT
    // [38] *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) | (byte) $80 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 
    // Set raster line to $100
    lda #$80
    ora VIC_CONTROL
    sta VIC_CONTROL
    // [39] *((const byte*) RASTER) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta RASTER
    // [40] *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 
    // Enable Raster Interrupt
    lda #IRQ_RASTER
    sta IRQ_ENABLE
    // [41] *((const void()**) HARDWARE_IRQ) ← &interrupt(HARDWARE_CLOBBER)(void()) irq() -- _deref_pptc1=pprc2 
    // Set the IRQ routine
    lda #<irq
    sta HARDWARE_IRQ
    lda #>irq
    sta HARDWARE_IRQ+1
    // asm { cli  }
    cli
    jmp __breturn
    // init_irq::@return
  __breturn:
    // [43] return 
    rts
}
  // bitmap_clear
// Clear all graphics on the bitmap
// bgcol - the background color to fill the screen with
// fgcol - the foreground color to fill the screen with
bitmap_clear: {
    .const col = WHITE*$10
    // [45] call memset 
    // [49] phi from bitmap_clear to memset [phi:bitmap_clear->memset]
  memset_from_bitmap_clear:
    // [49] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuxx=vbuc1 
    ldx #col
    // [49] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 
    lda #<SCREEN
    sta.z memset.str
    lda #>SCREEN
    sta.z memset.str+1
    // [49] phi (word) memset::num#2 = (word) $3e8 [phi:bitmap_clear->memset#2] -- vwuz1=vwuc1 
    lda #<$3e8
    sta.z memset.num
    lda #>$3e8
    sta.z memset.num+1
    jsr memset
    // [46] phi from bitmap_clear to bitmap_clear::@1 [phi:bitmap_clear->bitmap_clear::@1]
  __b1_from_bitmap_clear:
    jmp __b1
    // bitmap_clear::@1
  __b1:
    // [47] call memset 
    // [49] phi from bitmap_clear::@1 to memset [phi:bitmap_clear::@1->memset]
  memset_from___b1:
    // [49] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuxx=vbuc1 
    ldx #0
    // [49] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 
    lda #<BITMAP
    sta.z memset.str
    lda #>BITMAP
    sta.z memset.str+1
    // [49] phi (word) memset::num#2 = (word) $1f40 [phi:bitmap_clear::@1->memset#2] -- vwuz1=vwuc1 
    lda #<$1f40
    sta.z memset.num
    lda #>$1f40
    sta.z memset.num+1
    jsr memset
    jmp __breturn
    // bitmap_clear::@return
  __breturn:
    // [48] return 
    rts
}
  // memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zp(5) str, byte register(X) c, word zp(3) num)
memset: {
    .label end = 3
    .label dst = 5
    .label num = 3
    .label str = 5
    // [50] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1 
    lda.z num
    bne !+
    lda.z num+1
    beq __breturn
  !:
    jmp __b1
    // memset::@1
  __b1:
    // [51] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz1 
    lda.z end
    clc
    adc.z str
    sta.z end
    lda.z end+1
    adc.z str+1
    sta.z end+1
    // [52] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3
    // [53] phi from memset::@1 memset::@3 to memset::@2 [phi:memset::@1/memset::@3->memset::@2]
  __b2_from___b1:
  __b2_from___b3:
    // [53] phi (byte*) memset::dst#2 = (byte*) memset::dst#4 [phi:memset::@1/memset::@3->memset::@2#0] -- register_copy 
    jmp __b2
    // memset::@2
  __b2:
    // [54] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 -- pbuz1_neq_pbuz2_then_la1 
    lda.z dst+1
    cmp.z end+1
    bne __b3
    lda.z dst
    cmp.z end
    bne __b3
    jmp __breturn
    // memset::@return
  __breturn:
    // [55] return 
    rts
    // memset::@3
  __b3:
    // [56] *((byte*) memset::dst#2) ← (byte) memset::c#4 -- _deref_pbuz1=vbuxx 
    txa
    ldy #0
    sta (dst),y
    // [57] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 
    inc.z dst
    bne !+
    inc.z dst+1
  !:
    jmp __b2_from___b3
}
  // bitmap_init
// Initialize bitmap plotting tables
bitmap_init: {
    .label __7 = $c
    .label yoffs = 8
    // [59] phi from bitmap_init to bitmap_init::@1 [phi:bitmap_init->bitmap_init::@1]
  __b1_from_bitmap_init:
    // [59] phi (byte) bitmap_init::x#2 = (byte) 0 [phi:bitmap_init->bitmap_init::@1#0] -- vbuxx=vbuc1 
    ldx #0
    // [59] phi (byte) bitmap_init::bits#3 = (byte) $80 [phi:bitmap_init->bitmap_init::@1#1] -- vbuaa=vbuc1 
    lda #$80
    jmp __b1
    // [59] phi from bitmap_init::@2 to bitmap_init::@1 [phi:bitmap_init::@2->bitmap_init::@1]
  __b1_from___b2:
    // [59] phi (byte) bitmap_init::x#2 = (byte) bitmap_init::x#1 [phi:bitmap_init::@2->bitmap_init::@1#0] -- register_copy 
    // [59] phi (byte) bitmap_init::bits#3 = (byte) bitmap_init::bits#4 [phi:bitmap_init::@2->bitmap_init::@1#1] -- register_copy 
    jmp __b1
    // bitmap_init::@1
  __b1:
    // [60] *((const byte*) bitmap_plot_bit + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta bitmap_plot_bit,x
    // [61] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1 -- vbuaa=vbuaa_ror_1 
    lsr
    // [62] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6 -- vbuaa_neq_0_then_la1 
    cmp #0
    bne __b6_from___b1
    // [64] phi from bitmap_init::@1 to bitmap_init::@2 [phi:bitmap_init::@1->bitmap_init::@2]
  __b2_from___b1:
    // [64] phi (byte) bitmap_init::bits#4 = (byte) $80 [phi:bitmap_init::@1->bitmap_init::@2#0] -- vbuaa=vbuc1 
    lda #$80
    jmp __b2
    // [63] phi from bitmap_init::@1 to bitmap_init::@6 [phi:bitmap_init::@1->bitmap_init::@6]
  __b6_from___b1:
    jmp __b6
    // bitmap_init::@6
  __b6:
    // [64] phi from bitmap_init::@6 to bitmap_init::@2 [phi:bitmap_init::@6->bitmap_init::@2]
  __b2_from___b6:
    // [64] phi (byte) bitmap_init::bits#4 = (byte) bitmap_init::bits#1 [phi:bitmap_init::@6->bitmap_init::@2#0] -- register_copy 
    jmp __b2
    // bitmap_init::@2
  __b2:
    // [65] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2 -- vbuxx=_inc_vbuxx 
    inx
    // [66] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne __b1_from___b2
    // [67] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3]
  __b3_from___b2:
    // [67] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 
    lda #<BITMAP
    sta.z yoffs
    lda #>BITMAP
    sta.z yoffs+1
    // [67] phi (byte) bitmap_init::y#2 = (byte) 0 [phi:bitmap_init::@2->bitmap_init::@3#1] -- vbuxx=vbuc1 
    ldx #0
    jmp __b3
    // [67] phi from bitmap_init::@4 to bitmap_init::@3 [phi:bitmap_init::@4->bitmap_init::@3]
  __b3_from___b4:
    // [67] phi (byte*) bitmap_init::yoffs#2 = (byte*) bitmap_init::yoffs#4 [phi:bitmap_init::@4->bitmap_init::@3#0] -- register_copy 
    // [67] phi (byte) bitmap_init::y#2 = (byte) bitmap_init::y#1 [phi:bitmap_init::@4->bitmap_init::@3#1] -- register_copy 
    jmp __b3
    // bitmap_init::@3
  __b3:
    // [68] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 -- vbuz1=vbuxx_band_vbuc1 
    lda #7
    sax.z __7
    // [69] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 -- vbuaa=_lo_pbuz1 
    lda.z yoffs
    // [70] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4 -- vbuaa=vbuz1_bor_vbuaa 
    ora.z __7
    // [71] *((const byte*) bitmap_plot_ylo + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta bitmap_plot_ylo,x
    // [72] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2 -- vbuaa=_hi_pbuz1 
    lda.z yoffs+1
    // [73] *((const byte*) bitmap_plot_yhi + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta bitmap_plot_yhi,x
    // [74] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@4 -- vbuz1_neq_vbuc1_then_la1 
    lda #7
    cmp.z __7
    bne __b4_from___b3
    jmp __b5
    // bitmap_init::@5
  __b5:
    // [75] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8 -- pbuz1=pbuz1_plus_vwuc1 
    clc
    lda.z yoffs
    adc #<$28*8
    sta.z yoffs
    lda.z yoffs+1
    adc #>$28*8
    sta.z yoffs+1
    // [76] phi from bitmap_init::@3 bitmap_init::@5 to bitmap_init::@4 [phi:bitmap_init::@3/bitmap_init::@5->bitmap_init::@4]
  __b4_from___b3:
  __b4_from___b5:
    // [76] phi (byte*) bitmap_init::yoffs#4 = (byte*) bitmap_init::yoffs#2 [phi:bitmap_init::@3/bitmap_init::@5->bitmap_init::@4#0] -- register_copy 
    jmp __b4
    // bitmap_init::@4
  __b4:
    // [77] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2 -- vbuxx=_inc_vbuxx 
    inx
    // [78] if((byte) bitmap_init::y#1!=(byte) 0) goto bitmap_init::@3 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne __b3_from___b4
    jmp __breturn
    // bitmap_init::@return
  __breturn:
    // [79] return 
    rts
}
  // irq
// Interrupt Routine counting frames
irq: {
    // entry interrupt(HARDWARE_CLOBBER)
    sta rega+1
    // [80] *((const byte*) BGCOL) ← (const byte) WHITE -- _deref_pbuc1=vbuc2 
    lda #WHITE
    sta BGCOL
    // [81] if((byte) 0==(byte) frame_cnt) goto irq::@1 -- vbuc1_eq_vbuz1_then_la1 
    lda #0
    cmp.z frame_cnt
    beq __b1
    jmp __b2
    // irq::@2
  __b2:
    // [82] (byte) frame_cnt ← ++ (byte) frame_cnt -- vbuz1=_inc_vbuz1 
    inc.z frame_cnt
    jmp __b1
    // irq::@1
  __b1:
    // [83] *((const byte*) BGCOL) ← (const byte) BLACK -- _deref_pbuc1=vbuc2 
    lda #BLACK
    sta BGCOL
    // [84] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 
    // Acknowledge the IRQ
    lda #IRQ_RASTER
    sta IRQ_STATUS
    jmp __breturn
    // irq::@return
  __breturn:
    // [85] return  - exit interrupt(HARDWARE_CLOBBER)
  rega:
    lda #00
    rti
}
  // File Data
  // Tables for the plotter - initialized by calling bitmap_init();
  bitmap_plot_ylo: .fill $100, 0
  bitmap_plot_yhi: .fill $100, 0
  bitmap_plot_bit: .fill $100, 0
  plots_per_frame: .fill $100, 0

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __bend
Removing instruction jmp __b8
Removing instruction jmp __b9
Removing instruction jmp toD0181
Removing instruction jmp __b7
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b10
Removing instruction jmp __b11
Removing instruction jmp __b5
Removing instruction jmp __b3
Removing instruction jmp __b12
Removing instruction jmp __b6
Removing instruction jmp __b4
Removing instruction jmp __breturn
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __b6
Removing instruction jmp __b2
Removing instruction jmp __b3
Removing instruction jmp __b5
Removing instruction jmp __b4
Removing instruction jmp __breturn
Removing instruction jmp __b2
Removing instruction jmp __b1
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #<1
Removing instruction lda #0
Removing instruction lda #<0
Removing instruction lda #>0
Removing instruction ldy #0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label __bbegin with __b1
Replacing label __b3_from___b11 with __b3
Replacing label __b3_from___b11 with __b3
Replacing label __b4_from___b12 with __b4
Replacing label __b1 with __b2
Replacing label __b2_from___b3 with __b2
Replacing label __b6_from___b1 with __b2
Replacing label __b1_from___b2 with __b1
Replacing label __b4_from___b3 with __b4
Replacing label __b3_from___b4 with __b3
Removing instruction __bbegin:
Removing instruction __b2_from___b1:
Removing instruction main_from___b2:
Removing instruction __bend_from___b2:
Removing instruction __b8_from_main:
Removing instruction bitmap_clear_from___b8:
Removing instruction toD0181_from___b9:
Removing instruction toD0181:
Removing instruction __b1:
Removing instruction __b3_from___b11:
Removing instruction __b3_from___b5:
Removing instruction __b4_from___b12:
Removing instruction __b4_from___b6:
Removing instruction __b1_from_bitmap_clear:
Removing instruction memset_from___b1:
Removing instruction __b2_from___b1:
Removing instruction __b2_from___b3:
Removing instruction __b1_from___b2:
Removing instruction __b6_from___b1:
Removing instruction __b6:
Removing instruction __b2_from___b6:
Removing instruction __b3_from___b4:
Removing instruction __b4_from___b3:
Removing instruction __b4_from___b5:
Removing instruction __breturn:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __b2:
Removing instruction __bend:
Removing instruction bitmap_init_from_main:
Removing instruction __b8:
Removing instruction __b9:
Removing instruction __b7:
Removing instruction __b1_from___b7:
Removing instruction __b10:
Removing instruction __b11:
Removing instruction __b12:
Removing instruction __b1_from___b4:
Removing instruction __breturn:
Removing instruction __breturn:
Removing instruction memset_from_bitmap_clear:
Removing instruction __b1:
Removing instruction __breturn:
Removing instruction __b1:
Removing instruction __b1_from_bitmap_init:
Removing instruction __b2_from___b1:
Removing instruction __b3_from___b2:
Removing instruction __b5:
Removing instruction __breturn:
Removing instruction __b2:
Succesful ASM optimization Pass5UnusedLabelElimination
Adding RTS to root block 
Succesful ASM optimization Pass5AddMainRts
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b3
Succesful ASM optimization Pass5NextJumpElimination

FINAL SYMBOL TABLE
(label) @1
(label) @2
(label) @begin
(label) @end
(const byte*) BGCOL = (byte*) 53281
(const byte*) BITMAP = (byte*) 8192
(const byte) BLACK = (byte) 0
(const byte*) CIA1_INTERRUPT = (byte*) 56333
(const byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const byte*) D011 = (byte*) 53265
(const byte*) D018 = (byte*) 53272
(const void()**) HARDWARE_IRQ = (void()**) 65534
(const byte*) IRQ_ENABLE = (byte*) 53274
(const byte) IRQ_RASTER = (byte) 1
(const byte*) IRQ_STATUS = (byte*) 53273
(const byte*) PROCPORT = (byte*) 1
(const byte*) PROCPORT_DDR = (byte*) 0
(const byte) PROCPORT_DDR_MEMORY_MASK = (byte) 7
(const byte) PROCPORT_RAM_IO = (byte) 5
(const byte*) RASTER = (byte*) 53266
(const byte*) SCREEN = (byte*) 1024
(const byte) VIC_BMM = (byte) $20
(const byte*) VIC_CONTROL = (byte*) 53265
(const byte) VIC_DEN = (byte) $10
(const byte) VIC_RSEL = (byte) 8
(const byte) WHITE = (byte) 1
(void()) bitmap_clear((byte) bitmap_clear::bgcol , (byte) bitmap_clear::fgcol)
(label) bitmap_clear::@1
(label) bitmap_clear::@return
(byte) bitmap_clear::bgcol
(byte) bitmap_clear::col
(const byte) bitmap_clear::col#0 col = (const byte) WHITE*(byte) $10
(byte) bitmap_clear::fgcol
(byte*) bitmap_gfx
(void()) bitmap_init((byte*) bitmap_init::gfx , (byte*) bitmap_init::screen)
(byte~) bitmap_init::$4 reg byte a 22.0
(byte~) bitmap_init::$5 reg byte a 22.0
(byte~) bitmap_init::$6 reg byte a 22.0
(byte~) bitmap_init::$7 zp[1]:12 5.5
(label) bitmap_init::@1
(label) bitmap_init::@2
(label) bitmap_init::@3
(label) bitmap_init::@4
(label) bitmap_init::@5
(label) bitmap_init::@6
(label) bitmap_init::@return
(byte) bitmap_init::bits
(byte) bitmap_init::bits#1 reg byte a 11.0
(byte) bitmap_init::bits#3 reg byte a 16.5
(byte) bitmap_init::bits#4 reg byte a 7.333333333333333
(byte*) bitmap_init::gfx
(byte*) bitmap_init::screen
(byte) bitmap_init::x
(byte) bitmap_init::x#1 reg byte x 16.5
(byte) bitmap_init::x#2 reg byte x 5.5
(byte) bitmap_init::y
(byte) bitmap_init::y#1 reg byte x 16.5
(byte) bitmap_init::y#2 reg byte x 5.5
(byte*) bitmap_init::yoffs
(byte*) bitmap_init::yoffs#1 yoffs zp[2]:8 22.0
(byte*) bitmap_init::yoffs#2 yoffs zp[2]:8 6.875
(byte*) bitmap_init::yoffs#4 yoffs zp[2]:8 11.0
(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y)
(word~) bitmap_plot::$1 zp[2]:10 4.0
(byte~) bitmap_plot::$2 reg byte a 4.0
(label) bitmap_plot::@return
(byte*) bitmap_plot::plotter
(word) bitmap_plot::plotter#0 plotter zp[2]:8 1.0
(byte*) bitmap_plot::plotter#1 plotter zp[2]:8 3.0
(word) bitmap_plot::x
(word) bitmap_plot::x#0 x zp[2]:3 3.0
(byte) bitmap_plot::y
(byte) bitmap_plot::y#0 reg byte x 15.0
(const byte*) bitmap_plot_bit[(number) $100]  = { fill( $100, 0) }
(const byte*) bitmap_plot_yhi[(number) $100]  = { fill( $100, 0) }
(const byte*) bitmap_plot_ylo[(number) $100]  = { fill( $100, 0) }
(byte*) bitmap_screen
(byte) frame_cnt loadstore zp[1]:7 1.1538461538461537
(void()) init_irq()
(label) init_irq::@return
interrupt(HARDWARE_CLOBBER)(void()) irq()
(label) irq::@1
(label) irq::@2
(label) irq::@return
(void()) main()
(label) main::@1
(label) main::@10
(label) main::@11
(label) main::@12
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@8
(label) main::@9
(label) main::toD0181
(byte*) main::toD0181_gfx
(byte) main::toD0181_return
(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f
(byte*) main::toD0181_screen
(word) main::vx
(word) main::vx#1 vx zp[2]:5 22.0
(word) main::vx#2 vx zp[2]:5 5.5
(word) main::vx#6 vx zp[2]:5 5.5
(byte) main::vy
(byte) main::vy#1 vy zp[1]:2 22.0
(byte) main::vy#2 vy zp[1]:2 3.6666666666666665
(byte) main::vy#8 vy zp[1]:2 16.5
(word) main::x
(word) main::x#1 x zp[2]:3 4.0
(word) main::x#2 x zp[2]:3 8.25
(byte) main::y
(byte) main::y#1 y zp[1]:12 4.4
(byte) main::y#2 y zp[1]:12 6.6000000000000005
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@2
(label) memset::@3
(label) memset::@return
(byte) memset::c
(byte) memset::c#4 reg byte x 1.375
(byte*) memset::dst
(byte*) memset::dst#1 dst zp[2]:5 22.0
(byte*) memset::dst#2 dst zp[2]:5 15.333333333333332
(byte*) memset::dst#4 dst zp[2]:5 4.0
(byte*) memset::end
(byte*) memset::end#0 end zp[2]:3 2.1666666666666665
(word) memset::num
(word) memset::num#2 num zp[2]:3 2.0
(void*) memset::return
(void*) memset::str
(void*) memset::str#3 str zp[2]:5
(const byte*) plots_per_frame[(number) $100]  = { fill( $100, 0) }

zp[1]:2 [ main::vy#2 main::vy#8 main::vy#1 ]
zp[2]:3 [ memset::num#2 memset::end#0 main::x#2 main::x#1 bitmap_plot::x#0 ]
zp[2]:5 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 main::vx#2 main::vx#6 main::vx#1 ]
reg byte x [ memset::c#4 ]
reg byte a [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ]
reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ]
reg byte x [ bitmap_init::y#2 bitmap_init::y#1 ]
zp[1]:7 [ frame_cnt ]
reg byte x [ bitmap_plot::y#0 ]
zp[2]:8 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ]
zp[2]:10 [ bitmap_plot::$1 ]
reg byte a [ bitmap_plot::$2 ]
zp[1]:12 [ bitmap_init::$7 main::y#2 main::y#1 ]
reg byte a [ bitmap_init::$4 ]
reg byte a [ bitmap_init::$5 ]
reg byte a [ bitmap_init::$6 ]


FINAL ASSEMBLER
Score: 3177

  // File Comments
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots simple plots
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__b1)
.pc = $80d "Program"
  // Global Constants & labels
  // Processor port data direction register
  .label PROCPORT_DDR = 0
  // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written
  .const PROCPORT_DDR_MEMORY_MASK = 7
  // Processor Port Register controlling RAM/ROM configuration and the datasette
  .label PROCPORT = 1
  // RAM in $A000, $E000 I/O in $D000
  .const PROCPORT_RAM_IO = 5
  .label RASTER = $d012
  .label BGCOL = $d021
  .label VIC_CONTROL = $d011
  .label D011 = $d011
  .const VIC_BMM = $20
  .const VIC_DEN = $10
  .const VIC_RSEL = 8
  .label D018 = $d018
  // VIC II IRQ Status Register
  .label IRQ_STATUS = $d019
  // VIC II IRQ Enable Register
  .label IRQ_ENABLE = $d01a
  // Bits for the IRQ Status/Enable Registers
  .const IRQ_RASTER = 1
  // CIA#1 Interrupt Status & Control Register
  .label CIA1_INTERRUPT = $dc0d
  // Value that disables all CIA interrupts when stored to the CIA Interrupt registers
  .const CIA_INTERRUPT_CLEAR = $7f
  // The vector used when the HARDWARE serves IRQ interrupts
  .label HARDWARE_IRQ = $fffe
  // The colors of the C64
  .const BLACK = 0
  .const WHITE = 1
  .label BITMAP = $2000
  .label SCREEN = $400
  .label frame_cnt = 7
  // @begin
  // @1
__b1:
  // frame_cnt = 1
  // [1] (byte) frame_cnt ← (byte) 1 -- vbuz1=vbuc1 
  // Counts frames - updated by the IRQ
  lda #1
  sta.z frame_cnt
  // [2] phi from @1 to @2 [phi:@1->@2]
  // @2
  // [3] call main 
  // [5] phi from @2 to main [phi:@2->main]
  jsr main
  rts
  // [4] phi from @2 to @end [phi:@2->@end]
  // @end
  // main
main: {
    .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f
    .label x = 3
    .label y = $c
    .label vx = 5
    .label vy = 2
    // bitmap_init(BITMAP, SCREEN)
    // [6] call bitmap_init 
    // [58] phi from main to bitmap_init [phi:main->bitmap_init]
    jsr bitmap_init
    // [7] phi from main to main::@8 [phi:main->main::@8]
    // main::@8
    // bitmap_clear(BLACK, WHITE)
    // [8] call bitmap_clear 
    // [44] phi from main::@8 to bitmap_clear [phi:main::@8->bitmap_clear]
    jsr bitmap_clear
    // main::@9
    // *D011 = VIC_BMM|VIC_DEN|VIC_RSEL|3
    // [9] *((const byte*) D011) ← (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3 -- _deref_pbuc1=vbuc2 
    lda #VIC_BMM|VIC_DEN|VIC_RSEL|3
    sta D011
    // [10] phi from main::@9 to main::toD0181 [phi:main::@9->main::toD0181]
    // main::toD0181
    // main::@7
    // *D018 = toD018(SCREEN, BITMAP)
    // [11] *((const byte*) D018) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0181_return
    sta D018
    // init_irq()
    // [12] call init_irq 
    jsr init_irq
    // [13] phi from main::@7 to main::@1 [phi:main::@7->main::@1]
    // [13] phi (byte) main::vy#2 = (byte) 1 [phi:main::@7->main::@1#0] -- vbuz1=vbuc1 
    lda #1
    sta.z vy
    // [13] phi (word) main::vx#2 = (word) 1 [phi:main::@7->main::@1#1] -- vwuz1=vwuc1 
    sta.z vx
    lda #>1
    sta.z vx+1
    // [13] phi (byte) main::y#2 = (byte) 0 [phi:main::@7->main::@1#2] -- vbuz1=vbuc1 
    sta.z y
    // [13] phi (word) main::x#2 = (word) 0 [phi:main::@7->main::@1#3] -- vwuz1=vwuc1 
    sta.z x
    sta.z x+1
    // main::@1
    // main::@2
  __b2:
    // bitmap_plot(x, y)
    // [14] (word) bitmap_plot::x#0 ← (word) main::x#2
    // [15] (byte) bitmap_plot::y#0 ← (byte) main::y#2 -- vbuxx=vbuz1 
    ldx.z y
    // [16] call bitmap_plot 
    jsr bitmap_plot
    // main::@10
    // x += vx
    // [17] (word) main::x#1 ← (word) main::x#2 + (word) main::vx#2 -- vwuz1=vwuz1_plus_vwuz2 
    lda.z x
    clc
    adc.z vx
    sta.z x
    lda.z x+1
    adc.z vx+1
    sta.z x+1
    // y += vy
    // [18] (byte) main::y#1 ← (byte) main::y#2 + (byte) main::vy#2 -- vbuz1=vbuz1_plus_vbuz2 
    lda.z y
    clc
    adc.z vy
    sta.z y
    // if(x==319 || x==0)
    // [19] if((word) main::x#1==(word) $13f) goto main::@5 -- vwuz1_eq_vwuc1_then_la1 
    lda.z x
    cmp #<$13f
    bne !+
    lda.z x+1
    cmp #>$13f
    beq __b5
  !:
    // main::@11
    // [20] if((word) main::x#1!=(byte) 0) goto main::@3 -- vwuz1_neq_0_then_la1 
    lda.z x
    bne __b3
    lda.z x+1
    bne __b3
    // main::@5
  __b5:
    // vx = -vx
    // [21] (word) main::vx#1 ← - (word) main::vx#2 -- vwuz1=_neg_vwuz1 
    sec
    lda #0
    sbc.z vx
    sta.z vx
    lda #0
    sbc.z vx+1
    sta.z vx+1
    // [22] phi from main::@11 main::@5 to main::@3 [phi:main::@11/main::@5->main::@3]
    // [22] phi (word) main::vx#6 = (word) main::vx#2 [phi:main::@11/main::@5->main::@3#0] -- register_copy 
    // main::@3
  __b3:
    // if(y==199 || y==0)
    // [23] if((byte) main::y#1==(byte) $c7) goto main::@6 -- vbuz1_eq_vbuc1_then_la1 
    lda #$c7
    cmp.z y
    beq __b6
    // main::@12
    // [24] if((byte) main::y#1!=(byte) 0) goto main::@4 -- vbuz1_neq_0_then_la1 
    lda.z y
    cmp #0
    bne __b4
    // main::@6
  __b6:
    // vy = -vy
    // [25] (byte) main::vy#1 ← - (byte) main::vy#2 -- vbuz1=_neg_vbuz1 
    lda.z vy
    eor #$ff
    clc
    adc #1
    sta.z vy
    // [26] phi from main::@12 main::@6 to main::@4 [phi:main::@12/main::@6->main::@4]
    // [26] phi (byte) main::vy#8 = (byte) main::vy#2 [phi:main::@12/main::@6->main::@4#0] -- register_copy 
    // main::@4
  __b4:
    // plots_per_frame[frame_cnt]++;
    // [27] *((const byte*) plots_per_frame + (byte) frame_cnt) ← ++ *((const byte*) plots_per_frame + (byte) frame_cnt) -- pbuc1_derefidx_vbuz1=_inc_pbuc1_derefidx_vbuz1 
    ldx.z frame_cnt
    inc plots_per_frame,x
    // [13] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
    // [13] phi (byte) main::vy#2 = (byte) main::vy#8 [phi:main::@4->main::@1#0] -- register_copy 
    // [13] phi (word) main::vx#2 = (word) main::vx#6 [phi:main::@4->main::@1#1] -- register_copy 
    // [13] phi (byte) main::y#2 = (byte) main::y#1 [phi:main::@4->main::@1#2] -- register_copy 
    // [13] phi (word) main::x#2 = (word) main::x#1 [phi:main::@4->main::@1#3] -- register_copy 
    jmp __b2
}
  // bitmap_plot
// Plot a single dot in the bitmap
// bitmap_plot(word zp(3) x, byte register(X) y)
bitmap_plot: {
    .label __1 = $a
    .label plotter = 8
    .label x = 3
    // (byte*) { bitmap_plot_yhi[y], bitmap_plot_ylo[y] }
    // [28] (word) bitmap_plot::plotter#0 ← *((const byte*) bitmap_plot_yhi + (byte) bitmap_plot::y#0) w= *((const byte*) bitmap_plot_ylo + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx 
    lda bitmap_plot_yhi,x
    sta.z plotter+1
    lda bitmap_plot_ylo,x
    sta.z plotter
    // x & $fff8
    // [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 -- vwuz1=vwuz2_band_vwuc1 
    lda.z x
    and #<$fff8
    sta.z __1
    lda.z x+1
    and #>$fff8
    sta.z __1+1
    // plotter += ( x & $fff8 )
    // [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 -- pbuz1=pbuz1_plus_vwuz2 
    lda.z plotter
    clc
    adc.z __1
    sta.z plotter
    lda.z plotter+1
    adc.z __1+1
    sta.z plotter+1
    // <x
    // [31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 -- vbuaa=_lo_vwuz1 
    lda.z x
    // *plotter |= bitmap_plot_bit[<x]
    // [32] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte*) bitmap_plot_bit + (byte~) bitmap_plot::$2) -- _deref_pbuz1=_deref_pbuz1_bor_pbuc1_derefidx_vbuaa 
    tay
    lda bitmap_plot_bit,y
    ldy #0
    ora (plotter),y
    sta (plotter),y
    // bitmap_plot::@return
    // }
    // [33] return 
    rts
}
  // init_irq
// Setup the IRQ
init_irq: {
    // asm
    // asm { sei  }
    sei
    // *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK
    // [35] *((const byte*) PROCPORT_DDR) ← (const byte) PROCPORT_DDR_MEMORY_MASK -- _deref_pbuc1=vbuc2 
    // Disable kernal & basic
    lda #PROCPORT_DDR_MEMORY_MASK
    sta PROCPORT_DDR
    // *PROCPORT = PROCPORT_RAM_IO
    // [36] *((const byte*) PROCPORT) ← (const byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2 
    lda #PROCPORT_RAM_IO
    sta PROCPORT
    // *CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR
    // [37] *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 
    // Disable CIA 1 Timer IRQ
    lda #CIA_INTERRUPT_CLEAR
    sta CIA1_INTERRUPT
    // *VIC_CONTROL |=$80
    // [38] *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) | (byte) $80 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 
    // Set raster line to $100
    lda #$80
    ora VIC_CONTROL
    sta VIC_CONTROL
    // *RASTER = $00
    // [39] *((const byte*) RASTER) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta RASTER
    // *IRQ_ENABLE = IRQ_RASTER
    // [40] *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 
    // Enable Raster Interrupt
    lda #IRQ_RASTER
    sta IRQ_ENABLE
    // *HARDWARE_IRQ = &irq
    // [41] *((const void()**) HARDWARE_IRQ) ← &interrupt(HARDWARE_CLOBBER)(void()) irq() -- _deref_pptc1=pprc2 
    // Set the IRQ routine
    lda #<irq
    sta HARDWARE_IRQ
    lda #>irq
    sta HARDWARE_IRQ+1
    // asm
    // asm { cli  }
    cli
    // init_irq::@return
    // }
    // [43] return 
    rts
}
  // bitmap_clear
// Clear all graphics on the bitmap
// bgcol - the background color to fill the screen with
// fgcol - the foreground color to fill the screen with
bitmap_clear: {
    .const col = WHITE*$10
    // memset(bitmap_screen, col, 1000uw)
    // [45] call memset 
    // [49] phi from bitmap_clear to memset [phi:bitmap_clear->memset]
    // [49] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuxx=vbuc1 
    ldx #col
    // [49] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 
    lda #<SCREEN
    sta.z memset.str
    lda #>SCREEN
    sta.z memset.str+1
    // [49] phi (word) memset::num#2 = (word) $3e8 [phi:bitmap_clear->memset#2] -- vwuz1=vwuc1 
    lda #<$3e8
    sta.z memset.num
    lda #>$3e8
    sta.z memset.num+1
    jsr memset
    // [46] phi from bitmap_clear to bitmap_clear::@1 [phi:bitmap_clear->bitmap_clear::@1]
    // bitmap_clear::@1
    // memset(bitmap_gfx, 0, 8000uw)
    // [47] call memset 
    // [49] phi from bitmap_clear::@1 to memset [phi:bitmap_clear::@1->memset]
    // [49] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuxx=vbuc1 
    ldx #0
    // [49] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 
    lda #<BITMAP
    sta.z memset.str
    lda #>BITMAP
    sta.z memset.str+1
    // [49] phi (word) memset::num#2 = (word) $1f40 [phi:bitmap_clear::@1->memset#2] -- vwuz1=vwuc1 
    lda #<$1f40
    sta.z memset.num
    lda #>$1f40
    sta.z memset.num+1
    jsr memset
    // bitmap_clear::@return
    // }
    // [48] return 
    rts
}
  // memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zp(5) str, byte register(X) c, word zp(3) num)
memset: {
    .label end = 3
    .label dst = 5
    .label num = 3
    .label str = 5
    // if(num>0)
    // [50] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1 
    lda.z num
    bne !+
    lda.z num+1
    beq __breturn
  !:
    // memset::@1
    // end = (char*)str + num
    // [51] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz1 
    lda.z end
    clc
    adc.z str
    sta.z end
    lda.z end+1
    adc.z str+1
    sta.z end+1
    // [52] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3
    // [53] phi from memset::@1 memset::@3 to memset::@2 [phi:memset::@1/memset::@3->memset::@2]
    // [53] phi (byte*) memset::dst#2 = (byte*) memset::dst#4 [phi:memset::@1/memset::@3->memset::@2#0] -- register_copy 
    // memset::@2
  __b2:
    // for(char* dst = str; dst!=end; dst++)
    // [54] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 -- pbuz1_neq_pbuz2_then_la1 
    lda.z dst+1
    cmp.z end+1
    bne __b3
    lda.z dst
    cmp.z end
    bne __b3
    // memset::@return
  __breturn:
    // }
    // [55] return 
    rts
    // memset::@3
  __b3:
    // *dst = c
    // [56] *((byte*) memset::dst#2) ← (byte) memset::c#4 -- _deref_pbuz1=vbuxx 
    txa
    ldy #0
    sta (dst),y
    // for(char* dst = str; dst!=end; dst++)
    // [57] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 
    inc.z dst
    bne !+
    inc.z dst+1
  !:
    jmp __b2
}
  // bitmap_init
// Initialize bitmap plotting tables
bitmap_init: {
    .label __7 = $c
    .label yoffs = 8
    // [59] phi from bitmap_init to bitmap_init::@1 [phi:bitmap_init->bitmap_init::@1]
    // [59] phi (byte) bitmap_init::x#2 = (byte) 0 [phi:bitmap_init->bitmap_init::@1#0] -- vbuxx=vbuc1 
    ldx #0
    // [59] phi (byte) bitmap_init::bits#3 = (byte) $80 [phi:bitmap_init->bitmap_init::@1#1] -- vbuaa=vbuc1 
    lda #$80
    // [59] phi from bitmap_init::@2 to bitmap_init::@1 [phi:bitmap_init::@2->bitmap_init::@1]
    // [59] phi (byte) bitmap_init::x#2 = (byte) bitmap_init::x#1 [phi:bitmap_init::@2->bitmap_init::@1#0] -- register_copy 
    // [59] phi (byte) bitmap_init::bits#3 = (byte) bitmap_init::bits#4 [phi:bitmap_init::@2->bitmap_init::@1#1] -- register_copy 
    // bitmap_init::@1
  __b1:
    // bitmap_plot_bit[x] = bits
    // [60] *((const byte*) bitmap_plot_bit + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta bitmap_plot_bit,x
    // bits >>= 1
    // [61] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1 -- vbuaa=vbuaa_ror_1 
    lsr
    // if(bits==0)
    // [62] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6 -- vbuaa_neq_0_then_la1 
    cmp #0
    bne __b2
    // [64] phi from bitmap_init::@1 to bitmap_init::@2 [phi:bitmap_init::@1->bitmap_init::@2]
    // [64] phi (byte) bitmap_init::bits#4 = (byte) $80 [phi:bitmap_init::@1->bitmap_init::@2#0] -- vbuaa=vbuc1 
    lda #$80
    // [63] phi from bitmap_init::@1 to bitmap_init::@6 [phi:bitmap_init::@1->bitmap_init::@6]
    // bitmap_init::@6
    // [64] phi from bitmap_init::@6 to bitmap_init::@2 [phi:bitmap_init::@6->bitmap_init::@2]
    // [64] phi (byte) bitmap_init::bits#4 = (byte) bitmap_init::bits#1 [phi:bitmap_init::@6->bitmap_init::@2#0] -- register_copy 
    // bitmap_init::@2
  __b2:
    // for(byte x : 0..255)
    // [65] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2 -- vbuxx=_inc_vbuxx 
    inx
    // [66] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne __b1
    // [67] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3]
    // [67] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 
    lda #<BITMAP
    sta.z yoffs
    lda #>BITMAP
    sta.z yoffs+1
    // [67] phi (byte) bitmap_init::y#2 = (byte) 0 [phi:bitmap_init::@2->bitmap_init::@3#1] -- vbuxx=vbuc1 
    ldx #0
    // [67] phi from bitmap_init::@4 to bitmap_init::@3 [phi:bitmap_init::@4->bitmap_init::@3]
    // [67] phi (byte*) bitmap_init::yoffs#2 = (byte*) bitmap_init::yoffs#4 [phi:bitmap_init::@4->bitmap_init::@3#0] -- register_copy 
    // [67] phi (byte) bitmap_init::y#2 = (byte) bitmap_init::y#1 [phi:bitmap_init::@4->bitmap_init::@3#1] -- register_copy 
    // bitmap_init::@3
  __b3:
    // y&$7
    // [68] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 -- vbuz1=vbuxx_band_vbuc1 
    lda #7
    sax.z __7
    // <yoffs
    // [69] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 -- vbuaa=_lo_pbuz1 
    lda.z yoffs
    // y&$7 | <yoffs
    // [70] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4 -- vbuaa=vbuz1_bor_vbuaa 
    ora.z __7
    // bitmap_plot_ylo[y] = y&$7 | <yoffs
    // [71] *((const byte*) bitmap_plot_ylo + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta bitmap_plot_ylo,x
    // >yoffs
    // [72] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2 -- vbuaa=_hi_pbuz1 
    lda.z yoffs+1
    // bitmap_plot_yhi[y] = >yoffs
    // [73] *((const byte*) bitmap_plot_yhi + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta bitmap_plot_yhi,x
    // if((y&$7)==7)
    // [74] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@4 -- vbuz1_neq_vbuc1_then_la1 
    lda #7
    cmp.z __7
    bne __b4
    // bitmap_init::@5
    // yoffs = yoffs + 40*8
    // [75] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8 -- pbuz1=pbuz1_plus_vwuc1 
    clc
    lda.z yoffs
    adc #<$28*8
    sta.z yoffs
    lda.z yoffs+1
    adc #>$28*8
    sta.z yoffs+1
    // [76] phi from bitmap_init::@3 bitmap_init::@5 to bitmap_init::@4 [phi:bitmap_init::@3/bitmap_init::@5->bitmap_init::@4]
    // [76] phi (byte*) bitmap_init::yoffs#4 = (byte*) bitmap_init::yoffs#2 [phi:bitmap_init::@3/bitmap_init::@5->bitmap_init::@4#0] -- register_copy 
    // bitmap_init::@4
  __b4:
    // for(byte y : 0..255)
    // [77] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2 -- vbuxx=_inc_vbuxx 
    inx
    // [78] if((byte) bitmap_init::y#1!=(byte) 0) goto bitmap_init::@3 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne __b3
    // bitmap_init::@return
    // }
    // [79] return 
    rts
}
  // irq
// Interrupt Routine counting frames
irq: {
    // entry interrupt(HARDWARE_CLOBBER)
    sta rega+1
    // *BGCOL = WHITE
    // [80] *((const byte*) BGCOL) ← (const byte) WHITE -- _deref_pbuc1=vbuc2 
    lda #WHITE
    sta BGCOL
    // if(frame_cnt)
    // [81] if((byte) 0==(byte) frame_cnt) goto irq::@1 -- vbuc1_eq_vbuz1_then_la1 
    lda #0
    cmp.z frame_cnt
    beq __b1
    // irq::@2
    // frame_cnt++;
    // [82] (byte) frame_cnt ← ++ (byte) frame_cnt -- vbuz1=_inc_vbuz1 
    inc.z frame_cnt
    // irq::@1
  __b1:
    // *BGCOL = BLACK
    // [83] *((const byte*) BGCOL) ← (const byte) BLACK -- _deref_pbuc1=vbuc2 
    lda #BLACK
    sta BGCOL
    // *IRQ_STATUS = IRQ_RASTER
    // [84] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 
    // Acknowledge the IRQ
    lda #IRQ_RASTER
    sta IRQ_STATUS
    // irq::@return
    // }
    // [85] return  - exit interrupt(HARDWARE_CLOBBER)
  rega:
    lda #00
    rti
}
  // File Data
  // Tables for the plotter - initialized by calling bitmap_init();
  bitmap_plot_ylo: .fill $100, 0
  bitmap_plot_yhi: .fill $100, 0
  bitmap_plot_bit: .fill $100, 0
  plots_per_frame: .fill $100, 0

