
CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
  (byte*) RASTER#0 ← ((byte*)) (word/dword/signed dword) 53266
  (byte*) BGCOL#0 ← ((byte*)) (word/dword/signed dword) 53280
  (byte*) SCROLL#0 ← ((byte*)) (word/dword/signed dword) 53270
  (byte*) TEXT#0 ← (const string) $0
  to:@2
main: scope:[main]  from @2
  (byte*) SCROLL#12 ← phi( @2/(byte*) SCROLL#13 )
  (byte*) BGCOL#11 ← phi( @2/(byte*) BGCOL#13 )
  (byte*) RASTER#5 ← phi( @2/(byte*) RASTER#7 )
  (byte*) TEXT#3 ← phi( @2/(byte*) TEXT#5 )
  (byte*) SCREEN#1 ← phi( @2/(byte*) SCREEN#3 )
  (byte*) fillscreen::screen#0 ← (byte*) SCREEN#1
  (byte) fillscreen::fill#0 ← (byte/signed byte/word/signed word/dword/signed dword) 32
  call fillscreen 
  to:main::@13
main::@13: scope:[main]  from main
  (byte*) SCROLL#10 ← phi( main/(byte*) SCROLL#12 )
  (byte*) BGCOL#9 ← phi( main/(byte*) BGCOL#11 )
  (byte*) RASTER#4 ← phi( main/(byte*) RASTER#5 )
  (byte*) SCREEN#2 ← phi( main/(byte*) SCREEN#1 )
  (byte*) TEXT#1 ← phi( main/(byte*) TEXT#3 )
  (byte) main::scroll#0 ← (byte/signed byte/word/signed word/dword/signed dword) 7
  (byte*) main::nxt#0 ← (byte*) TEXT#1
  (byte*~) main::$1 ← (byte*) SCREEN#2 + (byte/signed byte/word/signed word/dword/signed dword) 40
  (byte[]) main::line#0 ← (byte*~) main::$1
  to:main::@2
main::@1: scope:[main]  from main::@4
  (byte*) TEXT#11 ← phi( main::@4/(byte*) TEXT#12 )
  (byte*) main::nxt#10 ← phi( main::@4/(byte*) main::nxt#11 )
  (byte*) SCROLL#9 ← phi( main::@4/(byte*) SCROLL#1 )
  (byte) main::scroll#10 ← phi( main::@4/(byte) main::scroll#4 )
  (byte*) BGCOL#8 ← phi( main::@4/(byte*) BGCOL#2 )
  (byte*) RASTER#3 ← phi( main::@4/(byte*) RASTER#6 )
  to:main::@2
