Inlined call call __init
Eliminating unused variable with no statement plot::$4

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start::@1
  *BG_COLOR = 0
  *FGCOL = 0
  main::$0 = BMM | DEN
  main::$1 = main::$0 | RSEL
  main::$2 = main::$1 | 3
  *D011 = main::$2
  main::$11 = (unsigned int)SCREEN
  main::$3 = main::$11 / $40
  main::$4 = main::$3 | (unsigned int)BITMAP/$400
  *D018 = (char)main::$4
  call init_screen
  to:main::@3
main::@3: scope:[main]  from main
  call init_plot_tables
  to:main::@4
main::@4: scope:[main]  from main::@3
  to:main::@1
main::@1: scope:[main]  from main::@1 main::@4 main::@5
  main::$7 = *RASTER != $ff
  if(main::$7) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@1
  *BG_COLOR = ++ *BG_COLOR
  call plots
  to:main::@5
main::@5: scope:[main]  from main::@2
  *BG_COLOR = -- *BG_COLOR
  if(true) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@5
  return 
  to:@return

void plots()
plots: scope:[plots]  from main::@2
  plots::i#0 = 0
  to:plots::@1
plots::@1: scope:[plots]  from plots plots::@3
  plots::i#2 = phi( plots/plots::i#0, plots::@3/plots::i#1 )
  plots::$0 = plots::i#2 < plots_cnt
  if(plots::$0) goto plots::@2
  to:plots::@return
plots::@2: scope:[plots]  from plots::@1
  plots::i#3 = phi( plots::@1/plots::i#2 )
  plot::x#0 = plots_x[plots::i#3]
  plot::y#0 = plots_y[plots::i#3]
  call plot
  to:plots::@3
plots::@3: scope:[plots]  from plots::@2
  plots::i#4 = phi( plots::@2/plots::i#3 )
  plots::i#1 = ++ plots::i#4
  to:plots::@1
plots::@return: scope:[plots]  from plots::@1
  return 
  to:@return

