
CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  (word/signed word/dword/signed dword~) $0 ← (byte/signed byte/word/signed word/dword/signed dword) 16 * (byte/signed byte/word/signed word/dword/signed dword) 16
  (byte[$0]) buffer1#0 ← { fill( $0, 0) }
  (word/signed word/dword/signed dword~) $1 ← (byte/signed byte/word/signed word/dword/signed dword) 16 * (byte/signed byte/word/signed word/dword/signed dword) 16
  (byte[$1]) buffer2#0 ← { fill( $1, 0) }
  (byte*) RASTER#0 ← ((byte*)) (word/dword/signed dword) 53266
  (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
  to:@4
main: scope:[main]  from @4
  (byte*) SCREEN#11 ← phi( @4/(byte*) SCREEN#12 )
  (byte*) RASTER#8 ← phi( @4/(byte*) RASTER#10 )
  call prepare 
  to:main::@9
main::@9: scope:[main]  from main
  (byte*) SCREEN#10 ← phi( main/(byte*) SCREEN#11 )
  (byte*) RASTER#6 ← phi( main/(byte*) RASTER#8 )
  to:main::@1
main::@1: scope:[main]  from main::@11 main::@9
  (byte*) SCREEN#7 ← phi( main::@11/(byte*) SCREEN#9 main::@9/(byte*) SCREEN#10 )
  (byte*) RASTER#3 ← phi( main::@11/(byte*) RASTER#5 main::@9/(byte*) RASTER#6 )
  (byte) main::c#0 ← (byte/signed byte/word/signed word/dword/signed dword) 25
  to:main::@3
main::@2: scope:[main]  from main::@6
  (byte*) SCREEN#8 ← phi( main::@6/(byte*) SCREEN#4 )
  (byte) main::c#5 ← phi( main::@6/(byte) main::c#1 )
  (byte*) RASTER#4 ← phi( main::@6/(byte*) RASTER#7 )
  to:main::@3
main::@3: scope:[main]  from main::@1 main::@2 main::@3
  (byte*) SCREEN#6 ← phi( main::@1/(byte*) SCREEN#7 main::@2/(byte*) SCREEN#8 main::@3/(byte*) SCREEN#6 )
  (byte) main::c#4 ← phi( main::@1/(byte) main::c#0 main::@2/(byte) main::c#5 main::@3/(byte) main::c#4 )
  (byte*) RASTER#1 ← phi( main::@1/(byte*) RASTER#3 main::@2/(byte*) RASTER#4 main::@3/(byte*) RASTER#1 )
  (bool~) main::$1 ← *((byte*) RASTER#1) != (byte/word/signed word/dword/signed dword) 254
  if((bool~) main::$1) goto main::@3
  to:main::@4
main::@4: scope:[main]  from main::@3 main::@4
  (byte*) SCREEN#5 ← phi( main::@3/(byte*) SCREEN#6 main::@4/(byte*) SCREEN#5 )
  (byte) main::c#3 ← phi( main::@3/(byte) main::c#4 main::@4/(byte) main::c#3 )
  (byte*) RASTER#2 ← phi( main::@3/(byte*) RASTER#1 main::@4/(byte*) RASTER#2 )
  (bool~) main::$2 ← *((byte*) RASTER#2) != (byte/word/signed word/dword/signed dword) 255
  if((bool~) main::$2) goto main::@4
  to:main::@6
main::@6: scope:[main]  from main::@4
  (byte*) SCREEN#4 ← phi( main::@4/(byte*) SCREEN#5 )
  (byte*) RASTER#7 ← phi( main::@4/(byte*) RASTER#2 )
  (byte) main::c#2 ← phi( main::@4/(byte) main::c#3 )
  (byte) main::c#1 ← (byte) main::c#2 + rangenext(25,1)
  (bool~) main::$3 ← (byte) main::c#1 != rangelast(25,1)
  if((bool~) main::$3) goto main::@2
  to:main::@7
main::@7: scope:[main]  from main::@6
  (byte*) RASTER#11 ← phi( main::@6/(byte*) RASTER#7 )
  (byte*) SCREEN#3 ← phi( main::@6/(byte*) SCREEN#4 )
  call flip 
  to:main::@10
main::@10: scope:[main]  from main::@7
  (byte*) RASTER#9 ← phi( main::@7/(byte*) RASTER#11 )
  (byte*) SCREEN#2 ← phi( main::@7/(byte*) SCREEN#3 )
  call plot 
  to:main::@11
main::@11: scope:[main]  from main::@10
  (byte*) SCREEN#9 ← phi( main::@10/(byte*) SCREEN#2 )
  (byte*) RASTER#5 ← phi( main::@10/(byte*) RASTER#9 )
  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/signed byte/word/signed word/dword/signed dword) 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[$0]) buffer1#0 + (byte) prepare::i#2) ← (byte) prepare::i#2
  (byte) prepare::i#1 ← (byte) prepare::i#2 + rangenext(0,255)
  (bool~) prepare::$0 ← (byte) prepare::i#1 != rangelast(0,255)
  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 ← (byte/signed byte/word/signed word/dword/signed dword) 0
  (byte) flip::dstIdx#0 ← (byte/signed byte/word/signed word/dword/signed dword) 15
  (byte) flip::r#0 ← (byte/signed byte/word/signed word/dword/signed dword) 16
  to:flip::@1
flip::@1: scope:[flip]  from flip flip::@4
  (byte) flip::r#4 ← phi( flip/(byte) flip::r#0 flip::@4/(byte) flip::r#1 )
  (byte) flip::dstIdx#5 ← phi( flip/(byte) flip::dstIdx#0 flip::@4/(byte) flip::dstIdx#2 )
  (byte) flip::srcIdx#3 ← phi( flip/(byte) flip::srcIdx#0 flip::@4/(byte) flip::srcIdx#4 )
  (byte) flip::c#0 ← (byte/signed byte/word/signed word/dword/signed dword) 16
  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[$1]) buffer2#0 + (byte) flip::dstIdx#3) ← *((byte[$0]) buffer1#0 + (byte) flip::srcIdx#2)
  (byte) flip::srcIdx#1 ← ++ (byte) flip::srcIdx#2
  (byte/signed word/word/dword/signed dword~) flip::$0 ← (byte) flip::dstIdx#3 + (byte/signed byte/word/signed word/dword/signed dword) 16
  (byte) flip::dstIdx#1 ← (byte/signed word/word/dword/signed dword~) flip::$0
  (byte) flip::c#1 ← (byte) flip::c#2 + rangenext(16,1)
  (bool~) flip::$1 ← (byte) flip::c#1 != rangelast(16,1)
  if((bool~) flip::$1) goto flip::@2
  to:flip::@4
flip::@4: 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(16,1)
  (bool~) flip::$2 ← (byte) flip::r#1 != rangelast(16,1)
  if((bool~) flip::$2) goto flip::@1
  to:flip::@5
flip::@5: scope:[flip]  from flip::@4
  (byte) flip::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
  to:flip::@3
flip::@3: scope:[flip]  from flip::@3 flip::@5
  (byte) flip::i#2 ← phi( flip::@3/(byte) flip::i#1 flip::@5/(byte) flip::i#0 )
  *((byte[$0]) buffer1#0 + (byte) flip::i#2) ← *((byte[$1]) buffer2#0 + (byte) flip::i#2)
  (byte) flip::i#1 ← (byte) flip::i#2 + rangenext(0,255)
  (bool~) flip::$3 ← (byte) flip::i#1 != rangelast(0,255)
  if((bool~) flip::$3) goto flip::@3
  to:flip::@return
flip::@return: scope:[flip]  from flip::@3
  return 
  to:@return
plot: scope:[plot]  from main::@10
  (byte*) SCREEN#1 ← phi( main::@10/(byte*) SCREEN#2 )
  (byte/word/signed word/dword/signed dword~) plot::$0 ← (byte/signed byte/word/signed word/dword/signed dword) 5 * (byte/signed byte/word/signed word/dword/signed dword) 40
  (byte*~) plot::$1 ← (byte*) SCREEN#1 + (byte/word/signed word/dword/signed dword~) plot::$0
  (byte*~) plot::$2 ← (byte*~) plot::$1 + (byte/signed byte/word/signed word/dword/signed dword) 12
  (byte*) plot::line#0 ← (byte*~) plot::$2
  (byte) plot::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
  (byte) plot::y#0 ← (byte/signed byte/word/signed word/dword/signed dword) 16
  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 ← (byte/signed byte/word/signed word/dword/signed dword) 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[$0]) buffer1#0 + (byte) plot::i#2)
  (byte) plot::i#1 ← ++ (byte) plot::i#2
  (byte) plot::x#1 ← ++ (byte) plot::x#2
  (bool~) plot::$3 ← (byte) plot::x#1 < (byte/signed byte/word/signed word/dword/signed dword) 16
  if((bool~) plot::$3) 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::$4 ← (byte*) plot::line#3 + (byte/signed byte/word/signed word/dword/signed dword) 40
  (byte*) plot::line#1 ← (byte*~) plot::$4
  (byte) plot::y#1 ← (byte) plot::y#2 + rangenext(16,1)
  (bool~) plot::$5 ← (byte) plot::y#1 != rangelast(16,1)
  if((bool~) plot::$5) goto plot::@1
  to:plot::@return
