Identified constant variable (byte*) SCREEN1
Identified constant variable (byte*) SCREEN2
Identified constant variable (byte*) BUFFER
Identified constant variable (byte*) CHARSET
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx 
Inlined call (byte~) main::$7 ← call toD018 (byte*) SCREEN1 (byte*) CHARSET 
Inlined call (byte~) main::$9 ← call toD018 (byte*) SCREEN2 (byte*) CHARSET 
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) @5
Culled Empty Block (label) sid_rnd::@1
Culled Empty Block (label) main::toD0181_@1
Culled Empty Block (label) main::toD0182_@1
Culled Empty Block (label) main::@4
Culled Empty Block (label) main::@3
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@6
Culled Empty Block (label) @7
Culled Empty Block (label) fire::@5
Culled Empty Block (label) fire::@6
Culled Empty Block (label) fire::@8
Culled Empty Block (label) fire::@10
Culled Empty Block (label) @8
Culled Empty Block (label) makecharset::@12
Culled Empty Block (label) @9
Culled Empty Block (label) fillscreen::@2

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  (byte*) BORDERCOL#0 ← ((byte*)) (number) $d020
  (byte*) BGCOL#0 ← ((byte*)) (number) $d021
  (byte*) D018#0 ← ((byte*)) (number) $d018
  (byte*) COLS#0 ← ((byte*)) (number) $d800
  (byte) BLACK#0 ← (number) 0
  (byte) YELLOW#0 ← (number) 7
  to:@4
@4: scope:[]  from @begin
  (word*) SID_VOICE3_FREQ#0 ← ((word*)) (number) $d40e
  (byte*) SID_VOICE3_CONTROL#0 ← ((byte*)) (number) $d412
  (byte) SID_CONTROL_NOISE#0 ← (number) $80
  (byte*) SID_VOICE3_OSC#0 ← ((byte*)) (number) $d41b
  to:@6
