Identified constant variable (byte*) D011
Identified constant variable (byte) RST8
Identified constant variable (byte) ECM
Identified constant variable (byte) BMM
Identified constant variable (byte) DEN
Identified constant variable (byte) RSEL
Identified constant variable (byte*) RASTER
Identified constant variable (byte*) D016
Identified constant variable (byte) MCM
Identified constant variable (byte) CSEL
Identified constant variable (byte*) D018
Identified constant variable (byte*) BGCOL
Identified constant variable (byte*) FGCOL
Identified constant variable (byte*) COLS
Identified constant variable (byte*) SCREEN
Identified constant variable (byte) plots_cnt
Culled Empty Block (label) main::@1
Culled Empty Block (label) main::@4
Culled Empty Block (label) @1
Culled Empty Block (label) plots::@4
Culled Empty Block (label) plots::@3
Culled Empty Block (label) plots::@5
Culled Empty Block (label) plots::@6
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) init_plot_tables::@8
Culled Empty Block (label) @4
Culled Empty Block (label) init_screen::@4
Culled Empty Block (label) init_screen::@5
Culled Empty Block (label) init_screen::@6
Culled Empty Block (label) init_screen::@10
Culled Empty Block (label) init_screen::@9
Culled Empty Block (label) init_screen::@11
Culled Empty Block (label) init_screen::@12

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

(void()) main()
main: scope:[main]  from @5
  *((const byte*) BGCOL) ← (number) 0
  *((const byte*) FGCOL) ← (number) 0
  (byte~) main::$0 ← (const byte) BMM | (const byte) DEN
  (byte~) main::$1 ← (byte~) main::$0 | (const byte) RSEL
  (number~) main::$2 ← (byte~) main::$1 | (number) 3
  *((const byte*) D011) ← (number~) main::$2
  (word~) main::$3 ← ((word)) (const byte*) SCREEN
  (number~) main::$4 ← (word~) main::$3 / (number) $40
  (number~) main::$5 ← (number~) main::$4 | (word)(const byte*) BITMAP/(number) $400
  (byte~) main::$6 ← ((byte)) (number~) main::$5
  *((const byte*) D018) ← (byte~) main::$6
  call init_screen 
  to:main::@5
main::@5: scope:[main]  from main
  call init_plot_tables 
  to:main::@6
main::@6: scope:[main]  from main::@5
  to:main::@2
main::@2: scope:[main]  from main::@2 main::@6 main::@7
  (bool~) main::$9 ← *((const byte*) RASTER) != (number) $ff
  if((bool~) main::$9) goto main::@2
  to:main::@3
main::@3: scope:[main]  from main::@2
  *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL)
  call plots 
  to:main::@7
main::@7: scope:[main]  from main::@3
  *((const byte*) BGCOL) ← -- *((const byte*) BGCOL)
  if(true) goto main::@2
  to:main::@return
main::@return: scope:[main]  from main::@7
  return 
  to:@return

(void()) plots()
plots: scope:[plots]  from main::@3
  (byte) plots::i#0 ← (byte) 0
  to:plots::@1
plots::@1: scope:[plots]  from plots plots::@7
  (byte) plots::i#2 ← phi( plots/(byte) plots::i#0 plots::@7/(byte) plots::i#1 )
  (bool~) plots::$0 ← (byte) plots::i#2 < (const byte) plots_cnt
  if((bool~) plots::$0) goto plots::@2
  to:plots::@return
plots::@2: scope:[plots]  from plots::@1
  (byte) plots::i#3 ← phi( plots::@1/(byte) plots::i#2 )
  (byte) plot::x#0 ← *((const byte*) plots_x + (byte) plots::i#3)
  (byte) plot::y#0 ← *((const byte*) plots_y + (byte) plots::i#3)
  call plot 
  to:plots::@7
plots::@7: scope:[plots]  from plots::@2
  (byte) plots::i#4 ← phi( plots::@2/(byte) plots::i#3 )
  (byte) plots::i#1 ← ++ (byte) plots::i#4
  to:plots::@1
plots::@return: scope:[plots]  from plots::@1
  return 
  to:@return

