Identified constant variable (byte*) RASTER
Identified constant variable (byte*) SCREEN
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@4
Culled Empty Block (label) main::@8
Culled Empty Block (label) @1
Culled Empty Block (label) prepare::@2
Culled Empty Block (label) @2
Culled Empty Block (label) flip::@6
Culled Empty Block (label) @3
Culled Empty Block (label) plot::@4

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  (byte[$10*$10]) buffer1#0 ← { fill( $10*$10, 0) }
  (byte[$10*$10]) buffer2#0 ← { fill( $10*$10, 0) }
  (byte*) RASTER#0 ← ((byte*)) (number) $d012
  (byte*) SCREEN#0 ← ((byte*)) (number) $400
  to:@4
main: scope:[main]  from @4
  call prepare 
  to:main::@9
main::@9: scope:[main]  from main
  to:main::@1
main::@1: scope:[main]  from main::@11 main::@9
  (byte) main::c#0 ← (byte) $19
  to:main::@3
main::@3: scope:[main]  from main::@1 main::@3 main::@6
  (byte) main::c#4 ← phi( main::@1/(byte) main::c#0 main::@3/(byte) main::c#4 main::@6/(byte) main::c#1 )
  (bool~) main::$1 ← *((byte*) RASTER#0) != (number) $fe
  if((bool~) main::$1) goto main::@3
  to:main::@5
main::@5: scope:[main]  from main::@3 main::@5
  (byte) main::c#3 ← phi( main::@3/(byte) main::c#4 main::@5/(byte) main::c#3 )
  (bool~) main::$2 ← *((byte*) RASTER#0) != (number) $ff
  if((bool~) main::$2) goto main::@5
  to:main::@6
main::@6: scope:[main]  from main::@5
  (byte) main::c#2 ← phi( main::@5/(byte) main::c#3 )
  (byte) main::c#1 ← (byte) main::c#2 + rangenext($19,1)
  (bool~) main::$3 ← (byte) main::c#1 != rangelast($19,1)
  if((bool~) main::$3) goto main::@3
  to:main::@7
main::@7: scope:[main]  from main::@6
  call flip 
  to:main::@10
main::@10: scope:[main]  from main::@7
  call plot 
  to:main::@11
main::@11: scope:[main]  from main::@10
  if(true) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@11
  return 
  to:@return
prepare: scope:[prepare]  from main
  (byte) prepare::i#0 ← (byte) 0
  to:prepare::@1
prepare::@1: scope:[prepare]  from prepare prepare::@1
  (byte) prepare::i#2 ← phi( prepare/(byte) prepare::i#0 prepare::@1/(byte) prepare::i#1 )
  *((byte[$10*$10]) buffer1#0 + (byte) prepare::i#2) ← (byte) prepare::i#2
  (byte) prepare::i#1 ← (byte) prepare::i#2 + rangenext(0,$ff)
  (bool~) prepare::$0 ← (byte) prepare::i#1 != rangelast(0,$ff)
  if((bool~) prepare::$0) goto prepare::@1
  to:prepare::@return
prepare::@return: scope:[prepare]  from prepare::@1
  return 
  to:@return
flip: scope:[flip]  from main::@7
  (byte) flip::srcIdx#0 ← (number) 0
  (byte) flip::dstIdx#0 ← (number) $f
  (byte) flip::r#0 ← (byte) $10
  to:flip::@1
flip::@1: scope:[flip]  from flip flip::@3
  (byte) flip::r#4 ← phi( flip/(byte) flip::r#0 flip::@3/(byte) flip::r#1 )
  (byte) flip::dstIdx#5 ← phi( flip/(byte) flip::dstIdx#0 flip::@3/(byte) flip::dstIdx#2 )
  (byte) flip::srcIdx#3 ← phi( flip/(byte) flip::srcIdx#0 flip::@3/(byte) flip::srcIdx#4 )
  (byte) flip::c#0 ← (byte) $10
  to:flip::@2
flip::@2: scope:[flip]  from flip::@1 flip::@2
  (byte) flip::r#3 ← phi( flip::@1/(byte) flip::r#4 flip::@2/(byte) flip::r#3 )
  (byte) flip::c#2 ← phi( flip::@1/(byte) flip::c#0 flip::@2/(byte) flip::c#1 )
  (byte) flip::dstIdx#3 ← phi( flip::@1/(byte) flip::dstIdx#5 flip::@2/(byte) flip::dstIdx#1 )
  (byte) flip::srcIdx#2 ← phi( flip::@1/(byte) flip::srcIdx#3 flip::@2/(byte) flip::srcIdx#1 )
  *((byte[$10*$10]) buffer2#0 + (byte) flip::dstIdx#3) ← *((byte[$10*$10]) buffer1#0 + (byte) flip::srcIdx#2)
  (byte) flip::srcIdx#1 ← ++ (byte) flip::srcIdx#2
  (number~) flip::$0 ← (byte) flip::dstIdx#3 + (number) $10
  (byte) flip::dstIdx#1 ← (number~) flip::$0
  (byte) flip::c#1 ← (byte) flip::c#2 + rangenext($10,1)
  (bool~) flip::$1 ← (byte) flip::c#1 != rangelast($10,1)
  if((bool~) flip::$1) goto flip::@2
  to:flip::@3
flip::@3: scope:[flip]  from flip::@2
  (byte) flip::srcIdx#4 ← phi( flip::@2/(byte) flip::srcIdx#1 )
  (byte) flip::r#2 ← phi( flip::@2/(byte) flip::r#3 )
  (byte) flip::dstIdx#4 ← phi( flip::@2/(byte) flip::dstIdx#1 )
  (byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#4
  (byte) flip::r#1 ← (byte) flip::r#2 + rangenext($10,1)
  (bool~) flip::$2 ← (byte) flip::r#1 != rangelast($10,1)
  if((bool~) flip::$2) goto flip::@1
  to:flip::@4
flip::@4: scope:[flip]  from flip::@3
  (byte) flip::i#0 ← (byte) 0
  to:flip::@5
flip::@5: scope:[flip]  from flip::@4 flip::@5
  (byte) flip::i#2 ← phi( flip::@4/(byte) flip::i#0 flip::@5/(byte) flip::i#1 )
  *((byte[$10*$10]) buffer1#0 + (byte) flip::i#2) ← *((byte[$10*$10]) buffer2#0 + (byte) flip::i#2)
  (byte) flip::i#1 ← (byte) flip::i#2 + rangenext(0,$ff)
  (bool~) flip::$3 ← (byte) flip::i#1 != rangelast(0,$ff)
  if((bool~) flip::$3) goto flip::@5
  to:flip::@return
flip::@return: scope:[flip]  from flip::@5
  return 
  to:@return
plot: scope:[plot]  from main::@10
  (byte*~) plot::$0 ← (byte*) SCREEN#0 + (number) 5*(number) $28
  (byte*~) plot::$1 ← (byte*~) plot::$0 + (number) $c
  (byte*) plot::line#0 ← (byte*~) plot::$1
  (byte) plot::i#0 ← (number) 0
  (byte) plot::y#0 ← (byte) $10
  to:plot::@1
plot::@1: scope:[plot]  from plot plot::@3
  (byte) plot::y#4 ← phi( plot/(byte) plot::y#0 plot::@3/(byte) plot::y#1 )
  (byte*) plot::line#4 ← phi( plot/(byte*) plot::line#0 plot::@3/(byte*) plot::line#1 )
  (byte) plot::i#3 ← phi( plot/(byte) plot::i#0 plot::@3/(byte) plot::i#4 )
  (byte) plot::x#0 ← (number) 0
  to:plot::@2
plot::@2: scope:[plot]  from plot::@1 plot::@2
  (byte) plot::y#3 ← phi( plot::@1/(byte) plot::y#4 plot::@2/(byte) plot::y#3 )
  (byte) plot::x#2 ← phi( plot::@1/(byte) plot::x#0 plot::@2/(byte) plot::x#1 )
  (byte*) plot::line#2 ← phi( plot::@1/(byte*) plot::line#4 plot::@2/(byte*) plot::line#2 )
  (byte) plot::i#2 ← phi( plot::@1/(byte) plot::i#3 plot::@2/(byte) plot::i#1 )
  *((byte*) plot::line#2 + (byte) plot::x#2) ← *((byte[$10*$10]) buffer1#0 + (byte) plot::i#2)
  (byte) plot::i#1 ← ++ (byte) plot::i#2
  (byte) plot::x#1 ← ++ (byte) plot::x#2
  (bool~) plot::$2 ← (byte) plot::x#1 < (number) $10
  if((bool~) plot::$2) goto plot::@2
  to:plot::@3
plot::@3: scope:[plot]  from plot::@2
  (byte) plot::i#4 ← phi( plot::@2/(byte) plot::i#1 )
  (byte) plot::y#2 ← phi( plot::@2/(byte) plot::y#3 )
  (byte*) plot::line#3 ← phi( plot::@2/(byte*) plot::line#2 )
  (byte*~) plot::$3 ← (byte*) plot::line#3 + (number) $28
  (byte*) plot::line#1 ← (byte*~) plot::$3
  (byte) plot::y#1 ← (byte) plot::y#2 + rangenext($10,1)
  (bool~) plot::$4 ← (byte) plot::y#1 != rangelast($10,1)
  if((bool~) plot::$4) goto plot::@1
  to:plot::@return
plot::@return: scope:[plot]  from plot::@3
  return 
  to:@return
@4: scope:[]  from @begin
  call main 
  to:@5
@5: scope:[]  from @4
  to:@end
@end: scope:[]  from @5

SYMBOL TABLE SSA
(label) @4
(label) @5
(label) @begin
(label) @end
(byte*) RASTER
(byte*) RASTER#0
(byte*) SCREEN
(byte*) SCREEN#0
(byte[$10*$10]) buffer1
(byte[$10*$10]) buffer1#0
(byte[$10*$10]) buffer2
(byte[$10*$10]) buffer2#0
(void()) flip()
(number~) flip::$0
(bool~) flip::$1
(bool~) flip::$2
(bool~) flip::$3
(label) flip::@1
(label) flip::@2
(label) flip::@3
(label) flip::@4
(label) flip::@5
(label) flip::@return
(byte) flip::c
(byte) flip::c#0
(byte) flip::c#1
(byte) flip::c#2
(byte) flip::dstIdx
(byte) flip::dstIdx#0
(byte) flip::dstIdx#1
(byte) flip::dstIdx#2
(byte) flip::dstIdx#3
(byte) flip::dstIdx#4
(byte) flip::dstIdx#5
(byte) flip::i
(byte) flip::i#0
(byte) flip::i#1
(byte) flip::i#2
(byte) flip::r
(byte) flip::r#0
(byte) flip::r#1
(byte) flip::r#2
(byte) flip::r#3
(byte) flip::r#4
(byte) flip::srcIdx
(byte) flip::srcIdx#0
(byte) flip::srcIdx#1
(byte) flip::srcIdx#2
(byte) flip::srcIdx#3
(byte) flip::srcIdx#4
(void()) main()
(bool~) main::$1
(bool~) main::$2
(bool~) main::$3
(label) main::@1
(label) main::@10
(label) main::@11
(label) main::@3
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@9
(label) main::@return
(byte) main::c
(byte) main::c#0
(byte) main::c#1
(byte) main::c#2
(byte) main::c#3
(byte) main::c#4
(void()) plot()
(byte*~) plot::$0
(byte*~) plot::$1
(bool~) plot::$2
(byte*~) plot::$3
(bool~) plot::$4
(label) plot::@1
(label) plot::@2
(label) plot::@3
(label) plot::@return
(byte) plot::i
(byte) plot::i#0
(byte) plot::i#1
(byte) plot::i#2
(byte) plot::i#3
(byte) plot::i#4
(byte*) plot::line
(byte*) plot::line#0
(byte*) plot::line#1
(byte*) plot::line#2
(byte*) plot::line#3
(byte*) plot::line#4
(byte) plot::x
(byte) plot::x#0
(byte) plot::x#1
(byte) plot::x#2
(byte) plot::y
(byte) plot::y#0
(byte) plot::y#1
(byte) plot::y#2
(byte) plot::y#3
(byte) plot::y#4
(void()) prepare()
(bool~) prepare::$0
(label) prepare::@1
(label) prepare::@return
(byte) prepare::i
(byte) prepare::i#0
(byte) prepare::i#1
(byte) prepare::i#2

Adding number conversion cast (unumber) $fe in (bool~) main::$1 ← *((byte*) RASTER#0) != (number) $fe
Adding number conversion cast (unumber) $ff in (bool~) main::$2 ← *((byte*) RASTER#0) != (number) $ff
Adding number conversion cast (unumber) 0 in (byte) flip::srcIdx#0 ← (number) 0
Adding number conversion cast (unumber) $f in (byte) flip::dstIdx#0 ← (number) $f
Adding number conversion cast (unumber) $10 in (number~) flip::$0 ← (byte) flip::dstIdx#3 + (number) $10
Adding number conversion cast (unumber) flip::$0 in (number~) flip::$0 ← (byte) flip::dstIdx#3 + (unumber)(number) $10
Adding number conversion cast (unumber) 5*$28 in (byte*~) plot::$0 ← (byte*) SCREEN#0 + (number) 5*(number) $28
Adding number conversion cast (unumber) $c in (byte*~) plot::$1 ← (byte*~) plot::$0 + (number) $c
Adding number conversion cast (unumber) 0 in (byte) plot::i#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) plot::x#0 ← (number) 0
Adding number conversion cast (unumber) $10 in (bool~) plot::$2 ← (byte) plot::x#1 < (number) $10
Adding number conversion cast (unumber) $28 in (byte*~) plot::$3 ← (byte*) plot::line#3 + (number) $28
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) RASTER#0 ← (byte*)(number) $d012
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400
Inlining cast (byte) flip::srcIdx#0 ← (unumber)(number) 0
Inlining cast (byte) flip::dstIdx#0 ← (unumber)(number) $f
Inlining cast (byte) plot::i#0 ← (unumber)(number) 0
Inlining cast (byte) plot::x#0 ← (unumber)(number) 0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $fe
Simplifying constant integer cast $ff
Simplifying constant integer cast 0
Simplifying constant integer cast $f
Simplifying constant integer cast $10
Simplifying constant integer cast $c
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast $10
Simplifying constant integer cast $28
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $fe
Finalized unsigned number type (byte) $ff
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $f
Finalized unsigned number type (byte) $10
Finalized unsigned number type (byte) $c
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $10
Finalized unsigned number type (byte) $28
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) flip::$0 ← (byte) flip::dstIdx#3 + (byte) $10
Alias (byte) main::c#2 = (byte) main::c#3 
Alias (byte) flip::dstIdx#1 = (byte~) flip::$0 (byte) flip::dstIdx#4 
Alias (byte) flip::r#2 = (byte) flip::r#3 
Alias (byte) flip::srcIdx#1 = (byte) flip::srcIdx#4 
Alias (byte*) plot::line#0 = (byte*~) plot::$1 
Alias (byte*) plot::line#2 = (byte*) plot::line#3 
Alias (byte) plot::y#2 = (byte) plot::y#3 
Alias (byte) plot::i#1 = (byte) plot::i#4 
Alias (byte*) plot::line#1 = (byte*~) plot::$3 
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte) main::c#4
Self Phi Eliminated (byte) main::c#2
Self Phi Eliminated (byte) flip::r#2
Self Phi Eliminated (byte*) plot::line#2
Self Phi Eliminated (byte) plot::y#2
Successful SSA optimization Pass2SelfPhiElimination
Identical Phi Values (byte) main::c#2 (byte) main::c#4
Identical Phi Values (byte) flip::r#2 (byte) flip::r#4
Identical Phi Values (byte*) plot::line#2 (byte*) plot::line#4
Identical Phi Values (byte) plot::y#2 (byte) plot::y#4
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::$1 [8] if(*((byte*) RASTER#0)!=(byte) $fe) goto main::@3
Simple Condition (bool~) main::$2 [11] if(*((byte*) RASTER#0)!=(byte) $ff) goto main::@5
Simple Condition (bool~) main::$3 [15] if((byte) main::c#1!=rangelast($19,1)) goto main::@3
Simple Condition (bool~) prepare::$0 [25] if((byte) prepare::i#1!=rangelast(0,$ff)) goto prepare::@1
Simple Condition (bool~) flip::$1 [39] if((byte) flip::c#1!=rangelast($10,1)) goto flip::@2
Simple Condition (bool~) flip::$2 [44] if((byte) flip::r#1!=rangelast($10,1)) goto flip::@1
Simple Condition (bool~) flip::$3 [50] if((byte) flip::i#1!=rangelast(0,$ff)) goto flip::@5
Simple Condition (bool~) plot::$2 [64] if((byte) plot::x#1<(byte) $10) goto plot::@2
Simple Condition (bool~) plot::$4 [70] if((byte) plot::y#1!=rangelast($10,1)) goto plot::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [0] (byte[$10*$10]) buffer1#0 ← { fill( $10*$10, 0) }
Constant right-side identified [1] (byte[$10*$10]) buffer2#0 ← { fill( $10*$10, 0) }
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte[$10*$10]) buffer1#0 = { fill( $10*$10, 0) }
Constant (const byte[$10*$10]) buffer2#0 = { fill( $10*$10, 0) }
Constant (const byte*) RASTER#0 = (byte*) 53266
Constant (const byte*) SCREEN#0 = (byte*) 1024
Constant (const byte) main::c#0 = $19
Constant (const byte) prepare::i#0 = 0
Constant (const byte) flip::srcIdx#0 = 0
Constant (const byte) flip::dstIdx#0 = $f
Constant (const byte) flip::r#0 = $10
Constant (const byte) flip::c#0 = $10
Constant (const byte) flip::i#0 = 0
Constant (const byte) plot::i#0 = 0
Constant (const byte) plot::y#0 = $10
Constant (const byte) plot::x#0 = 0
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [18] if(true) goto main::@1
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [13] main::c#1 ← -- main::c#4 to --
Resolved ranged comparison value [15] if(main::c#1!=rangelast($19,1)) goto main::@3 to (number) 0
Resolved ranged next value [23] prepare::i#1 ← ++ prepare::i#2 to ++
Resolved ranged comparison value [25] if(prepare::i#1!=rangelast(0,$ff)) goto prepare::@1 to (number) 0
Resolved ranged next value [37] flip::c#1 ← -- flip::c#2 to --
Resolved ranged comparison value [39] if(flip::c#1!=rangelast($10,1)) goto flip::@2 to (number) 0
Resolved ranged next value [42] flip::r#1 ← -- flip::r#4 to --
Resolved ranged comparison value [44] if(flip::r#1!=rangelast($10,1)) goto flip::@1 to (number) 0
Resolved ranged next value [48] flip::i#1 ← ++ flip::i#2 to ++
Resolved ranged comparison value [50] if(flip::i#1!=rangelast(0,$ff)) goto flip::@5 to (number) 0
Resolved ranged next value [68] plot::y#1 ← -- plot::y#4 to --
Resolved ranged comparison value [70] if(plot::y#1!=rangelast($10,1)) goto plot::@1 to (number) 0
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Adding number conversion cast (unumber) 0 in if((byte) main::c#1!=(number) 0) goto main::@3
Adding number conversion cast (unumber) 0 in if((byte) prepare::i#1!=(number) 0) goto prepare::@1
Adding number conversion cast (unumber) 0 in if((byte) flip::c#1!=(number) 0) goto flip::@2
Adding number conversion cast (unumber) 0 in if((byte) flip::r#1!=(number) 0) goto flip::@1
Adding number conversion cast (unumber) 0 in if((byte) flip::i#1!=(number) 0) goto flip::@5
Adding number conversion cast (unumber) 0 in if((byte) plot::y#1!=(number) 0) goto plot::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [28] (byte*~) plot::$0 ← (const byte*) SCREEN#0 + (byte)(number) 5*(number) $28
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) plot::$0 = SCREEN#0+(byte)5*$28
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [28] (byte*) plot::line#0 ← (const byte*) plot::$0 + (byte) $c
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) plot::line#0 = plot::$0+$c
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with var siblings (const byte) main::c#0
Inlining constant with var siblings (const byte) prepare::i#0
Inlining constant with var siblings (const byte) flip::srcIdx#0
Inlining constant with var siblings (const byte) flip::dstIdx#0
Inlining constant with var siblings (const byte) flip::r#0
Inlining constant with var siblings (const byte) flip::c#0
Inlining constant with var siblings (const byte) flip::i#0
Inlining constant with var siblings (const byte) plot::i#0
Inlining constant with var siblings (const byte) plot::y#0
Inlining constant with var siblings (const byte) plot::x#0
Inlining constant with var siblings (const byte*) plot::line#0
Constant inlined plot::line#0 = (const byte*) SCREEN#0+(byte)(number) 5*(number) $28+(byte) $c
Constant inlined plot::$0 = (const byte*) SCREEN#0+(byte)(number) 5*(number) $28
Constant inlined main::c#0 = (byte) $19
Constant inlined flip::i#0 = (byte) 0
Constant inlined flip::srcIdx#0 = (byte) 0
Constant inlined prepare::i#0 = (byte) 0
Constant inlined plot::x#0 = (byte) 0
Constant inlined plot::i#0 = (byte) 0
Constant inlined plot::y#0 = (byte) $10
Constant inlined flip::c#0 = (byte) $10
Constant inlined flip::dstIdx#0 = (byte) $f
Constant inlined flip::r#0 = (byte) $10
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@12(between main::@6 and main::@3)
Added new block during phi lifting prepare::@3(between prepare::@1 and prepare::@1)
Added new block during phi lifting flip::@7(between flip::@3 and flip::@1)
Added new block during phi lifting flip::@8(between flip::@2 and flip::@2)
Added new block during phi lifting flip::@9(between flip::@5 and flip::@5)
Added new block during phi lifting plot::@5(between plot::@3 and plot::@1)
Added new block during phi lifting plot::@6(between plot::@2 and plot::@2)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @4
Adding NOP phi() at start of @5
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@9
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@7
Adding NOP phi() at start of main::@10
Adding NOP phi() at start of main::@11
Adding NOP phi() at start of plot
Adding NOP phi() at start of flip
Adding NOP phi() at start of flip::@4
Adding NOP phi() at start of prepare
CALL GRAPH
Calls in [] to main:2 
Calls in [main] to prepare:6 flip:15 plot:17 

Created 14 initial phi equivalence classes
Coalesced [19] main::c#5 ← main::c#1
Coalesced [22] plot::i#6 ← plot::i#3
Coalesced [32] plot::i#5 ← plot::i#1
Coalesced [33] plot::line#5 ← plot::line#1
Coalesced [34] plot::y#5 ← plot::y#1
Coalesced (already) [35] plot::i#7 ← plot::i#1
Coalesced [36] plot::x#3 ← plot::x#1
Coalesced [39] flip::srcIdx#6 ← flip::srcIdx#3
Coalesced [40] flip::dstIdx#7 ← flip::dstIdx#5
Coalesced [56] flip::i#3 ← flip::i#1
Coalesced [57] flip::srcIdx#5 ← flip::srcIdx#1
Coalesced [58] flip::dstIdx#6 ← flip::dstIdx#2
Coalesced [59] flip::r#5 ← flip::r#1
Coalesced (already) [60] flip::srcIdx#7 ← flip::srcIdx#1
Coalesced [61] flip::dstIdx#8 ← flip::dstIdx#1
Coalesced [62] flip::c#3 ← flip::c#1
Coalesced [69] prepare::i#3 ← prepare::i#1
Coalesced down to 11 phi equivalence classes
Culled Empty Block (label) @5
Culled Empty Block (label) main::@9
Culled Empty Block (label) main::@1
Culled Empty Block (label) main::@11
Culled Empty Block (label) main::@12
Culled Empty Block (label) plot::@5
Culled Empty Block (label) plot::@6
Culled Empty Block (label) flip::@4
Culled Empty Block (label) flip::@9
Culled Empty Block (label) flip::@7
Culled Empty Block (label) flip::@8
Culled Empty Block (label) prepare::@3
Renumbering block @4 to @1
Renumbering block main::@3 to main::@1
Renumbering block main::@5 to main::@2
Renumbering block main::@6 to main::@3
Renumbering block main::@7 to main::@4
Renumbering block main::@10 to main::@5
Renumbering block flip::@5 to flip::@4
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@4
Adding NOP phi() at start of main::@5
Adding NOP phi() at start of plot
Adding NOP phi() at start of flip
Adding NOP phi() at start of prepare

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  [1] phi()
  [2] call main 
  to:@end
@end: scope:[]  from @1
  [3] phi()
main: scope:[main]  from @1
  [4] phi()
  [5] call prepare 
  to:main::@1
main::@1: scope:[main]  from main main::@1 main::@3 main::@5
  [6] (byte) main::c#4 ← phi( main/(byte) $19 main::@3/(byte) main::c#1 main::@5/(byte) $19 )
  [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@1 main::@2
  [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2
  to:main::@3
main::@3: scope:[main]  from main::@2
  [9] (byte) main::c#1 ← -- (byte) main::c#4
  [10] if((byte) main::c#1!=(byte) 0) goto main::@1
  to:main::@4
main::@4: scope:[main]  from main::@3
  [11] phi()
  [12] call flip 
  to:main::@5
main::@5: scope:[main]  from main::@4
  [13] phi()
  [14] call plot 
  to:main::@1
plot: scope:[plot]  from main::@5
  [15] phi()
  to:plot::@1
plot::@1: scope:[plot]  from plot plot::@3
  [16] (byte) plot::y#4 ← phi( plot/(byte) $10 plot::@3/(byte) plot::y#1 )
  [16] (byte*) plot::line#4 ← phi( plot/(const byte*) SCREEN#0+(byte)(number) 5*(number) $28+(byte) $c plot::@3/(byte*) plot::line#1 )
  [16] (byte) plot::i#3 ← phi( plot/(byte) 0 plot::@3/(byte) plot::i#1 )
  to:plot::@2
plot::@2: scope:[plot]  from plot::@1 plot::@2
  [17] (byte) plot::x#2 ← phi( plot::@1/(byte) 0 plot::@2/(byte) plot::x#1 )
  [17] (byte) plot::i#2 ← phi( plot::@1/(byte) plot::i#3 plot::@2/(byte) plot::i#1 )
  [18] *((byte*) plot::line#4 + (byte) plot::x#2) ← *((const byte[$10*$10]) buffer1#0 + (byte) plot::i#2)
  [19] (byte) plot::i#1 ← ++ (byte) plot::i#2
  [20] (byte) plot::x#1 ← ++ (byte) plot::x#2
  [21] if((byte) plot::x#1<(byte) $10) goto plot::@2
  to:plot::@3
plot::@3: scope:[plot]  from plot::@2
  [22] (byte*) plot::line#1 ← (byte*) plot::line#4 + (byte) $28
  [23] (byte) plot::y#1 ← -- (byte) plot::y#4
  [24] if((byte) plot::y#1!=(byte) 0) goto plot::@1
  to:plot::@return
plot::@return: scope:[plot]  from plot::@3
  [25] return 
  to:@return
flip: scope:[flip]  from main::@4
  [26] phi()
  to:flip::@1
flip::@1: scope:[flip]  from flip flip::@3
  [27] (byte) flip::r#4 ← phi( flip/(byte) $10 flip::@3/(byte) flip::r#1 )
  [27] (byte) flip::dstIdx#5 ← phi( flip/(byte) $f flip::@3/(byte) flip::dstIdx#2 )
  [27] (byte) flip::srcIdx#3 ← phi( flip/(byte) 0 flip::@3/(byte) flip::srcIdx#1 )
  to:flip::@2
flip::@2: scope:[flip]  from flip::@1 flip::@2
  [28] (byte) flip::c#2 ← phi( flip::@1/(byte) $10 flip::@2/(byte) flip::c#1 )
  [28] (byte) flip::dstIdx#3 ← phi( flip::@1/(byte) flip::dstIdx#5 flip::@2/(byte) flip::dstIdx#1 )
  [28] (byte) flip::srcIdx#2 ← phi( flip::@1/(byte) flip::srcIdx#3 flip::@2/(byte) flip::srcIdx#1 )
  [29] *((const byte[$10*$10]) buffer2#0 + (byte) flip::dstIdx#3) ← *((const byte[$10*$10]) buffer1#0 + (byte) flip::srcIdx#2)
  [30] (byte) flip::srcIdx#1 ← ++ (byte) flip::srcIdx#2
  [31] (byte) flip::dstIdx#1 ← (byte) flip::dstIdx#3 + (byte) $10
  [32] (byte) flip::c#1 ← -- (byte) flip::c#2
  [33] if((byte) flip::c#1!=(byte) 0) goto flip::@2
  to:flip::@3
flip::@3: scope:[flip]  from flip::@2
  [34] (byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#1
  [35] (byte) flip::r#1 ← -- (byte) flip::r#4
  [36] if((byte) flip::r#1!=(byte) 0) goto flip::@1
  to:flip::@4
flip::@4: scope:[flip]  from flip::@3 flip::@4
  [37] (byte) flip::i#2 ← phi( flip::@3/(byte) 0 flip::@4/(byte) flip::i#1 )
  [38] *((const byte[$10*$10]) buffer1#0 + (byte) flip::i#2) ← *((const byte[$10*$10]) buffer2#0 + (byte) flip::i#2)
  [39] (byte) flip::i#1 ← ++ (byte) flip::i#2
  [40] if((byte) flip::i#1!=(byte) 0) goto flip::@4
  to:flip::@return
flip::@return: scope:[flip]  from flip::@4
  [41] return 
  to:@return
prepare: scope:[prepare]  from main
  [42] phi()
  to:prepare::@1
prepare::@1: scope:[prepare]  from prepare prepare::@1
  [43] (byte) prepare::i#2 ← phi( prepare/(byte) 0 prepare::@1/(byte) prepare::i#1 )
  [44] *((const byte[$10*$10]) buffer1#0 + (byte) prepare::i#2) ← (byte) prepare::i#2
  [45] (byte) prepare::i#1 ← ++ (byte) prepare::i#2
  [46] if((byte) prepare::i#1!=(byte) 0) goto prepare::@1
  to:prepare::@return
prepare::@return: scope:[prepare]  from prepare::@1
  [47] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(byte*) RASTER
(byte*) SCREEN
(byte[$10*$10]) buffer1
(byte[$10*$10]) buffer2
(void()) flip()
(byte) flip::c
(byte) flip::c#1 1501.5
(byte) flip::c#2 500.5
(byte) flip::dstIdx
(byte) flip::dstIdx#1 701.0
(byte) flip::dstIdx#2 67.33333333333333
(byte) flip::dstIdx#3 1034.6666666666667
(byte) flip::dstIdx#5 202.0
(byte) flip::i
(byte) flip::i#1 151.5
(byte) flip::i#2 202.0
(byte) flip::r
(byte) flip::r#1 151.5
(byte) flip::r#4 25.25
(byte) flip::srcIdx
(byte) flip::srcIdx#1 300.42857142857144
(byte) flip::srcIdx#2 1552.0
(byte) flip::srcIdx#3 202.0
(void()) main()
(byte) main::c
(byte) main::c#1 151.5
(byte) main::c#4 67.33333333333333
(void()) plot()
(byte) plot::i
(byte) plot::i#1 350.5
(byte) plot::i#2 1552.0
(byte) plot::i#3 202.0
(byte*) plot::line
(byte*) plot::line#1 67.33333333333333
(byte*) plot::line#4 200.50000000000003
(byte) plot::x
(byte) plot::x#1 1501.5
(byte) plot::x#2 1001.0
(byte) plot::y
(byte) plot::y#1 151.5
(byte) plot::y#4 28.857142857142858
(void()) prepare()
(byte) prepare::i
(byte) prepare::i#1 16.5
(byte) prepare::i#2 22.0

Initial phi equivalence classes
[ main::c#4 main::c#1 ]
[ plot::line#4 plot::line#1 ]
[ plot::y#4 plot::y#1 ]
[ plot::i#2 plot::i#3 plot::i#1 ]
[ plot::x#2 plot::x#1 ]
[ flip::r#4 flip::r#1 ]
[ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ]
[ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ]
[ flip::c#2 flip::c#1 ]
[ flip::i#2 flip::i#1 ]
[ prepare::i#2 prepare::i#1 ]
Complete equivalence classes
[ main::c#4 main::c#1 ]
[ plot::line#4 plot::line#1 ]
[ plot::y#4 plot::y#1 ]
[ plot::i#2 plot::i#3 plot::i#1 ]
[ plot::x#2 plot::x#1 ]
[ flip::r#4 flip::r#1 ]
[ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ]
[ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ]
[ flip::c#2 flip::c#1 ]
[ flip::i#2 flip::i#1 ]
[ prepare::i#2 prepare::i#1 ]
Allocated zp ZP_BYTE:2 [ main::c#4 main::c#1 ]
Allocated zp ZP_WORD:3 [ plot::line#4 plot::line#1 ]
Allocated zp ZP_BYTE:5 [ plot::y#4 plot::y#1 ]
Allocated zp ZP_BYTE:6 [ plot::i#2 plot::i#3 plot::i#1 ]
Allocated zp ZP_BYTE:7 [ plot::x#2 plot::x#1 ]
Allocated zp ZP_BYTE:8 [ flip::r#4 flip::r#1 ]
Allocated zp ZP_BYTE:9 [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ]
Allocated zp ZP_BYTE:10 [ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ]
Allocated zp ZP_BYTE:11 [ flip::c#2 flip::c#1 ]
Allocated zp ZP_BYTE:12 [ flip::i#2 flip::i#1 ]
Allocated zp ZP_BYTE:13 [ prepare::i#2 prepare::i#1 ]

INITIAL ASM
  // File Comments
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label RASTER = $d012
  .label SCREEN = $400
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from_b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    .label c = 2
    // [5] call prepare 
    // [42] phi from main to prepare [phi:main->prepare]
  prepare_from_main:
    jsr prepare
    // [6] phi from main main::@5 to main::@1 [phi:main/main::@5->main::@1]
  b1_from_main:
  b1_from_b5:
    // [6] phi (byte) main::c#4 = (byte) $19 [phi:main/main::@5->main::@1#0] -- vbuz1=vbuc1 
    lda #$19
    sta c
    jmp b1
    // [6] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
  b1_from_b1:
    jmp b1
    // [6] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
  b1_from_b3:
    // [6] phi (byte) main::c#4 = (byte) main::c#1 [phi:main::@3->main::@1#0] -- register_copy 
    jmp b1
    // main::@1
  b1:
    // [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$fe
    cmp RASTER
    bne b1_from_b1
    jmp b2
    // main::@2
  b2:
    // [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$ff
    cmp RASTER
    bne b2
    jmp b3
    // main::@3
  b3:
    // [9] (byte) main::c#1 ← -- (byte) main::c#4 -- vbuz1=_dec_vbuz1 
    dec c
    // [10] if((byte) main::c#1!=(byte) 0) goto main::@1 -- vbuz1_neq_0_then_la1 
    lda c
    cmp #0
    bne b1_from_b3
    // [11] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
  b4_from_b3:
    jmp b4
    // main::@4
  b4:
    // [12] call flip 
    // [26] phi from main::@4 to flip [phi:main::@4->flip]
  flip_from_b4:
    jsr flip
    // [13] phi from main::@4 to main::@5 [phi:main::@4->main::@5]
  b5_from_b4:
    jmp b5
    // main::@5
  b5:
    // [14] call plot 
    // [15] phi from main::@5 to plot [phi:main::@5->plot]
  plot_from_b5:
    jsr plot
    jmp b1_from_b5
}
  // plot
// Plot buffer on screen
plot: {
    .label i = 6
    .label x = 7
    .label line = 3
    .label y = 5
    // [16] phi from plot to plot::@1 [phi:plot->plot::@1]
  b1_from_plot:
    // [16] phi (byte) plot::y#4 = (byte) $10 [phi:plot->plot::@1#0] -- vbuz1=vbuc1 
    lda #$10
    sta y
    // [16] phi (byte*) plot::line#4 = (const byte*) SCREEN#0+(byte)(number) 5*(number) $28+(byte) $c [phi:plot->plot::@1#1] -- pbuz1=pbuc1 
    lda #<SCREEN+5*$28+$c
    sta line
    lda #>SCREEN+5*$28+$c
    sta line+1
    // [16] phi (byte) plot::i#3 = (byte) 0 [phi:plot->plot::@1#2] -- vbuz1=vbuc1 
    lda #0
    sta i
    jmp b1
    // [16] phi from plot::@3 to plot::@1 [phi:plot::@3->plot::@1]
  b1_from_b3:
    // [16] phi (byte) plot::y#4 = (byte) plot::y#1 [phi:plot::@3->plot::@1#0] -- register_copy 
    // [16] phi (byte*) plot::line#4 = (byte*) plot::line#1 [phi:plot::@3->plot::@1#1] -- register_copy 
    // [16] phi (byte) plot::i#3 = (byte) plot::i#1 [phi:plot::@3->plot::@1#2] -- register_copy 
    jmp b1
    // plot::@1
  b1:
    // [17] phi from plot::@1 to plot::@2 [phi:plot::@1->plot::@2]
  b2_from_b1:
    // [17] phi (byte) plot::x#2 = (byte) 0 [phi:plot::@1->plot::@2#0] -- vbuz1=vbuc1 
    lda #0
    sta x
    // [17] phi (byte) plot::i#2 = (byte) plot::i#3 [phi:plot::@1->plot::@2#1] -- register_copy 
    jmp b2
    // [17] phi from plot::@2 to plot::@2 [phi:plot::@2->plot::@2]
  b2_from_b2:
    // [17] phi (byte) plot::x#2 = (byte) plot::x#1 [phi:plot::@2->plot::@2#0] -- register_copy 
    // [17] phi (byte) plot::i#2 = (byte) plot::i#1 [phi:plot::@2->plot::@2#1] -- register_copy 
    jmp b2
    // plot::@2
  b2:
    // [18] *((byte*) plot::line#4 + (byte) plot::x#2) ← *((const byte[$10*$10]) buffer1#0 + (byte) plot::i#2) -- pbuz1_derefidx_vbuz2=pbuc1_derefidx_vbuz3 
    ldy i
    lda buffer1,y
    ldy x
    sta (line),y
    // [19] (byte) plot::i#1 ← ++ (byte) plot::i#2 -- vbuz1=_inc_vbuz1 
    inc i
    // [20] (byte) plot::x#1 ← ++ (byte) plot::x#2 -- vbuz1=_inc_vbuz1 
    inc x
    // [21] if((byte) plot::x#1<(byte) $10) goto plot::@2 -- vbuz1_lt_vbuc1_then_la1 
    lda x
    cmp #$10
    bcc b2_from_b2
    jmp b3
    // plot::@3
  b3:
    // [22] (byte*) plot::line#1 ← (byte*) plot::line#4 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 
    lda #$28
    clc
    adc line
    sta line
    bcc !+
    inc line+1
  !:
    // [23] (byte) plot::y#1 ← -- (byte) plot::y#4 -- vbuz1=_dec_vbuz1 
    dec y
    // [24] if((byte) plot::y#1!=(byte) 0) goto plot::@1 -- vbuz1_neq_0_then_la1 
    lda y
    cmp #0
    bne b1_from_b3
    jmp breturn
    // plot::@return
  breturn:
    // [25] return 
    rts
}
  // flip
// Flip buffer
flip: {
    .label srcIdx = 9
    .label dstIdx = $a
    .label c = $b
    .label r = 8
    .label i = $c
    // [27] phi from flip to flip::@1 [phi:flip->flip::@1]
  b1_from_flip:
    // [27] phi (byte) flip::r#4 = (byte) $10 [phi:flip->flip::@1#0] -- vbuz1=vbuc1 
    lda #$10
    sta r
    // [27] phi (byte) flip::dstIdx#5 = (byte) $f [phi:flip->flip::@1#1] -- vbuz1=vbuc1 
    lda #$f
    sta dstIdx
    // [27] phi (byte) flip::srcIdx#3 = (byte) 0 [phi:flip->flip::@1#2] -- vbuz1=vbuc1 
    lda #0
    sta srcIdx
    jmp b1
    // [27] phi from flip::@3 to flip::@1 [phi:flip::@3->flip::@1]
  b1_from_b3:
    // [27] phi (byte) flip::r#4 = (byte) flip::r#1 [phi:flip::@3->flip::@1#0] -- register_copy 
    // [27] phi (byte) flip::dstIdx#5 = (byte) flip::dstIdx#2 [phi:flip::@3->flip::@1#1] -- register_copy 
    // [27] phi (byte) flip::srcIdx#3 = (byte) flip::srcIdx#1 [phi:flip::@3->flip::@1#2] -- register_copy 
    jmp b1
    // flip::@1
  b1:
    // [28] phi from flip::@1 to flip::@2 [phi:flip::@1->flip::@2]
  b2_from_b1:
    // [28] phi (byte) flip::c#2 = (byte) $10 [phi:flip::@1->flip::@2#0] -- vbuz1=vbuc1 
    lda #$10
    sta c
    // [28] phi (byte) flip::dstIdx#3 = (byte) flip::dstIdx#5 [phi:flip::@1->flip::@2#1] -- register_copy 
    // [28] phi (byte) flip::srcIdx#2 = (byte) flip::srcIdx#3 [phi:flip::@1->flip::@2#2] -- register_copy 
    jmp b2
    // [28] phi from flip::@2 to flip::@2 [phi:flip::@2->flip::@2]
  b2_from_b2:
    // [28] phi (byte) flip::c#2 = (byte) flip::c#1 [phi:flip::@2->flip::@2#0] -- register_copy 
    // [28] phi (byte) flip::dstIdx#3 = (byte) flip::dstIdx#1 [phi:flip::@2->flip::@2#1] -- register_copy 
    // [28] phi (byte) flip::srcIdx#2 = (byte) flip::srcIdx#1 [phi:flip::@2->flip::@2#2] -- register_copy 
    jmp b2
    // flip::@2
  b2:
    // [29] *((const byte[$10*$10]) buffer2#0 + (byte) flip::dstIdx#3) ← *((const byte[$10*$10]) buffer1#0 + (byte) flip::srcIdx#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 
    ldy srcIdx
    lda buffer1,y
    ldy dstIdx
    sta buffer2,y
    // [30] (byte) flip::srcIdx#1 ← ++ (byte) flip::srcIdx#2 -- vbuz1=_inc_vbuz1 
    inc srcIdx
    // [31] (byte) flip::dstIdx#1 ← (byte) flip::dstIdx#3 + (byte) $10 -- vbuz1=vbuz1_plus_vbuc1 
    lax dstIdx
    axs #-[$10]
    stx dstIdx
    // [32] (byte) flip::c#1 ← -- (byte) flip::c#2 -- vbuz1=_dec_vbuz1 
    dec c
    // [33] if((byte) flip::c#1!=(byte) 0) goto flip::@2 -- vbuz1_neq_0_then_la1 
    lda c
    cmp #0
    bne b2_from_b2
    jmp b3
    // flip::@3
  b3:
    // [34] (byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#1 -- vbuz1=_dec_vbuz1 
    dec dstIdx
    // [35] (byte) flip::r#1 ← -- (byte) flip::r#4 -- vbuz1=_dec_vbuz1 
    dec r
    // [36] if((byte) flip::r#1!=(byte) 0) goto flip::@1 -- vbuz1_neq_0_then_la1 
    lda r
    cmp #0
    bne b1_from_b3
    // [37] phi from flip::@3 to flip::@4 [phi:flip::@3->flip::@4]
  b4_from_b3:
    // [37] phi (byte) flip::i#2 = (byte) 0 [phi:flip::@3->flip::@4#0] -- vbuz1=vbuc1 
    lda #0
    sta i
    jmp b4
    // [37] phi from flip::@4 to flip::@4 [phi:flip::@4->flip::@4]
  b4_from_b4:
    // [37] phi (byte) flip::i#2 = (byte) flip::i#1 [phi:flip::@4->flip::@4#0] -- register_copy 
    jmp b4
    // flip::@4
  b4:
    // [38] *((const byte[$10*$10]) buffer1#0 + (byte) flip::i#2) ← *((const byte[$10*$10]) buffer2#0 + (byte) flip::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 
    ldy i
    lda buffer2,y
    sta buffer1,y
    // [39] (byte) flip::i#1 ← ++ (byte) flip::i#2 -- vbuz1=_inc_vbuz1 
    inc i
    // [40] if((byte) flip::i#1!=(byte) 0) goto flip::@4 -- vbuz1_neq_0_then_la1 
    lda i
    cmp #0
    bne b4_from_b4
    jmp breturn
    // flip::@return
  breturn:
    // [41] return 
    rts
}
  // prepare
// Prepare buffer
prepare: {
    .label i = $d
    // [43] phi from prepare to prepare::@1 [phi:prepare->prepare::@1]
  b1_from_prepare:
    // [43] phi (byte) prepare::i#2 = (byte) 0 [phi:prepare->prepare::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta i
    jmp b1
    // [43] phi from prepare::@1 to prepare::@1 [phi:prepare::@1->prepare::@1]
  b1_from_b1:
    // [43] phi (byte) prepare::i#2 = (byte) prepare::i#1 [phi:prepare::@1->prepare::@1#0] -- register_copy 
    jmp b1
    // prepare::@1
  b1:
    // [44] *((const byte[$10*$10]) buffer1#0 + (byte) prepare::i#2) ← (byte) prepare::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 
    ldy i
    tya
    sta buffer1,y
    // [45] (byte) prepare::i#1 ← ++ (byte) prepare::i#2 -- vbuz1=_inc_vbuz1 
    inc i
    // [46] if((byte) prepare::i#1!=(byte) 0) goto prepare::@1 -- vbuz1_neq_0_then_la1 
    lda i
    cmp #0
    bne b1_from_b1
    jmp breturn
    // prepare::@return
  breturn:
    // [47] return 
    rts
}
  // File Data
  buffer1: .fill $10*$10, 0
  buffer2: .fill $10*$10, 0

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 [ main::c#4 ] ( main:2 [ main::c#4 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::c#4 main::c#1 ]
Statement [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 [ main::c#4 ] ( main:2 [ main::c#4 ] ) always clobbers reg byte a 
Statement [18] *((byte*) plot::line#4 + (byte) plot::x#2) ← *((const byte[$10*$10]) buffer1#0 + (byte) plot::i#2) [ plot::line#4 plot::y#4 plot::i#2 plot::x#2 ] ( main:2::plot:14 [ plot::line#4 plot::y#4 plot::i#2 plot::x#2 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ plot::y#4 plot::y#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ plot::i#2 plot::i#3 plot::i#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ plot::x#2 plot::x#1 ]
Statement [22] (byte*) plot::line#1 ← (byte*) plot::line#4 + (byte) $28 [ plot::y#4 plot::i#1 plot::line#1 ] ( main:2::plot:14 [ plot::y#4 plot::i#1 plot::line#1 ] ) always clobbers reg byte a 
Statement [29] *((const byte[$10*$10]) buffer2#0 + (byte) flip::dstIdx#3) ← *((const byte[$10*$10]) buffer1#0 + (byte) flip::srcIdx#2) [ flip::r#4 flip::srcIdx#2 flip::dstIdx#3 flip::c#2 ] ( main:2::flip:12 [ flip::r#4 flip::srcIdx#2 flip::dstIdx#3 flip::c#2 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:8 [ flip::r#4 flip::r#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:9 [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:10 [ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:11 [ flip::c#2 flip::c#1 ]
Statement [31] (byte) flip::dstIdx#1 ← (byte) flip::dstIdx#3 + (byte) $10 [ flip::r#4 flip::srcIdx#1 flip::c#2 flip::dstIdx#1 ] ( main:2::flip:12 [ flip::r#4 flip::srcIdx#1 flip::c#2 flip::dstIdx#1 ] ) always clobbers reg byte a 
Statement [38] *((const byte[$10*$10]) buffer1#0 + (byte) flip::i#2) ← *((const byte[$10*$10]) buffer2#0 + (byte) flip::i#2) [ flip::i#2 ] ( main:2::flip:12 [ flip::i#2 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:12 [ flip::i#2 flip::i#1 ]
Statement [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 [ main::c#4 ] ( main:2 [ main::c#4 ] ) always clobbers reg byte a 
Statement [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 [ main::c#4 ] ( main:2 [ main::c#4 ] ) always clobbers reg byte a 
Statement [18] *((byte*) plot::line#4 + (byte) plot::x#2) ← *((const byte[$10*$10]) buffer1#0 + (byte) plot::i#2) [ plot::line#4 plot::y#4 plot::i#2 plot::x#2 ] ( main:2::plot:14 [ plot::line#4 plot::y#4 plot::i#2 plot::x#2 ] ) always clobbers reg byte a 
Statement [22] (byte*) plot::line#1 ← (byte*) plot::line#4 + (byte) $28 [ plot::y#4 plot::i#1 plot::line#1 ] ( main:2::plot:14 [ plot::y#4 plot::i#1 plot::line#1 ] ) always clobbers reg byte a 
Statement [29] *((const byte[$10*$10]) buffer2#0 + (byte) flip::dstIdx#3) ← *((const byte[$10*$10]) buffer1#0 + (byte) flip::srcIdx#2) [ flip::r#4 flip::srcIdx#2 flip::dstIdx#3 flip::c#2 ] ( main:2::flip:12 [ flip::r#4 flip::srcIdx#2 flip::dstIdx#3 flip::c#2 ] ) always clobbers reg byte a 
Statement [31] (byte) flip::dstIdx#1 ← (byte) flip::dstIdx#3 + (byte) $10 [ flip::r#4 flip::srcIdx#1 flip::c#2 flip::dstIdx#1 ] ( main:2::flip:12 [ flip::r#4 flip::srcIdx#1 flip::c#2 flip::dstIdx#1 ] ) always clobbers reg byte a 
Statement [38] *((const byte[$10*$10]) buffer1#0 + (byte) flip::i#2) ← *((const byte[$10*$10]) buffer2#0 + (byte) flip::i#2) [ flip::i#2 ] ( main:2::flip:12 [ flip::i#2 ] ) always clobbers reg byte a 
Potential registers zp ZP_BYTE:2 [ main::c#4 main::c#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , 
Potential registers zp ZP_WORD:3 [ plot::line#4 plot::line#1 ] : zp ZP_WORD:3 , 
Potential registers zp ZP_BYTE:5 [ plot::y#4 plot::y#1 ] : zp ZP_BYTE:5 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:6 [ plot::i#2 plot::i#3 plot::i#1 ] : zp ZP_BYTE:6 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:7 [ plot::x#2 plot::x#1 ] : zp ZP_BYTE:7 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:8 [ flip::r#4 flip::r#1 ] : zp ZP_BYTE:8 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:9 [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ] : zp ZP_BYTE:9 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:10 [ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ] : zp ZP_BYTE:10 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:11 [ flip::c#2 flip::c#1 ] : zp ZP_BYTE:11 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:12 [ flip::i#2 flip::i#1 ] : zp ZP_BYTE:12 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:13 [ prepare::i#2 prepare::i#1 ] : zp ZP_BYTE:13 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [flip] 2,054.43: zp ZP_BYTE:9 [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ] 2,005: zp ZP_BYTE:10 [ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ] 2,002: zp ZP_BYTE:11 [ flip::c#2 flip::c#1 ] 353.5: zp ZP_BYTE:12 [ flip::i#2 flip::i#1 ] 176.75: zp ZP_BYTE:8 [ flip::r#4 flip::r#1 ] 
Uplift Scope [plot] 2,502.5: zp ZP_BYTE:7 [ plot::x#2 plot::x#1 ] 2,104.5: zp ZP_BYTE:6 [ plot::i#2 plot::i#3 plot::i#1 ] 267.83: zp ZP_WORD:3 [ plot::line#4 plot::line#1 ] 180.36: zp ZP_BYTE:5 [ plot::y#4 plot::y#1 ] 
Uplift Scope [main] 218.83: zp ZP_BYTE:2 [ main::c#4 main::c#1 ] 
Uplift Scope [prepare] 38.5: zp ZP_BYTE:13 [ prepare::i#2 prepare::i#1 ] 
Uplift Scope [] 

Uplifting [flip] best 140276 combination reg byte y [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ] reg byte x [ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ] zp ZP_BYTE:11 [ flip::c#2 flip::c#1 ] reg byte x [ flip::i#2 flip::i#1 ] zp ZP_BYTE:8 [ flip::r#4 flip::r#1 ] 
Limited combination testing to 100 combinations of 243 possible.
Uplifting [plot] best 121976 combination reg byte y [ plot::x#2 plot::x#1 ] reg byte x [ plot::i#2 plot::i#3 plot::i#1 ] zp ZP_WORD:3 [ plot::line#4 plot::line#1 ] zp ZP_BYTE:5 [ plot::y#4 plot::y#1 ] 
Uplifting [main] best 118376 combination reg byte x [ main::c#4 main::c#1 ] 
Uplifting [prepare] best 118256 combination reg byte x [ prepare::i#2 prepare::i#1 ] 
Uplifting [] best 118256 combination 
Attempting to uplift remaining variables inzp ZP_BYTE:11 [ flip::c#2 flip::c#1 ]
Uplifting [flip] best 118256 combination zp ZP_BYTE:11 [ flip::c#2 flip::c#1 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:5 [ plot::y#4 plot::y#1 ]
Uplifting [plot] best 118256 combination zp ZP_BYTE:5 [ plot::y#4 plot::y#1 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:8 [ flip::r#4 flip::r#1 ]
Uplifting [flip] best 118256 combination zp ZP_BYTE:8 [ flip::r#4 flip::r#1 ] 
Allocated (was zp ZP_WORD:3) zp ZP_WORD:2 [ plot::line#4 plot::line#1 ]
Allocated (was zp ZP_BYTE:5) zp ZP_BYTE:4 [ plot::y#4 plot::y#1 ]
Allocated (was zp ZP_BYTE:8) zp ZP_BYTE:5 [ flip::r#4 flip::r#1 ]
Allocated (was zp ZP_BYTE:11) zp ZP_BYTE:6 [ flip::c#2 flip::c#1 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label RASTER = $d012
  .label SCREEN = $400
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from_b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    // [5] call prepare 
    // [42] phi from main to prepare [phi:main->prepare]
  prepare_from_main:
    jsr prepare
    // [6] phi from main main::@5 to main::@1 [phi:main/main::@5->main::@1]
  b1_from_main:
  b1_from_b5:
    // [6] phi (byte) main::c#4 = (byte) $19 [phi:main/main::@5->main::@1#0] -- vbuxx=vbuc1 
    ldx #$19
    jmp b1
    // [6] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
  b1_from_b1:
    jmp b1
    // [6] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
  b1_from_b3:
    // [6] phi (byte) main::c#4 = (byte) main::c#1 [phi:main::@3->main::@1#0] -- register_copy 
    jmp b1
    // main::@1
  b1:
    // [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$fe
    cmp RASTER
    bne b1_from_b1
    jmp b2
    // main::@2
  b2:
    // [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$ff
    cmp RASTER
    bne b2
    jmp b3
    // main::@3
  b3:
    // [9] (byte) main::c#1 ← -- (byte) main::c#4 -- vbuxx=_dec_vbuxx 
    dex
    // [10] if((byte) main::c#1!=(byte) 0) goto main::@1 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne b1_from_b3
    // [11] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
  b4_from_b3:
    jmp b4
    // main::@4
  b4:
    // [12] call flip 
    // [26] phi from main::@4 to flip [phi:main::@4->flip]
  flip_from_b4:
    jsr flip
    // [13] phi from main::@4 to main::@5 [phi:main::@4->main::@5]
  b5_from_b4:
    jmp b5
    // main::@5
  b5:
    // [14] call plot 
    // [15] phi from main::@5 to plot [phi:main::@5->plot]
  plot_from_b5:
    jsr plot
    jmp b1_from_b5
}
  // plot
// Plot buffer on screen
plot: {
    .label line = 2
    .label y = 4
    // [16] phi from plot to plot::@1 [phi:plot->plot::@1]
  b1_from_plot:
    // [16] phi (byte) plot::y#4 = (byte) $10 [phi:plot->plot::@1#0] -- vbuz1=vbuc1 
    lda #$10
    sta y
    // [16] phi (byte*) plot::line#4 = (const byte*) SCREEN#0+(byte)(number) 5*(number) $28+(byte) $c [phi:plot->plot::@1#1] -- pbuz1=pbuc1 
    lda #<SCREEN+5*$28+$c
    sta line
    lda #>SCREEN+5*$28+$c
    sta line+1
    // [16] phi (byte) plot::i#3 = (byte) 0 [phi:plot->plot::@1#2] -- vbuxx=vbuc1 
    ldx #0
    jmp b1
    // [16] phi from plot::@3 to plot::@1 [phi:plot::@3->plot::@1]
  b1_from_b3:
    // [16] phi (byte) plot::y#4 = (byte) plot::y#1 [phi:plot::@3->plot::@1#0] -- register_copy 
    // [16] phi (byte*) plot::line#4 = (byte*) plot::line#1 [phi:plot::@3->plot::@1#1] -- register_copy 
    // [16] phi (byte) plot::i#3 = (byte) plot::i#1 [phi:plot::@3->plot::@1#2] -- register_copy 
    jmp b1
    // plot::@1
  b1:
    // [17] phi from plot::@1 to plot::@2 [phi:plot::@1->plot::@2]
  b2_from_b1:
    // [17] phi (byte) plot::x#2 = (byte) 0 [phi:plot::@1->plot::@2#0] -- vbuyy=vbuc1 
    ldy #0
    // [17] phi (byte) plot::i#2 = (byte) plot::i#3 [phi:plot::@1->plot::@2#1] -- register_copy 
    jmp b2
    // [17] phi from plot::@2 to plot::@2 [phi:plot::@2->plot::@2]
  b2_from_b2:
    // [17] phi (byte) plot::x#2 = (byte) plot::x#1 [phi:plot::@2->plot::@2#0] -- register_copy 
    // [17] phi (byte) plot::i#2 = (byte) plot::i#1 [phi:plot::@2->plot::@2#1] -- register_copy 
    jmp b2
    // plot::@2
  b2:
    // [18] *((byte*) plot::line#4 + (byte) plot::x#2) ← *((const byte[$10*$10]) buffer1#0 + (byte) plot::i#2) -- pbuz1_derefidx_vbuyy=pbuc1_derefidx_vbuxx 
    lda buffer1,x
    sta (line),y
    // [19] (byte) plot::i#1 ← ++ (byte) plot::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [20] (byte) plot::x#1 ← ++ (byte) plot::x#2 -- vbuyy=_inc_vbuyy 
    iny
    // [21] if((byte) plot::x#1<(byte) $10) goto plot::@2 -- vbuyy_lt_vbuc1_then_la1 
    cpy #$10
    bcc b2_from_b2
    jmp b3
    // plot::@3
  b3:
    // [22] (byte*) plot::line#1 ← (byte*) plot::line#4 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 
    lda #$28
    clc
    adc line
    sta line
    bcc !+
    inc line+1
  !:
    // [23] (byte) plot::y#1 ← -- (byte) plot::y#4 -- vbuz1=_dec_vbuz1 
    dec y
    // [24] if((byte) plot::y#1!=(byte) 0) goto plot::@1 -- vbuz1_neq_0_then_la1 
    lda y
    cmp #0
    bne b1_from_b3
    jmp breturn
    // plot::@return
  breturn:
    // [25] return 
    rts
}
  // flip
// Flip buffer
flip: {
    .label c = 6
    .label r = 5
    // [27] phi from flip to flip::@1 [phi:flip->flip::@1]
  b1_from_flip:
    // [27] phi (byte) flip::r#4 = (byte) $10 [phi:flip->flip::@1#0] -- vbuz1=vbuc1 
    lda #$10
    sta r
    // [27] phi (byte) flip::dstIdx#5 = (byte) $f [phi:flip->flip::@1#1] -- vbuxx=vbuc1 
    ldx #$f
    // [27] phi (byte) flip::srcIdx#3 = (byte) 0 [phi:flip->flip::@1#2] -- vbuyy=vbuc1 
    ldy #0
    jmp b1
    // [27] phi from flip::@3 to flip::@1 [phi:flip::@3->flip::@1]
  b1_from_b3:
    // [27] phi (byte) flip::r#4 = (byte) flip::r#1 [phi:flip::@3->flip::@1#0] -- register_copy 
    // [27] phi (byte) flip::dstIdx#5 = (byte) flip::dstIdx#2 [phi:flip::@3->flip::@1#1] -- register_copy 
    // [27] phi (byte) flip::srcIdx#3 = (byte) flip::srcIdx#1 [phi:flip::@3->flip::@1#2] -- register_copy 
    jmp b1
    // flip::@1
  b1:
    // [28] phi from flip::@1 to flip::@2 [phi:flip::@1->flip::@2]
  b2_from_b1:
    // [28] phi (byte) flip::c#2 = (byte) $10 [phi:flip::@1->flip::@2#0] -- vbuz1=vbuc1 
    lda #$10
    sta c
    // [28] phi (byte) flip::dstIdx#3 = (byte) flip::dstIdx#5 [phi:flip::@1->flip::@2#1] -- register_copy 
    // [28] phi (byte) flip::srcIdx#2 = (byte) flip::srcIdx#3 [phi:flip::@1->flip::@2#2] -- register_copy 
    jmp b2
    // [28] phi from flip::@2 to flip::@2 [phi:flip::@2->flip::@2]
  b2_from_b2:
    // [28] phi (byte) flip::c#2 = (byte) flip::c#1 [phi:flip::@2->flip::@2#0] -- register_copy 
    // [28] phi (byte) flip::dstIdx#3 = (byte) flip::dstIdx#1 [phi:flip::@2->flip::@2#1] -- register_copy 
    // [28] phi (byte) flip::srcIdx#2 = (byte) flip::srcIdx#1 [phi:flip::@2->flip::@2#2] -- register_copy 
    jmp b2
    // flip::@2
  b2:
    // [29] *((const byte[$10*$10]) buffer2#0 + (byte) flip::dstIdx#3) ← *((const byte[$10*$10]) buffer1#0 + (byte) flip::srcIdx#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy 
    lda buffer1,y
    sta buffer2,x
    // [30] (byte) flip::srcIdx#1 ← ++ (byte) flip::srcIdx#2 -- vbuyy=_inc_vbuyy 
    iny
    // [31] (byte) flip::dstIdx#1 ← (byte) flip::dstIdx#3 + (byte) $10 -- vbuxx=vbuxx_plus_vbuc1 
    txa
    axs #-[$10]
    // [32] (byte) flip::c#1 ← -- (byte) flip::c#2 -- vbuz1=_dec_vbuz1 
    dec c
    // [33] if((byte) flip::c#1!=(byte) 0) goto flip::@2 -- vbuz1_neq_0_then_la1 
    lda c
    cmp #0
    bne b2_from_b2
    jmp b3
    // flip::@3
  b3:
    // [34] (byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#1 -- vbuxx=_dec_vbuxx 
    dex
    // [35] (byte) flip::r#1 ← -- (byte) flip::r#4 -- vbuz1=_dec_vbuz1 
    dec r
    // [36] if((byte) flip::r#1!=(byte) 0) goto flip::@1 -- vbuz1_neq_0_then_la1 
    lda r
    cmp #0
    bne b1_from_b3
    // [37] phi from flip::@3 to flip::@4 [phi:flip::@3->flip::@4]
  b4_from_b3:
    // [37] phi (byte) flip::i#2 = (byte) 0 [phi:flip::@3->flip::@4#0] -- vbuxx=vbuc1 
    ldx #0
    jmp b4
    // [37] phi from flip::@4 to flip::@4 [phi:flip::@4->flip::@4]
  b4_from_b4:
    // [37] phi (byte) flip::i#2 = (byte) flip::i#1 [phi:flip::@4->flip::@4#0] -- register_copy 
    jmp b4
    // flip::@4
  b4:
    // [38] *((const byte[$10*$10]) buffer1#0 + (byte) flip::i#2) ← *((const byte[$10*$10]) buffer2#0 + (byte) flip::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda buffer2,x
    sta buffer1,x
    // [39] (byte) flip::i#1 ← ++ (byte) flip::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [40] if((byte) flip::i#1!=(byte) 0) goto flip::@4 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne b4_from_b4
    jmp breturn
    // flip::@return
  breturn:
    // [41] return 
    rts
}
  // prepare
// Prepare buffer
prepare: {
    // [43] phi from prepare to prepare::@1 [phi:prepare->prepare::@1]
  b1_from_prepare:
    // [43] phi (byte) prepare::i#2 = (byte) 0 [phi:prepare->prepare::@1#0] -- vbuxx=vbuc1 
    ldx #0
    jmp b1
    // [43] phi from prepare::@1 to prepare::@1 [phi:prepare::@1->prepare::@1]
  b1_from_b1:
    // [43] phi (byte) prepare::i#2 = (byte) prepare::i#1 [phi:prepare::@1->prepare::@1#0] -- register_copy 
    jmp b1
    // prepare::@1
  b1:
    // [44] *((const byte[$10*$10]) buffer1#0 + (byte) prepare::i#2) ← (byte) prepare::i#2 -- pbuc1_derefidx_vbuxx=vbuxx 
    txa
    sta buffer1,x
    // [45] (byte) prepare::i#1 ← ++ (byte) prepare::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [46] if((byte) prepare::i#1!=(byte) 0) goto prepare::@1 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne b1_from_b1
    jmp breturn
    // prepare::@return
  breturn:
    // [47] return 
    rts
}
  // File Data
  buffer1: .fill $10*$10, 0
  buffer2: .fill $10*$10, 0

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp b4
Removing instruction jmp b5
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp b4
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label b1_from_b3 with b1
Replacing label b2_from_b2 with b2
Replacing label b1_from_b3 with b1
Replacing label b2_from_b2 with b2
Replacing label b1_from_b3 with b1
Replacing label b4_from_b4 with b4
Replacing label b1_from_b1 with b1
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Removing instruction b1_from_main:
Removing instruction b1_from_b3:
Removing instruction b4_from_b3:
Removing instruction flip_from_b4:
Removing instruction b5_from_b4:
Removing instruction plot_from_b5:
Removing instruction b1_from_b3:
Removing instruction b2_from_b1:
Removing instruction b2_from_b2:
Removing instruction b1_from_b3:
Removing instruction b2_from_b1:
Removing instruction b2_from_b2:
Removing instruction b4_from_b4:
Removing instruction b1_from_b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction prepare_from_main:
Removing instruction b3:
Removing instruction b4:
Removing instruction b5:
Removing instruction b1_from_plot:
Removing instruction b3:
Removing instruction breturn:
Removing instruction b1_from_flip:
Removing instruction b3:
Removing instruction b4_from_b3:
Removing instruction breturn:
Removing instruction b1_from_prepare:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Skipping double jump to b1 in bne b1_from_b1
Succesful ASM optimization Pass5DoubleJumpElimination
Relabelling long label b1_from_b5 to b3
Relabelling long label b1_from_b1 to b4
Succesful ASM optimization Pass5RelabelLongLabels
Removing instruction jmp b1
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b4
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction b4:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(byte*) RASTER
(const byte*) RASTER#0 RASTER = (byte*) 53266
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
(byte[$10*$10]) buffer1
(const byte[$10*$10]) buffer1#0 buffer1 = { fill( $10*$10, 0) }
(byte[$10*$10]) buffer2
(const byte[$10*$10]) buffer2#0 buffer2 = { fill( $10*$10, 0) }
(void()) flip()
(label) flip::@1
(label) flip::@2
(label) flip::@3
(label) flip::@4
(label) flip::@return
(byte) flip::c
(byte) flip::c#1 c zp ZP_BYTE:6 1501.5
(byte) flip::c#2 c zp ZP_BYTE:6 500.5
(byte) flip::dstIdx
(byte) flip::dstIdx#1 reg byte x 701.0
(byte) flip::dstIdx#2 reg byte x 67.33333333333333
(byte) flip::dstIdx#3 reg byte x 1034.6666666666667
(byte) flip::dstIdx#5 reg byte x 202.0
(byte) flip::i
(byte) flip::i#1 reg byte x 151.5
(byte) flip::i#2 reg byte x 202.0
(byte) flip::r
(byte) flip::r#1 r zp ZP_BYTE:5 151.5
(byte) flip::r#4 r zp ZP_BYTE:5 25.25
(byte) flip::srcIdx
(byte) flip::srcIdx#1 reg byte y 300.42857142857144
(byte) flip::srcIdx#2 reg byte y 1552.0
(byte) flip::srcIdx#3 reg byte y 202.0
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(byte) main::c
(byte) main::c#1 reg byte x 151.5
(byte) main::c#4 reg byte x 67.33333333333333
(void()) plot()
(label) plot::@1
(label) plot::@2
(label) plot::@3
(label) plot::@return
(byte) plot::i
(byte) plot::i#1 reg byte x 350.5
(byte) plot::i#2 reg byte x 1552.0
(byte) plot::i#3 reg byte x 202.0
(byte*) plot::line
(byte*) plot::line#1 line zp ZP_WORD:2 67.33333333333333
(byte*) plot::line#4 line zp ZP_WORD:2 200.50000000000003
(byte) plot::x
(byte) plot::x#1 reg byte y 1501.5
(byte) plot::x#2 reg byte y 1001.0
(byte) plot::y
(byte) plot::y#1 y zp ZP_BYTE:4 151.5
(byte) plot::y#4 y zp ZP_BYTE:4 28.857142857142858
(void()) prepare()
(label) prepare::@1
(label) prepare::@return
(byte) prepare::i
(byte) prepare::i#1 reg byte x 16.5
(byte) prepare::i#2 reg byte x 22.0

reg byte x [ main::c#4 main::c#1 ]
zp ZP_WORD:2 [ plot::line#4 plot::line#1 ]
zp ZP_BYTE:4 [ plot::y#4 plot::y#1 ]
reg byte x [ plot::i#2 plot::i#3 plot::i#1 ]
reg byte y [ plot::x#2 plot::x#1 ]
zp ZP_BYTE:5 [ flip::r#4 flip::r#1 ]
reg byte y [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ]
reg byte x [ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ]
zp ZP_BYTE:6 [ flip::c#2 flip::c#1 ]
reg byte x [ flip::i#2 flip::i#1 ]
reg byte x [ prepare::i#2 prepare::i#1 ]


FINAL ASSEMBLER
Score: 82694

  // File Comments
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .label RASTER = $d012
  .label SCREEN = $400
  // @begin
  // [1] phi from @begin to @1 [phi:@begin->@1]
  // @1
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
  // [3] phi from @1 to @end [phi:@1->@end]
  // @end
  // main
main: {
    // prepare()
    // [5] call prepare 
    // [42] phi from main to prepare [phi:main->prepare]
    jsr prepare
    // [6] phi from main main::@5 to main::@1 [phi:main/main::@5->main::@1]
  b3:
    // [6] phi (byte) main::c#4 = (byte) $19 [phi:main/main::@5->main::@1#0] -- vbuxx=vbuc1 
    ldx #$19
    // [6] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
    // [6] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
    // [6] phi (byte) main::c#4 = (byte) main::c#1 [phi:main::@3->main::@1#0] -- register_copy 
    // main::@1
  b1:
    // while(*RASTER!=254)
    // [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$fe
    cmp RASTER
    bne b1
    // main::@2
  b2:
    // while(*RASTER!=255)
    // [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$ff
    cmp RASTER
    bne b2
    // main::@3
    // for( byte c : 25..1)
    // [9] (byte) main::c#1 ← -- (byte) main::c#4 -- vbuxx=_dec_vbuxx 
    dex
    // [10] if((byte) main::c#1!=(byte) 0) goto main::@1 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne b1
    // [11] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
    // main::@4
    // flip()
    // [12] call flip 
    // [26] phi from main::@4 to flip [phi:main::@4->flip]
    jsr flip
    // [13] phi from main::@4 to main::@5 [phi:main::@4->main::@5]
    // main::@5
    // plot()
    // [14] call plot 
    // [15] phi from main::@5 to plot [phi:main::@5->plot]
    jsr plot
    jmp b3
}
  // plot
// Plot buffer on screen
plot: {
    .label line = 2
    .label y = 4
    // [16] phi from plot to plot::@1 [phi:plot->plot::@1]
    // [16] phi (byte) plot::y#4 = (byte) $10 [phi:plot->plot::@1#0] -- vbuz1=vbuc1 
    lda #$10
    sta y
    // [16] phi (byte*) plot::line#4 = (const byte*) SCREEN#0+(byte)(number) 5*(number) $28+(byte) $c [phi:plot->plot::@1#1] -- pbuz1=pbuc1 
    lda #<SCREEN+5*$28+$c
    sta line
    lda #>SCREEN+5*$28+$c
    sta line+1
    // [16] phi (byte) plot::i#3 = (byte) 0 [phi:plot->plot::@1#2] -- vbuxx=vbuc1 
    ldx #0
    // [16] phi from plot::@3 to plot::@1 [phi:plot::@3->plot::@1]
    // [16] phi (byte) plot::y#4 = (byte) plot::y#1 [phi:plot::@3->plot::@1#0] -- register_copy 
    // [16] phi (byte*) plot::line#4 = (byte*) plot::line#1 [phi:plot::@3->plot::@1#1] -- register_copy 
    // [16] phi (byte) plot::i#3 = (byte) plot::i#1 [phi:plot::@3->plot::@1#2] -- register_copy 
    // plot::@1
  b1:
    // [17] phi from plot::@1 to plot::@2 [phi:plot::@1->plot::@2]
    // [17] phi (byte) plot::x#2 = (byte) 0 [phi:plot::@1->plot::@2#0] -- vbuyy=vbuc1 
    ldy #0
    // [17] phi (byte) plot::i#2 = (byte) plot::i#3 [phi:plot::@1->plot::@2#1] -- register_copy 
    // [17] phi from plot::@2 to plot::@2 [phi:plot::@2->plot::@2]
    // [17] phi (byte) plot::x#2 = (byte) plot::x#1 [phi:plot::@2->plot::@2#0] -- register_copy 
    // [17] phi (byte) plot::i#2 = (byte) plot::i#1 [phi:plot::@2->plot::@2#1] -- register_copy 
    // plot::@2
  b2:
    // line[x] = buffer1[i++]
    // [18] *((byte*) plot::line#4 + (byte) plot::x#2) ← *((const byte[$10*$10]) buffer1#0 + (byte) plot::i#2) -- pbuz1_derefidx_vbuyy=pbuc1_derefidx_vbuxx 
    lda buffer1,x
    sta (line),y
    // line[x] = buffer1[i++];
    // [19] (byte) plot::i#1 ← ++ (byte) plot::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // for(byte x=0; x<16; x++ )
    // [20] (byte) plot::x#1 ← ++ (byte) plot::x#2 -- vbuyy=_inc_vbuyy 
    iny
    // [21] if((byte) plot::x#1<(byte) $10) goto plot::@2 -- vbuyy_lt_vbuc1_then_la1 
    cpy #$10
    bcc b2
    // plot::@3
    // line = line+40
    // [22] (byte*) plot::line#1 ← (byte*) plot::line#4 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 
    lda #$28
    clc
    adc line
    sta line
    bcc !+
    inc line+1
  !:
    // for(byte y : 16..1)
    // [23] (byte) plot::y#1 ← -- (byte) plot::y#4 -- vbuz1=_dec_vbuz1 
    dec y
    // [24] if((byte) plot::y#1!=(byte) 0) goto plot::@1 -- vbuz1_neq_0_then_la1 
    lda y
    cmp #0
    bne b1
    // plot::@return
    // }
    // [25] return 
    rts
}
  // flip
// Flip buffer
flip: {
    .label c = 6
    .label r = 5
    // [27] phi from flip to flip::@1 [phi:flip->flip::@1]
    // [27] phi (byte) flip::r#4 = (byte) $10 [phi:flip->flip::@1#0] -- vbuz1=vbuc1 
    lda #$10
    sta r
    // [27] phi (byte) flip::dstIdx#5 = (byte) $f [phi:flip->flip::@1#1] -- vbuxx=vbuc1 
    ldx #$f
    // [27] phi (byte) flip::srcIdx#3 = (byte) 0 [phi:flip->flip::@1#2] -- vbuyy=vbuc1 
    ldy #0
    // [27] phi from flip::@3 to flip::@1 [phi:flip::@3->flip::@1]
    // [27] phi (byte) flip::r#4 = (byte) flip::r#1 [phi:flip::@3->flip::@1#0] -- register_copy 
    // [27] phi (byte) flip::dstIdx#5 = (byte) flip::dstIdx#2 [phi:flip::@3->flip::@1#1] -- register_copy 
    // [27] phi (byte) flip::srcIdx#3 = (byte) flip::srcIdx#1 [phi:flip::@3->flip::@1#2] -- register_copy 
    // flip::@1
  b1:
    // [28] phi from flip::@1 to flip::@2 [phi:flip::@1->flip::@2]
    // [28] phi (byte) flip::c#2 = (byte) $10 [phi:flip::@1->flip::@2#0] -- vbuz1=vbuc1 
    lda #$10
    sta c
    // [28] phi (byte) flip::dstIdx#3 = (byte) flip::dstIdx#5 [phi:flip::@1->flip::@2#1] -- register_copy 
    // [28] phi (byte) flip::srcIdx#2 = (byte) flip::srcIdx#3 [phi:flip::@1->flip::@2#2] -- register_copy 
    // [28] phi from flip::@2 to flip::@2 [phi:flip::@2->flip::@2]
    // [28] phi (byte) flip::c#2 = (byte) flip::c#1 [phi:flip::@2->flip::@2#0] -- register_copy 
    // [28] phi (byte) flip::dstIdx#3 = (byte) flip::dstIdx#1 [phi:flip::@2->flip::@2#1] -- register_copy 
    // [28] phi (byte) flip::srcIdx#2 = (byte) flip::srcIdx#1 [phi:flip::@2->flip::@2#2] -- register_copy 
    // flip::@2
  b2:
    // buffer2[dstIdx] = buffer1[srcIdx++]
    // [29] *((const byte[$10*$10]) buffer2#0 + (byte) flip::dstIdx#3) ← *((const byte[$10*$10]) buffer1#0 + (byte) flip::srcIdx#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy 
    lda buffer1,y
    sta buffer2,x
    // buffer2[dstIdx] = buffer1[srcIdx++];
    // [30] (byte) flip::srcIdx#1 ← ++ (byte) flip::srcIdx#2 -- vbuyy=_inc_vbuyy 
    iny
    // dstIdx = dstIdx+16
    // [31] (byte) flip::dstIdx#1 ← (byte) flip::dstIdx#3 + (byte) $10 -- vbuxx=vbuxx_plus_vbuc1 
    txa
    axs #-[$10]
    // for( byte c : 16..1)
    // [32] (byte) flip::c#1 ← -- (byte) flip::c#2 -- vbuz1=_dec_vbuz1 
    dec c
    // [33] if((byte) flip::c#1!=(byte) 0) goto flip::@2 -- vbuz1_neq_0_then_la1 
    lda c
    cmp #0
    bne b2
    // flip::@3
    // dstIdx--;
    // [34] (byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#1 -- vbuxx=_dec_vbuxx 
    dex
    // for( byte r : 16..1)
    // [35] (byte) flip::r#1 ← -- (byte) flip::r#4 -- vbuz1=_dec_vbuz1 
    dec r
    // [36] if((byte) flip::r#1!=(byte) 0) goto flip::@1 -- vbuz1_neq_0_then_la1 
    lda r
    cmp #0
    bne b1
    // [37] phi from flip::@3 to flip::@4 [phi:flip::@3->flip::@4]
    // [37] phi (byte) flip::i#2 = (byte) 0 [phi:flip::@3->flip::@4#0] -- vbuxx=vbuc1 
    ldx #0
    // [37] phi from flip::@4 to flip::@4 [phi:flip::@4->flip::@4]
    // [37] phi (byte) flip::i#2 = (byte) flip::i#1 [phi:flip::@4->flip::@4#0] -- register_copy 
    // flip::@4
  b4:
    // buffer1[i] = buffer2[i]
    // [38] *((const byte[$10*$10]) buffer1#0 + (byte) flip::i#2) ← *((const byte[$10*$10]) buffer2#0 + (byte) flip::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda buffer2,x
    sta buffer1,x
    // for(byte i : 0..255)
    // [39] (byte) flip::i#1 ← ++ (byte) flip::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [40] if((byte) flip::i#1!=(byte) 0) goto flip::@4 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne b4
    // flip::@return
    // }
    // [41] return 
    rts
}
  // prepare
// Prepare buffer
prepare: {
    // [43] phi from prepare to prepare::@1 [phi:prepare->prepare::@1]
    // [43] phi (byte) prepare::i#2 = (byte) 0 [phi:prepare->prepare::@1#0] -- vbuxx=vbuc1 
    ldx #0
    // [43] phi from prepare::@1 to prepare::@1 [phi:prepare::@1->prepare::@1]
    // [43] phi (byte) prepare::i#2 = (byte) prepare::i#1 [phi:prepare::@1->prepare::@1#0] -- register_copy 
    // prepare::@1
  b1:
    // buffer1[i] = i
    // [44] *((const byte[$10*$10]) buffer1#0 + (byte) prepare::i#2) ← (byte) prepare::i#2 -- pbuc1_derefidx_vbuxx=vbuxx 
    txa
    sta buffer1,x
    // for( byte i : 0..255)
    // [45] (byte) prepare::i#1 ← ++ (byte) prepare::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [46] if((byte) prepare::i#1!=(byte) 0) goto prepare::@1 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne b1
    // prepare::@return
    // }
    // [47] return 
    rts
}
  // File Data
  buffer1: .fill $10*$10, 0
  buffer2: .fill $10*$10, 0