void plot(char x , char y)
plot: scope:[plot]  from plots::@2
  plot::y#1 = phi( plots::@2/plot::y#0 )
  plot::x#1 = phi( plots::@2/plot::x#0 )
  plot::plotter_x#0 = (char *)0
  plot::plotter_y#0 = 0
  plot::$6 = plot_xhi[plot::x#1]
  plot::plotter_x#1 = plot::plotter_x#0 byte1= plot::$6
  plot::$7 = plot_xlo[plot::x#1]
  plot::plotter_x#2 = plot::plotter_x#1 byte0= plot::$7
  plot::$8 = plot_yhi[plot::y#1]
  plot::plotter_y#1 = plot::plotter_y#0 byte1= plot::$8
  plot::$9 = plot_ylo[plot::y#1]
  plot::plotter_y#2 = plot::plotter_y#1 byte0= plot::$9
  plot::plotter#0 = plot::plotter_x#2 + plot::plotter_y#2
  plot::$5 = *plot::plotter#0 | plot_bit[plot::x#1]
  *plot::plotter#0 = 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::@3
  init_plot_tables::bits#0 = $80
  init_plot_tables::x#0 = 0
  to:init_plot_tables::@1
init_plot_tables::@1: scope:[init_plot_tables]  from init_plot_tables init_plot_tables::@2
  init_plot_tables::bits#3 = phi( init_plot_tables/init_plot_tables::bits#0, init_plot_tables::@2/init_plot_tables::bits#4 )
  init_plot_tables::x#2 = phi( init_plot_tables/init_plot_tables::x#0, init_plot_tables::@2/init_plot_tables::x#1 )
  init_plot_tables::$0 = init_plot_tables::x#2 & $f8
  plot_xlo[init_plot_tables::x#2] = init_plot_tables::$0
  plot_xhi[init_plot_tables::x#2] = byte1 BITMAP
  plot_bit[init_plot_tables::x#2] = init_plot_tables::bits#3
  init_plot_tables::$1 = init_plot_tables::bits#3 / 2
  init_plot_tables::bits#1 = init_plot_tables::$1
  init_plot_tables::$2 = init_plot_tables::bits#1 == 0
  init_plot_tables::$3 = ! init_plot_tables::$2
  if(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
  init_plot_tables::bits#4 = phi( init_plot_tables::@1/init_plot_tables::bits#1, init_plot_tables::@3/init_plot_tables::bits#2 )
  init_plot_tables::x#3 = phi( init_plot_tables::@1/init_plot_tables::x#2, init_plot_tables::@3/init_plot_tables::x#4 )
  init_plot_tables::x#1 = init_plot_tables::x#3 + rangenext(0,$ff)
  init_plot_tables::$4 = init_plot_tables::x#1 != rangelast(0,$ff)
  if(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
  init_plot_tables::x#4 = phi( init_plot_tables::@1/init_plot_tables::x#2 )
  init_plot_tables::bits#2 = $80
  to:init_plot_tables::@2
init_plot_tables::@4: scope:[init_plot_tables]  from init_plot_tables::@2
  init_plot_tables::yoffs#0 = (char *)0
  init_plot_tables::y#0 = 0
  to:init_plot_tables::@5
init_plot_tables::@5: scope:[init_plot_tables]  from init_plot_tables::@4 init_plot_tables::@6
  init_plot_tables::yoffs#2 = phi( init_plot_tables::@4/init_plot_tables::yoffs#0, init_plot_tables::@6/init_plot_tables::yoffs#4 )
  init_plot_tables::y#2 = phi( init_plot_tables::@4/init_plot_tables::y#0, init_plot_tables::@6/init_plot_tables::y#1 )
  init_plot_tables::$5 = init_plot_tables::y#2 & 7
  init_plot_tables::$6 = byte0  init_plot_tables::yoffs#2
  init_plot_tables::$7 = init_plot_tables::$5 | init_plot_tables::$6
  plot_ylo[init_plot_tables::y#2] = init_plot_tables::$7
  init_plot_tables::$8 = byte1  init_plot_tables::yoffs#2
  plot_yhi[init_plot_tables::y#2] = init_plot_tables::$8
  init_plot_tables::$9 = init_plot_tables::y#2 & 7
  init_plot_tables::$10 = init_plot_tables::$9 == 7
  init_plot_tables::$11 = ! init_plot_tables::$10
  if(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
  init_plot_tables::yoffs#4 = phi( init_plot_tables::@5/init_plot_tables::yoffs#2, init_plot_tables::@7/init_plot_tables::yoffs#1 )
  init_plot_tables::y#3 = phi( init_plot_tables::@5/init_plot_tables::y#2, init_plot_tables::@7/init_plot_tables::y#4 )
  init_plot_tables::y#1 = init_plot_tables::y#3 + rangenext(0,$ff)
  init_plot_tables::$13 = init_plot_tables::y#1 != rangelast(0,$ff)
  if(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
  init_plot_tables::y#4 = phi( init_plot_tables::@5/init_plot_tables::y#2 )
  init_plot_tables::yoffs#3 = phi( init_plot_tables::@5/init_plot_tables::yoffs#2 )
  init_plot_tables::$12 = init_plot_tables::yoffs#3 + $28*8
  init_plot_tables::yoffs#1 = 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
  init_screen::b#0 = BITMAP
  to:init_screen::@1
init_screen::@1: scope:[init_screen]  from init_screen init_screen::@2
  init_screen::b#2 = phi( init_screen/init_screen::b#0, init_screen::@2/init_screen::b#1 )
  init_screen::$0 = init_screen::b#2 != BITMAP+$2000
  if(init_screen::$0) goto init_screen::@2
  to:init_screen::@3
init_screen::@2: scope:[init_screen]  from init_screen::@1
  init_screen::b#3 = phi( init_screen::@1/init_screen::b#2 )
  *init_screen::b#3 = 0
  init_screen::b#1 = ++ init_screen::b#3
  to:init_screen::@1
init_screen::@3: scope:[init_screen]  from init_screen::@1
  init_screen::c#0 = SCREEN
  to:init_screen::@4
init_screen::@4: scope:[init_screen]  from init_screen::@3 init_screen::@5
  init_screen::c#2 = phi( init_screen::@3/init_screen::c#0, init_screen::@5/init_screen::c#1 )
  init_screen::$1 = SCREEN + $400
  init_screen::$2 = init_screen::c#2 != init_screen::$1
  if(init_screen::$2) goto init_screen::@5
  to:init_screen::@return
init_screen::@5: scope:[init_screen]  from init_screen::@4
  init_screen::c#3 = phi( init_screen::@4/init_screen::c#2 )
  *init_screen::c#3 = $14
  init_screen::c#1 = ++ init_screen::c#3
  to:init_screen::@4
init_screen::@return: scope:[init_screen]  from init_screen::@4
  return 
  to:@return

void __start()
__start: scope:[__start]  from
  to:__start::__init1
__start::__init1: scope:[__start]  from __start
  to:__start::@1
__start::@1: scope:[__start]  from __start::__init1
  call main
  to:__start::@2
__start::@2: scope:[__start]  from __start::@1
  to:__start::@return
__start::@return: scope:[__start]  from __start::@2
  return 
  to:@return

SYMBOL TABLE SSA
__constant char *BG_COLOR = (char *)$d020
__constant char * const BITMAP = (char *)$2000
__constant char BMM = $20
__constant char *D011 = (char *)$d011
__constant char *D018 = (char *)$d018
__constant char DEN = $10
__constant char *FGCOL = (char *)$d021
__constant char *RASTER = (char *)$d012
__constant char RSEL = 8
__constant char *SCREEN = (char *)$400
void __start()
void init_plot_tables()
number init_plot_tables::$0
number init_plot_tables::$1
bool init_plot_tables::$10
bool init_plot_tables::$11
char *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
char init_plot_tables::$6
number init_plot_tables::$7
char init_plot_tables::$8
number init_plot_tables::$9
char init_plot_tables::bits
char init_plot_tables::bits#0
char init_plot_tables::bits#1
char init_plot_tables::bits#2
char init_plot_tables::bits#3
char init_plot_tables::bits#4
char init_plot_tables::x
char init_plot_tables::x#0
char init_plot_tables::x#1
char init_plot_tables::x#2
char init_plot_tables::x#3
char init_plot_tables::x#4
char init_plot_tables::y
char init_plot_tables::y#0
char init_plot_tables::y#1
char init_plot_tables::y#2
char init_plot_tables::y#3
char init_plot_tables::y#4
char *init_plot_tables::yoffs
char *init_plot_tables::yoffs#0
char *init_plot_tables::yoffs#1
char *init_plot_tables::yoffs#2
char *init_plot_tables::yoffs#3
char *init_plot_tables::yoffs#4
void init_screen()
bool init_screen::$0
char *init_screen::$1
bool init_screen::$2
char *init_screen::b
char *init_screen::b#0
char *init_screen::b#1
char *init_screen::b#2
char *init_screen::b#3
char *init_screen::c
char *init_screen::c#0
char *init_screen::c#1
char *init_screen::c#2
char *init_screen::c#3
void main()
char main::$0
char main::$1
unsigned int main::$11
number main::$2
number main::$3
number main::$4
bool main::$7
void plot(char x , char y)
char plot::$5
char plot::$6
char plot::$7
char plot::$8
char plot::$9
char *plot::plotter
char *plot::plotter#0
char *plot::plotter_x
char *plot::plotter_x#0
char *plot::plotter_x#1
char *plot::plotter_x#2
unsigned int plot::plotter_y
unsigned int plot::plotter_y#0
unsigned int plot::plotter_y#1
unsigned int plot::plotter_y#2
char plot::x
char plot::x#0
char plot::x#1
char plot::y
char plot::y#0
char plot::y#1
__constant const char plot_bit[$100] = { fill( $100, 0) }
__constant const char plot_xhi[$100] = { fill( $100, 0) }
__constant const char plot_xlo[$100] = { fill( $100, 0) }
__constant const char plot_yhi[$100] = { fill( $100, 0) }
__constant const char plot_ylo[$100] = { fill( $100, 0) }
void plots()
bool plots::$0
char plots::i
char plots::i#0
char plots::i#1
char plots::i#2
char plots::i#3
char plots::i#4
__constant char plots_cnt = 8
__constant char plots_x[] = { $3c, $50, $6e, $50, $3c, $28, $a, $28 }
__constant char plots_y[] = { $a, $28, $3c, $50, $6e, $50, $3c, $28 }

Adding number conversion cast (unumber) 0 in *BG_COLOR = 0
Adding number conversion cast (unumber) 0 in *FGCOL = 0
Adding number conversion cast (unumber) 3 in main::$2 = main::$1 | 3
Adding number conversion cast (unumber) main::$2 in main::$2 = main::$1 | (unumber)3
Adding number conversion cast (unumber) $40 in main::$3 = main::$11 / $40
Adding number conversion cast (unumber) main::$3 in main::$3 = main::$11 / (unumber)$40
Adding number conversion cast (unumber) (unsigned int)BITMAP/$400 in main::$4 = main::$3 | (unsigned int)BITMAP/$400
Adding number conversion cast (unumber) main::$4 in main::$4 = main::$3 | (unumber)(unsigned int)BITMAP/$400
Adding number conversion cast (unumber) $400 in main::$4 = main::$3 | (unumber)(unsigned int)BITMAP/$400
Adding number conversion cast (unumber) $ff in main::$7 = *RASTER != $ff
Adding number conversion cast (unumber) $f8 in init_plot_tables::$0 = init_plot_tables::x#2 & $f8
Adding number conversion cast (unumber) init_plot_tables::$0 in init_plot_tables::$0 = init_plot_tables::x#2 & (unumber)$f8
Adding number conversion cast (unumber) 2 in init_plot_tables::$1 = init_plot_tables::bits#3 / 2
Adding number conversion cast (unumber) init_plot_tables::$1 in init_plot_tables::$1 = init_plot_tables::bits#3 / (unumber)2
Adding number conversion cast (unumber) 0 in init_plot_tables::$2 = init_plot_tables::bits#1 == 0
Adding number conversion cast (unumber) $80 in init_plot_tables::bits#2 = $80
Adding number conversion cast (unumber) 7 in init_plot_tables::$5 = init_plot_tables::y#2 & 7
Adding number conversion cast (unumber) init_plot_tables::$5 in init_plot_tables::$5 = init_plot_tables::y#2 & (unumber)7
Adding number conversion cast (unumber) init_plot_tables::$7 in init_plot_tables::$7 = init_plot_tables::$5 | init_plot_tables::$6
Adding number conversion cast (unumber) 7 in init_plot_tables::$9 = init_plot_tables::y#2 & 7
Adding number conversion cast (unumber) init_plot_tables::$9 in init_plot_tables::$9 = init_plot_tables::y#2 & (unumber)7
Adding number conversion cast (unumber) 7 in init_plot_tables::$10 = init_plot_tables::$9 == 7
Adding number conversion cast (unumber) $28*8 in init_plot_tables::$12 = init_plot_tables::yoffs#3 + $28*8
Adding number conversion cast (unumber) $2000 in init_screen::$0 = init_screen::b#2 != BITMAP+$2000
Adding number conversion cast (unumber) 0 in *init_screen::b#3 = 0
Adding number conversion cast (unumber) $400 in init_screen::$1 = SCREEN + $400
Adding number conversion cast (unumber) $14 in *init_screen::c#3 = $14
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast *BG_COLOR = (unumber)0
Inlining cast *FGCOL = (unumber)0
Inlining cast init_plot_tables::bits#2 = (unumber)$80
Inlining cast *init_screen::b#3 = (unumber)0
Inlining cast *init_screen::c#3 = (unumber)$14
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (char *) 8192
Simplifying constant pointer cast (char *) 53265
Simplifying constant pointer cast (char *) 53266
Simplifying constant pointer cast (char *) 53272
Simplifying constant pointer cast (char *) 53280
Simplifying constant pointer cast (char *) 53281
Simplifying constant pointer cast (char *) 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 (unsigned int)BITMAP/(unumber)$400
Simplifying constant integer cast $400
Simplifying constant integer cast $ff
Simplifying constant pointer cast (char *) 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 (char *) 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 (char) 0
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 3
Finalized unsigned number type (char) $40
Finalized unsigned number type (unsigned int) $400
Finalized unsigned number type (char) $ff
Finalized unsigned number type (char) $f8
Finalized unsigned number type (char) 2
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) $80
Finalized unsigned number type (char) 7
Finalized unsigned number type (char) 7
Finalized unsigned number type (char) 7
Finalized unsigned number type (unsigned int) $2000
Finalized unsigned number type (char) 0
Finalized unsigned number type (unsigned int) $400
Finalized unsigned number type (char) $14
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to char in main::$2 = main::$1 | 3
Inferred type updated to unsigned int in main::$3 = main::$11 / $40
Inferred type updated to unsigned int in main::$4 = main::$3 | (unsigned int)BITMAP/$400
Inferred type updated to char in init_plot_tables::$0 = init_plot_tables::x#2 & $f8
Inferred type updated to char in init_plot_tables::$1 = init_plot_tables::bits#3 / 2
Inferred type updated to char in init_plot_tables::$5 = init_plot_tables::y#2 & 7
Inferred type updated to char in init_plot_tables::$7 = init_plot_tables::$5 | init_plot_tables::$6
Inferred type updated to char in init_plot_tables::$9 = init_plot_tables::y#2 & 7
Inversing boolean not [55] init_plot_tables::$3 = init_plot_tables::bits#1 != 0 from [54] init_plot_tables::$2 = init_plot_tables::bits#1 == 0
Inversing boolean not [74] init_plot_tables::$11 = init_plot_tables::$9 != 7 from [73] init_plot_tables::$10 = init_plot_tables::$9 == 7
Successful SSA optimization Pass2UnaryNotSimplification
Alias plots::i#2 = plots::i#3 plots::i#4 
Alias init_plot_tables::bits#1 = init_plot_tables::$1 
Alias init_plot_tables::x#2 = init_plot_tables::x#4 
Alias init_plot_tables::yoffs#2 = init_plot_tables::yoffs#3 
Alias init_plot_tables::y#2 = init_plot_tables::y#4 
Alias init_plot_tables::yoffs#1 = init_plot_tables::$12 
Alias init_screen::b#2 = init_screen::b#3 
Alias init_screen::c#2 = init_screen::c#3 
Successful SSA optimization Pass2AliasElimination
Alias init_plot_tables::x#2 = init_plot_tables::x#3 
Alias init_plot_tables::y#2 = init_plot_tables::y#3 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values plot::x#1 plot::x#0
Identical Phi Values plot::y#1 plot::y#0
Successful SSA optimization Pass2IdenticalPhiElimination
Identified duplicate assignment right side [72] init_plot_tables::$9 = init_plot_tables::y#2 & 7
Successful SSA optimization Pass2DuplicateRValueIdentification
Simple Condition main::$7 [13] if(*RASTER!=$ff) goto main::@1
Simple Condition plots::$0 [22] if(plots::i#2<plots_cnt) goto plots::@2
Simple Condition init_plot_tables::$3 [52] if(init_plot_tables::bits#1!=0) goto init_plot_tables::@2
Simple Condition init_plot_tables::$4 [56] if(init_plot_tables::x#1!=rangelast(0,$ff)) goto init_plot_tables::@1
Simple Condition init_plot_tables::$11 [69] if(init_plot_tables::$9!=7) goto init_plot_tables::@6
Simple Condition init_plot_tables::$13 [73] if(init_plot_tables::y#1!=rangelast(0,$ff)) goto init_plot_tables::@5
Simple Condition init_screen::$0 [79] if(init_screen::b#2!=BITMAP+$2000) goto init_screen::@2
Simple Condition init_screen::$2 [86] if(init_screen::c#2!=init_screen::$1) goto init_screen::@5
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [2] main::$0 = BMM | DEN
Constant right-side identified [6] main::$11 = (unsigned int)SCREEN
Constant right-side identified [84] init_screen::$1 = SCREEN + $400
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant main::$0 = BMM|DEN
Constant main::$11 = (unsigned int)SCREEN
Constant plots::i#0 = 0
Constant plot::plotter_x#0 = (char *) 0
Constant plot::plotter_y#0 = 0
Constant init_plot_tables::bits#0 = $80
Constant init_plot_tables::x#0 = 0
Constant init_plot_tables::bits#2 = $80
Constant init_plot_tables::yoffs#0 = (char *) 0
Constant init_plot_tables::y#0 = 0
Constant init_screen::b#0 = BITMAP
Constant init_screen::c#0 = SCREEN
Constant init_screen::$1 = SCREEN+$400
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [17] if(true) goto main::@1
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [54] init_plot_tables::x#1 = ++ init_plot_tables::x#2 to ++
Resolved ranged comparison value [56] if(init_plot_tables::x#1!=rangelast(0,$ff)) goto init_plot_tables::@1 to 0
Resolved ranged next value [71] init_plot_tables::y#1 = ++ init_plot_tables::y#2 to ++
Resolved ranged comparison value [73] if(init_plot_tables::y#1!=rangelast(0,$ff)) goto init_plot_tables::@5 to 0
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::__init1
Removing unused procedure block __start::@1
Removing unused procedure block __start::@2
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Adding number conversion cast (unumber) 0 in [42] if(init_plot_tables::x#1!=0) goto init_plot_tables::@1
Adding number conversion cast (unumber) 0 in [54] if(init_plot_tables::y#1!=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 (char) 0
Finalized unsigned number type (char) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias init_plot_tables::$9 = init_plot_tables::$5 
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [2] main::$1 = main::$0 | RSEL
Constant right-side identified [5] main::$3 = main::$11 / $40
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant main::$1 = main::$0|RSEL
Constant main::$3 = main::$11/$40
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [2] main::$2 = main::$1 | 3
Constant right-side identified [4] main::$4 = main::$3 | (unsigned int)BITMAP/$400
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant main::$2 = main::$1|3
Constant main::$4 = main::$3|(unsigned int)BITMAP/$400
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (char)main::$4 in [5] *D018 = (char)main::$4
Successful SSA optimization Pass2ConstantValues
Rewriting division to use shift [34] init_plot_tables::bits#1 = init_plot_tables::bits#3 / 2
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings plots::i#0
Inlining constant with var siblings plot::plotter_x#0
Inlining constant with var siblings plot::plotter_y#0
Inlining constant with var siblings init_plot_tables::bits#0
Inlining constant with var siblings init_plot_tables::x#0
Inlining constant with var siblings init_plot_tables::bits#2
Inlining constant with var siblings init_plot_tables::yoffs#0
Inlining constant with var siblings init_plot_tables::y#0
Inlining constant with var siblings init_screen::b#0
Inlining constant with var siblings init_screen::c#0
Constant inlined plots::i#0 = 0
Constant inlined init_plot_tables::bits#2 = $80
Constant inlined init_plot_tables::bits#0 = $80
Constant inlined plot::plotter_y#0 = 0
Constant inlined main::$11 = (unsigned int)SCREEN
Constant inlined plot::plotter_x#0 = (char *) 0
Constant inlined init_screen::$1 = SCREEN+$400
Constant inlined main::$1 = BMM|DEN|RSEL
Constant inlined main::$2 = BMM|DEN|RSEL|3
Constant inlined main::$0 = BMM|DEN
Constant inlined init_plot_tables::y#0 = 0
Constant inlined init_plot_tables::yoffs#0 = (char *) 0
Constant inlined main::$3 = (unsigned int)SCREEN/$40
Constant inlined main::$4 = (unsigned int)SCREEN/$40|(unsigned int)BITMAP/$400
Constant inlined init_plot_tables::x#0 = 0
Constant inlined init_screen::c#0 = SCREEN
Constant inlined init_screen::b#0 = BITMAP
Successful SSA optimization Pass2ConstantInlining
Finalized unsigned number type (unsigned int) $100
Finalized unsigned number type (unsigned int) $100
Finalized unsigned number type (unsigned int) $100
Finalized unsigned number type (unsigned int) $100
Finalized unsigned number type (unsigned int) $100
Finalized unsigned number type (unsigned int) $100
Finalized unsigned number type (unsigned int) $100
Finalized unsigned number type (unsigned int) $100
Finalized unsigned number type (unsigned int) $100
Finalized unsigned number type (unsigned int) $100
Finalized unsigned number type (char) $28
Finalized unsigned number type (char) 8
Successful SSA optimization PassNFinalizeNumberTypeConversions
Added new block during phi lifting init_plot_tables::@8(between init_plot_tables::@2 and init_plot_tables::@1)
Added new block during phi lifting init_plot_tables::@9(between init_plot_tables::@1 and init_plot_tables::@2)
Added new block during phi lifting init_plot_tables::@10(between init_plot_tables::@6 and init_plot_tables::@5)
Added new block during phi lifting init_plot_tables::@11(between init_plot_tables::@5 and init_plot_tables::@6)
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of main::@4
Adding NOP phi() at start of init_screen
Adding NOP phi() at start of init_screen::@3
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 plots
CALL GRAPH
Calls in [main] to init_screen:4 init_plot_tables:6 plots:10 
Calls in [plots] to plot:64 

Created 9 initial phi equivalence classes
Coalesced [21] init_screen::c#4 = init_screen::c#1
Coalesced [24] init_screen::b#4 = init_screen::b#1
Coalesced [47] init_plot_tables::yoffs#7 = init_plot_tables::yoffs#1
Coalesced [52] init_plot_tables::y#5 = init_plot_tables::y#1
Coalesced [53] init_plot_tables::yoffs#5 = init_plot_tables::yoffs#4
Coalesced (already) [54] init_plot_tables::yoffs#6 = init_plot_tables::yoffs#2
Coalesced [55] init_plot_tables::x#5 = init_plot_tables::x#1
Coalesced [56] init_plot_tables::bits#5 = init_plot_tables::bits#4
Coalesced [57] init_plot_tables::bits#6 = init_plot_tables::bits#1
Coalesced [66] plots::i#5 = plots::i#1
Coalesced down to 7 phi equivalence classes
Culled Empty Block label main::@4
Culled Empty Block label init_screen::@3
Culled Empty Block label init_plot_tables::@3
Culled Empty Block label init_plot_tables::@4
Culled Empty Block label init_plot_tables::@10
Culled Empty Block label init_plot_tables::@11
Culled Empty Block label init_plot_tables::@8
Renumbering block main::@5 to main::@4
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::@9 to init_plot_tables::@6
Renumbering block init_screen::@4 to init_screen::@3
Renumbering block init_screen::@5 to init_screen::@4
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of init_screen
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 plots

FINAL CONTROL FLOW GRAPH

void main()
main: scope:[main]  from
  [0] *BG_COLOR = 0
  [1] *FGCOL = 0
  [2] *D011 = BMM|DEN|RSEL|3
  [3] *D018 = (char)(unsigned int)SCREEN/$40|(unsigned int)BITMAP/$400
  [4] call init_screen
  to:main::@3
main::@3: scope:[main]  from main
  [5] phi()
  [6] call init_plot_tables
  to:main::@1
main::@1: scope:[main]  from main::@1 main::@3 main::@4
  [7] if(*RASTER!=$ff) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@1
  [8] *BG_COLOR = ++ *BG_COLOR
  [9] call plots
  to:main::@4
main::@4: scope:[main]  from main::@2
  [10] *BG_COLOR = -- *BG_COLOR
  to:main::@1

void init_screen()
init_screen: scope:[init_screen]  from main
  [11] phi()
  to:init_screen::@1
init_screen::@1: scope:[init_screen]  from init_screen init_screen::@2
  [12] init_screen::b#2 = phi( init_screen/BITMAP, init_screen::@2/init_screen::b#1 )
  [13] if(init_screen::b#2!=BITMAP+$2000) goto init_screen::@2
  to:init_screen::@3
init_screen::@3: scope:[init_screen]  from init_screen::@1 init_screen::@4
  [14] init_screen::c#2 = phi( init_screen::@1/SCREEN, init_screen::@4/init_screen::c#1 )
  [15] if(init_screen::c#2!=SCREEN+$400) goto init_screen::@4
  to:init_screen::@return
init_screen::@return: scope:[init_screen]  from init_screen::@3
  [16] return 
  to:@return
init_screen::@4: scope:[init_screen]  from init_screen::@3
  [17] *init_screen::c#2 = $14
  [18] init_screen::c#1 = ++ init_screen::c#2
  to:init_screen::@3
init_screen::@2: scope:[init_screen]  from init_screen::@1
  [19] *init_screen::b#2 = 0
  [20] init_screen::b#1 = ++ init_screen::b#2
  to:init_screen::@1

void init_plot_tables()
init_plot_tables: scope:[init_plot_tables]  from main::@3
  [21] phi()
  to:init_plot_tables::@1
init_plot_tables::@1: scope:[init_plot_tables]  from init_plot_tables init_plot_tables::@2
  [22] init_plot_tables::bits#3 = phi( init_plot_tables/$80, init_plot_tables::@2/init_plot_tables::bits#4 )
  [22] init_plot_tables::x#2 = phi( init_plot_tables/0, init_plot_tables::@2/init_plot_tables::x#1 )
  [23] init_plot_tables::$0 = init_plot_tables::x#2 & $f8
  [24] plot_xlo[init_plot_tables::x#2] = init_plot_tables::$0
  [25] plot_xhi[init_plot_tables::x#2] = byte1 BITMAP
  [26] plot_bit[init_plot_tables::x#2] = init_plot_tables::bits#3
  [27] init_plot_tables::bits#1 = init_plot_tables::bits#3 >> 1
  [28] if(init_plot_tables::bits#1!=0) goto init_plot_tables::@6
  to:init_plot_tables::@2
init_plot_tables::@6: scope:[init_plot_tables]  from init_plot_tables::@1
  [29] phi()
  to:init_plot_tables::@2
init_plot_tables::@2: scope:[init_plot_tables]  from init_plot_tables::@1 init_plot_tables::@6
  [30] init_plot_tables::bits#4 = phi( init_plot_tables::@6/init_plot_tables::bits#1, init_plot_tables::@1/$80 )
  [31] init_plot_tables::x#1 = ++ init_plot_tables::x#2
  [32] if(init_plot_tables::x#1!=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
  [33] init_plot_tables::yoffs#2 = phi( init_plot_tables::@2/(char *) 0, init_plot_tables::@4/init_plot_tables::yoffs#4 )
  [33] init_plot_tables::y#2 = phi( init_plot_tables::@2/0, init_plot_tables::@4/init_plot_tables::y#1 )
  [34] init_plot_tables::$9 = init_plot_tables::y#2 & 7
  [35] init_plot_tables::$6 = byte0  init_plot_tables::yoffs#2
  [36] init_plot_tables::$7 = init_plot_tables::$9 | init_plot_tables::$6
  [37] plot_ylo[init_plot_tables::y#2] = init_plot_tables::$7
  [38] init_plot_tables::$8 = byte1  init_plot_tables::yoffs#2
  [39] plot_yhi[init_plot_tables::y#2] = init_plot_tables::$8
  [40] if(init_plot_tables::$9!=7) goto init_plot_tables::@4
  to:init_plot_tables::@5
init_plot_tables::@5: scope:[init_plot_tables]  from init_plot_tables::@3
  [41] init_plot_tables::yoffs#1 = init_plot_tables::yoffs#2 + (unsigned int)$28*8
  to:init_plot_tables::@4
init_plot_tables::@4: scope:[init_plot_tables]  from init_plot_tables::@3 init_plot_tables::@5
  [42] init_plot_tables::yoffs#4 = phi( init_plot_tables::@3/init_plot_tables::yoffs#2, init_plot_tables::@5/init_plot_tables::yoffs#1 )
  [43] init_plot_tables::y#1 = ++ init_plot_tables::y#2
  [44] if(init_plot_tables::y#1!=0) goto init_plot_tables::@3
  to:init_plot_tables::@return
init_plot_tables::@return: scope:[init_plot_tables]  from init_plot_tables::@4
  [45] return 
  to:@return

void plots()
plots: scope:[plots]  from main::@2
  [46] phi()
  to:plots::@1
plots::@1: scope:[plots]  from plots plots::@3
  [47] plots::i#2 = phi( plots/0, plots::@3/plots::i#1 )
  [48] if(plots::i#2<plots_cnt) goto plots::@2
  to:plots::@return
plots::@return: scope:[plots]  from plots::@1
  [49] return 
  to:@return
plots::@2: scope:[plots]  from plots::@1
  [50] plot::x#0 = plots_x[plots::i#2]
  [51] plot::y#0 = plots_y[plots::i#2]
  [52] call plot
  to:plots::@3
plots::@3: scope:[plots]  from plots::@2
  [53] plots::i#1 = ++ plots::i#2
  to:plots::@1

void plot(char x , char y)
plot: scope:[plot]  from plots::@2
  [54] plot::$6 = plot_xhi[plot::x#0]
  [55] plot::plotter_x#1 = (char *) 0 byte1= plot::$6
  [56] plot::$7 = plot_xlo[plot::x#0]
  [57] plot::plotter_x#2 = plot::plotter_x#1 byte0= plot::$7
  [58] plot::$8 = plot_yhi[plot::y#0]
  [59] plot::plotter_y#1 = 0 byte1= plot::$8
  [60] plot::$9 = plot_ylo[plot::y#0]
  [61] plot::plotter_y#2 = plot::plotter_y#1 byte0= plot::$9
  [62] plot::plotter#0 = plot::plotter_x#2 + plot::plotter_y#2
  [63] plot::$5 = *plot::plotter#0 | plot_bit[plot::x#0]
  [64] *plot::plotter#0 = plot::$5
  to:plot::@return
plot::@return: scope:[plot]  from plot
  [65] return 
  to:@return


VARIABLE REGISTER WEIGHTS
void init_plot_tables()
char init_plot_tables::$0 // 202.0
char init_plot_tables::$6 // 202.0
char init_plot_tables::$7 // 202.0
char init_plot_tables::$8 // 202.0
char init_plot_tables::$9 // 50.5
char init_plot_tables::bits
char init_plot_tables::bits#1 // 101.0
char init_plot_tables::bits#3 // 60.599999999999994
char init_plot_tables::bits#4 // 67.33333333333333
char init_plot_tables::x
char init_plot_tables::x#1 // 151.5
char init_plot_tables::x#2 // 67.33333333333333
char init_plot_tables::y
char init_plot_tables::y#1 // 151.5
char init_plot_tables::y#2 // 50.5
char *init_plot_tables::yoffs
char *init_plot_tables::yoffs#1 // 202.0
char *init_plot_tables::yoffs#2 // 63.125
char *init_plot_tables::yoffs#4 // 101.0
void init_screen()
char *init_screen::b
char *init_screen::b#1 // 202.0
char *init_screen::b#2 // 134.66666666666666
char *init_screen::c
char *init_screen::c#1 // 202.0
char *init_screen::c#2 // 134.66666666666666
void main()
void plot(char x , char y)
char plot::$5 // 200002.0
char plot::$6 // 200002.0
char plot::$7 // 200002.0
char plot::$8 // 200002.0
char plot::$9 // 200002.0
char *plot::plotter
char *plot::plotter#0 // 150001.5
char *plot::plotter_x
char *plot::plotter_x#1 // 100001.0
char *plot::plotter_x#2 // 40000.4
unsigned int plot::plotter_y
unsigned int plot::plotter_y#1 // 100001.0
unsigned int plot::plotter_y#2 // 200002.0
char plot::x
char plot::x#0 // 28182.181818181816
char plot::y
char plot::y#0 // 30000.428571428572
void plots()
char plots::i
char plots::i#1 // 20002.0
char plots::i#2 // 10001.0

Initial phi equivalence classes
[ init_screen::b#2 init_screen::b#1 ]
[ init_screen::c#2 init_screen::c#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 ]
[ plots::i#2 plots::i#1 ]
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 ]
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 ]
Complete equivalence classes
[ init_screen::b#2 init_screen::b#1 ]
[ init_screen::c#2 init_screen::c#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 ]
[ plots::i#2 plots::i#1 ]
[ init_plot_tables::$0 ]
[ init_plot_tables::$9 ]
[ init_plot_tables::$6 ]
[ init_plot_tables::$7 ]
[ init_plot_tables::$8 ]
[ 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 ]
Allocated zp[1]:2 [ plot::$6 ]
Allocated zp[1]:3 [ plot::$7 ]
Allocated zp[1]:4 [ plot::$8 ]
Allocated zp[1]:5 [ plot::$9 ]
Allocated zp[2]:6 [ plot::plotter_y#2 ]
Allocated zp[1]:8 [ plot::$5 ]
Allocated zp[2]:9 [ plot::plotter#0 ]
Allocated zp[2]:11 [ plot::plotter_x#1 ]
Allocated zp[2]:13 [ plot::plotter_y#1 ]
Allocated zp[2]:15 [ plot::plotter_x#2 ]
Allocated zp[1]:17 [ plots::i#2 plots::i#1 ]
Allocated zp[1]:18 [ plot::y#0 ]
Allocated zp[1]:19 [ plot::x#0 ]
Allocated zp[2]:20 [ init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 ]
Allocated zp[2]:22 [ init_screen::b#2 init_screen::b#1 ]
Allocated zp[2]:24 [ init_screen::c#2 init_screen::c#1 ]
Allocated zp[1]:26 [ init_plot_tables::bits#3 init_plot_tables::bits#4 init_plot_tables::bits#1 ]
Allocated zp[1]:27 [ init_plot_tables::x#2 init_plot_tables::x#1 ]
Allocated zp[1]:28 [ init_plot_tables::y#2 init_plot_tables::y#1 ]
Allocated zp[1]:29 [ init_plot_tables::$0 ]
Allocated zp[1]:30 [ init_plot_tables::$6 ]
Allocated zp[1]:31 [ init_plot_tables::$7 ]
Allocated zp[1]:32 [ init_plot_tables::$8 ]
Allocated zp[1]:33 [ init_plot_tables::$9 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Equivalence Class zp[1]:30 [ init_plot_tables::$6 ] has ALU potential.
Statement [0] *BG_COLOR = 0 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [1] *FGCOL = 0 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [2] *D011 = BMM|DEN|RSEL|3 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [3] *D018 = (char)(unsigned int)SCREEN/$40|(unsigned int)BITMAP/$400 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [7] if(*RASTER!=$ff) goto main::@1 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [13] if(init_screen::b#2!=BITMAP+$2000) goto init_screen::@2 [ init_screen::b#2 ] ( init_screen:4 [ init_screen::b#2 ] { }  ) always clobbers reg byte a 
Statement [15] if(init_screen::c#2!=SCREEN+$400) goto init_screen::@4 [ init_screen::c#2 ] ( init_screen:4 [ init_screen::c#2 ] { }  ) always clobbers reg byte a 
Statement [17] *init_screen::c#2 = $14 [ init_screen::c#2 ] ( init_screen:4 [ init_screen::c#2 ] { }  ) always clobbers reg byte a reg byte y 
Statement [19] *init_screen::b#2 = 0 [ init_screen::b#2 ] ( init_screen:4 [ init_screen::b#2 ] { }  ) always clobbers reg byte a reg byte y 
Statement [25] plot_xhi[init_plot_tables::x#2] = byte1 BITMAP [ init_plot_tables::x#2 init_plot_tables::bits#3 ] ( init_plot_tables:6 [ 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]:27 [ init_plot_tables::x#2 init_plot_tables::x#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:26 [ init_plot_tables::bits#3 init_plot_tables::bits#4 init_plot_tables::bits#1 ]
Statement [26] plot_bit[init_plot_tables::x#2] = init_plot_tables::bits#3 [ init_plot_tables::x#2 init_plot_tables::bits#3 ] ( init_plot_tables:6 [ init_plot_tables::x#2 init_plot_tables::bits#3 ] { }  ) always clobbers reg byte a 
Statement [41] init_plot_tables::yoffs#1 = init_plot_tables::yoffs#2 + (unsigned int)$28*8 [ init_plot_tables::y#2 init_plot_tables::yoffs#1 ] ( init_plot_tables:6 [ 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]:28 [ init_plot_tables::y#2 init_plot_tables::y#1 ]
Statement [55] plot::plotter_x#1 = (char *) 0 byte1= plot::$6 [ plot::x#0 plot::y#0 plot::plotter_x#1 ] ( plots:9::plot:52 [ plots::i#2 plot::x#0 plot::y#0 plot::plotter_x#1 ] { }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:17 [ plots::i#2 plots::i#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:19 [ plot::x#0 ]
Removing always clobbered register reg byte a as potential for zp[1]:18 [ plot::y#0 ]
Statement [57] plot::plotter_x#2 = plot::plotter_x#1 byte0= plot::$7 [ plot::x#0 plot::y#0 plot::plotter_x#2 ] ( plots:9::plot:52 [ plots::i#2 plot::x#0 plot::y#0 plot::plotter_x#2 ] { }  ) always clobbers reg byte a 
Statement [61] plot::plotter_y#2 = plot::plotter_y#1 byte0= plot::$9 [ plot::x#0 plot::plotter_x#2 plot::plotter_y#2 ] ( plots:9::plot:52 [ plots::i#2 plot::x#0 plot::plotter_x#2 plot::plotter_y#2 ] { }  ) always clobbers reg byte a 
Statement [62] plot::plotter#0 = plot::plotter_x#2 + plot::plotter_y#2 [ plot::x#0 plot::plotter#0 ] ( plots:9::plot:52 [ plots::i#2 plot::x#0 plot::plotter#0 ] { }  ) always clobbers reg byte a 
Statement [63] plot::$5 = *plot::plotter#0 | plot_bit[plot::x#0] [ plot::plotter#0 plot::$5 ] ( plots:9::plot:52 [ 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]:17 [ plots::i#2 plots::i#1 ]
Statement [64] *plot::plotter#0 = plot::$5 [ ] ( plots:9::plot:52 [ plots::i#2 ] { }  ) always clobbers reg byte y 
Statement [0] *BG_COLOR = 0 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [1] *FGCOL = 0 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [2] *D011 = BMM|DEN|RSEL|3 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [3] *D018 = (char)(unsigned int)SCREEN/$40|(unsigned int)BITMAP/$400 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [7] if(*RASTER!=$ff) goto main::@1 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [13] if(init_screen::b#2!=BITMAP+$2000) goto init_screen::@2 [ init_screen::b#2 ] ( init_screen:4 [ init_screen::b#2 ] { }  ) always clobbers reg byte a 
Statement [15] if(init_screen::c#2!=SCREEN+$400) goto init_screen::@4 [ init_screen::c#2 ] ( init_screen:4 [ init_screen::c#2 ] { }  ) always clobbers reg byte a 
Statement [17] *init_screen::c#2 = $14 [ init_screen::c#2 ] ( init_screen:4 [ init_screen::c#2 ] { }  ) always clobbers reg byte a reg byte y 
Statement [19] *init_screen::b#2 = 0 [ init_screen::b#2 ] ( init_screen:4 [ init_screen::b#2 ] { }  ) always clobbers reg byte a reg byte y 
Statement [23] init_plot_tables::$0 = init_plot_tables::x#2 & $f8 [ init_plot_tables::x#2 init_plot_tables::bits#3 init_plot_tables::$0 ] ( init_plot_tables:6 [ init_plot_tables::x#2 init_plot_tables::bits#3 init_plot_tables::$0 ] { }  ) always clobbers reg byte a 
Statement [25] plot_xhi[init_plot_tables::x#2] = byte1 BITMAP [ init_plot_tables::x#2 init_plot_tables::bits#3 ] ( init_plot_tables:6 [ init_plot_tables::x#2 init_plot_tables::bits#3 ] { }  ) always clobbers reg byte a 
Statement [26] plot_bit[init_plot_tables::x#2] = init_plot_tables::bits#3 [ init_plot_tables::x#2 init_plot_tables::bits#3 ] ( init_plot_tables:6 [ init_plot_tables::x#2 init_plot_tables::bits#3 ] { }  ) always clobbers reg byte a 
Statement [34] init_plot_tables::$9 = init_plot_tables::y#2 & 7 [ init_plot_tables::y#2 init_plot_tables::yoffs#2 init_plot_tables::$9 ] ( init_plot_tables:6 [ init_plot_tables::y#2 init_plot_tables::yoffs#2 init_plot_tables::$9 ] { }  ) always clobbers reg byte a 
Statement [41] init_plot_tables::yoffs#1 = init_plot_tables::yoffs#2 + (unsigned int)$28*8 [ init_plot_tables::y#2 init_plot_tables::yoffs#1 ] ( init_plot_tables:6 [ init_plot_tables::y#2 init_plot_tables::yoffs#1 ] { }  ) always clobbers reg byte a 
Statement [55] plot::plotter_x#1 = (char *) 0 byte1= plot::$6 [ plot::x#0 plot::y#0 plot::plotter_x#1 ] ( plots:9::plot:52 [ plots::i#2 plot::x#0 plot::y#0 plot::plotter_x#1 ] { }  ) always clobbers reg byte a 
Statement [57] plot::plotter_x#2 = plot::plotter_x#1 byte0= plot::$7 [ plot::x#0 plot::y#0 plot::plotter_x#2 ] ( plots:9::plot:52 [ plots::i#2 plot::x#0 plot::y#0 plot::plotter_x#2 ] { }  ) always clobbers reg byte a 
Statement [61] plot::plotter_y#2 = plot::plotter_y#1 byte0= plot::$9 [ plot::x#0 plot::plotter_x#2 plot::plotter_y#2 ] ( plots:9::plot:52 [ plots::i#2 plot::x#0 plot::plotter_x#2 plot::plotter_y#2 ] { }  ) always clobbers reg byte a 
Statement [62] plot::plotter#0 = plot::plotter_x#2 + plot::plotter_y#2 [ plot::x#0 plot::plotter#0 ] ( plots:9::plot:52 [ plots::i#2 plot::x#0 plot::plotter#0 ] { }  ) always clobbers reg byte a 
Statement [63] plot::$5 = *plot::plotter#0 | plot_bit[plot::x#0] [ plot::plotter#0 plot::$5 ] ( plots:9::plot:52 [ plots::i#2 plot::plotter#0 plot::$5 ] { }  ) always clobbers reg byte a reg byte y 
Statement [64] *plot::plotter#0 = plot::$5 [ ] ( plots:9::plot:52 [ plots::i#2 ] { }  ) always clobbers reg byte y 
Potential registers zp[2]:22 [ init_screen::b#2 init_screen::b#1 ] : zp[2]:22 , 
Potential registers zp[2]:24 [ init_screen::c#2 init_screen::c#1 ] : zp[2]:24 , 
Potential registers zp[1]:27 [ init_plot_tables::x#2 init_plot_tables::x#1 ] : zp[1]:27 , reg byte x , reg byte y , 
Potential registers zp[1]:26 [ init_plot_tables::bits#3 init_plot_tables::bits#4 init_plot_tables::bits#1 ] : zp[1]:26 , reg byte x , reg byte y , 
Potential registers zp[1]:28 [ init_plot_tables::y#2 init_plot_tables::y#1 ] : zp[1]:28 , reg byte x , reg byte y , 
Potential registers zp[2]:20 [ init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 ] : zp[2]:20 , 
Potential registers zp[1]:17 [ plots::i#2 plots::i#1 ] : zp[1]:17 , reg byte x , 
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]:33 [ init_plot_tables::$9 ] : zp[1]:33 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:30 [ init_plot_tables::$6 ] : zp[1]:30 , reg byte a , reg byte x , reg byte y , reg byte alu , 
Potential registers zp[1]:31 [ init_plot_tables::$7 ] : zp[1]:31 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:32 [ init_plot_tables::$8 ] : zp[1]:32 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:19 [ plot::x#0 ] : zp[1]:19 , reg byte x , reg byte y , 
Potential registers zp[1]:18 [ plot::y#0 ] : zp[1]:18 , reg byte x , reg byte y , 
Potential registers zp[1]:2 [ plot::$6 ] : zp[1]:2 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:11 [ plot::plotter_x#1 ] : zp[2]:11 , 
Potential registers zp[1]:3 [ plot::$7 ] : zp[1]:3 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:15 [ plot::plotter_x#2 ] : zp[2]:15 , 
Potential registers zp[1]:4 [ plot::$8 ] : zp[1]:4 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:13 [ plot::plotter_y#1 ] : zp[2]:13 , 
Potential registers zp[1]:5 [ plot::$9 ] : zp[1]:5 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:6 [ plot::plotter_y#2 ] : zp[2]:6 , 
Potential registers zp[2]:9 [ plot::plotter#0 ] : zp[2]:9 , 
Potential registers zp[1]:8 [ plot::$5 ] : zp[1]:8 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [plot] 200,002: zp[1]:2 [ plot::$6 ] 200,002: zp[1]:3 [ plot::$7 ] 200,002: zp[1]:4 [ plot::$8 ] 200,002: zp[1]:5 [ plot::$9 ] 200,002: zp[2]:6 [ plot::plotter_y#2 ] 200,002: zp[1]:8 [ plot::$5 ] 150,001.5: zp[2]:9 [ plot::plotter#0 ] 100,001: zp[2]:11 [ plot::plotter_x#1 ] 100,001: zp[2]:13 [ plot::plotter_y#1 ] 40,000.4: zp[2]:15 [ plot::plotter_x#2 ] 30,000.43: zp[1]:18 [ plot::y#0 ] 28,182.18: zp[1]:19 [ plot::x#0 ] 
Uplift Scope [plots] 30,003: zp[1]:17 [ plots::i#2 plots::i#1 ] 
Uplift Scope [init_plot_tables] 366.12: zp[2]:20 [ init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 ] 228.93: zp[1]:26 [ init_plot_tables::bits#3 init_plot_tables::bits#4 init_plot_tables::bits#1 ] 218.83: zp[1]:27 [ init_plot_tables::x#2 init_plot_tables::x#1 ] 202: zp[1]:28 [ init_plot_tables::y#2 init_plot_tables::y#1 ] 202: zp[1]:29 [ init_plot_tables::$0 ] 202: zp[1]:30 [ init_plot_tables::$6 ] 202: zp[1]:31 [ init_plot_tables::$7 ] 202: zp[1]:32 [ init_plot_tables::$8 ] 50.5: zp[1]:33 [ init_plot_tables::$9 ] 
Uplift Scope [init_screen] 336.67: zp[2]:22 [ init_screen::b#2 init_screen::b#1 ] 336.67: zp[2]:24 [ init_screen::c#2 init_screen::c#1 ] 
Uplift Scope [main] 
Uplift Scope [] 

Uplifting [plot] best 10319 combination reg byte a [ plot::$6 ] reg byte a [ plot::$7 ] reg byte a [ plot::$8 ] reg byte a [ plot::$9 ] zp[2]:6 [ plot::plotter_y#2 ] zp[1]:8 [ plot::$5 ] zp[2]:9 [ plot::plotter#0 ] zp[2]:11 [ plot::plotter_x#1 ] zp[2]:13 [ plot::plotter_y#1 ] zp[2]:15 [ plot::plotter_x#2 ] zp[1]:18 [ plot::y#0 ] zp[1]:19 [ plot::x#0 ] 
Limited combination testing to 100 combinations of 9216 possible.
Uplifting [plots] best 8819 combination reg byte x [ plots::i#2 plots::i#1 ] 
Uplifting [init_plot_tables] best 8359 combination zp[2]:20 [ 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]:30 [ init_plot_tables::$6 ] zp[1]:31 [ init_plot_tables::$7 ] zp[1]:32 [ init_plot_tables::$8 ] zp[1]:33 [ init_plot_tables::$9 ] 
Limited combination testing to 100 combinations of 34560 possible.
Uplifting [init_screen] best 8359 combination zp[2]:22 [ init_screen::b#2 init_screen::b#1 ] zp[2]:24 [ init_screen::c#2 init_screen::c#1 ] 
Uplifting [main] best 8359 combination 
Uplifting [] best 8359 combination 
Attempting to uplift remaining variables inzp[1]:8 [ plot::$5 ]
Uplifting [plot] best 8353 combination reg byte a [ plot::$5 ] 
Attempting to uplift remaining variables inzp[1]:18 [ plot::y#0 ]
Uplifting [plot] best 8353 combination zp[1]:18 [ plot::y#0 ] 
Attempting to uplift remaining variables inzp[1]:19 [ plot::x#0 ]
Uplifting [plot] best 8353 combination zp[1]:19 [ plot::x#0 ] 
Attempting to uplift remaining variables inzp[1]:30 [ init_plot_tables::$6 ]
Uplifting [init_plot_tables] best 8293 combination reg byte a [ init_plot_tables::$6 ] 
Attempting to uplift remaining variables inzp[1]:31 [ init_plot_tables::$7 ]
Uplifting [init_plot_tables] best 8233 combination reg byte a [ init_plot_tables::$7 ] 
Attempting to uplift remaining variables inzp[1]:32 [ init_plot_tables::$8 ]
Uplifting [init_plot_tables] best 8173 combination reg byte a [ init_plot_tables::$8 ] 
Attempting to uplift remaining variables inzp[1]:33 [ init_plot_tables::$9 ]
Uplifting [init_plot_tables] best 8173 combination zp[1]:33 [ init_plot_tables::$9 ] 
Coalescing zero page register [ zp[2]:11 [ plot::plotter_x#1 ] ] with [ zp[2]:15 [ plot::plotter_x#2 ] ] - score: 1
Coalescing zero page register [ zp[2]:13 [ plot::plotter_y#1 ] ] with [ zp[2]:6 [ plot::plotter_y#2 ] ] - score: 1
Coalescing zero page register [ zp[2]:11 [ plot::plotter_x#1 plot::plotter_x#2 ] ] with [ zp[2]:9 [ plot::plotter#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:20 [ init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 ] ] with [ zp[2]:22 [ init_screen::b#2 init_screen::b#1 ] ]
Coalescing zero page register [ zp[1]:19 [ plot::x#0 ] ] with [ zp[1]:33 [ init_plot_tables::$9 ] ]
Coalescing zero page register [ zp[2]:11 [ plot::plotter_x#1 plot::plotter_x#2 plot::plotter#0 ] ] with [ zp[2]:24 [ init_screen::c#2 init_screen::c#1 ] ]
Coalescing zero page register [ zp[2]:13 [ plot::plotter_y#1 plot::plotter_y#2 ] ] with [ zp[2]:20 [ init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 init_screen::b#2 init_screen::b#1 ] ]
Allocated (was zp[2]:13) zp[2]:2 [ plot::plotter_y#1 plot::plotter_y#2 init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 init_screen::b#2 init_screen::b#1 ]
Allocated (was zp[2]:11) zp[2]:4 [ plot::plotter_x#1 plot::plotter_x#2 plot::plotter#0 init_screen::c#2 init_screen::c#1 ]
Allocated (was zp[1]:18) zp[1]:6 [ plot::y#0 ]
Allocated (was zp[1]:19) zp[1]:7 [ plot::x#0 init_plot_tables::$9 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
  // Upstart
  // Commodore 64 PRG executable file
.file [name="bitmap-plotter.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
  // Global Constants & labels
  .const BMM = $20
  .const DEN = $10
  .const RSEL = 8
  .const plots_cnt = 8
  .label BITMAP = $2000
  .label D011 = $d011
  .label RASTER = $d012
  .label D018 = $d018
  .label BG_COLOR = $d020
  .label FGCOL = $d021
  .label SCREEN = $400
.segment Code
  // main
main: {
    // [0] *BG_COLOR = 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta BG_COLOR
    // [1] *FGCOL = 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta FGCOL
    // [2] *D011 = BMM|DEN|RSEL|3 -- _deref_pbuc1=vbuc2 
    lda #BMM|DEN|RSEL|3
    sta D011
    // [3] *D018 = (char)(unsigned int)SCREEN/$40|(unsigned int)BITMAP/$400 -- _deref_pbuc1=vbuc2 
    lda #SCREEN/$40|BITMAP/$400
    sta D018
    // [4] call init_screen
    // [11] phi from main to init_screen [phi:main->init_screen]
  init_screen_from_main:
    jsr init_screen
    // [5] phi from main to main::@3 [phi:main->main::@3]
  __b3_from_main:
    jmp __b3
    // main::@3
  __b3:
    // [6] call init_plot_tables
    // [21] 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:
    // [7] if(*RASTER!=$ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$ff
    cmp RASTER
    bne __b1
    jmp __b2
    // main::@2
  __b2:
    // [8] *BG_COLOR = ++ *BG_COLOR -- _deref_pbuc1=_inc__deref_pbuc1 
    inc BG_COLOR
    // [9] call plots
    // [46] phi from main::@2 to plots [phi:main::@2->plots]
  plots_from___b2:
    jsr plots
    jmp __b4
    // main::@4
  __b4:
    // [10] *BG_COLOR = -- *BG_COLOR -- _deref_pbuc1=_dec__deref_pbuc1 
    dec BG_COLOR
    jmp __b1
}
  // init_screen
init_screen: {
    .label b = 2
    .label c = 4
    // [12] phi from init_screen to init_screen::@1 [phi:init_screen->init_screen::@1]
  __b1_from_init_screen:
    // [12] phi init_screen::b#2 = 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:
    // [13] if(init_screen::b#2!=BITMAP+$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
    // [14] phi from init_screen::@1 to init_screen::@3 [phi:init_screen::@1->init_screen::@3]
  __b3_from___b1:
    // [14] phi init_screen::c#2 = 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:
    // [15] if(init_screen::c#2!=SCREEN+$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:
    // [16] return 
    rts
    // init_screen::@4
  __b4:
    // [17] *init_screen::c#2 = $14 -- _deref_pbuz1=vbuc1 
    lda #$14
    ldy #0
    sta (c),y
    // [18] init_screen::c#1 = ++ init_screen::c#2 -- pbuz1=_inc_pbuz1 
    inc.z c
    bne !+
    inc.z c+1
  !:
    // [14] phi from init_screen::@4 to init_screen::@3 [phi:init_screen::@4->init_screen::@3]
  __b3_from___b4:
    // [14] phi init_screen::c#2 = init_screen::c#1 [phi:init_screen::@4->init_screen::@3#0] -- register_copy 
    jmp __b3
    // init_screen::@2
  __b2:
    // [19] *init_screen::b#2 = 0 -- _deref_pbuz1=vbuc1 
    lda #0
    ldy #0
    sta (b),y
    // [20] init_screen::b#1 = ++ init_screen::b#2 -- pbuz1=_inc_pbuz1 
    inc.z b
    bne !+
    inc.z b+1
  !:
    // [12] phi from init_screen::@2 to init_screen::@1 [phi:init_screen::@2->init_screen::@1]
  __b1_from___b2:
    // [12] phi init_screen::b#2 = init_screen::b#1 [phi:init_screen::@2->init_screen::@1#0] -- register_copy 
    jmp __b1
}
  // init_plot_tables
init_plot_tables: {
    .label __9 = 7
    .label yoffs = 2
    // [22] phi from init_plot_tables to init_plot_tables::@1 [phi:init_plot_tables->init_plot_tables::@1]
  __b1_from_init_plot_tables:
    // [22] phi init_plot_tables::bits#3 = $80 [phi:init_plot_tables->init_plot_tables::@1#0] -- vbuyy=vbuc1 
    ldy #$80
    // [22] phi init_plot_tables::x#2 = 0 [phi:init_plot_tables->init_plot_tables::@1#1] -- vbuxx=vbuc1 
    ldx #0
    jmp __b1
    // [22] phi from init_plot_tables::@2 to init_plot_tables::@1 [phi:init_plot_tables::@2->init_plot_tables::@1]
  __b1_from___b2:
    // [22] phi init_plot_tables::bits#3 = init_plot_tables::bits#4 [phi:init_plot_tables::@2->init_plot_tables::@1#0] -- register_copy 
    // [22] phi init_plot_tables::x#2 = init_plot_tables::x#1 [phi:init_plot_tables::@2->init_plot_tables::@1#1] -- register_copy 
    jmp __b1
    // init_plot_tables::@1
  __b1:
    // [23] init_plot_tables::$0 = init_plot_tables::x#2 & $f8 -- vbuaa=vbuxx_band_vbuc1 
    txa
    and #$f8
    // [24] plot_xlo[init_plot_tables::x#2] = init_plot_tables::$0 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta plot_xlo,x
    // [25] plot_xhi[init_plot_tables::x#2] = byte1 BITMAP -- pbuc1_derefidx_vbuxx=vbuc2 
    lda #>BITMAP
    sta plot_xhi,x
    // [26] plot_bit[init_plot_tables::x#2] = init_plot_tables::bits#3 -- pbuc1_derefidx_vbuxx=vbuyy 
    tya
    sta plot_bit,x
    // [27] init_plot_tables::bits#1 = init_plot_tables::bits#3 >> 1 -- vbuyy=vbuyy_ror_1 
    tya
    lsr
    tay
    // [28] if(init_plot_tables::bits#1!=0) goto init_plot_tables::@6 -- vbuyy_neq_0_then_la1 
    cpy #0
    bne __b6_from___b1
    // [30] phi from init_plot_tables::@1 to init_plot_tables::@2 [phi:init_plot_tables::@1->init_plot_tables::@2]
  __b2_from___b1:
    // [30] phi init_plot_tables::bits#4 = $80 [phi:init_plot_tables::@1->init_plot_tables::@2#0] -- vbuyy=vbuc1 
    ldy #$80
    jmp __b2
    // [29] 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:
    // [30] phi from init_plot_tables::@6 to init_plot_tables::@2 [phi:init_plot_tables::@6->init_plot_tables::@2]
  __b2_from___b6:
    // [30] phi init_plot_tables::bits#4 = init_plot_tables::bits#1 [phi:init_plot_tables::@6->init_plot_tables::@2#0] -- register_copy 
    jmp __b2
    // init_plot_tables::@2
  __b2:
    // [31] init_plot_tables::x#1 = ++ init_plot_tables::x#2 -- vbuxx=_inc_vbuxx 
    inx
    // [32] if(init_plot_tables::x#1!=0) goto init_plot_tables::@1 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne __b1_from___b2
    // [33] phi from init_plot_tables::@2 to init_plot_tables::@3 [phi:init_plot_tables::@2->init_plot_tables::@3]
  __b3_from___b2:
    // [33] phi init_plot_tables::yoffs#2 = (char *) 0 [phi:init_plot_tables::@2->init_plot_tables::@3#0] -- pbuz1=pbuc1 
    lda #<0
    sta.z yoffs
    lda #>0
    sta.z yoffs+1
    // [33] phi init_plot_tables::y#2 = 0 [phi:init_plot_tables::@2->init_plot_tables::@3#1] -- vbuxx=vbuc1 
    ldx #0
    jmp __b3
    // [33] phi from init_plot_tables::@4 to init_plot_tables::@3 [phi:init_plot_tables::@4->init_plot_tables::@3]
  __b3_from___b4:
    // [33] phi init_plot_tables::yoffs#2 = init_plot_tables::yoffs#4 [phi:init_plot_tables::@4->init_plot_tables::@3#0] -- register_copy 
    // [33] phi init_plot_tables::y#2 = init_plot_tables::y#1 [phi:init_plot_tables::@4->init_plot_tables::@3#1] -- register_copy 
    jmp __b3
    // init_plot_tables::@3
  __b3:
    // [34] init_plot_tables::$9 = init_plot_tables::y#2 & 7 -- vbuz1=vbuxx_band_vbuc1 
    lda #7
    sax.z __9
    // [35] init_plot_tables::$6 = byte0  init_plot_tables::yoffs#2 -- vbuaa=_byte0_pbuz1 
    lda.z yoffs
    // [36] init_plot_tables::$7 = init_plot_tables::$9 | init_plot_tables::$6 -- vbuaa=vbuz1_bor_vbuaa 
    ora.z __9
    // [37] plot_ylo[init_plot_tables::y#2] = init_plot_tables::$7 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta plot_ylo,x
    // [38] init_plot_tables::$8 = byte1  init_plot_tables::yoffs#2 -- vbuaa=_byte1_pbuz1 
    lda.z yoffs+1
    // [39] plot_yhi[init_plot_tables::y#2] = init_plot_tables::$8 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta plot_yhi,x
    // [40] if(init_plot_tables::$9!=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:
    // [41] init_plot_tables::yoffs#1 = init_plot_tables::yoffs#2 + (unsigned int)$28*8 -- pbuz1=pbuz1_plus_vwuc1 
    lda.z yoffs
    clc
    adc #<$28*8
    sta.z yoffs
    lda.z yoffs+1
    adc #>$28*8
    sta.z yoffs+1
    // [42] 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:
    // [42] phi init_plot_tables::yoffs#4 = 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:
    // [43] init_plot_tables::y#1 = ++ init_plot_tables::y#2 -- vbuxx=_inc_vbuxx 
    inx
    // [44] if(init_plot_tables::y#1!=0) goto init_plot_tables::@3 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne __b3_from___b4
    jmp __breturn
    // init_plot_tables::@return
  __breturn:
    // [45] return 
    rts
}
  // plots
plots: {
    // [47] phi from plots to plots::@1 [phi:plots->plots::@1]
  __b1_from_plots:
    // [47] phi plots::i#2 = 0 [phi:plots->plots::@1#0] -- vbuxx=vbuc1 
    ldx #0
    jmp __b1
    // plots::@1
  __b1:
    // [48] if(plots::i#2<plots_cnt) goto plots::@2 -- vbuxx_lt_vbuc1_then_la1 
    cpx #plots_cnt
    bcc __b2
    jmp __breturn
    // plots::@return
  __breturn:
    // [49] return 
    rts
    // plots::@2
  __b2:
    // [50] plot::x#0 = plots_x[plots::i#2] -- vbuz1=pbuc1_derefidx_vbuxx 
    lda plots_x,x
    sta.z plot.x
    // [51] plot::y#0 = plots_y[plots::i#2] -- vbuz1=pbuc1_derefidx_vbuxx 
    lda plots_y,x
    sta.z plot.y
    // [52] call plot
    jsr plot
    jmp __b3
    // plots::@3
  __b3:
    // [53] plots::i#1 = ++ plots::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [47] phi from plots::@3 to plots::@1 [phi:plots::@3->plots::@1]
  __b1_from___b3:
    // [47] phi plots::i#2 = plots::i#1 [phi:plots::@3->plots::@1#0] -- register_copy 
    jmp __b1
}
  // plot
// void plot(__zp(7) char x, __zp(6) char y)
plot: {
    .label x = 7
    .label y = 6
    .label plotter_x = 4
    .label plotter_y = 2
    .label plotter = 4
    // [54] plot::$6 = plot_xhi[plot::x#0] -- vbuaa=pbuc1_derefidx_vbuz1 
    ldy.z x
    lda plot_xhi,y
    // [55] plot::plotter_x#1 = (char *) 0 byte1= plot::$6 -- pbuz1=pbuc1_setbyte1_vbuaa 
    sta.z plotter_x+1
    lda #<0
    sta.z plotter_x
    // [56] plot::$7 = plot_xlo[plot::x#0] -- vbuaa=pbuc1_derefidx_vbuz1 
    ldy.z x
    lda plot_xlo,y
    // [57] plot::plotter_x#2 = plot::plotter_x#1 byte0= plot::$7 -- pbuz1=pbuz1_setbyte0_vbuaa 
    sta.z plotter_x
    // [58] plot::$8 = plot_yhi[plot::y#0] -- vbuaa=pbuc1_derefidx_vbuz1 
    ldy.z y
    lda plot_yhi,y
    // [59] plot::plotter_y#1 = 0 byte1= plot::$8 -- vwuz1=vwuc1_setbyte1_vbuaa 
    sta.z plotter_y+1
    lda #<0
    sta.z plotter_y
    // [60] plot::$9 = plot_ylo[plot::y#0] -- vbuaa=pbuc1_derefidx_vbuz1 
    ldy.z y
    lda plot_ylo,y
    // [61] plot::plotter_y#2 = plot::plotter_y#1 byte0= plot::$9 -- vwuz1=vwuz1_setbyte0_vbuaa 
    sta.z plotter_y
    // [62] plot::plotter#0 = plot::plotter_x#2 + plot::plotter_y#2 -- pbuz1=pbuz1_plus_vwuz2 
    clc
    lda.z plotter
    adc.z plotter_y
    sta.z plotter
    lda.z plotter+1
    adc.z plotter_y+1
    sta.z plotter+1
    // [63] plot::$5 = *plot::plotter#0 | plot_bit[plot::x#0] -- vbuaa=_deref_pbuz1_bor_pbuc1_derefidx_vbuz2 
    ldy #0
    lda (plotter),y
    ldy.z x
    ora plot_bit,y
    // [64] *plot::plotter#0 = plot::$5 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (plotter),y
    jmp __breturn
    // plot::@return
  __breturn:
    // [65] return 
    rts
}
  // File Data
.segment 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 __b3
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b4
Removing instruction jmp __b1
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 __breturn
Removing instruction jmp __b3
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #0
Replacing instruction ldy #0 with TAY
Removing instruction lda #>0
Replacing instruction ldx #0 with TAX
Removing instruction ldy.z x
Removing instruction ldy.z y
Succesful ASM optimization Pass5UnnecesaryLoadElimination
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 __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 init_screen_from_main:
Removing instruction __b3:
Removing instruction __b2:
Removing instruction plots_from___b2:
Removing instruction __b4:
Removing instruction __b1_from_init_screen:
Removing instruction __b3_from___b1:
Removing instruction __breturn:
Removing instruction __b3_from___b4:
Removing instruction __b1_from___b2:
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_plots:
Removing instruction __breturn:
Removing instruction __b3:
Removing instruction __b1_from___b3:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b3
Succesful ASM optimization Pass5NextJumpElimination

FINAL SYMBOL TABLE
__constant char *BG_COLOR = (char *) 53280
__constant char * const BITMAP = (char *) 8192
__constant char BMM = $20
__constant char *D011 = (char *) 53265
__constant char *D018 = (char *) 53272
__constant char DEN = $10
__constant char *FGCOL = (char *) 53281
__constant char *RASTER = (char *) 53266
__constant char RSEL = 8
__constant char *SCREEN = (char *) 1024
void init_plot_tables()
char init_plot_tables::$0 // reg byte a 202.0
char init_plot_tables::$6 // reg byte a 202.0
char init_plot_tables::$7 // reg byte a 202.0
char init_plot_tables::$8 // reg byte a 202.0
char init_plot_tables::$9 // zp[1]:7 50.5
char init_plot_tables::bits
char init_plot_tables::bits#1 // reg byte y 101.0
char init_plot_tables::bits#3 // reg byte y 60.599999999999994
char init_plot_tables::bits#4 // reg byte y 67.33333333333333
char init_plot_tables::x
char init_plot_tables::x#1 // reg byte x 151.5
char init_plot_tables::x#2 // reg byte x 67.33333333333333
char init_plot_tables::y
char init_plot_tables::y#1 // reg byte x 151.5
char init_plot_tables::y#2 // reg byte x 50.5
char *init_plot_tables::yoffs
char *init_plot_tables::yoffs#1 // yoffs zp[2]:2 202.0
char *init_plot_tables::yoffs#2 // yoffs zp[2]:2 63.125
char *init_plot_tables::yoffs#4 // yoffs zp[2]:2 101.0
void init_screen()
char *init_screen::b
char *init_screen::b#1 // b zp[2]:2 202.0
char *init_screen::b#2 // b zp[2]:2 134.66666666666666
char *init_screen::c
char *init_screen::c#1 // c zp[2]:4 202.0
char *init_screen::c#2 // c zp[2]:4 134.66666666666666
void main()
void plot(char x , char y)
char plot::$5 // reg byte a 200002.0
char plot::$6 // reg byte a 200002.0
char plot::$7 // reg byte a 200002.0
char plot::$8 // reg byte a 200002.0
char plot::$9 // reg byte a 200002.0
char *plot::plotter
char *plot::plotter#0 // plotter zp[2]:4 150001.5
char *plot::plotter_x
char *plot::plotter_x#1 // plotter_x zp[2]:4 100001.0
char *plot::plotter_x#2 // plotter_x zp[2]:4 40000.4
unsigned int plot::plotter_y
unsigned int plot::plotter_y#1 // plotter_y zp[2]:2 100001.0
unsigned int plot::plotter_y#2 // plotter_y zp[2]:2 200002.0
char plot::x
char plot::x#0 // x zp[1]:7 28182.181818181816
char plot::y
char plot::y#0 // y zp[1]:6 30000.428571428572
__constant const char plot_bit[$100] = { fill( $100, 0) }
__constant const char plot_xhi[$100] = { fill( $100, 0) }
__constant const char plot_xlo[$100] = { fill( $100, 0) }
__constant const char plot_yhi[$100] = { fill( $100, 0) }
__constant const char plot_ylo[$100] = { fill( $100, 0) }
void plots()
char plots::i
char plots::i#1 // reg byte x 20002.0
char plots::i#2 // reg byte x 10001.0
__constant char plots_cnt = 8
__constant char plots_x[] = { $3c, $50, $6e, $50, $3c, $28, $a, $28 }
__constant char plots_y[] = { $a, $28, $3c, $50, $6e, $50, $3c, $28 }

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 ]
reg byte x [ plots::i#2 plots::i#1 ]
reg byte a [ init_plot_tables::$0 ]
reg byte a [ init_plot_tables::$6 ]
reg byte a [ init_plot_tables::$7 ]
reg byte a [ init_plot_tables::$8 ]
zp[1]:7 [ plot::x#0 init_plot_tables::$9 ]
zp[1]:6 [ plot::y#0 ]
reg byte a [ plot::$6 ]
zp[2]:4 [ 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]:2 [ plot::plotter_y#1 plot::plotter_y#2 init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 init_screen::b#2 init_screen::b#1 ]
reg byte a [ plot::$9 ]
reg byte a [ plot::$5 ]


FINAL ASSEMBLER
Score: 6531

  // File Comments
  // Upstart
  // Commodore 64 PRG executable file
.file [name="bitmap-plotter.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
  // Global Constants & labels
  .const BMM = $20
  .const DEN = $10
  .const RSEL = 8
  .const plots_cnt = 8
  .label BITMAP = $2000
  .label D011 = $d011
  .label RASTER = $d012
  .label D018 = $d018
  .label BG_COLOR = $d020
  .label FGCOL = $d021
  .label SCREEN = $400
.segment Code
  // main
main: {
    // *BG_COLOR = 0
    // [0] *BG_COLOR = 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta BG_COLOR
    // *FGCOL = 0
    // [1] *FGCOL = 0 -- _deref_pbuc1=vbuc2 
    sta FGCOL
    // *D011 = BMM|DEN|RSEL|3
    // [2] *D011 = BMM|DEN|RSEL|3 -- _deref_pbuc1=vbuc2 
    lda #BMM|DEN|RSEL|3
    sta D011
    // *D018 = (byte)(((word)SCREEN/$40)|((word)BITMAP/$400))
    // [3] *D018 = (char)(unsigned int)SCREEN/$40|(unsigned int)BITMAP/$400 -- _deref_pbuc1=vbuc2 
    lda #SCREEN/$40|BITMAP/$400
    sta D018
    // init_screen()
    // [4] call init_screen
    // [11] phi from main to init_screen [phi:main->init_screen]
    jsr init_screen
    // [5] phi from main to main::@3 [phi:main->main::@3]
    // main::@3
    // init_plot_tables()
    // [6] call init_plot_tables
    // [21] phi from main::@3 to init_plot_tables [phi:main::@3->init_plot_tables]
    jsr init_plot_tables
    // main::@1
  __b1:
    // while (*RASTER!=$ff)
    // [7] if(*RASTER!=$ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$ff
    cmp RASTER
    bne __b1
    // main::@2
    // (*BG_COLOR)++;
    // [8] *BG_COLOR = ++ *BG_COLOR -- _deref_pbuc1=_inc__deref_pbuc1 
    inc BG_COLOR
    // plots()
    // [9] call plots
    // [46] phi from main::@2 to plots [phi:main::@2->plots]
    jsr plots
    // main::@4
    // (*BG_COLOR)--;
    // [10] *BG_COLOR = -- *BG_COLOR -- _deref_pbuc1=_dec__deref_pbuc1 
    dec BG_COLOR
    jmp __b1
}
  // init_screen
init_screen: {
    .label b = 2
    .label c = 4
    // [12] phi from init_screen to init_screen::@1 [phi:init_screen->init_screen::@1]
    // [12] phi init_screen::b#2 = 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++)
    // [13] if(init_screen::b#2!=BITMAP+$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
    // [14] phi from init_screen::@1 to init_screen::@3 [phi:init_screen::@1->init_screen::@3]
    // [14] phi init_screen::c#2 = 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++)
    // [15] if(init_screen::c#2!=SCREEN+$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
    // }
    // [16] return 
    rts
    // init_screen::@4
  __b4:
    // *c = $14
    // [17] *init_screen::c#2 = $14 -- _deref_pbuz1=vbuc1 
    lda #$14
    ldy #0
    sta (c),y
    // for(byte* c = SCREEN; c!=SCREEN+$400;c++)
    // [18] init_screen::c#1 = ++ init_screen::c#2 -- pbuz1=_inc_pbuz1 
    inc.z c
    bne !+
    inc.z c+1
  !:
    // [14] phi from init_screen::@4 to init_screen::@3 [phi:init_screen::@4->init_screen::@3]
    // [14] phi init_screen::c#2 = init_screen::c#1 [phi:init_screen::@4->init_screen::@3#0] -- register_copy 
    jmp __b3
    // init_screen::@2
  __b2:
    // *b = 0
    // [19] *init_screen::b#2 = 0 -- _deref_pbuz1=vbuc1 
    lda #0
    tay
    sta (b),y
    // for(byte* b = BITMAP; b!=BITMAP+$2000; b++)
    // [20] init_screen::b#1 = ++ init_screen::b#2 -- pbuz1=_inc_pbuz1 
    inc.z b
    bne !+
    inc.z b+1
  !:
    // [12] phi from init_screen::@2 to init_screen::@1 [phi:init_screen::@2->init_screen::@1]
    // [12] phi init_screen::b#2 = init_screen::b#1 [phi:init_screen::@2->init_screen::@1#0] -- register_copy 
    jmp __b1
}
  // init_plot_tables
init_plot_tables: {
    .label __9 = 7
    .label yoffs = 2
    // [22] phi from init_plot_tables to init_plot_tables::@1 [phi:init_plot_tables->init_plot_tables::@1]
    // [22] phi init_plot_tables::bits#3 = $80 [phi:init_plot_tables->init_plot_tables::@1#0] -- vbuyy=vbuc1 
    ldy #$80
    // [22] phi init_plot_tables::x#2 = 0 [phi:init_plot_tables->init_plot_tables::@1#1] -- vbuxx=vbuc1 
    ldx #0
    // [22] phi from init_plot_tables::@2 to init_plot_tables::@1 [phi:init_plot_tables::@2->init_plot_tables::@1]
    // [22] phi init_plot_tables::bits#3 = init_plot_tables::bits#4 [phi:init_plot_tables::@2->init_plot_tables::@1#0] -- register_copy 
    // [22] phi init_plot_tables::x#2 = init_plot_tables::x#1 [phi:init_plot_tables::@2->init_plot_tables::@1#1] -- register_copy 
    // init_plot_tables::@1
  __b1:
    // x&$f8
    // [23] init_plot_tables::$0 = init_plot_tables::x#2 & $f8 -- vbuaa=vbuxx_band_vbuc1 
    txa
    and #$f8
    // plot_xlo[x] = x&$f8
    // [24] plot_xlo[init_plot_tables::x#2] = init_plot_tables::$0 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta plot_xlo,x
    // plot_xhi[x] = BYTE1(BITMAP)
    // [25] plot_xhi[init_plot_tables::x#2] = byte1 BITMAP -- pbuc1_derefidx_vbuxx=vbuc2 
    lda #>BITMAP
    sta plot_xhi,x
    // plot_bit[x] = bits
    // [26] plot_bit[init_plot_tables::x#2] = init_plot_tables::bits#3 -- pbuc1_derefidx_vbuxx=vbuyy 
    tya
    sta plot_bit,x
    // bits = bits/2
    // [27] init_plot_tables::bits#1 = init_plot_tables::bits#3 >> 1 -- vbuyy=vbuyy_ror_1 
    tya
    lsr
    tay
    // if(bits==0)
    // [28] if(init_plot_tables::bits#1!=0) goto init_plot_tables::@6 -- vbuyy_neq_0_then_la1 
    cpy #0
    bne __b2
    // [30] phi from init_plot_tables::@1 to init_plot_tables::@2 [phi:init_plot_tables::@1->init_plot_tables::@2]
    // [30] phi init_plot_tables::bits#4 = $80 [phi:init_plot_tables::@1->init_plot_tables::@2#0] -- vbuyy=vbuc1 
    ldy #$80
    // [29] phi from init_plot_tables::@1 to init_plot_tables::@6 [phi:init_plot_tables::@1->init_plot_tables::@6]
    // init_plot_tables::@6
    // [30] phi from init_plot_tables::@6 to init_plot_tables::@2 [phi:init_plot_tables::@6->init_plot_tables::@2]
    // [30] phi init_plot_tables::bits#4 = 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)
    // [31] init_plot_tables::x#1 = ++ init_plot_tables::x#2 -- vbuxx=_inc_vbuxx 
    inx
    // [32] if(init_plot_tables::x#1!=0) goto init_plot_tables::@1 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne __b1
    // [33] phi from init_plot_tables::@2 to init_plot_tables::@3 [phi:init_plot_tables::@2->init_plot_tables::@3]
    // [33] phi init_plot_tables::yoffs#2 = (char *) 0 [phi:init_plot_tables::@2->init_plot_tables::@3#0] -- pbuz1=pbuc1 
    lda #<0
    sta.z yoffs
    sta.z yoffs+1
    // [33] phi init_plot_tables::y#2 = 0 [phi:init_plot_tables::@2->init_plot_tables::@3#1] -- vbuxx=vbuc1 
    tax
    // [33] phi from init_plot_tables::@4 to init_plot_tables::@3 [phi:init_plot_tables::@4->init_plot_tables::@3]
    // [33] phi init_plot_tables::yoffs#2 = init_plot_tables::yoffs#4 [phi:init_plot_tables::@4->init_plot_tables::@3#0] -- register_copy 
    // [33] phi init_plot_tables::y#2 = init_plot_tables::y#1 [phi:init_plot_tables::@4->init_plot_tables::@3#1] -- register_copy 
    // init_plot_tables::@3
  __b3:
    // y&$7
    // [34] init_plot_tables::$9 = init_plot_tables::y#2 & 7 -- vbuz1=vbuxx_band_vbuc1 
    lda #7
    sax.z __9
    // BYTE0(yoffs)
    // [35] init_plot_tables::$6 = byte0  init_plot_tables::yoffs#2 -- vbuaa=_byte0_pbuz1 
    lda.z yoffs
    // y&$7 | BYTE0(yoffs)
    // [36] init_plot_tables::$7 = init_plot_tables::$9 | init_plot_tables::$6 -- vbuaa=vbuz1_bor_vbuaa 
    ora.z __9
    // plot_ylo[y] = y&$7 | BYTE0(yoffs)
    // [37] plot_ylo[init_plot_tables::y#2] = init_plot_tables::$7 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta plot_ylo,x
    // BYTE1(yoffs)
    // [38] init_plot_tables::$8 = byte1  init_plot_tables::yoffs#2 -- vbuaa=_byte1_pbuz1 
    lda.z yoffs+1
    // plot_yhi[y] = BYTE1(yoffs)
    // [39] plot_yhi[init_plot_tables::y#2] = init_plot_tables::$8 -- pbuc1_derefidx_vbuxx=vbuaa 
    sta plot_yhi,x
    // if((y&$7)==7)
    // [40] if(init_plot_tables::$9!=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
    // [41] init_plot_tables::yoffs#1 = init_plot_tables::yoffs#2 + (unsigned int)$28*8 -- pbuz1=pbuz1_plus_vwuc1 
    lda.z yoffs
    clc
    adc #<$28*8
    sta.z yoffs
    lda.z yoffs+1
    adc #>$28*8
    sta.z yoffs+1
    // [42] 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]
    // [42] phi init_plot_tables::yoffs#4 = 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)
    // [43] init_plot_tables::y#1 = ++ init_plot_tables::y#2 -- vbuxx=_inc_vbuxx 
    inx
    // [44] if(init_plot_tables::y#1!=0) goto init_plot_tables::@3 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne __b3
    // init_plot_tables::@return
    // }
    // [45] return 
    rts
}
  // plots
plots: {
    // [47] phi from plots to plots::@1 [phi:plots->plots::@1]
    // [47] phi plots::i#2 = 0 [phi:plots->plots::@1#0] -- vbuxx=vbuc1 
    ldx #0
    // plots::@1
  __b1:
    // for(byte i=0; i<plots_cnt;i++)
    // [48] if(plots::i#2<plots_cnt) goto plots::@2 -- vbuxx_lt_vbuc1_then_la1 
    cpx #plots_cnt
    bcc __b2
    // plots::@return
    // }
    // [49] return 
    rts
    // plots::@2
  __b2:
    // plot(plots_x[i], plots_y[i])
    // [50] plot::x#0 = plots_x[plots::i#2] -- vbuz1=pbuc1_derefidx_vbuxx 
    lda plots_x,x
    sta.z plot.x
    // [51] plot::y#0 = plots_y[plots::i#2] -- vbuz1=pbuc1_derefidx_vbuxx 
    lda plots_y,x
    sta.z plot.y
    // [52] call plot
    jsr plot
    // plots::@3
    // for(byte i=0; i<plots_cnt;i++)
    // [53] plots::i#1 = ++ plots::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [47] phi from plots::@3 to plots::@1 [phi:plots::@3->plots::@1]
    // [47] phi plots::i#2 = plots::i#1 [phi:plots::@3->plots::@1#0] -- register_copy 
    jmp __b1
}
  // plot
// void plot(__zp(7) char x, __zp(6) char y)
plot: {
    .label x = 7
    .label y = 6
    .label plotter_x = 4
    .label plotter_y = 2
    .label plotter = 4
    // BYTE1(plotter_x) = plot_xhi[x]
    // [54] plot::$6 = plot_xhi[plot::x#0] -- vbuaa=pbuc1_derefidx_vbuz1 
    ldy.z x
    lda plot_xhi,y
    // [55] plot::plotter_x#1 = (char *) 0 byte1= plot::$6 -- pbuz1=pbuc1_setbyte1_vbuaa 
    sta.z plotter_x+1
    lda #<0
    sta.z plotter_x
    // BYTE0(plotter_x) = plot_xlo[x]
    // [56] plot::$7 = plot_xlo[plot::x#0] -- vbuaa=pbuc1_derefidx_vbuz1 
    lda plot_xlo,y
    // [57] plot::plotter_x#2 = plot::plotter_x#1 byte0= plot::$7 -- pbuz1=pbuz1_setbyte0_vbuaa 
    sta.z plotter_x
    // BYTE1(plotter_y) = plot_yhi[y]
    // [58] plot::$8 = plot_yhi[plot::y#0] -- vbuaa=pbuc1_derefidx_vbuz1 
    ldy.z y
    lda plot_yhi,y
    // [59] plot::plotter_y#1 = 0 byte1= plot::$8 -- vwuz1=vwuc1_setbyte1_vbuaa 
    sta.z plotter_y+1
    lda #<0
    sta.z plotter_y
    // BYTE0(plotter_y) = plot_ylo[y]
    // [60] plot::$9 = plot_ylo[plot::y#0] -- vbuaa=pbuc1_derefidx_vbuz1 
    lda plot_ylo,y
    // [61] plot::plotter_y#2 = plot::plotter_y#1 byte0= plot::$9 -- vwuz1=vwuz1_setbyte0_vbuaa 
    sta.z plotter_y
    // byte* plotter = plotter_x+plotter_y
    // [62] plot::plotter#0 = plot::plotter_x#2 + plot::plotter_y#2 -- pbuz1=pbuz1_plus_vwuz2 
    clc
    lda.z plotter
    adc.z plotter_y
    sta.z plotter
    lda.z plotter+1
    adc.z plotter_y+1
    sta.z plotter+1
    // *plotter | plot_bit[x]
    // [63] plot::$5 = *plot::plotter#0 | plot_bit[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]
    // [64] *plot::plotter#0 = plot::$5 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (plotter),y
    // plot::@return
    // }
    // [65] return 
    rts
}
  // File Data
.segment 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