(void()) plot((byte) plot::x , (byte) plot::y)
plot: scope:[plot]  from plots::@2
  (byte) plot::y#1 ← phi( plots::@2/(byte) plot::y#0 )
  (byte) plot::x#1 ← phi( plots::@2/(byte) plot::x#0 )
  (byte*) plot::plotter_x#0 ← (byte*)(number) 0
  (word) plot::plotter_y#0 ← (word) 0
  (byte~) plot::$6 ← *((const byte*) plot_xhi + (byte) plot::x#1)
  (byte*) plot::plotter_x#1 ← (byte*) plot::plotter_x#0 hi= (byte~) plot::$6
  (byte~) plot::$7 ← *((const byte*) plot_xlo + (byte) plot::x#1)
  (byte*) plot::plotter_x#2 ← (byte*) plot::plotter_x#1 lo= (byte~) plot::$7
  (byte~) plot::$8 ← *((const byte*) plot_yhi + (byte) plot::y#1)
  (word) plot::plotter_y#1 ← (word) plot::plotter_y#0 hi= (byte~) plot::$8
  (byte~) plot::$9 ← *((const byte*) plot_ylo + (byte) plot::y#1)
  (word) plot::plotter_y#2 ← (word) plot::plotter_y#1 lo= (byte~) plot::$9
  (byte*~) plot::$4 ← (byte*) plot::plotter_x#2 + (word) plot::plotter_y#2
  (byte*) plot::plotter#0 ← (byte*~) plot::$4
  (byte~) plot::$5 ← *((byte*) plot::plotter#0) | *((const byte*) plot_bit + (byte) plot::x#1)
  *((byte*) plot::plotter#0) ← (byte~) plot::$5
  to:plot::@return
plot::@return: scope:[plot]  from plot
  return 
  to:@return

(void()) init_plot_tables()
init_plot_tables: scope:[init_plot_tables]  from main::@5
  (byte) init_plot_tables::bits#0 ← (byte) $80
  (byte) init_plot_tables::x#0 ← (byte) 0
  to:init_plot_tables::@1
init_plot_tables::@1: scope:[init_plot_tables]  from init_plot_tables init_plot_tables::@2
  (byte) init_plot_tables::bits#3 ← phi( init_plot_tables/(byte) init_plot_tables::bits#0 init_plot_tables::@2/(byte) init_plot_tables::bits#4 )
  (byte) init_plot_tables::x#2 ← phi( init_plot_tables/(byte) init_plot_tables::x#0 init_plot_tables::@2/(byte) init_plot_tables::x#1 )
  (number~) init_plot_tables::$0 ← (byte) init_plot_tables::x#2 & (number) $f8
  *((const byte*) plot_xlo + (byte) init_plot_tables::x#2) ← (number~) init_plot_tables::$0
  *((const byte*) plot_xhi + (byte) init_plot_tables::x#2) ← >(const byte*) BITMAP
  *((const byte*) plot_bit + (byte) init_plot_tables::x#2) ← (byte) init_plot_tables::bits#3
  (number~) init_plot_tables::$1 ← (byte) init_plot_tables::bits#3 / (number) 2
  (byte) init_plot_tables::bits#1 ← (number~) init_plot_tables::$1
  (bool~) init_plot_tables::$2 ← (byte) init_plot_tables::bits#1 == (number) 0
  (bool~) init_plot_tables::$3 ← ! (bool~) init_plot_tables::$2
  if((bool~) init_plot_tables::$3) goto init_plot_tables::@2
  to:init_plot_tables::@3
init_plot_tables::@2: scope:[init_plot_tables]  from init_plot_tables::@1 init_plot_tables::@3
  (byte) init_plot_tables::bits#4 ← phi( init_plot_tables::@1/(byte) init_plot_tables::bits#1 init_plot_tables::@3/(byte) init_plot_tables::bits#2 )
  (byte) init_plot_tables::x#3 ← phi( init_plot_tables::@1/(byte) init_plot_tables::x#2 init_plot_tables::@3/(byte) init_plot_tables::x#4 )
  (byte) init_plot_tables::x#1 ← (byte) init_plot_tables::x#3 + rangenext(0,$ff)
  (bool~) init_plot_tables::$4 ← (byte) init_plot_tables::x#1 != rangelast(0,$ff)
  if((bool~) init_plot_tables::$4) goto init_plot_tables::@1
  to:init_plot_tables::@4
init_plot_tables::@3: scope:[init_plot_tables]  from init_plot_tables::@1
  (byte) init_plot_tables::x#4 ← phi( init_plot_tables::@1/(byte) init_plot_tables::x#2 )
  (byte) init_plot_tables::bits#2 ← (number) $80
  to:init_plot_tables::@2
init_plot_tables::@4: scope:[init_plot_tables]  from init_plot_tables::@2
  (byte*) init_plot_tables::yoffs#0 ← (byte*)(number) 0
  (byte) init_plot_tables::y#0 ← (byte) 0
  to:init_plot_tables::@5
init_plot_tables::@5: scope:[init_plot_tables]  from init_plot_tables::@4 init_plot_tables::@6
  (byte*) init_plot_tables::yoffs#2 ← phi( init_plot_tables::@4/(byte*) init_plot_tables::yoffs#0 init_plot_tables::@6/(byte*) init_plot_tables::yoffs#4 )
  (byte) init_plot_tables::y#2 ← phi( init_plot_tables::@4/(byte) init_plot_tables::y#0 init_plot_tables::@6/(byte) init_plot_tables::y#1 )
  (number~) init_plot_tables::$5 ← (byte) init_plot_tables::y#2 & (number) 7
  (byte~) init_plot_tables::$6 ← < (byte*) init_plot_tables::yoffs#2
  (number~) init_plot_tables::$7 ← (number~) init_plot_tables::$5 | (byte~) init_plot_tables::$6
  *((const byte*) plot_ylo + (byte) init_plot_tables::y#2) ← (number~) init_plot_tables::$7
  (byte~) init_plot_tables::$8 ← > (byte*) init_plot_tables::yoffs#2
  *((const byte*) plot_yhi + (byte) init_plot_tables::y#2) ← (byte~) init_plot_tables::$8
  (number~) init_plot_tables::$9 ← (byte) init_plot_tables::y#2 & (number) 7
  (bool~) init_plot_tables::$10 ← (number~) init_plot_tables::$9 == (number) 7
  (bool~) init_plot_tables::$11 ← ! (bool~) init_plot_tables::$10
  if((bool~) init_plot_tables::$11) goto init_plot_tables::@6
  to:init_plot_tables::@7
init_plot_tables::@6: scope:[init_plot_tables]  from init_plot_tables::@5 init_plot_tables::@7
  (byte*) init_plot_tables::yoffs#4 ← phi( init_plot_tables::@5/(byte*) init_plot_tables::yoffs#2 init_plot_tables::@7/(byte*) init_plot_tables::yoffs#1 )
  (byte) init_plot_tables::y#3 ← phi( init_plot_tables::@5/(byte) init_plot_tables::y#2 init_plot_tables::@7/(byte) init_plot_tables::y#4 )
  (byte) init_plot_tables::y#1 ← (byte) init_plot_tables::y#3 + rangenext(0,$ff)
  (bool~) init_plot_tables::$13 ← (byte) init_plot_tables::y#1 != rangelast(0,$ff)
  if((bool~) init_plot_tables::$13) goto init_plot_tables::@5
  to:init_plot_tables::@return
init_plot_tables::@7: scope:[init_plot_tables]  from init_plot_tables::@5
  (byte) init_plot_tables::y#4 ← phi( init_plot_tables::@5/(byte) init_plot_tables::y#2 )
  (byte*) init_plot_tables::yoffs#3 ← phi( init_plot_tables::@5/(byte*) init_plot_tables::yoffs#2 )
  (byte*~) init_plot_tables::$12 ← (byte*) init_plot_tables::yoffs#3 + (number) $28*(number) 8
  (byte*) init_plot_tables::yoffs#1 ← (byte*~) init_plot_tables::$12
  to:init_plot_tables::@6
init_plot_tables::@return: scope:[init_plot_tables]  from init_plot_tables::@6
  return 
  to:@return

(void()) init_screen()
init_screen: scope:[init_screen]  from main
  (byte*) init_screen::b#0 ← (const byte*) BITMAP
  to:init_screen::@1
init_screen::@1: scope:[init_screen]  from init_screen init_screen::@2
  (byte*) init_screen::b#2 ← phi( init_screen/(byte*) init_screen::b#0 init_screen::@2/(byte*) init_screen::b#1 )
  (bool~) init_screen::$0 ← (byte*) init_screen::b#2 != (const byte*) BITMAP+(number) $2000
  if((bool~) init_screen::$0) goto init_screen::@2
  to:init_screen::@3
init_screen::@2: scope:[init_screen]  from init_screen::@1
  (byte*) init_screen::b#3 ← phi( init_screen::@1/(byte*) init_screen::b#2 )
  *((byte*) init_screen::b#3) ← (number) 0
  (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#3
  to:init_screen::@1
init_screen::@3: scope:[init_screen]  from init_screen::@1
  (byte*) init_screen::c#0 ← (const byte*) SCREEN
  to:init_screen::@7
init_screen::@7: scope:[init_screen]  from init_screen::@3 init_screen::@8
  (byte*) init_screen::c#2 ← phi( init_screen::@3/(byte*) init_screen::c#0 init_screen::@8/(byte*) init_screen::c#1 )
  (byte*~) init_screen::$1 ← (const byte*) SCREEN + (number) $400
  (bool~) init_screen::$2 ← (byte*) init_screen::c#2 != (byte*~) init_screen::$1
  if((bool~) init_screen::$2) goto init_screen::@8
  to:init_screen::@return
init_screen::@8: scope:[init_screen]  from init_screen::@7
  (byte*) init_screen::c#3 ← phi( init_screen::@7/(byte*) init_screen::c#2 )
  *((byte*) init_screen::c#3) ← (number) $14
  (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#3
  to:init_screen::@7
init_screen::@return: scope:[init_screen]  from init_screen::@7
  return 
  to:@return
@5: scope:[]  from @begin
  call main 
  to:@6
@6: scope:[]  from @5
  to:@end
@end: scope:[]  from @6

SYMBOL TABLE SSA
(label) @5
(label) @6
(label) @begin
(label) @end
(const byte*) BGCOL = (byte*)(number) $d020
(const byte*) BITMAP = (byte*)(number) $2000
(const byte) BMM = (byte) $20
(const byte*) D011 = (byte*)(number) $d011
(const byte*) D018 = (byte*)(number) $d018
(const byte) DEN = (byte) $10
(const byte*) FGCOL = (byte*)(number) $d021
(const byte*) RASTER = (byte*)(number) $d012
(const byte) RSEL = (byte) 8
(const byte*) SCREEN = (byte*)(number) $400
(void()) init_plot_tables()
(number~) init_plot_tables::$0
(number~) init_plot_tables::$1
(bool~) init_plot_tables::$10
(bool~) init_plot_tables::$11
(byte*~) init_plot_tables::$12
(bool~) init_plot_tables::$13
(bool~) init_plot_tables::$2
(bool~) init_plot_tables::$3
(bool~) init_plot_tables::$4
(number~) init_plot_tables::$5
(byte~) init_plot_tables::$6
(number~) init_plot_tables::$7
(byte~) init_plot_tables::$8
(number~) init_plot_tables::$9
(label) init_plot_tables::@1
(label) init_plot_tables::@2
(label) init_plot_tables::@3
(label) init_plot_tables::@4
(label) init_plot_tables::@5
(label) init_plot_tables::@6
(label) init_plot_tables::@7
(label) init_plot_tables::@return
(byte) init_plot_tables::bits
(byte) init_plot_tables::bits#0
(byte) init_plot_tables::bits#1
(byte) init_plot_tables::bits#2
(byte) init_plot_tables::bits#3
(byte) init_plot_tables::bits#4
(byte) init_plot_tables::x
(byte) init_plot_tables::x#0
(byte) init_plot_tables::x#1
(byte) init_plot_tables::x#2
(byte) init_plot_tables::x#3
(byte) init_plot_tables::x#4
(byte) init_plot_tables::y
(byte) init_plot_tables::y#0
(byte) init_plot_tables::y#1
(byte) init_plot_tables::y#2
(byte) init_plot_tables::y#3
(byte) init_plot_tables::y#4
(byte*) init_plot_tables::yoffs
(byte*) init_plot_tables::yoffs#0
(byte*) init_plot_tables::yoffs#1
(byte*) init_plot_tables::yoffs#2
(byte*) init_plot_tables::yoffs#3
(byte*) init_plot_tables::yoffs#4
(void()) init_screen()
(bool~) init_screen::$0
(byte*~) init_screen::$1
(bool~) init_screen::$2
(label) init_screen::@1
(label) init_screen::@2
(label) init_screen::@3
(label) init_screen::@7
(label) init_screen::@8
(label) init_screen::@return
(byte*) init_screen::b
(byte*) init_screen::b#0
(byte*) init_screen::b#1
(byte*) init_screen::b#2
(byte*) init_screen::b#3
(byte*) init_screen::c
(byte*) init_screen::c#0
(byte*) init_screen::c#1
(byte*) init_screen::c#2
(byte*) init_screen::c#3
(void()) main()
(byte~) main::$0
(byte~) main::$1
(number~) main::$2
(word~) main::$3
(number~) main::$4
(number~) main::$5
(byte~) main::$6
(bool~) main::$9
(label) main::@2
(label) main::@3
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@return
(void()) plot((byte) plot::x , (byte) plot::y)
(byte*~) plot::$4
(byte~) plot::$5
(byte~) plot::$6
(byte~) plot::$7
(byte~) plot::$8
(byte~) plot::$9
(label) plot::@return
(byte*) plot::plotter
(byte*) plot::plotter#0
(byte*) plot::plotter_x
(byte*) plot::plotter_x#0
(byte*) plot::plotter_x#1
(byte*) plot::plotter_x#2
(word) plot::plotter_y
(word) plot::plotter_y#0
(word) plot::plotter_y#1
(word) plot::plotter_y#2
(byte) plot::x
(byte) plot::x#0
(byte) plot::x#1
(byte) plot::y
(byte) plot::y#0
(byte) plot::y#1
(const byte*) plot_bit[(number) $100]  = { fill( $100, 0) }
(const byte*) plot_xhi[(number) $100]  = { fill( $100, 0) }
(const byte*) plot_xlo[(number) $100]  = { fill( $100, 0) }
(const byte*) plot_yhi[(number) $100]  = { fill( $100, 0) }
(const byte*) plot_ylo[(number) $100]  = { fill( $100, 0) }
(void()) plots()
(bool~) plots::$0
(label) plots::@1
(label) plots::@2
(label) plots::@7
(label) plots::@return
(byte) plots::i
(byte) plots::i#0
(byte) plots::i#1
(byte) plots::i#2
(byte) plots::i#3
(byte) plots::i#4
(const byte) plots_cnt = (byte) 8
(const byte*) plots_x[]  = { (byte) $3c, (byte) $50, (byte) $6e, (byte) $50, (byte) $3c, (byte) $28, (byte) $a, (byte) $28 }
(const byte*) plots_y[]  = { (byte) $a, (byte) $28, (byte) $3c, (byte) $50, (byte) $6e, (byte) $50, (byte) $3c, (byte) $28 }

Adding number conversion cast (unumber) 0 in *((const byte*) BGCOL) ← (number) 0
Adding number conversion cast (unumber) 0 in *((const byte*) FGCOL) ← (number) 0
Adding number conversion cast (unumber) 3 in (number~) main::$2 ← (byte~) main::$1 | (number) 3
Adding number conversion cast (unumber) main::$2 in (number~) main::$2 ← (byte~) main::$1 | (unumber)(number) 3
Adding number conversion cast (unumber) $40 in (number~) main::$4 ← (word~) main::$3 / (number) $40
Adding number conversion cast (unumber) main::$4 in (number~) main::$4 ← (word~) main::$3 / (unumber)(number) $40
Adding number conversion cast (unumber) (word)BITMAP/$400 in (number~) main::$5 ← (unumber~) main::$4 | (word)(const byte*) BITMAP/(number) $400
Adding number conversion cast (unumber) main::$5 in (number~) main::$5 ← (unumber~) main::$4 | (unumber)(word)(const byte*) BITMAP/(number) $400
Adding number conversion cast (unumber) $400 in (unumber~) main::$5 ← (unumber~) main::$4 | (unumber)(word)(const byte*) BITMAP/(number) $400
Adding number conversion cast (unumber) $ff in (bool~) main::$9 ← *((const byte*) RASTER) != (number) $ff
Adding number conversion cast (unumber) $f8 in (number~) init_plot_tables::$0 ← (byte) init_plot_tables::x#2 & (number) $f8
Adding number conversion cast (unumber) init_plot_tables::$0 in (number~) init_plot_tables::$0 ← (byte) init_plot_tables::x#2 & (unumber)(number) $f8
Adding number conversion cast (unumber) 2 in (number~) init_plot_tables::$1 ← (byte) init_plot_tables::bits#3 / (number) 2
Adding number conversion cast (unumber) init_plot_tables::$1 in (number~) init_plot_tables::$1 ← (byte) init_plot_tables::bits#3 / (unumber)(number) 2
Adding number conversion cast (unumber) 0 in (bool~) init_plot_tables::$2 ← (byte) init_plot_tables::bits#1 == (number) 0
Adding number conversion cast (unumber) $80 in (byte) init_plot_tables::bits#2 ← (number) $80
Adding number conversion cast (unumber) 7 in (number~) init_plot_tables::$5 ← (byte) init_plot_tables::y#2 & (number) 7
Adding number conversion cast (unumber) init_plot_tables::$5 in (number~) init_plot_tables::$5 ← (byte) init_plot_tables::y#2 & (unumber)(number) 7
Adding number conversion cast (unumber) init_plot_tables::$7 in (number~) init_plot_tables::$7 ← (unumber~) init_plot_tables::$5 | (byte~) init_plot_tables::$6
Adding number conversion cast (unumber) 7 in (number~) init_plot_tables::$9 ← (byte) init_plot_tables::y#2 & (number) 7
Adding number conversion cast (unumber) init_plot_tables::$9 in (number~) init_plot_tables::$9 ← (byte) init_plot_tables::y#2 & (unumber)(number) 7
Adding number conversion cast (unumber) 7 in (bool~) init_plot_tables::$10 ← (unumber~) init_plot_tables::$9 == (number) 7
Adding number conversion cast (unumber) $28*8 in (byte*~) init_plot_tables::$12 ← (byte*) init_plot_tables::yoffs#3 + (number) $28*(number) 8
Adding number conversion cast (unumber) $2000 in (bool~) init_screen::$0 ← (byte*) init_screen::b#2 != (const byte*) BITMAP+(number) $2000
Adding number conversion cast (unumber) 0 in *((byte*) init_screen::b#3) ← (number) 0
Adding number conversion cast (unumber) $400 in (byte*~) init_screen::$1 ← (const byte*) SCREEN + (number) $400
Adding number conversion cast (unumber) $14 in *((byte*) init_screen::c#3) ← (number) $14
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast *((const byte*) BGCOL) ← (unumber)(number) 0
Inlining cast *((const byte*) FGCOL) ← (unumber)(number) 0
Inlining cast (word~) main::$3 ← (word)(const byte*) SCREEN
Inlining cast (byte~) main::$6 ← (byte)(unumber~) main::$5
Inlining cast (byte) init_plot_tables::bits#2 ← (unumber)(number) $80
Inlining cast *((byte*) init_screen::b#3) ← (unumber)(number) 0
Inlining cast *((byte*) init_screen::c#3) ← (unumber)(number) $14
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 8192
Simplifying constant pointer cast (byte*) 53265
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53281
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 3
Simplifying constant integer cast $40
Simplifying constant integer cast (word)(const byte*) BITMAP/(unumber)(number) $400
Simplifying constant integer cast $400
Simplifying constant integer cast $ff
Simplifying constant pointer cast (byte*) 0
Simplifying constant integer cast $f8
Simplifying constant integer cast 2
Simplifying constant integer cast 0
Simplifying constant integer cast $80
Simplifying constant pointer cast (byte*) 0
Simplifying constant integer cast 7
Simplifying constant integer cast 7
Simplifying constant integer cast 7
Simplifying constant integer cast $2000
Simplifying constant integer cast 0
Simplifying constant integer cast $400
Simplifying constant integer cast $14
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) $40
Finalized unsigned number type (word) $400
Finalized unsigned number type (byte) $ff
Finalized unsigned number type (byte) $f8
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $80
Finalized unsigned number type (byte) 7
Finalized unsigned number type (byte) 7
Finalized unsigned number type (byte) 7
Finalized unsigned number type (word) $2000
Finalized unsigned number type (byte) 0
Finalized unsigned number type (word) $400
Finalized unsigned number type (byte) $14
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$2 ← (byte~) main::$1 | (byte) 3
Inferred type updated to word in (unumber~) main::$4 ← (word~) main::$3 / (byte) $40
Inferred type updated to word in (unumber~) main::$5 ← (word~) main::$4 | (word)(const byte*) BITMAP/(word) $400
Inferred type updated to byte in (unumber~) init_plot_tables::$0 ← (byte) init_plot_tables::x#2 & (byte) $f8
Inferred type updated to byte in (unumber~) init_plot_tables::$1 ← (byte) init_plot_tables::bits#3 / (byte) 2
Inferred type updated to byte in (unumber~) init_plot_tables::$5 ← (byte) init_plot_tables::y#2 & (byte) 7
Inferred type updated to byte in (unumber~) init_plot_tables::$7 ← (byte~) init_plot_tables::$5 | (byte~) init_plot_tables::$6
Inferred type updated to byte in (unumber~) init_plot_tables::$9 ← (byte) init_plot_tables::y#2 & (byte) 7
Inversing boolean not [57] (bool~) init_plot_tables::$3 ← (byte) init_plot_tables::bits#1 != (byte) 0 from [56] (bool~) init_plot_tables::$2 ← (byte) init_plot_tables::bits#1 == (byte) 0
Inversing boolean not [76] (bool~) init_plot_tables::$11 ← (byte~) init_plot_tables::$9 != (byte) 7 from [75] (bool~) init_plot_tables::$10 ← (byte~) init_plot_tables::$9 == (byte) 7
Successful SSA optimization Pass2UnaryNotSimplification
Alias (byte) plots::i#2 = (byte) plots::i#3 (byte) plots::i#4 
Alias (byte*) plot::plotter#0 = (byte*~) plot::$4 
Alias (byte) init_plot_tables::bits#1 = (byte~) init_plot_tables::$1 
Alias (byte) init_plot_tables::x#2 = (byte) init_plot_tables::x#4 
Alias (byte*) init_plot_tables::yoffs#2 = (byte*) init_plot_tables::yoffs#3 
Alias (byte) init_plot_tables::y#2 = (byte) init_plot_tables::y#4 
Alias (byte*) init_plot_tables::yoffs#1 = (byte*~) init_plot_tables::$12 
Alias (byte*) init_screen::b#2 = (byte*) init_screen::b#3 
Alias (byte*) init_screen::c#2 = (byte*) init_screen::c#3 
Successful SSA optimization Pass2AliasElimination
Alias (byte) init_plot_tables::x#2 = (byte) init_plot_tables::x#3 
Alias (byte) init_plot_tables::y#2 = (byte) init_plot_tables::y#3 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte) plot::x#1 (byte) plot::x#0
Identical Phi Values (byte) plot::y#1 (byte) plot::y#0
Successful SSA optimization Pass2IdenticalPhiElimination
Identified duplicate assignment right side [74] (byte~) init_plot_tables::$9 ← (byte) init_plot_tables::y#2 & (byte) 7
Successful SSA optimization Pass2DuplicateRValueIdentification
Simple Condition (bool~) main::$9 [14] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2
Simple Condition (bool~) plots::$0 [23] if((byte) plots::i#2<(const byte) plots_cnt) goto plots::@2
Simple Condition (bool~) init_plot_tables::$3 [53] if((byte) init_plot_tables::bits#1!=(byte) 0) goto init_plot_tables::@2
Simple Condition (bool~) init_plot_tables::$4 [57] if((byte) init_plot_tables::x#1!=rangelast(0,$ff)) goto init_plot_tables::@1
Simple Condition (bool~) init_plot_tables::$11 [70] if((byte~) init_plot_tables::$9!=(byte) 7) goto init_plot_tables::@6
Simple Condition (bool~) init_plot_tables::$13 [74] if((byte) init_plot_tables::y#1!=rangelast(0,$ff)) goto init_plot_tables::@5
Simple Condition (bool~) init_screen::$0 [80] if((byte*) init_screen::b#2!=(const byte*) BITMAP+(word) $2000) goto init_screen::@2
Simple Condition (bool~) init_screen::$2 [87] if((byte*) init_screen::c#2!=(byte*~) init_screen::$1) goto init_screen::@8
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [2] (byte~) main::$0 ← (const byte) BMM | (const byte) DEN
Constant right-side identified [6] (word~) main::$3 ← (word)(const byte*) SCREEN
Constant right-side identified [85] (byte*~) init_screen::$1 ← (const byte*) SCREEN + (word) $400
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::$0 = BMM|DEN
Constant (const word) main::$3 = (word)SCREEN
Constant (const byte) plots::i#0 = 0
Constant (const byte*) plot::plotter_x#0 = (byte*) 0
Constant (const word) plot::plotter_y#0 = 0
Constant (const byte) init_plot_tables::bits#0 = $80
Constant (const byte) init_plot_tables::x#0 = 0
Constant (const byte) init_plot_tables::bits#2 = $80
Constant (const byte*) init_plot_tables::yoffs#0 = (byte*) 0
Constant (const byte) init_plot_tables::y#0 = 0
Constant (const byte*) init_screen::b#0 = BITMAP
Constant (const byte*) init_screen::c#0 = SCREEN
Constant (const byte*) init_screen::$1 = SCREEN+$400
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [18] if(true) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [55] init_plot_tables::x#1 ← ++ init_plot_tables::x#2 to ++
Resolved ranged comparison value [57] if(init_plot_tables::x#1!=rangelast(0,$ff)) goto init_plot_tables::@1 to (number) 0
Resolved ranged next value [72] init_plot_tables::y#1 ← ++ init_plot_tables::y#2 to ++
Resolved ranged comparison value [74] if(init_plot_tables::y#1!=rangelast(0,$ff)) goto init_plot_tables::@5 to (number) 0
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Adding number conversion cast (unumber) 0 in if((byte) init_plot_tables::x#1!=(number) 0) goto init_plot_tables::@1
Adding number conversion cast (unumber) 0 in if((byte) init_plot_tables::y#1!=(number) 0) goto init_plot_tables::@5
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte~) init_plot_tables::$9 = (byte~) init_plot_tables::$5 
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [2] (byte~) main::$1 ← (const byte) main::$0 | (const byte) RSEL
Constant right-side identified [5] (word~) main::$4 ← (const word) main::$3 / (byte) $40
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::$1 = main::$0|RSEL
Constant (const word) main::$4 = main::$3/$40
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [2] (byte~) main::$2 ← (const byte) main::$1 | (byte) 3
Constant right-side identified [4] (word~) main::$5 ← (const word) main::$4 | (word)(const byte*) BITMAP/(word) $400
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::$2 = main::$1|3
Constant (const word) main::$5 = main::$4|(word)BITMAP/$400
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) main::$6 = (byte)main::$5
Successful SSA optimization Pass2ConstantIdentification
Rewriting division to use shift [34] (byte) init_plot_tables::bits#1 ← (byte) init_plot_tables::bits#3 / (byte) 2
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const byte) plots::i#0
Inlining constant with var siblings (const byte*) plot::plotter_x#0
Inlining constant with var siblings (const word) plot::plotter_y#0
Inlining constant with var siblings (const byte) init_plot_tables::bits#0
Inlining constant with var siblings (const byte) init_plot_tables::x#0
Inlining constant with var siblings (const byte) init_plot_tables::bits#2
Inlining constant with var siblings (const byte*) init_plot_tables::yoffs#0
Inlining constant with var siblings (const byte) init_plot_tables::y#0
Inlining constant with var siblings (const byte*) init_screen::b#0
Inlining constant with var siblings (const byte*) init_screen::c#0
Constant inlined plots::i#0 = (byte) 0
Constant inlined init_plot_tables::bits#2 = (byte) $80
Constant inlined init_plot_tables::bits#0 = (byte) $80
Constant inlined plot::plotter_y#0 = (word) 0
Constant inlined plot::plotter_x#0 = (byte*) 0
Constant inlined init_screen::$1 = (const byte*) SCREEN+(word) $400
Constant inlined main::$1 = (const byte) BMM|(const byte) DEN|(const byte) RSEL
Constant inlined main::$2 = (const byte) BMM|(const byte) DEN|(const byte) RSEL|(byte) 3
Constant inlined main::$0 = (const byte) BMM|(const byte) DEN
Constant inlined main::$5 = (word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400
Constant inlined init_plot_tables::y#0 = (byte) 0
Constant inlined main::$6 = (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400
Constant inlined init_plot_tables::yoffs#0 = (byte*) 0
Constant inlined main::$3 = (word)(const byte*) SCREEN
Constant inlined main::$4 = (word)(const byte*) SCREEN/(byte) $40
Constant inlined init_plot_tables::x#0 = (byte) 0
Constant inlined init_screen::c#0 = (const byte*) SCREEN
Constant inlined init_screen::b#0 = (const byte*) BITMAP
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting init_plot_tables::@9(between init_plot_tables::@2 and init_plot_tables::@1)
Added new block during phi lifting init_plot_tables::@10(between init_plot_tables::@1 and init_plot_tables::@2)
Added new block during phi lifting init_plot_tables::@11(between init_plot_tables::@6 and init_plot_tables::@5)
Added new block during phi lifting init_plot_tables::@12(between init_plot_tables::@5 and init_plot_tables::@6)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @5
Adding NOP phi() at start of @6
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@5
Adding NOP phi() at start of main::@6
Adding NOP phi() at start of plots
Adding NOP phi() at start of init_plot_tables
Adding NOP phi() at start of init_plot_tables::@3
Adding NOP phi() at start of init_plot_tables::@4
Adding NOP phi() at start of init_screen
Adding NOP phi() at start of init_screen::@3
CALL GRAPH
Calls in [] to main:2 
Calls in [main] to init_screen:9 init_plot_tables:11 plots:15 
Calls in [plots] to plot:23 

Created 9 initial phi equivalence classes
Coalesced [25] plots::i#5 ← plots::i#1
Coalesced [60] init_plot_tables::yoffs#7 ← init_plot_tables::yoffs#1
Coalesced [65] init_plot_tables::y#5 ← init_plot_tables::y#1
Coalesced [66] init_plot_tables::yoffs#5 ← init_plot_tables::yoffs#4
Coalesced (already) [67] init_plot_tables::yoffs#6 ← init_plot_tables::yoffs#2
Coalesced [68] init_plot_tables::x#5 ← init_plot_tables::x#1
Coalesced [69] init_plot_tables::bits#5 ← init_plot_tables::bits#4
Coalesced [70] init_plot_tables::bits#6 ← init_plot_tables::bits#1
Coalesced [80] init_screen::c#4 ← init_screen::c#1
Coalesced [83] init_screen::b#4 ← init_screen::b#1
Coalesced down to 7 phi equivalence classes
Culled Empty Block (label) @6
Culled Empty Block (label) main::@6
Culled Empty Block (label) init_plot_tables::@3
Culled Empty Block (label) init_plot_tables::@4
Culled Empty Block (label) init_plot_tables::@11
Culled Empty Block (label) init_plot_tables::@12
Culled Empty Block (label) init_plot_tables::@9
Culled Empty Block (label) init_screen::@3
Renumbering block @5 to @1
Renumbering block main::@2 to main::@1
Renumbering block main::@3 to main::@2
Renumbering block main::@5 to main::@3
Renumbering block main::@7 to main::@4
Renumbering block plots::@7 to plots::@3
Renumbering block init_plot_tables::@5 to init_plot_tables::@3
Renumbering block init_plot_tables::@6 to init_plot_tables::@4
Renumbering block init_plot_tables::@7 to init_plot_tables::@5
Renumbering block init_plot_tables::@10 to init_plot_tables::@6
Renumbering block init_screen::@7 to init_screen::@3
Renumbering block init_screen::@8 to init_screen::@4
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of plots
Adding NOP phi() at start of init_plot_tables
Adding NOP phi() at start of init_plot_tables::@6
Adding NOP phi() at start of init_screen

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

(void()) main()
main: scope:[main]  from @1
  [4] *((const byte*) BGCOL) ← (byte) 0
  [5] *((const byte*) FGCOL) ← (byte) 0
  [6] *((const byte*) D011) ← (const byte) BMM|(const byte) DEN|(const byte) RSEL|(byte) 3
  [7] *((const byte*) D018) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400
  [8] call init_screen 
  to:main::@3
main::@3: scope:[main]  from main
  [9] phi()
  [10] call init_plot_tables 
  to:main::@1
main::@1: scope:[main]  from main::@1 main::@3 main::@4
  [11] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@1
  [12] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL)
  [13] call plots 
  to:main::@4
main::@4: scope:[main]  from main::@2
  [14] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL)
  to:main::@1

(void()) plots()
plots: scope:[plots]  from main::@2
  [15] phi()
  to:plots::@1
plots::@1: scope:[plots]  from plots plots::@3
  [16] (byte) plots::i#2 ← phi( plots/(byte) 0 plots::@3/(byte) plots::i#1 )
  [17] if((byte) plots::i#2<(const byte) plots_cnt) goto plots::@2
  to:plots::@return
plots::@return: scope:[plots]  from plots::@1
  [18] return 
  to:@return
plots::@2: scope:[plots]  from plots::@1
  [19] (byte) plot::x#0 ← *((const byte*) plots_x + (byte) plots::i#2)
  [20] (byte) plot::y#0 ← *((const byte*) plots_y + (byte) plots::i#2)
  [21] call plot 
  to:plots::@3
plots::@3: scope:[plots]  from plots::@2
  [22] (byte) plots::i#1 ← ++ (byte) plots::i#2
  to:plots::@1

(void()) plot((byte) plot::x , (byte) plot::y)
plot: scope:[plot]  from plots::@2
  [23] (byte~) plot::$6 ← *((const byte*) plot_xhi + (byte) plot::x#0)
  [24] (byte*) plot::plotter_x#1 ← (byte*) 0 hi= (byte~) plot::$6
  [25] (byte~) plot::$7 ← *((const byte*) plot_xlo + (byte) plot::x#0)
  [26] (byte*) plot::plotter_x#2 ← (byte*) plot::plotter_x#1 lo= (byte~) plot::$7
  [27] (byte~) plot::$8 ← *((const byte*) plot_yhi + (byte) plot::y#0)
  [28] (word) plot::plotter_y#1 ← (word) 0 hi= (byte~) plot::$8
  [29] (byte~) plot::$9 ← *((const byte*) plot_ylo + (byte) plot::y#0)
  [30] (word) plot::plotter_y#2 ← (word) plot::plotter_y#1 lo= (byte~) plot::$9
  [31] (byte*) plot::plotter#0 ← (byte*) plot::plotter_x#2 + (word) plot::plotter_y#2
  [32] (byte~) plot::$5 ← *((byte*) plot::plotter#0) | *((const byte*) plot_bit + (byte) plot::x#0)
  [33] *((byte*) plot::plotter#0) ← (byte~) plot::$5
  to:plot::@return
plot::@return: scope:[plot]  from plot
  [34] return 
  to:@return

(void()) init_plot_tables()
init_plot_tables: scope:[init_plot_tables]  from main::@3
  [35] phi()
  to:init_plot_tables::@1
init_plot_tables::@1: scope:[init_plot_tables]  from init_plot_tables init_plot_tables::@2
  [36] (byte) init_plot_tables::bits#3 ← phi( init_plot_tables/(byte) $80 init_plot_tables::@2/(byte) init_plot_tables::bits#4 )
  [36] (byte) init_plot_tables::x#2 ← phi( init_plot_tables/(byte) 0 init_plot_tables::@2/(byte) init_plot_tables::x#1 )
  [37] (byte~) init_plot_tables::$0 ← (byte) init_plot_tables::x#2 & (byte) $f8
  [38] *((const byte*) plot_xlo + (byte) init_plot_tables::x#2) ← (byte~) init_plot_tables::$0
  [39] *((const byte*) plot_xhi + (byte) init_plot_tables::x#2) ← >(const byte*) BITMAP
  [40] *((const byte*) plot_bit + (byte) init_plot_tables::x#2) ← (byte) init_plot_tables::bits#3
  [41] (byte) init_plot_tables::bits#1 ← (byte) init_plot_tables::bits#3 >> (byte) 1
  [42] if((byte) init_plot_tables::bits#1!=(byte) 0) goto init_plot_tables::@6
  to:init_plot_tables::@2
init_plot_tables::@6: scope:[init_plot_tables]  from init_plot_tables::@1
  [43] phi()
  to:init_plot_tables::@2
init_plot_tables::@2: scope:[init_plot_tables]  from init_plot_tables::@1 init_plot_tables::@6
  [44] (byte) init_plot_tables::bits#4 ← phi( init_plot_tables::@6/(byte) init_plot_tables::bits#1 init_plot_tables::@1/(byte) $80 )
  [45] (byte) init_plot_tables::x#1 ← ++ (byte) init_plot_tables::x#2
  [46] if((byte) init_plot_tables::x#1!=(byte) 0) goto init_plot_tables::@1
  to:init_plot_tables::@3
init_plot_tables::@3: scope:[init_plot_tables]  from init_plot_tables::@2 init_plot_tables::@4
  [47] (byte*) init_plot_tables::yoffs#2 ← phi( init_plot_tables::@2/(byte*) 0 init_plot_tables::@4/(byte*) init_plot_tables::yoffs#4 )
  [47] (byte) init_plot_tables::y#2 ← phi( init_plot_tables::@2/(byte) 0 init_plot_tables::@4/(byte) init_plot_tables::y#1 )
  [48] (byte~) init_plot_tables::$9 ← (byte) init_plot_tables::y#2 & (byte) 7
  [49] (byte~) init_plot_tables::$6 ← < (byte*) init_plot_tables::yoffs#2
  [50] (byte~) init_plot_tables::$7 ← (byte~) init_plot_tables::$9 | (byte~) init_plot_tables::$6
  [51] *((const byte*) plot_ylo + (byte) init_plot_tables::y#2) ← (byte~) init_plot_tables::$7
  [52] (byte~) init_plot_tables::$8 ← > (byte*) init_plot_tables::yoffs#2
  [53] *((const byte*) plot_yhi + (byte) init_plot_tables::y#2) ← (byte~) init_plot_tables::$8
  [54] if((byte~) init_plot_tables::$9!=(byte) 7) goto init_plot_tables::@4
  to:init_plot_tables::@5
init_plot_tables::@5: scope:[init_plot_tables]  from init_plot_tables::@3
  [55] (byte*) init_plot_tables::yoffs#1 ← (byte*) init_plot_tables::yoffs#2 + (word)(number) $28*(number) 8
  to:init_plot_tables::@4
init_plot_tables::@4: scope:[init_plot_tables]  from init_plot_tables::@3 init_plot_tables::@5
  [56] (byte*) init_plot_tables::yoffs#4 ← phi( init_plot_tables::@3/(byte*) init_plot_tables::yoffs#2 init_plot_tables::@5/(byte*) init_plot_tables::yoffs#1 )
  [57] (byte) init_plot_tables::y#1 ← ++ (byte) init_plot_tables::y#2
  [58] if((byte) init_plot_tables::y#1!=(byte) 0) goto init_plot_tables::@3
  to:init_plot_tables::@return
init_plot_tables::@return: scope:[init_plot_tables]  from init_plot_tables::@4
  [59] return 
  to:@return

(void()) init_screen()
init_screen: scope:[init_screen]  from main
  [60] phi()
  to:init_screen::@1
init_screen::@1: scope:[init_screen]  from init_screen init_screen::@2
  [61] (byte*) init_screen::b#2 ← phi( init_screen/(const byte*) BITMAP init_screen::@2/(byte*) init_screen::b#1 )
  [62] if((byte*) init_screen::b#2!=(const byte*) BITMAP+(word) $2000) goto init_screen::@2
  to:init_screen::@3
init_screen::@3: scope:[init_screen]  from init_screen::@1 init_screen::@4
  [63] (byte*) init_screen::c#2 ← phi( init_screen::@1/(const byte*) SCREEN init_screen::@4/(byte*) init_screen::c#1 )
  [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN+(word) $400) goto init_screen::@4
  to:init_screen::@return
init_screen::@return: scope:[init_screen]  from init_screen::@3
  [65] return 
  to:@return
init_screen::@4: scope:[init_screen]  from init_screen::@3
  [66] *((byte*) init_screen::c#2) ← (byte) $14
  [67] (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#2
  to:init_screen::@3
init_screen::@2: scope:[init_screen]  from init_screen::@1
  [68] *((byte*) init_screen::b#2) ← (byte) 0
  [69] (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#2
  to:init_screen::@1


VARIABLE REGISTER WEIGHTS
(void()) init_plot_tables()
(byte~) init_plot_tables::$0 22.0
(byte~) init_plot_tables::$6 22.0
(byte~) init_plot_tables::$7 22.0
(byte~) init_plot_tables::$8 22.0
(byte~) init_plot_tables::$9 5.5
(byte) init_plot_tables::bits
(byte) init_plot_tables::bits#1 11.0
(byte) init_plot_tables::bits#3 6.6000000000000005
(byte) init_plot_tables::bits#4 7.333333333333333
(byte) init_plot_tables::x
(byte) init_plot_tables::x#1 16.5
(byte) init_plot_tables::x#2 7.333333333333334
(byte) init_plot_tables::y
(byte) init_plot_tables::y#1 16.5
(byte) init_plot_tables::y#2 5.5
(byte*) init_plot_tables::yoffs
(byte*) init_plot_tables::yoffs#1 22.0
(byte*) init_plot_tables::yoffs#2 6.875
(byte*) init_plot_tables::yoffs#4 11.0
(void()) init_screen()
(byte*) init_screen::b
(byte*) init_screen::b#1 22.0
(byte*) init_screen::b#2 14.666666666666666
(byte*) init_screen::c
(byte*) init_screen::c#1 22.0
(byte*) init_screen::c#2 14.666666666666666
(void()) main()
(void()) plot((byte) plot::x , (byte) plot::y)
(byte~) plot::$5 4.0
(byte~) plot::$6 4.0
(byte~) plot::$7 4.0
(byte~) plot::$8 4.0
(byte~) plot::$9 4.0
(byte*) plot::plotter
(byte*) plot::plotter#0 3.0
(byte*) plot::plotter_x
(byte*) plot::plotter_x#1 2.0
(byte*) plot::plotter_x#2 0.8
(word) plot::plotter_y
(word) plot::plotter_y#1 2.0
(word) plot::plotter_y#2 4.0
(byte) plot::x
(byte) plot::x#0 9.727272727272727
(byte) plot::y
(byte) plot::y#0 15.000000000000002
(void()) plots()
(byte) plots::i
(byte) plots::i#1 202.0
(byte) plots::i#2 101.0

Initial phi equivalence classes
[ plots::i#2 plots::i#1 ]
[ init_plot_tables::x#2 init_plot_tables::x#1 ]
[ init_plot_tables::bits#3 init_plot_tables::bits#4 init_plot_tables::bits#1 ]
[ init_plot_tables::y#2 init_plot_tables::y#1 ]
[ init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 ]
[ init_screen::b#2 init_screen::b#1 ]
[ init_screen::c#2 init_screen::c#1 ]
Added variable plot::x#0 to live range equivalence class [ plot::x#0 ]
Added variable plot::y#0 to live range equivalence class [ plot::y#0 ]
Added variable plot::$6 to live range equivalence class [ plot::$6 ]
Added variable plot::plotter_x#1 to live range equivalence class [ plot::plotter_x#1 ]
Added variable plot::$7 to live range equivalence class [ plot::$7 ]
Added variable plot::plotter_x#2 to live range equivalence class [ plot::plotter_x#2 ]
Added variable plot::$8 to live range equivalence class [ plot::$8 ]
Added variable plot::plotter_y#1 to live range equivalence class [ plot::plotter_y#1 ]
Added variable plot::$9 to live range equivalence class [ plot::$9 ]
Added variable plot::plotter_y#2 to live range equivalence class [ plot::plotter_y#2 ]
Added variable plot::plotter#0 to live range equivalence class [ plot::plotter#0 ]
Added variable plot::$5 to live range equivalence class [ plot::$5 ]
Added variable init_plot_tables::$0 to live range equivalence class [ init_plot_tables::$0 ]
Added variable init_plot_tables::$9 to live range equivalence class [ init_plot_tables::$9 ]
Added variable init_plot_tables::$6 to live range equivalence class [ init_plot_tables::$6 ]
Added variable init_plot_tables::$7 to live range equivalence class [ init_plot_tables::$7 ]
Added variable init_plot_tables::$8 to live range equivalence class [ init_plot_tables::$8 ]
Complete equivalence classes
[ plots::i#2 plots::i#1 ]
[ init_plot_tables::x#2 init_plot_tables::x#1 ]
[ init_plot_tables::bits#3 init_plot_tables::bits#4 init_plot_tables::bits#1 ]
[ init_plot_tables::y#2 init_plot_tables::y#1 ]
[ init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 ]
[ init_screen::b#2 init_screen::b#1 ]
[ init_screen::c#2 init_screen::c#1 ]
[ plot::x#0 ]
[ plot::y#0 ]
[ plot::$6 ]
[ plot::plotter_x#1 ]
[ plot::$7 ]
[ plot::plotter_x#2 ]
[ plot::$8 ]
[ plot::plotter_y#1 ]
[ plot::$9 ]
[ plot::plotter_y#2 ]
[ plot::plotter#0 ]
[ plot::$5 ]
[ init_plot_tables::$0 ]
[ init_plot_tables::$9 ]
[ init_plot_tables::$6 ]
[ init_plot_tables::$7 ]
[ init_plot_tables::$8 ]
Allocated zp[1]:2 [ plots::i#2 plots::i#1 ]
Allocated zp[1]:3 [ init_plot_tables::x#2 init_plot_tables::x#1 ]
Allocated zp[1]:4 [ init_plot_tables::bits#3 init_plot_tables::bits#4 init_plot_tables::bits#1 ]
Allocated zp[1]:5 [ init_plot_tables::y#2 init_plot_tables::y#1 ]
Allocated zp[2]:6 [ init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 ]
Allocated zp[2]:8 [ init_screen::b#2 init_screen::b#1 ]
Allocated zp[2]:10 [ init_screen::c#2 init_screen::c#1 ]
Allocated zp[1]:12 [ plot::x#0 ]
Allocated zp[1]:13 [ plot::y#0 ]
Allocated zp[1]:14 [ plot::$6 ]
Allocated zp[2]:15 [ plot::plotter_x#1 ]
Allocated zp[1]:17 [ plot::$7 ]
Allocated zp[2]:18 [ plot::plotter_x#2 ]
Allocated zp[1]:20 [ plot::$8 ]
Allocated zp[2]:21 [ plot::plotter_y#1 ]
Allocated zp[1]:23 [ plot::$9 ]
Allocated zp[2]:24 [ plot::plotter_y#2 ]
Allocated zp[2]:26 [ plot::plotter#0 ]
Allocated zp[1]:28 [ plot::$5 ]
Allocated zp[1]:29 [ init_plot_tables::$0 ]
Allocated zp[1]:30 [ init_plot_tables::$9 ]
Allocated zp[1]:31 [ init_plot_tables::$6 ]
Allocated zp[1]:32 [ init_plot_tables::$7 ]
Allocated zp[1]:33 [ init_plot_tables::$8 ]

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label BITMAP = $2000
  .label D011 = $d011
  .const BMM = $20
  .const DEN = $10
  .const RSEL = 8
  .label RASTER = $d012
  .label D018 = $d018
  .label BGCOL = $d020
  .label FGCOL = $d021
  .label SCREEN = $400
  .const plots_cnt = 8
  // @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: {
    // [4] *((const byte*) BGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta BGCOL
    // [5] *((const byte*) FGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta FGCOL
    // [6] *((const byte*) D011) ← (const byte) BMM|(const byte) DEN|(const byte) RSEL|(byte) 3 -- _deref_pbuc1=vbuc2 
    lda #BMM|DEN|RSEL|3
    sta D011
    // [7] *((const byte*) D018) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400 -- _deref_pbuc1=vbuc2 
    lda #SCREEN/$40|BITMAP/$400
    sta D018
    // [8] call init_screen 
    // [60] phi from main to init_screen [phi:main->init_screen]
  init_screen_from_main:
    jsr init_screen
    // [9] phi from main to main::@3 [phi:main->main::@3]
  __b3_from_main:
    jmp __b3
    // main::@3
  __b3:
    // [10] call init_plot_tables 
    // [35] phi from main::@3 to init_plot_tables [phi:main::@3->init_plot_tables]
  init_plot_tables_from___b3:
    jsr init_plot_tables
    jmp __b1
    // main::@1
  __b1:
    // [11] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$ff
    cmp RASTER
    bne __b1
    jmp __b2
    // main::@2
  __b2:
    // [12] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc BGCOL
    // [13] call plots 
    // [15] phi from main::@2 to plots [phi:main::@2->plots]
  plots_from___b2:
    jsr plots
    jmp __b4
    // main::@4
  __b4:
    // [14] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 
    dec BGCOL
    jmp __b1
}
  // plots
plots: {
    .label i = 2
    // [16] phi from plots to plots::@1 [phi:plots->plots::@1]
  __b1_from_plots:
    // [16] phi (byte) plots::i#2 = (byte) 0 [phi:plots->plots::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z i
    jmp __b1
    // plots::@1
  __b1:
    // [17] if((byte) plots::i#2<(const byte) plots_cnt) goto plots::@2 -- vbuz1_lt_vbuc1_then_la1 
    lda.z i
    cmp #plots_cnt
    bcc __b2
    jmp __breturn
    // plots::@return
  __breturn:
    // [18] return 
    rts
    // plots::@2
  __b2:
    // [19] (byte) plot::x#0 ← *((const byte*) plots_x + (byte) plots::i#2) -- vbuz1=pbuc1_derefidx_vbuz2 
    ldy.z i
    lda plots_x,y
    sta.z plot.x
    // [20] (byte) plot::y#0 ← *((const byte*) plots_y + (byte) plots::i#2) -- vbuz1=pbuc1_derefidx_vbuz2 
    ldy.z i
    lda plots_y,y
    sta.z plot.y
    // [21] call plot 
    jsr plot
    jmp __b3
    // plots::@3
  __b3:
    // [22] (byte) plots::i#1 ← ++ (byte) plots::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [16] phi from plots::@3 to plots::@1 [phi:plots::@3->plots::@1]
  __b1_from___b3:
    // [16] phi (byte) plots::i#2 = (byte) plots::i#1 [phi:plots::@3->plots::@1#0] -- register_copy 
    jmp __b1
}
  // plot
// plot(byte zp($c) x, byte zp($d) y)
plot: {
    .label __5 = $1c
    .label __6 = $e
    .label __7 = $11
    .label __8 = $14
    .label __9 = $17
    .label x = $c
    .label y = $d
    .label plotter_x = $f
    .label plotter_x_1 = $12
    .label plotter_y = $15
    .label plotter_y_1 = $18
    .label plotter = $1a
    // [23] (byte~) plot::$6 ← *((const byte*) plot_xhi + (byte) plot::x#0) -- vbuz1=pbuc1_derefidx_vbuz2 
    ldy.z x
    lda plot_xhi,y
    sta.z __6
    // [24] (byte*) plot::plotter_x#1 ← (byte*) 0 hi= (byte~) plot::$6 -- pbuz1=pbuc1_sethi_vbuz2 
    lda.z __6
    sta.z plotter_x+1
    lda #<0
    sta.z plotter_x
    // [25] (byte~) plot::$7 ← *((const byte*) plot_xlo + (byte) plot::x#0) -- vbuz1=pbuc1_derefidx_vbuz2 
    ldy.z x
    lda plot_xlo,y
    sta.z __7
    // [26] (byte*) plot::plotter_x#2 ← (byte*) plot::plotter_x#1 lo= (byte~) plot::$7 -- pbuz1=pbuz2_setlo_vbuz3 
    lda.z __7
    sta.z plotter_x_1
    lda.z plotter_x+1
    sta.z plotter_x_1+1
    // [27] (byte~) plot::$8 ← *((const byte*) plot_yhi + (byte) plot::y#0) -- vbuz1=pbuc1_derefidx_vbuz2 
    ldy.z y
    lda plot_yhi,y
    sta.z __8
    // [28] (word) plot::plotter_y#1 ← (word) 0 hi= (byte~) plot::$8 -- vwuz1=vwuc1_sethi_vbuz2 
    lda.z __8
    sta.z plotter_y+1
    lda #<0
    sta.z plotter_y
    // [29] (byte~) plot::$9 ← *((const byte*) plot_ylo + (byte) plot::y#0) -- vbuz1=pbuc1_derefidx_vbuz2 
    ldy.z y
    lda plot_ylo,y
    sta.z __9
    // [30] (word) plot::plotter_y#2 ← (word) plot::plotter_y#1 lo= (byte~) plot::$9 -- vwuz1=vwuz2_setlo_vbuz3 
    lda.z __9
    sta.z plotter_y_1
    lda.z plotter_y+1
    sta.z plotter_y_1+1
    // [31] (byte*) plot::plotter#0 ← (byte*) plot::plotter_x#2 + (word) plot::plotter_y#2 -- pbuz1=pbuz2_plus_vwuz3 
    lda.z plotter_x_1
    clc
    adc.z plotter_y_1
    sta.z plotter
    lda.z plotter_x_1+1
    adc.z plotter_y_1+1
    sta.z plotter+1
    // [32] (byte~) plot::$5 ← *((byte*) plot::plotter#0) | *((const byte*) plot_bit + (byte) plot::x#0) -- vbuz1=_deref_pbuz2_bor_pbuc1_derefidx_vbuz3 
    ldy #0
    lda (plotter),y
    ldy.z x
    ora plot_bit,y
    sta.z __5
    // [33] *((byte*) plot::plotter#0) ← (byte~) plot::$5 -- _deref_pbuz1=vbuz2 
    lda.z __5
    ldy #0
    sta (plotter),y
    jmp __breturn
    // plot::@return
  __breturn:
    // [34] return 
    rts
}
  // init_plot_tables
init_plot_tables: {
    .label __0 = $1d
    .label __6 = $1f
    .label __7 = $20
    .label __8 = $21
    .label __9 = $1e
    .label bits = 4
    .label x = 3
    .label y = 5
    .label yoffs = 6
    // [36] phi from init_plot_tables to init_plot_tables::@1 [phi:init_plot_tables->init_plot_tables::@1]
  __b1_from_init_plot_tables:
    // [36] phi (byte) init_plot_tables::bits#3 = (byte) $80 [phi:init_plot_tables->init_plot_tables::@1#0] -- vbuz1=vbuc1 
    lda #$80
    sta.z bits
    // [36] phi (byte) init_plot_tables::x#2 = (byte) 0 [phi:init_plot_tables->init_plot_tables::@1#1] -- vbuz1=vbuc1 
    lda #0
    sta.z x
    jmp __b1
    // [36] phi from init_plot_tables::@2 to init_plot_tables::@1 [phi:init_plot_tables::@2->init_plot_tables::@1]
  __b1_from___b2:
    // [36] phi (byte) init_plot_tables::bits#3 = (byte) init_plot_tables::bits#4 [phi:init_plot_tables::@2->init_plot_tables::@1#0] -- register_copy 
    // [36] phi (byte) init_plot_tables::x#2 = (byte) init_plot_tables::x#1 [phi:init_plot_tables::@2->init_plot_tables::@1#1] -- register_copy 
    jmp __b1
    // init_plot_tables::@1
  __b1:
    // [37] (byte~) init_plot_tables::$0 ← (byte) init_plot_tables::x#2 & (byte) $f8 -- vbuz1=vbuz2_band_vbuc1 
    lda #$f8
    and.z x
    sta.z __0
    // [38] *((const byte*) plot_xlo + (byte) init_plot_tables::x#2) ← (byte~) init_plot_tables::$0 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __0
    ldy.z x
    sta plot_xlo,y
    // [39] *((const byte*) plot_xhi + (byte) init_plot_tables::x#2) ← >(const byte*) BITMAP -- pbuc1_derefidx_vbuz1=vbuc2 
    lda #>BITMAP
    ldy.z x
    sta plot_xhi,y
    // [40] *((const byte*) plot_bit + (byte) init_plot_tables::x#2) ← (byte) init_plot_tables::bits#3 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z bits
    ldy.z x
    sta plot_bit,y
    // [41] (byte) init_plot_tables::bits#1 ← (byte) init_plot_tables::bits#3 >> (byte) 1 -- vbuz1=vbuz1_ror_1 
    lsr.z bits
    // [42] if((byte) init_plot_tables::bits#1!=(byte) 0) goto init_plot_tables::@6 -- vbuz1_neq_0_then_la1 
    lda.z bits
    cmp #0
    bne __b6_from___b1
    // [44] phi from init_plot_tables::@1 to init_plot_tables::@2 [phi:init_plot_tables::@1->init_plot_tables::@2]
  __b2_from___b1:
    // [44] phi (byte) init_plot_tables::bits#4 = (byte) $80 [phi:init_plot_tables::@1->init_plot_tables::@2#0] -- vbuz1=vbuc1 
    lda #$80
    sta.z bits
    jmp __b2
    // [43] phi from init_plot_tables::@1 to init_plot_tables::@6 [phi:init_plot_tables::@1->init_plot_tables::@6]
  __b6_from___b1:
    jmp __b6
    // init_plot_tables::@6
  __b6:
    // [44] phi from init_plot_tables::@6 to init_plot_tables::@2 [phi:init_plot_tables::@6->init_plot_tables::@2]
  __b2_from___b6:
    // [44] phi (byte) init_plot_tables::bits#4 = (byte) init_plot_tables::bits#1 [phi:init_plot_tables::@6->init_plot_tables::@2#0] -- register_copy 
    jmp __b2
    // init_plot_tables::@2
  __b2:
    // [45] (byte) init_plot_tables::x#1 ← ++ (byte) init_plot_tables::x#2 -- vbuz1=_inc_vbuz1 
    inc.z x
    // [46] if((byte) init_plot_tables::x#1!=(byte) 0) goto init_plot_tables::@1 -- vbuz1_neq_0_then_la1 
    lda.z x
    cmp #0
    bne __b1_from___b2
    // [47] phi from init_plot_tables::@2 to init_plot_tables::@3 [phi:init_plot_tables::@2->init_plot_tables::@3]
  __b3_from___b2:
    // [47] phi (byte*) init_plot_tables::yoffs#2 = (byte*) 0 [phi:init_plot_tables::@2->init_plot_tables::@3#0] -- pbuz1=pbuc1 
    lda #<0
    sta.z yoffs
    lda #>0
    sta.z yoffs+1
    // [47] phi (byte) init_plot_tables::y#2 = (byte) 0 [phi:init_plot_tables::@2->init_plot_tables::@3#1] -- vbuz1=vbuc1 
    lda #0
    sta.z y
    jmp __b3
    // [47] phi from init_plot_tables::@4 to init_plot_tables::@3 [phi:init_plot_tables::@4->init_plot_tables::@3]
  __b3_from___b4:
    // [47] phi (byte*) init_plot_tables::yoffs#2 = (byte*) init_plot_tables::yoffs#4 [phi:init_plot_tables::@4->init_plot_tables::@3#0] -- register_copy 
    // [47] phi (byte) init_plot_tables::y#2 = (byte) init_plot_tables::y#1 [phi:init_plot_tables::@4->init_plot_tables::@3#1] -- register_copy 
    jmp __b3
    // init_plot_tables::@3
  __b3:
    // [48] (byte~) init_plot_tables::$9 ← (byte) init_plot_tables::y#2 & (byte) 7 -- vbuz1=vbuz2_band_vbuc1 
    lda #7
    and.z y
    sta.z __9
    // [49] (byte~) init_plot_tables::$6 ← < (byte*) init_plot_tables::yoffs#2 -- vbuz1=_lo_pbuz2 
    lda.z yoffs
    sta.z __6
    // [50] (byte~) init_plot_tables::$7 ← (byte~) init_plot_tables::$9 | (byte~) init_plot_tables::$6 -- vbuz1=vbuz2_bor_vbuz3 
    lda.z __9
    ora.z __6
    sta.z __7
    // [51] *((const byte*) plot_ylo + (byte) init_plot_tables::y#2) ← (byte~) init_plot_tables::$7 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __7
    ldy.z y
    sta plot_ylo,y
    // [52] (byte~) init_plot_tables::$8 ← > (byte*) init_plot_tables::yoffs#2 -- vbuz1=_hi_pbuz2 
    lda.z yoffs+1
    sta.z __8
    // [53] *((const byte*) plot_yhi + (byte) init_plot_tables::y#2) ← (byte~) init_plot_tables::$8 -- pbuc1_derefidx_vbuz1=vbuz2 
    lda.z __8
    ldy.z y
    sta plot_yhi,y
    // [54] if((byte~) init_plot_tables::$9!=(byte) 7) goto init_plot_tables::@4 -- vbuz1_neq_vbuc1_then_la1 
    lda #7
    cmp.z __9
    bne __b4_from___b3
    jmp __b5
    // init_plot_tables::@5
  __b5:
    // [55] (byte*) init_plot_tables::yoffs#1 ← (byte*) init_plot_tables::yoffs#2 + (word)(number) $28*(number) 8 -- pbuz1=pbuz1_plus_vwuc1 
    clc
    lda.z yoffs
    adc #<$28*8
    sta.z yoffs
    lda.z yoffs+1
    adc #>$28*8
    sta.z yoffs+1
    // [56] phi from init_plot_tables::@3 init_plot_tables::@5 to init_plot_tables::@4 [phi:init_plot_tables::@3/init_plot_tables::@5->init_plot_tables::@4]
  __b4_from___b3:
  __b4_from___b5:
    // [56] phi (byte*) init_plot_tables::yoffs#4 = (byte*) init_plot_tables::yoffs#2 [phi:init_plot_tables::@3/init_plot_tables::@5->init_plot_tables::@4#0] -- register_copy 
    jmp __b4
    // init_plot_tables::@4
  __b4:
    // [57] (byte) init_plot_tables::y#1 ← ++ (byte) init_plot_tables::y#2 -- vbuz1=_inc_vbuz1 
    inc.z y
    // [58] if((byte) init_plot_tables::y#1!=(byte) 0) goto init_plot_tables::@3 -- vbuz1_neq_0_then_la1 
    lda.z y
    cmp #0
    bne __b3_from___b4
    jmp __breturn
    // init_plot_tables::@return
  __breturn:
    // [59] return 
    rts
}
  // init_screen
init_screen: {
    .label b = 8
    .label c = $a
    // [61] phi from init_screen to init_screen::@1 [phi:init_screen->init_screen::@1]
  __b1_from_init_screen:
    // [61] phi (byte*) init_screen::b#2 = (const byte*) BITMAP [phi:init_screen->init_screen::@1#0] -- pbuz1=pbuc1 
    lda #<BITMAP
    sta.z b
    lda #>BITMAP
    sta.z b+1
    jmp __b1
    // init_screen::@1
  __b1:
    // [62] if((byte*) init_screen::b#2!=(const byte*) BITMAP+(word) $2000) goto init_screen::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda.z b+1
    cmp #>BITMAP+$2000
    bne __b2
    lda.z b
    cmp #<BITMAP+$2000
    bne __b2
    // [63] phi from init_screen::@1 to init_screen::@3 [phi:init_screen::@1->init_screen::@3]
  __b3_from___b1:
    // [63] phi (byte*) init_screen::c#2 = (const byte*) SCREEN [phi:init_screen::@1->init_screen::@3#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z c
    lda #>SCREEN
    sta.z c+1
    jmp __b3
    // init_screen::@3
  __b3:
    // [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN+(word) $400) goto init_screen::@4 -- pbuz1_neq_pbuc1_then_la1 
    lda.z c+1
    cmp #>SCREEN+$400
    bne __b4
    lda.z c
    cmp #<SCREEN+$400
    bne __b4
    jmp __breturn
    // init_screen::@return
  __breturn:
    // [65] return 
    rts
    // init_screen::@4
  __b4:
    // [66] *((byte*) init_screen::c#2) ← (byte) $14 -- _deref_pbuz1=vbuc1 
    lda #$14
    ldy #0
    sta (c),y
    // [67] (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#2 -- pbuz1=_inc_pbuz1 
    inc.z c
    bne !+
    inc.z c+1
  !:
    // [63] phi from init_screen::@4 to init_screen::@3 [phi:init_screen::@4->init_screen::@3]
  __b3_from___b4:
    // [63] phi (byte*) init_screen::c#2 = (byte*) init_screen::c#1 [phi:init_screen::@4->init_screen::@3#0] -- register_copy 
    jmp __b3
    // init_screen::@2
  __b2:
    // [68] *((byte*) init_screen::b#2) ← (byte) 0 -- _deref_pbuz1=vbuc1 
    lda #0
    ldy #0
    sta (b),y
    // [69] (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#2 -- pbuz1=_inc_pbuz1 
    inc.z b
    bne !+
    inc.z b+1
  !:
    // [61] phi from init_screen::@2 to init_screen::@1 [phi:init_screen::@2->init_screen::@1]
  __b1_from___b2:
    // [61] phi (byte*) init_screen::b#2 = (byte*) init_screen::b#1 [phi:init_screen::@2->init_screen::@1#0] -- register_copy 
    jmp __b1
}
  // File Data
  plots_x: .byte $3c, $50, $6e, $50, $3c, $28, $a, $28
  plots_y: .byte $a, $28, $3c, $50, $6e, $50, $3c, $28
  plot_xlo: .fill $100, 0
  plot_xhi: .fill $100, 0
  plot_ylo: .fill $100, 0
  plot_yhi: .fill $100, 0
  plot_bit: .fill $100, 0

REGISTER UPLIFT POTENTIAL REGISTERS
Equivalence Class zp[1]:31 [ init_plot_tables::$6 ] has ALU potential.
Statement [4] *((const byte*) BGCOL) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [5] *((const byte*) FGCOL) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [6] *((const byte*) D011) ← (const byte) BMM|(const byte) DEN|(const byte) RSEL|(byte) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [7] *((const byte*) D018) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [11] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [26] (byte*) plot::plotter_x#2 ← (byte*) plot::plotter_x#1 lo= (byte~) plot::$7 [ plot::x#0 plot::y#0 plot::plotter_x#2 ] ( main:2::plots:13::plot:21 [ plots::i#2 plot::x#0 plot::y#0 plot::plotter_x#2 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:2 [ plots::i#2 plots::i#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:12 [ plot::x#0 ]
Removing always clobbered register reg byte a as potential for zp[1]:13 [ plot::y#0 ]
Statement [30] (word) plot::plotter_y#2 ← (word) plot::plotter_y#1 lo= (byte~) plot::$9 [ plot::x#0 plot::plotter_x#2 plot::plotter_y#2 ] ( main:2::plots:13::plot:21 [ plots::i#2 plot::x#0 plot::plotter_x#2 plot::plotter_y#2 ] ) always clobbers reg byte a 
Statement [31] (byte*) plot::plotter#0 ← (byte*) plot::plotter_x#2 + (word) plot::plotter_y#2 [ plot::x#0 plot::plotter#0 ] ( main:2::plots:13::plot:21 [ plots::i#2 plot::x#0 plot::plotter#0 ] ) always clobbers reg byte a 
Statement [32] (byte~) plot::$5 ← *((byte*) plot::plotter#0) | *((const byte*) plot_bit + (byte) plot::x#0) [ plot::plotter#0 plot::$5 ] ( main:2::plots:13::plot:21 [ plots::i#2 plot::plotter#0 plot::$5 ] ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte y as potential for zp[1]:2 [ plots::i#2 plots::i#1 ]
Statement [33] *((byte*) plot::plotter#0) ← (byte~) plot::$5 [ ] ( main:2::plots:13::plot:21 [ plots::i#2 ] ) always clobbers reg byte y 
Statement [39] *((const byte*) plot_xhi + (byte) init_plot_tables::x#2) ← >(const byte*) BITMAP [ init_plot_tables::x#2 init_plot_tables::bits#3 ] ( main:2::init_plot_tables:10 [ init_plot_tables::x#2 init_plot_tables::bits#3 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:3 [ init_plot_tables::x#2 init_plot_tables::x#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:4 [ init_plot_tables::bits#3 init_plot_tables::bits#4 init_plot_tables::bits#1 ]
Statement [40] *((const byte*) plot_bit + (byte) init_plot_tables::x#2) ← (byte) init_plot_tables::bits#3 [ init_plot_tables::x#2 init_plot_tables::bits#3 ] ( main:2::init_plot_tables:10 [ init_plot_tables::x#2 init_plot_tables::bits#3 ] ) always clobbers reg byte a 
Statement [55] (byte*) init_plot_tables::yoffs#1 ← (byte*) init_plot_tables::yoffs#2 + (word)(number) $28*(number) 8 [ init_plot_tables::y#2 init_plot_tables::yoffs#1 ] ( main:2::init_plot_tables:10 [ init_plot_tables::y#2 init_plot_tables::yoffs#1 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:5 [ init_plot_tables::y#2 init_plot_tables::y#1 ]
Statement [62] if((byte*) init_screen::b#2!=(const byte*) BITMAP+(word) $2000) goto init_screen::@2 [ init_screen::b#2 ] ( main:2::init_screen:8 [ init_screen::b#2 ] ) always clobbers reg byte a 
Statement [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN+(word) $400) goto init_screen::@4 [ init_screen::c#2 ] ( main:2::init_screen:8 [ init_screen::c#2 ] ) always clobbers reg byte a 
Statement [66] *((byte*) init_screen::c#2) ← (byte) $14 [ init_screen::c#2 ] ( main:2::init_screen:8 [ init_screen::c#2 ] ) always clobbers reg byte a reg byte y 
Statement [68] *((byte*) init_screen::b#2) ← (byte) 0 [ init_screen::b#2 ] ( main:2::init_screen:8 [ init_screen::b#2 ] ) always clobbers reg byte a reg byte y 
Statement [4] *((const byte*) BGCOL) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [5] *((const byte*) FGCOL) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [6] *((const byte*) D011) ← (const byte) BMM|(const byte) DEN|(const byte) RSEL|(byte) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [7] *((const byte*) D018) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [11] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [26] (byte*) plot::plotter_x#2 ← (byte*) plot::plotter_x#1 lo= (byte~) plot::$7 [ plot::x#0 plot::y#0 plot::plotter_x#2 ] ( main:2::plots:13::plot:21 [ plots::i#2 plot::x#0 plot::y#0 plot::plotter_x#2 ] ) always clobbers reg byte a 
Statement [30] (word) plot::plotter_y#2 ← (word) plot::plotter_y#1 lo= (byte~) plot::$9 [ plot::x#0 plot::plotter_x#2 plot::plotter_y#2 ] ( main:2::plots:13::plot:21 [ plots::i#2 plot::x#0 plot::plotter_x#2 plot::plotter_y#2 ] ) always clobbers reg byte a 
Statement [31] (byte*) plot::plotter#0 ← (byte*) plot::plotter_x#2 + (word) plot::plotter_y#2 [ plot::x#0 plot::plotter#0 ] ( main:2::plots:13::plot:21 [ plots::i#2 plot::x#0 plot::plotter#0 ] ) always clobbers reg byte a 
Statement [32] (byte~) plot::$5 ← *((byte*) plot::plotter#0) | *((const byte*) plot_bit + (byte) plot::x#0) [ plot::plotter#0 plot::$5 ] ( main:2::plots:13::plot:21 [ plots::i#2 plot::plotter#0 plot::$5 ] ) always clobbers reg byte a reg byte y 
Statement [33] *((byte*) plot::plotter#0) ← (byte~) plot::$5 [ ] ( main:2::plots:13::plot:21 [ plots::i#2 ] ) always clobbers reg byte y 
Statement [37] (byte~) init_plot_tables::$0 ← (byte) init_plot_tables::x#2 & (byte) $f8 [ init_plot_tables::x#2 init_plot_tables::bits#3 init_plot_tables::$0 ] ( main:2::init_plot_tables:10 [ init_plot_tables::x#2 init_plot_tables::bits#3 init_plot_tables::$0 ] ) always clobbers reg byte a 
Statement [39] *((const byte*) plot_xhi + (byte) init_plot_tables::x#2) ← >(const byte*) BITMAP [ init_plot_tables::x#2 init_plot_tables::bits#3 ] ( main:2::init_plot_tables:10 [ init_plot_tables::x#2 init_plot_tables::bits#3 ] ) always clobbers reg byte a 
Statement [40] *((const byte*) plot_bit + (byte) init_plot_tables::x#2) ← (byte) init_plot_tables::bits#3 [ init_plot_tables::x#2 init_plot_tables::bits#3 ] ( main:2::init_plot_tables:10 [ init_plot_tables::x#2 init_plot_tables::bits#3 ] ) always clobbers reg byte a 
Statement [48] (byte~) init_plot_tables::$9 ← (byte) init_plot_tables::y#2 & (byte) 7 [ init_plot_tables::y#2 init_plot_tables::yoffs#2 init_plot_tables::$9 ] ( main:2::init_plot_tables:10 [ init_plot_tables::y#2 init_plot_tables::yoffs#2 init_plot_tables::$9 ] ) always clobbers reg byte a 
Statement [55] (byte*) init_plot_tables::yoffs#1 ← (byte*) init_plot_tables::yoffs#2 + (word)(number) $28*(number) 8 [ init_plot_tables::y#2 init_plot_tables::yoffs#1 ] ( main:2::init_plot_tables:10 [ init_plot_tables::y#2 init_plot_tables::yoffs#1 ] ) always clobbers reg byte a 
Statement [62] if((byte*) init_screen::b#2!=(const byte*) BITMAP+(word) $2000) goto init_screen::@2 [ init_screen::b#2 ] ( main:2::init_screen:8 [ init_screen::b#2 ] ) always clobbers reg byte a 
Statement [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN+(word) $400) goto init_screen::@4 [ init_screen::c#2 ] ( main:2::init_screen:8 [ init_screen::c#2 ] ) always clobbers reg byte a 
Statement [66] *((byte*) init_screen::c#2) ← (byte) $14 [ init_screen::c#2 ] ( main:2::init_screen:8 [ init_screen::c#2 ] ) always clobbers reg byte a reg byte y 
Statement [68] *((byte*) init_screen::b#2) ← (byte) 0 [ init_screen::b#2 ] ( main:2::init_screen:8 [ init_screen::b#2 ] ) always clobbers reg byte a reg byte y 
Potential registers zp[1]:2 [ plots::i#2 plots::i#1 ] : zp[1]:2 , reg byte x , 
Potential registers zp[1]:3 [ init_plot_tables::x#2 init_plot_tables::x#1 ] : zp[1]:3 , reg byte x , reg byte y , 
Potential registers zp[1]:4 [ init_plot_tables::bits#3 init_plot_tables::bits#4 init_plot_tables::bits#1 ] : zp[1]:4 , reg byte x , reg byte y , 
Potential registers zp[1]:5 [ init_plot_tables::y#2 init_plot_tables::y#1 ] : zp[1]:5 , reg byte x , reg byte y , 
Potential registers zp[2]:6 [ init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 ] : zp[2]:6 , 
Potential registers zp[2]:8 [ init_screen::b#2 init_screen::b#1 ] : zp[2]:8 , 
Potential registers zp[2]:10 [ init_screen::c#2 init_screen::c#1 ] : zp[2]:10 , 
Potential registers zp[1]:12 [ plot::x#0 ] : zp[1]:12 , reg byte x , reg byte y , 
Potential registers zp[1]:13 [ plot::y#0 ] : zp[1]:13 , reg byte x , reg byte y , 
Potential registers zp[1]:14 [ plot::$6 ] : zp[1]:14 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:15 [ plot::plotter_x#1 ] : zp[2]:15 , 
Potential registers zp[1]:17 [ plot::$7 ] : zp[1]:17 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:18 [ plot::plotter_x#2 ] : zp[2]:18 , 
Potential registers zp[1]:20 [ plot::$8 ] : zp[1]:20 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:21 [ plot::plotter_y#1 ] : zp[2]:21 , 
Potential registers zp[1]:23 [ plot::$9 ] : zp[1]:23 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:24 [ plot::plotter_y#2 ] : zp[2]:24 , 
Potential registers zp[2]:26 [ plot::plotter#0 ] : zp[2]:26 , 
Potential registers zp[1]:28 [ plot::$5 ] : zp[1]:28 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:29 [ init_plot_tables::$0 ] : zp[1]:29 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:30 [ init_plot_tables::$9 ] : zp[1]:30 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:31 [ init_plot_tables::$6 ] : zp[1]:31 , reg byte a , reg byte x , reg byte y , reg byte alu , 
Potential registers zp[1]:32 [ init_plot_tables::$7 ] : zp[1]:32 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:33 [ init_plot_tables::$8 ] : zp[1]:33 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [plots] 303: zp[1]:2 [ plots::i#2 plots::i#1 ] 
Uplift Scope [init_plot_tables] 39.88: zp[2]:6 [ init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 ] 24.93: zp[1]:4 [ init_plot_tables::bits#3 init_plot_tables::bits#4 init_plot_tables::bits#1 ] 23.83: zp[1]:3 [ init_plot_tables::x#2 init_plot_tables::x#1 ] 22: zp[1]:5 [ init_plot_tables::y#2 init_plot_tables::y#1 ] 22: zp[1]:29 [ init_plot_tables::$0 ] 22: zp[1]:31 [ init_plot_tables::$6 ] 22: zp[1]:32 [ init_plot_tables::$7 ] 22: zp[1]:33 [ init_plot_tables::$8 ] 5.5: zp[1]:30 [ init_plot_tables::$9 ] 
Uplift Scope [init_screen] 36.67: zp[2]:8 [ init_screen::b#2 init_screen::b#1 ] 36.67: zp[2]:10 [ init_screen::c#2 init_screen::c#1 ] 
Uplift Scope [plot] 15: zp[1]:13 [ plot::y#0 ] 9.73: zp[1]:12 [ plot::x#0 ] 4: zp[1]:14 [ plot::$6 ] 4: zp[1]:17 [ plot::$7 ] 4: zp[1]:20 [ plot::$8 ] 4: zp[1]:23 [ plot::$9 ] 4: zp[2]:24 [ plot::plotter_y#2 ] 4: zp[1]:28 [ plot::$5 ] 3: zp[2]:26 [ plot::plotter#0 ] 2: zp[2]:15 [ plot::plotter_x#1 ] 2: zp[2]:21 [ plot::plotter_y#1 ] 0.8: zp[2]:18 [ plot::plotter_x#2 ] 
Uplift Scope [main] 
Uplift Scope [] 

Uplifting [plots] best 8915 combination reg byte x [ plots::i#2 plots::i#1 ] 
Uplifting [init_plot_tables] best 8395 combination zp[2]:6 [ init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 ] reg byte y [ init_plot_tables::bits#3 init_plot_tables::bits#4 init_plot_tables::bits#1 ] reg byte x [ init_plot_tables::x#2 init_plot_tables::x#1 ] reg byte x [ init_plot_tables::y#2 init_plot_tables::y#1 ] reg byte a [ init_plot_tables::$0 ] zp[1]:31 [ init_plot_tables::$6 ] zp[1]:32 [ init_plot_tables::$7 ] zp[1]:33 [ init_plot_tables::$8 ] zp[1]:30 [ init_plot_tables::$9 ] 
Limited combination testing to 100 combinations of 34560 possible.
Uplifting [init_screen] best 8395 combination zp[2]:8 [ init_screen::b#2 init_screen::b#1 ] zp[2]:10 [ init_screen::c#2 init_screen::c#1 ] 
Uplifting [plot] best 8383 combination zp[1]:13 [ plot::y#0 ] zp[1]:12 [ plot::x#0 ] reg byte a [ plot::$6 ] reg byte a [ plot::$7 ] zp[1]:20 [ plot::$8 ] zp[1]:23 [ plot::$9 ] zp[2]:24 [ plot::plotter_y#2 ] zp[1]:28 [ plot::$5 ] zp[2]:26 [ plot::plotter#0 ] zp[2]:15 [ plot::plotter_x#1 ] zp[2]:21 [ plot::plotter_y#1 ] zp[2]:18 [ plot::plotter_x#2 ] 
Limited combination testing to 100 combinations of 9216 possible.
Uplifting [main] best 8383 combination 
Uplifting [] best 8383 combination 
Attempting to uplift remaining variables inzp[1]:31 [ init_plot_tables::$6 ]
Uplifting [init_plot_tables] best 8323 combination reg byte a [ init_plot_tables::$6 ] 
Attempting to uplift remaining variables inzp[1]:32 [ init_plot_tables::$7 ]
Uplifting [init_plot_tables] best 8263 combination reg byte a [ init_plot_tables::$7 ] 
Attempting to uplift remaining variables inzp[1]:33 [ init_plot_tables::$8 ]
Uplifting [init_plot_tables] best 8203 combination reg byte a [ init_plot_tables::$8 ] 
Attempting to uplift remaining variables inzp[1]:13 [ plot::y#0 ]
Uplifting [plot] best 8203 combination zp[1]:13 [ plot::y#0 ] 
Attempting to uplift remaining variables inzp[1]:12 [ plot::x#0 ]
Uplifting [plot] best 8203 combination zp[1]:12 [ plot::x#0 ] 
Attempting to uplift remaining variables inzp[1]:30 [ init_plot_tables::$9 ]
Uplifting [init_plot_tables] best 8203 combination zp[1]:30 [ init_plot_tables::$9 ] 
Attempting to uplift remaining variables inzp[1]:20 [ plot::$8 ]
Uplifting [plot] best 8197 combination reg byte a [ plot::$8 ] 
Attempting to uplift remaining variables inzp[1]:23 [ plot::$9 ]
Uplifting [plot] best 8191 combination reg byte a [ plot::$9 ] 
Attempting to uplift remaining variables inzp[1]:28 [ plot::$5 ]
Uplifting [plot] best 8185 combination reg byte a [ plot::$5 ] 
Coalescing zero page register [ zp[2]:15 [ plot::plotter_x#1 ] ] with [ zp[2]:18 [ plot::plotter_x#2 ] ] - score: 1
Coalescing zero page register [ zp[2]:21 [ plot::plotter_y#1 ] ] with [ zp[2]:24 [ plot::plotter_y#2 ] ] - score: 1
Coalescing zero page register [ zp[2]:15 [ plot::plotter_x#1 plot::plotter_x#2 ] ] with [ zp[2]:26 [ plot::plotter#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:8 [ init_screen::b#2 init_screen::b#1 ] ] with [ zp[2]:6 [ init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 ] ]
Coalescing zero page register [ zp[2]:15 [ plot::plotter_x#1 plot::plotter_x#2 plot::plotter#0 ] ] with [ zp[2]:10 [ init_screen::c#2 init_screen::c#1 ] ]
Coalescing zero page register [ zp[1]:30 [ init_plot_tables::$9 ] ] with [ zp[1]:12 [ plot::x#0 ] ]
Coalescing zero page register [ zp[2]:21 [ plot::plotter_y#1 plot::plotter_y#2 ] ] with [ zp[2]:8 [ init_screen::b#2 init_screen::b#1 init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 ] ]
Allocated (was zp[1]:13) zp[1]:2 [ plot::y#0 ]
Allocated (was zp[2]:15) zp[2]:3 [ plot::plotter_x#1 plot::plotter_x#2 plot::plotter#0 init_screen::c#2 init_screen::c#1 ]
Allocated (was zp[2]:21) zp[2]:5 [ plot::plotter_y#1 plot::plotter_y#2 init_screen::b#2 init_screen::b#1 init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 ]
Allocated (was zp[1]:30) zp[1]:7 [ init_plot_tables::$9 plot::x#0 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label BITMAP = $2000
  .label D011 = $d011
  .const BMM = $20
  .const DEN = $10
  .const RSEL = 8
  .label RASTER = $d012
  .label D018 = $d018
  .label BGCOL = $d020
  .label FGCOL = $d021
  .label SCREEN = $400
  .const plots_cnt = 8
  // @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: {
    // [4] *((const byte*) BGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta BGCOL
    // [5] *((const byte*) FGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta FGCOL
    // [6] *((const byte*) D011) ← (const byte) BMM|(const byte) DEN|(const byte) RSEL|(byte) 3 -- _deref_pbuc1=vbuc2 
    lda #BMM|DEN|RSEL|3
    sta D011
    // [7] *((const byte*) D018) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400 -- _deref_pbuc1=vbuc2 
    lda #SCREEN/$40|BITMAP/$400
    sta D018
    // [8] call init_screen 
    // [60] phi from main to init_screen [phi:main->init_screen]
  init_screen_from_main:
    jsr init_screen
    // [9] phi from main to main::@3 [phi:main->main::@3]
  __b3_from_main:
    jmp __b3
    // main::@3
  __b3:
    // [10] call init_plot_tables 
    // [35] phi from main::@3 to init_plot_tables [phi:main::@3->init_plot_tables]
  init_plot_tables_from___b3:
    jsr init_plot_tables
    jmp __b1
    // main::@1
  __b1:
    // [11] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$ff
    cmp RASTER
    bne __b1
    jmp __b2
    // main::@2
  __b2:
    // [12] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc BGCOL
    // [13] call plots 
    // [15] phi from main::@2 to plots [phi:main::@2->plots]
  plots_from___b2:
    jsr plots
    jmp __b4
    // main::@4
  __b4:
    // [14] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 
    dec BGCOL
    jmp __b1
}
  // plots
plots: {
    // [16] phi from plots to plots::@1 [phi:plots->plots::@1]
  __b1_from_plots:
    // [16] phi (byte) plots::i#2 = (byte) 0 [phi:plots->plots::@1#0] -- vbuxx=vbuc1 
    ldx #0
    jmp __b1
    // plots::@1
  __b1:
    // [17] if((byte) plots::i#2<(const byte) plots_cnt) goto plots::@2 -- vbuxx_lt_vbuc1_then_la1 
    cpx #plots_cnt
    bcc __b2
    jmp __breturn
    // plots::@return
  __breturn:
    // [18] return 
    rts
    // plots::@2
  __b2:
    // [19] (byte) plot::x#0 ← *((const byte*) plots_x + (byte) plots::i#2) -- vbuz1=pbuc1_derefidx_vbuxx 
    lda plots_x,x
    sta.z plot.x
    // [20] (byte) plot::y#0 ← *((const byte*) plots_y + (byte) plots::i#2) -- vbuz1=pbuc1_derefidx_vbuxx 
    lda plots_y,x
    sta.z plot.y
    // [21] call plot 
    jsr plot
    jmp __b3
    // plots::@3
  __b3:
    // [22] (byte) plots::i#1 ← ++ (byte) plots::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [16] phi from plots::@3 to plots::@1 [phi:plots::@3->plots::@1]
  __b1_from___b3:
    // [16] phi (byte) plots::i#2 = (byte) plots::i#1 [phi:plots::@3->plots::@1#0] -- register_copy 
    jmp __b1
}
  // plot
// plot(byte zp(7) x, byte zp(2) y)
plot: {
    .label x = 7
    .label y = 2
    .label plotter_x = 3
    .label plotter_y = 5
    .label plotter = 3
    // [23] (byte~) plot::$6 ← *((const byte*) plot_xhi + (byte) plot::x#0) -- vbuaa=pbuc1_derefidx_vbuz1 
    ldy.z x
    lda plot_xhi,y
    // [24] (byte*) plot::plotter_x#1 ← (byte*) 0 hi= (byte~) plot::$6 -- pbuz1=pbuc1_sethi_vbuaa 
    sta.z plotter_x+1
    lda #<0
    sta.z plotter_x
    // [25] (byte~) plot::$7 ← *((const byte*) plot_xlo + (byte) plot::x#0) -- vbuaa=pbuc1_derefidx_vbuz1 
    ldy.z x
    lda plot_xlo,y
    // [26] (byte*) plot::plotter_x#2 ← (byte*) plot::plotter_x#1 lo= (byte~) plot::$7 -- pbuz1=pbuz1_setlo_vbuaa 
    sta.z plotter_x
    // [27] (byte~) plot::$8 ← *((const byte*) plot_yhi + (byte) plot::y#0) -- vbuaa=pbuc1_derefidx_vbuz1 
    ldy.z y
    lda plot_yhi,y
    // [28] (word) plot::plotter_y#1 ← (word) 0 hi= (byte~) plot::$8 -- vwuz1=vwuc1_sethi_vbuaa 
    sta.z plotter_y+1
    lda #<0
    sta.z plotter_y
    // [29] (byte~) plot::$9 ← *((const byte*) plot_ylo + (byte) plot::y#0) -- vbuaa=pbuc1_derefidx_vbuz1 
    ldy.z y
    lda plot_ylo,y
    // [30] (word) plot::plotter_y#2 ← (word) plot::plotter_y#1 lo= (byte~) plot::$9 -- vwuz1=vwuz1_setlo_vbuaa 
    sta.z plotter_y
    // [31] (byte*) plot::plotter#0 ← (byte*) plot::plotter_x#2 + (word) plot::plotter_y#2 -- pbuz1=pbuz1_plus_vwuz2 
    lda.z plotter
    clc
    adc.z plotter_y
    sta.z plotter
    lda.z plotter+1
    adc.z plotter_y+1
    sta.z plotter+1
    // [32] (byte~) plot::$5 ← *((byte*) plot::plotter#0) | *((const byte*) plot_bit + (byte) plot::x#0) -- vbuaa=_deref_pbuz1_bor_pbuc1_derefidx_vbuz2 
    ldy #0
    lda (plotter),y
    ldy.z x
    ora plot_bit,y
    // [33] *((byte*) plot::plotter#0) ← (byte~) plot::$5 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (plotter),y
    jmp __breturn
    // plot::@return
  __breturn:
    // [34] return 
    rts
}
  // init_plot_tables
init_plot_tables: {
    .label __9 = 7
    .label yoffs = 5
    // [36] phi from init_plot_tables to init_plot_tables::@1 [phi:init_plot_tables->init_plot_tables::@1]
  __b1_from_init_plot_tables:
    // [36] phi (byte) init_plot_tables::bits#3 = (byte) $80 [phi:init_plot_tables->init_plot_tables::@1#0] -- vbuyy=vbuc1 
    ldy #$80
    // [36] phi (byte) init_plot_tables::x#2 = (byte) 0 [phi:init_plot_tables->init_plot_tables::@1#1] -- vbuxx=vbuc1 
    ldx #0
    jmp __b1
    // [36] phi from init_plot_tables::@2 to init_plot_tables::@1 [phi:init_plot_tables::@2->init_plot_tables::@1]
  __b1_from___b2:
    // [36] phi (byte) init_plot_tables::bits#3 = (byte) init_plot_tables::bits#4 [phi:init_plot_tables::@2->init_plot_tables::@1#0] -- register_copy 
    // [36] phi (byte) init_plot_tables::x#2 = (byte) init_plot_tables::x#1 [phi:init_plot_tables::@2->init_plot_tables::@1#1] -- register_copy 
    jmp __b1
    // init_plot_tables::@1
  __b1:
    // [37] (byte~) init_plot_tables::$0 ← (byte) init_plot_tables::x#2 & (byte) $f8 -- vbuaa=vbuxx_band_vbuc1 
    txa
    and #$f8
    // [38] *((const byte*) plot_xlo + (byte) init_plot_tables::x#2) ← (byte~) init_plot_tables::$0 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta plot_xlo,x
    // [39] *((const byte*) plot_xhi + (byte) init_plot_tables::x#2) ← >(const byte*) BITMAP -- pbuc1_derefidx_vbuxx=vbuc2 
    lda #>BITMAP
    sta plot_xhi,x
    // [40] *((const byte*) plot_bit + (byte) init_plot_tables::x#2) ← (byte) init_plot_tables::bits#3 -- pbuc1_derefidx_vbuxx=vbuyy 
    tya
    sta plot_bit,x
    // [41] (byte) init_plot_tables::bits#1 ← (byte) init_plot_tables::bits#3 >> (byte) 1 -- vbuyy=vbuyy_ror_1 
    tya
    lsr
    tay
    // [42] if((byte) init_plot_tables::bits#1!=(byte) 0) goto init_plot_tables::@6 -- vbuyy_neq_0_then_la1 
    cpy #0
    bne __b6_from___b1
    // [44] phi from init_plot_tables::@1 to init_plot_tables::@2 [phi:init_plot_tables::@1->init_plot_tables::@2]
  __b2_from___b1:
    // [44] phi (byte) init_plot_tables::bits#4 = (byte) $80 [phi:init_plot_tables::@1->init_plot_tables::@2#0] -- vbuyy=vbuc1 
    ldy #$80
    jmp __b2
    // [43] phi from init_plot_tables::@1 to init_plot_tables::@6 [phi:init_plot_tables::@1->init_plot_tables::@6]
  __b6_from___b1:
    jmp __b6
    // init_plot_tables::@6
  __b6:
    // [44] phi from init_plot_tables::@6 to init_plot_tables::@2 [phi:init_plot_tables::@6->init_plot_tables::@2]
  __b2_from___b6:
    // [44] phi (byte) init_plot_tables::bits#4 = (byte) init_plot_tables::bits#1 [phi:init_plot_tables::@6->init_plot_tables::@2#0] -- register_copy 
    jmp __b2
    // init_plot_tables::@2
  __b2:
    // [45] (byte) init_plot_tables::x#1 ← ++ (byte) init_plot_tables::x#2 -- vbuxx=_inc_vbuxx 
    inx
    // [46] if((byte) init_plot_tables::x#1!=(byte) 0) goto init_plot_tables::@1 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne __b1_from___b2
    // [47] phi from init_plot_tables::@2 to init_plot_tables::@3 [phi:init_plot_tables::@2->init_plot_tables::@3]
  __b3_from___b2:
    // [47] phi (byte*) init_plot_tables::yoffs#2 = (byte*) 0 [phi:init_plot_tables::@2->init_plot_tables::@3#0] -- pbuz1=pbuc1 
    lda #<0
    sta.z yoffs
    lda #>0
    sta.z yoffs+1
    // [47] phi (byte) init_plot_tables::y#2 = (byte) 0 [phi:init_plot_tables::@2->init_plot_tables::@3#1] -- vbuxx=vbuc1 
    ldx #0
    jmp __b3
    // [47] phi from init_plot_tables::@4 to init_plot_tables::@3 [phi:init_plot_tables::@4->init_plot_tables::@3]
  __b3_from___b4:
    // [47] phi (byte*) init_plot_tables::yoffs#2 = (byte*) init_plot_tables::yoffs#4 [phi:init_plot_tables::@4->init_plot_tables::@3#0] -- register_copy 
    // [47] phi (byte) init_plot_tables::y#2 = (byte) init_plot_tables::y#1 [phi:init_plot_tables::@4->init_plot_tables::@3#1] -- register_copy 
    jmp __b3
    // init_plot_tables::@3
  __b3:
    // [48] (byte~) init_plot_tables::$9 ← (byte) init_plot_tables::y#2 & (byte) 7 -- vbuz1=vbuxx_band_vbuc1 
    lda #7
    sax.z __9
    // [49] (byte~) init_plot_tables::$6 ← < (byte*) init_plot_tables::yoffs#2 -- vbuaa=_lo_pbuz1 
    lda.z yoffs
    // [50] (byte~) init_plot_tables::$7 ← (byte~) init_plot_tables::$9 | (byte~) init_plot_tables::$6 -- vbuaa=vbuz1_bor_vbuaa 
    ora.z __9
    // [51] *((const byte*) plot_ylo + (byte) init_plot_tables::y#2) ← (byte~) init_plot_tables::$7 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta plot_ylo,x
    // [52] (byte~) init_plot_tables::$8 ← > (byte*) init_plot_tables::yoffs#2 -- vbuaa=_hi_pbuz1 
    lda.z yoffs+1
    // [53] *((const byte*) plot_yhi + (byte) init_plot_tables::y#2) ← (byte~) init_plot_tables::$8 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta plot_yhi,x
    // [54] if((byte~) init_plot_tables::$9!=(byte) 7) goto init_plot_tables::@4 -- vbuz1_neq_vbuc1_then_la1 
    lda #7
    cmp.z __9
    bne __b4_from___b3
    jmp __b5
    // init_plot_tables::@5
  __b5:
    // [55] (byte*) init_plot_tables::yoffs#1 ← (byte*) init_plot_tables::yoffs#2 + (word)(number) $28*(number) 8 -- pbuz1=pbuz1_plus_vwuc1 
    clc
    lda.z yoffs
    adc #<$28*8
    sta.z yoffs
    lda.z yoffs+1
    adc #>$28*8
    sta.z yoffs+1
    // [56] phi from init_plot_tables::@3 init_plot_tables::@5 to init_plot_tables::@4 [phi:init_plot_tables::@3/init_plot_tables::@5->init_plot_tables::@4]
  __b4_from___b3:
  __b4_from___b5:
    // [56] phi (byte*) init_plot_tables::yoffs#4 = (byte*) init_plot_tables::yoffs#2 [phi:init_plot_tables::@3/init_plot_tables::@5->init_plot_tables::@4#0] -- register_copy 
    jmp __b4
    // init_plot_tables::@4
  __b4:
    // [57] (byte) init_plot_tables::y#1 ← ++ (byte) init_plot_tables::y#2 -- vbuxx=_inc_vbuxx 
    inx
    // [58] if((byte) init_plot_tables::y#1!=(byte) 0) goto init_plot_tables::@3 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne __b3_from___b4
    jmp __breturn
    // init_plot_tables::@return
  __breturn:
    // [59] return 
    rts
}
  // init_screen
init_screen: {
    .label b = 5
    .label c = 3
    // [61] phi from init_screen to init_screen::@1 [phi:init_screen->init_screen::@1]
  __b1_from_init_screen:
    // [61] phi (byte*) init_screen::b#2 = (const byte*) BITMAP [phi:init_screen->init_screen::@1#0] -- pbuz1=pbuc1 
    lda #<BITMAP
    sta.z b
    lda #>BITMAP
    sta.z b+1
    jmp __b1
    // init_screen::@1
  __b1:
    // [62] if((byte*) init_screen::b#2!=(const byte*) BITMAP+(word) $2000) goto init_screen::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda.z b+1
    cmp #>BITMAP+$2000
    bne __b2
    lda.z b
    cmp #<BITMAP+$2000
    bne __b2
    // [63] phi from init_screen::@1 to init_screen::@3 [phi:init_screen::@1->init_screen::@3]
  __b3_from___b1:
    // [63] phi (byte*) init_screen::c#2 = (const byte*) SCREEN [phi:init_screen::@1->init_screen::@3#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z c
    lda #>SCREEN
    sta.z c+1
    jmp __b3
    // init_screen::@3
  __b3:
    // [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN+(word) $400) goto init_screen::@4 -- pbuz1_neq_pbuc1_then_la1 
    lda.z c+1
    cmp #>SCREEN+$400
    bne __b4
    lda.z c
    cmp #<SCREEN+$400
    bne __b4
    jmp __breturn
    // init_screen::@return
  __breturn:
    // [65] return 
    rts
    // init_screen::@4
  __b4:
    // [66] *((byte*) init_screen::c#2) ← (byte) $14 -- _deref_pbuz1=vbuc1 
    lda #$14
    ldy #0
    sta (c),y
    // [67] (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#2 -- pbuz1=_inc_pbuz1 
    inc.z c
    bne !+
    inc.z c+1
  !:
    // [63] phi from init_screen::@4 to init_screen::@3 [phi:init_screen::@4->init_screen::@3]
  __b3_from___b4:
    // [63] phi (byte*) init_screen::c#2 = (byte*) init_screen::c#1 [phi:init_screen::@4->init_screen::@3#0] -- register_copy 
    jmp __b3
    // init_screen::@2
  __b2:
    // [68] *((byte*) init_screen::b#2) ← (byte) 0 -- _deref_pbuz1=vbuc1 
    lda #0
    ldy #0
    sta (b),y
    // [69] (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#2 -- pbuz1=_inc_pbuz1 
    inc.z b
    bne !+
    inc.z b+1
  !:
    // [61] phi from init_screen::@2 to init_screen::@1 [phi:init_screen::@2->init_screen::@1]
  __b1_from___b2:
    // [61] phi (byte*) init_screen::b#2 = (byte*) init_screen::b#1 [phi:init_screen::@2->init_screen::@1#0] -- register_copy 
    jmp __b1
}
  // File Data
  plots_x: .byte $3c, $50, $6e, $50, $3c, $28, $a, $28
  plots_y: .byte $a, $28, $3c, $50, $6e, $50, $3c, $28
  plot_xlo: .fill $100, 0
  plot_xhi: .fill $100, 0
  plot_ylo: .fill $100, 0
  plot_yhi: .fill $100, 0
  plot_bit: .fill $100, 0

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __bend
Removing instruction jmp __b3
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b4
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b3
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __b6
Removing instruction jmp __b2
Removing instruction jmp __b3
Removing instruction jmp __b5
Removing instruction jmp __b4
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __b3
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #0
Removing instruction ldy.z x
Removing instruction ldy.z y
Removing instruction lda #>0
Replacing instruction ldx #0 with TAX
Replacing instruction ldy #0 with TAY
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label __bbegin with __b1
Replacing label __b6_from___b1 with __b2
Replacing label __b1_from___b2 with __b1
Replacing label __b4_from___b3 with __b4
Replacing label __b3_from___b4 with __b3
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
Removing instruction __bend_from___b1:
Removing instruction __b3_from_main:
Removing instruction init_plot_tables_from___b3:
Removing instruction __b1_from___b2:
Removing instruction __b6_from___b1:
Removing instruction __b6:
Removing instruction __b2_from___b6:
Removing instruction __b3_from___b4:
Removing instruction __b4_from___b3:
Removing instruction __b4_from___b5:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bend:
Removing instruction init_screen_from_main:
Removing instruction __b3:
Removing instruction __b2:
Removing instruction plots_from___b2:
Removing instruction __b4:
Removing instruction __b1_from_plots:
Removing instruction __breturn:
Removing instruction __b3:
Removing instruction __b1_from___b3:
Removing instruction __breturn:
Removing instruction __b1_from_init_plot_tables:
Removing instruction __b2_from___b1:
Removing instruction __b3_from___b2:
Removing instruction __b5:
Removing instruction __breturn:
Removing instruction __b1_from_init_screen:
Removing instruction __b3_from___b1:
Removing instruction __breturn:
Removing instruction __b3_from___b4:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b3
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __b1:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const byte*) BGCOL = (byte*) 53280
(const byte*) BITMAP = (byte*) 8192
(const byte) BMM = (byte) $20
(const byte*) D011 = (byte*) 53265
(const byte*) D018 = (byte*) 53272
(const byte) DEN = (byte) $10
(const byte*) FGCOL = (byte*) 53281
(const byte*) RASTER = (byte*) 53266
(const byte) RSEL = (byte) 8
(const byte*) SCREEN = (byte*) 1024
(void()) init_plot_tables()
(byte~) init_plot_tables::$0 reg byte a 22.0
(byte~) init_plot_tables::$6 reg byte a 22.0
(byte~) init_plot_tables::$7 reg byte a 22.0
(byte~) init_plot_tables::$8 reg byte a 22.0
(byte~) init_plot_tables::$9 zp[1]:7 5.5
(label) init_plot_tables::@1
(label) init_plot_tables::@2
(label) init_plot_tables::@3
(label) init_plot_tables::@4
(label) init_plot_tables::@5
(label) init_plot_tables::@6
(label) init_plot_tables::@return
(byte) init_plot_tables::bits
(byte) init_plot_tables::bits#1 reg byte y 11.0
(byte) init_plot_tables::bits#3 reg byte y 6.6000000000000005
(byte) init_plot_tables::bits#4 reg byte y 7.333333333333333
(byte) init_plot_tables::x
(byte) init_plot_tables::x#1 reg byte x 16.5
(byte) init_plot_tables::x#2 reg byte x 7.333333333333334
(byte) init_plot_tables::y
(byte) init_plot_tables::y#1 reg byte x 16.5
(byte) init_plot_tables::y#2 reg byte x 5.5
(byte*) init_plot_tables::yoffs
(byte*) init_plot_tables::yoffs#1 yoffs zp[2]:5 22.0
(byte*) init_plot_tables::yoffs#2 yoffs zp[2]:5 6.875
(byte*) init_plot_tables::yoffs#4 yoffs zp[2]:5 11.0
(void()) init_screen()
(label) init_screen::@1
(label) init_screen::@2
(label) init_screen::@3
(label) init_screen::@4
(label) init_screen::@return
(byte*) init_screen::b
(byte*) init_screen::b#1 b zp[2]:5 22.0
(byte*) init_screen::b#2 b zp[2]:5 14.666666666666666
(byte*) init_screen::c
(byte*) init_screen::c#1 c zp[2]:3 22.0
(byte*) init_screen::c#2 c zp[2]:3 14.666666666666666
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(void()) plot((byte) plot::x , (byte) plot::y)
(byte~) plot::$5 reg byte a 4.0
(byte~) plot::$6 reg byte a 4.0
(byte~) plot::$7 reg byte a 4.0
(byte~) plot::$8 reg byte a 4.0
(byte~) plot::$9 reg byte a 4.0
(label) plot::@return
(byte*) plot::plotter
(byte*) plot::plotter#0 plotter zp[2]:3 3.0
(byte*) plot::plotter_x
(byte*) plot::plotter_x#1 plotter_x zp[2]:3 2.0
(byte*) plot::plotter_x#2 plotter_x zp[2]:3 0.8
(word) plot::plotter_y
(word) plot::plotter_y#1 plotter_y zp[2]:5 2.0
(word) plot::plotter_y#2 plotter_y zp[2]:5 4.0
(byte) plot::x
(byte) plot::x#0 x zp[1]:7 9.727272727272727
(byte) plot::y
(byte) plot::y#0 y zp[1]:2 15.000000000000002
(const byte*) plot_bit[(number) $100]  = { fill( $100, 0) }
(const byte*) plot_xhi[(number) $100]  = { fill( $100, 0) }
(const byte*) plot_xlo[(number) $100]  = { fill( $100, 0) }
(const byte*) plot_yhi[(number) $100]  = { fill( $100, 0) }
(const byte*) plot_ylo[(number) $100]  = { fill( $100, 0) }
(void()) plots()
(label) plots::@1
(label) plots::@2
(label) plots::@3
(label) plots::@return
(byte) plots::i
(byte) plots::i#1 reg byte x 202.0
(byte) plots::i#2 reg byte x 101.0
(const byte) plots_cnt = (byte) 8
(const byte*) plots_x[]  = { (byte) $3c, (byte) $50, (byte) $6e, (byte) $50, (byte) $3c, (byte) $28, (byte) $a, (byte) $28 }
(const byte*) plots_y[]  = { (byte) $a, (byte) $28, (byte) $3c, (byte) $50, (byte) $6e, (byte) $50, (byte) $3c, (byte) $28 }

reg byte x [ plots::i#2 plots::i#1 ]
reg byte x [ init_plot_tables::x#2 init_plot_tables::x#1 ]
reg byte y [ init_plot_tables::bits#3 init_plot_tables::bits#4 init_plot_tables::bits#1 ]
reg byte x [ init_plot_tables::y#2 init_plot_tables::y#1 ]
zp[1]:2 [ plot::y#0 ]
reg byte a [ plot::$6 ]
zp[2]:3 [ plot::plotter_x#1 plot::plotter_x#2 plot::plotter#0 init_screen::c#2 init_screen::c#1 ]
reg byte a [ plot::$7 ]
reg byte a [ plot::$8 ]
zp[2]:5 [ plot::plotter_y#1 plot::plotter_y#2 init_screen::b#2 init_screen::b#1 init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 ]
reg byte a [ plot::$9 ]
reg byte a [ plot::$5 ]
reg byte a [ init_plot_tables::$0 ]
zp[1]:7 [ init_plot_tables::$9 plot::x#0 ]
reg byte a [ init_plot_tables::$6 ]
reg byte a [ init_plot_tables::$7 ]
reg byte a [ init_plot_tables::$8 ]


FINAL ASSEMBLER
Score: 6531

  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .label BITMAP = $2000
  .label D011 = $d011
  .const BMM = $20
  .const DEN = $10
  .const RSEL = 8
  .label RASTER = $d012
  .label D018 = $d018
  .label BGCOL = $d020
  .label FGCOL = $d021
  .label SCREEN = $400
  .const plots_cnt = 8
  // @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: {
    // *BGCOL = 0
    // [4] *((const byte*) BGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta BGCOL
    // *FGCOL = 0
    // [5] *((const byte*) FGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 
    sta FGCOL
    // *D011 = BMM|DEN|RSEL|3
    // [6] *((const byte*) D011) ← (const byte) BMM|(const byte) DEN|(const byte) RSEL|(byte) 3 -- _deref_pbuc1=vbuc2 
    lda #BMM|DEN|RSEL|3
    sta D011
    // *D018 = (byte)(((word)SCREEN/$40)|((word)BITMAP/$400))
    // [7] *((const byte*) D018) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400 -- _deref_pbuc1=vbuc2 
    lda #SCREEN/$40|BITMAP/$400
    sta D018
    // init_screen()
    // [8] call init_screen 
    // [60] phi from main to init_screen [phi:main->init_screen]
    jsr init_screen
    // [9] phi from main to main::@3 [phi:main->main::@3]
    // main::@3
    // init_plot_tables()
    // [10] call init_plot_tables 
    // [35] phi from main::@3 to init_plot_tables [phi:main::@3->init_plot_tables]
    jsr init_plot_tables
    // main::@1
  __b1:
    // while (*RASTER!=$ff)
    // [11] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$ff
    cmp RASTER
    bne __b1
    // main::@2
    // (*BGCOL)++;
    // [12] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc BGCOL
    // plots()
    // [13] call plots 
    // [15] phi from main::@2 to plots [phi:main::@2->plots]
    jsr plots
    // main::@4
    // (*BGCOL)--;
    // [14] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 
    dec BGCOL
    jmp __b1
}
  // plots
plots: {
    // [16] phi from plots to plots::@1 [phi:plots->plots::@1]
    // [16] phi (byte) plots::i#2 = (byte) 0 [phi:plots->plots::@1#0] -- vbuxx=vbuc1 
    ldx #0
    // plots::@1
  __b1:
    // for(byte i=0; i<plots_cnt;i++)
    // [17] if((byte) plots::i#2<(const byte) plots_cnt) goto plots::@2 -- vbuxx_lt_vbuc1_then_la1 
    cpx #plots_cnt
    bcc __b2
    // plots::@return
    // }
    // [18] return 
    rts
    // plots::@2
  __b2:
    // plot(plots_x[i], plots_y[i])
    // [19] (byte) plot::x#0 ← *((const byte*) plots_x + (byte) plots::i#2) -- vbuz1=pbuc1_derefidx_vbuxx 
    lda plots_x,x
    sta.z plot.x
    // [20] (byte) plot::y#0 ← *((const byte*) plots_y + (byte) plots::i#2) -- vbuz1=pbuc1_derefidx_vbuxx 
    lda plots_y,x
    sta.z plot.y
    // [21] call plot 
    jsr plot
    // plots::@3
    // for(byte i=0; i<plots_cnt;i++)
    // [22] (byte) plots::i#1 ← ++ (byte) plots::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [16] phi from plots::@3 to plots::@1 [phi:plots::@3->plots::@1]
    // [16] phi (byte) plots::i#2 = (byte) plots::i#1 [phi:plots::@3->plots::@1#0] -- register_copy 
    jmp __b1
}
  // plot
// plot(byte zp(7) x, byte zp(2) y)
plot: {
    .label x = 7
    .label y = 2
    .label plotter_x = 3
    .label plotter_y = 5
    .label plotter = 3
    // >plotter_x = plot_xhi[x]
    // [23] (byte~) plot::$6 ← *((const byte*) plot_xhi + (byte) plot::x#0) -- vbuaa=pbuc1_derefidx_vbuz1 
    ldy.z x
    lda plot_xhi,y
    // [24] (byte*) plot::plotter_x#1 ← (byte*) 0 hi= (byte~) plot::$6 -- pbuz1=pbuc1_sethi_vbuaa 
    sta.z plotter_x+1
    lda #<0
    sta.z plotter_x
    // <plotter_x = plot_xlo[x]
    // [25] (byte~) plot::$7 ← *((const byte*) plot_xlo + (byte) plot::x#0) -- vbuaa=pbuc1_derefidx_vbuz1 
    lda plot_xlo,y
    // [26] (byte*) plot::plotter_x#2 ← (byte*) plot::plotter_x#1 lo= (byte~) plot::$7 -- pbuz1=pbuz1_setlo_vbuaa 
    sta.z plotter_x
    // >plotter_y = plot_yhi[y]
    // [27] (byte~) plot::$8 ← *((const byte*) plot_yhi + (byte) plot::y#0) -- vbuaa=pbuc1_derefidx_vbuz1 
    ldy.z y
    lda plot_yhi,y
    // [28] (word) plot::plotter_y#1 ← (word) 0 hi= (byte~) plot::$8 -- vwuz1=vwuc1_sethi_vbuaa 
    sta.z plotter_y+1
    lda #<0
    sta.z plotter_y
    // <plotter_y = plot_ylo[y]
    // [29] (byte~) plot::$9 ← *((const byte*) plot_ylo + (byte) plot::y#0) -- vbuaa=pbuc1_derefidx_vbuz1 
    lda plot_ylo,y
    // [30] (word) plot::plotter_y#2 ← (word) plot::plotter_y#1 lo= (byte~) plot::$9 -- vwuz1=vwuz1_setlo_vbuaa 
    sta.z plotter_y
    // plotter = plotter_x+plotter_y
    // [31] (byte*) plot::plotter#0 ← (byte*) plot::plotter_x#2 + (word) plot::plotter_y#2 -- pbuz1=pbuz1_plus_vwuz2 
    lda.z plotter
    clc
    adc.z plotter_y
    sta.z plotter
    lda.z plotter+1
    adc.z plotter_y+1
    sta.z plotter+1
    // *plotter | plot_bit[x]
    // [32] (byte~) plot::$5 ← *((byte*) plot::plotter#0) | *((const byte*) plot_bit + (byte) plot::x#0) -- vbuaa=_deref_pbuz1_bor_pbuc1_derefidx_vbuz2 
    ldy #0
    lda (plotter),y
    ldy.z x
    ora plot_bit,y
    // *plotter = *plotter | plot_bit[x]
    // [33] *((byte*) plot::plotter#0) ← (byte~) plot::$5 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (plotter),y
    // plot::@return
    // }
    // [34] return 
    rts
}
  // init_plot_tables
init_plot_tables: {
    .label __9 = 7
    .label yoffs = 5
    // [36] phi from init_plot_tables to init_plot_tables::@1 [phi:init_plot_tables->init_plot_tables::@1]
    // [36] phi (byte) init_plot_tables::bits#3 = (byte) $80 [phi:init_plot_tables->init_plot_tables::@1#0] -- vbuyy=vbuc1 
    ldy #$80
    // [36] phi (byte) init_plot_tables::x#2 = (byte) 0 [phi:init_plot_tables->init_plot_tables::@1#1] -- vbuxx=vbuc1 
    ldx #0
    // [36] phi from init_plot_tables::@2 to init_plot_tables::@1 [phi:init_plot_tables::@2->init_plot_tables::@1]
    // [36] phi (byte) init_plot_tables::bits#3 = (byte) init_plot_tables::bits#4 [phi:init_plot_tables::@2->init_plot_tables::@1#0] -- register_copy 
    // [36] phi (byte) init_plot_tables::x#2 = (byte) init_plot_tables::x#1 [phi:init_plot_tables::@2->init_plot_tables::@1#1] -- register_copy 
    // init_plot_tables::@1
  __b1:
    // x&$f8
    // [37] (byte~) init_plot_tables::$0 ← (byte) init_plot_tables::x#2 & (byte) $f8 -- vbuaa=vbuxx_band_vbuc1 
    txa
    and #$f8
    // plot_xlo[x] = x&$f8
    // [38] *((const byte*) plot_xlo + (byte) init_plot_tables::x#2) ← (byte~) init_plot_tables::$0 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta plot_xlo,x
    // plot_xhi[x] = >BITMAP
    // [39] *((const byte*) plot_xhi + (byte) init_plot_tables::x#2) ← >(const byte*) BITMAP -- pbuc1_derefidx_vbuxx=vbuc2 
    lda #>BITMAP
    sta plot_xhi,x
    // plot_bit[x] = bits
    // [40] *((const byte*) plot_bit + (byte) init_plot_tables::x#2) ← (byte) init_plot_tables::bits#3 -- pbuc1_derefidx_vbuxx=vbuyy 
    tya
    sta plot_bit,x
    // bits = bits/2
    // [41] (byte) init_plot_tables::bits#1 ← (byte) init_plot_tables::bits#3 >> (byte) 1 -- vbuyy=vbuyy_ror_1 
    tya
    lsr
    tay
    // if(bits==0)
    // [42] if((byte) init_plot_tables::bits#1!=(byte) 0) goto init_plot_tables::@6 -- vbuyy_neq_0_then_la1 
    cpy #0
    bne __b2
    // [44] phi from init_plot_tables::@1 to init_plot_tables::@2 [phi:init_plot_tables::@1->init_plot_tables::@2]
    // [44] phi (byte) init_plot_tables::bits#4 = (byte) $80 [phi:init_plot_tables::@1->init_plot_tables::@2#0] -- vbuyy=vbuc1 
    ldy #$80
    // [43] phi from init_plot_tables::@1 to init_plot_tables::@6 [phi:init_plot_tables::@1->init_plot_tables::@6]
    // init_plot_tables::@6
    // [44] phi from init_plot_tables::@6 to init_plot_tables::@2 [phi:init_plot_tables::@6->init_plot_tables::@2]
    // [44] phi (byte) init_plot_tables::bits#4 = (byte) init_plot_tables::bits#1 [phi:init_plot_tables::@6->init_plot_tables::@2#0] -- register_copy 
    // init_plot_tables::@2
  __b2:
    // for(byte x : 0..255)
    // [45] (byte) init_plot_tables::x#1 ← ++ (byte) init_plot_tables::x#2 -- vbuxx=_inc_vbuxx 
    inx
    // [46] if((byte) init_plot_tables::x#1!=(byte) 0) goto init_plot_tables::@1 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne __b1
    // [47] phi from init_plot_tables::@2 to init_plot_tables::@3 [phi:init_plot_tables::@2->init_plot_tables::@3]
    // [47] phi (byte*) init_plot_tables::yoffs#2 = (byte*) 0 [phi:init_plot_tables::@2->init_plot_tables::@3#0] -- pbuz1=pbuc1 
    lda #<0
    sta.z yoffs
    sta.z yoffs+1
    // [47] phi (byte) init_plot_tables::y#2 = (byte) 0 [phi:init_plot_tables::@2->init_plot_tables::@3#1] -- vbuxx=vbuc1 
    tax
    // [47] phi from init_plot_tables::@4 to init_plot_tables::@3 [phi:init_plot_tables::@4->init_plot_tables::@3]
    // [47] phi (byte*) init_plot_tables::yoffs#2 = (byte*) init_plot_tables::yoffs#4 [phi:init_plot_tables::@4->init_plot_tables::@3#0] -- register_copy 
    // [47] phi (byte) init_plot_tables::y#2 = (byte) init_plot_tables::y#1 [phi:init_plot_tables::@4->init_plot_tables::@3#1] -- register_copy 
    // init_plot_tables::@3
  __b3:
    // y&$7
    // [48] (byte~) init_plot_tables::$9 ← (byte) init_plot_tables::y#2 & (byte) 7 -- vbuz1=vbuxx_band_vbuc1 
    lda #7
    sax.z __9
    // <yoffs
    // [49] (byte~) init_plot_tables::$6 ← < (byte*) init_plot_tables::yoffs#2 -- vbuaa=_lo_pbuz1 
    lda.z yoffs
    // y&$7 | <yoffs
    // [50] (byte~) init_plot_tables::$7 ← (byte~) init_plot_tables::$9 | (byte~) init_plot_tables::$6 -- vbuaa=vbuz1_bor_vbuaa 
    ora.z __9
    // plot_ylo[y] = y&$7 | <yoffs
    // [51] *((const byte*) plot_ylo + (byte) init_plot_tables::y#2) ← (byte~) init_plot_tables::$7 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta plot_ylo,x
    // >yoffs
    // [52] (byte~) init_plot_tables::$8 ← > (byte*) init_plot_tables::yoffs#2 -- vbuaa=_hi_pbuz1 
    lda.z yoffs+1
    // plot_yhi[y] = >yoffs
    // [53] *((const byte*) plot_yhi + (byte) init_plot_tables::y#2) ← (byte~) init_plot_tables::$8 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta plot_yhi,x
    // if((y&$7)==7)
    // [54] if((byte~) init_plot_tables::$9!=(byte) 7) goto init_plot_tables::@4 -- vbuz1_neq_vbuc1_then_la1 
    lda #7
    cmp.z __9
    bne __b4
    // init_plot_tables::@5
    // yoffs = yoffs + 40*8
    // [55] (byte*) init_plot_tables::yoffs#1 ← (byte*) init_plot_tables::yoffs#2 + (word)(number) $28*(number) 8 -- pbuz1=pbuz1_plus_vwuc1 
    clc
    lda.z yoffs
    adc #<$28*8
    sta.z yoffs
    lda.z yoffs+1
    adc #>$28*8
    sta.z yoffs+1
    // [56] phi from init_plot_tables::@3 init_plot_tables::@5 to init_plot_tables::@4 [phi:init_plot_tables::@3/init_plot_tables::@5->init_plot_tables::@4]
    // [56] phi (byte*) init_plot_tables::yoffs#4 = (byte*) init_plot_tables::yoffs#2 [phi:init_plot_tables::@3/init_plot_tables::@5->init_plot_tables::@4#0] -- register_copy 
    // init_plot_tables::@4
  __b4:
    // for(byte y : 0..255)
    // [57] (byte) init_plot_tables::y#1 ← ++ (byte) init_plot_tables::y#2 -- vbuxx=_inc_vbuxx 
    inx
    // [58] if((byte) init_plot_tables::y#1!=(byte) 0) goto init_plot_tables::@3 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne __b3
    // init_plot_tables::@return
    // }
    // [59] return 
    rts
}
  // init_screen
init_screen: {
    .label b = 5
    .label c = 3
    // [61] phi from init_screen to init_screen::@1 [phi:init_screen->init_screen::@1]
    // [61] phi (byte*) init_screen::b#2 = (const byte*) BITMAP [phi:init_screen->init_screen::@1#0] -- pbuz1=pbuc1 
    lda #<BITMAP
    sta.z b
    lda #>BITMAP
    sta.z b+1
    // init_screen::@1
  __b1:
    // for(byte* b = BITMAP; b!=BITMAP+$2000; b++)
    // [62] if((byte*) init_screen::b#2!=(const byte*) BITMAP+(word) $2000) goto init_screen::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda.z b+1
    cmp #>BITMAP+$2000
    bne __b2
    lda.z b
    cmp #<BITMAP+$2000
    bne __b2
    // [63] phi from init_screen::@1 to init_screen::@3 [phi:init_screen::@1->init_screen::@3]
    // [63] phi (byte*) init_screen::c#2 = (const byte*) SCREEN [phi:init_screen::@1->init_screen::@3#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z c
    lda #>SCREEN
    sta.z c+1
    // init_screen::@3
  __b3:
    // for(byte* c = SCREEN; c!=SCREEN+$400;c++)
    // [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN+(word) $400) goto init_screen::@4 -- pbuz1_neq_pbuc1_then_la1 
    lda.z c+1
    cmp #>SCREEN+$400
    bne __b4
    lda.z c
    cmp #<SCREEN+$400
    bne __b4
    // init_screen::@return
    // }
    // [65] return 
    rts
    // init_screen::@4
  __b4:
    // *c = $14
    // [66] *((byte*) init_screen::c#2) ← (byte) $14 -- _deref_pbuz1=vbuc1 
    lda #$14
    ldy #0
    sta (c),y
    // for(byte* c = SCREEN; c!=SCREEN+$400;c++)
    // [67] (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#2 -- pbuz1=_inc_pbuz1 
    inc.z c
    bne !+
    inc.z c+1
  !:
    // [63] phi from init_screen::@4 to init_screen::@3 [phi:init_screen::@4->init_screen::@3]
    // [63] phi (byte*) init_screen::c#2 = (byte*) init_screen::c#1 [phi:init_screen::@4->init_screen::@3#0] -- register_copy 
    jmp __b3
    // init_screen::@2
  __b2:
    // *b = 0
    // [68] *((byte*) init_screen::b#2) ← (byte) 0 -- _deref_pbuz1=vbuc1 
    lda #0
    tay
    sta (b),y
    // for(byte* b = BITMAP; b!=BITMAP+$2000; b++)
    // [69] (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#2 -- pbuz1=_inc_pbuz1 
    inc.z b
    bne !+
    inc.z b+1
  !:
    // [61] phi from init_screen::@2 to init_screen::@1 [phi:init_screen::@2->init_screen::@1]
    // [61] phi (byte*) init_screen::b#2 = (byte*) init_screen::b#1 [phi:init_screen::@2->init_screen::@1#0] -- register_copy 
    jmp __b1
}
  // File Data
  plots_x: .byte $3c, $50, $6e, $50, $3c, $28, $a, $28
  plots_y: .byte $a, $28, $3c, $50, $6e, $50, $3c, $28
  plot_xlo: .fill $100, 0
  plot_xhi: .fill $100, 0
  plot_ylo: .fill $100, 0
  plot_yhi: .fill $100, 0
  plot_bit: .fill $100, 0