plot::@return: scope:[plot]  from plot::@3
  return 
  to:@return
@4: scope:[]  from @begin
  (byte*) SCREEN#12 ← phi( @begin/(byte*) SCREEN#0 )
  (byte*) RASTER#10 ← phi( @begin/(byte*) RASTER#0 )
  call main 
  to:@5
@5: scope:[]  from @4
  to:@end
@end: scope:[]  from @5

SYMBOL TABLE SSA
(word/signed word/dword/signed dword~) $0
(word/signed word/dword/signed dword~) $1
(label) @4
(label) @5
(label) @begin
(label) @end
(byte*) RASTER
(byte*) RASTER#0
(byte*) RASTER#1
(byte*) RASTER#10
(byte*) RASTER#11
(byte*) RASTER#2
(byte*) RASTER#3
(byte*) RASTER#4
(byte*) RASTER#5
(byte*) RASTER#6
(byte*) RASTER#7
(byte*) RASTER#8
(byte*) RASTER#9
(byte*) SCREEN
(byte*) SCREEN#0
(byte*) SCREEN#1
(byte*) SCREEN#10
(byte*) SCREEN#11
(byte*) SCREEN#12
(byte*) SCREEN#2
(byte*) SCREEN#3
(byte*) SCREEN#4
(byte*) SCREEN#5
(byte*) SCREEN#6
(byte*) SCREEN#7
(byte*) SCREEN#8
(byte*) SCREEN#9
(byte[$0]) buffer1
(byte[$0]) buffer1#0
(byte[$1]) buffer2
(byte[$1]) buffer2#0
(void()) flip()
(byte/signed word/word/dword/signed dword~) 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::@2
(label) main::@3
(label) main::@4
(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
(byte) main::c#5
(void()) plot()
(byte/word/signed word/dword/signed dword~) plot::$0
(byte*~) plot::$1
(byte*~) plot::$2
(bool~) plot::$3
(byte*~) plot::$4
(bool~) plot::$5
(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

Culled Empty Block (label) @5
Successful SSA optimization Pass2CullEmptyBlocks
Alias (byte*) RASTER#6 = (byte*) RASTER#8 
Alias (byte*) SCREEN#10 = (byte*) SCREEN#11 
Alias (byte*) RASTER#11 = (byte*) RASTER#4 (byte*) RASTER#7 (byte*) RASTER#2 (byte*) RASTER#9 (byte*) RASTER#5 
Alias (byte) main::c#1 = (byte) main::c#5 
Alias (byte*) SCREEN#2 = (byte*) SCREEN#8 (byte*) SCREEN#4 (byte*) SCREEN#5 (byte*) SCREEN#3 (byte*) SCREEN#9 
Alias (byte) main::c#2 = (byte) main::c#3 
Alias (byte) flip::dstIdx#1 = (byte/signed word/word/dword/signed dword~) 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::$2 
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::$4 
Alias (byte*) RASTER#0 = (byte*) RASTER#10 
Alias (byte*) SCREEN#0 = (byte*) SCREEN#12 
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte*) RASTER#1
Self Phi Eliminated (byte) main::c#4
Self Phi Eliminated (byte*) SCREEN#6
Self Phi Eliminated (byte*) RASTER#11
Self Phi Eliminated (byte) main::c#2
Self Phi Eliminated (byte*) SCREEN#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
Redundant Phi (byte*) RASTER#6 (byte*) RASTER#0
Redundant Phi (byte*) SCREEN#10 (byte*) SCREEN#0
Redundant Phi (byte*) RASTER#11 (byte*) RASTER#1
Redundant Phi (byte) main::c#2 (byte) main::c#4
Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#6
Redundant Phi (byte) flip::r#2 (byte) flip::r#4
Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#2
Redundant Phi (byte*) plot::line#2 (byte*) plot::line#4
Redundant Phi (byte) plot::y#2 (byte) plot::y#4
Successful SSA optimization Pass2RedundantPhiElimination
Simple Condition (bool~) main::$1 [14] if(*((byte*) RASTER#1)!=(byte/word/signed word/dword/signed dword) 254) goto main::@3
Simple Condition (bool~) main::$2 [17] if(*((byte*) RASTER#1)!=(byte/word/signed word/dword/signed dword) 255) goto main::@4
Simple Condition (bool~) main::$3 [21] if((byte) main::c#1!=rangelast(25,1)) goto main::@2
Simple Condition (bool~) prepare::$0 [34] if((byte) prepare::i#1!=rangelast(0,255)) goto prepare::@1
Simple Condition (bool~) flip::$1 [48] if((byte) flip::c#1!=rangelast(16,1)) goto flip::@2
Simple Condition (bool~) flip::$2 [53] if((byte) flip::r#1!=rangelast(16,1)) goto flip::@1
Simple Condition (bool~) flip::$3 [59] if((byte) flip::i#1!=rangelast(0,255)) goto flip::@3
Simple Condition (bool~) plot::$3 [75] if((byte) plot::x#1<(byte/signed byte/word/signed word/dword/signed dword) 16) goto plot::@2
Simple Condition (bool~) plot::$5 [81] if((byte) plot::y#1!=rangelast(16,1)) goto plot::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const word/signed word/dword/signed dword) $0 = 16*16
Constant (const word/signed word/dword/signed dword) $1 = 16*16
Constant (const byte*) RASTER#0 = ((byte*))53266
Constant (const byte*) SCREEN#0 = ((byte*))1024
Constant (const byte) main::c#0 = 25
Constant (const byte) prepare::i#0 = 0
Constant (const byte) flip::srcIdx#0 = 0
Constant (const byte) flip::dstIdx#0 = 15
Constant (const byte) flip::r#0 = 16
Constant (const byte) flip::c#0 = 16
Constant (const byte) flip::i#0 = 0
Constant (const byte/word/signed word/dword/signed dword) plot::$0 = 5*40
Constant (const byte) plot::i#0 = 0
Constant (const byte) plot::y#0 = 16
Constant (const byte) plot::x#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte[$0]) buffer1#0 = { fill( $0, 0) }
Constant (const byte[$1]) buffer2#0 = { fill( $1, 0) }
Successful SSA optimization Pass2ConstantIdentification
Consolidated constant in assignment plot::line#0
Successful SSA optimization Pass2ConstantAdditionElimination
if() condition always true - replacing block destination [9] if(true) goto main::@1
Successful SSA optimization Pass2ConstantIfs
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Resolved ranged next value main::c#1 ← -- main::c#4 to --
Resolved ranged comparison value if(main::c#1!=rangelast(25,1)) goto main::@2 to (byte/signed byte/word/signed word/dword/signed dword) 0
Resolved ranged next value prepare::i#1 ← ++ prepare::i#2 to ++
Resolved ranged comparison value if(prepare::i#1!=rangelast(0,255)) goto prepare::@1 to (byte/signed byte/word/signed word/dword/signed dword) 0
Resolved ranged next value flip::c#1 ← -- flip::c#2 to --
Resolved ranged comparison value if(flip::c#1!=rangelast(16,1)) goto flip::@2 to (byte/signed byte/word/signed word/dword/signed dword) 0
Resolved ranged next value flip::r#1 ← -- flip::r#4 to --
Resolved ranged comparison value if(flip::r#1!=rangelast(16,1)) goto flip::@1 to (byte/signed byte/word/signed word/dword/signed dword) 0
Resolved ranged next value flip::i#1 ← ++ flip::i#2 to ++
Resolved ranged comparison value if(flip::i#1!=rangelast(0,255)) goto flip::@3 to (byte/signed byte/word/signed word/dword/signed dword) 0
Resolved ranged next value plot::y#1 ← -- plot::y#4 to --
Resolved ranged comparison value if(plot::y#1!=rangelast(16,1)) goto plot::@1 to (byte/signed byte/word/signed word/dword/signed dword) 0
Culled Empty Block (label) main::@9
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@11
Culled Empty Block (label) flip::@5
Successful SSA optimization Pass2CullEmptyBlocks
Self Phi Eliminated (byte*) RASTER#1
Self Phi Eliminated (byte*) SCREEN#6
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte*) RASTER#1 (byte*) RASTER#3
Redundant Phi (byte*) SCREEN#6 (byte*) SCREEN#7
Successful SSA optimization Pass2RedundantPhiElimination
Self Phi Eliminated (byte*) RASTER#3
Self Phi Eliminated (byte*) SCREEN#7
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte*) RASTER#3 (const byte*) RASTER#0
Redundant Phi (byte*) SCREEN#7 (const byte*) SCREEN#0
Successful SSA optimization Pass2RedundantPhiElimination
Constant (const byte*) plot::$1 = SCREEN#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) plot::line#0 = plot::$1+plot::$0+12
Successful SSA optimization Pass2ConstantIdentification
Culled Empty Block (label) main::@1
Successful SSA optimization Pass2CullEmptyBlocks
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/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 12
Constant inlined plot::$0 = (byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40
Constant inlined plot::$1 = (const byte*) SCREEN#0
Constant inlined plot::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined plot::y#0 = (byte/signed byte/word/signed word/dword/signed dword) 16
Constant inlined $0 = (byte/signed byte/word/signed word/dword/signed dword) 16*(byte/signed byte/word/signed word/dword/signed dword) 16
Constant inlined $1 = (byte/signed byte/word/signed word/dword/signed dword) 16*(byte/signed byte/word/signed word/dword/signed dword) 16
Constant inlined flip::dstIdx#0 = (byte/signed byte/word/signed word/dword/signed dword) 15
Constant inlined flip::r#0 = (byte/signed byte/word/signed word/dword/signed dword) 16
Constant inlined main::c#0 = (byte/signed byte/word/signed word/dword/signed dword) 25
Constant inlined flip::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined flip::srcIdx#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined prepare::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined plot::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined flip::c#0 = (byte/signed byte/word/signed word/dword/signed dword) 16
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@12(between main::@6 and main::@3)
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)
Added new block during phi lifting flip::@7(between flip::@4 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::@3 and flip::@3)
Added new block during phi lifting prepare::@3(between prepare::@1 and prepare::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @4
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@7
Adding NOP phi() at start of main::@10
Adding NOP phi() at start of plot
Adding NOP phi() at start of flip
Adding NOP phi() at start of prepare
CALL GRAPH
Calls in [] to main:2 
Calls in [main] to prepare:5 flip:12 plot:14 

Created 14 initial phi equivalence classes
Coalesced [15] main::c#6 ← main::c#1
Coalesced [18] plot::i#6 ← plot::i#3
Coalesced [28] plot::i#5 ← plot::i#1
Coalesced [29] plot::line#5 ← plot::line#1
Coalesced [30] plot::y#5 ← plot::y#1
Coalesced (already) [31] plot::i#7 ← plot::i#1
Coalesced [32] plot::x#3 ← plot::x#1
Coalesced [35] flip::srcIdx#6 ← flip::srcIdx#3
Coalesced [36] flip::dstIdx#7 ← flip::dstIdx#5
Coalesced [51] flip::i#3 ← flip::i#1
Coalesced [52] flip::srcIdx#5 ← flip::srcIdx#1
Coalesced [53] flip::dstIdx#6 ← flip::dstIdx#2
Coalesced [54] flip::r#5 ← flip::r#1
Coalesced (already) [55] flip::srcIdx#7 ← flip::srcIdx#1
Coalesced [56] flip::dstIdx#8 ← flip::dstIdx#1
Coalesced [57] flip::c#3 ← flip::c#1
Coalesced [64] prepare::i#3 ← prepare::i#1
Coalesced down to 11 phi equivalence classes
Culled Empty Block (label) main::@12
Culled Empty Block (label) plot::@5
Culled Empty Block (label) plot::@6
Culled Empty Block (label) flip::@9
Culled Empty Block (label) flip::@7
Culled Empty Block (label) flip::@8
Culled Empty Block (label) prepare::@3
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @4
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@7
Adding NOP phi() at start of main::@10
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:@4
@4: scope:[]  from @begin
  [1] phi()
  [2] call main 
  to:@end
@end: scope:[]  from @4
  [3] phi()
main: scope:[main]  from @4
  [4] phi()
  [5] call prepare 
  to:main::@3
main::@3: scope:[main]  from main main::@10 main::@3 main::@6
  [6] (byte) main::c#4 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 25 main::@6/(byte) main::c#1 main::@10/(byte/signed byte/word/signed word/dword/signed dword) 25 )
  [7] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 254) goto main::@3
  to:main::@4
main::@4: scope:[main]  from main::@3 main::@4
  [8] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@4
  to:main::@6
main::@6: scope:[main]  from main::@4
  [9] (byte) main::c#1 ← -- (byte) main::c#4
  [10] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3
  to:main::@7
main::@7: scope:[main]  from main::@6
  [11] phi()
  [12] call flip 
  to:main::@10
main::@10: scope:[main]  from main::@7
  [13] phi()
  [14] call plot 
  to:main::@3
plot: scope:[plot]  from main::@10
  [15] phi()
  to:plot::@1
plot::@1: scope:[plot]  from plot plot::@3
  [16] (byte) plot::y#4 ← phi( plot/(byte/signed byte/word/signed word/dword/signed dword) 16 plot::@3/(byte) plot::y#1 )
  [16] (byte*) plot::line#4 ← phi( plot/(const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 12 plot::@3/(byte*) plot::line#1 )
  [16] (byte) plot::i#3 ← phi( plot/(byte/signed byte/word/signed word/dword/signed dword) 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/signed byte/word/signed word/dword/signed dword) 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[16*16]) 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/signed byte/word/signed word/dword/signed dword) 16) goto plot::@2
  to:plot::@3
plot::@3: scope:[plot]  from plot::@2
  [22] (byte*) plot::line#1 ← (byte*) plot::line#4 + (byte/signed byte/word/signed word/dword/signed dword) 40
  [23] (byte) plot::y#1 ← -- (byte) plot::y#4
  [24] if((byte) plot::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plot::@1
  to:plot::@return
plot::@return: scope:[plot]  from plot::@3
  [25] return 
  to:@return
flip: scope:[flip]  from main::@7
  [26] phi()
  to:flip::@1
flip::@1: scope:[flip]  from flip flip::@4
  [27] (byte) flip::r#4 ← phi( flip/(byte/signed byte/word/signed word/dword/signed dword) 16 flip::@4/(byte) flip::r#1 )
  [27] (byte) flip::dstIdx#5 ← phi( flip/(byte/signed byte/word/signed word/dword/signed dword) 15 flip::@4/(byte) flip::dstIdx#2 )
  [27] (byte) flip::srcIdx#3 ← phi( flip/(byte/signed byte/word/signed word/dword/signed dword) 0 flip::@4/(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/signed byte/word/signed word/dword/signed dword) 16 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[16*16]) buffer2#0 + (byte) flip::dstIdx#3) ← *((const byte[16*16]) 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/signed byte/word/signed word/dword/signed dword) 16
  [32] (byte) flip::c#1 ← -- (byte) flip::c#2
  [33] if((byte) flip::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto flip::@2
  to:flip::@4
flip::@4: 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/signed byte/word/signed word/dword/signed dword) 0) goto flip::@1
  to:flip::@3
flip::@3: scope:[flip]  from flip::@3 flip::@4
  [37] (byte) flip::i#2 ← phi( flip::@3/(byte) flip::i#1 flip::@4/(byte/signed byte/word/signed word/dword/signed dword) 0 )
  [38] *((const byte[16*16]) buffer1#0 + (byte) flip::i#2) ← *((const byte[16*16]) buffer2#0 + (byte) flip::i#2)
  [39] (byte) flip::i#1 ← ++ (byte) flip::i#2
  [40] if((byte) flip::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto flip::@3
  to:flip::@return
flip::@return: scope:[flip]  from flip::@3
  [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/signed byte/word/signed word/dword/signed dword) 0 prepare::@1/(byte) prepare::i#1 )
  [44] *((const byte[16*16]) 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/signed byte/word/signed word/dword/signed dword) 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[16*16]) buffer1
(byte[16*16]) 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
//SEG0 File Comments
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
  .label RASTER = $d012
  .label SCREEN = $400
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @4 [phi:@begin->@4]
b4_from_bbegin:
  jmp b4
//SEG5 @4
b4:
//SEG6 [2] call main 
//SEG7 [4] phi from @4 to main [phi:@4->main]
main_from_b4:
  jsr main
//SEG8 [3] phi from @4 to @end [phi:@4->@end]
bend_from_b4:
  jmp bend
//SEG9 @end
bend:
//SEG10 main
main: {
    .label c = 2
  //SEG11 [5] call prepare 
  //SEG12 [42] phi from main to prepare [phi:main->prepare]
  prepare_from_main:
    jsr prepare
  //SEG13 [6] phi from main main::@10 to main::@3 [phi:main/main::@10->main::@3]
  b3_from_main:
  b3_from_b10:
  //SEG14 [6] phi (byte) main::c#4 = (byte/signed byte/word/signed word/dword/signed dword) 25 [phi:main/main::@10->main::@3#0] -- vbuz1=vbuc1 
    lda #$19
    sta c
    jmp b3
  //SEG15 [6] phi from main::@3 to main::@3 [phi:main::@3->main::@3]
  b3_from_b3:
    jmp b3
  //SEG16 [6] phi from main::@6 to main::@3 [phi:main::@6->main::@3]
  b3_from_b6:
  //SEG17 [6] phi (byte) main::c#4 = (byte) main::c#1 [phi:main::@6->main::@3#0] -- register_copy 
    jmp b3
  //SEG18 main::@3
  b3:
  //SEG19 [7] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 254) goto main::@3 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$fe
    bne b3_from_b3
    jmp b4
  //SEG20 main::@4
  b4:
  //SEG21 [8] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@4 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$ff
    bne b4
    jmp b6
  //SEG22 main::@6
  b6:
  //SEG23 [9] (byte) main::c#1 ← -- (byte) main::c#4 -- vbuz1=_dec_vbuz1 
    dec c
  //SEG24 [10] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3 -- vbuz1_neq_0_then_la1 
    lda c
    cmp #0
    bne b3_from_b6
  //SEG25 [11] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
  b7_from_b6:
    jmp b7
  //SEG26 main::@7
  b7:
  //SEG27 [12] call flip 
  //SEG28 [26] phi from main::@7 to flip [phi:main::@7->flip]
  flip_from_b7:
    jsr flip
  //SEG29 [13] phi from main::@7 to main::@10 [phi:main::@7->main::@10]
  b10_from_b7:
    jmp b10
  //SEG30 main::@10
  b10:
  //SEG31 [14] call plot 
  //SEG32 [15] phi from main::@10 to plot [phi:main::@10->plot]
  plot_from_b10:
    jsr plot
    jmp b3_from_b10
}
//SEG33 plot
// Plot buffer on screen
plot: {
    .label i = 6
    .label x = 7
    .label line = 3
    .label y = 5
  //SEG34 [16] phi from plot to plot::@1 [phi:plot->plot::@1]
  b1_from_plot:
  //SEG35 [16] phi (byte) plot::y#4 = (byte/signed byte/word/signed word/dword/signed dword) 16 [phi:plot->plot::@1#0] -- vbuz1=vbuc1 
    lda #$10
    sta y
  //SEG36 [16] phi (byte*) plot::line#4 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 12 [phi:plot->plot::@1#1] -- pbuz1=pbuc1 
    lda #<SCREEN+5*$28+$c
    sta line
    lda #>SCREEN+5*$28+$c
    sta line+1
  //SEG37 [16] phi (byte) plot::i#3 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plot->plot::@1#2] -- vbuz1=vbuc1 
    lda #0
    sta i
    jmp b1
  //SEG38 [16] phi from plot::@3 to plot::@1 [phi:plot::@3->plot::@1]
  b1_from_b3:
  //SEG39 [16] phi (byte) plot::y#4 = (byte) plot::y#1 [phi:plot::@3->plot::@1#0] -- register_copy 
  //SEG40 [16] phi (byte*) plot::line#4 = (byte*) plot::line#1 [phi:plot::@3->plot::@1#1] -- register_copy 
  //SEG41 [16] phi (byte) plot::i#3 = (byte) plot::i#1 [phi:plot::@3->plot::@1#2] -- register_copy 
    jmp b1
  //SEG42 plot::@1
  b1:
  //SEG43 [17] phi from plot::@1 to plot::@2 [phi:plot::@1->plot::@2]
  b2_from_b1:
  //SEG44 [17] phi (byte) plot::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plot::@1->plot::@2#0] -- vbuz1=vbuc1 
    lda #0
    sta x
  //SEG45 [17] phi (byte) plot::i#2 = (byte) plot::i#3 [phi:plot::@1->plot::@2#1] -- register_copy 
    jmp b2
  //SEG46 [17] phi from plot::@2 to plot::@2 [phi:plot::@2->plot::@2]
  b2_from_b2:
  //SEG47 [17] phi (byte) plot::x#2 = (byte) plot::x#1 [phi:plot::@2->plot::@2#0] -- register_copy 
  //SEG48 [17] phi (byte) plot::i#2 = (byte) plot::i#1 [phi:plot::@2->plot::@2#1] -- register_copy 
    jmp b2
  //SEG49 plot::@2
  b2:
  //SEG50 [18] *((byte*) plot::line#4 + (byte) plot::x#2) ← *((const byte[16*16]) buffer1#0 + (byte) plot::i#2) -- pbuz1_derefidx_vbuz2=pbuc1_derefidx_vbuz3 
    ldy i
    lda buffer1,y
    ldy x
    sta (line),y
  //SEG51 [19] (byte) plot::i#1 ← ++ (byte) plot::i#2 -- vbuz1=_inc_vbuz1 
    inc i
  //SEG52 [20] (byte) plot::x#1 ← ++ (byte) plot::x#2 -- vbuz1=_inc_vbuz1 
    inc x
  //SEG53 [21] if((byte) plot::x#1<(byte/signed byte/word/signed word/dword/signed dword) 16) goto plot::@2 -- vbuz1_lt_vbuc1_then_la1 
    lda x
    cmp #$10
    bcc b2_from_b2
    jmp b3
  //SEG54 plot::@3
  b3:
  //SEG55 [22] (byte*) plot::line#1 ← (byte*) plot::line#4 + (byte/signed byte/word/signed word/dword/signed dword) 40 -- pbuz1=pbuz1_plus_vbuc1 
    lda line
    clc
    adc #$28
    sta line
    bcc !+
    inc line+1
  !:
  //SEG56 [23] (byte) plot::y#1 ← -- (byte) plot::y#4 -- vbuz1=_dec_vbuz1 
    dec y
  //SEG57 [24] if((byte) plot::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plot::@1 -- vbuz1_neq_0_then_la1 
    lda y
    cmp #0
    bne b1_from_b3
    jmp breturn
  //SEG58 plot::@return
  breturn:
  //SEG59 [25] return 
    rts
}
//SEG60 flip
// Flip buffer
flip: {
    .label srcIdx = 9
    .label dstIdx = $a
    .label c = $b
    .label r = 8
    .label i = $c
  //SEG61 [27] phi from flip to flip::@1 [phi:flip->flip::@1]
  b1_from_flip:
  //SEG62 [27] phi (byte) flip::r#4 = (byte/signed byte/word/signed word/dword/signed dword) 16 [phi:flip->flip::@1#0] -- vbuz1=vbuc1 
    lda #$10
    sta r
  //SEG63 [27] phi (byte) flip::dstIdx#5 = (byte/signed byte/word/signed word/dword/signed dword) 15 [phi:flip->flip::@1#1] -- vbuz1=vbuc1 
    lda #$f
    sta dstIdx
  //SEG64 [27] phi (byte) flip::srcIdx#3 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:flip->flip::@1#2] -- vbuz1=vbuc1 
    lda #0
    sta srcIdx
    jmp b1
  //SEG65 [27] phi from flip::@4 to flip::@1 [phi:flip::@4->flip::@1]
  b1_from_b4:
  //SEG66 [27] phi (byte) flip::r#4 = (byte) flip::r#1 [phi:flip::@4->flip::@1#0] -- register_copy 
  //SEG67 [27] phi (byte) flip::dstIdx#5 = (byte) flip::dstIdx#2 [phi:flip::@4->flip::@1#1] -- register_copy 
  //SEG68 [27] phi (byte) flip::srcIdx#3 = (byte) flip::srcIdx#1 [phi:flip::@4->flip::@1#2] -- register_copy 
    jmp b1
  //SEG69 flip::@1
  b1:
  //SEG70 [28] phi from flip::@1 to flip::@2 [phi:flip::@1->flip::@2]
  b2_from_b1:
  //SEG71 [28] phi (byte) flip::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 16 [phi:flip::@1->flip::@2#0] -- vbuz1=vbuc1 
    lda #$10
    sta c
  //SEG72 [28] phi (byte) flip::dstIdx#3 = (byte) flip::dstIdx#5 [phi:flip::@1->flip::@2#1] -- register_copy 
  //SEG73 [28] phi (byte) flip::srcIdx#2 = (byte) flip::srcIdx#3 [phi:flip::@1->flip::@2#2] -- register_copy 
    jmp b2
  //SEG74 [28] phi from flip::@2 to flip::@2 [phi:flip::@2->flip::@2]
  b2_from_b2:
  //SEG75 [28] phi (byte) flip::c#2 = (byte) flip::c#1 [phi:flip::@2->flip::@2#0] -- register_copy 
  //SEG76 [28] phi (byte) flip::dstIdx#3 = (byte) flip::dstIdx#1 [phi:flip::@2->flip::@2#1] -- register_copy 
  //SEG77 [28] phi (byte) flip::srcIdx#2 = (byte) flip::srcIdx#1 [phi:flip::@2->flip::@2#2] -- register_copy 
    jmp b2
  //SEG78 flip::@2
  b2:
  //SEG79 [29] *((const byte[16*16]) buffer2#0 + (byte) flip::dstIdx#3) ← *((const byte[16*16]) buffer1#0 + (byte) flip::srcIdx#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 
    ldy srcIdx
    lda buffer1,y
    ldy dstIdx
    sta buffer2,y
  //SEG80 [30] (byte) flip::srcIdx#1 ← ++ (byte) flip::srcIdx#2 -- vbuz1=_inc_vbuz1 
    inc srcIdx
  //SEG81 [31] (byte) flip::dstIdx#1 ← (byte) flip::dstIdx#3 + (byte/signed byte/word/signed word/dword/signed dword) 16 -- vbuz1=vbuz1_plus_vbuc1 
    lda #$10
    clc
    adc dstIdx
    sta dstIdx
  //SEG82 [32] (byte) flip::c#1 ← -- (byte) flip::c#2 -- vbuz1=_dec_vbuz1 
    dec c
  //SEG83 [33] if((byte) flip::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto flip::@2 -- vbuz1_neq_0_then_la1 
    lda c
    cmp #0
    bne b2_from_b2
    jmp b4
  //SEG84 flip::@4
  b4:
  //SEG85 [34] (byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#1 -- vbuz1=_dec_vbuz1 
    dec dstIdx
  //SEG86 [35] (byte) flip::r#1 ← -- (byte) flip::r#4 -- vbuz1=_dec_vbuz1 
    dec r
  //SEG87 [36] if((byte) flip::r#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto flip::@1 -- vbuz1_neq_0_then_la1 
    lda r
    cmp #0
    bne b1_from_b4
  //SEG88 [37] phi from flip::@4 to flip::@3 [phi:flip::@4->flip::@3]
  b3_from_b4:
  //SEG89 [37] phi (byte) flip::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:flip::@4->flip::@3#0] -- vbuz1=vbuc1 
    lda #0
    sta i
    jmp b3
  //SEG90 [37] phi from flip::@3 to flip::@3 [phi:flip::@3->flip::@3]
  b3_from_b3:
  //SEG91 [37] phi (byte) flip::i#2 = (byte) flip::i#1 [phi:flip::@3->flip::@3#0] -- register_copy 
    jmp b3
  //SEG92 flip::@3
  b3:
  //SEG93 [38] *((const byte[16*16]) buffer1#0 + (byte) flip::i#2) ← *((const byte[16*16]) buffer2#0 + (byte) flip::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 
    ldy i
    lda buffer2,y
    sta buffer1,y
  //SEG94 [39] (byte) flip::i#1 ← ++ (byte) flip::i#2 -- vbuz1=_inc_vbuz1 
    inc i
  //SEG95 [40] if((byte) flip::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto flip::@3 -- vbuz1_neq_0_then_la1 
    lda i
    cmp #0
    bne b3_from_b3
    jmp breturn
  //SEG96 flip::@return
  breturn:
  //SEG97 [41] return 
    rts
}
//SEG98 prepare
// Prepare buffer
prepare: {
    .label i = $d
  //SEG99 [43] phi from prepare to prepare::@1 [phi:prepare->prepare::@1]
  b1_from_prepare:
  //SEG100 [43] phi (byte) prepare::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:prepare->prepare::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta i
    jmp b1
  //SEG101 [43] phi from prepare::@1 to prepare::@1 [phi:prepare::@1->prepare::@1]
  b1_from_b1:
  //SEG102 [43] phi (byte) prepare::i#2 = (byte) prepare::i#1 [phi:prepare::@1->prepare::@1#0] -- register_copy 
    jmp b1
  //SEG103 prepare::@1
  b1:
  //SEG104 [44] *((const byte[16*16]) buffer1#0 + (byte) prepare::i#2) ← (byte) prepare::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 
    ldy i
    tya
    sta buffer1,y
  //SEG105 [45] (byte) prepare::i#1 ← ++ (byte) prepare::i#2 -- vbuz1=_inc_vbuz1 
    inc i
  //SEG106 [46] if((byte) prepare::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto prepare::@1 -- vbuz1_neq_0_then_la1 
    lda i
    cmp #0
    bne b1_from_b1
    jmp breturn
  //SEG107 prepare::@return
  breturn:
  //SEG108 [47] return 
    rts
}
  buffer1: .fill $10*$10, 0
  buffer2: .fill $10*$10, 0

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 254) goto main::@3 [ 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/word/signed word/dword/signed dword) 255) goto main::@4 [ 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[16*16]) 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/signed byte/word/signed word/dword/signed dword) 40 [ 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[16*16]) buffer2#0 + (byte) flip::dstIdx#3) ← *((const byte[16*16]) 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/signed byte/word/signed word/dword/signed dword) 16 [ 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[16*16]) buffer1#0 + (byte) flip::i#2) ← *((const byte[16*16]) 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/word/signed word/dword/signed dword) 254) goto main::@3 [ main::c#4 ] ( main:2 [ main::c#4 ] ) always clobbers reg byte a 
Statement [8] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@4 [ 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[16*16]) 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/signed byte/word/signed word/dword/signed dword) 40 [ 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[16*16]) buffer2#0 + (byte) flip::dstIdx#3) ← *((const byte[16*16]) 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/signed byte/word/signed word/dword/signed dword) 16 [ 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[16*16]) buffer1#0 + (byte) flip::i#2) ← *((const byte[16*16]) 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 144276 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 125976 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 122376 combination reg byte x [ main::c#4 main::c#1 ] 
Uplifting [prepare] best 122256 combination reg byte x [ prepare::i#2 prepare::i#1 ] 
Uplifting [] best 122256 combination 
Attempting to uplift remaining variables inzp ZP_BYTE:11 [ flip::c#2 flip::c#1 ]
Uplifting [flip] best 122256 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 122256 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 122256 combination zp ZP_BYTE:8 [ flip::r#4 flip::r#1 ] 
Coalescing zero page register [ zp ZP_BYTE:5 [ plot::y#4 plot::y#1 ] ] with [ 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 flip::r#4 flip::r#1 ]
Allocated (was zp ZP_BYTE:11) zp ZP_BYTE:5 [ flip::c#2 flip::c#1 ]

ASSEMBLER BEFORE OPTIMIZATION
//SEG0 File Comments
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
  .label RASTER = $d012
  .label SCREEN = $400
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @4 [phi:@begin->@4]
b4_from_bbegin:
  jmp b4
//SEG5 @4
b4:
//SEG6 [2] call main 
//SEG7 [4] phi from @4 to main [phi:@4->main]
main_from_b4:
  jsr main
//SEG8 [3] phi from @4 to @end [phi:@4->@end]
bend_from_b4:
  jmp bend
//SEG9 @end
bend:
//SEG10 main
main: {
  //SEG11 [5] call prepare 
  //SEG12 [42] phi from main to prepare [phi:main->prepare]
  prepare_from_main:
    jsr prepare
  //SEG13 [6] phi from main main::@10 to main::@3 [phi:main/main::@10->main::@3]
  b3_from_main:
  b3_from_b10:
  //SEG14 [6] phi (byte) main::c#4 = (byte/signed byte/word/signed word/dword/signed dword) 25 [phi:main/main::@10->main::@3#0] -- vbuxx=vbuc1 
    ldx #$19
    jmp b3
  //SEG15 [6] phi from main::@3 to main::@3 [phi:main::@3->main::@3]
  b3_from_b3:
    jmp b3
  //SEG16 [6] phi from main::@6 to main::@3 [phi:main::@6->main::@3]
  b3_from_b6:
  //SEG17 [6] phi (byte) main::c#4 = (byte) main::c#1 [phi:main::@6->main::@3#0] -- register_copy 
    jmp b3
  //SEG18 main::@3
  b3:
  //SEG19 [7] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 254) goto main::@3 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$fe
    bne b3_from_b3
    jmp b4
  //SEG20 main::@4
  b4:
  //SEG21 [8] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@4 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$ff
    bne b4
    jmp b6
  //SEG22 main::@6
  b6:
  //SEG23 [9] (byte) main::c#1 ← -- (byte) main::c#4 -- vbuxx=_dec_vbuxx 
    dex
  //SEG24 [10] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne b3_from_b6
  //SEG25 [11] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
  b7_from_b6:
    jmp b7
  //SEG26 main::@7
  b7:
  //SEG27 [12] call flip 
  //SEG28 [26] phi from main::@7 to flip [phi:main::@7->flip]
  flip_from_b7:
    jsr flip
  //SEG29 [13] phi from main::@7 to main::@10 [phi:main::@7->main::@10]
  b10_from_b7:
    jmp b10
  //SEG30 main::@10
  b10:
  //SEG31 [14] call plot 
  //SEG32 [15] phi from main::@10 to plot [phi:main::@10->plot]
  plot_from_b10:
    jsr plot
    jmp b3_from_b10
}
//SEG33 plot
// Plot buffer on screen
plot: {
    .label line = 2
    .label y = 4
  //SEG34 [16] phi from plot to plot::@1 [phi:plot->plot::@1]
  b1_from_plot:
  //SEG35 [16] phi (byte) plot::y#4 = (byte/signed byte/word/signed word/dword/signed dword) 16 [phi:plot->plot::@1#0] -- vbuz1=vbuc1 
    lda #$10
    sta y
  //SEG36 [16] phi (byte*) plot::line#4 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 12 [phi:plot->plot::@1#1] -- pbuz1=pbuc1 
    lda #<SCREEN+5*$28+$c
    sta line
    lda #>SCREEN+5*$28+$c
    sta line+1
  //SEG37 [16] phi (byte) plot::i#3 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plot->plot::@1#2] -- vbuxx=vbuc1 
    ldx #0
    jmp b1
  //SEG38 [16] phi from plot::@3 to plot::@1 [phi:plot::@3->plot::@1]
  b1_from_b3:
  //SEG39 [16] phi (byte) plot::y#4 = (byte) plot::y#1 [phi:plot::@3->plot::@1#0] -- register_copy 
  //SEG40 [16] phi (byte*) plot::line#4 = (byte*) plot::line#1 [phi:plot::@3->plot::@1#1] -- register_copy 
  //SEG41 [16] phi (byte) plot::i#3 = (byte) plot::i#1 [phi:plot::@3->plot::@1#2] -- register_copy 
    jmp b1
  //SEG42 plot::@1
  b1:
  //SEG43 [17] phi from plot::@1 to plot::@2 [phi:plot::@1->plot::@2]
  b2_from_b1:
  //SEG44 [17] phi (byte) plot::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plot::@1->plot::@2#0] -- vbuyy=vbuc1 
    ldy #0
  //SEG45 [17] phi (byte) plot::i#2 = (byte) plot::i#3 [phi:plot::@1->plot::@2#1] -- register_copy 
    jmp b2
  //SEG46 [17] phi from plot::@2 to plot::@2 [phi:plot::@2->plot::@2]
  b2_from_b2:
  //SEG47 [17] phi (byte) plot::x#2 = (byte) plot::x#1 [phi:plot::@2->plot::@2#0] -- register_copy 
  //SEG48 [17] phi (byte) plot::i#2 = (byte) plot::i#1 [phi:plot::@2->plot::@2#1] -- register_copy 
    jmp b2
  //SEG49 plot::@2
  b2:
  //SEG50 [18] *((byte*) plot::line#4 + (byte) plot::x#2) ← *((const byte[16*16]) buffer1#0 + (byte) plot::i#2) -- pbuz1_derefidx_vbuyy=pbuc1_derefidx_vbuxx 
    lda buffer1,x
    sta (line),y
  //SEG51 [19] (byte) plot::i#1 ← ++ (byte) plot::i#2 -- vbuxx=_inc_vbuxx 
    inx
  //SEG52 [20] (byte) plot::x#1 ← ++ (byte) plot::x#2 -- vbuyy=_inc_vbuyy 
    iny
  //SEG53 [21] if((byte) plot::x#1<(byte/signed byte/word/signed word/dword/signed dword) 16) goto plot::@2 -- vbuyy_lt_vbuc1_then_la1 
    cpy #$10
    bcc b2_from_b2
    jmp b3
  //SEG54 plot::@3
  b3:
  //SEG55 [22] (byte*) plot::line#1 ← (byte*) plot::line#4 + (byte/signed byte/word/signed word/dword/signed dword) 40 -- pbuz1=pbuz1_plus_vbuc1 
    lda line
    clc
    adc #$28
    sta line
    bcc !+
    inc line+1
  !:
  //SEG56 [23] (byte) plot::y#1 ← -- (byte) plot::y#4 -- vbuz1=_dec_vbuz1 
    dec y
  //SEG57 [24] if((byte) plot::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plot::@1 -- vbuz1_neq_0_then_la1 
    lda y
    cmp #0
    bne b1_from_b3
    jmp breturn
  //SEG58 plot::@return
  breturn:
  //SEG59 [25] return 
    rts
}
//SEG60 flip
// Flip buffer
flip: {
    .label c = 5
    .label r = 4
  //SEG61 [27] phi from flip to flip::@1 [phi:flip->flip::@1]
  b1_from_flip:
  //SEG62 [27] phi (byte) flip::r#4 = (byte/signed byte/word/signed word/dword/signed dword) 16 [phi:flip->flip::@1#0] -- vbuz1=vbuc1 
    lda #$10
    sta r
  //SEG63 [27] phi (byte) flip::dstIdx#5 = (byte/signed byte/word/signed word/dword/signed dword) 15 [phi:flip->flip::@1#1] -- vbuxx=vbuc1 
    ldx #$f
  //SEG64 [27] phi (byte) flip::srcIdx#3 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:flip->flip::@1#2] -- vbuyy=vbuc1 
    ldy #0
    jmp b1
  //SEG65 [27] phi from flip::@4 to flip::@1 [phi:flip::@4->flip::@1]
  b1_from_b4:
  //SEG66 [27] phi (byte) flip::r#4 = (byte) flip::r#1 [phi:flip::@4->flip::@1#0] -- register_copy 
  //SEG67 [27] phi (byte) flip::dstIdx#5 = (byte) flip::dstIdx#2 [phi:flip::@4->flip::@1#1] -- register_copy 
  //SEG68 [27] phi (byte) flip::srcIdx#3 = (byte) flip::srcIdx#1 [phi:flip::@4->flip::@1#2] -- register_copy 
    jmp b1
  //SEG69 flip::@1
  b1:
  //SEG70 [28] phi from flip::@1 to flip::@2 [phi:flip::@1->flip::@2]
  b2_from_b1:
  //SEG71 [28] phi (byte) flip::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 16 [phi:flip::@1->flip::@2#0] -- vbuz1=vbuc1 
    lda #$10
    sta c
  //SEG72 [28] phi (byte) flip::dstIdx#3 = (byte) flip::dstIdx#5 [phi:flip::@1->flip::@2#1] -- register_copy 
  //SEG73 [28] phi (byte) flip::srcIdx#2 = (byte) flip::srcIdx#3 [phi:flip::@1->flip::@2#2] -- register_copy 
    jmp b2
  //SEG74 [28] phi from flip::@2 to flip::@2 [phi:flip::@2->flip::@2]
  b2_from_b2:
  //SEG75 [28] phi (byte) flip::c#2 = (byte) flip::c#1 [phi:flip::@2->flip::@2#0] -- register_copy 
  //SEG76 [28] phi (byte) flip::dstIdx#3 = (byte) flip::dstIdx#1 [phi:flip::@2->flip::@2#1] -- register_copy 
  //SEG77 [28] phi (byte) flip::srcIdx#2 = (byte) flip::srcIdx#1 [phi:flip::@2->flip::@2#2] -- register_copy 
    jmp b2
  //SEG78 flip::@2
  b2:
  //SEG79 [29] *((const byte[16*16]) buffer2#0 + (byte) flip::dstIdx#3) ← *((const byte[16*16]) buffer1#0 + (byte) flip::srcIdx#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy 
    lda buffer1,y
    sta buffer2,x
  //SEG80 [30] (byte) flip::srcIdx#1 ← ++ (byte) flip::srcIdx#2 -- vbuyy=_inc_vbuyy 
    iny
  //SEG81 [31] (byte) flip::dstIdx#1 ← (byte) flip::dstIdx#3 + (byte/signed byte/word/signed word/dword/signed dword) 16 -- vbuxx=vbuxx_plus_vbuc1 
    txa
    clc
    adc #$10
    tax
  //SEG82 [32] (byte) flip::c#1 ← -- (byte) flip::c#2 -- vbuz1=_dec_vbuz1 
    dec c
  //SEG83 [33] if((byte) flip::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto flip::@2 -- vbuz1_neq_0_then_la1 
    lda c
    cmp #0
    bne b2_from_b2
    jmp b4
  //SEG84 flip::@4
  b4:
  //SEG85 [34] (byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#1 -- vbuxx=_dec_vbuxx 
    dex
  //SEG86 [35] (byte) flip::r#1 ← -- (byte) flip::r#4 -- vbuz1=_dec_vbuz1 
    dec r
  //SEG87 [36] if((byte) flip::r#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto flip::@1 -- vbuz1_neq_0_then_la1 
    lda r
    cmp #0
    bne b1_from_b4
  //SEG88 [37] phi from flip::@4 to flip::@3 [phi:flip::@4->flip::@3]
  b3_from_b4:
  //SEG89 [37] phi (byte) flip::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:flip::@4->flip::@3#0] -- vbuxx=vbuc1 
    ldx #0
    jmp b3
  //SEG90 [37] phi from flip::@3 to flip::@3 [phi:flip::@3->flip::@3]
  b3_from_b3:
  //SEG91 [37] phi (byte) flip::i#2 = (byte) flip::i#1 [phi:flip::@3->flip::@3#0] -- register_copy 
    jmp b3
  //SEG92 flip::@3
  b3:
  //SEG93 [38] *((const byte[16*16]) buffer1#0 + (byte) flip::i#2) ← *((const byte[16*16]) buffer2#0 + (byte) flip::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda buffer2,x
    sta buffer1,x
  //SEG94 [39] (byte) flip::i#1 ← ++ (byte) flip::i#2 -- vbuxx=_inc_vbuxx 
    inx
  //SEG95 [40] if((byte) flip::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto flip::@3 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne b3_from_b3
    jmp breturn
  //SEG96 flip::@return
  breturn:
  //SEG97 [41] return 
    rts
}
//SEG98 prepare
// Prepare buffer
prepare: {
  //SEG99 [43] phi from prepare to prepare::@1 [phi:prepare->prepare::@1]
  b1_from_prepare:
  //SEG100 [43] phi (byte) prepare::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:prepare->prepare::@1#0] -- vbuxx=vbuc1 
    ldx #0
    jmp b1
  //SEG101 [43] phi from prepare::@1 to prepare::@1 [phi:prepare::@1->prepare::@1]
  b1_from_b1:
  //SEG102 [43] phi (byte) prepare::i#2 = (byte) prepare::i#1 [phi:prepare::@1->prepare::@1#0] -- register_copy 
    jmp b1
  //SEG103 prepare::@1
  b1:
  //SEG104 [44] *((const byte[16*16]) buffer1#0 + (byte) prepare::i#2) ← (byte) prepare::i#2 -- pbuc1_derefidx_vbuxx=vbuxx 
    txa
    sta buffer1,x
  //SEG105 [45] (byte) prepare::i#1 ← ++ (byte) prepare::i#2 -- vbuxx=_inc_vbuxx 
    inx
  //SEG106 [46] if((byte) prepare::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto prepare::@1 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne b1_from_b1
    jmp breturn
  //SEG107 prepare::@return
  breturn:
  //SEG108 [47] return 
    rts
}
  buffer1: .fill $10*$10, 0
  buffer2: .fill $10*$10, 0

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b4
Removing instruction jmp bend
Removing instruction jmp b3
Removing instruction jmp b4
Removing instruction jmp b6
Removing instruction jmp b7
Removing instruction jmp b10
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 b4
Removing instruction jmp b3
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label b3_from_b6 with b3
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_b4 with b1
Replacing label b3_from_b3 with b3
Replacing label b1_from_b1 with b1
Removing instruction b4_from_bbegin:
Removing instruction b4:
Removing instruction main_from_b4:
Removing instruction bend_from_b4:
Removing instruction b3_from_main:
Removing instruction b3_from_b6:
Removing instruction b7_from_b6:
Removing instruction flip_from_b7:
Removing instruction b10_from_b7:
Removing instruction plot_from_b10:
Removing instruction b1_from_b3:
Removing instruction b2_from_b1:
Removing instruction b2_from_b2:
Removing instruction b1_from_b4:
Removing instruction b2_from_b1:
Removing instruction b2_from_b2:
Removing instruction b3_from_b3:
Removing instruction b1_from_b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction prepare_from_main:
Removing instruction b6:
Removing instruction b7:
Removing instruction b10:
Removing instruction b1_from_plot:
Removing instruction b3:
Removing instruction breturn:
Removing instruction b1_from_flip:
Removing instruction b4:
Removing instruction b3_from_b4:
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 b3 in bne b3_from_b3
Succesful ASM optimization Pass5DoubleJumpElimination
Relabelling long label b3_from_b10 to b1
Relabelling long label b3_from_b3 to b2
Succesful ASM optimization Pass5RelabelLongLabels
Removing instruction jmp b3
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing instruction jmp b3
Succesful ASM optimization Pass5NextJumpElimination

FINAL SYMBOL TABLE
(label) @4
(label) @begin
(label) @end
(byte*) RASTER
(const byte*) RASTER#0 RASTER = ((byte*))(word/dword/signed dword) 53266
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024
(byte[16*16]) buffer1
(const byte[16*16]) buffer1#0 buffer1 = { fill( 16*16, 0) }
(byte[16*16]) buffer2
(const byte[16*16]) buffer2#0 buffer2 = { fill( 16*16, 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:5 1501.5
(byte) flip::c#2 c zp ZP_BYTE:5 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:4 151.5
(byte) flip::r#4 r zp ZP_BYTE:4 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::@10
(label) main::@3
(label) main::@4
(label) main::@6
(label) main::@7
(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 flip::r#4 flip::r#1 ]
reg byte x [ plot::i#2 plot::i#3 plot::i#1 ]
reg byte y [ plot::x#2 plot::x#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:5 [ 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: 86694

//SEG0 File Comments
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG2 Global Constants & labels
  .label RASTER = $d012
  .label SCREEN = $400
//SEG3 @begin
//SEG4 [1] phi from @begin to @4 [phi:@begin->@4]
//SEG5 @4
//SEG6 [2] call main 
//SEG7 [4] phi from @4 to main [phi:@4->main]
//SEG8 [3] phi from @4 to @end [phi:@4->@end]
//SEG9 @end
//SEG10 main
main: {
  //SEG11 [5] call prepare 
  //SEG12 [42] phi from main to prepare [phi:main->prepare]
    jsr prepare
  //SEG13 [6] phi from main main::@10 to main::@3 [phi:main/main::@10->main::@3]
  b1:
  //SEG14 [6] phi (byte) main::c#4 = (byte/signed byte/word/signed word/dword/signed dword) 25 [phi:main/main::@10->main::@3#0] -- vbuxx=vbuc1 
    ldx #$19
  //SEG15 [6] phi from main::@3 to main::@3 [phi:main::@3->main::@3]
  //SEG16 [6] phi from main::@6 to main::@3 [phi:main::@6->main::@3]
  //SEG17 [6] phi (byte) main::c#4 = (byte) main::c#1 [phi:main::@6->main::@3#0] -- register_copy 
  //SEG18 main::@3
  b3:
  //SEG19 [7] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 254) goto main::@3 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$fe
    bne b3
  //SEG20 main::@4
  b4:
  //SEG21 [8] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@4 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$ff
    bne b4
  //SEG22 main::@6
  //SEG23 [9] (byte) main::c#1 ← -- (byte) main::c#4 -- vbuxx=_dec_vbuxx 
    dex
  //SEG24 [10] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne b3
  //SEG25 [11] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
  //SEG26 main::@7
  //SEG27 [12] call flip 
  //SEG28 [26] phi from main::@7 to flip [phi:main::@7->flip]
    jsr flip
  //SEG29 [13] phi from main::@7 to main::@10 [phi:main::@7->main::@10]
  //SEG30 main::@10
  //SEG31 [14] call plot 
  //SEG32 [15] phi from main::@10 to plot [phi:main::@10->plot]
    jsr plot
    jmp b1
}
//SEG33 plot
// Plot buffer on screen
plot: {
    .label line = 2
    .label y = 4
  //SEG34 [16] phi from plot to plot::@1 [phi:plot->plot::@1]
  //SEG35 [16] phi (byte) plot::y#4 = (byte/signed byte/word/signed word/dword/signed dword) 16 [phi:plot->plot::@1#0] -- vbuz1=vbuc1 
    lda #$10
    sta y
  //SEG36 [16] phi (byte*) plot::line#4 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 12 [phi:plot->plot::@1#1] -- pbuz1=pbuc1 
    lda #<SCREEN+5*$28+$c
    sta line
    lda #>SCREEN+5*$28+$c
    sta line+1
  //SEG37 [16] phi (byte) plot::i#3 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plot->plot::@1#2] -- vbuxx=vbuc1 
    ldx #0
  //SEG38 [16] phi from plot::@3 to plot::@1 [phi:plot::@3->plot::@1]
  //SEG39 [16] phi (byte) plot::y#4 = (byte) plot::y#1 [phi:plot::@3->plot::@1#0] -- register_copy 
  //SEG40 [16] phi (byte*) plot::line#4 = (byte*) plot::line#1 [phi:plot::@3->plot::@1#1] -- register_copy 
  //SEG41 [16] phi (byte) plot::i#3 = (byte) plot::i#1 [phi:plot::@3->plot::@1#2] -- register_copy 
  //SEG42 plot::@1
  b1:
  //SEG43 [17] phi from plot::@1 to plot::@2 [phi:plot::@1->plot::@2]
  //SEG44 [17] phi (byte) plot::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plot::@1->plot::@2#0] -- vbuyy=vbuc1 
    ldy #0
  //SEG45 [17] phi (byte) plot::i#2 = (byte) plot::i#3 [phi:plot::@1->plot::@2#1] -- register_copy 
  //SEG46 [17] phi from plot::@2 to plot::@2 [phi:plot::@2->plot::@2]
  //SEG47 [17] phi (byte) plot::x#2 = (byte) plot::x#1 [phi:plot::@2->plot::@2#0] -- register_copy 
  //SEG48 [17] phi (byte) plot::i#2 = (byte) plot::i#1 [phi:plot::@2->plot::@2#1] -- register_copy 
  //SEG49 plot::@2
  b2:
  //SEG50 [18] *((byte*) plot::line#4 + (byte) plot::x#2) ← *((const byte[16*16]) buffer1#0 + (byte) plot::i#2) -- pbuz1_derefidx_vbuyy=pbuc1_derefidx_vbuxx 
    lda buffer1,x
    sta (line),y
  //SEG51 [19] (byte) plot::i#1 ← ++ (byte) plot::i#2 -- vbuxx=_inc_vbuxx 
    inx
  //SEG52 [20] (byte) plot::x#1 ← ++ (byte) plot::x#2 -- vbuyy=_inc_vbuyy 
    iny
  //SEG53 [21] if((byte) plot::x#1<(byte/signed byte/word/signed word/dword/signed dword) 16) goto plot::@2 -- vbuyy_lt_vbuc1_then_la1 
    cpy #$10
    bcc b2
  //SEG54 plot::@3
  //SEG55 [22] (byte*) plot::line#1 ← (byte*) plot::line#4 + (byte/signed byte/word/signed word/dword/signed dword) 40 -- pbuz1=pbuz1_plus_vbuc1 
    lda line
    clc
    adc #$28
    sta line
    bcc !+
    inc line+1
  !:
  //SEG56 [23] (byte) plot::y#1 ← -- (byte) plot::y#4 -- vbuz1=_dec_vbuz1 
    dec y
  //SEG57 [24] if((byte) plot::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plot::@1 -- vbuz1_neq_0_then_la1 
    lda y
    cmp #0
    bne b1
  //SEG58 plot::@return
  //SEG59 [25] return 
    rts
}
//SEG60 flip
// Flip buffer
flip: {
    .label c = 5
    .label r = 4
  //SEG61 [27] phi from flip to flip::@1 [phi:flip->flip::@1]
  //SEG62 [27] phi (byte) flip::r#4 = (byte/signed byte/word/signed word/dword/signed dword) 16 [phi:flip->flip::@1#0] -- vbuz1=vbuc1 
    lda #$10
    sta r
  //SEG63 [27] phi (byte) flip::dstIdx#5 = (byte/signed byte/word/signed word/dword/signed dword) 15 [phi:flip->flip::@1#1] -- vbuxx=vbuc1 
    ldx #$f
  //SEG64 [27] phi (byte) flip::srcIdx#3 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:flip->flip::@1#2] -- vbuyy=vbuc1 
    ldy #0
  //SEG65 [27] phi from flip::@4 to flip::@1 [phi:flip::@4->flip::@1]
  //SEG66 [27] phi (byte) flip::r#4 = (byte) flip::r#1 [phi:flip::@4->flip::@1#0] -- register_copy 
  //SEG67 [27] phi (byte) flip::dstIdx#5 = (byte) flip::dstIdx#2 [phi:flip::@4->flip::@1#1] -- register_copy 
  //SEG68 [27] phi (byte) flip::srcIdx#3 = (byte) flip::srcIdx#1 [phi:flip::@4->flip::@1#2] -- register_copy 
  //SEG69 flip::@1
  b1:
  //SEG70 [28] phi from flip::@1 to flip::@2 [phi:flip::@1->flip::@2]
  //SEG71 [28] phi (byte) flip::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 16 [phi:flip::@1->flip::@2#0] -- vbuz1=vbuc1 
    lda #$10
    sta c
  //SEG72 [28] phi (byte) flip::dstIdx#3 = (byte) flip::dstIdx#5 [phi:flip::@1->flip::@2#1] -- register_copy 
  //SEG73 [28] phi (byte) flip::srcIdx#2 = (byte) flip::srcIdx#3 [phi:flip::@1->flip::@2#2] -- register_copy 
  //SEG74 [28] phi from flip::@2 to flip::@2 [phi:flip::@2->flip::@2]
  //SEG75 [28] phi (byte) flip::c#2 = (byte) flip::c#1 [phi:flip::@2->flip::@2#0] -- register_copy 
  //SEG76 [28] phi (byte) flip::dstIdx#3 = (byte) flip::dstIdx#1 [phi:flip::@2->flip::@2#1] -- register_copy 
  //SEG77 [28] phi (byte) flip::srcIdx#2 = (byte) flip::srcIdx#1 [phi:flip::@2->flip::@2#2] -- register_copy 
  //SEG78 flip::@2
  b2:
  //SEG79 [29] *((const byte[16*16]) buffer2#0 + (byte) flip::dstIdx#3) ← *((const byte[16*16]) buffer1#0 + (byte) flip::srcIdx#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy 
    lda buffer1,y
    sta buffer2,x
  //SEG80 [30] (byte) flip::srcIdx#1 ← ++ (byte) flip::srcIdx#2 -- vbuyy=_inc_vbuyy 
    iny
  //SEG81 [31] (byte) flip::dstIdx#1 ← (byte) flip::dstIdx#3 + (byte/signed byte/word/signed word/dword/signed dword) 16 -- vbuxx=vbuxx_plus_vbuc1 
    txa
    clc
    adc #$10
    tax
  //SEG82 [32] (byte) flip::c#1 ← -- (byte) flip::c#2 -- vbuz1=_dec_vbuz1 
    dec c
  //SEG83 [33] if((byte) flip::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto flip::@2 -- vbuz1_neq_0_then_la1 
    lda c
    cmp #0
    bne b2
  //SEG84 flip::@4
  //SEG85 [34] (byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#1 -- vbuxx=_dec_vbuxx 
    dex
  //SEG86 [35] (byte) flip::r#1 ← -- (byte) flip::r#4 -- vbuz1=_dec_vbuz1 
    dec r
  //SEG87 [36] if((byte) flip::r#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto flip::@1 -- vbuz1_neq_0_then_la1 
    lda r
    cmp #0
    bne b1
  //SEG88 [37] phi from flip::@4 to flip::@3 [phi:flip::@4->flip::@3]
  //SEG89 [37] phi (byte) flip::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:flip::@4->flip::@3#0] -- vbuxx=vbuc1 
    ldx #0
  //SEG90 [37] phi from flip::@3 to flip::@3 [phi:flip::@3->flip::@3]
  //SEG91 [37] phi (byte) flip::i#2 = (byte) flip::i#1 [phi:flip::@3->flip::@3#0] -- register_copy 
  //SEG92 flip::@3
  b3:
  //SEG93 [38] *((const byte[16*16]) buffer1#0 + (byte) flip::i#2) ← *((const byte[16*16]) buffer2#0 + (byte) flip::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda buffer2,x
    sta buffer1,x
  //SEG94 [39] (byte) flip::i#1 ← ++ (byte) flip::i#2 -- vbuxx=_inc_vbuxx 
    inx
  //SEG95 [40] if((byte) flip::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto flip::@3 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne b3
  //SEG96 flip::@return
  //SEG97 [41] return 
    rts
}
//SEG98 prepare
// Prepare buffer
prepare: {
  //SEG99 [43] phi from prepare to prepare::@1 [phi:prepare->prepare::@1]
  //SEG100 [43] phi (byte) prepare::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:prepare->prepare::@1#0] -- vbuxx=vbuc1 
    ldx #0
  //SEG101 [43] phi from prepare::@1 to prepare::@1 [phi:prepare::@1->prepare::@1]
  //SEG102 [43] phi (byte) prepare::i#2 = (byte) prepare::i#1 [phi:prepare::@1->prepare::@1#0] -- register_copy 
  //SEG103 prepare::@1
  b1:
  //SEG104 [44] *((const byte[16*16]) buffer1#0 + (byte) prepare::i#2) ← (byte) prepare::i#2 -- pbuc1_derefidx_vbuxx=vbuxx 
    txa
    sta buffer1,x
  //SEG105 [45] (byte) prepare::i#1 ← ++ (byte) prepare::i#2 -- vbuxx=_inc_vbuxx 
    inx
  //SEG106 [46] if((byte) prepare::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto prepare::@1 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne b1
  //SEG107 prepare::@return
  //SEG108 [47] return 
    rts
}
  buffer1: .fill $10*$10, 0
  buffer2: .fill $10*$10, 0