sid_rnd_init: scope:[sid_rnd_init]  from main::@12
  *((word*) SID_VOICE3_FREQ#0) ← (number) $ffff
  *((byte*) SID_VOICE3_CONTROL#0) ← (byte) SID_CONTROL_NOISE#0
  to:sid_rnd_init::@return
sid_rnd_init::@return: scope:[sid_rnd_init]  from sid_rnd_init
  return 
  to:@return
sid_rnd: scope:[sid_rnd]  from fire::@9
  (byte) sid_rnd::return#0 ← *((byte*) SID_VOICE3_OSC#0)
  to:sid_rnd::@return
sid_rnd::@return: scope:[sid_rnd]  from sid_rnd
  (byte) sid_rnd::return#3 ← phi( sid_rnd/(byte) sid_rnd::return#0 )
  (byte) sid_rnd::return#1 ← (byte) sid_rnd::return#3
  return 
  to:@return
@6: scope:[]  from @4
  (byte*) SCREEN1#0 ← ((byte*)) (number) $3800
  (byte*) SCREEN2#0 ← ((byte*)) (number) $3c00
  (byte*) BUFFER#0 ← ((byte*)) (number) $4000
  (byte*) CHARSET#0 ← ((byte*)) (number) $3000
  to:@10
main: scope:[main]  from @10
  asm { sei  }
  *((byte*) BORDERCOL#0) ← (byte) BLACK#0
  *((byte*) BGCOL#0) ← (byte) BLACK#0
  (byte*) fillscreen::screen#0 ← (byte*) BUFFER#0
  (byte) fillscreen::fill#0 ← (number) 0
  call fillscreen 
  to:main::@9
main::@9: scope:[main]  from main
  (byte*) fillscreen::screen#1 ← (byte*) SCREEN1#0
  (byte) fillscreen::fill#1 ← (number) 0
  call fillscreen 
  to:main::@10
main::@10: scope:[main]  from main::@9
  (byte*) fillscreen::screen#2 ← (byte*) SCREEN2#0
  (byte) fillscreen::fill#2 ← (number) 0
  call fillscreen 
  to:main::@11
main::@11: scope:[main]  from main::@10
  (byte*) fillscreen::screen#3 ← (byte*) COLS#0
  (byte) fillscreen::fill#3 ← (byte) YELLOW#0
  call fillscreen 
  to:main::@12
main::@12: scope:[main]  from main::@11
  call sid_rnd_init 
  to:main::@13
main::@13: scope:[main]  from main::@12
  (byte*) makecharset::charset#0 ← (byte*) CHARSET#0
  call makecharset 
  to:main::@14
main::@14: scope:[main]  from main::@13
  to:main::@1
main::@1: scope:[main]  from main::@14 main::@8
  if(true) goto main::@2
  to:main::@return
main::@2: scope:[main]  from main::@1
  (byte*) fire::screenbase#0 ← (byte*) SCREEN1#0
  call fire 
  to:main::@15
main::@15: scope:[main]  from main::@2
  (byte*) main::toD0181_screen#0 ← (byte*) SCREEN1#0
  (byte*) main::toD0181_gfx#0 ← (byte*) CHARSET#0
  to:main::toD0181
main::toD0181: scope:[main]  from main::@15
  (byte*) main::toD0181_gfx#1 ← phi( main::@15/(byte*) main::toD0181_gfx#0 )
  (byte*) main::toD0181_screen#1 ← phi( main::@15/(byte*) main::toD0181_screen#0 )
  (word~) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1
  (number~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (number) $3fff
  (number~) main::toD0181_$2#0 ← (number~) main::toD0181_$1#0 * (number) 4
  (number~) main::toD0181_$3#0 ← > (number~) main::toD0181_$2#0
  (word~) main::toD0181_$4#0 ← ((word)) (byte*) main::toD0181_gfx#1
  (byte~) main::toD0181_$5#0 ← > (word~) main::toD0181_$4#0
  (number~) main::toD0181_$6#0 ← (byte~) main::toD0181_$5#0 / (number) 4
  (number~) main::toD0181_$7#0 ← (number~) main::toD0181_$6#0 & (number) $f
  (number~) main::toD0181_$8#0 ← (number~) main::toD0181_$3#0 | (number~) main::toD0181_$7#0
  (byte) main::toD0181_return#0 ← (number~) main::toD0181_$8#0
  to:main::toD0181_@return
main::toD0181_@return: scope:[main]  from main::toD0181
  (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::@7
main::@7: scope:[main]  from main::toD0181_@return
  (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 )
  (byte~) main::$7 ← (byte) main::toD0181_return#3
  *((byte*) D018#0) ← (byte~) main::$7
  (byte*) fire::screenbase#1 ← (byte*) SCREEN2#0
  call fire 
  to:main::@16
main::@16: scope:[main]  from main::@7
  (byte*) main::toD0182_screen#0 ← (byte*) SCREEN2#0
  (byte*) main::toD0182_gfx#0 ← (byte*) CHARSET#0
  to:main::toD0182
main::toD0182: scope:[main]  from main::@16
  (byte*) main::toD0182_gfx#1 ← phi( main::@16/(byte*) main::toD0182_gfx#0 )
  (byte*) main::toD0182_screen#1 ← phi( main::@16/(byte*) main::toD0182_screen#0 )
  (word~) main::toD0182_$0#0 ← ((word)) (byte*) main::toD0182_screen#1
  (number~) main::toD0182_$1#0 ← (word~) main::toD0182_$0#0 & (number) $3fff
  (number~) main::toD0182_$2#0 ← (number~) main::toD0182_$1#0 * (number) 4
  (number~) main::toD0182_$3#0 ← > (number~) main::toD0182_$2#0
  (word~) main::toD0182_$4#0 ← ((word)) (byte*) main::toD0182_gfx#1
  (byte~) main::toD0182_$5#0 ← > (word~) main::toD0182_$4#0
  (number~) main::toD0182_$6#0 ← (byte~) main::toD0182_$5#0 / (number) 4
  (number~) main::toD0182_$7#0 ← (number~) main::toD0182_$6#0 & (number) $f
  (number~) main::toD0182_$8#0 ← (number~) main::toD0182_$3#0 | (number~) main::toD0182_$7#0
  (byte) main::toD0182_return#0 ← (number~) main::toD0182_$8#0
  to:main::toD0182_@return
main::toD0182_@return: scope:[main]  from main::toD0182
  (byte) main::toD0182_return#2 ← phi( main::toD0182/(byte) main::toD0182_return#0 )
  (byte) main::toD0182_return#1 ← (byte) main::toD0182_return#2
  to:main::@8
main::@8: scope:[main]  from main::toD0182_@return
  (byte) main::toD0182_return#3 ← phi( main::toD0182_@return/(byte) main::toD0182_return#1 )
  (byte~) main::$9 ← (byte) main::toD0182_return#3
  *((byte*) D018#0) ← (byte~) main::$9
  to:main::@1
main::@return: scope:[main]  from main::@1
  return 
  to:@return
fire: scope:[fire]  from main::@2 main::@7
  (byte*) fire::screenbase#2 ← phi( main::@2/(byte*) fire::screenbase#0 main::@7/(byte*) fire::screenbase#1 )
  (byte*) fire::screen#0 ← (byte*) fire::screenbase#2
  (byte*) fire::buffer#0 ← (byte*) BUFFER#0
  to:fire::@1
fire::@1: scope:[fire]  from fire fire::@4
  (byte*) fire::screen#9 ← phi( fire/(byte*) fire::screen#0 fire::@4/(byte*) fire::screen#2 )
  (byte*) fire::screenbase#4 ← phi( fire/(byte*) fire::screenbase#2 fire::@4/(byte*) fire::screenbase#5 )
  (byte*) fire::buffer#4 ← phi( fire/(byte*) fire::buffer#0 fire::@4/(byte*) fire::buffer#2 )
  (byte*~) fire::$2 ← (byte*) BUFFER#0 + (number) $18*(number) $28
  (bool~) fire::$3 ← (byte*) fire::buffer#4 != (byte*~) fire::$2
  if((bool~) fire::$3) goto fire::@2
  to:fire::@3
fire::@2: scope:[fire]  from fire::@1
  (byte*) fire::screenbase#6 ← phi( fire::@1/(byte*) fire::screenbase#4 )
  (byte*) fire::screen#6 ← phi( fire::@1/(byte*) fire::screen#9 )
  (byte*) fire::buffer#5 ← phi( fire::@1/(byte*) fire::buffer#4 )
  (byte~) fire::$4 ← *((byte*) fire::buffer#5 + (number) $28-(number) 1) + *((byte*) fire::buffer#5 + (number) $28-(number) 1)
  (byte~) fire::$5 ← (byte~) fire::$4 + *((byte*) fire::buffer#5 + (number) $28)
  (byte~) fire::$6 ← (byte~) fire::$5 + *((byte*) fire::buffer#5 + (number) $29)
  (number~) fire::$7 ← (byte~) fire::$6 / (number) 4
  (byte) fire::c#0 ← (number~) fire::$7
  (bool~) fire::$8 ← (byte) fire::c#0 > (number) 2
  (bool~) fire::$9 ← ! (bool~) fire::$8
  if((bool~) fire::$9) goto fire::@4
  to:fire::@7
fire::@3: scope:[fire]  from fire::@1
  (byte*) fire::screenbase#3 ← phi( fire::@1/(byte*) fire::screenbase#4 )
  (byte*~) fire::$0 ← (byte*) fire::screenbase#3 + (number) $18*(number) $28
  (byte*) fire::screen#1 ← (byte*~) fire::$0
  (byte*~) fire::$1 ← (byte*) BUFFER#0 + (number) $18*(number) $28
  (byte*) fire::buffer#1 ← (byte*~) fire::$1
  to:fire::@9
fire::@4: scope:[fire]  from fire::@2 fire::@7
  (byte*) fire::screenbase#5 ← phi( fire::@2/(byte*) fire::screenbase#6 fire::@7/(byte*) fire::screenbase#7 )
  (byte*) fire::screen#4 ← phi( fire::@2/(byte*) fire::screen#6 fire::@7/(byte*) fire::screen#7 )
  (byte*) fire::buffer#6 ← phi( fire::@2/(byte*) fire::buffer#5 fire::@7/(byte*) fire::buffer#8 )
  (byte) fire::c#2 ← phi( fire::@2/(byte) fire::c#0 fire::@7/(byte) fire::c#1 )
  *((byte*) fire::buffer#6) ← (byte) fire::c#2
  *((byte*) fire::screen#4) ← *((byte*) fire::buffer#6)
  (byte*) fire::screen#2 ← ++ (byte*) fire::screen#4
  (byte*) fire::buffer#2 ← ++ (byte*) fire::buffer#6
  to:fire::@1
fire::@7: scope:[fire]  from fire::@2
  (byte*) fire::screenbase#7 ← phi( fire::@2/(byte*) fire::screenbase#6 )
  (byte*) fire::screen#7 ← phi( fire::@2/(byte*) fire::screen#6 )
  (byte*) fire::buffer#8 ← phi( fire::@2/(byte*) fire::buffer#5 )
  (byte) fire::c#3 ← phi( fire::@2/(byte) fire::c#0 )
  (byte) fire::c#1 ← (byte) fire::c#3 - (number) 3
  to:fire::@4
fire::@9: scope:[fire]  from fire::@11 fire::@3
  (byte*) fire::screen#8 ← phi( fire::@11/(byte*) fire::screen#3 fire::@3/(byte*) fire::screen#1 )
  (byte*) fire::buffer#9 ← phi( fire::@11/(byte*) fire::buffer#3 fire::@3/(byte*) fire::buffer#1 )
  call sid_rnd 
  (byte) sid_rnd::return#2 ← (byte) sid_rnd::return#1
  to:fire::@11
fire::@11: scope:[fire]  from fire::@9
  (byte*) fire::screen#5 ← phi( fire::@9/(byte*) fire::screen#8 )
  (byte*) fire::buffer#7 ← phi( fire::@9/(byte*) fire::buffer#9 )
  (byte) sid_rnd::return#4 ← phi( fire::@9/(byte) sid_rnd::return#2 )
  (byte~) fire::$10 ← (byte) sid_rnd::return#4
  (number~) fire::$11 ← (byte~) fire::$10 / (number) $10
  (number~) fire::$12 ← (number) $30 + (number~) fire::$11
  *((byte*) fire::buffer#7) ← (number~) fire::$12
  *((byte*) fire::screen#5) ← *((byte*) fire::buffer#7)
  (byte*) fire::screen#3 ← ++ (byte*) fire::screen#5
  (byte*) fire::buffer#3 ← ++ (byte*) fire::buffer#7
  (byte*~) fire::$13 ← (byte*) BUFFER#0 + (number) $19*(number) $28
  (bool~) fire::$14 ← (byte*) fire::buffer#3 != (byte*~) fire::$13
  if((bool~) fire::$14) goto fire::@9
  to:fire::@return
fire::@return: scope:[fire]  from fire::@11
  return 
  to:@return
makecharset: scope:[makecharset]  from main::@13
  (byte*) makecharset::charset#1 ← phi( main::@13/(byte*) makecharset::charset#0 )
  (byte[8]) makecharset::bittab#0 ← { (number) 1, (number) 2, (number) 4, (number) 8, (number) $10, (number) $20, (number) $40, (number) $80 }
  (byte*) makecharset::font#0 ← (byte*) makecharset::charset#1
  to:makecharset::@1
makecharset::@1: scope:[makecharset]  from makecharset makecharset::@1
  (byte*) makecharset::charset#2 ← phi( makecharset/(byte*) makecharset::charset#1 makecharset::@1/(byte*) makecharset::charset#2 )
  (byte*) makecharset::font#2 ← phi( makecharset/(byte*) makecharset::font#0 makecharset::@1/(byte*) makecharset::font#1 )
  *((byte*) makecharset::font#2) ← (number) 0
  (byte*) makecharset::font#1 ← ++ (byte*) makecharset::font#2
  (byte*~) makecharset::$0 ← (byte*) makecharset::charset#2 + (number) 1*(number) 8
  (bool~) makecharset::$1 ← (byte*) makecharset::font#1 != (byte*~) makecharset::$0
  if((bool~) makecharset::$1) goto makecharset::@1
  to:makecharset::@2
makecharset::@2: scope:[makecharset]  from makecharset::@1
  (byte*) makecharset::charset#3 ← phi( makecharset::@1/(byte*) makecharset::charset#2 )
  (byte*~) makecharset::$2 ← (byte*) makecharset::charset#3 + (number) $40*(number) 8
  (byte*) makecharset::font1#0 ← (byte*~) makecharset::$2
  to:makecharset::@3
makecharset::@3: scope:[makecharset]  from makecharset::@2 makecharset::@3
  (byte*) makecharset::charset#4 ← phi( makecharset::@2/(byte*) makecharset::charset#3 makecharset::@3/(byte*) makecharset::charset#4 )
  (byte*) makecharset::font1#2 ← phi( makecharset::@2/(byte*) makecharset::font1#0 makecharset::@3/(byte*) makecharset::font1#1 )
  *((byte*) makecharset::font1#2) ← (number) $ff
  (byte*) makecharset::font1#1 ← ++ (byte*) makecharset::font1#2
  (byte*~) makecharset::$3 ← (byte*) makecharset::charset#4 + (number) $100*(number) 8
  (bool~) makecharset::$4 ← (byte*) makecharset::font1#1 != (byte*~) makecharset::$3
  if((bool~) makecharset::$4) goto makecharset::@3
  to:makecharset::@4
makecharset::@4: scope:[makecharset]  from makecharset::@3
  (byte*) makecharset::charset#12 ← phi( makecharset::@3/(byte*) makecharset::charset#4 )
  (byte) makecharset::c#0 ← (number) 0
  to:makecharset::@5
makecharset::@5: scope:[makecharset]  from makecharset::@11 makecharset::@4
  (byte*) makecharset::charset#10 ← phi( makecharset::@11/(byte*) makecharset::charset#11 makecharset::@4/(byte*) makecharset::charset#12 )
  (byte) makecharset::c#7 ← phi( makecharset::@11/(byte) makecharset::c#1 makecharset::@4/(byte) makecharset::c#0 )
  (byte) makecharset::bc#0 ← (number) 0
  (byte) makecharset::i#0 ← (number) 0
  to:makecharset::@6
makecharset::@6: scope:[makecharset]  from makecharset::@10 makecharset::@5
  (byte*) makecharset::charset#9 ← phi( makecharset::@10/(byte*) makecharset::charset#5 makecharset::@5/(byte*) makecharset::charset#10 )
  (byte) makecharset::i#6 ← phi( makecharset::@10/(byte) makecharset::i#1 makecharset::@5/(byte) makecharset::i#0 )
  (byte) makecharset::c#5 ← phi( makecharset::@10/(byte) makecharset::c#3 makecharset::@5/(byte) makecharset::c#7 )
  (byte) makecharset::bc#5 ← phi( makecharset::@10/(byte) makecharset::bc#7 makecharset::@5/(byte) makecharset::bc#0 )
  (byte) makecharset::b#0 ← (number) 0
  (byte) makecharset::ii#0 ← (number) 0
  to:makecharset::@7
makecharset::@7: scope:[makecharset]  from makecharset::@6 makecharset::@8
  (byte*) makecharset::charset#7 ← phi( makecharset::@6/(byte*) makecharset::charset#9 makecharset::@8/(byte*) makecharset::charset#6 )
  (byte) makecharset::b#4 ← phi( makecharset::@6/(byte) makecharset::b#0 makecharset::@8/(byte) makecharset::b#5 )
  (byte) makecharset::i#4 ← phi( makecharset::@6/(byte) makecharset::i#6 makecharset::@8/(byte) makecharset::i#5 )
  (byte) makecharset::ii#4 ← phi( makecharset::@6/(byte) makecharset::ii#0 makecharset::@8/(byte) makecharset::ii#1 )
  (byte) makecharset::c#2 ← phi( makecharset::@6/(byte) makecharset::c#5 makecharset::@8/(byte) makecharset::c#6 )
  (byte) makecharset::bc#3 ← phi( makecharset::@6/(byte) makecharset::bc#5 makecharset::@8/(byte) makecharset::bc#6 )
  (byte) makecharset::bc#1 ← (byte) makecharset::bc#3 + (byte) makecharset::c#2
  (bool~) makecharset::$5 ← (byte) makecharset::bc#1 > (number) $3f
  (bool~) makecharset::$6 ← ! (bool~) makecharset::$5
  if((bool~) makecharset::$6) goto makecharset::@8
  to:makecharset::@9
makecharset::@8: scope:[makecharset]  from makecharset::@7 makecharset::@9
  (byte) makecharset::b#5 ← phi( makecharset::@7/(byte) makecharset::b#4 makecharset::@9/(byte) makecharset::b#1 )
  (byte) makecharset::i#5 ← phi( makecharset::@7/(byte) makecharset::i#4 makecharset::@9/(byte) makecharset::i#2 )
  (byte*) makecharset::charset#6 ← phi( makecharset::@7/(byte*) makecharset::charset#7 makecharset::@9/(byte*) makecharset::charset#8 )
  (byte) makecharset::c#6 ← phi( makecharset::@7/(byte) makecharset::c#2 makecharset::@9/(byte) makecharset::c#8 )
  (byte) makecharset::bc#6 ← phi( makecharset::@7/(byte) makecharset::bc#1 makecharset::@9/(byte) makecharset::bc#2 )
  (byte) makecharset::ii#2 ← phi( makecharset::@7/(byte) makecharset::ii#4 makecharset::@9/(byte) makecharset::ii#3 )
  (byte) makecharset::ii#1 ← ++ (byte) makecharset::ii#2
  (bool~) makecharset::$11 ← (byte) makecharset::ii#1 < (number) 8
  if((bool~) makecharset::$11) goto makecharset::@7
  to:makecharset::@10
makecharset::@9: scope:[makecharset]  from makecharset::@7
  (byte*) makecharset::charset#8 ← phi( makecharset::@7/(byte*) makecharset::charset#7 )
  (byte) makecharset::c#8 ← phi( makecharset::@7/(byte) makecharset::c#2 )
  (byte) makecharset::b#2 ← phi( makecharset::@7/(byte) makecharset::b#4 )
  (byte) makecharset::ii#3 ← phi( makecharset::@7/(byte) makecharset::ii#4 )
  (byte) makecharset::i#2 ← phi( makecharset::@7/(byte) makecharset::i#4 )
  (byte) makecharset::bc#4 ← phi( makecharset::@7/(byte) makecharset::bc#1 )
  (number~) makecharset::$7 ← (byte) makecharset::bc#4 - (number) $40
  (byte) makecharset::bc#2 ← (number~) makecharset::$7
  (number~) makecharset::$8 ← (byte) makecharset::i#2 & (number) 1
  (number~) makecharset::$9 ← (byte) makecharset::ii#3 + (number~) makecharset::$8
  (number~) makecharset::$10 ← (number~) makecharset::$9 & (number) 7
  (byte) makecharset::b#1 ← (byte) makecharset::b#2 + *((byte[8]) makecharset::bittab#0 + (number~) makecharset::$10)
  to:makecharset::@8
makecharset::@10: scope:[makecharset]  from makecharset::@8
  (byte) makecharset::bc#7 ← phi( makecharset::@8/(byte) makecharset::bc#6 )
  (byte) makecharset::b#3 ← phi( makecharset::@8/(byte) makecharset::b#5 )
  (byte) makecharset::i#3 ← phi( makecharset::@8/(byte) makecharset::i#5 )
  (byte) makecharset::c#3 ← phi( makecharset::@8/(byte) makecharset::c#6 )
  (byte*) makecharset::charset#5 ← phi( makecharset::@8/(byte*) makecharset::charset#6 )
  (byte*~) makecharset::$12 ← (byte*) makecharset::charset#5 + (number) 1*(number) 8
  (word~) makecharset::$13 ← ((word)) (byte) makecharset::c#3
  (word~) makecharset::$14 ← (word~) makecharset::$13 << (number) 3
  (word~) makecharset::$15 ← (word~) makecharset::$14 + (byte) makecharset::i#3
  *((byte*~) makecharset::$12 + (word~) makecharset::$15) ← (byte) makecharset::b#3
  (byte) makecharset::i#1 ← ++ (byte) makecharset::i#3
  (bool~) makecharset::$16 ← (byte) makecharset::i#1 < (number) 8
  if((bool~) makecharset::$16) goto makecharset::@6
  to:makecharset::@11
makecharset::@11: scope:[makecharset]  from makecharset::@10
  (byte*) makecharset::charset#11 ← phi( makecharset::@10/(byte*) makecharset::charset#5 )
  (byte) makecharset::c#4 ← phi( makecharset::@10/(byte) makecharset::c#3 )
  (byte) makecharset::c#1 ← ++ (byte) makecharset::c#4
  (bool~) makecharset::$17 ← (byte) makecharset::c#1 < (number) $40
  if((bool~) makecharset::$17) goto makecharset::@5
  to:makecharset::@return
makecharset::@return: scope:[makecharset]  from makecharset::@11
  return 
  to:@return
fillscreen: scope:[fillscreen]  from main main::@10 main::@11 main::@9
  (byte*) fillscreen::screen#6 ← phi( main/(byte*) fillscreen::screen#0 main::@10/(byte*) fillscreen::screen#2 main::@11/(byte*) fillscreen::screen#3 main::@9/(byte*) fillscreen::screen#1 )
  (byte) fillscreen::fill#5 ← phi( main/(byte) fillscreen::fill#0 main::@10/(byte) fillscreen::fill#2 main::@11/(byte) fillscreen::fill#3 main::@9/(byte) fillscreen::fill#1 )
  (word) fillscreen::i#0 ← (word) 0
  to:fillscreen::@1
fillscreen::@1: scope:[fillscreen]  from fillscreen fillscreen::@1
  (word) fillscreen::i#2 ← phi( fillscreen/(word) fillscreen::i#0 fillscreen::@1/(word) fillscreen::i#1 )
  (byte*) fillscreen::screen#5 ← phi( fillscreen/(byte*) fillscreen::screen#6 fillscreen::@1/(byte*) fillscreen::screen#4 )
  (byte) fillscreen::fill#4 ← phi( fillscreen/(byte) fillscreen::fill#5 fillscreen::@1/(byte) fillscreen::fill#4 )
  *((byte*) fillscreen::screen#5) ← (byte) fillscreen::fill#4
  (byte*) fillscreen::screen#4 ← ++ (byte*) fillscreen::screen#5
  (word) fillscreen::i#1 ← (word) fillscreen::i#2 + rangenext(0,$3e7)
  (bool~) fillscreen::$0 ← (word) fillscreen::i#1 != rangelast(0,$3e7)
  if((bool~) fillscreen::$0) goto fillscreen::@1
  to:fillscreen::@return
fillscreen::@return: scope:[fillscreen]  from fillscreen::@1
  return 
  to:@return
@10: scope:[]  from @6
  call main 
  to:@11
@11: scope:[]  from @10
  to:@end
@end: scope:[]  from @11

SYMBOL TABLE SSA
(label) @10
(label) @11
(label) @4
(label) @6
(label) @begin
(label) @end
(byte*) BGCOL
(byte*) BGCOL#0
(byte) BLACK
(byte) BLACK#0
(byte*) BORDERCOL
(byte*) BORDERCOL#0
(byte*) BUFFER
(byte*) BUFFER#0
(byte*) CHARSET
(byte*) CHARSET#0
(byte*) COLS
(byte*) COLS#0
(byte*) D018
(byte*) D018#0
(byte*) SCREEN1
(byte*) SCREEN1#0
(byte*) SCREEN2
(byte*) SCREEN2#0
(byte) SID_CONTROL_NOISE
(byte) SID_CONTROL_NOISE#0
(byte*) SID_VOICE3_CONTROL
(byte*) SID_VOICE3_CONTROL#0
(word*) SID_VOICE3_FREQ
(word*) SID_VOICE3_FREQ#0
(byte*) SID_VOICE3_OSC
(byte*) SID_VOICE3_OSC#0
(byte) YELLOW
(byte) YELLOW#0
(void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill)
(bool~) fillscreen::$0
(label) fillscreen::@1
(label) fillscreen::@return
(byte) fillscreen::fill
(byte) fillscreen::fill#0
(byte) fillscreen::fill#1
(byte) fillscreen::fill#2
(byte) fillscreen::fill#3
(byte) fillscreen::fill#4
(byte) fillscreen::fill#5
(word) fillscreen::i
(word) fillscreen::i#0
(word) fillscreen::i#1
(word) fillscreen::i#2
(byte*) fillscreen::screen
(byte*) fillscreen::screen#0
(byte*) fillscreen::screen#1
(byte*) fillscreen::screen#2
(byte*) fillscreen::screen#3
(byte*) fillscreen::screen#4
(byte*) fillscreen::screen#5
(byte*) fillscreen::screen#6
(void()) fire((byte*) fire::screenbase)
(byte*~) fire::$0
(byte*~) fire::$1
(byte~) fire::$10
(number~) fire::$11
(number~) fire::$12
(byte*~) fire::$13
(bool~) fire::$14
(byte*~) fire::$2
(bool~) fire::$3
(byte~) fire::$4
(byte~) fire::$5
(byte~) fire::$6
(number~) fire::$7
(bool~) fire::$8
(bool~) fire::$9
(label) fire::@1
(label) fire::@11
(label) fire::@2
(label) fire::@3
(label) fire::@4
(label) fire::@7
(label) fire::@9
(label) fire::@return
(byte*) fire::buffer
(byte*) fire::buffer#0
(byte*) fire::buffer#1
(byte*) fire::buffer#2
(byte*) fire::buffer#3
(byte*) fire::buffer#4
(byte*) fire::buffer#5
(byte*) fire::buffer#6
(byte*) fire::buffer#7
(byte*) fire::buffer#8
(byte*) fire::buffer#9
(byte) fire::c
(byte) fire::c#0
(byte) fire::c#1
(byte) fire::c#2
(byte) fire::c#3
(byte*) fire::screen
(byte*) fire::screen#0
(byte*) fire::screen#1
(byte*) fire::screen#2
(byte*) fire::screen#3
(byte*) fire::screen#4
(byte*) fire::screen#5
(byte*) fire::screen#6
(byte*) fire::screen#7
(byte*) fire::screen#8
(byte*) fire::screen#9
(byte*) fire::screenbase
(byte*) fire::screenbase#0
(byte*) fire::screenbase#1
(byte*) fire::screenbase#2
(byte*) fire::screenbase#3
(byte*) fire::screenbase#4
(byte*) fire::screenbase#5
(byte*) fire::screenbase#6
(byte*) fire::screenbase#7
(void()) main()
(byte~) main::$7
(byte~) main::$9
(label) main::@1
(label) main::@10
(label) main::@11
(label) main::@12
(label) main::@13
(label) main::@14
(label) main::@15
(label) main::@16
(label) main::@2
(label) main::@7
(label) main::@8
(label) main::@9
(label) main::@return
(label) main::toD0181
(word~) main::toD0181_$0
(word~) main::toD0181_$0#0
(number~) main::toD0181_$1
(number~) main::toD0181_$1#0
(number~) main::toD0181_$2
(number~) main::toD0181_$2#0
(number~) main::toD0181_$3
(number~) main::toD0181_$3#0
(word~) main::toD0181_$4
(word~) main::toD0181_$4#0
(byte~) main::toD0181_$5
(byte~) main::toD0181_$5#0
(number~) main::toD0181_$6
(number~) main::toD0181_$6#0
(number~) main::toD0181_$7
(number~) main::toD0181_$7#0
(number~) main::toD0181_$8
(number~) main::toD0181_$8#0
(label) main::toD0181_@return
(byte*) main::toD0181_gfx
(byte*) main::toD0181_gfx#0
(byte*) main::toD0181_gfx#1
(byte) main::toD0181_return
(byte) main::toD0181_return#0
(byte) main::toD0181_return#1
(byte) main::toD0181_return#2
(byte) main::toD0181_return#3
(byte*) main::toD0181_screen
(byte*) main::toD0181_screen#0
(byte*) main::toD0181_screen#1
(label) main::toD0182
(word~) main::toD0182_$0
(word~) main::toD0182_$0#0
(number~) main::toD0182_$1
(number~) main::toD0182_$1#0
(number~) main::toD0182_$2
(number~) main::toD0182_$2#0
(number~) main::toD0182_$3
(number~) main::toD0182_$3#0
(word~) main::toD0182_$4
(word~) main::toD0182_$4#0
(byte~) main::toD0182_$5
(byte~) main::toD0182_$5#0
(number~) main::toD0182_$6
(number~) main::toD0182_$6#0
(number~) main::toD0182_$7
(number~) main::toD0182_$7#0
(number~) main::toD0182_$8
(number~) main::toD0182_$8#0
(label) main::toD0182_@return
(byte*) main::toD0182_gfx
(byte*) main::toD0182_gfx#0
(byte*) main::toD0182_gfx#1
(byte) main::toD0182_return
(byte) main::toD0182_return#0
(byte) main::toD0182_return#1
(byte) main::toD0182_return#2
(byte) main::toD0182_return#3
(byte*) main::toD0182_screen
(byte*) main::toD0182_screen#0
(byte*) main::toD0182_screen#1
(void()) makecharset((byte*) makecharset::charset)
(byte*~) makecharset::$0
(bool~) makecharset::$1
(number~) makecharset::$10
(bool~) makecharset::$11
(byte*~) makecharset::$12
(word~) makecharset::$13
(word~) makecharset::$14
(word~) makecharset::$15
(bool~) makecharset::$16
(bool~) makecharset::$17
(byte*~) makecharset::$2
(byte*~) makecharset::$3
(bool~) makecharset::$4
(bool~) makecharset::$5
(bool~) makecharset::$6
(number~) makecharset::$7
(number~) makecharset::$8
(number~) makecharset::$9
(label) makecharset::@1
(label) makecharset::@10
(label) makecharset::@11
(label) makecharset::@2
(label) makecharset::@3
(label) makecharset::@4
(label) makecharset::@5
(label) makecharset::@6
(label) makecharset::@7
(label) makecharset::@8
(label) makecharset::@9
(label) makecharset::@return
(byte) makecharset::b
(byte) makecharset::b#0
(byte) makecharset::b#1
(byte) makecharset::b#2
(byte) makecharset::b#3
(byte) makecharset::b#4
(byte) makecharset::b#5
(byte) makecharset::bc
(byte) makecharset::bc#0
(byte) makecharset::bc#1
(byte) makecharset::bc#2
(byte) makecharset::bc#3
(byte) makecharset::bc#4
(byte) makecharset::bc#5
(byte) makecharset::bc#6
(byte) makecharset::bc#7
(byte[8]) makecharset::bittab
(byte[8]) makecharset::bittab#0
(byte) makecharset::c
(byte) makecharset::c#0
(byte) makecharset::c#1
(byte) makecharset::c#2
(byte) makecharset::c#3
(byte) makecharset::c#4
(byte) makecharset::c#5
(byte) makecharset::c#6
(byte) makecharset::c#7
(byte) makecharset::c#8
(byte*) makecharset::charset
(byte*) makecharset::charset#0
(byte*) makecharset::charset#1
(byte*) makecharset::charset#10
(byte*) makecharset::charset#11
(byte*) makecharset::charset#12
(byte*) makecharset::charset#2
(byte*) makecharset::charset#3
(byte*) makecharset::charset#4
(byte*) makecharset::charset#5
(byte*) makecharset::charset#6
(byte*) makecharset::charset#7
(byte*) makecharset::charset#8
(byte*) makecharset::charset#9
(byte*) makecharset::font
(byte*) makecharset::font#0
(byte*) makecharset::font#1
(byte*) makecharset::font#2
(byte*) makecharset::font1
(byte*) makecharset::font1#0
(byte*) makecharset::font1#1
(byte*) makecharset::font1#2
(byte) makecharset::i
(byte) makecharset::i#0
(byte) makecharset::i#1
(byte) makecharset::i#2
(byte) makecharset::i#3
(byte) makecharset::i#4
(byte) makecharset::i#5
(byte) makecharset::i#6
(byte) makecharset::ii
(byte) makecharset::ii#0
(byte) makecharset::ii#1
(byte) makecharset::ii#2
(byte) makecharset::ii#3
(byte) makecharset::ii#4
(byte()) sid_rnd()
(label) sid_rnd::@return
(byte) sid_rnd::return
(byte) sid_rnd::return#0
(byte) sid_rnd::return#1
(byte) sid_rnd::return#2
(byte) sid_rnd::return#3
(byte) sid_rnd::return#4
(void()) sid_rnd_init()
(label) sid_rnd_init::@return

Adding number conversion cast (unumber) 0 in (byte) BLACK#0 ← (number) 0
Adding number conversion cast (unumber) 7 in (byte) YELLOW#0 ← (number) 7
Adding number conversion cast (unumber) $80 in (byte) SID_CONTROL_NOISE#0 ← (number) $80
Adding number conversion cast (unumber) $ffff in *((word*) SID_VOICE3_FREQ#0) ← (number) $ffff
Adding number conversion cast (unumber) 0 in (byte) fillscreen::fill#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) fillscreen::fill#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) fillscreen::fill#2 ← (number) 0
Adding number conversion cast (unumber) $3fff in (number~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (number) $3fff
Adding number conversion cast (unumber) main::toD0181_$1#0 in (number~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (unumber)(number) $3fff
Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$2#0 ← (unumber~) main::toD0181_$1#0 * (number) 4
Adding number conversion cast (unumber) main::toD0181_$2#0 in (number~) main::toD0181_$2#0 ← (unumber~) main::toD0181_$1#0 * (unumber)(number) 4
Adding number conversion cast (unumber) main::toD0181_$3#0 in (number~) main::toD0181_$3#0 ← > (unumber~) main::toD0181_$2#0
Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$6#0 ← (byte~) main::toD0181_$5#0 / (number) 4
Adding number conversion cast (unumber) main::toD0181_$6#0 in (number~) main::toD0181_$6#0 ← (byte~) main::toD0181_$5#0 / (unumber)(number) 4
Adding number conversion cast (unumber) $f in (number~) main::toD0181_$7#0 ← (unumber~) main::toD0181_$6#0 & (number) $f
Adding number conversion cast (unumber) main::toD0181_$7#0 in (number~) main::toD0181_$7#0 ← (unumber~) main::toD0181_$6#0 & (unumber)(number) $f
Adding number conversion cast (unumber) main::toD0181_$8#0 in (number~) main::toD0181_$8#0 ← (unumber~) main::toD0181_$3#0 | (unumber~) main::toD0181_$7#0
Adding number conversion cast (unumber) $3fff in (number~) main::toD0182_$1#0 ← (word~) main::toD0182_$0#0 & (number) $3fff
Adding number conversion cast (unumber) main::toD0182_$1#0 in (number~) main::toD0182_$1#0 ← (word~) main::toD0182_$0#0 & (unumber)(number) $3fff
Adding number conversion cast (unumber) 4 in (number~) main::toD0182_$2#0 ← (unumber~) main::toD0182_$1#0 * (number) 4
Adding number conversion cast (unumber) main::toD0182_$2#0 in (number~) main::toD0182_$2#0 ← (unumber~) main::toD0182_$1#0 * (unumber)(number) 4
Adding number conversion cast (unumber) main::toD0182_$3#0 in (number~) main::toD0182_$3#0 ← > (unumber~) main::toD0182_$2#0
Adding number conversion cast (unumber) 4 in (number~) main::toD0182_$6#0 ← (byte~) main::toD0182_$5#0 / (number) 4
Adding number conversion cast (unumber) main::toD0182_$6#0 in (number~) main::toD0182_$6#0 ← (byte~) main::toD0182_$5#0 / (unumber)(number) 4
Adding number conversion cast (unumber) $f in (number~) main::toD0182_$7#0 ← (unumber~) main::toD0182_$6#0 & (number) $f
Adding number conversion cast (unumber) main::toD0182_$7#0 in (number~) main::toD0182_$7#0 ← (unumber~) main::toD0182_$6#0 & (unumber)(number) $f
Adding number conversion cast (unumber) main::toD0182_$8#0 in (number~) main::toD0182_$8#0 ← (unumber~) main::toD0182_$3#0 | (unumber~) main::toD0182_$7#0
Adding number conversion cast (unumber) $18*$28 in (byte*~) fire::$2 ← (byte*) BUFFER#0 + (number) $18*(number) $28
Adding number conversion cast (unumber) $28-1 in (byte~) fire::$4 ← *((byte*) fire::buffer#5 + (number) $28-(number) 1) + *((byte*) fire::buffer#5 + (number) $28-(number) 1)
Adding number conversion cast (unumber) $28-1 in (byte~) fire::$4 ← *((byte*) fire::buffer#5 + (unumber)(number) $28-(number) 1) + *((byte*) fire::buffer#5 + (number) $28-(number) 1)
Adding number conversion cast (unumber) $28 in (byte~) fire::$5 ← (byte~) fire::$4 + *((byte*) fire::buffer#5 + (number) $28)
Adding number conversion cast (unumber) $29 in (byte~) fire::$6 ← (byte~) fire::$5 + *((byte*) fire::buffer#5 + (number) $29)
Adding number conversion cast (unumber) 4 in (number~) fire::$7 ← (byte~) fire::$6 / (number) 4
Adding number conversion cast (unumber) fire::$7 in (number~) fire::$7 ← (byte~) fire::$6 / (unumber)(number) 4
Adding number conversion cast (unumber) 2 in (bool~) fire::$8 ← (byte) fire::c#0 > (number) 2
Adding number conversion cast (unumber) $18*$28 in (byte*~) fire::$0 ← (byte*) fire::screenbase#3 + (number) $18*(number) $28
Adding number conversion cast (unumber) $18*$28 in (byte*~) fire::$1 ← (byte*) BUFFER#0 + (number) $18*(number) $28
Adding number conversion cast (unumber) 3 in (byte) fire::c#1 ← (byte) fire::c#3 - (number) 3
Adding number conversion cast (unumber) $10 in (number~) fire::$11 ← (byte~) fire::$10 / (number) $10
Adding number conversion cast (unumber) fire::$11 in (number~) fire::$11 ← (byte~) fire::$10 / (unumber)(number) $10
Adding number conversion cast (unumber) $30 in (number~) fire::$12 ← (number) $30 + (unumber~) fire::$11
Adding number conversion cast (unumber) fire::$12 in (number~) fire::$12 ← (unumber)(number) $30 + (unumber~) fire::$11
Adding number conversion cast (unumber) $19*$28 in (byte*~) fire::$13 ← (byte*) BUFFER#0 + (number) $19*(number) $28
Adding number conversion cast (unumber) 0 in *((byte*) makecharset::font#2) ← (number) 0
Adding number conversion cast (unumber) 1*8 in (byte*~) makecharset::$0 ← (byte*) makecharset::charset#2 + (number) 1*(number) 8
Adding number conversion cast (unumber) $40*8 in (byte*~) makecharset::$2 ← (byte*) makecharset::charset#3 + (number) $40*(number) 8
Adding number conversion cast (unumber) $ff in *((byte*) makecharset::font1#2) ← (number) $ff
Adding number conversion cast (unumber) $100*8 in (byte*~) makecharset::$3 ← (byte*) makecharset::charset#4 + (number) $100*(number) 8
Adding number conversion cast (unumber) 0 in (byte) makecharset::c#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) makecharset::bc#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) makecharset::i#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) makecharset::b#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) makecharset::ii#0 ← (number) 0
Adding number conversion cast (unumber) $3f in (bool~) makecharset::$5 ← (byte) makecharset::bc#1 > (number) $3f
Adding number conversion cast (unumber) 8 in (bool~) makecharset::$11 ← (byte) makecharset::ii#1 < (number) 8
Adding number conversion cast (unumber) $40 in (number~) makecharset::$7 ← (byte) makecharset::bc#4 - (number) $40
Adding number conversion cast (unumber) makecharset::$7 in (number~) makecharset::$7 ← (byte) makecharset::bc#4 - (unumber)(number) $40
Adding number conversion cast (unumber) 1 in (number~) makecharset::$8 ← (byte) makecharset::i#2 & (number) 1
Adding number conversion cast (unumber) makecharset::$8 in (number~) makecharset::$8 ← (byte) makecharset::i#2 & (unumber)(number) 1
Adding number conversion cast (unumber) makecharset::$9 in (number~) makecharset::$9 ← (byte) makecharset::ii#3 + (unumber~) makecharset::$8
Adding number conversion cast (unumber) 7 in (number~) makecharset::$10 ← (unumber~) makecharset::$9 & (number) 7
Adding number conversion cast (unumber) makecharset::$10 in (number~) makecharset::$10 ← (unumber~) makecharset::$9 & (unumber)(number) 7
Adding number conversion cast (unumber) 1*8 in (byte*~) makecharset::$12 ← (byte*) makecharset::charset#5 + (number) 1*(number) 8
Adding number conversion cast (unumber) 3 in (word~) makecharset::$14 ← (word~) makecharset::$13 << (number) 3
Adding number conversion cast (unumber) 8 in (bool~) makecharset::$16 ← (byte) makecharset::i#1 < (number) 8
Adding number conversion cast (unumber) $40 in (bool~) makecharset::$17 ← (byte) makecharset::c#1 < (number) $40
Successful SSA optimization PassNAddNumberTypeConversions
Adding number conversion cast (byte) to elements in (byte[8]) makecharset::bittab#0 ← { (byte)(number) 1, (byte)(number) 2, (byte)(number) 4, (byte)(number) 8, (byte)(number) $10, (byte)(number) $20, (byte)(number) $40, (byte)(number) $80 }
Successful SSA optimization PassNAddArrayNumberTypeConversions
Inlining cast (byte*) BORDERCOL#0 ← (byte*)(number) $d020
Inlining cast (byte*) BGCOL#0 ← (byte*)(number) $d021
Inlining cast (byte*) D018#0 ← (byte*)(number) $d018
Inlining cast (byte*) COLS#0 ← (byte*)(number) $d800
Inlining cast (byte) BLACK#0 ← (unumber)(number) 0
Inlining cast (byte) YELLOW#0 ← (unumber)(number) 7
Inlining cast (word*) SID_VOICE3_FREQ#0 ← (word*)(number) $d40e
Inlining cast (byte*) SID_VOICE3_CONTROL#0 ← (byte*)(number) $d412
Inlining cast (byte) SID_CONTROL_NOISE#0 ← (unumber)(number) $80
Inlining cast (byte*) SID_VOICE3_OSC#0 ← (byte*)(number) $d41b
Inlining cast *((word*) SID_VOICE3_FREQ#0) ← (unumber)(number) $ffff
Inlining cast (byte*) SCREEN1#0 ← (byte*)(number) $3800
Inlining cast (byte*) SCREEN2#0 ← (byte*)(number) $3c00
Inlining cast (byte*) BUFFER#0 ← (byte*)(number) $4000
Inlining cast (byte*) CHARSET#0 ← (byte*)(number) $3000
Inlining cast (byte) fillscreen::fill#0 ← (unumber)(number) 0
Inlining cast (byte) fillscreen::fill#1 ← (unumber)(number) 0
Inlining cast (byte) fillscreen::fill#2 ← (unumber)(number) 0
Inlining cast (word~) main::toD0181_$0#0 ← (word)(byte*) main::toD0181_screen#1
Inlining cast (word~) main::toD0181_$4#0 ← (word)(byte*) main::toD0181_gfx#1
Inlining cast (word~) main::toD0182_$0#0 ← (word)(byte*) main::toD0182_screen#1
Inlining cast (word~) main::toD0182_$4#0 ← (word)(byte*) main::toD0182_gfx#1
Inlining cast *((byte*) makecharset::font#2) ← (unumber)(number) 0
Inlining cast *((byte*) makecharset::font1#2) ← (unumber)(number) $ff
Inlining cast (byte) makecharset::c#0 ← (unumber)(number) 0
Inlining cast (byte) makecharset::bc#0 ← (unumber)(number) 0
Inlining cast (byte) makecharset::i#0 ← (unumber)(number) 0
Inlining cast (byte) makecharset::b#0 ← (unumber)(number) 0
Inlining cast (byte) makecharset::ii#0 ← (unumber)(number) 0
Inlining cast (word~) makecharset::$13 ← (word)(byte) makecharset::c#3
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53281
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (byte*) 55296
Simplifying constant integer cast 0
Simplifying constant integer cast 7
Simplifying constant pointer cast (word*) 54286
Simplifying constant pointer cast (byte*) 54290
Simplifying constant integer cast $80
Simplifying constant pointer cast (byte*) 54299
Simplifying constant integer cast $ffff
Simplifying constant pointer cast (byte*) 14336
Simplifying constant pointer cast (byte*) 15360
Simplifying constant pointer cast (byte*) 16384
Simplifying constant pointer cast (byte*) 12288
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast $3fff
Simplifying constant integer cast 4
Simplifying constant integer cast 4
Simplifying constant integer cast $f
Simplifying constant integer cast $3fff
Simplifying constant integer cast 4
Simplifying constant integer cast 4
Simplifying constant integer cast $f
Simplifying constant integer cast $28
Simplifying constant integer cast $29
Simplifying constant integer cast 4
Simplifying constant integer cast 2
Simplifying constant integer cast 3
Simplifying constant integer cast $10
Simplifying constant integer cast $30
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 4
Simplifying constant integer cast 8
Simplifying constant integer cast $10
Simplifying constant integer cast $20
Simplifying constant integer cast $40
Simplifying constant integer cast $80
Simplifying constant integer cast 0
Simplifying constant integer cast $ff
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast $3f
Simplifying constant integer cast 8
Simplifying constant integer cast $40
Simplifying constant integer cast 1
Simplifying constant integer cast 7
Simplifying constant integer cast 3
Simplifying constant integer cast 8
Simplifying constant integer cast $40
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 7
Finalized unsigned number type (byte) $80
Finalized unsigned number type (word) $ffff
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
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) $3fff
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) $f
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) $29
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) $10
Finalized unsigned number type (byte) $30
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $ff
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $3f
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) $40
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 7
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) $40
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to word in (unumber~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (word) $3fff
Inferred type updated to word in (unumber~) main::toD0181_$2#0 ← (word~) main::toD0181_$1#0 * (byte) 4
Inferred type updated to byte in (unumber~) main::toD0181_$3#0 ← > (word~) main::toD0181_$2#0
Inferred type updated to byte in (unumber~) main::toD0181_$6#0 ← (byte~) main::toD0181_$5#0 / (byte) 4
Inferred type updated to byte in (unumber~) main::toD0181_$7#0 ← (byte~) main::toD0181_$6#0 & (byte) $f
Inferred type updated to byte in (unumber~) main::toD0181_$8#0 ← (byte~) main::toD0181_$3#0 | (byte~) main::toD0181_$7#0
Inferred type updated to word in (unumber~) main::toD0182_$1#0 ← (word~) main::toD0182_$0#0 & (word) $3fff
Inferred type updated to word in (unumber~) main::toD0182_$2#0 ← (word~) main::toD0182_$1#0 * (byte) 4
Inferred type updated to byte in (unumber~) main::toD0182_$3#0 ← > (word~) main::toD0182_$2#0
Inferred type updated to byte in (unumber~) main::toD0182_$6#0 ← (byte~) main::toD0182_$5#0 / (byte) 4
Inferred type updated to byte in (unumber~) main::toD0182_$7#0 ← (byte~) main::toD0182_$6#0 & (byte) $f
Inferred type updated to byte in (unumber~) main::toD0182_$8#0 ← (byte~) main::toD0182_$3#0 | (byte~) main::toD0182_$7#0
Inferred type updated to byte in (unumber~) fire::$7 ← (byte~) fire::$6 / (byte) 4
Inferred type updated to byte in (unumber~) fire::$11 ← (byte~) fire::$10 / (byte) $10
Inferred type updated to byte in (unumber~) fire::$12 ← (byte) $30 + (byte~) fire::$11
Inferred type updated to byte in (unumber~) makecharset::$7 ← (byte) makecharset::bc#4 - (byte) $40
Inferred type updated to byte in (unumber~) makecharset::$8 ← (byte) makecharset::i#2 & (byte) 1
Inferred type updated to byte in (unumber~) makecharset::$9 ← (byte) makecharset::ii#3 + (byte~) makecharset::$8
Inferred type updated to byte in (unumber~) makecharset::$10 ← (byte~) makecharset::$9 & (byte) 7
Inversing boolean not [95] (bool~) fire::$9 ← (byte) fire::c#0 <= (byte) 2 from [94] (bool~) fire::$8 ← (byte) fire::c#0 > (byte) 2
Inversing boolean not [153] (bool~) makecharset::$6 ← (byte) makecharset::bc#1 <= (byte) $3f from [152] (bool~) makecharset::$5 ← (byte) makecharset::bc#1 > (byte) $3f
Successful SSA optimization Pass2UnaryNotSimplification
Alias (byte) sid_rnd::return#0 = (byte) sid_rnd::return#3 (byte) sid_rnd::return#1 
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#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$7 
Alias (byte*) main::toD0182_screen#0 = (byte*) main::toD0182_screen#1 
Alias (byte*) main::toD0182_gfx#0 = (byte*) main::toD0182_gfx#1 
Alias (byte) main::toD0182_return#0 = (byte~) main::toD0182_$8#0 (byte) main::toD0182_return#2 (byte) main::toD0182_return#1 (byte) main::toD0182_return#3 (byte~) main::$9 
Alias (byte*) fire::screen#0 = (byte*) fire::screenbase#2 
Alias (byte*) fire::buffer#4 = (byte*) fire::buffer#5 (byte*) fire::buffer#8 
Alias (byte*) fire::screen#6 = (byte*) fire::screen#9 (byte*) fire::screen#7 
Alias (byte*) fire::screenbase#3 = (byte*) fire::screenbase#6 (byte*) fire::screenbase#4 (byte*) fire::screenbase#7 
Alias (byte) fire::c#0 = (byte~) fire::$7 (byte) fire::c#3 
Alias (byte*) fire::screen#1 = (byte*~) fire::$0 
Alias (byte*) fire::buffer#1 = (byte*~) fire::$1 
Alias (byte) sid_rnd::return#2 = (byte) sid_rnd::return#4 
Alias (byte*) fire::buffer#7 = (byte*) fire::buffer#9 
Alias (byte*) fire::screen#5 = (byte*) fire::screen#8 
Alias (byte*) makecharset::font#0 = (byte*) makecharset::charset#1 
Alias (byte*) makecharset::charset#2 = (byte*) makecharset::charset#3 
Alias (byte*) makecharset::font1#0 = (byte*~) makecharset::$2 
Alias (byte*) makecharset::charset#12 = (byte*) makecharset::charset#4 
Alias (byte) makecharset::bc#1 = (byte) makecharset::bc#4 
Alias (byte) makecharset::i#2 = (byte) makecharset::i#4 
Alias (byte) makecharset::ii#3 = (byte) makecharset::ii#4 
Alias (byte) makecharset::b#2 = (byte) makecharset::b#4 
Alias (byte) makecharset::c#2 = (byte) makecharset::c#8 
Alias (byte*) makecharset::charset#7 = (byte*) makecharset::charset#8 
Alias (byte) makecharset::bc#2 = (byte~) makecharset::$7 
Alias (byte*) makecharset::charset#11 = (byte*) makecharset::charset#5 (byte*) makecharset::charset#6 
Alias (byte) makecharset::c#3 = (byte) makecharset::c#6 (byte) makecharset::c#4 
Alias (byte) makecharset::i#3 = (byte) makecharset::i#5 
Alias (byte) makecharset::b#3 = (byte) makecharset::b#5 
Alias (byte) makecharset::bc#6 = (byte) makecharset::bc#7 
Successful SSA optimization Pass2AliasElimination
Alias (byte*) fire::buffer#4 = (byte*) fire::buffer#6 
Alias (byte*) fire::screen#4 = (byte*) fire::screen#6 
Alias (byte*) fire::screenbase#3 = (byte*) fire::screenbase#5 
Alias (byte) makecharset::ii#2 = (byte) makecharset::ii#3 
Alias (byte) makecharset::c#2 = (byte) makecharset::c#3 
Alias (byte*) makecharset::charset#11 = (byte*) makecharset::charset#7 
Alias (byte) makecharset::i#2 = (byte) makecharset::i#3 
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte*) fire::screenbase#3
Self Phi Eliminated (byte*) makecharset::charset#2
Self Phi Eliminated (byte*) makecharset::charset#12
Self Phi Eliminated (byte) makecharset::c#2
Self Phi Eliminated (byte) makecharset::i#2
Self Phi Eliminated (byte*) makecharset::charset#11
Self Phi Eliminated (byte) fillscreen::fill#4
Successful SSA optimization Pass2SelfPhiElimination
Identical Phi Values (byte*) fire::screenbase#3 (byte*) fire::screen#0
Identical Phi Values (byte*) makecharset::font#0 (byte*) makecharset::charset#0
Identical Phi Values (byte*) makecharset::charset#2 (byte*) makecharset::font#0
Identical Phi Values (byte*) makecharset::charset#12 (byte*) makecharset::charset#2
Identical Phi Values (byte) makecharset::c#2 (byte) makecharset::c#5
Identical Phi Values (byte) makecharset::i#2 (byte) makecharset::i#6
Identical Phi Values (byte*) makecharset::charset#11 (byte*) makecharset::charset#9
Identical Phi Values (byte) fillscreen::fill#4 (byte) fillscreen::fill#5
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) fire::$3 [87] if((byte*) fire::buffer#4!=(byte*~) fire::$2) goto fire::@2
Simple Condition (bool~) fire::$9 [96] if((byte) fire::c#0<=(byte) 2) goto fire::@4
Simple Condition (bool~) fire::$14 [122] if((byte*) fire::buffer#3!=(byte*~) fire::$13) goto fire::@9
Simple Condition (bool~) makecharset::$1 [132] if((byte*) makecharset::font#1!=(byte*~) makecharset::$0) goto makecharset::@1
Simple Condition (bool~) makecharset::$4 [141] if((byte*) makecharset::font1#1!=(byte*~) makecharset::$3) goto makecharset::@3
Simple Condition (bool~) makecharset::$6 [154] if((byte) makecharset::bc#1<=(byte) $3f) goto makecharset::@8
Simple Condition (bool~) makecharset::$11 [158] if((byte) makecharset::ii#1<(byte) 8) goto makecharset::@7
Simple Condition (bool~) makecharset::$16 [174] if((byte) makecharset::i#1<(byte) 8) goto makecharset::@6
Simple Condition (bool~) makecharset::$17 [178] if((byte) makecharset::c#1<(byte) $40) goto makecharset::@5
Simple Condition (bool~) fillscreen::$0 [187] if((word) fillscreen::i#1!=rangelast(0,$3e7)) goto fillscreen::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [125] (byte[8]) makecharset::bittab#0 ← { (byte) 1, (byte) 2, (byte) 4, (byte) 8, (byte) $10, (byte) $20, (byte) $40, (byte) $80 }
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) BORDERCOL#0 = (byte*) 53280
Constant (const byte*) BGCOL#0 = (byte*) 53281
Constant (const byte*) D018#0 = (byte*) 53272
Constant (const byte*) COLS#0 = (byte*) 55296
Constant (const byte) BLACK#0 = 0
Constant (const byte) YELLOW#0 = 7
Constant (const word*) SID_VOICE3_FREQ#0 = (word*) 54286
Constant (const byte*) SID_VOICE3_CONTROL#0 = (byte*) 54290
Constant (const byte) SID_CONTROL_NOISE#0 = $80
Constant (const byte*) SID_VOICE3_OSC#0 = (byte*) 54299
Constant (const byte*) SCREEN1#0 = (byte*) 14336
Constant (const byte*) SCREEN2#0 = (byte*) 15360
Constant (const byte*) BUFFER#0 = (byte*) 16384
Constant (const byte*) CHARSET#0 = (byte*) 12288
Constant (const byte) fillscreen::fill#0 = 0
Constant (const byte) fillscreen::fill#1 = 0
Constant (const byte) fillscreen::fill#2 = 0
Constant (const byte[8]) makecharset::bittab#0 = { 1, 2, 4, 8, $10, $20, $40, $80 }
Constant (const byte) makecharset::c#0 = 0
Constant (const byte) makecharset::bc#0 = 0
Constant (const byte) makecharset::i#0 = 0
Constant (const byte) makecharset::b#0 = 0
Constant (const byte) makecharset::ii#0 = 0
Constant (const word) fillscreen::i#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) fillscreen::screen#0 = BUFFER#0
Constant (const byte*) fillscreen::screen#1 = SCREEN1#0
Constant (const byte*) fillscreen::screen#2 = SCREEN2#0
Constant (const byte*) fillscreen::screen#3 = COLS#0
Constant (const byte) fillscreen::fill#3 = YELLOW#0
Constant (const byte*) makecharset::charset#0 = CHARSET#0
Constant (const byte*) fire::screenbase#0 = SCREEN1#0
Constant (const byte*) main::toD0181_screen#0 = SCREEN1#0
Constant (const byte*) main::toD0181_gfx#0 = CHARSET#0
Constant (const byte*) fire::screenbase#1 = SCREEN2#0
Constant (const byte*) main::toD0182_screen#0 = SCREEN2#0
Constant (const byte*) main::toD0182_gfx#0 = CHARSET#0
Constant (const byte*) fire::buffer#0 = BUFFER#0
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (word)main::toD0181_screen#0 in [45] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0
Constant value identified (word)main::toD0181_gfx#0 in [49] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0
Constant value identified (word)main::toD0182_screen#0 in [65] (word~) main::toD0182_$0#0 ← (word)(const byte*) main::toD0182_screen#0
Constant value identified (word)main::toD0182_gfx#0 in [69] (word~) main::toD0182_$4#0 ← (word)(const byte*) main::toD0182_gfx#0
Successful SSA optimization Pass2ConstantValues
if() condition always true - replacing block destination [39] if(true) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [185] fillscreen::i#1 ← ++ fillscreen::i#2 to ++
Resolved ranged comparison value [187] if(fillscreen::i#1!=rangelast(0,$3e7)) goto fillscreen::@1 to (number) $3e8
Rewriting conditional comparison [96] if((byte) fire::c#0<=(byte) 2) goto fire::@4
Rewriting conditional comparison [154] if((byte) makecharset::bc#1<=(byte) $3f) goto makecharset::@8
De-inlining pointer[w] to *(pointer+w)   [171] *((byte*~) makecharset::$12 + (word~) makecharset::$15) ← (byte) makecharset::b#3
Successful SSA optimization Pass2DeInlineWordDerefIdx
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Adding number conversion cast (unumber) 2+1 in if((byte) fire::c#0<(byte) 2+(number) 1) goto fire::@4
Adding number conversion cast (unumber) 1 in if((byte) fire::c#0<(unumber)(byte) 2+(number) 1) goto fire::@4
Adding number conversion cast (unumber) $3f+1 in if((byte) makecharset::bc#1<(byte) $3f+(number) 1) goto makecharset::@8
Adding number conversion cast (unumber) 1 in if((byte) makecharset::bc#1<(unumber)(byte) $3f+(number) 1) goto makecharset::@8
Adding number conversion cast (unumber) $3e8 in if((word) fillscreen::i#1!=(number) $3e8) goto fillscreen::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast (byte) 2+(unumber)(number) 1
Simplifying constant integer cast 1
Simplifying constant integer cast (byte) $3f+(unumber)(number) 1
Simplifying constant integer cast 1
Simplifying constant integer cast $3e8
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (word) $3e8
Successful SSA optimization PassNFinalizeNumberTypeConversions
Self Phi Eliminated (byte) makecharset::c#5
Self Phi Eliminated (byte*) makecharset::charset#9
Successful SSA optimization Pass2SelfPhiElimination
Identical Phi Values (byte) makecharset::c#5 (byte) makecharset::c#7
Identical Phi Values (byte*) makecharset::charset#9 (byte*) makecharset::charset#10
Successful SSA optimization Pass2IdenticalPhiElimination
Constant right-side identified [38] (byte*~) fire::$2 ← (const byte*) BUFFER#0 + (word)(number) $18*(number) $28
Constant right-side identified [46] (byte*) fire::buffer#1 ← (const byte*) BUFFER#0 + (word)(number) $18*(number) $28
Constant right-side identified [63] (byte*~) fire::$13 ← (const byte*) BUFFER#0 + (word)(number) $19*(number) $28
Constant right-side identified [69] (byte*~) makecharset::$0 ← (const byte*) makecharset::charset#0 + (byte)(number) 1*(number) 8
Constant right-side identified [71] (byte*) makecharset::font1#0 ← (const byte*) makecharset::charset#0 + (word)(number) $40*(number) 8
Constant right-side identified [75] (byte*~) makecharset::$3 ← (const byte*) makecharset::charset#0 + (word)(number) $100*(number) 8
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) main::toD0181_$0#0 = (word)main::toD0181_screen#0
Constant (const word) main::toD0181_$4#0 = (word)main::toD0181_gfx#0
Constant (const word) main::toD0182_$0#0 = (word)main::toD0182_screen#0
Constant (const word) main::toD0182_$4#0 = (word)main::toD0182_gfx#0
Constant (const byte*) fire::$2 = BUFFER#0+(word)$18*$28
Constant (const byte*) fire::buffer#1 = BUFFER#0+(word)$18*$28
Constant (const byte*) fire::$13 = BUFFER#0+(word)$19*$28
Constant (const byte*) makecharset::$0 = makecharset::charset#0+(byte)1*8
Constant (const byte*) makecharset::font1#0 = makecharset::charset#0+(word)$40*8
Constant (const byte*) makecharset::$3 = makecharset::charset#0+(word)$100*8
Successful SSA optimization Pass2ConstantIdentification
Self Phi Eliminated (byte*) makecharset::charset#10
Successful SSA optimization Pass2SelfPhiElimination
Identical Phi Values (byte*) makecharset::charset#10 (const byte*) makecharset::charset#0
Successful SSA optimization Pass2IdenticalPhiElimination
Constant right-side identified [15] (word~) main::toD0181_$1#0 ← (const word) main::toD0181_$0#0 & (word) $3fff
Constant right-side identified [18] (byte~) main::toD0181_$5#0 ← > (const word) main::toD0181_$4#0
Constant right-side identified [24] (word~) main::toD0182_$1#0 ← (const word) main::toD0182_$0#0 & (word) $3fff
Constant right-side identified [27] (byte~) main::toD0182_$5#0 ← > (const word) main::toD0182_$4#0
Constant right-side identified [80] (byte*~) makecharset::$12 ← (const byte*) makecharset::charset#0 + (byte)(number) 1*(number) 8
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) main::toD0181_$1#0 = main::toD0181_$0#0&$3fff
Constant (const byte) main::toD0181_$5#0 = >main::toD0181_$4#0
Constant (const word) main::toD0182_$1#0 = main::toD0182_$0#0&$3fff
Constant (const byte) main::toD0182_$5#0 = >main::toD0182_$4#0
Constant (const byte*) makecharset::$12 = makecharset::charset#0+(byte)1*8
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [15] (word~) main::toD0181_$2#0 ← (const word) main::toD0181_$1#0 * (byte) 4
Constant right-side identified [17] (byte~) main::toD0181_$6#0 ← (const byte) main::toD0181_$5#0 / (byte) 4
Constant right-side identified [22] (word~) main::toD0182_$2#0 ← (const word) main::toD0182_$1#0 * (byte) 4
Constant right-side identified [24] (byte~) main::toD0182_$6#0 ← (const byte) main::toD0182_$5#0 / (byte) 4
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) main::toD0181_$2#0 = main::toD0181_$1#0*4
Constant (const byte) main::toD0181_$6#0 = main::toD0181_$5#0/4
Constant (const word) main::toD0182_$2#0 = main::toD0182_$1#0*4
Constant (const byte) main::toD0182_$6#0 = main::toD0182_$5#0/4
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [15] (byte~) main::toD0181_$3#0 ← > (const word) main::toD0181_$2#0
Constant right-side identified [16] (byte~) main::toD0181_$7#0 ← (const byte) main::toD0181_$6#0 & (byte) $f
Constant right-side identified [20] (byte~) main::toD0182_$3#0 ← > (const word) main::toD0182_$2#0
Constant right-side identified [21] (byte~) main::toD0182_$7#0 ← (const byte) main::toD0182_$6#0 & (byte) $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::toD0181_$3#0 = >main::toD0181_$2#0
Constant (const byte) main::toD0181_$7#0 = main::toD0181_$6#0&$f
Constant (const byte) main::toD0182_$3#0 = >main::toD0182_$2#0
Constant (const byte) main::toD0182_$7#0 = main::toD0182_$6#0&$f
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [15] (byte) main::toD0181_return#0 ← (const byte) main::toD0181_$3#0 | (const byte) main::toD0181_$7#0
Constant right-side identified [18] (byte) main::toD0182_return#0 ← (const byte) main::toD0182_$3#0 | (const byte) main::toD0182_$7#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::toD0181_return#0 = main::toD0181_$3#0|main::toD0181_$7#0
Constant (const byte) main::toD0182_return#0 = main::toD0182_$3#0|main::toD0182_$7#0
Successful SSA optimization Pass2ConstantIdentification
Rewriting division to use shift [24] (byte) fire::c#0 ← (byte~) fire::$6 / (byte) 4
Rewriting division to use shift [37] (byte~) fire::$11 ← (byte~) fire::$10 / (byte) $10
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const byte*) fire::buffer#0
Inlining constant with var siblings (const byte*) fire::buffer#1
Inlining constant with var siblings (const byte) makecharset::c#0
Inlining constant with var siblings (const byte) makecharset::bc#0
Inlining constant with var siblings (const byte) makecharset::i#0
Inlining constant with var siblings (const byte) makecharset::b#0
Inlining constant with var siblings (const byte) makecharset::ii#0
Inlining constant with var siblings (const byte*) makecharset::font1#0
Inlining constant with var siblings (const byte) fillscreen::fill#0
Inlining constant with var siblings (const byte) fillscreen::fill#1
Inlining constant with var siblings (const byte) fillscreen::fill#2
Inlining constant with var siblings (const word) fillscreen::i#0
Inlining constant with var siblings (const byte*) fillscreen::screen#0
Inlining constant with var siblings (const byte*) fillscreen::screen#1
Inlining constant with var siblings (const byte*) fillscreen::screen#2
Inlining constant with var siblings (const byte*) fillscreen::screen#3
Inlining constant with var siblings (const byte) fillscreen::fill#3
Constant inlined fillscreen::fill#2 = (byte) 0
Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN1#0
Constant inlined main::toD0181_gfx#0 = (const byte*) CHARSET#0
Constant inlined fillscreen::fill#1 = (byte) 0
Constant inlined fillscreen::fill#3 = (const byte) YELLOW#0
Constant inlined makecharset::bc#0 = (byte) 0
Constant inlined fillscreen::screen#3 = (const byte*) COLS#0
Constant inlined fillscreen::screen#2 = (const byte*) SCREEN2#0
Constant inlined fillscreen::screen#1 = (const byte*) SCREEN1#0
Constant inlined fillscreen::screen#0 = (const byte*) BUFFER#0
Constant inlined fire::$13 = (const byte*) BUFFER#0+(word)(number) $19*(number) $28
Constant inlined fire::$2 = (const byte*) BUFFER#0+(word)(number) $18*(number) $28
Constant inlined fire::screenbase#1 = (const byte*) SCREEN2#0
Constant inlined fire::screenbase#0 = (const byte*) SCREEN1#0
Constant inlined makecharset::$12 = (const byte*) CHARSET#0+(byte)(number) 1*(number) 8
Constant inlined fillscreen::i#0 = (word) 0
Constant inlined makecharset::$3 = (const byte*) CHARSET#0+(word)(number) $100*(number) 8
Constant inlined main::toD0182_gfx#0 = (const byte*) CHARSET#0
Constant inlined makecharset::$0 = (const byte*) CHARSET#0+(byte)(number) 1*(number) 8
Constant inlined main::toD0182_$4#0 = (word)(const byte*) CHARSET#0
Constant inlined main::toD0182_$3#0 = >(word)(const byte*) SCREEN2#0&(word) $3fff*(byte) 4
Constant inlined main::toD0181_$0#0 = (word)(const byte*) SCREEN1#0
Constant inlined main::toD0182_$6#0 = >(word)(const byte*) CHARSET#0/(byte) 4
Constant inlined main::toD0181_$1#0 = (word)(const byte*) SCREEN1#0&(word) $3fff
Constant inlined main::toD0182_$5#0 = >(word)(const byte*) CHARSET#0
Constant inlined main::toD0182_$7#0 = >(word)(const byte*) CHARSET#0/(byte) 4&(byte) $f
Constant inlined makecharset::ii#0 = (byte) 0
Constant inlined main::toD0181_$6#0 = >(word)(const byte*) CHARSET#0/(byte) 4
Constant inlined makecharset::i#0 = (byte) 0
Constant inlined makecharset::font1#0 = (const byte*) CHARSET#0+(word)(number) $40*(number) 8
Constant inlined makecharset::charset#0 = (const byte*) CHARSET#0
Constant inlined main::toD0181_$7#0 = >(word)(const byte*) CHARSET#0/(byte) 4&(byte) $f
Constant inlined main::toD0182_$0#0 = (word)(const byte*) SCREEN2#0
Constant inlined main::toD0181_$2#0 = (word)(const byte*) SCREEN1#0&(word) $3fff*(byte) 4
Constant inlined main::toD0182_screen#0 = (const byte*) SCREEN2#0
Constant inlined main::toD0181_$3#0 = >(word)(const byte*) SCREEN1#0&(word) $3fff*(byte) 4
Constant inlined main::toD0181_$4#0 = (word)(const byte*) CHARSET#0
Constant inlined main::toD0182_$2#0 = (word)(const byte*) SCREEN2#0&(word) $3fff*(byte) 4
Constant inlined main::toD0181_$5#0 = >(word)(const byte*) CHARSET#0
Constant inlined main::toD0182_$1#0 = (word)(const byte*) SCREEN2#0&(word) $3fff
Constant inlined makecharset::b#0 = (byte) 0
Constant inlined fire::buffer#1 = (const byte*) BUFFER#0+(word)(number) $18*(number) $28
Constant inlined makecharset::c#0 = (byte) 0
Constant inlined fire::buffer#0 = (const byte*) BUFFER#0
Constant inlined fillscreen::fill#0 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting fire::@12(between fire::@2 and fire::@4)
Added new block during phi lifting fire::@13(between fire::@11 and fire::@9)
Added new block during phi lifting makecharset::@13(between makecharset::@1 and makecharset::@1)
Added new block during phi lifting makecharset::@14(between makecharset::@3 and makecharset::@3)
Added new block during phi lifting makecharset::@15(between makecharset::@11 and makecharset::@5)
Added new block during phi lifting makecharset::@16(between makecharset::@10 and makecharset::@6)
Added new block during phi lifting makecharset::@17(between makecharset::@8 and makecharset::@7)
Added new block during phi lifting makecharset::@18(between makecharset::@7 and makecharset::@8)
Added new block during phi lifting fillscreen::@3(between fillscreen::@1 and fillscreen::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @4
Adding NOP phi() at start of @6
Adding NOP phi() at start of @10
Adding NOP phi() at start of @11
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@9
Adding NOP phi() at start of main::@10
Adding NOP phi() at start of main::@11
Adding NOP phi() at start of main::@12
Adding NOP phi() at start of main::@13
Adding NOP phi() at start of main::@14
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of main::@15
Adding NOP phi() at start of main::toD0181
Adding NOP phi() at start of main::toD0181_@return
Adding NOP phi() at start of main::@16
Adding NOP phi() at start of main::toD0182
Adding NOP phi() at start of main::toD0182_@return
Adding NOP phi() at start of makecharset
Adding NOP phi() at start of makecharset::@2
Adding NOP phi() at start of makecharset::@4
CALL GRAPH
Calls in [] to main:4 
Calls in [main] to fillscreen:10 fillscreen:12 fillscreen:14 fillscreen:16 sid_rnd_init:18 makecharset:20 fire:24 fire:29 
Calls in [fire] to sid_rnd:41 

Created 20 initial phi equivalence classes
Not coalescing [35] fire::screen#10 ← fire::screen#0
Coalesced [39] fire::screen#13 ← fire::screen#1
Coalesced [52] fire::buffer#11 ← fire::buffer#3
Coalesced [53] fire::screen#12 ← fire::screen#3
Coalesced [60] fire::c#5 ← fire::c#1
Coalesced [66] fire::buffer#10 ← fire::buffer#2
Coalesced [67] fire::screen#11 ← fire::screen#2
Coalesced [68] fire::c#4 ← fire::c#0
Coalesced [84] makecharset::bc#9 ← makecharset::bc#5
Coalesced [93] makecharset::bc#12 ← makecharset::bc#2
Coalesced [94] makecharset::b#8 ← makecharset::b#1
Coalesced [108] makecharset::c#9 ← makecharset::c#1
Coalesced [109] makecharset::bc#8 ← makecharset::bc#6
Coalesced [110] makecharset::i#7 ← makecharset::i#1
Coalesced (already) [111] makecharset::bc#10 ← makecharset::bc#6
Coalesced [112] makecharset::ii#5 ← makecharset::ii#1
Coalesced [113] makecharset::b#6 ← makecharset::b#3
Coalesced [114] makecharset::bc#11 ← makecharset::bc#1
Coalesced (already) [115] makecharset::b#7 ← makecharset::b#2
Coalesced [116] makecharset::font1#3 ← makecharset::font1#1
Coalesced [117] makecharset::font#3 ← makecharset::font#1
Coalesced [122] fillscreen::screen#7 ← fillscreen::screen#6
Coalesced [129] fillscreen::screen#8 ← fillscreen::screen#4
Coalesced [130] fillscreen::i#3 ← fillscreen::i#1
Coalesced down to 16 phi equivalence classes
Culled Empty Block (label) @4
Culled Empty Block (label) @6
Culled Empty Block (label) @11
Culled Empty Block (label) main::@14
Culled Empty Block (label) main::@1
Culled Empty Block (label) main::@15
Culled Empty Block (label) main::toD0181_@return
Culled Empty Block (label) main::@16
Culled Empty Block (label) main::toD0182_@return
Culled Empty Block (label) fire::@13
Culled Empty Block (label) fire::@12
Culled Empty Block (label) makecharset::@2
Culled Empty Block (label) makecharset::@4
Culled Empty Block (label) makecharset::@15
Culled Empty Block (label) makecharset::@16
Culled Empty Block (label) makecharset::@17
Culled Empty Block (label) makecharset::@18
Culled Empty Block (label) makecharset::@14
Culled Empty Block (label) makecharset::@13
Culled Empty Block (label) fillscreen::@3
Renumbering block @10 to @1
Renumbering block main::@2 to main::@1
Renumbering block main::@7 to main::@2
Renumbering block main::@8 to main::@3
Renumbering block main::@9 to main::@4
Renumbering block main::@10 to main::@5
Renumbering block main::@11 to main::@6
Renumbering block main::@12 to main::@7
Renumbering block main::@13 to main::@8
Renumbering block fire::@7 to fire::@5
Renumbering block fire::@9 to fire::@6
Renumbering block fire::@11 to fire::@7
Renumbering block makecharset::@3 to makecharset::@2
Renumbering block makecharset::@5 to makecharset::@3
Renumbering block makecharset::@6 to makecharset::@4
Renumbering block makecharset::@7 to makecharset::@5
Renumbering block makecharset::@8 to makecharset::@6
Renumbering block makecharset::@9 to makecharset::@7
Renumbering block makecharset::@10 to makecharset::@8
Renumbering block makecharset::@11 to makecharset::@9
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@4
Adding NOP phi() at start of main::@5
Adding NOP phi() at start of main::@6
Adding NOP phi() at start of main::@7
Adding NOP phi() at start of main::@8
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::toD0181
Adding NOP phi() at start of main::toD0182
Adding NOP phi() at start of makecharset

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  [1] phi()
  [2] call main 
  to:@end
@end: scope:[]  from @1
  [3] phi()
main: scope:[main]  from @1
  asm { sei  }
  [5] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0
  [6] *((const byte*) BGCOL#0) ← (const byte) BLACK#0
  [7] call fillscreen 
  to:main::@4
main::@4: scope:[main]  from main
  [8] phi()
  [9] call fillscreen 
  to:main::@5
main::@5: scope:[main]  from main::@4
  [10] phi()
  [11] call fillscreen 
  to:main::@6
main::@6: scope:[main]  from main::@5
  [12] phi()
  [13] call fillscreen 
  to:main::@7
main::@7: scope:[main]  from main::@6
  [14] phi()
  [15] call sid_rnd_init 
  to:main::@8
main::@8: scope:[main]  from main::@7
  [16] phi()
  [17] call makecharset 
  to:main::@1
main::@1: scope:[main]  from main::@3 main::@8
  [18] phi()
  [19] call fire 
  to:main::toD0181
main::toD0181: scope:[main]  from main::@1
  [20] phi()
  to:main::@2
main::@2: scope:[main]  from main::toD0181
  [21] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
  [22] call fire 
  to:main::toD0182
main::toD0182: scope:[main]  from main::@2
  [23] phi()
  to:main::@3
main::@3: scope:[main]  from main::toD0182
  [24] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0
  to:main::@1
fire: scope:[fire]  from main::@1 main::@2
  [25] (byte*) fire::screen#0 ← phi( main::@1/(const byte*) SCREEN1#0 main::@2/(const byte*) SCREEN2#0 )
  [26] (byte*~) fire::screen#10 ← (byte*) fire::screen#0
  to:fire::@1
fire::@1: scope:[fire]  from fire fire::@4
  [27] (byte*) fire::screen#4 ← phi( fire/(byte*~) fire::screen#10 fire::@4/(byte*) fire::screen#2 )
  [27] (byte*) fire::buffer#4 ← phi( fire/(const byte*) BUFFER#0 fire::@4/(byte*) fire::buffer#2 )
  [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER#0+(word)(number) $18*(number) $28) goto fire::@2
  to:fire::@3
fire::@3: scope:[fire]  from fire::@1
  [29] (byte*) fire::screen#1 ← (byte*) fire::screen#0 + (word)(number) $18*(number) $28
  to:fire::@6
fire::@6: scope:[fire]  from fire::@3 fire::@7
  [30] (byte*) fire::screen#5 ← phi( fire::@7/(byte*) fire::screen#3 fire::@3/(byte*) fire::screen#1 )
  [30] (byte*) fire::buffer#7 ← phi( fire::@7/(byte*) fire::buffer#3 fire::@3/(const byte*) BUFFER#0+(word)(number) $18*(number) $28 )
  [31] call sid_rnd 
  [32] (byte) sid_rnd::return#2 ← (byte) sid_rnd::return#0
  to:fire::@7
fire::@7: scope:[fire]  from fire::@6
  [33] (byte~) fire::$10 ← (byte) sid_rnd::return#2
  [34] (byte~) fire::$11 ← (byte~) fire::$10 >> (byte) 4
  [35] (byte~) fire::$12 ← (byte) $30 + (byte~) fire::$11
  [36] *((byte*) fire::buffer#7) ← (byte~) fire::$12
  [37] *((byte*) fire::screen#5) ← *((byte*) fire::buffer#7)
  [38] (byte*) fire::screen#3 ← ++ (byte*) fire::screen#5
  [39] (byte*) fire::buffer#3 ← ++ (byte*) fire::buffer#7
  [40] if((byte*) fire::buffer#3!=(const byte*) BUFFER#0+(word)(number) $19*(number) $28) goto fire::@6
  to:fire::@return
fire::@return: scope:[fire]  from fire::@7
  [41] return 
  to:@return
fire::@2: scope:[fire]  from fire::@1
  [42] (byte~) fire::$4 ← *((byte*) fire::buffer#4 + (byte)(number) $28-(number) 1) + *((byte*) fire::buffer#4 + (byte)(number) $28-(number) 1)
  [43] (byte~) fire::$5 ← (byte~) fire::$4 + *((byte*) fire::buffer#4 + (byte) $28)
  [44] (byte~) fire::$6 ← (byte~) fire::$5 + *((byte*) fire::buffer#4 + (byte) $29)
  [45] (byte) fire::c#0 ← (byte~) fire::$6 >> (byte) 2
  [46] if((byte) fire::c#0<(byte) 2+(byte) 1) goto fire::@4
  to:fire::@5
fire::@5: scope:[fire]  from fire::@2
  [47] (byte) fire::c#1 ← (byte) fire::c#0 - (byte) 3
  to:fire::@4
fire::@4: scope:[fire]  from fire::@2 fire::@5
  [48] (byte) fire::c#2 ← phi( fire::@2/(byte) fire::c#0 fire::@5/(byte) fire::c#1 )
  [49] *((byte*) fire::buffer#4) ← (byte) fire::c#2
  [50] *((byte*) fire::screen#4) ← *((byte*) fire::buffer#4)
  [51] (byte*) fire::screen#2 ← ++ (byte*) fire::screen#4
  [52] (byte*) fire::buffer#2 ← ++ (byte*) fire::buffer#4
  to:fire::@1
sid_rnd: scope:[sid_rnd]  from fire::@6
  [53] (byte) sid_rnd::return#0 ← *((const byte*) SID_VOICE3_OSC#0)
  to:sid_rnd::@return
sid_rnd::@return: scope:[sid_rnd]  from sid_rnd
  [54] return 
  to:@return
makecharset: scope:[makecharset]  from main::@8
  [55] phi()
  to:makecharset::@1
makecharset::@1: scope:[makecharset]  from makecharset makecharset::@1
  [56] (byte*) makecharset::font#2 ← phi( makecharset/(const byte*) CHARSET#0 makecharset::@1/(byte*) makecharset::font#1 )
  [57] *((byte*) makecharset::font#2) ← (byte) 0
  [58] (byte*) makecharset::font#1 ← ++ (byte*) makecharset::font#2
  [59] if((byte*) makecharset::font#1!=(const byte*) CHARSET#0+(byte)(number) 1*(number) 8) goto makecharset::@1
  to:makecharset::@2
makecharset::@2: scope:[makecharset]  from makecharset::@1 makecharset::@2
  [60] (byte*) makecharset::font1#2 ← phi( makecharset::@1/(const byte*) CHARSET#0+(word)(number) $40*(number) 8 makecharset::@2/(byte*) makecharset::font1#1 )
  [61] *((byte*) makecharset::font1#2) ← (byte) $ff
  [62] (byte*) makecharset::font1#1 ← ++ (byte*) makecharset::font1#2
  [63] if((byte*) makecharset::font1#1!=(const byte*) CHARSET#0+(word)(number) $100*(number) 8) goto makecharset::@2
  to:makecharset::@3
makecharset::@3: scope:[makecharset]  from makecharset::@2 makecharset::@9
  [64] (byte) makecharset::c#7 ← phi( makecharset::@9/(byte) makecharset::c#1 makecharset::@2/(byte) 0 )
  to:makecharset::@4
makecharset::@4: scope:[makecharset]  from makecharset::@3 makecharset::@8
  [65] (byte) makecharset::i#6 ← phi( makecharset::@8/(byte) makecharset::i#1 makecharset::@3/(byte) 0 )
  [65] (byte) makecharset::bc#5 ← phi( makecharset::@8/(byte) makecharset::bc#6 makecharset::@3/(byte) 0 )
  to:makecharset::@5
makecharset::@5: scope:[makecharset]  from makecharset::@4 makecharset::@6
  [66] (byte) makecharset::b#2 ← phi( makecharset::@4/(byte) 0 makecharset::@6/(byte) makecharset::b#3 )
  [66] (byte) makecharset::ii#2 ← phi( makecharset::@4/(byte) 0 makecharset::@6/(byte) makecharset::ii#1 )
  [66] (byte) makecharset::bc#3 ← phi( makecharset::@4/(byte) makecharset::bc#5 makecharset::@6/(byte) makecharset::bc#6 )
  [67] (byte) makecharset::bc#1 ← (byte) makecharset::bc#3 + (byte) makecharset::c#7
  [68] if((byte) makecharset::bc#1<(byte) $3f+(byte) 1) goto makecharset::@6
  to:makecharset::@7
makecharset::@7: scope:[makecharset]  from makecharset::@5
  [69] (byte) makecharset::bc#2 ← (byte) makecharset::bc#1 - (byte) $40
  [70] (byte~) makecharset::$8 ← (byte) makecharset::i#6 & (byte) 1
  [71] (byte~) makecharset::$9 ← (byte) makecharset::ii#2 + (byte~) makecharset::$8
  [72] (byte~) makecharset::$10 ← (byte~) makecharset::$9 & (byte) 7
  [73] (byte) makecharset::b#1 ← (byte) makecharset::b#2 + *((const byte[8]) makecharset::bittab#0 + (byte~) makecharset::$10)
  to:makecharset::@6
makecharset::@6: scope:[makecharset]  from makecharset::@5 makecharset::@7
  [74] (byte) makecharset::b#3 ← phi( makecharset::@5/(byte) makecharset::b#2 makecharset::@7/(byte) makecharset::b#1 )
  [74] (byte) makecharset::bc#6 ← phi( makecharset::@5/(byte) makecharset::bc#1 makecharset::@7/(byte) makecharset::bc#2 )
  [75] (byte) makecharset::ii#1 ← ++ (byte) makecharset::ii#2
  [76] if((byte) makecharset::ii#1<(byte) 8) goto makecharset::@5
  to:makecharset::@8
makecharset::@8: scope:[makecharset]  from makecharset::@6
  [77] (word~) makecharset::$13 ← (word)(byte) makecharset::c#7
  [78] (word~) makecharset::$14 ← (word~) makecharset::$13 << (byte) 3
  [79] (word~) makecharset::$15 ← (word~) makecharset::$14 + (byte) makecharset::i#6
  [80] (byte*~) makecharset::$18 ← (const byte*) CHARSET#0+(byte)(number) 1*(number) 8 + (word~) makecharset::$15
  [81] *((byte*~) makecharset::$18) ← (byte) makecharset::b#3
  [82] (byte) makecharset::i#1 ← ++ (byte) makecharset::i#6
  [83] if((byte) makecharset::i#1<(byte) 8) goto makecharset::@4
  to:makecharset::@9
makecharset::@9: scope:[makecharset]  from makecharset::@8
  [84] (byte) makecharset::c#1 ← ++ (byte) makecharset::c#7
  [85] if((byte) makecharset::c#1<(byte) $40) goto makecharset::@3
  to:makecharset::@return
makecharset::@return: scope:[makecharset]  from makecharset::@9
  [86] return 
  to:@return
sid_rnd_init: scope:[sid_rnd_init]  from main::@7
  [87] *((const word*) SID_VOICE3_FREQ#0) ← (word) $ffff
  [88] *((const byte*) SID_VOICE3_CONTROL#0) ← (const byte) SID_CONTROL_NOISE#0
  to:sid_rnd_init::@return
sid_rnd_init::@return: scope:[sid_rnd_init]  from sid_rnd_init
  [89] return 
  to:@return
fillscreen: scope:[fillscreen]  from main main::@4 main::@5 main::@6
  [90] (byte*) fillscreen::screen#6 ← phi( main/(const byte*) BUFFER#0 main::@5/(const byte*) SCREEN2#0 main::@6/(const byte*) COLS#0 main::@4/(const byte*) SCREEN1#0 )
  [90] (byte) fillscreen::fill#5 ← phi( main/(byte) 0 main::@5/(byte) 0 main::@6/(const byte) YELLOW#0 main::@4/(byte) 0 )
  to:fillscreen::@1
fillscreen::@1: scope:[fillscreen]  from fillscreen fillscreen::@1
  [91] (word) fillscreen::i#2 ← phi( fillscreen/(word) 0 fillscreen::@1/(word) fillscreen::i#1 )
  [91] (byte*) fillscreen::screen#5 ← phi( fillscreen/(byte*) fillscreen::screen#6 fillscreen::@1/(byte*) fillscreen::screen#4 )
  [92] *((byte*) fillscreen::screen#5) ← (byte) fillscreen::fill#5
  [93] (byte*) fillscreen::screen#4 ← ++ (byte*) fillscreen::screen#5
  [94] (word) fillscreen::i#1 ← ++ (word) fillscreen::i#2
  [95] if((word) fillscreen::i#1!=(word) $3e8) goto fillscreen::@1
  to:fillscreen::@return
fillscreen::@return: scope:[fillscreen]  from fillscreen::@1
  [96] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(byte*) BGCOL
(byte) BLACK
(byte*) BORDERCOL
(byte*) BUFFER
(byte*) CHARSET
(byte*) COLS
(byte*) D018
(byte*) SCREEN1
(byte*) SCREEN2
(byte) SID_CONTROL_NOISE
(byte*) SID_VOICE3_CONTROL
(word*) SID_VOICE3_FREQ
(byte*) SID_VOICE3_OSC
(byte) YELLOW
(void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill)
(byte) fillscreen::fill
(byte) fillscreen::fill#5 1.8333333333333333
(word) fillscreen::i
(word) fillscreen::i#1 16.5
(word) fillscreen::i#2 7.333333333333333
(byte*) fillscreen::screen
(byte*) fillscreen::screen#4 7.333333333333333
(byte*) fillscreen::screen#5 17.5
(byte*) fillscreen::screen#6 2.0
(void()) fire((byte*) fire::screenbase)
(byte~) fire::$10 202.0
(byte~) fire::$11 202.0
(byte~) fire::$12 202.0
(byte~) fire::$4 202.0
(byte~) fire::$5 202.0
(byte~) fire::$6 202.0
(byte*) fire::buffer
(byte*) fire::buffer#2 202.0
(byte*) fire::buffer#3 151.5
(byte*) fire::buffer#4 75.75
(byte*) fire::buffer#7 44.888888888888886
(byte) fire::c
(byte) fire::c#0 202.0
(byte) fire::c#1 202.0
(byte) fire::c#2 303.0
(byte*) fire::screen
(byte*) fire::screen#0 0.26666666666666666
(byte*) fire::screen#1 4.0
(byte*~) fire::screen#10 4.0
(byte*) fire::screen#2 101.0
(byte*) fire::screen#3 67.33333333333333
(byte*) fire::screen#4 27.727272727272727
(byte*) fire::screen#5 38.125
(byte*) fire::screenbase
(void()) main()
(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
(byte*) main::toD0181_gfx
(byte) main::toD0181_return
(byte*) main::toD0181_screen
(word~) main::toD0182_$0
(number~) main::toD0182_$1
(number~) main::toD0182_$2
(number~) main::toD0182_$3
(word~) main::toD0182_$4
(byte~) main::toD0182_$5
(number~) main::toD0182_$6
(number~) main::toD0182_$7
(number~) main::toD0182_$8
(byte*) main::toD0182_gfx
(byte) main::toD0182_return
(byte*) main::toD0182_screen
(void()) makecharset((byte*) makecharset::charset)
(byte~) makecharset::$10 2002.0
(word~) makecharset::$13 202.0
(word~) makecharset::$14 202.0
(word~) makecharset::$15 202.0
(byte*~) makecharset::$18 202.0
(byte~) makecharset::$8 2002.0
(byte~) makecharset::$9 2002.0
(byte) makecharset::b
(byte) makecharset::b#1 2002.0
(byte) makecharset::b#2 429.0
(byte) makecharset::b#3 443.42857142857144
(byte) makecharset::bc
(byte) makecharset::bc#1 2002.0
(byte) makecharset::bc#2 400.4
(byte) makecharset::bc#3 2103.0
(byte) makecharset::bc#5 202.0
(byte) makecharset::bc#6 310.4
(byte[8]) makecharset::bittab
(byte) makecharset::c
(byte) makecharset::c#1 16.5
(byte) makecharset::c#7 51.14999999999999
(byte*) makecharset::charset
(byte*) makecharset::font
(byte*) makecharset::font#1 16.5
(byte*) makecharset::font#2 16.5
(byte*) makecharset::font1
(byte*) makecharset::font1#1 16.5
(byte*) makecharset::font1#2 16.5
(byte) makecharset::i
(byte) makecharset::i#1 151.5
(byte) makecharset::i#6 76.70588235294117
(byte) makecharset::ii
(byte) makecharset::ii#1 1501.5
(byte) makecharset::ii#2 333.6666666666667
(byte()) sid_rnd()
(byte) sid_rnd::return
(byte) sid_rnd::return#0 34.33333333333333
(byte) sid_rnd::return#2 202.0
(void()) sid_rnd_init()

Initial phi equivalence classes
[ fire::screen#0 ]
[ fire::buffer#4 fire::buffer#2 ]
[ fire::screen#4 fire::screen#10 fire::screen#2 ]
[ fire::buffer#7 fire::buffer#3 ]
[ fire::screen#5 fire::screen#3 fire::screen#1 ]
[ fire::c#2 fire::c#0 fire::c#1 ]
[ makecharset::font#2 makecharset::font#1 ]
[ makecharset::font1#2 makecharset::font1#1 ]
[ makecharset::c#7 makecharset::c#1 ]
[ makecharset::i#6 makecharset::i#1 ]
[ makecharset::bc#3 makecharset::bc#5 makecharset::bc#6 makecharset::bc#1 makecharset::bc#2 ]
[ makecharset::ii#2 makecharset::ii#1 ]
[ makecharset::b#2 makecharset::b#3 makecharset::b#1 ]
[ fillscreen::fill#5 ]
[ fillscreen::screen#5 fillscreen::screen#6 fillscreen::screen#4 ]
[ fillscreen::i#2 fillscreen::i#1 ]
Added variable sid_rnd::return#2 to zero page equivalence class [ sid_rnd::return#2 ]
Added variable fire::$10 to zero page equivalence class [ fire::$10 ]
Added variable fire::$11 to zero page equivalence class [ fire::$11 ]
Added variable fire::$12 to zero page equivalence class [ fire::$12 ]
Added variable fire::$4 to zero page equivalence class [ fire::$4 ]
Added variable fire::$5 to zero page equivalence class [ fire::$5 ]
Added variable fire::$6 to zero page equivalence class [ fire::$6 ]
Added variable sid_rnd::return#0 to zero page equivalence class [ sid_rnd::return#0 ]
Added variable makecharset::$8 to zero page equivalence class [ makecharset::$8 ]
Added variable makecharset::$9 to zero page equivalence class [ makecharset::$9 ]
Added variable makecharset::$10 to zero page equivalence class [ makecharset::$10 ]
Added variable makecharset::$13 to zero page equivalence class [ makecharset::$13 ]
Added variable makecharset::$14 to zero page equivalence class [ makecharset::$14 ]
Added variable makecharset::$15 to zero page equivalence class [ makecharset::$15 ]
Added variable makecharset::$18 to zero page equivalence class [ makecharset::$18 ]
Complete equivalence classes
[ fire::screen#0 ]
[ fire::buffer#4 fire::buffer#2 ]
[ fire::screen#4 fire::screen#10 fire::screen#2 ]
[ fire::buffer#7 fire::buffer#3 ]
[ fire::screen#5 fire::screen#3 fire::screen#1 ]
[ fire::c#2 fire::c#0 fire::c#1 ]
[ makecharset::font#2 makecharset::font#1 ]
[ makecharset::font1#2 makecharset::font1#1 ]
[ makecharset::c#7 makecharset::c#1 ]
[ makecharset::i#6 makecharset::i#1 ]
[ makecharset::bc#3 makecharset::bc#5 makecharset::bc#6 makecharset::bc#1 makecharset::bc#2 ]
[ makecharset::ii#2 makecharset::ii#1 ]
[ makecharset::b#2 makecharset::b#3 makecharset::b#1 ]
[ fillscreen::fill#5 ]
[ fillscreen::screen#5 fillscreen::screen#6 fillscreen::screen#4 ]
[ fillscreen::i#2 fillscreen::i#1 ]
[ sid_rnd::return#2 ]
[ fire::$10 ]
[ fire::$11 ]
[ fire::$12 ]
[ fire::$4 ]
[ fire::$5 ]
[ fire::$6 ]
[ sid_rnd::return#0 ]
[ makecharset::$8 ]
[ makecharset::$9 ]
[ makecharset::$10 ]
[ makecharset::$13 ]
[ makecharset::$14 ]
[ makecharset::$15 ]
[ makecharset::$18 ]
Allocated zp ZP_WORD:2 [ fire::screen#0 ]
Allocated zp ZP_WORD:4 [ fire::buffer#4 fire::buffer#2 ]
Allocated zp ZP_WORD:6 [ fire::screen#4 fire::screen#10 fire::screen#2 ]
Allocated zp ZP_WORD:8 [ fire::buffer#7 fire::buffer#3 ]
Allocated zp ZP_WORD:10 [ fire::screen#5 fire::screen#3 fire::screen#1 ]
Allocated zp ZP_BYTE:12 [ fire::c#2 fire::c#0 fire::c#1 ]
Allocated zp ZP_WORD:13 [ makecharset::font#2 makecharset::font#1 ]
Allocated zp ZP_WORD:15 [ makecharset::font1#2 makecharset::font1#1 ]
Allocated zp ZP_BYTE:17 [ makecharset::c#7 makecharset::c#1 ]
Allocated zp ZP_BYTE:18 [ makecharset::i#6 makecharset::i#1 ]
Allocated zp ZP_BYTE:19 [ makecharset::bc#3 makecharset::bc#5 makecharset::bc#6 makecharset::bc#1 makecharset::bc#2 ]
Allocated zp ZP_BYTE:20 [ makecharset::ii#2 makecharset::ii#1 ]
Allocated zp ZP_BYTE:21 [ makecharset::b#2 makecharset::b#3 makecharset::b#1 ]
Allocated zp ZP_BYTE:22 [ fillscreen::fill#5 ]
Allocated zp ZP_WORD:23 [ fillscreen::screen#5 fillscreen::screen#6 fillscreen::screen#4 ]
Allocated zp ZP_WORD:25 [ fillscreen::i#2 fillscreen::i#1 ]
Allocated zp ZP_BYTE:27 [ sid_rnd::return#2 ]
Allocated zp ZP_BYTE:28 [ fire::$10 ]
Allocated zp ZP_BYTE:29 [ fire::$11 ]
Allocated zp ZP_BYTE:30 [ fire::$12 ]
Allocated zp ZP_BYTE:31 [ fire::$4 ]
Allocated zp ZP_BYTE:32 [ fire::$5 ]
Allocated zp ZP_BYTE:33 [ fire::$6 ]
Allocated zp ZP_BYTE:34 [ sid_rnd::return#0 ]
Allocated zp ZP_BYTE:35 [ makecharset::$8 ]
Allocated zp ZP_BYTE:36 [ makecharset::$9 ]
Allocated zp ZP_BYTE:37 [ makecharset::$10 ]
Allocated zp ZP_WORD:38 [ makecharset::$13 ]
Allocated zp ZP_WORD:40 [ makecharset::$14 ]
Allocated zp ZP_WORD:42 [ makecharset::$15 ]
Allocated zp ZP_WORD:44 [ makecharset::$18 ]

INITIAL ASM
  // File Comments
// A KickC version of the fire routine from the CC65 samples
// (w)2002 by groepaz/hitmen
// Cleanup and porting to CC65 by Ullrich von Bassewitz and Greg King .
// Ported to KickC by Jesper Gravgaard.
// Original source https://github.com/cc65/cc65/blob/master/samples/fire.c
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label BORDERCOL = $d020
  .label BGCOL = $d021
  .label D018 = $d018
  // Color Ram
  .label COLS = $d800
  // The colors of the C64
  .const BLACK = 0
  .const YELLOW = 7
  // SID registers for random number generation
  .label SID_VOICE3_FREQ = $d40e
  .label SID_VOICE3_CONTROL = $d412
  .const SID_CONTROL_NOISE = $80
  .label SID_VOICE3_OSC = $d41b
  .label SCREEN1 = $3800
  .label SCREEN2 = $3c00
  .label BUFFER = $4000
  .label CHARSET = $3000
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    .const toD0181_return = (>(SCREEN1&$3fff)*4)|(>CHARSET)/4&$f
    .const toD0182_return = (>(SCREEN2&$3fff)*4)|(>CHARSET)/4&$f
    // asm { sei  }
    sei
    // [5] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 
    lda #BLACK
    sta BORDERCOL
    // [6] *((const byte*) BGCOL#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 
    lda #BLACK
    sta BGCOL
    // [7] call fillscreen 
    // [90] phi from main to fillscreen [phi:main->fillscreen]
  fillscreen_from_main:
    // [90] phi (byte*) fillscreen::screen#6 = (const byte*) BUFFER#0 [phi:main->fillscreen#0] -- pbuz1=pbuc1 
    lda #<BUFFER
    sta fillscreen.screen
    lda #>BUFFER
    sta fillscreen.screen+1
    // [90] phi (byte) fillscreen::fill#5 = (byte) 0 [phi:main->fillscreen#1] -- vbuz1=vbuc1 
    lda #0
    sta fillscreen.fill
    jsr fillscreen
    // [8] phi from main to main::@4 [phi:main->main::@4]
  b4_from_main:
    jmp b4
    // main::@4
  b4:
    // [9] call fillscreen 
    // [90] phi from main::@4 to fillscreen [phi:main::@4->fillscreen]
  fillscreen_from_b4:
    // [90] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN1#0 [phi:main::@4->fillscreen#0] -- pbuz1=pbuc1 
    lda #<SCREEN1
    sta fillscreen.screen
    lda #>SCREEN1
    sta fillscreen.screen+1
    // [90] phi (byte) fillscreen::fill#5 = (byte) 0 [phi:main::@4->fillscreen#1] -- vbuz1=vbuc1 
    lda #0
    sta fillscreen.fill
    jsr fillscreen
    // [10] phi from main::@4 to main::@5 [phi:main::@4->main::@5]
  b5_from_b4:
    jmp b5
    // main::@5
  b5:
    // [11] call fillscreen 
    // [90] phi from main::@5 to fillscreen [phi:main::@5->fillscreen]
  fillscreen_from_b5:
    // [90] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN2#0 [phi:main::@5->fillscreen#0] -- pbuz1=pbuc1 
    lda #<SCREEN2
    sta fillscreen.screen
    lda #>SCREEN2
    sta fillscreen.screen+1
    // [90] phi (byte) fillscreen::fill#5 = (byte) 0 [phi:main::@5->fillscreen#1] -- vbuz1=vbuc1 
    lda #0
    sta fillscreen.fill
    jsr fillscreen
    // [12] phi from main::@5 to main::@6 [phi:main::@5->main::@6]
  b6_from_b5:
    jmp b6
    // main::@6
  b6:
    // [13] call fillscreen 
    // [90] phi from main::@6 to fillscreen [phi:main::@6->fillscreen]
  fillscreen_from_b6:
    // [90] phi (byte*) fillscreen::screen#6 = (const byte*) COLS#0 [phi:main::@6->fillscreen#0] -- pbuz1=pbuc1 
    lda #<COLS
    sta fillscreen.screen
    lda #>COLS
    sta fillscreen.screen+1
    // [90] phi (byte) fillscreen::fill#5 = (const byte) YELLOW#0 [phi:main::@6->fillscreen#1] -- vbuz1=vbuc1 
    lda #YELLOW
    sta fillscreen.fill
    jsr fillscreen
    // [14] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
  b7_from_b6:
    jmp b7
    // main::@7
  b7:
    // [15] call sid_rnd_init 
    jsr sid_rnd_init
    // [16] phi from main::@7 to main::@8 [phi:main::@7->main::@8]
  b8_from_b7:
    jmp b8
    // main::@8
  b8:
    // [17] call makecharset 
    // [55] phi from main::@8 to makecharset [phi:main::@8->makecharset]
  makecharset_from_b8:
    jsr makecharset
    // [18] phi from main::@3 main::@8 to main::@1 [phi:main::@3/main::@8->main::@1]
  b1_from_b3:
  b1_from_b8:
    jmp b1
    // main::@1
  b1:
    // [19] call fire 
    // [25] phi from main::@1 to fire [phi:main::@1->fire]
  fire_from_b1:
    // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN1#0 [phi:main::@1->fire#0] -- pbuz1=pbuc1 
    lda #<SCREEN1
    sta fire.screen
    lda #>SCREEN1
    sta fire.screen+1
    jsr fire
    // [20] phi from main::@1 to main::toD0181 [phi:main::@1->main::toD0181]
  toD0181_from_b1:
    jmp toD0181
    // main::toD0181
  toD0181:
    jmp b2
    // main::@2
  b2:
    // [21] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0181_return
    sta D018
    // [22] call fire 
    // [25] phi from main::@2 to fire [phi:main::@2->fire]
  fire_from_b2:
    // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN2#0 [phi:main::@2->fire#0] -- pbuz1=pbuc1 
    lda #<SCREEN2
    sta fire.screen
    lda #>SCREEN2
    sta fire.screen+1
    jsr fire
    // [23] phi from main::@2 to main::toD0182 [phi:main::@2->main::toD0182]
  toD0182_from_b2:
    jmp toD0182
    // main::toD0182
  toD0182:
    jmp b3
    // main::@3
  b3:
    // [24] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0182_return
    sta D018
    jmp b1_from_b3
}
  // fire
// Animate the fire on the passed screen. Uses BUFFER to store the current values.
fire: {
    .label _4 = $1f
    .label _5 = $20
    .label _6 = $21
    .label _10 = $1c
    .label _11 = $1d
    .label _12 = $1e
    .label screen = 2
    .label c = $c
    .label screen_1 = $a
    .label screen_2 = 6
    .label buffer = 4
    .label screen_3 = $a
    .label buffer_3 = 8
    .label screen_4 = 6
    .label buffer_7 = 8
    .label screen_5 = $a
    .label screen_10 = 6
    // [26] (byte*~) fire::screen#10 ← (byte*) fire::screen#0 -- pbuz1=pbuz2 
    lda screen
    sta screen_10
    lda screen+1
    sta screen_10+1
    // [27] phi from fire to fire::@1 [phi:fire->fire::@1]
  b1_from_fire:
    // [27] phi (byte*) fire::screen#4 = (byte*~) fire::screen#10 [phi:fire->fire::@1#0] -- register_copy 
    // [27] phi (byte*) fire::buffer#4 = (const byte*) BUFFER#0 [phi:fire->fire::@1#1] -- pbuz1=pbuc1 
    lda #<BUFFER
    sta buffer
    lda #>BUFFER
    sta buffer+1
    jmp b1
    // fire::@1
  b1:
    // [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER#0+(word)(number) $18*(number) $28) goto fire::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda buffer+1
    cmp #>BUFFER+$18*$28
    bne b2
    lda buffer
    cmp #<BUFFER+$18*$28
    bne b2
    jmp b3
    // fire::@3
  b3:
    // [29] (byte*) fire::screen#1 ← (byte*) fire::screen#0 + (word)(number) $18*(number) $28 -- pbuz1=pbuz2_plus_vwuc1 
    lda screen
    clc
    adc #<$18*$28
    sta screen_1
    lda screen+1
    adc #>$18*$28
    sta screen_1+1
    // [30] phi from fire::@3 to fire::@6 [phi:fire::@3->fire::@6]
  b6_from_b3:
    // [30] phi (byte*) fire::screen#5 = (byte*) fire::screen#1 [phi:fire::@3->fire::@6#0] -- register_copy 
    // [30] phi (byte*) fire::buffer#7 = (const byte*) BUFFER#0+(word)(number) $18*(number) $28 [phi:fire::@3->fire::@6#1] -- pbuz1=pbuc1 
    lda #<BUFFER+$18*$28
    sta buffer_7
    lda #>BUFFER+$18*$28
    sta buffer_7+1
    jmp b6
    // [30] phi from fire::@7 to fire::@6 [phi:fire::@7->fire::@6]
  b6_from_b7:
    // [30] phi (byte*) fire::screen#5 = (byte*) fire::screen#3 [phi:fire::@7->fire::@6#0] -- register_copy 
    // [30] phi (byte*) fire::buffer#7 = (byte*) fire::buffer#3 [phi:fire::@7->fire::@6#1] -- register_copy 
    jmp b6
    // fire::@6
  b6:
    // [31] call sid_rnd 
    jsr sid_rnd
    // [32] (byte) sid_rnd::return#2 ← (byte) sid_rnd::return#0 -- vbuz1=vbuz2 
    lda sid_rnd.return
    sta sid_rnd.return_2
    jmp b7
    // fire::@7
  b7:
    // [33] (byte~) fire::$10 ← (byte) sid_rnd::return#2 -- vbuz1=vbuz2 
    lda sid_rnd.return_2
    sta _10
    // [34] (byte~) fire::$11 ← (byte~) fire::$10 >> (byte) 4 -- vbuz1=vbuz2_ror_4 
    lda _10
    lsr
    lsr
    lsr
    lsr
    sta _11
    // [35] (byte~) fire::$12 ← (byte) $30 + (byte~) fire::$11 -- vbuz1=vbuc1_plus_vbuz2 
    lax _11
    axs #-[$30]
    stx _12
    // [36] *((byte*) fire::buffer#7) ← (byte~) fire::$12 -- _deref_pbuz1=vbuz2 
    lda _12
    ldy #0
    sta (buffer_7),y
    // [37] *((byte*) fire::screen#5) ← *((byte*) fire::buffer#7) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (buffer_7),y
    ldy #0
    sta (screen_5),y
    // [38] (byte*) fire::screen#3 ← ++ (byte*) fire::screen#5 -- pbuz1=_inc_pbuz1 
    inc screen_3
    bne !+
    inc screen_3+1
  !:
    // [39] (byte*) fire::buffer#3 ← ++ (byte*) fire::buffer#7 -- pbuz1=_inc_pbuz1 
    inc buffer_3
    bne !+
    inc buffer_3+1
  !:
    // [40] if((byte*) fire::buffer#3!=(const byte*) BUFFER#0+(word)(number) $19*(number) $28) goto fire::@6 -- pbuz1_neq_pbuc1_then_la1 
    lda buffer_3+1
    cmp #>BUFFER+$19*$28
    bne b6_from_b7
    lda buffer_3
    cmp #<BUFFER+$19*$28
    bne b6_from_b7
    jmp breturn
    // fire::@return
  breturn:
    // [41] return 
    rts
    // fire::@2
  b2:
    // [42] (byte~) fire::$4 ← *((byte*) fire::buffer#4 + (byte)(number) $28-(number) 1) + *((byte*) fire::buffer#4 + (byte)(number) $28-(number) 1) -- vbuz1=pbuz2_derefidx_vbuc1_plus_pbuz2_derefidx_vbuc2 
    ldy #$28-1
    clc
    lda (buffer),y
    ldy #$28-1
    adc (buffer),y
    sta _4
    // [43] (byte~) fire::$5 ← (byte~) fire::$4 + *((byte*) fire::buffer#4 + (byte) $28) -- vbuz1=vbuz2_plus_pbuz3_derefidx_vbuc1 
    lda _4
    ldy #$28
    clc
    adc (buffer),y
    sta _5
    // [44] (byte~) fire::$6 ← (byte~) fire::$5 + *((byte*) fire::buffer#4 + (byte) $29) -- vbuz1=vbuz2_plus_pbuz3_derefidx_vbuc1 
    lda _5
    ldy #$29
    clc
    adc (buffer),y
    sta _6
    // [45] (byte) fire::c#0 ← (byte~) fire::$6 >> (byte) 2 -- vbuz1=vbuz2_ror_2 
    lda _6
    lsr
    lsr
    sta c
    // [46] if((byte) fire::c#0<(byte) 2+(byte) 1) goto fire::@4 -- vbuz1_lt_vbuc1_then_la1 
    lda c
    cmp #2+1
    bcc b4_from_b2
    jmp b5
    // fire::@5
  b5:
    // [47] (byte) fire::c#1 ← (byte) fire::c#0 - (byte) 3 -- vbuz1=vbuz1_minus_vbuc1 
    lax c
    axs #3
    stx c
    // [48] phi from fire::@2 fire::@5 to fire::@4 [phi:fire::@2/fire::@5->fire::@4]
  b4_from_b2:
  b4_from_b5:
    // [48] phi (byte) fire::c#2 = (byte) fire::c#0 [phi:fire::@2/fire::@5->fire::@4#0] -- register_copy 
    jmp b4
    // fire::@4
  b4:
    // [49] *((byte*) fire::buffer#4) ← (byte) fire::c#2 -- _deref_pbuz1=vbuz2 
    lda c
    ldy #0
    sta (buffer),y
    // [50] *((byte*) fire::screen#4) ← *((byte*) fire::buffer#4) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (buffer),y
    ldy #0
    sta (screen_4),y
    // [51] (byte*) fire::screen#2 ← ++ (byte*) fire::screen#4 -- pbuz1=_inc_pbuz1 
    inc screen_2
    bne !+
    inc screen_2+1
  !:
    // [52] (byte*) fire::buffer#2 ← ++ (byte*) fire::buffer#4 -- pbuz1=_inc_pbuz1 
    inc buffer
    bne !+
    inc buffer+1
  !:
    // [27] phi from fire::@4 to fire::@1 [phi:fire::@4->fire::@1]
  b1_from_b4:
    // [27] phi (byte*) fire::screen#4 = (byte*) fire::screen#2 [phi:fire::@4->fire::@1#0] -- register_copy 
    // [27] phi (byte*) fire::buffer#4 = (byte*) fire::buffer#2 [phi:fire::@4->fire::@1#1] -- register_copy 
    jmp b1
}
  // sid_rnd
// Get a random number from the SID voice 3,
// Must be initialized with sid_rnd_init()
sid_rnd: {
    .label return = $22
    .label return_2 = $1b
    // [53] (byte) sid_rnd::return#0 ← *((const byte*) SID_VOICE3_OSC#0) -- vbuz1=_deref_pbuc1 
    lda SID_VOICE3_OSC
    sta return
    jmp breturn
    // sid_rnd::@return
  breturn:
    // [54] return 
    rts
}
  // makecharset
// Make a fire-friendly charset in chars $00-$3f of the passed charset
makecharset: {
    .label _8 = $23
    .label _9 = $24
    .label _10 = $25
    .label _13 = $26
    .label _14 = $28
    .label _15 = $2a
    .label font = $d
    .label font1 = $f
    .label bc = $13
    .label ii = $14
    .label b = $15
    .label i = $12
    .label c = $11
    .label _18 = $2c
    // [56] phi from makecharset to makecharset::@1 [phi:makecharset->makecharset::@1]
  b1_from_makecharset:
    // [56] phi (byte*) makecharset::font#2 = (const byte*) CHARSET#0 [phi:makecharset->makecharset::@1#0] -- pbuz1=pbuc1 
    lda #<CHARSET
    sta font
    lda #>CHARSET
    sta font+1
    jmp b1
    // [56] phi from makecharset::@1 to makecharset::@1 [phi:makecharset::@1->makecharset::@1]
  b1_from_b1:
    // [56] phi (byte*) makecharset::font#2 = (byte*) makecharset::font#1 [phi:makecharset::@1->makecharset::@1#0] -- register_copy 
    jmp b1
    // makecharset::@1
  b1:
    // [57] *((byte*) makecharset::font#2) ← (byte) 0 -- _deref_pbuz1=vbuc1 
    lda #0
    ldy #0
    sta (font),y
    // [58] (byte*) makecharset::font#1 ← ++ (byte*) makecharset::font#2 -- pbuz1=_inc_pbuz1 
    inc font
    bne !+
    inc font+1
  !:
    // [59] if((byte*) makecharset::font#1!=(const byte*) CHARSET#0+(byte)(number) 1*(number) 8) goto makecharset::@1 -- pbuz1_neq_pbuc1_then_la1 
    lda font+1
    cmp #>CHARSET+1*8
    bne b1_from_b1
    lda font
    cmp #<CHARSET+1*8
    bne b1_from_b1
    // [60] phi from makecharset::@1 to makecharset::@2 [phi:makecharset::@1->makecharset::@2]
  b2_from_b1:
    // [60] phi (byte*) makecharset::font1#2 = (const byte*) CHARSET#0+(word)(number) $40*(number) 8 [phi:makecharset::@1->makecharset::@2#0] -- pbuz1=pbuc1 
    lda #<CHARSET+$40*8
    sta font1
    lda #>CHARSET+$40*8
    sta font1+1
    jmp b2
    // [60] phi from makecharset::@2 to makecharset::@2 [phi:makecharset::@2->makecharset::@2]
  b2_from_b2:
    // [60] phi (byte*) makecharset::font1#2 = (byte*) makecharset::font1#1 [phi:makecharset::@2->makecharset::@2#0] -- register_copy 
    jmp b2
    // makecharset::@2
  b2:
    // [61] *((byte*) makecharset::font1#2) ← (byte) $ff -- _deref_pbuz1=vbuc1 
    lda #$ff
    ldy #0
    sta (font1),y
    // [62] (byte*) makecharset::font1#1 ← ++ (byte*) makecharset::font1#2 -- pbuz1=_inc_pbuz1 
    inc font1
    bne !+
    inc font1+1
  !:
    // [63] if((byte*) makecharset::font1#1!=(const byte*) CHARSET#0+(word)(number) $100*(number) 8) goto makecharset::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda font1+1
    cmp #>CHARSET+$100*8
    bne b2_from_b2
    lda font1
    cmp #<CHARSET+$100*8
    bne b2_from_b2
    // [64] phi from makecharset::@2 to makecharset::@3 [phi:makecharset::@2->makecharset::@3]
  b3_from_b2:
    // [64] phi (byte) makecharset::c#7 = (byte) 0 [phi:makecharset::@2->makecharset::@3#0] -- vbuz1=vbuc1 
    lda #0
    sta c
    jmp b3
    // [64] phi from makecharset::@9 to makecharset::@3 [phi:makecharset::@9->makecharset::@3]
  b3_from_b9:
    // [64] phi (byte) makecharset::c#7 = (byte) makecharset::c#1 [phi:makecharset::@9->makecharset::@3#0] -- register_copy 
    jmp b3
    // makecharset::@3
  b3:
    // [65] phi from makecharset::@3 to makecharset::@4 [phi:makecharset::@3->makecharset::@4]
  b4_from_b3:
    // [65] phi (byte) makecharset::i#6 = (byte) 0 [phi:makecharset::@3->makecharset::@4#0] -- vbuz1=vbuc1 
    lda #0
    sta i
    // [65] phi (byte) makecharset::bc#5 = (byte) 0 [phi:makecharset::@3->makecharset::@4#1] -- vbuz1=vbuc1 
    lda #0
    sta bc
    jmp b4
    // [65] phi from makecharset::@8 to makecharset::@4 [phi:makecharset::@8->makecharset::@4]
  b4_from_b8:
    // [65] phi (byte) makecharset::i#6 = (byte) makecharset::i#1 [phi:makecharset::@8->makecharset::@4#0] -- register_copy 
    // [65] phi (byte) makecharset::bc#5 = (byte) makecharset::bc#6 [phi:makecharset::@8->makecharset::@4#1] -- register_copy 
    jmp b4
    // makecharset::@4
  b4:
    // [66] phi from makecharset::@4 to makecharset::@5 [phi:makecharset::@4->makecharset::@5]
  b5_from_b4:
    // [66] phi (byte) makecharset::b#2 = (byte) 0 [phi:makecharset::@4->makecharset::@5#0] -- vbuz1=vbuc1 
    lda #0
    sta b
    // [66] phi (byte) makecharset::ii#2 = (byte) 0 [phi:makecharset::@4->makecharset::@5#1] -- vbuz1=vbuc1 
    lda #0
    sta ii
    // [66] phi (byte) makecharset::bc#3 = (byte) makecharset::bc#5 [phi:makecharset::@4->makecharset::@5#2] -- register_copy 
    jmp b5
    // [66] phi from makecharset::@6 to makecharset::@5 [phi:makecharset::@6->makecharset::@5]
  b5_from_b6:
    // [66] phi (byte) makecharset::b#2 = (byte) makecharset::b#3 [phi:makecharset::@6->makecharset::@5#0] -- register_copy 
    // [66] phi (byte) makecharset::ii#2 = (byte) makecharset::ii#1 [phi:makecharset::@6->makecharset::@5#1] -- register_copy 
    // [66] phi (byte) makecharset::bc#3 = (byte) makecharset::bc#6 [phi:makecharset::@6->makecharset::@5#2] -- register_copy 
    jmp b5
    // makecharset::@5
  b5:
    // [67] (byte) makecharset::bc#1 ← (byte) makecharset::bc#3 + (byte) makecharset::c#7 -- vbuz1=vbuz1_plus_vbuz2 
    lda bc
    clc
    adc c
    sta bc
    // [68] if((byte) makecharset::bc#1<(byte) $3f+(byte) 1) goto makecharset::@6 -- vbuz1_lt_vbuc1_then_la1 
    lda bc
    cmp #$3f+1
    bcc b6_from_b5
    jmp b7
    // makecharset::@7
  b7:
    // [69] (byte) makecharset::bc#2 ← (byte) makecharset::bc#1 - (byte) $40 -- vbuz1=vbuz1_minus_vbuc1 
    lax bc
    axs #$40
    stx bc
    // [70] (byte~) makecharset::$8 ← (byte) makecharset::i#6 & (byte) 1 -- vbuz1=vbuz2_band_vbuc1 
    lda #1
    and i
    sta _8
    // [71] (byte~) makecharset::$9 ← (byte) makecharset::ii#2 + (byte~) makecharset::$8 -- vbuz1=vbuz2_plus_vbuz3 
    lda ii
    clc
    adc _8
    sta _9
    // [72] (byte~) makecharset::$10 ← (byte~) makecharset::$9 & (byte) 7 -- vbuz1=vbuz2_band_vbuc1 
    lda #7
    and _9
    sta _10
    // [73] (byte) makecharset::b#1 ← (byte) makecharset::b#2 + *((const byte[8]) makecharset::bittab#0 + (byte~) makecharset::$10) -- vbuz1=vbuz1_plus_pbuc1_derefidx_vbuz2 
    lda b
    ldy _10
    clc
    adc bittab,y
    sta b
    // [74] phi from makecharset::@5 makecharset::@7 to makecharset::@6 [phi:makecharset::@5/makecharset::@7->makecharset::@6]
  b6_from_b5:
  b6_from_b7:
    // [74] phi (byte) makecharset::b#3 = (byte) makecharset::b#2 [phi:makecharset::@5/makecharset::@7->makecharset::@6#0] -- register_copy 
    // [74] phi (byte) makecharset::bc#6 = (byte) makecharset::bc#1 [phi:makecharset::@5/makecharset::@7->makecharset::@6#1] -- register_copy 
    jmp b6
    // makecharset::@6
  b6:
    // [75] (byte) makecharset::ii#1 ← ++ (byte) makecharset::ii#2 -- vbuz1=_inc_vbuz1 
    inc ii
    // [76] if((byte) makecharset::ii#1<(byte) 8) goto makecharset::@5 -- vbuz1_lt_vbuc1_then_la1 
    lda ii
    cmp #8
    bcc b5_from_b6
    jmp b8
    // makecharset::@8
  b8:
    // [77] (word~) makecharset::$13 ← (word)(byte) makecharset::c#7 -- vwuz1=_word_vbuz2 
    lda c
    sta _13
    lda #0
    sta _13+1
    // [78] (word~) makecharset::$14 ← (word~) makecharset::$13 << (byte) 3 -- vwuz1=vwuz2_rol_3 
    lda _13
    asl
    sta _14
    lda _13+1
    rol
    sta _14+1
    asl _14
    rol _14+1
    asl _14
    rol _14+1
    // [79] (word~) makecharset::$15 ← (word~) makecharset::$14 + (byte) makecharset::i#6 -- vwuz1=vwuz2_plus_vbuz3 
    lda i
    clc
    adc _14
    sta _15
    lda #0
    adc _14+1
    sta _15+1
    // [80] (byte*~) makecharset::$18 ← (const byte*) CHARSET#0+(byte)(number) 1*(number) 8 + (word~) makecharset::$15 -- pbuz1=pbuc1_plus_vwuz2 
    lda _15
    clc
    adc #<CHARSET+1*8
    sta _18
    lda _15+1
    adc #>CHARSET+1*8
    sta _18+1
    // [81] *((byte*~) makecharset::$18) ← (byte) makecharset::b#3 -- _deref_pbuz1=vbuz2 
    lda b
    ldy #0
    sta (_18),y
    // [82] (byte) makecharset::i#1 ← ++ (byte) makecharset::i#6 -- vbuz1=_inc_vbuz1 
    inc i
    // [83] if((byte) makecharset::i#1<(byte) 8) goto makecharset::@4 -- vbuz1_lt_vbuc1_then_la1 
    lda i
    cmp #8
    bcc b4_from_b8
    jmp b9
    // makecharset::@9
  b9:
    // [84] (byte) makecharset::c#1 ← ++ (byte) makecharset::c#7 -- vbuz1=_inc_vbuz1 
    inc c
    // [85] if((byte) makecharset::c#1<(byte) $40) goto makecharset::@3 -- vbuz1_lt_vbuc1_then_la1 
    lda c
    cmp #$40
    bcc b3_from_b9
    jmp breturn
    // makecharset::@return
  breturn:
    // [86] return 
    rts
    bittab: .byte 1, 2, 4, 8, $10, $20, $40, $80
}
  // sid_rnd_init
// Initialize SID voice 3 for random number generation
sid_rnd_init: {
    // [87] *((const word*) SID_VOICE3_FREQ#0) ← (word) $ffff -- _deref_pwuc1=vwuc2 
    lda #<$ffff
    sta SID_VOICE3_FREQ
    lda #>$ffff
    sta SID_VOICE3_FREQ+1
    // [88] *((const byte*) SID_VOICE3_CONTROL#0) ← (const byte) SID_CONTROL_NOISE#0 -- _deref_pbuc1=vbuc2 
    lda #SID_CONTROL_NOISE
    sta SID_VOICE3_CONTROL
    jmp breturn
    // sid_rnd_init::@return
  breturn:
    // [89] return 
    rts
}
  // fillscreen
// Fill a screen (1000 bytes) with a specific byte
// fillscreen(byte* zeropage($17) screen, byte zeropage($16) fill)
fillscreen: {
    .label screen = $17
    .label i = $19
    .label fill = $16
    // [91] phi from fillscreen to fillscreen::@1 [phi:fillscreen->fillscreen::@1]
  b1_from_fillscreen:
    // [91] phi (word) fillscreen::i#2 = (word) 0 [phi:fillscreen->fillscreen::@1#0] -- vwuz1=vwuc1 
    lda #<0
    sta i
    lda #>0
    sta i+1
    // [91] phi (byte*) fillscreen::screen#5 = (byte*) fillscreen::screen#6 [phi:fillscreen->fillscreen::@1#1] -- register_copy 
    jmp b1
    // [91] phi from fillscreen::@1 to fillscreen::@1 [phi:fillscreen::@1->fillscreen::@1]
  b1_from_b1:
    // [91] phi (word) fillscreen::i#2 = (word) fillscreen::i#1 [phi:fillscreen::@1->fillscreen::@1#0] -- register_copy 
    // [91] phi (byte*) fillscreen::screen#5 = (byte*) fillscreen::screen#4 [phi:fillscreen::@1->fillscreen::@1#1] -- register_copy 
    jmp b1
    // fillscreen::@1
  b1:
    // [92] *((byte*) fillscreen::screen#5) ← (byte) fillscreen::fill#5 -- _deref_pbuz1=vbuz2 
    lda fill
    ldy #0
    sta (screen),y
    // [93] (byte*) fillscreen::screen#4 ← ++ (byte*) fillscreen::screen#5 -- pbuz1=_inc_pbuz1 
    inc screen
    bne !+
    inc screen+1
  !:
    // [94] (word) fillscreen::i#1 ← ++ (word) fillscreen::i#2 -- vwuz1=_inc_vwuz1 
    inc i
    bne !+
    inc i+1
  !:
    // [95] if((word) fillscreen::i#1!=(word) $3e8) goto fillscreen::@1 -- vwuz1_neq_vwuc1_then_la1 
    lda i+1
    cmp #>$3e8
    bne b1_from_b1
    lda i
    cmp #<$3e8
    bne b1_from_b1
    jmp breturn
    // fillscreen::@return
  breturn:
    // [96] return 
    rts
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [6] *((const byte*) BGCOL#0) ← (const byte) BLACK#0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [21] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [24] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [26] (byte*~) fire::screen#10 ← (byte*) fire::screen#0 [ fire::screen#0 fire::screen#10 ] ( main:2::fire:19 [ fire::screen#0 fire::screen#10 ] main:2::fire:22 [ fire::screen#0 fire::screen#10 ] ) always clobbers reg byte a 
Statement [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER#0+(word)(number) $18*(number) $28) goto fire::@2 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ) always clobbers reg byte a 
Statement [29] (byte*) fire::screen#1 ← (byte*) fire::screen#0 + (word)(number) $18*(number) $28 [ fire::screen#1 ] ( main:2::fire:19 [ fire::screen#1 ] main:2::fire:22 [ fire::screen#1 ] ) always clobbers reg byte a 
Statement [34] (byte~) fire::$11 ← (byte~) fire::$10 >> (byte) 4 [ fire::buffer#7 fire::screen#5 fire::$11 ] ( main:2::fire:19 [ fire::buffer#7 fire::screen#5 fire::$11 ] main:2::fire:22 [ fire::buffer#7 fire::screen#5 fire::$11 ] ) always clobbers reg byte a 
Statement [36] *((byte*) fire::buffer#7) ← (byte~) fire::$12 [ fire::buffer#7 fire::screen#5 ] ( main:2::fire:19 [ fire::buffer#7 fire::screen#5 ] main:2::fire:22 [ fire::buffer#7 fire::screen#5 ] ) always clobbers reg byte y 
Statement [37] *((byte*) fire::screen#5) ← *((byte*) fire::buffer#7) [ fire::buffer#7 fire::screen#5 ] ( main:2::fire:19 [ fire::buffer#7 fire::screen#5 ] main:2::fire:22 [ fire::buffer#7 fire::screen#5 ] ) always clobbers reg byte a reg byte y 
Statement [40] if((byte*) fire::buffer#3!=(const byte*) BUFFER#0+(word)(number) $19*(number) $28) goto fire::@6 [ fire::buffer#3 fire::screen#3 ] ( main:2::fire:19 [ fire::buffer#3 fire::screen#3 ] main:2::fire:22 [ fire::buffer#3 fire::screen#3 ] ) always clobbers reg byte a 
Statement [42] (byte~) fire::$4 ← *((byte*) fire::buffer#4 + (byte)(number) $28-(number) 1) + *((byte*) fire::buffer#4 + (byte)(number) $28-(number) 1) [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$4 ] ) always clobbers reg byte a reg byte y 
Statement [43] (byte~) fire::$5 ← (byte~) fire::$4 + *((byte*) fire::buffer#4 + (byte) $28) [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$5 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$5 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$5 ] ) always clobbers reg byte a reg byte y 
Statement [44] (byte~) fire::$6 ← (byte~) fire::$5 + *((byte*) fire::buffer#4 + (byte) $29) [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$6 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$6 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$6 ] ) always clobbers reg byte a reg byte y 
Statement [45] (byte) fire::c#0 ← (byte~) fire::$6 >> (byte) 2 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#0 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#0 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#0 ] ) always clobbers reg byte a 
Statement [47] (byte) fire::c#1 ← (byte) fire::c#0 - (byte) 3 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#1 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#1 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#1 ] ) always clobbers reg byte a 
Statement [49] *((byte*) fire::buffer#4) ← (byte) fire::c#2 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ) always clobbers reg byte y 
Statement [50] *((byte*) fire::screen#4) ← *((byte*) fire::buffer#4) [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ) always clobbers reg byte a reg byte y 
Statement [57] *((byte*) makecharset::font#2) ← (byte) 0 [ makecharset::font#2 ] ( main:2::makecharset:17 [ makecharset::font#2 ] ) always clobbers reg byte a reg byte y 
Statement [59] if((byte*) makecharset::font#1!=(const byte*) CHARSET#0+(byte)(number) 1*(number) 8) goto makecharset::@1 [ makecharset::font#1 ] ( main:2::makecharset:17 [ makecharset::font#1 ] ) always clobbers reg byte a 
Statement [61] *((byte*) makecharset::font1#2) ← (byte) $ff [ makecharset::font1#2 ] ( main:2::makecharset:17 [ makecharset::font1#2 ] ) always clobbers reg byte a reg byte y 
Statement [63] if((byte*) makecharset::font1#1!=(const byte*) CHARSET#0+(word)(number) $100*(number) 8) goto makecharset::@2 [ makecharset::font1#1 ] ( main:2::makecharset:17 [ makecharset::font1#1 ] ) always clobbers reg byte a 
Statement [67] (byte) makecharset::bc#1 ← (byte) makecharset::bc#3 + (byte) makecharset::c#7 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#1 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#1 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:17 [ makecharset::c#7 makecharset::c#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:18 [ makecharset::i#6 makecharset::i#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:20 [ makecharset::ii#2 makecharset::ii#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:21 [ makecharset::b#2 makecharset::b#3 makecharset::b#1 ]
Statement [69] (byte) makecharset::bc#2 ← (byte) makecharset::bc#1 - (byte) $40 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 ] ) always clobbers reg byte a 
Statement [70] (byte~) makecharset::$8 ← (byte) makecharset::i#6 & (byte) 1 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 makecharset::$8 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 makecharset::$8 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:19 [ makecharset::bc#3 makecharset::bc#5 makecharset::bc#6 makecharset::bc#1 makecharset::bc#2 ]
Statement [71] (byte~) makecharset::$9 ← (byte) makecharset::ii#2 + (byte~) makecharset::$8 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 makecharset::$9 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 makecharset::$9 ] ) always clobbers reg byte a 
Statement [73] (byte) makecharset::b#1 ← (byte) makecharset::b#2 + *((const byte[8]) makecharset::bittab#0 + (byte~) makecharset::$10) [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::bc#2 makecharset::b#1 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::bc#2 makecharset::b#1 ] ) always clobbers reg byte a 
Statement [77] (word~) makecharset::$13 ← (word)(byte) makecharset::c#7 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$13 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$13 ] ) always clobbers reg byte a 
Statement [78] (word~) makecharset::$14 ← (word~) makecharset::$13 << (byte) 3 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$14 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$14 ] ) always clobbers reg byte a 
Statement [79] (word~) makecharset::$15 ← (word~) makecharset::$14 + (byte) makecharset::i#6 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$15 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$15 ] ) always clobbers reg byte a 
Statement [80] (byte*~) makecharset::$18 ← (const byte*) CHARSET#0+(byte)(number) 1*(number) 8 + (word~) makecharset::$15 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$18 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$18 ] ) always clobbers reg byte a 
Statement [81] *((byte*~) makecharset::$18) ← (byte) makecharset::b#3 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 ] ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:17 [ makecharset::c#7 makecharset::c#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:18 [ makecharset::i#6 makecharset::i#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:19 [ makecharset::bc#3 makecharset::bc#5 makecharset::bc#6 makecharset::bc#1 makecharset::bc#2 ]
Statement [87] *((const word*) SID_VOICE3_FREQ#0) ← (word) $ffff [ ] ( main:2::sid_rnd_init:15 [ ] ) always clobbers reg byte a 
Statement [88] *((const byte*) SID_VOICE3_CONTROL#0) ← (const byte) SID_CONTROL_NOISE#0 [ ] ( main:2::sid_rnd_init:15 [ ] ) always clobbers reg byte a 
Statement [92] *((byte*) fillscreen::screen#5) ← (byte) fillscreen::fill#5 [ fillscreen::fill#5 fillscreen::screen#5 fillscreen::i#2 ] ( main:2::fillscreen:7 [ fillscreen::fill#5 fillscreen::screen#5 fillscreen::i#2 ] main:2::fillscreen:9 [ fillscreen::fill#5 fillscreen::screen#5 fillscreen::i#2 ] main:2::fillscreen:11 [ fillscreen::fill#5 fillscreen::screen#5 fillscreen::i#2 ] main:2::fillscreen:13 [ fillscreen::fill#5 fillscreen::screen#5 fillscreen::i#2 ] ) always clobbers reg byte y 
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:22 [ fillscreen::fill#5 ]
Statement [95] if((word) fillscreen::i#1!=(word) $3e8) goto fillscreen::@1 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] ( main:2::fillscreen:7 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] main:2::fillscreen:9 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] main:2::fillscreen:11 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] main:2::fillscreen:13 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:22 [ fillscreen::fill#5 ]
Statement [5] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [6] *((const byte*) BGCOL#0) ← (const byte) BLACK#0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [21] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [24] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [26] (byte*~) fire::screen#10 ← (byte*) fire::screen#0 [ fire::screen#0 fire::screen#10 ] ( main:2::fire:19 [ fire::screen#0 fire::screen#10 ] main:2::fire:22 [ fire::screen#0 fire::screen#10 ] ) always clobbers reg byte a 
Statement [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER#0+(word)(number) $18*(number) $28) goto fire::@2 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ) always clobbers reg byte a 
Statement [29] (byte*) fire::screen#1 ← (byte*) fire::screen#0 + (word)(number) $18*(number) $28 [ fire::screen#1 ] ( main:2::fire:19 [ fire::screen#1 ] main:2::fire:22 [ fire::screen#1 ] ) always clobbers reg byte a 
Statement [34] (byte~) fire::$11 ← (byte~) fire::$10 >> (byte) 4 [ fire::buffer#7 fire::screen#5 fire::$11 ] ( main:2::fire:19 [ fire::buffer#7 fire::screen#5 fire::$11 ] main:2::fire:22 [ fire::buffer#7 fire::screen#5 fire::$11 ] ) always clobbers reg byte a 
Statement [36] *((byte*) fire::buffer#7) ← (byte~) fire::$12 [ fire::buffer#7 fire::screen#5 ] ( main:2::fire:19 [ fire::buffer#7 fire::screen#5 ] main:2::fire:22 [ fire::buffer#7 fire::screen#5 ] ) always clobbers reg byte y 
Statement [37] *((byte*) fire::screen#5) ← *((byte*) fire::buffer#7) [ fire::buffer#7 fire::screen#5 ] ( main:2::fire:19 [ fire::buffer#7 fire::screen#5 ] main:2::fire:22 [ fire::buffer#7 fire::screen#5 ] ) always clobbers reg byte a reg byte y 
Statement [40] if((byte*) fire::buffer#3!=(const byte*) BUFFER#0+(word)(number) $19*(number) $28) goto fire::@6 [ fire::buffer#3 fire::screen#3 ] ( main:2::fire:19 [ fire::buffer#3 fire::screen#3 ] main:2::fire:22 [ fire::buffer#3 fire::screen#3 ] ) always clobbers reg byte a 
Statement [42] (byte~) fire::$4 ← *((byte*) fire::buffer#4 + (byte)(number) $28-(number) 1) + *((byte*) fire::buffer#4 + (byte)(number) $28-(number) 1) [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$4 ] ) always clobbers reg byte a reg byte y 
Statement [43] (byte~) fire::$5 ← (byte~) fire::$4 + *((byte*) fire::buffer#4 + (byte) $28) [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$5 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$5 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$5 ] ) always clobbers reg byte a reg byte y 
Statement [44] (byte~) fire::$6 ← (byte~) fire::$5 + *((byte*) fire::buffer#4 + (byte) $29) [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$6 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$6 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$6 ] ) always clobbers reg byte a reg byte y 
Statement [45] (byte) fire::c#0 ← (byte~) fire::$6 >> (byte) 2 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#0 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#0 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#0 ] ) always clobbers reg byte a 
Statement [47] (byte) fire::c#1 ← (byte) fire::c#0 - (byte) 3 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#1 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#1 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#1 ] ) always clobbers reg byte a 
Statement [49] *((byte*) fire::buffer#4) ← (byte) fire::c#2 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ) always clobbers reg byte y 
Statement [50] *((byte*) fire::screen#4) ← *((byte*) fire::buffer#4) [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ) always clobbers reg byte a reg byte y 
Statement [57] *((byte*) makecharset::font#2) ← (byte) 0 [ makecharset::font#2 ] ( main:2::makecharset:17 [ makecharset::font#2 ] ) always clobbers reg byte a reg byte y 
Statement [59] if((byte*) makecharset::font#1!=(const byte*) CHARSET#0+(byte)(number) 1*(number) 8) goto makecharset::@1 [ makecharset::font#1 ] ( main:2::makecharset:17 [ makecharset::font#1 ] ) always clobbers reg byte a 
Statement [61] *((byte*) makecharset::font1#2) ← (byte) $ff [ makecharset::font1#2 ] ( main:2::makecharset:17 [ makecharset::font1#2 ] ) always clobbers reg byte a reg byte y 
Statement [63] if((byte*) makecharset::font1#1!=(const byte*) CHARSET#0+(word)(number) $100*(number) 8) goto makecharset::@2 [ makecharset::font1#1 ] ( main:2::makecharset:17 [ makecharset::font1#1 ] ) always clobbers reg byte a 
Statement [67] (byte) makecharset::bc#1 ← (byte) makecharset::bc#3 + (byte) makecharset::c#7 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#1 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#1 ] ) always clobbers reg byte a 
Statement [69] (byte) makecharset::bc#2 ← (byte) makecharset::bc#1 - (byte) $40 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 ] ) always clobbers reg byte a reg byte x 
Removing always clobbered register reg byte x as potential for zp ZP_BYTE:17 [ makecharset::c#7 makecharset::c#1 ]
Removing always clobbered register reg byte x as potential for zp ZP_BYTE:18 [ makecharset::i#6 makecharset::i#1 ]
Removing always clobbered register reg byte x as potential for zp ZP_BYTE:20 [ makecharset::ii#2 makecharset::ii#1 ]
Removing always clobbered register reg byte x as potential for zp ZP_BYTE:21 [ makecharset::b#2 makecharset::b#3 makecharset::b#1 ]
Statement [70] (byte~) makecharset::$8 ← (byte) makecharset::i#6 & (byte) 1 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 makecharset::$8 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 makecharset::$8 ] ) always clobbers reg byte a 
Statement [71] (byte~) makecharset::$9 ← (byte) makecharset::ii#2 + (byte~) makecharset::$8 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 makecharset::$9 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 makecharset::$9 ] ) always clobbers reg byte a 
Statement [73] (byte) makecharset::b#1 ← (byte) makecharset::b#2 + *((const byte[8]) makecharset::bittab#0 + (byte~) makecharset::$10) [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::bc#2 makecharset::b#1 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::bc#2 makecharset::b#1 ] ) always clobbers reg byte a 
Statement [77] (word~) makecharset::$13 ← (word)(byte) makecharset::c#7 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$13 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$13 ] ) always clobbers reg byte a 
Statement [78] (word~) makecharset::$14 ← (word~) makecharset::$13 << (byte) 3 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$14 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$14 ] ) always clobbers reg byte a 
Statement [79] (word~) makecharset::$15 ← (word~) makecharset::$14 + (byte) makecharset::i#6 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$15 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$15 ] ) always clobbers reg byte a 
Statement [80] (byte*~) makecharset::$18 ← (const byte*) CHARSET#0+(byte)(number) 1*(number) 8 + (word~) makecharset::$15 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$18 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$18 ] ) always clobbers reg byte a 
Statement [81] *((byte*~) makecharset::$18) ← (byte) makecharset::b#3 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 ] ) always clobbers reg byte a reg byte y 
Statement [83] if((byte) makecharset::i#1<(byte) 8) goto makecharset::@4 [ makecharset::c#7 makecharset::bc#6 makecharset::i#1 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::bc#6 makecharset::i#1 ] ) always clobbers reg byte a 
Statement [85] if((byte) makecharset::c#1<(byte) $40) goto makecharset::@3 [ makecharset::c#1 ] ( main:2::makecharset:17 [ makecharset::c#1 ] ) always clobbers reg byte a 
Statement [87] *((const word*) SID_VOICE3_FREQ#0) ← (word) $ffff [ ] ( main:2::sid_rnd_init:15 [ ] ) always clobbers reg byte a 
Statement [88] *((const byte*) SID_VOICE3_CONTROL#0) ← (const byte) SID_CONTROL_NOISE#0 [ ] ( main:2::sid_rnd_init:15 [ ] ) always clobbers reg byte a 
Statement [92] *((byte*) fillscreen::screen#5) ← (byte) fillscreen::fill#5 [ fillscreen::fill#5 fillscreen::screen#5 fillscreen::i#2 ] ( main:2::fillscreen:7 [ fillscreen::fill#5 fillscreen::screen#5 fillscreen::i#2 ] main:2::fillscreen:9 [ fillscreen::fill#5 fillscreen::screen#5 fillscreen::i#2 ] main:2::fillscreen:11 [ fillscreen::fill#5 fillscreen::screen#5 fillscreen::i#2 ] main:2::fillscreen:13 [ fillscreen::fill#5 fillscreen::screen#5 fillscreen::i#2 ] ) always clobbers reg byte a reg byte y 
Statement [95] if((word) fillscreen::i#1!=(word) $3e8) goto fillscreen::@1 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] ( main:2::fillscreen:7 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] main:2::fillscreen:9 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] main:2::fillscreen:11 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] main:2::fillscreen:13 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] ) always clobbers reg byte a 
Statement [5] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [6] *((const byte*) BGCOL#0) ← (const byte) BLACK#0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [21] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [24] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [26] (byte*~) fire::screen#10 ← (byte*) fire::screen#0 [ fire::screen#0 fire::screen#10 ] ( main:2::fire:19 [ fire::screen#0 fire::screen#10 ] main:2::fire:22 [ fire::screen#0 fire::screen#10 ] ) always clobbers reg byte a 
Statement [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER#0+(word)(number) $18*(number) $28) goto fire::@2 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ) always clobbers reg byte a 
Statement [29] (byte*) fire::screen#1 ← (byte*) fire::screen#0 + (word)(number) $18*(number) $28 [ fire::screen#1 ] ( main:2::fire:19 [ fire::screen#1 ] main:2::fire:22 [ fire::screen#1 ] ) always clobbers reg byte a 
Statement [34] (byte~) fire::$11 ← (byte~) fire::$10 >> (byte) 4 [ fire::buffer#7 fire::screen#5 fire::$11 ] ( main:2::fire:19 [ fire::buffer#7 fire::screen#5 fire::$11 ] main:2::fire:22 [ fire::buffer#7 fire::screen#5 fire::$11 ] ) always clobbers reg byte a 
Statement [36] *((byte*) fire::buffer#7) ← (byte~) fire::$12 [ fire::buffer#7 fire::screen#5 ] ( main:2::fire:19 [ fire::buffer#7 fire::screen#5 ] main:2::fire:22 [ fire::buffer#7 fire::screen#5 ] ) always clobbers reg byte y 
Statement [37] *((byte*) fire::screen#5) ← *((byte*) fire::buffer#7) [ fire::buffer#7 fire::screen#5 ] ( main:2::fire:19 [ fire::buffer#7 fire::screen#5 ] main:2::fire:22 [ fire::buffer#7 fire::screen#5 ] ) always clobbers reg byte a reg byte y 
Statement [40] if((byte*) fire::buffer#3!=(const byte*) BUFFER#0+(word)(number) $19*(number) $28) goto fire::@6 [ fire::buffer#3 fire::screen#3 ] ( main:2::fire:19 [ fire::buffer#3 fire::screen#3 ] main:2::fire:22 [ fire::buffer#3 fire::screen#3 ] ) always clobbers reg byte a 
Statement [42] (byte~) fire::$4 ← *((byte*) fire::buffer#4 + (byte)(number) $28-(number) 1) + *((byte*) fire::buffer#4 + (byte)(number) $28-(number) 1) [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$4 ] ) always clobbers reg byte a reg byte y 
Statement [43] (byte~) fire::$5 ← (byte~) fire::$4 + *((byte*) fire::buffer#4 + (byte) $28) [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$5 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$5 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$5 ] ) always clobbers reg byte a reg byte y 
Statement [44] (byte~) fire::$6 ← (byte~) fire::$5 + *((byte*) fire::buffer#4 + (byte) $29) [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$6 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$6 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::$6 ] ) always clobbers reg byte a reg byte y 
Statement [45] (byte) fire::c#0 ← (byte~) fire::$6 >> (byte) 2 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#0 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#0 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#0 ] ) always clobbers reg byte a 
Statement [47] (byte) fire::c#1 ← (byte) fire::c#0 - (byte) 3 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#1 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#1 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#1 ] ) always clobbers reg byte a 
Statement [49] *((byte*) fire::buffer#4) ← (byte) fire::c#2 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ) always clobbers reg byte y 
Statement [50] *((byte*) fire::screen#4) ← *((byte*) fire::buffer#4) [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ) always clobbers reg byte a reg byte y 
Statement [57] *((byte*) makecharset::font#2) ← (byte) 0 [ makecharset::font#2 ] ( main:2::makecharset:17 [ makecharset::font#2 ] ) always clobbers reg byte a reg byte y 
Statement [59] if((byte*) makecharset::font#1!=(const byte*) CHARSET#0+(byte)(number) 1*(number) 8) goto makecharset::@1 [ makecharset::font#1 ] ( main:2::makecharset:17 [ makecharset::font#1 ] ) always clobbers reg byte a 
Statement [61] *((byte*) makecharset::font1#2) ← (byte) $ff [ makecharset::font1#2 ] ( main:2::makecharset:17 [ makecharset::font1#2 ] ) always clobbers reg byte a reg byte y 
Statement [63] if((byte*) makecharset::font1#1!=(const byte*) CHARSET#0+(word)(number) $100*(number) 8) goto makecharset::@2 [ makecharset::font1#1 ] ( main:2::makecharset:17 [ makecharset::font1#1 ] ) always clobbers reg byte a 
Statement [67] (byte) makecharset::bc#1 ← (byte) makecharset::bc#3 + (byte) makecharset::c#7 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#1 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#1 ] ) always clobbers reg byte a 
Statement [69] (byte) makecharset::bc#2 ← (byte) makecharset::bc#1 - (byte) $40 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 ] ) always clobbers reg byte a reg byte x 
Statement [70] (byte~) makecharset::$8 ← (byte) makecharset::i#6 & (byte) 1 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 makecharset::$8 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 makecharset::$8 ] ) always clobbers reg byte a 
Statement [71] (byte~) makecharset::$9 ← (byte) makecharset::ii#2 + (byte~) makecharset::$8 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 makecharset::$9 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 makecharset::$9 ] ) always clobbers reg byte a 
Statement [73] (byte) makecharset::b#1 ← (byte) makecharset::b#2 + *((const byte[8]) makecharset::bittab#0 + (byte~) makecharset::$10) [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::bc#2 makecharset::b#1 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::ii#2 makecharset::bc#2 makecharset::b#1 ] ) always clobbers reg byte a 
Statement [77] (word~) makecharset::$13 ← (word)(byte) makecharset::c#7 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$13 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$13 ] ) always clobbers reg byte a 
Statement [78] (word~) makecharset::$14 ← (word~) makecharset::$13 << (byte) 3 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$14 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$14 ] ) always clobbers reg byte a 
Statement [79] (word~) makecharset::$15 ← (word~) makecharset::$14 + (byte) makecharset::i#6 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$15 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$15 ] ) always clobbers reg byte a 
Statement [80] (byte*~) makecharset::$18 ← (const byte*) CHARSET#0+(byte)(number) 1*(number) 8 + (word~) makecharset::$15 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$18 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 makecharset::b#3 makecharset::$18 ] ) always clobbers reg byte a 
Statement [81] *((byte*~) makecharset::$18) ← (byte) makecharset::b#3 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::i#6 makecharset::bc#6 ] ) always clobbers reg byte a reg byte y 
Statement [83] if((byte) makecharset::i#1<(byte) 8) goto makecharset::@4 [ makecharset::c#7 makecharset::bc#6 makecharset::i#1 ] ( main:2::makecharset:17 [ makecharset::c#7 makecharset::bc#6 makecharset::i#1 ] ) always clobbers reg byte a 
Statement [85] if((byte) makecharset::c#1<(byte) $40) goto makecharset::@3 [ makecharset::c#1 ] ( main:2::makecharset:17 [ makecharset::c#1 ] ) always clobbers reg byte a 
Statement [87] *((const word*) SID_VOICE3_FREQ#0) ← (word) $ffff [ ] ( main:2::sid_rnd_init:15 [ ] ) always clobbers reg byte a 
Statement [88] *((const byte*) SID_VOICE3_CONTROL#0) ← (const byte) SID_CONTROL_NOISE#0 [ ] ( main:2::sid_rnd_init:15 [ ] ) always clobbers reg byte a 
Statement [92] *((byte*) fillscreen::screen#5) ← (byte) fillscreen::fill#5 [ fillscreen::fill#5 fillscreen::screen#5 fillscreen::i#2 ] ( main:2::fillscreen:7 [ fillscreen::fill#5 fillscreen::screen#5 fillscreen::i#2 ] main:2::fillscreen:9 [ fillscreen::fill#5 fillscreen::screen#5 fillscreen::i#2 ] main:2::fillscreen:11 [ fillscreen::fill#5 fillscreen::screen#5 fillscreen::i#2 ] main:2::fillscreen:13 [ fillscreen::fill#5 fillscreen::screen#5 fillscreen::i#2 ] ) always clobbers reg byte a reg byte y 
Statement [95] if((word) fillscreen::i#1!=(word) $3e8) goto fillscreen::@1 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] ( main:2::fillscreen:7 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] main:2::fillscreen:9 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] main:2::fillscreen:11 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] main:2::fillscreen:13 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] ) always clobbers reg byte a 
Potential registers zp ZP_WORD:2 [ fire::screen#0 ] : zp ZP_WORD:2 , 
Potential registers zp ZP_WORD:4 [ fire::buffer#4 fire::buffer#2 ] : zp ZP_WORD:4 , 
Potential registers zp ZP_WORD:6 [ fire::screen#4 fire::screen#10 fire::screen#2 ] : zp ZP_WORD:6 , 
Potential registers zp ZP_WORD:8 [ fire::buffer#7 fire::buffer#3 ] : zp ZP_WORD:8 , 
Potential registers zp ZP_WORD:10 [ fire::screen#5 fire::screen#3 fire::screen#1 ] : zp ZP_WORD:10 , 
Potential registers zp ZP_BYTE:12 [ fire::c#2 fire::c#0 fire::c#1 ] : zp ZP_BYTE:12 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_WORD:13 [ makecharset::font#2 makecharset::font#1 ] : zp ZP_WORD:13 , 
Potential registers zp ZP_WORD:15 [ makecharset::font1#2 makecharset::font1#1 ] : zp ZP_WORD:15 , 
Potential registers zp ZP_BYTE:17 [ makecharset::c#7 makecharset::c#1 ] : zp ZP_BYTE:17 , 
Potential registers zp ZP_BYTE:18 [ makecharset::i#6 makecharset::i#1 ] : zp ZP_BYTE:18 , 
Potential registers zp ZP_BYTE:19 [ makecharset::bc#3 makecharset::bc#5 makecharset::bc#6 makecharset::bc#1 makecharset::bc#2 ] : zp ZP_BYTE:19 , reg byte x , 
Potential registers zp ZP_BYTE:20 [ makecharset::ii#2 makecharset::ii#1 ] : zp ZP_BYTE:20 , reg byte y , 
Potential registers zp ZP_BYTE:21 [ makecharset::b#2 makecharset::b#3 makecharset::b#1 ] : zp ZP_BYTE:21 , reg byte y , 
Potential registers zp ZP_BYTE:22 [ fillscreen::fill#5 ] : zp ZP_BYTE:22 , reg byte x , 
Potential registers zp ZP_WORD:23 [ fillscreen::screen#5 fillscreen::screen#6 fillscreen::screen#4 ] : zp ZP_WORD:23 , 
Potential registers zp ZP_WORD:25 [ fillscreen::i#2 fillscreen::i#1 ] : zp ZP_WORD:25 , 
Potential registers zp ZP_BYTE:27 [ sid_rnd::return#2 ] : zp ZP_BYTE:27 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:28 [ fire::$10 ] : zp ZP_BYTE:28 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:29 [ fire::$11 ] : zp ZP_BYTE:29 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:30 [ fire::$12 ] : zp ZP_BYTE:30 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:31 [ fire::$4 ] : zp ZP_BYTE:31 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:32 [ fire::$5 ] : zp ZP_BYTE:32 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:33 [ fire::$6 ] : zp ZP_BYTE:33 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:34 [ sid_rnd::return#0 ] : zp ZP_BYTE:34 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:35 [ makecharset::$8 ] : zp ZP_BYTE:35 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:36 [ makecharset::$9 ] : zp ZP_BYTE:36 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:37 [ makecharset::$10 ] : zp ZP_BYTE:37 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_WORD:38 [ makecharset::$13 ] : zp ZP_WORD:38 , 
Potential registers zp ZP_WORD:40 [ makecharset::$14 ] : zp ZP_WORD:40 , 
Potential registers zp ZP_WORD:42 [ makecharset::$15 ] : zp ZP_WORD:42 , 
Potential registers zp ZP_WORD:44 [ makecharset::$18 ] : zp ZP_WORD:44 , 

REGISTER UPLIFT SCOPES
Uplift Scope [makecharset] 5,017.8: zp ZP_BYTE:19 [ makecharset::bc#3 makecharset::bc#5 makecharset::bc#6 makecharset::bc#1 makecharset::bc#2 ] 2,874.43: zp ZP_BYTE:21 [ makecharset::b#2 makecharset::b#3 makecharset::b#1 ] 2,002: zp ZP_BYTE:35 [ makecharset::$8 ] 2,002: zp ZP_BYTE:36 [ makecharset::$9 ] 2,002: zp ZP_BYTE:37 [ makecharset::$10 ] 1,835.17: zp ZP_BYTE:20 [ makecharset::ii#2 makecharset::ii#1 ] 228.21: zp ZP_BYTE:18 [ makecharset::i#6 makecharset::i#1 ] 202: zp ZP_WORD:38 [ makecharset::$13 ] 202: zp ZP_WORD:40 [ makecharset::$14 ] 202: zp ZP_WORD:42 [ makecharset::$15 ] 202: zp ZP_WORD:44 [ makecharset::$18 ] 67.65: zp ZP_BYTE:17 [ makecharset::c#7 makecharset::c#1 ] 33: zp ZP_WORD:13 [ makecharset::font#2 makecharset::font#1 ] 33: zp ZP_WORD:15 [ makecharset::font1#2 makecharset::font1#1 ] 
Uplift Scope [fire] 707: zp ZP_BYTE:12 [ fire::c#2 fire::c#0 fire::c#1 ] 277.75: zp ZP_WORD:4 [ fire::buffer#4 fire::buffer#2 ] 202: zp ZP_BYTE:28 [ fire::$10 ] 202: zp ZP_BYTE:29 [ fire::$11 ] 202: zp ZP_BYTE:30 [ fire::$12 ] 202: zp ZP_BYTE:31 [ fire::$4 ] 202: zp ZP_BYTE:32 [ fire::$5 ] 202: zp ZP_BYTE:33 [ fire::$6 ] 196.39: zp ZP_WORD:8 [ fire::buffer#7 fire::buffer#3 ] 132.73: zp ZP_WORD:6 [ fire::screen#4 fire::screen#10 fire::screen#2 ] 109.46: zp ZP_WORD:10 [ fire::screen#5 fire::screen#3 fire::screen#1 ] 0.27: zp ZP_WORD:2 [ fire::screen#0 ] 
Uplift Scope [sid_rnd] 202: zp ZP_BYTE:27 [ sid_rnd::return#2 ] 34.33: zp ZP_BYTE:34 [ sid_rnd::return#0 ] 
Uplift Scope [fillscreen] 26.83: zp ZP_WORD:23 [ fillscreen::screen#5 fillscreen::screen#6 fillscreen::screen#4 ] 23.83: zp ZP_WORD:25 [ fillscreen::i#2 fillscreen::i#1 ] 1.83: zp ZP_BYTE:22 [ fillscreen::fill#5 ] 
Uplift Scope [sid_rnd_init] 
Uplift Scope [main] 
Uplift Scope [] 

Uplifting [makecharset] best 124995 combination reg byte x [ makecharset::bc#3 makecharset::bc#5 makecharset::bc#6 makecharset::bc#1 makecharset::bc#2 ] reg byte y [ makecharset::b#2 makecharset::b#3 makecharset::b#1 ] reg byte a [ makecharset::$8 ] reg byte a [ makecharset::$9 ] zp ZP_BYTE:37 [ makecharset::$10 ] zp ZP_BYTE:20 [ makecharset::ii#2 makecharset::ii#1 ] zp ZP_BYTE:18 [ makecharset::i#6 makecharset::i#1 ] zp ZP_WORD:38 [ makecharset::$13 ] zp ZP_WORD:40 [ makecharset::$14 ] zp ZP_WORD:42 [ makecharset::$15 ] zp ZP_WORD:44 [ makecharset::$18 ] zp ZP_BYTE:17 [ makecharset::c#7 makecharset::c#1 ] zp ZP_WORD:13 [ makecharset::font#2 makecharset::font#1 ] zp ZP_WORD:15 [ makecharset::font1#2 makecharset::font1#1 ] 
Limited combination testing to 100 combinations of 512 possible.
Uplifting [fire] best 122095 combination reg byte a [ fire::c#2 fire::c#0 fire::c#1 ] zp ZP_WORD:4 [ fire::buffer#4 fire::buffer#2 ] reg byte a [ fire::$10 ] reg byte a [ fire::$11 ] reg byte a [ fire::$12 ] zp ZP_BYTE:31 [ fire::$4 ] zp ZP_BYTE:32 [ fire::$5 ] zp ZP_BYTE:33 [ fire::$6 ] zp ZP_WORD:8 [ fire::buffer#7 fire::buffer#3 ] zp ZP_WORD:6 [ fire::screen#4 fire::screen#10 fire::screen#2 ] zp ZP_WORD:10 [ fire::screen#5 fire::screen#3 fire::screen#1 ] zp ZP_WORD:2 [ fire::screen#0 ] 
Limited combination testing to 100 combinations of 16384 possible.
Uplifting [sid_rnd] best 121192 combination reg byte a [ sid_rnd::return#2 ] reg byte a [ sid_rnd::return#0 ] 
Uplifting [fillscreen] best 121170 combination zp ZP_WORD:23 [ fillscreen::screen#5 fillscreen::screen#6 fillscreen::screen#4 ] zp ZP_WORD:25 [ fillscreen::i#2 fillscreen::i#1 ] reg byte x [ fillscreen::fill#5 ] 
Uplifting [sid_rnd_init] best 121170 combination 
Uplifting [main] best 121170 combination 
Uplifting [] best 121170 combination 
Attempting to uplift remaining variables inzp ZP_BYTE:37 [ makecharset::$10 ]
Uplifting [makecharset] best 121170 combination zp ZP_BYTE:37 [ makecharset::$10 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:20 [ makecharset::ii#2 makecharset::ii#1 ]
Uplifting [makecharset] best 121170 combination zp ZP_BYTE:20 [ makecharset::ii#2 makecharset::ii#1 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:18 [ makecharset::i#6 makecharset::i#1 ]
Uplifting [makecharset] best 121170 combination zp ZP_BYTE:18 [ makecharset::i#6 makecharset::i#1 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:31 [ fire::$4 ]
Uplifting [fire] best 120570 combination reg byte a [ fire::$4 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:32 [ fire::$5 ]
Uplifting [fire] best 119970 combination reg byte a [ fire::$5 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:33 [ fire::$6 ]
Uplifting [fire] best 119370 combination reg byte a [ fire::$6 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:17 [ makecharset::c#7 makecharset::c#1 ]
Uplifting [makecharset] best 119370 combination zp ZP_BYTE:17 [ makecharset::c#7 makecharset::c#1 ] 
Coalescing zero page register with common assignment [ zp ZP_WORD:2 [ fire::screen#0 ] ] with [ zp ZP_WORD:10 [ fire::screen#5 fire::screen#3 fire::screen#1 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:38 [ makecharset::$13 ] ] with [ zp ZP_WORD:40 [ makecharset::$14 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:42 [ makecharset::$15 ] ] with [ zp ZP_WORD:44 [ makecharset::$18 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:38 [ makecharset::$13 makecharset::$14 ] ] with [ zp ZP_WORD:42 [ makecharset::$15 makecharset::$18 ] ] - score: 1
Allocated (was zp ZP_WORD:13) zp ZP_WORD:10 [ makecharset::font#2 makecharset::font#1 ]
Allocated (was zp ZP_WORD:15) zp ZP_WORD:12 [ makecharset::font1#2 makecharset::font1#1 ]
Allocated (was zp ZP_BYTE:17) zp ZP_BYTE:14 [ makecharset::c#7 makecharset::c#1 ]
Allocated (was zp ZP_BYTE:18) zp ZP_BYTE:15 [ makecharset::i#6 makecharset::i#1 ]
Allocated (was zp ZP_BYTE:20) zp ZP_BYTE:16 [ makecharset::ii#2 makecharset::ii#1 ]
Allocated (was zp ZP_WORD:23) zp ZP_WORD:17 [ fillscreen::screen#5 fillscreen::screen#6 fillscreen::screen#4 ]
Allocated (was zp ZP_WORD:25) zp ZP_WORD:19 [ fillscreen::i#2 fillscreen::i#1 ]
Allocated (was zp ZP_BYTE:37) zp ZP_BYTE:21 [ makecharset::$10 ]
Allocated (was zp ZP_WORD:38) zp ZP_WORD:22 [ makecharset::$13 makecharset::$14 makecharset::$15 makecharset::$18 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// A KickC version of the fire routine from the CC65 samples
// (w)2002 by groepaz/hitmen
// Cleanup and porting to CC65 by Ullrich von Bassewitz and Greg King .
// Ported to KickC by Jesper Gravgaard.
// Original source https://github.com/cc65/cc65/blob/master/samples/fire.c
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label BORDERCOL = $d020
  .label BGCOL = $d021
  .label D018 = $d018
  // Color Ram
  .label COLS = $d800
  // The colors of the C64
  .const BLACK = 0
  .const YELLOW = 7
  // SID registers for random number generation
  .label SID_VOICE3_FREQ = $d40e
  .label SID_VOICE3_CONTROL = $d412
  .const SID_CONTROL_NOISE = $80
  .label SID_VOICE3_OSC = $d41b
  .label SCREEN1 = $3800
  .label SCREEN2 = $3c00
  .label BUFFER = $4000
  .label CHARSET = $3000
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    .const toD0181_return = (>(SCREEN1&$3fff)*4)|(>CHARSET)/4&$f
    .const toD0182_return = (>(SCREEN2&$3fff)*4)|(>CHARSET)/4&$f
    // asm { sei  }
    sei
    // [5] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 
    lda #BLACK
    sta BORDERCOL
    // [6] *((const byte*) BGCOL#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 
    lda #BLACK
    sta BGCOL
    // [7] call fillscreen 
    // [90] phi from main to fillscreen [phi:main->fillscreen]
  fillscreen_from_main:
    // [90] phi (byte*) fillscreen::screen#6 = (const byte*) BUFFER#0 [phi:main->fillscreen#0] -- pbuz1=pbuc1 
    lda #<BUFFER
    sta fillscreen.screen
    lda #>BUFFER
    sta fillscreen.screen+1
    // [90] phi (byte) fillscreen::fill#5 = (byte) 0 [phi:main->fillscreen#1] -- vbuxx=vbuc1 
    ldx #0
    jsr fillscreen
    // [8] phi from main to main::@4 [phi:main->main::@4]
  b4_from_main:
    jmp b4
    // main::@4
  b4:
    // [9] call fillscreen 
    // [90] phi from main::@4 to fillscreen [phi:main::@4->fillscreen]
  fillscreen_from_b4:
    // [90] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN1#0 [phi:main::@4->fillscreen#0] -- pbuz1=pbuc1 
    lda #<SCREEN1
    sta fillscreen.screen
    lda #>SCREEN1
    sta fillscreen.screen+1
    // [90] phi (byte) fillscreen::fill#5 = (byte) 0 [phi:main::@4->fillscreen#1] -- vbuxx=vbuc1 
    ldx #0
    jsr fillscreen
    // [10] phi from main::@4 to main::@5 [phi:main::@4->main::@5]
  b5_from_b4:
    jmp b5
    // main::@5
  b5:
    // [11] call fillscreen 
    // [90] phi from main::@5 to fillscreen [phi:main::@5->fillscreen]
  fillscreen_from_b5:
    // [90] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN2#0 [phi:main::@5->fillscreen#0] -- pbuz1=pbuc1 
    lda #<SCREEN2
    sta fillscreen.screen
    lda #>SCREEN2
    sta fillscreen.screen+1
    // [90] phi (byte) fillscreen::fill#5 = (byte) 0 [phi:main::@5->fillscreen#1] -- vbuxx=vbuc1 
    ldx #0
    jsr fillscreen
    // [12] phi from main::@5 to main::@6 [phi:main::@5->main::@6]
  b6_from_b5:
    jmp b6
    // main::@6
  b6:
    // [13] call fillscreen 
    // [90] phi from main::@6 to fillscreen [phi:main::@6->fillscreen]
  fillscreen_from_b6:
    // [90] phi (byte*) fillscreen::screen#6 = (const byte*) COLS#0 [phi:main::@6->fillscreen#0] -- pbuz1=pbuc1 
    lda #<COLS
    sta fillscreen.screen
    lda #>COLS
    sta fillscreen.screen+1
    // [90] phi (byte) fillscreen::fill#5 = (const byte) YELLOW#0 [phi:main::@6->fillscreen#1] -- vbuxx=vbuc1 
    ldx #YELLOW
    jsr fillscreen
    // [14] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
  b7_from_b6:
    jmp b7
    // main::@7
  b7:
    // [15] call sid_rnd_init 
    jsr sid_rnd_init
    // [16] phi from main::@7 to main::@8 [phi:main::@7->main::@8]
  b8_from_b7:
    jmp b8
    // main::@8
  b8:
    // [17] call makecharset 
    // [55] phi from main::@8 to makecharset [phi:main::@8->makecharset]
  makecharset_from_b8:
    jsr makecharset
    // [18] phi from main::@3 main::@8 to main::@1 [phi:main::@3/main::@8->main::@1]
  b1_from_b3:
  b1_from_b8:
    jmp b1
    // main::@1
  b1:
    // [19] call fire 
    // [25] phi from main::@1 to fire [phi:main::@1->fire]
  fire_from_b1:
    // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN1#0 [phi:main::@1->fire#0] -- pbuz1=pbuc1 
    lda #<SCREEN1
    sta fire.screen
    lda #>SCREEN1
    sta fire.screen+1
    jsr fire
    // [20] phi from main::@1 to main::toD0181 [phi:main::@1->main::toD0181]
  toD0181_from_b1:
    jmp toD0181
    // main::toD0181
  toD0181:
    jmp b2
    // main::@2
  b2:
    // [21] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0181_return
    sta D018
    // [22] call fire 
    // [25] phi from main::@2 to fire [phi:main::@2->fire]
  fire_from_b2:
    // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN2#0 [phi:main::@2->fire#0] -- pbuz1=pbuc1 
    lda #<SCREEN2
    sta fire.screen
    lda #>SCREEN2
    sta fire.screen+1
    jsr fire
    // [23] phi from main::@2 to main::toD0182 [phi:main::@2->main::toD0182]
  toD0182_from_b2:
    jmp toD0182
    // main::toD0182
  toD0182:
    jmp b3
    // main::@3
  b3:
    // [24] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0182_return
    sta D018
    jmp b1_from_b3
}
  // fire
// Animate the fire on the passed screen. Uses BUFFER to store the current values.
fire: {
    .label screen = 2
    .label screen_2 = 6
    .label buffer = 4
    .label buffer_3 = 8
    .label screen_4 = 6
    .label buffer_7 = 8
    .label screen_10 = 6
    // [26] (byte*~) fire::screen#10 ← (byte*) fire::screen#0 -- pbuz1=pbuz2 
    lda screen
    sta screen_10
    lda screen+1
    sta screen_10+1
    // [27] phi from fire to fire::@1 [phi:fire->fire::@1]
  b1_from_fire:
    // [27] phi (byte*) fire::screen#4 = (byte*~) fire::screen#10 [phi:fire->fire::@1#0] -- register_copy 
    // [27] phi (byte*) fire::buffer#4 = (const byte*) BUFFER#0 [phi:fire->fire::@1#1] -- pbuz1=pbuc1 
    lda #<BUFFER
    sta buffer
    lda #>BUFFER
    sta buffer+1
    jmp b1
    // fire::@1
  b1:
    // [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER#0+(word)(number) $18*(number) $28) goto fire::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda buffer+1
    cmp #>BUFFER+$18*$28
    bne b2
    lda buffer
    cmp #<BUFFER+$18*$28
    bne b2
    jmp b3
    // fire::@3
  b3:
    // [29] (byte*) fire::screen#1 ← (byte*) fire::screen#0 + (word)(number) $18*(number) $28 -- pbuz1=pbuz1_plus_vwuc1 
    clc
    lda screen
    adc #<$18*$28
    sta screen
    lda screen+1
    adc #>$18*$28
    sta screen+1
    // [30] phi from fire::@3 to fire::@6 [phi:fire::@3->fire::@6]
  b6_from_b3:
    // [30] phi (byte*) fire::screen#5 = (byte*) fire::screen#1 [phi:fire::@3->fire::@6#0] -- register_copy 
    // [30] phi (byte*) fire::buffer#7 = (const byte*) BUFFER#0+(word)(number) $18*(number) $28 [phi:fire::@3->fire::@6#1] -- pbuz1=pbuc1 
    lda #<BUFFER+$18*$28
    sta buffer_7
    lda #>BUFFER+$18*$28
    sta buffer_7+1
    jmp b6
    // [30] phi from fire::@7 to fire::@6 [phi:fire::@7->fire::@6]
  b6_from_b7:
    // [30] phi (byte*) fire::screen#5 = (byte*) fire::screen#3 [phi:fire::@7->fire::@6#0] -- register_copy 
    // [30] phi (byte*) fire::buffer#7 = (byte*) fire::buffer#3 [phi:fire::@7->fire::@6#1] -- register_copy 
    jmp b6
    // fire::@6
  b6:
    // [31] call sid_rnd 
    jsr sid_rnd
    // [32] (byte) sid_rnd::return#2 ← (byte) sid_rnd::return#0
    jmp b7
    // fire::@7
  b7:
    // [33] (byte~) fire::$10 ← (byte) sid_rnd::return#2
    // [34] (byte~) fire::$11 ← (byte~) fire::$10 >> (byte) 4 -- vbuaa=vbuaa_ror_4 
    lsr
    lsr
    lsr
    lsr
    // [35] (byte~) fire::$12 ← (byte) $30 + (byte~) fire::$11 -- vbuaa=vbuc1_plus_vbuaa 
    clc
    adc #$30
    // [36] *((byte*) fire::buffer#7) ← (byte~) fire::$12 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (buffer_7),y
    // [37] *((byte*) fire::screen#5) ← *((byte*) fire::buffer#7) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (buffer_7),y
    ldy #0
    sta (screen),y
    // [38] (byte*) fire::screen#3 ← ++ (byte*) fire::screen#5 -- pbuz1=_inc_pbuz1 
    inc screen
    bne !+
    inc screen+1
  !:
    // [39] (byte*) fire::buffer#3 ← ++ (byte*) fire::buffer#7 -- pbuz1=_inc_pbuz1 
    inc buffer_3
    bne !+
    inc buffer_3+1
  !:
    // [40] if((byte*) fire::buffer#3!=(const byte*) BUFFER#0+(word)(number) $19*(number) $28) goto fire::@6 -- pbuz1_neq_pbuc1_then_la1 
    lda buffer_3+1
    cmp #>BUFFER+$19*$28
    bne b6_from_b7
    lda buffer_3
    cmp #<BUFFER+$19*$28
    bne b6_from_b7
    jmp breturn
    // fire::@return
  breturn:
    // [41] return 
    rts
    // fire::@2
  b2:
    // [42] (byte~) fire::$4 ← *((byte*) fire::buffer#4 + (byte)(number) $28-(number) 1) + *((byte*) fire::buffer#4 + (byte)(number) $28-(number) 1) -- vbuaa=pbuz1_derefidx_vbuc1_plus_pbuz1_derefidx_vbuc2 
    ldy #$28-1
    clc
    lda (buffer),y
    ldy #$28-1
    adc (buffer),y
    // [43] (byte~) fire::$5 ← (byte~) fire::$4 + *((byte*) fire::buffer#4 + (byte) $28) -- vbuaa=vbuaa_plus_pbuz1_derefidx_vbuc1 
    ldy #$28
    clc
    adc (buffer),y
    // [44] (byte~) fire::$6 ← (byte~) fire::$5 + *((byte*) fire::buffer#4 + (byte) $29) -- vbuaa=vbuaa_plus_pbuz1_derefidx_vbuc1 
    ldy #$29
    clc
    adc (buffer),y
    // [45] (byte) fire::c#0 ← (byte~) fire::$6 >> (byte) 2 -- vbuaa=vbuaa_ror_2 
    lsr
    lsr
    // [46] if((byte) fire::c#0<(byte) 2+(byte) 1) goto fire::@4 -- vbuaa_lt_vbuc1_then_la1 
    cmp #2+1
    bcc b4_from_b2
    jmp b5
    // fire::@5
  b5:
    // [47] (byte) fire::c#1 ← (byte) fire::c#0 - (byte) 3 -- vbuaa=vbuaa_minus_vbuc1 
    sec
    sbc #3
    // [48] phi from fire::@2 fire::@5 to fire::@4 [phi:fire::@2/fire::@5->fire::@4]
  b4_from_b2:
  b4_from_b5:
    // [48] phi (byte) fire::c#2 = (byte) fire::c#0 [phi:fire::@2/fire::@5->fire::@4#0] -- register_copy 
    jmp b4
    // fire::@4
  b4:
    // [49] *((byte*) fire::buffer#4) ← (byte) fire::c#2 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (buffer),y
    // [50] *((byte*) fire::screen#4) ← *((byte*) fire::buffer#4) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (buffer),y
    ldy #0
    sta (screen_4),y
    // [51] (byte*) fire::screen#2 ← ++ (byte*) fire::screen#4 -- pbuz1=_inc_pbuz1 
    inc screen_2
    bne !+
    inc screen_2+1
  !:
    // [52] (byte*) fire::buffer#2 ← ++ (byte*) fire::buffer#4 -- pbuz1=_inc_pbuz1 
    inc buffer
    bne !+
    inc buffer+1
  !:
    // [27] phi from fire::@4 to fire::@1 [phi:fire::@4->fire::@1]
  b1_from_b4:
    // [27] phi (byte*) fire::screen#4 = (byte*) fire::screen#2 [phi:fire::@4->fire::@1#0] -- register_copy 
    // [27] phi (byte*) fire::buffer#4 = (byte*) fire::buffer#2 [phi:fire::@4->fire::@1#1] -- register_copy 
    jmp b1
}
  // sid_rnd
// Get a random number from the SID voice 3,
// Must be initialized with sid_rnd_init()
sid_rnd: {
    // [53] (byte) sid_rnd::return#0 ← *((const byte*) SID_VOICE3_OSC#0) -- vbuaa=_deref_pbuc1 
    lda SID_VOICE3_OSC
    jmp breturn
    // sid_rnd::@return
  breturn:
    // [54] return 
    rts
}
  // makecharset
// Make a fire-friendly charset in chars $00-$3f of the passed charset
makecharset: {
    .label _10 = $15
    .label _13 = $16
    .label _14 = $16
    .label _15 = $16
    .label font = $a
    .label font1 = $c
    .label ii = $10
    .label i = $f
    .label c = $e
    .label _18 = $16
    // [56] phi from makecharset to makecharset::@1 [phi:makecharset->makecharset::@1]
  b1_from_makecharset:
    // [56] phi (byte*) makecharset::font#2 = (const byte*) CHARSET#0 [phi:makecharset->makecharset::@1#0] -- pbuz1=pbuc1 
    lda #<CHARSET
    sta font
    lda #>CHARSET
    sta font+1
    jmp b1
    // [56] phi from makecharset::@1 to makecharset::@1 [phi:makecharset::@1->makecharset::@1]
  b1_from_b1:
    // [56] phi (byte*) makecharset::font#2 = (byte*) makecharset::font#1 [phi:makecharset::@1->makecharset::@1#0] -- register_copy 
    jmp b1
    // makecharset::@1
  b1:
    // [57] *((byte*) makecharset::font#2) ← (byte) 0 -- _deref_pbuz1=vbuc1 
    lda #0
    ldy #0
    sta (font),y
    // [58] (byte*) makecharset::font#1 ← ++ (byte*) makecharset::font#2 -- pbuz1=_inc_pbuz1 
    inc font
    bne !+
    inc font+1
  !:
    // [59] if((byte*) makecharset::font#1!=(const byte*) CHARSET#0+(byte)(number) 1*(number) 8) goto makecharset::@1 -- pbuz1_neq_pbuc1_then_la1 
    lda font+1
    cmp #>CHARSET+1*8
    bne b1_from_b1
    lda font
    cmp #<CHARSET+1*8
    bne b1_from_b1
    // [60] phi from makecharset::@1 to makecharset::@2 [phi:makecharset::@1->makecharset::@2]
  b2_from_b1:
    // [60] phi (byte*) makecharset::font1#2 = (const byte*) CHARSET#0+(word)(number) $40*(number) 8 [phi:makecharset::@1->makecharset::@2#0] -- pbuz1=pbuc1 
    lda #<CHARSET+$40*8
    sta font1
    lda #>CHARSET+$40*8
    sta font1+1
    jmp b2
    // [60] phi from makecharset::@2 to makecharset::@2 [phi:makecharset::@2->makecharset::@2]
  b2_from_b2:
    // [60] phi (byte*) makecharset::font1#2 = (byte*) makecharset::font1#1 [phi:makecharset::@2->makecharset::@2#0] -- register_copy 
    jmp b2
    // makecharset::@2
  b2:
    // [61] *((byte*) makecharset::font1#2) ← (byte) $ff -- _deref_pbuz1=vbuc1 
    lda #$ff
    ldy #0
    sta (font1),y
    // [62] (byte*) makecharset::font1#1 ← ++ (byte*) makecharset::font1#2 -- pbuz1=_inc_pbuz1 
    inc font1
    bne !+
    inc font1+1
  !:
    // [63] if((byte*) makecharset::font1#1!=(const byte*) CHARSET#0+(word)(number) $100*(number) 8) goto makecharset::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda font1+1
    cmp #>CHARSET+$100*8
    bne b2_from_b2
    lda font1
    cmp #<CHARSET+$100*8
    bne b2_from_b2
    // [64] phi from makecharset::@2 to makecharset::@3 [phi:makecharset::@2->makecharset::@3]
  b3_from_b2:
    // [64] phi (byte) makecharset::c#7 = (byte) 0 [phi:makecharset::@2->makecharset::@3#0] -- vbuz1=vbuc1 
    lda #0
    sta c
    jmp b3
    // [64] phi from makecharset::@9 to makecharset::@3 [phi:makecharset::@9->makecharset::@3]
  b3_from_b9:
    // [64] phi (byte) makecharset::c#7 = (byte) makecharset::c#1 [phi:makecharset::@9->makecharset::@3#0] -- register_copy 
    jmp b3
    // makecharset::@3
  b3:
    // [65] phi from makecharset::@3 to makecharset::@4 [phi:makecharset::@3->makecharset::@4]
  b4_from_b3:
    // [65] phi (byte) makecharset::i#6 = (byte) 0 [phi:makecharset::@3->makecharset::@4#0] -- vbuz1=vbuc1 
    lda #0
    sta i
    // [65] phi (byte) makecharset::bc#5 = (byte) 0 [phi:makecharset::@3->makecharset::@4#1] -- vbuxx=vbuc1 
    ldx #0
    jmp b4
    // [65] phi from makecharset::@8 to makecharset::@4 [phi:makecharset::@8->makecharset::@4]
  b4_from_b8:
    // [65] phi (byte) makecharset::i#6 = (byte) makecharset::i#1 [phi:makecharset::@8->makecharset::@4#0] -- register_copy 
    // [65] phi (byte) makecharset::bc#5 = (byte) makecharset::bc#6 [phi:makecharset::@8->makecharset::@4#1] -- register_copy 
    jmp b4
    // makecharset::@4
  b4:
    // [66] phi from makecharset::@4 to makecharset::@5 [phi:makecharset::@4->makecharset::@5]
  b5_from_b4:
    // [66] phi (byte) makecharset::b#2 = (byte) 0 [phi:makecharset::@4->makecharset::@5#0] -- vbuyy=vbuc1 
    ldy #0
    // [66] phi (byte) makecharset::ii#2 = (byte) 0 [phi:makecharset::@4->makecharset::@5#1] -- vbuz1=vbuc1 
    lda #0
    sta ii
    // [66] phi (byte) makecharset::bc#3 = (byte) makecharset::bc#5 [phi:makecharset::@4->makecharset::@5#2] -- register_copy 
    jmp b5
    // [66] phi from makecharset::@6 to makecharset::@5 [phi:makecharset::@6->makecharset::@5]
  b5_from_b6:
    // [66] phi (byte) makecharset::b#2 = (byte) makecharset::b#3 [phi:makecharset::@6->makecharset::@5#0] -- register_copy 
    // [66] phi (byte) makecharset::ii#2 = (byte) makecharset::ii#1 [phi:makecharset::@6->makecharset::@5#1] -- register_copy 
    // [66] phi (byte) makecharset::bc#3 = (byte) makecharset::bc#6 [phi:makecharset::@6->makecharset::@5#2] -- register_copy 
    jmp b5
    // makecharset::@5
  b5:
    // [67] (byte) makecharset::bc#1 ← (byte) makecharset::bc#3 + (byte) makecharset::c#7 -- vbuxx=vbuxx_plus_vbuz1 
    txa
    clc
    adc c
    tax
    // [68] if((byte) makecharset::bc#1<(byte) $3f+(byte) 1) goto makecharset::@6 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$3f+1
    bcc b6_from_b5
    jmp b7
    // makecharset::@7
  b7:
    // [69] (byte) makecharset::bc#2 ← (byte) makecharset::bc#1 - (byte) $40 -- vbuxx=vbuxx_minus_vbuc1 
    txa
    axs #$40
    // [70] (byte~) makecharset::$8 ← (byte) makecharset::i#6 & (byte) 1 -- vbuaa=vbuz1_band_vbuc1 
    lda #1
    and i
    // [71] (byte~) makecharset::$9 ← (byte) makecharset::ii#2 + (byte~) makecharset::$8 -- vbuaa=vbuz1_plus_vbuaa 
    clc
    adc ii
    // [72] (byte~) makecharset::$10 ← (byte~) makecharset::$9 & (byte) 7 -- vbuz1=vbuaa_band_vbuc1 
    and #7
    sta _10
    // [73] (byte) makecharset::b#1 ← (byte) makecharset::b#2 + *((const byte[8]) makecharset::bittab#0 + (byte~) makecharset::$10) -- vbuyy=vbuyy_plus_pbuc1_derefidx_vbuz1 
    tya
    ldy _10
    clc
    adc bittab,y
    tay
    // [74] phi from makecharset::@5 makecharset::@7 to makecharset::@6 [phi:makecharset::@5/makecharset::@7->makecharset::@6]
  b6_from_b5:
  b6_from_b7:
    // [74] phi (byte) makecharset::b#3 = (byte) makecharset::b#2 [phi:makecharset::@5/makecharset::@7->makecharset::@6#0] -- register_copy 
    // [74] phi (byte) makecharset::bc#6 = (byte) makecharset::bc#1 [phi:makecharset::@5/makecharset::@7->makecharset::@6#1] -- register_copy 
    jmp b6
    // makecharset::@6
  b6:
    // [75] (byte) makecharset::ii#1 ← ++ (byte) makecharset::ii#2 -- vbuz1=_inc_vbuz1 
    inc ii
    // [76] if((byte) makecharset::ii#1<(byte) 8) goto makecharset::@5 -- vbuz1_lt_vbuc1_then_la1 
    lda ii
    cmp #8
    bcc b5_from_b6
    jmp b8
    // makecharset::@8
  b8:
    // [77] (word~) makecharset::$13 ← (word)(byte) makecharset::c#7 -- vwuz1=_word_vbuz2 
    lda c
    sta _13
    lda #0
    sta _13+1
    // [78] (word~) makecharset::$14 ← (word~) makecharset::$13 << (byte) 3 -- vwuz1=vwuz1_rol_3 
    asl _14
    rol _14+1
    asl _14
    rol _14+1
    asl _14
    rol _14+1
    // [79] (word~) makecharset::$15 ← (word~) makecharset::$14 + (byte) makecharset::i#6 -- vwuz1=vwuz1_plus_vbuz2 
    lda i
    clc
    adc _15
    sta _15
    bcc !+
    inc _15+1
  !:
    // [80] (byte*~) makecharset::$18 ← (const byte*) CHARSET#0+(byte)(number) 1*(number) 8 + (word~) makecharset::$15 -- pbuz1=pbuc1_plus_vwuz1 
    clc
    lda _18
    adc #<CHARSET+1*8
    sta _18
    lda _18+1
    adc #>CHARSET+1*8
    sta _18+1
    // [81] *((byte*~) makecharset::$18) ← (byte) makecharset::b#3 -- _deref_pbuz1=vbuyy 
    tya
    ldy #0
    sta (_18),y
    // [82] (byte) makecharset::i#1 ← ++ (byte) makecharset::i#6 -- vbuz1=_inc_vbuz1 
    inc i
    // [83] if((byte) makecharset::i#1<(byte) 8) goto makecharset::@4 -- vbuz1_lt_vbuc1_then_la1 
    lda i
    cmp #8
    bcc b4_from_b8
    jmp b9
    // makecharset::@9
  b9:
    // [84] (byte) makecharset::c#1 ← ++ (byte) makecharset::c#7 -- vbuz1=_inc_vbuz1 
    inc c
    // [85] if((byte) makecharset::c#1<(byte) $40) goto makecharset::@3 -- vbuz1_lt_vbuc1_then_la1 
    lda c
    cmp #$40
    bcc b3_from_b9
    jmp breturn
    // makecharset::@return
  breturn:
    // [86] return 
    rts
    bittab: .byte 1, 2, 4, 8, $10, $20, $40, $80
}
  // sid_rnd_init
// Initialize SID voice 3 for random number generation
sid_rnd_init: {
    // [87] *((const word*) SID_VOICE3_FREQ#0) ← (word) $ffff -- _deref_pwuc1=vwuc2 
    lda #<$ffff
    sta SID_VOICE3_FREQ
    lda #>$ffff
    sta SID_VOICE3_FREQ+1
    // [88] *((const byte*) SID_VOICE3_CONTROL#0) ← (const byte) SID_CONTROL_NOISE#0 -- _deref_pbuc1=vbuc2 
    lda #SID_CONTROL_NOISE
    sta SID_VOICE3_CONTROL
    jmp breturn
    // sid_rnd_init::@return
  breturn:
    // [89] return 
    rts
}
  // fillscreen
// Fill a screen (1000 bytes) with a specific byte
// fillscreen(byte* zeropage($11) screen, byte register(X) fill)
fillscreen: {
    .label screen = $11
    .label i = $13
    // [91] phi from fillscreen to fillscreen::@1 [phi:fillscreen->fillscreen::@1]
  b1_from_fillscreen:
    // [91] phi (word) fillscreen::i#2 = (word) 0 [phi:fillscreen->fillscreen::@1#0] -- vwuz1=vwuc1 
    lda #<0
    sta i
    lda #>0
    sta i+1
    // [91] phi (byte*) fillscreen::screen#5 = (byte*) fillscreen::screen#6 [phi:fillscreen->fillscreen::@1#1] -- register_copy 
    jmp b1
    // [91] phi from fillscreen::@1 to fillscreen::@1 [phi:fillscreen::@1->fillscreen::@1]
  b1_from_b1:
    // [91] phi (word) fillscreen::i#2 = (word) fillscreen::i#1 [phi:fillscreen::@1->fillscreen::@1#0] -- register_copy 
    // [91] phi (byte*) fillscreen::screen#5 = (byte*) fillscreen::screen#4 [phi:fillscreen::@1->fillscreen::@1#1] -- register_copy 
    jmp b1
    // fillscreen::@1
  b1:
    // [92] *((byte*) fillscreen::screen#5) ← (byte) fillscreen::fill#5 -- _deref_pbuz1=vbuxx 
    txa
    ldy #0
    sta (screen),y
    // [93] (byte*) fillscreen::screen#4 ← ++ (byte*) fillscreen::screen#5 -- pbuz1=_inc_pbuz1 
    inc screen
    bne !+
    inc screen+1
  !:
    // [94] (word) fillscreen::i#1 ← ++ (word) fillscreen::i#2 -- vwuz1=_inc_vwuz1 
    inc i
    bne !+
    inc i+1
  !:
    // [95] if((word) fillscreen::i#1!=(word) $3e8) goto fillscreen::@1 -- vwuz1_neq_vwuc1_then_la1 
    lda i+1
    cmp #>$3e8
    bne b1_from_b1
    lda i
    cmp #<$3e8
    bne b1_from_b1
    jmp breturn
    // fillscreen::@return
  breturn:
    // [96] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp b4
Removing instruction jmp b5
Removing instruction jmp b6
Removing instruction jmp b7
Removing instruction jmp b8
Removing instruction jmp b1
Removing instruction jmp toD0181
Removing instruction jmp b2
Removing instruction jmp toD0182
Removing instruction jmp b3
Removing instruction jmp b1
Removing instruction jmp b3
Removing instruction jmp b6
Removing instruction jmp b7
Removing instruction jmp breturn
Removing instruction jmp b5
Removing instruction jmp b4
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp b4
Removing instruction jmp b5
Removing instruction jmp b7
Removing instruction jmp b6
Removing instruction jmp b8
Removing instruction jmp b9
Removing instruction jmp breturn
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #BLACK
Removing instruction ldy #0
Removing instruction ldy #0
Removing instruction ldy #$28-1
Removing instruction ldy #0
Removing instruction ldy #0
Replacing instruction ldy #0 with TAY
Replacing instruction ldx #0 with TAX
Replacing instruction lda #0 with TYA
Removing instruction lda #>0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label b1_from_b3 with b1
Replacing label b6_from_b7 with b6
Replacing label b6_from_b7 with b6
Replacing label b4_from_b2 with b4
Replacing label b1_from_b1 with b1
Replacing label b1_from_b1 with b1
Replacing label b2_from_b2 with b2
Replacing label b2_from_b2 with b2
Replacing label b6_from_b5 with b6
Replacing label b5_from_b6 with b5
Replacing label b4_from_b8 with b4
Replacing label b3_from_b9 with b3
Replacing label b1_from_b1 with b1
Replacing label b1_from_b1 with b1
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction bend_from_b1:
Removing instruction b4_from_main:
Removing instruction fillscreen_from_b4:
Removing instruction b5_from_b4:
Removing instruction fillscreen_from_b5:
Removing instruction b6_from_b5:
Removing instruction fillscreen_from_b6:
Removing instruction b7_from_b6:
Removing instruction b8_from_b7:
Removing instruction makecharset_from_b8:
Removing instruction b1_from_b3:
Removing instruction b1_from_b8:
Removing instruction fire_from_b1:
Removing instruction toD0181_from_b1:
Removing instruction toD0181:
Removing instruction toD0182_from_b2:
Removing instruction toD0182:
Removing instruction b6_from_b7:
Removing instruction b4_from_b2:
Removing instruction b4_from_b5:
Removing instruction b1_from_b1:
Removing instruction b2_from_b2:
Removing instruction b3_from_b9:
Removing instruction b4_from_b3:
Removing instruction b4_from_b8:
Removing instruction b5_from_b4:
Removing instruction b5_from_b6:
Removing instruction b6_from_b5:
Removing instruction b6_from_b7:
Removing instruction b1_from_b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction fillscreen_from_main:
Removing instruction b4:
Removing instruction b5:
Removing instruction b6:
Removing instruction b7:
Removing instruction b8:
Removing instruction b2:
Removing instruction fire_from_b2:
Removing instruction b3:
Removing instruction b1_from_fire:
Removing instruction b3:
Removing instruction b6_from_b3:
Removing instruction b7:
Removing instruction breturn:
Removing instruction b5:
Removing instruction b1_from_b4:
Removing instruction breturn:
Removing instruction b1_from_makecharset:
Removing instruction b2_from_b1:
Removing instruction b3_from_b2:
Removing instruction b7:
Removing instruction b8:
Removing instruction b9:
Removing instruction breturn:
Removing instruction breturn:
Removing instruction b1_from_fillscreen:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp b6
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp b4
Removing instruction jmp b5
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(byte*) BGCOL
(const byte*) BGCOL#0 BGCOL = (byte*) 53281
(byte) BLACK
(const byte) BLACK#0 BLACK = (byte) 0
(byte*) BORDERCOL
(const byte*) BORDERCOL#0 BORDERCOL = (byte*) 53280
(byte*) BUFFER
(const byte*) BUFFER#0 BUFFER = (byte*) 16384
(byte*) CHARSET
(const byte*) CHARSET#0 CHARSET = (byte*) 12288
(byte*) COLS
(const byte*) COLS#0 COLS = (byte*) 55296
(byte*) D018
(const byte*) D018#0 D018 = (byte*) 53272
(byte*) SCREEN1
(const byte*) SCREEN1#0 SCREEN1 = (byte*) 14336
(byte*) SCREEN2
(const byte*) SCREEN2#0 SCREEN2 = (byte*) 15360
(byte) SID_CONTROL_NOISE
(const byte) SID_CONTROL_NOISE#0 SID_CONTROL_NOISE = (byte) $80
(byte*) SID_VOICE3_CONTROL
(const byte*) SID_VOICE3_CONTROL#0 SID_VOICE3_CONTROL = (byte*) 54290
(word*) SID_VOICE3_FREQ
(const word*) SID_VOICE3_FREQ#0 SID_VOICE3_FREQ = (word*) 54286
(byte*) SID_VOICE3_OSC
(const byte*) SID_VOICE3_OSC#0 SID_VOICE3_OSC = (byte*) 54299
(byte) YELLOW
(const byte) YELLOW#0 YELLOW = (byte) 7
(void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill)
(label) fillscreen::@1
(label) fillscreen::@return
(byte) fillscreen::fill
(byte) fillscreen::fill#5 reg byte x 1.8333333333333333
(word) fillscreen::i
(word) fillscreen::i#1 i zp ZP_WORD:19 16.5
(word) fillscreen::i#2 i zp ZP_WORD:19 7.333333333333333
(byte*) fillscreen::screen
(byte*) fillscreen::screen#4 screen zp ZP_WORD:17 7.333333333333333
(byte*) fillscreen::screen#5 screen zp ZP_WORD:17 17.5
(byte*) fillscreen::screen#6 screen zp ZP_WORD:17 2.0
(void()) fire((byte*) fire::screenbase)
(byte~) fire::$10 reg byte a 202.0
(byte~) fire::$11 reg byte a 202.0
(byte~) fire::$12 reg byte a 202.0
(byte~) fire::$4 reg byte a 202.0
(byte~) fire::$5 reg byte a 202.0
(byte~) fire::$6 reg byte a 202.0
(label) fire::@1
(label) fire::@2
(label) fire::@3
(label) fire::@4
(label) fire::@5
(label) fire::@6
(label) fire::@7
(label) fire::@return
(byte*) fire::buffer
(byte*) fire::buffer#2 buffer zp ZP_WORD:4 202.0
(byte*) fire::buffer#3 buffer#3 zp ZP_WORD:8 151.5
(byte*) fire::buffer#4 buffer zp ZP_WORD:4 75.75
(byte*) fire::buffer#7 buffer#7 zp ZP_WORD:8 44.888888888888886
(byte) fire::c
(byte) fire::c#0 reg byte a 202.0
(byte) fire::c#1 reg byte a 202.0
(byte) fire::c#2 reg byte a 303.0
(byte*) fire::screen
(byte*) fire::screen#0 screen zp ZP_WORD:2 0.26666666666666666
(byte*) fire::screen#1 screen zp ZP_WORD:2 4.0
(byte*~) fire::screen#10 screen#10 zp ZP_WORD:6 4.0
(byte*) fire::screen#2 screen#2 zp ZP_WORD:6 101.0
(byte*) fire::screen#3 screen zp ZP_WORD:2 67.33333333333333
(byte*) fire::screen#4 screen#4 zp ZP_WORD:6 27.727272727272727
(byte*) fire::screen#5 screen zp ZP_WORD:2 38.125
(byte*) fire::screenbase
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@8
(label) main::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
(byte*) main::toD0181_gfx
(byte) main::toD0181_return
(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN1#0&(word) $3fff*(byte) 4|>(word)(const byte*) CHARSET#0/(byte) 4&(byte) $f
(byte*) main::toD0181_screen
(label) main::toD0182
(word~) main::toD0182_$0
(number~) main::toD0182_$1
(number~) main::toD0182_$2
(number~) main::toD0182_$3
(word~) main::toD0182_$4
(byte~) main::toD0182_$5
(number~) main::toD0182_$6
(number~) main::toD0182_$7
(number~) main::toD0182_$8
(byte*) main::toD0182_gfx
(byte) main::toD0182_return
(const byte) main::toD0182_return#0 toD0182_return = >(word)(const byte*) SCREEN2#0&(word) $3fff*(byte) 4|>(word)(const byte*) CHARSET#0/(byte) 4&(byte) $f
(byte*) main::toD0182_screen
(void()) makecharset((byte*) makecharset::charset)
(byte~) makecharset::$10 $10 zp ZP_BYTE:21 2002.0
(word~) makecharset::$13 $13 zp ZP_WORD:22 202.0
(word~) makecharset::$14 $14 zp ZP_WORD:22 202.0
(word~) makecharset::$15 $15 zp ZP_WORD:22 202.0
(byte*~) makecharset::$18 $18 zp ZP_WORD:22 202.0
(byte~) makecharset::$8 reg byte a 2002.0
(byte~) makecharset::$9 reg byte a 2002.0
(label) makecharset::@1
(label) makecharset::@2
(label) makecharset::@3
(label) makecharset::@4
(label) makecharset::@5
(label) makecharset::@6
(label) makecharset::@7
(label) makecharset::@8
(label) makecharset::@9
(label) makecharset::@return
(byte) makecharset::b
(byte) makecharset::b#1 reg byte y 2002.0
(byte) makecharset::b#2 reg byte y 429.0
(byte) makecharset::b#3 reg byte y 443.42857142857144
(byte) makecharset::bc
(byte) makecharset::bc#1 reg byte x 2002.0
(byte) makecharset::bc#2 reg byte x 400.4
(byte) makecharset::bc#3 reg byte x 2103.0
(byte) makecharset::bc#5 reg byte x 202.0
(byte) makecharset::bc#6 reg byte x 310.4
(byte[8]) makecharset::bittab
(const byte[8]) makecharset::bittab#0 bittab = { (byte) 1, (byte) 2, (byte) 4, (byte) 8, (byte) $10, (byte) $20, (byte) $40, (byte) $80 }
(byte) makecharset::c
(byte) makecharset::c#1 c zp ZP_BYTE:14 16.5
(byte) makecharset::c#7 c zp ZP_BYTE:14 51.14999999999999
(byte*) makecharset::charset
(byte*) makecharset::font
(byte*) makecharset::font#1 font zp ZP_WORD:10 16.5
(byte*) makecharset::font#2 font zp ZP_WORD:10 16.5
(byte*) makecharset::font1
(byte*) makecharset::font1#1 font1 zp ZP_WORD:12 16.5
(byte*) makecharset::font1#2 font1 zp ZP_WORD:12 16.5
(byte) makecharset::i
(byte) makecharset::i#1 i zp ZP_BYTE:15 151.5
(byte) makecharset::i#6 i zp ZP_BYTE:15 76.70588235294117
(byte) makecharset::ii
(byte) makecharset::ii#1 ii zp ZP_BYTE:16 1501.5
(byte) makecharset::ii#2 ii zp ZP_BYTE:16 333.6666666666667
(byte()) sid_rnd()
(label) sid_rnd::@return
(byte) sid_rnd::return
(byte) sid_rnd::return#0 reg byte a 34.33333333333333
(byte) sid_rnd::return#2 reg byte a 202.0
(void()) sid_rnd_init()
(label) sid_rnd_init::@return

zp ZP_WORD:2 [ fire::screen#0 fire::screen#5 fire::screen#3 fire::screen#1 ]
zp ZP_WORD:4 [ fire::buffer#4 fire::buffer#2 ]
zp ZP_WORD:6 [ fire::screen#4 fire::screen#10 fire::screen#2 ]
zp ZP_WORD:8 [ fire::buffer#7 fire::buffer#3 ]
reg byte a [ fire::c#2 fire::c#0 fire::c#1 ]
zp ZP_WORD:10 [ makecharset::font#2 makecharset::font#1 ]
zp ZP_WORD:12 [ makecharset::font1#2 makecharset::font1#1 ]
zp ZP_BYTE:14 [ makecharset::c#7 makecharset::c#1 ]
zp ZP_BYTE:15 [ makecharset::i#6 makecharset::i#1 ]
reg byte x [ makecharset::bc#3 makecharset::bc#5 makecharset::bc#6 makecharset::bc#1 makecharset::bc#2 ]
zp ZP_BYTE:16 [ makecharset::ii#2 makecharset::ii#1 ]
reg byte y [ makecharset::b#2 makecharset::b#3 makecharset::b#1 ]
reg byte x [ fillscreen::fill#5 ]
zp ZP_WORD:17 [ fillscreen::screen#5 fillscreen::screen#6 fillscreen::screen#4 ]
zp ZP_WORD:19 [ fillscreen::i#2 fillscreen::i#1 ]
reg byte a [ sid_rnd::return#2 ]
reg byte a [ fire::$10 ]
reg byte a [ fire::$11 ]
reg byte a [ fire::$12 ]
reg byte a [ fire::$4 ]
reg byte a [ fire::$5 ]
reg byte a [ fire::$6 ]
reg byte a [ sid_rnd::return#0 ]
reg byte a [ makecharset::$8 ]
reg byte a [ makecharset::$9 ]
zp ZP_BYTE:21 [ makecharset::$10 ]
zp ZP_WORD:22 [ makecharset::$13 makecharset::$14 makecharset::$15 makecharset::$18 ]


FINAL ASSEMBLER
Score: 98915

  // File Comments
// A KickC version of the fire routine from the CC65 samples
// (w)2002 by groepaz/hitmen
// Cleanup and porting to CC65 by Ullrich von Bassewitz and Greg King .
// Ported to KickC by Jesper Gravgaard.
// Original source https://github.com/cc65/cc65/blob/master/samples/fire.c
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .label BORDERCOL = $d020
  .label BGCOL = $d021
  .label D018 = $d018
  // Color Ram
  .label COLS = $d800
  // The colors of the C64
  .const BLACK = 0
  .const YELLOW = 7
  // SID registers for random number generation
  .label SID_VOICE3_FREQ = $d40e
  .label SID_VOICE3_CONTROL = $d412
  .const SID_CONTROL_NOISE = $80
  .label SID_VOICE3_OSC = $d41b
  .label SCREEN1 = $3800
  .label SCREEN2 = $3c00
  .label BUFFER = $4000
  .label CHARSET = $3000
  // @begin
  // [1] phi from @begin to @1 [phi:@begin->@1]
  // @1
  // [2] call main 
  // [3] phi from @1 to @end [phi:@1->@end]
  // @end
  // main
main: {
    .const toD0181_return = (>(SCREEN1&$3fff)*4)|(>CHARSET)/4&$f
    .const toD0182_return = (>(SCREEN2&$3fff)*4)|(>CHARSET)/4&$f
    // asm
    // asm { sei  }
    sei
    // *BORDERCOL = BLACK
    // [5] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 
    lda #BLACK
    sta BORDERCOL
    // *BGCOL = BLACK
    // [6] *((const byte*) BGCOL#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 
    sta BGCOL
    // fillscreen(BUFFER, 00)
    // [7] call fillscreen 
    // [90] phi from main to fillscreen [phi:main->fillscreen]
    // [90] phi (byte*) fillscreen::screen#6 = (const byte*) BUFFER#0 [phi:main->fillscreen#0] -- pbuz1=pbuc1 
    lda #<BUFFER
    sta fillscreen.screen
    lda #>BUFFER
    sta fillscreen.screen+1
    // [90] phi (byte) fillscreen::fill#5 = (byte) 0 [phi:main->fillscreen#1] -- vbuxx=vbuc1 
    ldx #0
    jsr fillscreen
    // [8] phi from main to main::@4 [phi:main->main::@4]
    // main::@4
    // fillscreen(SCREEN1, 00)
    // [9] call fillscreen 
    // [90] phi from main::@4 to fillscreen [phi:main::@4->fillscreen]
    // [90] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN1#0 [phi:main::@4->fillscreen#0] -- pbuz1=pbuc1 
    lda #<SCREEN1
    sta fillscreen.screen
    lda #>SCREEN1
    sta fillscreen.screen+1
    // [90] phi (byte) fillscreen::fill#5 = (byte) 0 [phi:main::@4->fillscreen#1] -- vbuxx=vbuc1 
    ldx #0
    jsr fillscreen
    // [10] phi from main::@4 to main::@5 [phi:main::@4->main::@5]
    // main::@5
    // fillscreen(SCREEN2, 00)
    // [11] call fillscreen 
    // [90] phi from main::@5 to fillscreen [phi:main::@5->fillscreen]
    // [90] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN2#0 [phi:main::@5->fillscreen#0] -- pbuz1=pbuc1 
    lda #<SCREEN2
    sta fillscreen.screen
    lda #>SCREEN2
    sta fillscreen.screen+1
    // [90] phi (byte) fillscreen::fill#5 = (byte) 0 [phi:main::@5->fillscreen#1] -- vbuxx=vbuc1 
    ldx #0
    jsr fillscreen
    // [12] phi from main::@5 to main::@6 [phi:main::@5->main::@6]
    // main::@6
    // fillscreen(COLS, YELLOW)
    // [13] call fillscreen 
    // [90] phi from main::@6 to fillscreen [phi:main::@6->fillscreen]
    // [90] phi (byte*) fillscreen::screen#6 = (const byte*) COLS#0 [phi:main::@6->fillscreen#0] -- pbuz1=pbuc1 
    lda #<COLS
    sta fillscreen.screen
    lda #>COLS
    sta fillscreen.screen+1
    // [90] phi (byte) fillscreen::fill#5 = (const byte) YELLOW#0 [phi:main::@6->fillscreen#1] -- vbuxx=vbuc1 
    ldx #YELLOW
    jsr fillscreen
    // [14] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
    // main::@7
    // sid_rnd_init()
    // [15] call sid_rnd_init 
    jsr sid_rnd_init
    // [16] phi from main::@7 to main::@8 [phi:main::@7->main::@8]
    // main::@8
    // makecharset(CHARSET)
    // [17] call makecharset 
    // [55] phi from main::@8 to makecharset [phi:main::@8->makecharset]
    jsr makecharset
    // [18] phi from main::@3 main::@8 to main::@1 [phi:main::@3/main::@8->main::@1]
    // main::@1
  b1:
    // fire(SCREEN1)
    // [19] call fire 
    // [25] phi from main::@1 to fire [phi:main::@1->fire]
    // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN1#0 [phi:main::@1->fire#0] -- pbuz1=pbuc1 
    lda #<SCREEN1
    sta fire.screen
    lda #>SCREEN1
    sta fire.screen+1
    jsr fire
    // [20] phi from main::@1 to main::toD0181 [phi:main::@1->main::toD0181]
    // main::toD0181
    // main::@2
    // *D018 = toD018(SCREEN1, CHARSET)
    // [21] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0181_return
    sta D018
    // fire(SCREEN2)
    // [22] call fire 
    // [25] phi from main::@2 to fire [phi:main::@2->fire]
    // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN2#0 [phi:main::@2->fire#0] -- pbuz1=pbuc1 
    lda #<SCREEN2
    sta fire.screen
    lda #>SCREEN2
    sta fire.screen+1
    jsr fire
    // [23] phi from main::@2 to main::toD0182 [phi:main::@2->main::toD0182]
    // main::toD0182
    // main::@3
    // *D018 = toD018(SCREEN2, CHARSET)
    // [24] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0182_return
    sta D018
    jmp b1
}
  // fire
// Animate the fire on the passed screen. Uses BUFFER to store the current values.
fire: {
    .label screen = 2
    .label screen_2 = 6
    .label buffer = 4
    .label buffer_3 = 8
    .label screen_4 = 6
    .label buffer_7 = 8
    .label screen_10 = 6
    // [26] (byte*~) fire::screen#10 ← (byte*) fire::screen#0 -- pbuz1=pbuz2 
    lda screen
    sta screen_10
    lda screen+1
    sta screen_10+1
    // [27] phi from fire to fire::@1 [phi:fire->fire::@1]
    // [27] phi (byte*) fire::screen#4 = (byte*~) fire::screen#10 [phi:fire->fire::@1#0] -- register_copy 
    // [27] phi (byte*) fire::buffer#4 = (const byte*) BUFFER#0 [phi:fire->fire::@1#1] -- pbuz1=pbuc1 
    lda #<BUFFER
    sta buffer
    lda #>BUFFER
    sta buffer+1
    // fire::@1
  b1:
    // while (buffer != (BUFFER + (24 * 40)))
    // [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER#0+(word)(number) $18*(number) $28) goto fire::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda buffer+1
    cmp #>BUFFER+$18*$28
    bne b2
    lda buffer
    cmp #<BUFFER+$18*$28
    bne b2
    // fire::@3
    // screen = (screenbase + (24 * 40))
    // [29] (byte*) fire::screen#1 ← (byte*) fire::screen#0 + (word)(number) $18*(number) $28 -- pbuz1=pbuz1_plus_vwuc1 
    clc
    lda screen
    adc #<$18*$28
    sta screen
    lda screen+1
    adc #>$18*$28
    sta screen+1
    // [30] phi from fire::@3 to fire::@6 [phi:fire::@3->fire::@6]
    // [30] phi (byte*) fire::screen#5 = (byte*) fire::screen#1 [phi:fire::@3->fire::@6#0] -- register_copy 
    // [30] phi (byte*) fire::buffer#7 = (const byte*) BUFFER#0+(word)(number) $18*(number) $28 [phi:fire::@3->fire::@6#1] -- pbuz1=pbuc1 
    lda #<BUFFER+$18*$28
    sta buffer_7
    lda #>BUFFER+$18*$28
    sta buffer_7+1
    // [30] phi from fire::@7 to fire::@6 [phi:fire::@7->fire::@6]
    // [30] phi (byte*) fire::screen#5 = (byte*) fire::screen#3 [phi:fire::@7->fire::@6#0] -- register_copy 
    // [30] phi (byte*) fire::buffer#7 = (byte*) fire::buffer#3 [phi:fire::@7->fire::@6#1] -- register_copy 
    // fire::@6
  b6:
    // sid_rnd()
    // [31] call sid_rnd 
    jsr sid_rnd
    // [32] (byte) sid_rnd::return#2 ← (byte) sid_rnd::return#0
    // fire::@7
    // [33] (byte~) fire::$10 ← (byte) sid_rnd::return#2
    // (sid_rnd())/$10
    // [34] (byte~) fire::$11 ← (byte~) fire::$10 >> (byte) 4 -- vbuaa=vbuaa_ror_4 
    lsr
    lsr
    lsr
    lsr
    // 0x30 + (sid_rnd())/$10
    // [35] (byte~) fire::$12 ← (byte) $30 + (byte~) fire::$11 -- vbuaa=vbuc1_plus_vbuaa 
    clc
    adc #$30
    // *buffer = 0x30 + (sid_rnd())/$10
    // [36] *((byte*) fire::buffer#7) ← (byte~) fire::$12 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (buffer_7),y
    // *screen = *buffer = 0x30 + (sid_rnd())/$10
    // [37] *((byte*) fire::screen#5) ← *((byte*) fire::buffer#7) -- _deref_pbuz1=_deref_pbuz2 
    lda (buffer_7),y
    sta (screen),y
    // for(; buffer != (BUFFER+(25*40)); ++screen, ++buffer)
    // [38] (byte*) fire::screen#3 ← ++ (byte*) fire::screen#5 -- pbuz1=_inc_pbuz1 
    inc screen
    bne !+
    inc screen+1
  !:
    // [39] (byte*) fire::buffer#3 ← ++ (byte*) fire::buffer#7 -- pbuz1=_inc_pbuz1 
    inc buffer_3
    bne !+
    inc buffer_3+1
  !:
    // [40] if((byte*) fire::buffer#3!=(const byte*) BUFFER#0+(word)(number) $19*(number) $28) goto fire::@6 -- pbuz1_neq_pbuc1_then_la1 
    lda buffer_3+1
    cmp #>BUFFER+$19*$28
    bne b6
    lda buffer_3
    cmp #<BUFFER+$19*$28
    bne b6
    // fire::@return
    // }
    // [41] return 
    rts
    // fire::@2
  b2:
    // buffer[40-1] + buffer[40-1]
    // [42] (byte~) fire::$4 ← *((byte*) fire::buffer#4 + (byte)(number) $28-(number) 1) + *((byte*) fire::buffer#4 + (byte)(number) $28-(number) 1) -- vbuaa=pbuz1_derefidx_vbuc1_plus_pbuz1_derefidx_vbuc2 
    ldy #$28-1
    clc
    lda (buffer),y
    adc (buffer),y
    // buffer[40-1] + buffer[40-1] + buffer[40]
    // [43] (byte~) fire::$5 ← (byte~) fire::$4 + *((byte*) fire::buffer#4 + (byte) $28) -- vbuaa=vbuaa_plus_pbuz1_derefidx_vbuc1 
    ldy #$28
    clc
    adc (buffer),y
    // buffer[40-1] + buffer[40-1] + buffer[40] + buffer[41]
    // [44] (byte~) fire::$6 ← (byte~) fire::$5 + *((byte*) fire::buffer#4 + (byte) $29) -- vbuaa=vbuaa_plus_pbuz1_derefidx_vbuc1 
    ldy #$29
    clc
    adc (buffer),y
    // c = ( buffer[40-1] + buffer[40-1] + buffer[40] + buffer[41] )/4
    // [45] (byte) fire::c#0 ← (byte~) fire::$6 >> (byte) 2 -- vbuaa=vbuaa_ror_2 
    lsr
    lsr
    // if (c > 2)
    // [46] if((byte) fire::c#0<(byte) 2+(byte) 1) goto fire::@4 -- vbuaa_lt_vbuc1_then_la1 
    cmp #2+1
    bcc b4
    // fire::@5
    // c -= 3
    // [47] (byte) fire::c#1 ← (byte) fire::c#0 - (byte) 3 -- vbuaa=vbuaa_minus_vbuc1 
    sec
    sbc #3
    // [48] phi from fire::@2 fire::@5 to fire::@4 [phi:fire::@2/fire::@5->fire::@4]
    // [48] phi (byte) fire::c#2 = (byte) fire::c#0 [phi:fire::@2/fire::@5->fire::@4#0] -- register_copy 
    // fire::@4
  b4:
    // *buffer = c
    // [49] *((byte*) fire::buffer#4) ← (byte) fire::c#2 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (buffer),y
    // *screen = *buffer = c
    // [50] *((byte*) fire::screen#4) ← *((byte*) fire::buffer#4) -- _deref_pbuz1=_deref_pbuz2 
    lda (buffer),y
    sta (screen_4),y
    // ++screen;
    // [51] (byte*) fire::screen#2 ← ++ (byte*) fire::screen#4 -- pbuz1=_inc_pbuz1 
    inc screen_2
    bne !+
    inc screen_2+1
  !:
    // ++buffer;
    // [52] (byte*) fire::buffer#2 ← ++ (byte*) fire::buffer#4 -- pbuz1=_inc_pbuz1 
    inc buffer
    bne !+
    inc buffer+1
  !:
    // [27] phi from fire::@4 to fire::@1 [phi:fire::@4->fire::@1]
    // [27] phi (byte*) fire::screen#4 = (byte*) fire::screen#2 [phi:fire::@4->fire::@1#0] -- register_copy 
    // [27] phi (byte*) fire::buffer#4 = (byte*) fire::buffer#2 [phi:fire::@4->fire::@1#1] -- register_copy 
    jmp b1
}
  // sid_rnd
// Get a random number from the SID voice 3,
// Must be initialized with sid_rnd_init()
sid_rnd: {
    // return *SID_VOICE3_OSC;
    // [53] (byte) sid_rnd::return#0 ← *((const byte*) SID_VOICE3_OSC#0) -- vbuaa=_deref_pbuc1 
    lda SID_VOICE3_OSC
    // sid_rnd::@return
    // }
    // [54] return 
    rts
}
  // makecharset
// Make a fire-friendly charset in chars $00-$3f of the passed charset
makecharset: {
    .label _10 = $15
    .label _13 = $16
    .label _14 = $16
    .label _15 = $16
    .label font = $a
    .label font1 = $c
    .label ii = $10
    .label i = $f
    .label c = $e
    .label _18 = $16
    // [56] phi from makecharset to makecharset::@1 [phi:makecharset->makecharset::@1]
    // [56] phi (byte*) makecharset::font#2 = (const byte*) CHARSET#0 [phi:makecharset->makecharset::@1#0] -- pbuz1=pbuc1 
    lda #<CHARSET
    sta font
    lda #>CHARSET
    sta font+1
    // [56] phi from makecharset::@1 to makecharset::@1 [phi:makecharset::@1->makecharset::@1]
    // [56] phi (byte*) makecharset::font#2 = (byte*) makecharset::font#1 [phi:makecharset::@1->makecharset::@1#0] -- register_copy 
    // makecharset::@1
  b1:
    // *font = 0x00
    // [57] *((byte*) makecharset::font#2) ← (byte) 0 -- _deref_pbuz1=vbuc1 
    lda #0
    tay
    sta (font),y
    // for (unsigned char *font = charset; font != (charset+(1*8)); ++font)
    // [58] (byte*) makecharset::font#1 ← ++ (byte*) makecharset::font#2 -- pbuz1=_inc_pbuz1 
    inc font
    bne !+
    inc font+1
  !:
    // [59] if((byte*) makecharset::font#1!=(const byte*) CHARSET#0+(byte)(number) 1*(number) 8) goto makecharset::@1 -- pbuz1_neq_pbuc1_then_la1 
    lda font+1
    cmp #>CHARSET+1*8
    bne b1
    lda font
    cmp #<CHARSET+1*8
    bne b1
    // [60] phi from makecharset::@1 to makecharset::@2 [phi:makecharset::@1->makecharset::@2]
    // [60] phi (byte*) makecharset::font1#2 = (const byte*) CHARSET#0+(word)(number) $40*(number) 8 [phi:makecharset::@1->makecharset::@2#0] -- pbuz1=pbuc1 
    lda #<CHARSET+$40*8
    sta font1
    lda #>CHARSET+$40*8
    sta font1+1
    // [60] phi from makecharset::@2 to makecharset::@2 [phi:makecharset::@2->makecharset::@2]
    // [60] phi (byte*) makecharset::font1#2 = (byte*) makecharset::font1#1 [phi:makecharset::@2->makecharset::@2#0] -- register_copy 
    // makecharset::@2
  b2:
    // *font = 0xff
    // [61] *((byte*) makecharset::font1#2) ← (byte) $ff -- _deref_pbuz1=vbuc1 
    lda #$ff
    ldy #0
    sta (font1),y
    // for (unsigned char *font = (charset+(64*8)); font != (charset+(256*8)); ++font)
    // [62] (byte*) makecharset::font1#1 ← ++ (byte*) makecharset::font1#2 -- pbuz1=_inc_pbuz1 
    inc font1
    bne !+
    inc font1+1
  !:
    // [63] if((byte*) makecharset::font1#1!=(const byte*) CHARSET#0+(word)(number) $100*(number) 8) goto makecharset::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda font1+1
    cmp #>CHARSET+$100*8
    bne b2
    lda font1
    cmp #<CHARSET+$100*8
    bne b2
    // [64] phi from makecharset::@2 to makecharset::@3 [phi:makecharset::@2->makecharset::@3]
    // [64] phi (byte) makecharset::c#7 = (byte) 0 [phi:makecharset::@2->makecharset::@3#0] -- vbuz1=vbuc1 
    lda #0
    sta c
    // [64] phi from makecharset::@9 to makecharset::@3 [phi:makecharset::@9->makecharset::@3]
    // [64] phi (byte) makecharset::c#7 = (byte) makecharset::c#1 [phi:makecharset::@9->makecharset::@3#0] -- register_copy 
    // makecharset::@3
  b3:
    // [65] phi from makecharset::@3 to makecharset::@4 [phi:makecharset::@3->makecharset::@4]
    // [65] phi (byte) makecharset::i#6 = (byte) 0 [phi:makecharset::@3->makecharset::@4#0] -- vbuz1=vbuc1 
    lda #0
    sta i
    // [65] phi (byte) makecharset::bc#5 = (byte) 0 [phi:makecharset::@3->makecharset::@4#1] -- vbuxx=vbuc1 
    tax
    // [65] phi from makecharset::@8 to makecharset::@4 [phi:makecharset::@8->makecharset::@4]
    // [65] phi (byte) makecharset::i#6 = (byte) makecharset::i#1 [phi:makecharset::@8->makecharset::@4#0] -- register_copy 
    // [65] phi (byte) makecharset::bc#5 = (byte) makecharset::bc#6 [phi:makecharset::@8->makecharset::@4#1] -- register_copy 
    // makecharset::@4
  b4:
    // [66] phi from makecharset::@4 to makecharset::@5 [phi:makecharset::@4->makecharset::@5]
    // [66] phi (byte) makecharset::b#2 = (byte) 0 [phi:makecharset::@4->makecharset::@5#0] -- vbuyy=vbuc1 
    ldy #0
    // [66] phi (byte) makecharset::ii#2 = (byte) 0 [phi:makecharset::@4->makecharset::@5#1] -- vbuz1=vbuc1 
    tya
    sta ii
    // [66] phi (byte) makecharset::bc#3 = (byte) makecharset::bc#5 [phi:makecharset::@4->makecharset::@5#2] -- register_copy 
    // [66] phi from makecharset::@6 to makecharset::@5 [phi:makecharset::@6->makecharset::@5]
    // [66] phi (byte) makecharset::b#2 = (byte) makecharset::b#3 [phi:makecharset::@6->makecharset::@5#0] -- register_copy 
    // [66] phi (byte) makecharset::ii#2 = (byte) makecharset::ii#1 [phi:makecharset::@6->makecharset::@5#1] -- register_copy 
    // [66] phi (byte) makecharset::bc#3 = (byte) makecharset::bc#6 [phi:makecharset::@6->makecharset::@5#2] -- register_copy 
    // makecharset::@5
  b5:
    // bc += c
    // [67] (byte) makecharset::bc#1 ← (byte) makecharset::bc#3 + (byte) makecharset::c#7 -- vbuxx=vbuxx_plus_vbuz1 
    txa
    clc
    adc c
    tax
    // if (bc > 0x3f)
    // [68] if((byte) makecharset::bc#1<(byte) $3f+(byte) 1) goto makecharset::@6 -- vbuxx_lt_vbuc1_then_la1 
    cpx #$3f+1
    bcc b6
    // makecharset::@7
    // bc = bc - 0x40
    // [69] (byte) makecharset::bc#2 ← (byte) makecharset::bc#1 - (byte) $40 -- vbuxx=vbuxx_minus_vbuc1 
    txa
    axs #$40
    // i & 1
    // [70] (byte~) makecharset::$8 ← (byte) makecharset::i#6 & (byte) 1 -- vbuaa=vbuz1_band_vbuc1 
    lda #1
    and i
    // ii + (i & 1)
    // [71] (byte~) makecharset::$9 ← (byte) makecharset::ii#2 + (byte~) makecharset::$8 -- vbuaa=vbuz1_plus_vbuaa 
    clc
    adc ii
    // (ii + (i & 1)) & 0x7
    // [72] (byte~) makecharset::$10 ← (byte~) makecharset::$9 & (byte) 7 -- vbuz1=vbuaa_band_vbuc1 
    and #7
    sta _10
    // b += bittab[(ii + (i & 1)) & 0x7]
    // [73] (byte) makecharset::b#1 ← (byte) makecharset::b#2 + *((const byte[8]) makecharset::bittab#0 + (byte~) makecharset::$10) -- vbuyy=vbuyy_plus_pbuc1_derefidx_vbuz1 
    tya
    ldy _10
    clc
    adc bittab,y
    tay
    // [74] phi from makecharset::@5 makecharset::@7 to makecharset::@6 [phi:makecharset::@5/makecharset::@7->makecharset::@6]
    // [74] phi (byte) makecharset::b#3 = (byte) makecharset::b#2 [phi:makecharset::@5/makecharset::@7->makecharset::@6#0] -- register_copy 
    // [74] phi (byte) makecharset::bc#6 = (byte) makecharset::bc#1 [phi:makecharset::@5/makecharset::@7->makecharset::@6#1] -- register_copy 
    // makecharset::@6
  b6:
    // for (unsigned char ii = 0; ii < 8; ii++)
    // [75] (byte) makecharset::ii#1 ← ++ (byte) makecharset::ii#2 -- vbuz1=_inc_vbuz1 
    inc ii
    // [76] if((byte) makecharset::ii#1<(byte) 8) goto makecharset::@5 -- vbuz1_lt_vbuc1_then_la1 
    lda ii
    cmp #8
    bcc b5
    // makecharset::@8
    // (unsigned short)c
    // [77] (word~) makecharset::$13 ← (word)(byte) makecharset::c#7 -- vwuz1=_word_vbuz2 
    lda c
    sta _13
    lda #0
    sta _13+1
    // ((unsigned short)c) << 3
    // [78] (word~) makecharset::$14 ← (word~) makecharset::$13 << (byte) 3 -- vwuz1=vwuz1_rol_3 
    asl _14
    rol _14+1
    asl _14
    rol _14+1
    asl _14
    rol _14+1
    // (((unsigned short)c) << 3) + i
    // [79] (word~) makecharset::$15 ← (word~) makecharset::$14 + (byte) makecharset::i#6 -- vwuz1=vwuz1_plus_vbuz2 
    lda i
    clc
    adc _15
    sta _15
    bcc !+
    inc _15+1
  !:
    // (charset + (1 * 8)) [(((unsigned short)c) << 3) + i] = b
    // [80] (byte*~) makecharset::$18 ← (const byte*) CHARSET#0+(byte)(number) 1*(number) 8 + (word~) makecharset::$15 -- pbuz1=pbuc1_plus_vwuz1 
    clc
    lda _18
    adc #<CHARSET+1*8
    sta _18
    lda _18+1
    adc #>CHARSET+1*8
    sta _18+1
    // [81] *((byte*~) makecharset::$18) ← (byte) makecharset::b#3 -- _deref_pbuz1=vbuyy 
    tya
    ldy #0
    sta (_18),y
    // for (unsigned char bc = 0, i = 0; i < 8; i++)
    // [82] (byte) makecharset::i#1 ← ++ (byte) makecharset::i#6 -- vbuz1=_inc_vbuz1 
    inc i
    // [83] if((byte) makecharset::i#1<(byte) 8) goto makecharset::@4 -- vbuz1_lt_vbuc1_then_la1 
    lda i
    cmp #8
    bcc b4
    // makecharset::@9
    // for (unsigned char c = 0; c < 0x40; ++c)
    // [84] (byte) makecharset::c#1 ← ++ (byte) makecharset::c#7 -- vbuz1=_inc_vbuz1 
    inc c
    // [85] if((byte) makecharset::c#1<(byte) $40) goto makecharset::@3 -- vbuz1_lt_vbuc1_then_la1 
    lda c
    cmp #$40
    bcc b3
    // makecharset::@return
    // }
    // [86] return 
    rts
    bittab: .byte 1, 2, 4, 8, $10, $20, $40, $80
}
  // sid_rnd_init
// Initialize SID voice 3 for random number generation
sid_rnd_init: {
    // *SID_VOICE3_FREQ = $ffff
    // [87] *((const word*) SID_VOICE3_FREQ#0) ← (word) $ffff -- _deref_pwuc1=vwuc2 
    lda #<$ffff
    sta SID_VOICE3_FREQ
    lda #>$ffff
    sta SID_VOICE3_FREQ+1
    // *SID_VOICE3_CONTROL = SID_CONTROL_NOISE
    // [88] *((const byte*) SID_VOICE3_CONTROL#0) ← (const byte) SID_CONTROL_NOISE#0 -- _deref_pbuc1=vbuc2 
    lda #SID_CONTROL_NOISE
    sta SID_VOICE3_CONTROL
    // sid_rnd_init::@return
    // }
    // [89] return 
    rts
}
  // fillscreen
// Fill a screen (1000 bytes) with a specific byte
// fillscreen(byte* zeropage($11) screen, byte register(X) fill)
fillscreen: {
    .label screen = $11
    .label i = $13
    // [91] phi from fillscreen to fillscreen::@1 [phi:fillscreen->fillscreen::@1]
    // [91] phi (word) fillscreen::i#2 = (word) 0 [phi:fillscreen->fillscreen::@1#0] -- vwuz1=vwuc1 
    lda #<0
    sta i
    sta i+1
    // [91] phi (byte*) fillscreen::screen#5 = (byte*) fillscreen::screen#6 [phi:fillscreen->fillscreen::@1#1] -- register_copy 
    // [91] phi from fillscreen::@1 to fillscreen::@1 [phi:fillscreen::@1->fillscreen::@1]
    // [91] phi (word) fillscreen::i#2 = (word) fillscreen::i#1 [phi:fillscreen::@1->fillscreen::@1#0] -- register_copy 
    // [91] phi (byte*) fillscreen::screen#5 = (byte*) fillscreen::screen#4 [phi:fillscreen::@1->fillscreen::@1#1] -- register_copy 
    // fillscreen::@1
  b1:
    // *screen++ = fill
    // [92] *((byte*) fillscreen::screen#5) ← (byte) fillscreen::fill#5 -- _deref_pbuz1=vbuxx 
    txa
    ldy #0
    sta (screen),y
    // *screen++ = fill;
    // [93] (byte*) fillscreen::screen#4 ← ++ (byte*) fillscreen::screen#5 -- pbuz1=_inc_pbuz1 
    inc screen
    bne !+
    inc screen+1
  !:
    // for( unsigned word i : 0..999)
    // [94] (word) fillscreen::i#1 ← ++ (word) fillscreen::i#2 -- vwuz1=_inc_vwuz1 
    inc i
    bne !+
    inc i+1
  !:
    // [95] if((word) fillscreen::i#1!=(word) $3e8) goto fillscreen::@1 -- vwuz1_neq_vwuc1_then_la1 
    lda i+1
    cmp #>$3e8
    bne b1
    lda i
    cmp #<$3e8
    bne b1
    // fillscreen::@return
    // }
    // [96] return 
    rts
}
  // File Data