main::@2: scope:[main]  from main::@1 main::@13 main::@2
  (byte*) TEXT#10 ← phi( main::@1/(byte*) TEXT#11 main::@13/(byte*) TEXT#1 main::@2/(byte*) TEXT#10 )
  (byte*) main::nxt#9 ← phi( main::@1/(byte*) main::nxt#10 main::@13/(byte*) main::nxt#0 main::@2/(byte*) main::nxt#9 )
  (byte*) SCROLL#7 ← phi( main::@1/(byte*) SCROLL#9 main::@13/(byte*) SCROLL#10 main::@2/(byte*) SCROLL#7 )
  (byte) main::scroll#7 ← phi( main::@1/(byte) main::scroll#10 main::@13/(byte) main::scroll#0 main::@2/(byte) main::scroll#7 )
  (byte*) BGCOL#5 ← phi( main::@1/(byte*) BGCOL#8 main::@13/(byte*) BGCOL#9 main::@2/(byte*) BGCOL#5 )
  (byte*) RASTER#1 ← phi( main::@1/(byte*) RASTER#3 main::@13/(byte*) RASTER#4 main::@2/(byte*) RASTER#1 )
  (bool~) main::$2 ← *((byte*) RASTER#1) != (byte/word/signed word/dword/signed dword) 254
  if((bool~) main::$2) goto main::@2
  to:main::@3
main::@3: scope:[main]  from main::@2 main::@3
  (byte*) TEXT#9 ← phi( main::@2/(byte*) TEXT#10 main::@3/(byte*) TEXT#9 )
  (byte*) main::nxt#8 ← phi( main::@2/(byte*) main::nxt#9 main::@3/(byte*) main::nxt#8 )
  (byte*) SCROLL#4 ← phi( main::@2/(byte*) SCROLL#7 main::@3/(byte*) SCROLL#4 )
  (byte) main::scroll#5 ← phi( main::@2/(byte) main::scroll#7 main::@3/(byte) main::scroll#5 )
  (byte*) BGCOL#3 ← phi( main::@2/(byte*) BGCOL#5 main::@3/(byte*) BGCOL#3 )
  (byte*) RASTER#2 ← phi( main::@2/(byte*) RASTER#1 main::@3/(byte*) RASTER#2 )
  (bool~) main::$3 ← *((byte*) RASTER#2) != (byte/word/signed word/dword/signed dword) 255
  if((bool~) main::$3) goto main::@3
  to:main::@8
main::@8: scope:[main]  from main::@3
  (byte*) TEXT#8 ← phi( main::@3/(byte*) TEXT#9 )
  (byte*) main::nxt#7 ← phi( main::@3/(byte*) main::nxt#8 )
  (byte*) RASTER#9 ← phi( main::@3/(byte*) RASTER#2 )
  (byte*) SCROLL#3 ← phi( main::@3/(byte*) SCROLL#4 )
  (byte) main::scroll#3 ← phi( main::@3/(byte) main::scroll#5 )
  (byte*) BGCOL#1 ← phi( main::@3/(byte*) BGCOL#3 )
  *((byte*) BGCOL#1) ← ++ *((byte*) BGCOL#1)
  (byte) main::scroll#1 ← -- (byte) main::scroll#3
  (bool~) main::$4 ← (byte) main::scroll#1 == (byte/word/signed word/dword/signed dword) 255
  (bool~) main::$5 ← ! (bool~) main::$4
  if((bool~) main::$5) goto main::@4
  to:main::@9
main::@4: scope:[main]  from main::@6 main::@8
  (byte*) TEXT#12 ← phi( main::@6/(byte*) TEXT#13 main::@8/(byte*) TEXT#8 )
  (byte*) main::nxt#11 ← phi( main::@6/(byte*) main::nxt#1 main::@8/(byte*) main::nxt#7 )
  (byte*) RASTER#6 ← phi( main::@6/(byte*) RASTER#8 main::@8/(byte*) RASTER#9 )
  (byte*) BGCOL#2 ← phi( main::@6/(byte*) BGCOL#4 main::@8/(byte*) BGCOL#1 )
  (byte*) SCROLL#1 ← phi( main::@6/(byte*) SCROLL#2 main::@8/(byte*) SCROLL#3 )
  (byte) main::scroll#4 ← phi( main::@6/(byte) main::scroll#6 main::@8/(byte) main::scroll#1 )
  *((byte*) SCROLL#1) ← (byte) main::scroll#4
  *((byte*) BGCOL#2) ← -- *((byte*) BGCOL#2)
  if(true) goto main::@1
  to:main::@return
main::@9: scope:[main]  from main::@8
  (byte*) RASTER#13 ← phi( main::@8/(byte*) RASTER#9 )
  (byte*) BGCOL#12 ← phi( main::@8/(byte*) BGCOL#1 )
  (byte*) SCROLL#11 ← phi( main::@8/(byte*) SCROLL#3 )
  (byte*) TEXT#7 ← phi( main::@8/(byte*) TEXT#8 )
  (byte*) main::nxt#6 ← phi( main::@8/(byte*) main::nxt#7 )
  (byte) main::scroll#2 ← (byte/signed byte/word/signed word/dword/signed dword) 7
  (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
  to:main::@5
main::@5: scope:[main]  from main::@5 main::@9
  (byte*) RASTER#12 ← phi( main::@5/(byte*) RASTER#12 main::@9/(byte*) RASTER#13 )
  (byte*) BGCOL#10 ← phi( main::@5/(byte*) BGCOL#10 main::@9/(byte*) BGCOL#12 )
  (byte*) SCROLL#8 ← phi( main::@5/(byte*) SCROLL#8 main::@9/(byte*) SCROLL#11 )
  (byte) main::scroll#11 ← phi( main::@5/(byte) main::scroll#11 main::@9/(byte) main::scroll#2 )
  (byte*) TEXT#6 ← phi( main::@5/(byte*) TEXT#6 main::@9/(byte*) TEXT#7 )
  (byte*) main::nxt#5 ← phi( main::@5/(byte*) main::nxt#5 main::@9/(byte*) main::nxt#6 )
  (byte) main::i#2 ← phi( main::@5/(byte) main::i#1 main::@9/(byte) main::i#0 )
  (byte/signed word/word/dword/signed dword~) main::$6 ← (byte) main::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
  *((byte[]) main::line#0 + (byte) main::i#2) ← *((byte[]) main::line#0 + (byte/signed word/word/dword/signed dword~) main::$6)
  (byte) main::i#1 ← ++ (byte) main::i#2
  (bool~) main::$7 ← (byte) main::i#1 != (byte/signed byte/word/signed word/dword/signed dword) 39
  if((bool~) main::$7) goto main::@5
  to:main::@10
main::@10: scope:[main]  from main::@5
  (byte*) RASTER#10 ← phi( main::@5/(byte*) RASTER#12 )
  (byte*) BGCOL#6 ← phi( main::@5/(byte*) BGCOL#10 )
  (byte*) SCROLL#5 ← phi( main::@5/(byte*) SCROLL#8 )
  (byte) main::scroll#8 ← phi( main::@5/(byte) main::scroll#11 )
  (byte*) TEXT#4 ← phi( main::@5/(byte*) TEXT#6 )
  (byte*) main::nxt#3 ← phi( main::@5/(byte*) main::nxt#5 )
  (byte) main::c#0 ← *((byte*) main::nxt#3)
  (bool~) main::$8 ← (byte) main::c#0 == (byte) '@'
  (bool~) main::$9 ← ! (bool~) main::$8
  if((bool~) main::$9) goto main::@6
  to:main::@11
main::@6: scope:[main]  from main::@10 main::@11
  (byte*) TEXT#13 ← phi( main::@10/(byte*) TEXT#4 main::@11/(byte*) TEXT#2 )
  (byte*) RASTER#8 ← phi( main::@10/(byte*) RASTER#10 main::@11/(byte*) RASTER#11 )
  (byte*) BGCOL#4 ← phi( main::@10/(byte*) BGCOL#6 main::@11/(byte*) BGCOL#7 )
  (byte*) SCROLL#2 ← phi( main::@10/(byte*) SCROLL#5 main::@11/(byte*) SCROLL#6 )
  (byte) main::scroll#6 ← phi( main::@10/(byte) main::scroll#8 main::@11/(byte) main::scroll#9 )
  (byte*) main::nxt#4 ← phi( main::@10/(byte*) main::nxt#3 main::@11/(byte*) main::nxt#2 )
  (byte) main::c#2 ← phi( main::@10/(byte) main::c#0 main::@11/(byte) main::c#1 )
  *((byte[]) main::line#0 + (byte/signed byte/word/signed word/dword/signed dword) 39) ← (byte) main::c#2
  (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4
  to:main::@4
main::@11: scope:[main]  from main::@10
  (byte*) RASTER#11 ← phi( main::@10/(byte*) RASTER#10 )
  (byte*) BGCOL#7 ← phi( main::@10/(byte*) BGCOL#6 )
  (byte*) SCROLL#6 ← phi( main::@10/(byte*) SCROLL#5 )
  (byte) main::scroll#9 ← phi( main::@10/(byte) main::scroll#8 )
  (byte*) TEXT#2 ← phi( main::@10/(byte*) TEXT#4 )
  (byte*) main::nxt#2 ← (byte*) TEXT#2
  (byte) main::c#1 ← *((byte*) main::nxt#2)
  to:main::@6
main::@return: scope:[main]  from main::@4
  return 
  to:@return
fillscreen: scope:[fillscreen]  from main
  (byte) fillscreen::fill#2 ← phi( main/(byte) fillscreen::fill#0 )
  (byte*) fillscreen::screen#1 ← phi( main/(byte*) fillscreen::screen#0 )
  (byte*) fillscreen::cursor#0 ← (byte*) fillscreen::screen#1
  to:fillscreen::@1
fillscreen::@1: scope:[fillscreen]  from fillscreen fillscreen::@1
  (byte*) fillscreen::screen#2 ← phi( fillscreen/(byte*) fillscreen::screen#1 fillscreen::@1/(byte*) fillscreen::screen#2 )
  (byte*) fillscreen::cursor#2 ← phi( fillscreen/(byte*) fillscreen::cursor#0 fillscreen::@1/(byte*) fillscreen::cursor#1 )
  (byte) fillscreen::fill#1 ← phi( fillscreen/(byte) fillscreen::fill#2 fillscreen::@1/(byte) fillscreen::fill#1 )
  *((byte*) fillscreen::cursor#2) ← (byte) fillscreen::fill#1
  (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2
  (byte*~) fillscreen::$0 ← (byte*) fillscreen::screen#2 + (word/signed word/dword/signed dword) 1000
  (bool~) fillscreen::$1 ← (byte*) fillscreen::cursor#1 < (byte*~) fillscreen::$0
  if((bool~) fillscreen::$1) goto fillscreen::@1
  to:fillscreen::@return
fillscreen::@return: scope:[fillscreen]  from fillscreen::@1
  return 
  to:@return
@2: scope:[]  from @begin
  (byte*) SCROLL#13 ← phi( @begin/(byte*) SCROLL#0 )
  (byte*) BGCOL#13 ← phi( @begin/(byte*) BGCOL#0 )
  (byte*) RASTER#7 ← phi( @begin/(byte*) RASTER#0 )
  (byte*) TEXT#5 ← phi( @begin/(byte*) TEXT#0 )
  (byte*) SCREEN#3 ← phi( @begin/(byte*) SCREEN#0 )
  call main 
  to:@3
@3: scope:[]  from @2
  to:@end
@end: scope:[]  from @3

SYMBOL TABLE SSA
(const string) $0 = (string) "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =-     @"
(label) @2
(label) @3
(label) @begin
(label) @end
(byte*) BGCOL
(byte*) BGCOL#0
(byte*) BGCOL#1
(byte*) BGCOL#10
(byte*) BGCOL#11
(byte*) BGCOL#12
(byte*) BGCOL#13
(byte*) BGCOL#2
(byte*) BGCOL#3
(byte*) BGCOL#4
(byte*) BGCOL#5
(byte*) BGCOL#6
(byte*) BGCOL#7
(byte*) BGCOL#8
(byte*) BGCOL#9
(byte*) RASTER
(byte*) RASTER#0
(byte*) RASTER#1
(byte*) RASTER#10
(byte*) RASTER#11
(byte*) RASTER#12
(byte*) RASTER#13
(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#2
(byte*) SCREEN#3
(byte*) SCROLL
(byte*) SCROLL#0
(byte*) SCROLL#1
(byte*) SCROLL#10
(byte*) SCROLL#11
(byte*) SCROLL#12
(byte*) SCROLL#13
(byte*) SCROLL#2
(byte*) SCROLL#3
(byte*) SCROLL#4
(byte*) SCROLL#5
(byte*) SCROLL#6
(byte*) SCROLL#7
(byte*) SCROLL#8
(byte*) SCROLL#9
(byte*) TEXT
(byte*) TEXT#0
(byte*) TEXT#1
(byte*) TEXT#10
(byte*) TEXT#11
(byte*) TEXT#12
(byte*) TEXT#13
(byte*) TEXT#2
(byte*) TEXT#3
(byte*) TEXT#4
(byte*) TEXT#5
(byte*) TEXT#6
(byte*) TEXT#7
(byte*) TEXT#8
(byte*) TEXT#9
(void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill)
(byte*~) fillscreen::$0
(bool~) fillscreen::$1
(label) fillscreen::@1
(label) fillscreen::@return
(byte*) fillscreen::cursor
(byte*) fillscreen::cursor#0
(byte*) fillscreen::cursor#1
(byte*) fillscreen::cursor#2
(byte) fillscreen::fill
(byte) fillscreen::fill#0
(byte) fillscreen::fill#1
(byte) fillscreen::fill#2
(byte*) fillscreen::screen
(byte*) fillscreen::screen#0
(byte*) fillscreen::screen#1
(byte*) fillscreen::screen#2
(void()) main()
(byte*~) main::$1
(bool~) main::$2
(bool~) main::$3
(bool~) main::$4
(bool~) main::$5
(byte/signed word/word/dword/signed dword~) main::$6
(bool~) main::$7
(bool~) main::$8
(bool~) main::$9
(label) main::@1
(label) main::@10
(label) main::@11
(label) main::@13
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@8
(label) main::@9
(label) main::@return
(byte) main::c
(byte) main::c#0
(byte) main::c#1
(byte) main::c#2
(byte) main::i
(byte) main::i#0
(byte) main::i#1
(byte) main::i#2
(byte[]) main::line
(byte[]) main::line#0
(byte*) main::nxt
(byte*) main::nxt#0
(byte*) main::nxt#1
(byte*) main::nxt#10
(byte*) main::nxt#11
(byte*) main::nxt#2
(byte*) main::nxt#3
(byte*) main::nxt#4
(byte*) main::nxt#5
(byte*) main::nxt#6
(byte*) main::nxt#7
(byte*) main::nxt#8
(byte*) main::nxt#9
(byte) main::scroll
(byte) main::scroll#0
(byte) main::scroll#1
(byte) main::scroll#10
(byte) main::scroll#11
(byte) main::scroll#2
(byte) main::scroll#3
(byte) main::scroll#4
(byte) main::scroll#5
(byte) main::scroll#6
(byte) main::scroll#7
(byte) main::scroll#8
(byte) main::scroll#9

Culled Empty Block (label) @3
Successful SSA optimization Pass2CullEmptyBlocks
Inversing boolean not [25] (bool~) main::$5 ← (byte) main::scroll#1 != (byte/word/signed word/dword/signed dword) 255 from [24] (bool~) main::$4 ← (byte) main::scroll#1 == (byte/word/signed word/dword/signed dword) 255
Inversing boolean not [43] (bool~) main::$9 ← (byte) main::c#0 != (byte) '@' from [42] (bool~) main::$8 ← (byte) main::c#0 == (byte) '@'
Successful SSA optimization Pass2UnaryNotSimplification
Alias (byte*) TEXT#1 = (byte*) TEXT#3 
Alias (byte*) SCREEN#1 = (byte*) SCREEN#2 
Alias (byte*) RASTER#4 = (byte*) RASTER#5 
Alias (byte*) BGCOL#11 = (byte*) BGCOL#9 
Alias (byte*) SCROLL#10 = (byte*) SCROLL#12 
Alias (byte[]) main::line#0 = (byte*~) main::$1 
Alias (byte*) RASTER#3 = (byte*) RASTER#6 
Alias (byte*) BGCOL#2 = (byte*) BGCOL#8 
Alias (byte) main::scroll#10 = (byte) main::scroll#4 
Alias (byte*) SCROLL#1 = (byte*) SCROLL#9 
Alias (byte*) main::nxt#10 = (byte*) main::nxt#11 
Alias (byte*) TEXT#11 = (byte*) TEXT#12 
Alias (byte*) BGCOL#1 = (byte*) BGCOL#3 (byte*) BGCOL#12 
Alias (byte) main::scroll#3 = (byte) main::scroll#5 
Alias (byte*) SCROLL#11 = (byte*) SCROLL#3 (byte*) SCROLL#4 
Alias (byte*) RASTER#13 = (byte*) RASTER#9 (byte*) RASTER#2 
Alias (byte*) main::nxt#6 = (byte*) main::nxt#7 (byte*) main::nxt#8 
Alias (byte*) TEXT#7 = (byte*) TEXT#8 (byte*) TEXT#9 
Alias (byte*) main::nxt#3 = (byte*) main::nxt#5 
Alias (byte*) TEXT#2 = (byte*) TEXT#4 (byte*) TEXT#6 
Alias (byte) main::scroll#11 = (byte) main::scroll#8 (byte) main::scroll#9 
Alias (byte*) SCROLL#5 = (byte*) SCROLL#8 (byte*) SCROLL#6 
Alias (byte*) BGCOL#10 = (byte*) BGCOL#6 (byte*) BGCOL#7 
Alias (byte*) RASTER#10 = (byte*) RASTER#12 (byte*) RASTER#11 
Alias (byte*) fillscreen::cursor#0 = (byte*) fillscreen::screen#1 
Alias (byte*) SCREEN#0 = (byte*) SCREEN#3 
Alias (byte*) TEXT#0 = (byte*) TEXT#5 
Alias (byte*) RASTER#0 = (byte*) RASTER#7 
Alias (byte*) BGCOL#0 = (byte*) BGCOL#13 
Alias (byte*) SCROLL#0 = (byte*) SCROLL#13 
Successful SSA optimization Pass2AliasElimination
Alias (byte) main::scroll#11 = (byte) main::scroll#6 
Alias (byte*) SCROLL#2 = (byte*) SCROLL#5 
Alias (byte*) BGCOL#10 = (byte*) BGCOL#4 
Alias (byte*) RASTER#10 = (byte*) RASTER#8 
Alias (byte*) TEXT#13 = (byte*) TEXT#2 
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte*) RASTER#1
Self Phi Eliminated (byte*) BGCOL#5
Self Phi Eliminated (byte) main::scroll#7
Self Phi Eliminated (byte*) SCROLL#7
Self Phi Eliminated (byte*) main::nxt#9
Self Phi Eliminated (byte*) TEXT#10
Self Phi Eliminated (byte*) RASTER#13
Self Phi Eliminated (byte*) BGCOL#1
Self Phi Eliminated (byte) main::scroll#3
Self Phi Eliminated (byte*) SCROLL#11
Self Phi Eliminated (byte*) main::nxt#6
Self Phi Eliminated (byte*) TEXT#7
Self Phi Eliminated (byte*) main::nxt#3
Self Phi Eliminated (byte*) TEXT#13
Self Phi Eliminated (byte) main::scroll#11
Self Phi Eliminated (byte*) SCROLL#2
Self Phi Eliminated (byte*) BGCOL#10
Self Phi Eliminated (byte*) RASTER#10
Self Phi Eliminated (byte) fillscreen::fill#1
Self Phi Eliminated (byte*) fillscreen::screen#2
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0
Redundant Phi (byte*) TEXT#1 (byte*) TEXT#0
Redundant Phi (byte*) RASTER#4 (byte*) RASTER#0
Redundant Phi (byte*) BGCOL#11 (byte*) BGCOL#0
Redundant Phi (byte*) SCROLL#10 (byte*) SCROLL#0
Redundant Phi (byte*) RASTER#13 (byte*) RASTER#1
Redundant Phi (byte*) BGCOL#1 (byte*) BGCOL#5
Redundant Phi (byte) main::scroll#3 (byte) main::scroll#7
Redundant Phi (byte*) SCROLL#11 (byte*) SCROLL#7
Redundant Phi (byte*) main::nxt#6 (byte*) main::nxt#9
Redundant Phi (byte*) TEXT#7 (byte*) TEXT#10
Redundant Phi (byte*) main::nxt#3 (byte*) main::nxt#6
Redundant Phi (byte*) TEXT#13 (byte*) TEXT#7
Redundant Phi (byte) main::scroll#11 (byte) main::scroll#2
Redundant Phi (byte*) SCROLL#2 (byte*) SCROLL#11
Redundant Phi (byte*) BGCOL#10 (byte*) BGCOL#1
Redundant Phi (byte*) RASTER#10 (byte*) RASTER#13
Redundant Phi (byte*) fillscreen::cursor#0 (byte*) fillscreen::screen#0
Redundant Phi (byte) fillscreen::fill#2 (byte) fillscreen::fill#0
Redundant Phi (byte) fillscreen::fill#1 (byte) fillscreen::fill#2
Redundant Phi (byte*) fillscreen::screen#2 (byte*) fillscreen::cursor#0
Successful SSA optimization Pass2RedundantPhiElimination
Redundant Phi (byte*) SCROLL#1 (byte*) SCROLL#7
Redundant Phi (byte*) BGCOL#2 (byte*) BGCOL#5
Redundant Phi (byte*) RASTER#3 (byte*) RASTER#1
Redundant Phi (byte*) TEXT#11 (byte*) TEXT#10
Successful SSA optimization Pass2RedundantPhiElimination
Simple Condition (bool~) main::$2 [17] if(*((byte*) RASTER#1)!=(byte/word/signed word/dword/signed dword) 254) goto main::@2
Simple Condition (bool~) main::$3 [20] if(*((byte*) RASTER#1)!=(byte/word/signed word/dword/signed dword) 255) goto main::@3
Simple Condition (bool~) main::$5 [26] if((byte) main::scroll#1!=(byte/word/signed word/dword/signed dword) 255) goto main::@4
Simple Condition (bool~) main::$7 [39] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 39) goto main::@5
Simple Condition (bool~) main::$9 [44] if((byte) main::c#0!=(byte) '@') goto main::@6
Simple Condition (bool~) fillscreen::$1 [59] if((byte*) fillscreen::cursor#1<(byte*~) fillscreen::$0) goto fillscreen::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) SCREEN#0 = ((byte*))1024
Constant (const byte*) RASTER#0 = ((byte*))53266
Constant (const byte*) BGCOL#0 = ((byte*))53280
Constant (const byte*) SCROLL#0 = ((byte*))53270
Constant (const byte*) TEXT#0 = $0
Constant (const byte) fillscreen::fill#0 = 32
Constant (const byte) main::scroll#0 = 7
Constant (const byte) main::scroll#2 = 7
Constant (const byte) main::i#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) fillscreen::screen#0 = SCREEN#0
Constant (const byte*) main::nxt#0 = TEXT#0
Constant (const byte[]) main::line#0 = SCREEN#0+40
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) fillscreen::$0 = fillscreen::screen#0+1000
Successful SSA optimization Pass2ConstantIdentification
Consolidated array index constant in assignment *(main::line#0+1 + main::$6)
Consolidated array index constant in *(main::line#0+39)
Successful SSA optimization Pass2ConstantAdditionElimination
if() condition always true - replacing block destination [10] if(true) goto main::@1
Successful SSA optimization Pass2ConstantIfs
Inferred type updated to byte in [12] (byte/signed word/word/dword/signed dword~) main::$6 ← (byte) main::i#2
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Culled Empty Block (label) main::@13
Culled Empty Block (label) main::@1
Culled Empty Block (label) main::@9
Successful SSA optimization Pass2CullEmptyBlocks
Alias (byte) main::i#2 = (byte~) main::$6 
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte*) RASTER#1
Self Phi Eliminated (byte*) BGCOL#5
Self Phi Eliminated (byte*) SCROLL#7
Self Phi Eliminated (byte*) TEXT#10
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte*) RASTER#1 (const byte*) RASTER#0
Redundant Phi (byte*) BGCOL#5 (const byte*) BGCOL#0
Redundant Phi (byte*) SCROLL#7 (const byte*) SCROLL#0
Redundant Phi (byte*) TEXT#10 (const byte*) TEXT#0
Successful SSA optimization Pass2RedundantPhiElimination
Constant (const byte*) main::nxt#2 = TEXT#0
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with var siblings (const byte) main::scroll#0
Inlining constant with var siblings (const byte) main::scroll#2
Inlining constant with var siblings (const byte) main::i#0
Inlining constant with var siblings (const byte*) main::nxt#0
Inlining constant with var siblings (const byte*) main::nxt#2
Constant inlined main::nxt#0 = (const byte*) TEXT#0
Constant inlined main::scroll#0 = (byte/signed byte/word/signed word/dword/signed dword) 7
Constant inlined fillscreen::$0 = (const byte*) SCREEN#0+(word/signed word/dword/signed dword) 1000
Constant inlined fillscreen::screen#0 = (const byte*) SCREEN#0
Constant inlined main::scroll#2 = (byte/signed byte/word/signed word/dword/signed dword) 7
Constant inlined main::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined $0 = (const byte*) TEXT#0
Constant inlined main::nxt#2 = (const byte*) TEXT#0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@14(between main::@5 and main::@5)
Added new block during phi lifting main::@15(between main::@10 and main::@6)
Added new block during phi lifting main::@16(between main::@8 and main::@4)
Added new block during phi lifting fillscreen::@3(between fillscreen::@1 and fillscreen::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of fillscreen
CALL GRAPH
Calls in [] to main:2 
Calls in [main] to fillscreen:5 

Created 8 initial phi equivalence classes
Coalesced [19] main::c#4 ← main::c#1
Coalesced [23] main::nxt#14 ← main::nxt#1
Coalesced [27] main::scroll#12 ← main::scroll#10
Coalesced [28] main::nxt#12 ← main::nxt#10
Coalesced [29] main::c#3 ← main::c#0
Coalesced [30] main::nxt#13 ← main::nxt#9
Coalesced [31] main::i#3 ← main::i#1
Coalesced [32] main::scroll#13 ← main::scroll#1
Coalesced (already) [33] main::nxt#15 ← main::nxt#9
Coalesced [40] fillscreen::cursor#3 ← fillscreen::cursor#1
Coalesced down to 5 phi equivalence classes
Culled Empty Block (label) main::@15
Culled Empty Block (label) main::@14
Culled Empty Block (label) main::@16
Culled Empty Block (label) fillscreen::@3
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of fillscreen

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@2
@2: scope:[]  from @begin
  [1] phi()
  [2] call main 
  to:@end
@end: scope:[]  from @2
  [3] phi()
main: scope:[main]  from @2
  [4] phi()
  [5] call fillscreen 
  to:main::@2
main::@2: scope:[main]  from main main::@2 main::@4
  [6] (byte*) main::nxt#9 ← phi( main::@4/(byte*) main::nxt#10 main/(const byte*) TEXT#0 )
  [6] (byte) main::scroll#7 ← phi( main::@4/(byte) main::scroll#10 main/(byte/signed byte/word/signed word/dword/signed dword) 7 )
  [7] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 254) goto main::@2
  to:main::@3
main::@3: scope:[main]  from main::@2 main::@3
  [8] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@3
  to:main::@8
main::@8: scope:[main]  from main::@3
  [9] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0)
  [10] (byte) main::scroll#1 ← -- (byte) main::scroll#7
  [11] if((byte) main::scroll#1!=(byte/word/signed word/dword/signed dword) 255) goto main::@4
  to:main::@5
main::@5: scope:[main]  from main::@5 main::@8
  [12] (byte) main::i#2 ← phi( main::@5/(byte) main::i#1 main::@8/(byte/signed byte/word/signed word/dword/signed dword) 0 )
  [13] *((const byte[]) main::line#0 + (byte) main::i#2) ← *((const byte[]) main::line#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) main::i#2)
  [14] (byte) main::i#1 ← ++ (byte) main::i#2
  [15] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 39) goto main::@5
  to:main::@10
main::@10: scope:[main]  from main::@5
  [16] (byte) main::c#0 ← *((byte*) main::nxt#9)
  [17] if((byte) main::c#0!=(byte) '@') goto main::@6
  to:main::@11
main::@11: scope:[main]  from main::@10
  [18] (byte) main::c#1 ← *((const byte*) TEXT#0)
  to:main::@6
main::@6: scope:[main]  from main::@10 main::@11
  [19] (byte*) main::nxt#4 ← phi( main::@10/(byte*) main::nxt#9 main::@11/(const byte*) TEXT#0 )
  [19] (byte) main::c#2 ← phi( main::@10/(byte) main::c#0 main::@11/(byte) main::c#1 )
  [20] *((const byte[]) main::line#0+(byte/signed byte/word/signed word/dword/signed dword) 39) ← (byte) main::c#2
  [21] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4
  to:main::@4
main::@4: scope:[main]  from main::@6 main::@8
  [22] (byte*) main::nxt#10 ← phi( main::@6/(byte*) main::nxt#1 main::@8/(byte*) main::nxt#9 )
  [22] (byte) main::scroll#10 ← phi( main::@6/(byte/signed byte/word/signed word/dword/signed dword) 7 main::@8/(byte) main::scroll#1 )
  [23] *((const byte*) SCROLL#0) ← (byte) main::scroll#10
  [24] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0)
  to:main::@2
fillscreen: scope:[fillscreen]  from main
  [25] phi()
  to:fillscreen::@1
fillscreen::@1: scope:[fillscreen]  from fillscreen fillscreen::@1
  [26] (byte*) fillscreen::cursor#2 ← phi( fillscreen/(const byte*) SCREEN#0 fillscreen::@1/(byte*) fillscreen::cursor#1 )
  [27] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0
  [28] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2
  [29] if((byte*) fillscreen::cursor#1<(const byte*) SCREEN#0+(word/signed word/dword/signed dword) 1000) goto fillscreen::@1
  to:fillscreen::@return
fillscreen::@return: scope:[fillscreen]  from fillscreen::@1
  [30] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(byte*) BGCOL
(byte*) RASTER
(byte*) SCREEN
(byte*) SCROLL
(byte*) TEXT
(void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill)
(byte*) fillscreen::cursor
(byte*) fillscreen::cursor#1 16.5
(byte*) fillscreen::cursor#2 16.5
(byte) fillscreen::fill
(byte*) fillscreen::screen
(void()) main()
(byte) main::c
(byte) main::c#0 16.5
(byte) main::c#1 22.0
(byte) main::c#2 33.0
(byte) main::i
(byte) main::i#1 151.5
(byte) main::i#2 202.0
(byte[]) main::line
(byte*) main::nxt
(byte*) main::nxt#1 22.0
(byte*) main::nxt#10 11.0
(byte*) main::nxt#4 11.0
(byte*) main::nxt#9 3.6666666666666665
(byte) main::scroll
(byte) main::scroll#1 16.5
(byte) main::scroll#10 11.0
(byte) main::scroll#7 5.5

Initial phi equivalence classes
[ main::scroll#7 main::scroll#10 main::scroll#1 ]
[ main::i#2 main::i#1 ]
[ main::c#2 main::c#0 main::c#1 ]
[ main::nxt#4 main::nxt#9 main::nxt#10 main::nxt#1 ]
[ fillscreen::cursor#2 fillscreen::cursor#1 ]
Complete equivalence classes
[ main::scroll#7 main::scroll#10 main::scroll#1 ]
[ main::i#2 main::i#1 ]
[ main::c#2 main::c#0 main::c#1 ]
[ main::nxt#4 main::nxt#9 main::nxt#10 main::nxt#1 ]
[ fillscreen::cursor#2 fillscreen::cursor#1 ]
Allocated zp ZP_BYTE:2 [ main::scroll#7 main::scroll#10 main::scroll#1 ]
Allocated zp ZP_BYTE:3 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:4 [ main::c#2 main::c#0 main::c#1 ]
Allocated zp ZP_WORD:5 [ main::nxt#4 main::nxt#9 main::nxt#10 main::nxt#1 ]
Allocated zp ZP_WORD:7 [ fillscreen::cursor#2 fillscreen::cursor#1 ]

INITIAL ASM
//SEG0 File Comments
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
  .label SCREEN = $400
  .label RASTER = $d012
  .label BGCOL = $d020
  .label SCROLL = $d016
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
  jmp b2
//SEG5 @2
b2:
//SEG6 [2] call main 
//SEG7 [4] phi from @2 to main [phi:@2->main]
main_from_b2:
  jsr main
//SEG8 [3] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
  jmp bend
//SEG9 @end
bend:
//SEG10 main
main: {
    .label line = SCREEN+$28
    .label scroll = 2
    .label i = 3
    .label c = 4
    .label nxt = 5
  //SEG11 [5] call fillscreen 
  //SEG12 [25] phi from main to fillscreen [phi:main->fillscreen]
  fillscreen_from_main:
    jsr fillscreen
  //SEG13 [6] phi from main to main::@2 [phi:main->main::@2]
  b2_from_main:
  //SEG14 [6] phi (byte*) main::nxt#9 = (const byte*) TEXT#0 [phi:main->main::@2#0] -- pbuz1=pbuc1 
    lda #<TEXT
    sta nxt
    lda #>TEXT
    sta nxt+1
  //SEG15 [6] phi (byte) main::scroll#7 = (byte/signed byte/word/signed word/dword/signed dword) 7 [phi:main->main::@2#1] -- vbuz1=vbuc1 
    lda #7
    sta scroll
    jmp b2
  // Wait for raster
  //SEG16 [6] phi from main::@2 to main::@2 [phi:main::@2->main::@2]
  b2_from_b2:
    jmp b2
  //SEG17 main::@2
  b2:
  //SEG18 [7] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 254) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$fe
    bne b2_from_b2
    jmp b3
  //SEG19 main::@3
  b3:
  //SEG20 [8] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@3 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$ff
    bne b3
    jmp b8
  //SEG21 main::@8
  b8:
  //SEG22 [9] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc BGCOL
  //SEG23 [10] (byte) main::scroll#1 ← -- (byte) main::scroll#7 -- vbuz1=_dec_vbuz1 
    dec scroll
  //SEG24 [11] if((byte) main::scroll#1!=(byte/word/signed word/dword/signed dword) 255) goto main::@4 -- vbuz1_neq_vbuc1_then_la1 
    lda scroll
    cmp #$ff
    bne b4_from_b8
  //SEG25 [12] phi from main::@8 to main::@5 [phi:main::@8->main::@5]
  b5_from_b8:
  //SEG26 [12] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@8->main::@5#0] -- vbuz1=vbuc1 
    lda #0
    sta i
    jmp b5
  // Hard scroll
  //SEG27 [12] phi from main::@5 to main::@5 [phi:main::@5->main::@5]
  b5_from_b5:
  //SEG28 [12] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@5->main::@5#0] -- register_copy 
    jmp b5
  //SEG29 main::@5
  b5:
  //SEG30 [13] *((const byte[]) main::line#0 + (byte) main::i#2) ← *((const byte[]) main::line#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 
    ldy i
    lda line+1,y
    sta line,y
  //SEG31 [14] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1 
    inc i
  //SEG32 [15] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 39) goto main::@5 -- vbuz1_neq_vbuc1_then_la1 
    lda i
    cmp #$27
    bne b5_from_b5
    jmp b10
  //SEG33 main::@10
  b10:
  //SEG34 [16] (byte) main::c#0 ← *((byte*) main::nxt#9) -- vbuz1=_deref_pbuz2 
    // Render next char
    ldy #0
    lda (nxt),y
    sta c
  //SEG35 [17] if((byte) main::c#0!=(byte) '@') goto main::@6 -- vbuz1_neq_vbuc1_then_la1 
    lda c
    cmp #'@'
    bne b6_from_b10
    jmp b11
  //SEG36 main::@11
  b11:
  //SEG37 [18] (byte) main::c#1 ← *((const byte*) TEXT#0) -- vbuz1=_deref_pbuc1 
    lda TEXT
    sta c
  //SEG38 [19] phi from main::@11 to main::@6 [phi:main::@11->main::@6]
  b6_from_b11:
  //SEG39 [19] phi (byte*) main::nxt#4 = (const byte*) TEXT#0 [phi:main::@11->main::@6#0] -- pbuz1=pbuc1 
    lda #<TEXT
    sta nxt
    lda #>TEXT
    sta nxt+1
  //SEG40 [19] phi (byte) main::c#2 = (byte) main::c#1 [phi:main::@11->main::@6#1] -- register_copy 
    jmp b6
  //SEG41 [19] phi from main::@10 to main::@6 [phi:main::@10->main::@6]
  b6_from_b10:
  //SEG42 [19] phi (byte*) main::nxt#4 = (byte*) main::nxt#9 [phi:main::@10->main::@6#0] -- register_copy 
  //SEG43 [19] phi (byte) main::c#2 = (byte) main::c#0 [phi:main::@10->main::@6#1] -- register_copy 
    jmp b6
  //SEG44 main::@6
  b6:
  //SEG45 [20] *((const byte[]) main::line#0+(byte/signed byte/word/signed word/dword/signed dword) 39) ← (byte) main::c#2 -- _deref_pbuc1=vbuz1 
    lda c
    sta line+$27
  //SEG46 [21] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 -- pbuz1=_inc_pbuz1 
    inc nxt
    bne !+
    inc nxt+1
  !:
  //SEG47 [22] phi from main::@6 to main::@4 [phi:main::@6->main::@4]
  b4_from_b6:
  //SEG48 [22] phi (byte*) main::nxt#10 = (byte*) main::nxt#1 [phi:main::@6->main::@4#0] -- register_copy 
  //SEG49 [22] phi (byte) main::scroll#10 = (byte/signed byte/word/signed word/dword/signed dword) 7 [phi:main::@6->main::@4#1] -- vbuz1=vbuc1 
    lda #7
    sta scroll
    jmp b4
  //SEG50 [22] phi from main::@8 to main::@4 [phi:main::@8->main::@4]
  b4_from_b8:
  //SEG51 [22] phi (byte*) main::nxt#10 = (byte*) main::nxt#9 [phi:main::@8->main::@4#0] -- register_copy 
  //SEG52 [22] phi (byte) main::scroll#10 = (byte) main::scroll#1 [phi:main::@8->main::@4#1] -- register_copy 
    jmp b4
  //SEG53 main::@4
  b4:
  //SEG54 [23] *((const byte*) SCROLL#0) ← (byte) main::scroll#10 -- _deref_pbuc1=vbuz1 
    lda scroll
    sta SCROLL
  //SEG55 [24] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 
    dec BGCOL
  //SEG56 [6] phi from main::@4 to main::@2 [phi:main::@4->main::@2]
  b2_from_b4:
  //SEG57 [6] phi (byte*) main::nxt#9 = (byte*) main::nxt#10 [phi:main::@4->main::@2#0] -- register_copy 
  //SEG58 [6] phi (byte) main::scroll#7 = (byte) main::scroll#10 [phi:main::@4->main::@2#1] -- register_copy 
    jmp b2
}
//SEG59 fillscreen
fillscreen: {
    .const fill = $20
    .label cursor = 7
  //SEG60 [26] phi from fillscreen to fillscreen::@1 [phi:fillscreen->fillscreen::@1]
  b1_from_fillscreen:
  //SEG61 [26] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta cursor
    lda #>SCREEN
    sta cursor+1
    jmp b1
  //SEG62 [26] phi from fillscreen::@1 to fillscreen::@1 [phi:fillscreen::@1->fillscreen::@1]
  b1_from_b1:
  //SEG63 [26] phi (byte*) fillscreen::cursor#2 = (byte*) fillscreen::cursor#1 [phi:fillscreen::@1->fillscreen::@1#0] -- register_copy 
    jmp b1
  //SEG64 fillscreen::@1
  b1:
  //SEG65 [27] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 -- _deref_pbuz1=vbuc1 
    lda #fill
    ldy #0
    sta (cursor),y
  //SEG66 [28] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 -- pbuz1=_inc_pbuz1 
    inc cursor
    bne !+
    inc cursor+1
  !:
  //SEG67 [29] if((byte*) fillscreen::cursor#1<(const byte*) SCREEN#0+(word/signed word/dword/signed dword) 1000) goto fillscreen::@1 -- pbuz1_lt_pbuc1_then_la1 
    lda cursor+1
    cmp #>SCREEN+$3e8
    bcc b1_from_b1
    bne !+
    lda cursor
    cmp #<SCREEN+$3e8
    bcc b1_from_b1
  !:
    jmp breturn
  //SEG68 fillscreen::@return
  breturn:
  //SEG69 [30] return 
    rts
}
  TEXT: .text "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =-     @"

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 254) goto main::@2 [ main::scroll#7 main::nxt#9 ] ( main:2 [ main::scroll#7 main::nxt#9 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::scroll#7 main::scroll#10 main::scroll#1 ]
Statement [8] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@3 [ main::scroll#7 main::nxt#9 ] ( main:2 [ main::scroll#7 main::nxt#9 ] ) always clobbers reg byte a 
Statement [13] *((const byte[]) main::line#0 + (byte) main::i#2) ← *((const byte[]) main::line#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) main::i#2) [ main::nxt#9 main::i#2 ] ( main:2 [ main::nxt#9 main::i#2 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::i#2 main::i#1 ]
Statement [16] (byte) main::c#0 ← *((byte*) main::nxt#9) [ main::nxt#9 main::c#0 ] ( main:2 [ main::nxt#9 main::c#0 ] ) always clobbers reg byte a reg byte y 
Statement [27] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) always clobbers reg byte a reg byte y 
Statement [29] if((byte*) fillscreen::cursor#1<(const byte*) SCREEN#0+(word/signed word/dword/signed dword) 1000) goto fillscreen::@1 [ fillscreen::cursor#1 ] ( main:2::fillscreen:5 [ fillscreen::cursor#1 ] ) always clobbers reg byte a 
Statement [7] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 254) goto main::@2 [ main::scroll#7 main::nxt#9 ] ( main:2 [ main::scroll#7 main::nxt#9 ] ) always clobbers reg byte a 
Statement [8] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@3 [ main::scroll#7 main::nxt#9 ] ( main:2 [ main::scroll#7 main::nxt#9 ] ) always clobbers reg byte a 
Statement [13] *((const byte[]) main::line#0 + (byte) main::i#2) ← *((const byte[]) main::line#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) main::i#2) [ main::nxt#9 main::i#2 ] ( main:2 [ main::nxt#9 main::i#2 ] ) always clobbers reg byte a 
Statement [16] (byte) main::c#0 ← *((byte*) main::nxt#9) [ main::nxt#9 main::c#0 ] ( main:2 [ main::nxt#9 main::c#0 ] ) always clobbers reg byte a reg byte y 
Statement [27] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) always clobbers reg byte a reg byte y 
Statement [29] if((byte*) fillscreen::cursor#1<(const byte*) SCREEN#0+(word/signed word/dword/signed dword) 1000) goto fillscreen::@1 [ fillscreen::cursor#1 ] ( main:2::fillscreen:5 [ fillscreen::cursor#1 ] ) always clobbers reg byte a 
Potential registers zp ZP_BYTE:2 [ main::scroll#7 main::scroll#10 main::scroll#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:3 [ main::i#2 main::i#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:4 [ main::c#2 main::c#0 main::c#1 ] : zp ZP_BYTE:4 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_WORD:5 [ main::nxt#4 main::nxt#9 main::nxt#10 main::nxt#1 ] : zp ZP_WORD:5 , 
Potential registers zp ZP_WORD:7 [ fillscreen::cursor#2 fillscreen::cursor#1 ] : zp ZP_WORD:7 , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 353.5: zp ZP_BYTE:3 [ main::i#2 main::i#1 ] 71.5: zp ZP_BYTE:4 [ main::c#2 main::c#0 main::c#1 ] 47.67: zp ZP_WORD:5 [ main::nxt#4 main::nxt#9 main::nxt#10 main::nxt#1 ] 33: zp ZP_BYTE:2 [ main::scroll#7 main::scroll#10 main::scroll#1 ] 
Uplift Scope [fillscreen] 33: zp ZP_WORD:7 [ fillscreen::cursor#2 fillscreen::cursor#1 ] 
Uplift Scope [] 

Uplifting [main] best 8554 combination reg byte x [ main::i#2 main::i#1 ] reg byte x [ main::c#2 main::c#0 main::c#1 ] zp ZP_WORD:5 [ main::nxt#4 main::nxt#9 main::nxt#10 main::nxt#1 ] reg byte x [ main::scroll#7 main::scroll#10 main::scroll#1 ] 
Uplifting [fillscreen] best 8554 combination zp ZP_WORD:7 [ fillscreen::cursor#2 fillscreen::cursor#1 ] 
Uplifting [] best 8554 combination 
Coalescing zero page register [ zp ZP_WORD:5 [ main::nxt#4 main::nxt#9 main::nxt#10 main::nxt#1 ] ] with [ zp ZP_WORD:7 [ fillscreen::cursor#2 fillscreen::cursor#1 ] ]
Allocated (was zp ZP_WORD:5) zp ZP_WORD:2 [ main::nxt#4 main::nxt#9 main::nxt#10 main::nxt#1 fillscreen::cursor#2 fillscreen::cursor#1 ]

ASSEMBLER BEFORE OPTIMIZATION
//SEG0 File Comments
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
  .label SCREEN = $400
  .label RASTER = $d012
  .label BGCOL = $d020
  .label SCROLL = $d016
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
  jmp b2
//SEG5 @2
b2:
//SEG6 [2] call main 
//SEG7 [4] phi from @2 to main [phi:@2->main]
main_from_b2:
  jsr main
//SEG8 [3] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
  jmp bend
//SEG9 @end
bend:
//SEG10 main
main: {
    .label line = SCREEN+$28
    .label nxt = 2
  //SEG11 [5] call fillscreen 
  //SEG12 [25] phi from main to fillscreen [phi:main->fillscreen]
  fillscreen_from_main:
    jsr fillscreen
  //SEG13 [6] phi from main to main::@2 [phi:main->main::@2]
  b2_from_main:
  //SEG14 [6] phi (byte*) main::nxt#9 = (const byte*) TEXT#0 [phi:main->main::@2#0] -- pbuz1=pbuc1 
    lda #<TEXT
    sta nxt
    lda #>TEXT
    sta nxt+1
  //SEG15 [6] phi (byte) main::scroll#7 = (byte/signed byte/word/signed word/dword/signed dword) 7 [phi:main->main::@2#1] -- vbuxx=vbuc1 
    ldx #7
    jmp b2
  // Wait for raster
  //SEG16 [6] phi from main::@2 to main::@2 [phi:main::@2->main::@2]
  b2_from_b2:
    jmp b2
  //SEG17 main::@2
  b2:
  //SEG18 [7] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 254) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$fe
    bne b2_from_b2
    jmp b3
  //SEG19 main::@3
  b3:
  //SEG20 [8] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@3 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$ff
    bne b3
    jmp b8
  //SEG21 main::@8
  b8:
  //SEG22 [9] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc BGCOL
  //SEG23 [10] (byte) main::scroll#1 ← -- (byte) main::scroll#7 -- vbuxx=_dec_vbuxx 
    dex
  //SEG24 [11] if((byte) main::scroll#1!=(byte/word/signed word/dword/signed dword) 255) goto main::@4 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$ff
    bne b4_from_b8
  //SEG25 [12] phi from main::@8 to main::@5 [phi:main::@8->main::@5]
  b5_from_b8:
  //SEG26 [12] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@8->main::@5#0] -- vbuxx=vbuc1 
    ldx #0
    jmp b5
  // Hard scroll
  //SEG27 [12] phi from main::@5 to main::@5 [phi:main::@5->main::@5]
  b5_from_b5:
  //SEG28 [12] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@5->main::@5#0] -- register_copy 
    jmp b5
  //SEG29 main::@5
  b5:
  //SEG30 [13] *((const byte[]) main::line#0 + (byte) main::i#2) ← *((const byte[]) main::line#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda line+1,x
    sta line,x
  //SEG31 [14] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx 
    inx
  //SEG32 [15] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 39) goto main::@5 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$27
    bne b5_from_b5
    jmp b10
  //SEG33 main::@10
  b10:
  //SEG34 [16] (byte) main::c#0 ← *((byte*) main::nxt#9) -- vbuxx=_deref_pbuz1 
    // Render next char
    ldy #0
    lda (nxt),y
    tax
  //SEG35 [17] if((byte) main::c#0!=(byte) '@') goto main::@6 -- vbuxx_neq_vbuc1_then_la1 
    cpx #'@'
    bne b6_from_b10
    jmp b11
  //SEG36 main::@11
  b11:
  //SEG37 [18] (byte) main::c#1 ← *((const byte*) TEXT#0) -- vbuxx=_deref_pbuc1 
    ldx TEXT
  //SEG38 [19] phi from main::@11 to main::@6 [phi:main::@11->main::@6]
  b6_from_b11:
  //SEG39 [19] phi (byte*) main::nxt#4 = (const byte*) TEXT#0 [phi:main::@11->main::@6#0] -- pbuz1=pbuc1 
    lda #<TEXT
    sta nxt
    lda #>TEXT
    sta nxt+1
  //SEG40 [19] phi (byte) main::c#2 = (byte) main::c#1 [phi:main::@11->main::@6#1] -- register_copy 
    jmp b6
  //SEG41 [19] phi from main::@10 to main::@6 [phi:main::@10->main::@6]
  b6_from_b10:
  //SEG42 [19] phi (byte*) main::nxt#4 = (byte*) main::nxt#9 [phi:main::@10->main::@6#0] -- register_copy 
  //SEG43 [19] phi (byte) main::c#2 = (byte) main::c#0 [phi:main::@10->main::@6#1] -- register_copy 
    jmp b6
  //SEG44 main::@6
  b6:
  //SEG45 [20] *((const byte[]) main::line#0+(byte/signed byte/word/signed word/dword/signed dword) 39) ← (byte) main::c#2 -- _deref_pbuc1=vbuxx 
    stx line+$27
  //SEG46 [21] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 -- pbuz1=_inc_pbuz1 
    inc nxt
    bne !+
    inc nxt+1
  !:
  //SEG47 [22] phi from main::@6 to main::@4 [phi:main::@6->main::@4]
  b4_from_b6:
  //SEG48 [22] phi (byte*) main::nxt#10 = (byte*) main::nxt#1 [phi:main::@6->main::@4#0] -- register_copy 
  //SEG49 [22] phi (byte) main::scroll#10 = (byte/signed byte/word/signed word/dword/signed dword) 7 [phi:main::@6->main::@4#1] -- vbuxx=vbuc1 
    ldx #7
    jmp b4
  //SEG50 [22] phi from main::@8 to main::@4 [phi:main::@8->main::@4]
  b4_from_b8:
  //SEG51 [22] phi (byte*) main::nxt#10 = (byte*) main::nxt#9 [phi:main::@8->main::@4#0] -- register_copy 
  //SEG52 [22] phi (byte) main::scroll#10 = (byte) main::scroll#1 [phi:main::@8->main::@4#1] -- register_copy 
    jmp b4
  //SEG53 main::@4
  b4:
  //SEG54 [23] *((const byte*) SCROLL#0) ← (byte) main::scroll#10 -- _deref_pbuc1=vbuxx 
    stx SCROLL
  //SEG55 [24] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 
    dec BGCOL
  //SEG56 [6] phi from main::@4 to main::@2 [phi:main::@4->main::@2]
  b2_from_b4:
  //SEG57 [6] phi (byte*) main::nxt#9 = (byte*) main::nxt#10 [phi:main::@4->main::@2#0] -- register_copy 
  //SEG58 [6] phi (byte) main::scroll#7 = (byte) main::scroll#10 [phi:main::@4->main::@2#1] -- register_copy 
    jmp b2
}
//SEG59 fillscreen
fillscreen: {
    .const fill = $20
    .label cursor = 2
  //SEG60 [26] phi from fillscreen to fillscreen::@1 [phi:fillscreen->fillscreen::@1]
  b1_from_fillscreen:
  //SEG61 [26] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta cursor
    lda #>SCREEN
    sta cursor+1
    jmp b1
  //SEG62 [26] phi from fillscreen::@1 to fillscreen::@1 [phi:fillscreen::@1->fillscreen::@1]
  b1_from_b1:
  //SEG63 [26] phi (byte*) fillscreen::cursor#2 = (byte*) fillscreen::cursor#1 [phi:fillscreen::@1->fillscreen::@1#0] -- register_copy 
    jmp b1
  //SEG64 fillscreen::@1
  b1:
  //SEG65 [27] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 -- _deref_pbuz1=vbuc1 
    lda #fill
    ldy #0
    sta (cursor),y
  //SEG66 [28] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 -- pbuz1=_inc_pbuz1 
    inc cursor
    bne !+
    inc cursor+1
  !:
  //SEG67 [29] if((byte*) fillscreen::cursor#1<(const byte*) SCREEN#0+(word/signed word/dword/signed dword) 1000) goto fillscreen::@1 -- pbuz1_lt_pbuc1_then_la1 
    lda cursor+1
    cmp #>SCREEN+$3e8
    bcc b1_from_b1
    bne !+
    lda cursor
    cmp #<SCREEN+$3e8
    bcc b1_from_b1
  !:
    jmp breturn
  //SEG68 fillscreen::@return
  breturn:
  //SEG69 [30] return 
    rts
}
  TEXT: .text "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =-     @"

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b2
Removing instruction jmp bend
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp b8
Removing instruction jmp b5
Removing instruction jmp b10
Removing instruction jmp b11
Removing instruction jmp b6
Removing instruction jmp b4
Removing instruction jmp b1
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label b2_from_b2 with b2
Replacing label b4_from_b8 with b4
Replacing label b5_from_b5 with b5
Replacing label b6_from_b10 with b6
Replacing label b1_from_b1 with b1
Replacing label b1_from_b1 with b1
Removing instruction b2_from_bbegin:
Removing instruction b2:
Removing instruction main_from_b2:
Removing instruction bend_from_b2:
Removing instruction b2_from_b2:
Removing instruction b5_from_b5:
Removing instruction b6_from_b10:
Removing instruction b4_from_b8:
Removing instruction b1_from_b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction fillscreen_from_main:
Removing instruction b2_from_main:
Removing instruction b8:
Removing instruction b5_from_b8:
Removing instruction b10:
Removing instruction b11:
Removing instruction b6_from_b11:
Removing instruction b4_from_b6:
Removing instruction b2_from_b4:
Removing instruction b1_from_fillscreen:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp b2
Removing instruction jmp b5
Removing instruction jmp b6
Removing instruction jmp b4
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @2
(label) @begin
(label) @end
(byte*) BGCOL
(const byte*) BGCOL#0 BGCOL = ((byte*))(word/dword/signed dword) 53280
(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*) SCROLL
(const byte*) SCROLL#0 SCROLL = ((byte*))(word/dword/signed dword) 53270
(byte*) TEXT
(const byte*) TEXT#0 TEXT = (string) "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =-     @"
(void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill)
(label) fillscreen::@1
(label) fillscreen::@return
(byte*) fillscreen::cursor
(byte*) fillscreen::cursor#1 cursor zp ZP_WORD:2 16.5
(byte*) fillscreen::cursor#2 cursor zp ZP_WORD:2 16.5
(byte) fillscreen::fill
(const byte) fillscreen::fill#0 fill = (byte/signed byte/word/signed word/dword/signed dword) 32
(byte*) fillscreen::screen
(void()) main()
(label) main::@10
(label) main::@11
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@8
(byte) main::c
(byte) main::c#0 reg byte x 16.5
(byte) main::c#1 reg byte x 22.0
(byte) main::c#2 reg byte x 33.0
(byte) main::i
(byte) main::i#1 reg byte x 151.5
(byte) main::i#2 reg byte x 202.0
(byte[]) main::line
(const byte[]) main::line#0 line = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40
(byte*) main::nxt
(byte*) main::nxt#1 nxt zp ZP_WORD:2 22.0
(byte*) main::nxt#10 nxt zp ZP_WORD:2 11.0
(byte*) main::nxt#4 nxt zp ZP_WORD:2 11.0
(byte*) main::nxt#9 nxt zp ZP_WORD:2 3.6666666666666665
(byte) main::scroll
(byte) main::scroll#1 reg byte x 16.5
(byte) main::scroll#10 reg byte x 11.0
(byte) main::scroll#7 reg byte x 5.5

reg byte x [ main::scroll#7 main::scroll#10 main::scroll#1 ]
reg byte x [ main::i#2 main::i#1 ]
reg byte x [ main::c#2 main::c#0 main::c#1 ]
zp ZP_WORD:2 [ main::nxt#4 main::nxt#9 main::nxt#10 main::nxt#1 fillscreen::cursor#2 fillscreen::cursor#1 ]


FINAL ASSEMBLER
Score: 6202

//SEG0 File Comments
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG2 Global Constants & labels
  .label SCREEN = $400
  .label RASTER = $d012
  .label BGCOL = $d020
  .label SCROLL = $d016
//SEG3 @begin
//SEG4 [1] phi from @begin to @2 [phi:@begin->@2]
//SEG5 @2
//SEG6 [2] call main 
//SEG7 [4] phi from @2 to main [phi:@2->main]
//SEG8 [3] phi from @2 to @end [phi:@2->@end]
//SEG9 @end
//SEG10 main
main: {
    .label line = SCREEN+$28
    .label nxt = 2
  //SEG11 [5] call fillscreen 
  //SEG12 [25] phi from main to fillscreen [phi:main->fillscreen]
    jsr fillscreen
  //SEG13 [6] phi from main to main::@2 [phi:main->main::@2]
  //SEG14 [6] phi (byte*) main::nxt#9 = (const byte*) TEXT#0 [phi:main->main::@2#0] -- pbuz1=pbuc1 
    lda #<TEXT
    sta nxt
    lda #>TEXT
    sta nxt+1
  //SEG15 [6] phi (byte) main::scroll#7 = (byte/signed byte/word/signed word/dword/signed dword) 7 [phi:main->main::@2#1] -- vbuxx=vbuc1 
    ldx #7
  // Wait for raster
  //SEG16 [6] phi from main::@2 to main::@2 [phi:main::@2->main::@2]
  //SEG17 main::@2
  b2:
  //SEG18 [7] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 254) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$fe
    bne b2
  //SEG19 main::@3
  b3:
  //SEG20 [8] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@3 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$ff
    bne b3
  //SEG21 main::@8
  //SEG22 [9] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc BGCOL
  //SEG23 [10] (byte) main::scroll#1 ← -- (byte) main::scroll#7 -- vbuxx=_dec_vbuxx 
    dex
  //SEG24 [11] if((byte) main::scroll#1!=(byte/word/signed word/dword/signed dword) 255) goto main::@4 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$ff
    bne b4
  //SEG25 [12] phi from main::@8 to main::@5 [phi:main::@8->main::@5]
  //SEG26 [12] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@8->main::@5#0] -- vbuxx=vbuc1 
    ldx #0
  // Hard scroll
  //SEG27 [12] phi from main::@5 to main::@5 [phi:main::@5->main::@5]
  //SEG28 [12] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@5->main::@5#0] -- register_copy 
  //SEG29 main::@5
  b5:
  //SEG30 [13] *((const byte[]) main::line#0 + (byte) main::i#2) ← *((const byte[]) main::line#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda line+1,x
    sta line,x
  //SEG31 [14] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx 
    inx
  //SEG32 [15] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 39) goto main::@5 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$27
    bne b5
  //SEG33 main::@10
  //SEG34 [16] (byte) main::c#0 ← *((byte*) main::nxt#9) -- vbuxx=_deref_pbuz1 
    // Render next char
    ldy #0
    lda (nxt),y
    tax
  //SEG35 [17] if((byte) main::c#0!=(byte) '@') goto main::@6 -- vbuxx_neq_vbuc1_then_la1 
    cpx #'@'
    bne b6
  //SEG36 main::@11
  //SEG37 [18] (byte) main::c#1 ← *((const byte*) TEXT#0) -- vbuxx=_deref_pbuc1 
    ldx TEXT
  //SEG38 [19] phi from main::@11 to main::@6 [phi:main::@11->main::@6]
  //SEG39 [19] phi (byte*) main::nxt#4 = (const byte*) TEXT#0 [phi:main::@11->main::@6#0] -- pbuz1=pbuc1 
    lda #<TEXT
    sta nxt
    lda #>TEXT
    sta nxt+1
  //SEG40 [19] phi (byte) main::c#2 = (byte) main::c#1 [phi:main::@11->main::@6#1] -- register_copy 
  //SEG41 [19] phi from main::@10 to main::@6 [phi:main::@10->main::@6]
  //SEG42 [19] phi (byte*) main::nxt#4 = (byte*) main::nxt#9 [phi:main::@10->main::@6#0] -- register_copy 
  //SEG43 [19] phi (byte) main::c#2 = (byte) main::c#0 [phi:main::@10->main::@6#1] -- register_copy 
  //SEG44 main::@6
  b6:
  //SEG45 [20] *((const byte[]) main::line#0+(byte/signed byte/word/signed word/dword/signed dword) 39) ← (byte) main::c#2 -- _deref_pbuc1=vbuxx 
    stx line+$27
  //SEG46 [21] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 -- pbuz1=_inc_pbuz1 
    inc nxt
    bne !+
    inc nxt+1
  !:
  //SEG47 [22] phi from main::@6 to main::@4 [phi:main::@6->main::@4]
  //SEG48 [22] phi (byte*) main::nxt#10 = (byte*) main::nxt#1 [phi:main::@6->main::@4#0] -- register_copy 
  //SEG49 [22] phi (byte) main::scroll#10 = (byte/signed byte/word/signed word/dword/signed dword) 7 [phi:main::@6->main::@4#1] -- vbuxx=vbuc1 
    ldx #7
  //SEG50 [22] phi from main::@8 to main::@4 [phi:main::@8->main::@4]
  //SEG51 [22] phi (byte*) main::nxt#10 = (byte*) main::nxt#9 [phi:main::@8->main::@4#0] -- register_copy 
  //SEG52 [22] phi (byte) main::scroll#10 = (byte) main::scroll#1 [phi:main::@8->main::@4#1] -- register_copy 
  //SEG53 main::@4
  b4:
  //SEG54 [23] *((const byte*) SCROLL#0) ← (byte) main::scroll#10 -- _deref_pbuc1=vbuxx 
    stx SCROLL
  //SEG55 [24] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 
    dec BGCOL
  //SEG56 [6] phi from main::@4 to main::@2 [phi:main::@4->main::@2]
  //SEG57 [6] phi (byte*) main::nxt#9 = (byte*) main::nxt#10 [phi:main::@4->main::@2#0] -- register_copy 
  //SEG58 [6] phi (byte) main::scroll#7 = (byte) main::scroll#10 [phi:main::@4->main::@2#1] -- register_copy 
    jmp b2
}
//SEG59 fillscreen
fillscreen: {
    .const fill = $20
    .label cursor = 2
  //SEG60 [26] phi from fillscreen to fillscreen::@1 [phi:fillscreen->fillscreen::@1]
  //SEG61 [26] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta cursor
    lda #>SCREEN
    sta cursor+1
  //SEG62 [26] phi from fillscreen::@1 to fillscreen::@1 [phi:fillscreen::@1->fillscreen::@1]
  //SEG63 [26] phi (byte*) fillscreen::cursor#2 = (byte*) fillscreen::cursor#1 [phi:fillscreen::@1->fillscreen::@1#0] -- register_copy 
  //SEG64 fillscreen::@1
  b1:
  //SEG65 [27] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 -- _deref_pbuz1=vbuc1 
    lda #fill
    ldy #0
    sta (cursor),y
  //SEG66 [28] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 -- pbuz1=_inc_pbuz1 
    inc cursor
    bne !+
    inc cursor+1
  !:
  //SEG67 [29] if((byte*) fillscreen::cursor#1<(const byte*) SCREEN#0+(word/signed word/dword/signed dword) 1000) goto fillscreen::@1 -- pbuz1_lt_pbuc1_then_la1 
    lda cursor+1
    cmp #>SCREEN+$3e8
    bcc b1
    bne !+
    lda cursor
    cmp #<SCREEN+$3e8
    bcc b1
  !:
  //SEG68 fillscreen::@return
  //SEG69 [30] return 
    rts
}
  TEXT: .text "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =-     @"

