Inlined call vicSelectGfxBank::$0 = call toDd00(vicSelectGfxBank::gfx)

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start
  fillscreen::screen#0 = SCREEN
  fillscreen::fill#0 = $20
  call fillscreen
  to:main::@11
main::@11: scope:[main]  from main
  main::scroll#0 = 7
  main::nxt#0 = TEXT
  to:main::@1
main::@1: scope:[main]  from main::@1 main::@11 main::@5
  main::nxt#10 = phi( main::@1/main::nxt#10, main::@11/main::nxt#0, main::@5/main::nxt#11 )
  main::scroll#7 = phi( main::@1/main::scroll#7, main::@11/main::scroll#0, main::@5/main::scroll#4 )
  main::$1 = *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) != $fe
  if(main::$1) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@1 main::@2
  main::nxt#9 = phi( main::@1/main::nxt#10, main::@2/main::nxt#9 )
  main::scroll#5 = phi( main::@1/main::scroll#7, main::@2/main::scroll#5 )
  main::$2 = *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) != $ff
  if(main::$2) goto main::@2
  to:main::@3
main::@3: scope:[main]  from main::@2
  main::nxt#8 = phi( main::@2/main::nxt#9 )
  main::scroll#3 = phi( main::@2/main::scroll#5 )
  *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) = ++ *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR)
  main::scroll#1 = -- main::scroll#3
  main::$4 = main::scroll#1 == $ff
  main::$5 = ! main::$4
  if(main::$5) goto main::@5
  to:main::@4
main::@5: scope:[main]  from main::@10 main::@3
  main::nxt#11 = phi( main::@10/main::nxt#1, main::@3/main::nxt#8 )
  main::scroll#4 = phi( main::@10/main::scroll#6, main::@3/main::scroll#1 )
  *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2) = main::scroll#4
  *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) = -- *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR)
  if(true) goto main::@1
  to:main::@return
main::@4: scope:[main]  from main::@3
  main::nxt#6 = phi( main::@3/main::nxt#8 )
  main::scroll#2 = 7
  main::i#0 = 0
  to:main::@6
main::@6: scope:[main]  from main::@4 main::@7
  main::scroll#10 = phi( main::@4/main::scroll#2, main::@7/main::scroll#11 )
  main::nxt#5 = phi( main::@4/main::nxt#6, main::@7/main::nxt#7 )
  main::i#2 = phi( main::@4/main::i#0, main::@7/main::i#1 )
  main::$6 = main::i#2 != $27
  if(main::$6) goto main::@7
  to:main::@8
main::@7: scope:[main]  from main::@6
  main::scroll#11 = phi( main::@6/main::scroll#10 )
  main::nxt#7 = phi( main::@6/main::nxt#5 )
  main::i#3 = phi( main::@6/main::i#2 )
  main::$7 = main::i#3 + 1
  main::line[main::i#3] = main::line[main::$7]
  main::i#1 = ++ main::i#3
  to:main::@6
main::@8: scope:[main]  from main::@6
  main::scroll#8 = phi( main::@6/main::scroll#10 )
  main::nxt#3 = phi( main::@6/main::nxt#5 )
  main::c#0 = *main::nxt#3
  main::$8 = main::c#0 == 0
  main::$9 = ! main::$8
  if(main::$9) goto main::@10
  to:main::@9
main::@10: scope:[main]  from main::@8 main::@9
  main::scroll#6 = phi( main::@8/main::scroll#8, main::@9/main::scroll#9 )
  main::nxt#4 = phi( main::@8/main::nxt#3, main::@9/main::nxt#2 )
  main::c#2 = phi( main::@8/main::c#0, main::@9/main::c#1 )
  main::line[$27] = main::c#2
  main::nxt#1 = ++ main::nxt#4
  to:main::@5
main::@9: scope:[main]  from main::@8
  main::scroll#9 = phi( main::@8/main::scroll#8 )
  main::nxt#2 = TEXT
  main::c#1 = *main::nxt#2
  to:main::@10
main::@return: scope:[main]  from main::@5
  return 
  to:@return

void fillscreen(char *screen , char fill)
fillscreen: scope:[fillscreen]  from main
  fillscreen::fill#3 = phi( main/fillscreen::fill#0 )
  fillscreen::screen#1 = phi( main/fillscreen::screen#0 )
  fillscreen::cursor#0 = fillscreen::screen#1
  to:fillscreen::@1
fillscreen::@1: scope:[fillscreen]  from fillscreen fillscreen::@2
  fillscreen::fill#2 = phi( fillscreen/fillscreen::fill#3, fillscreen::@2/fillscreen::fill#1 )
  fillscreen::cursor#2 = phi( fillscreen/fillscreen::cursor#0, fillscreen::@2/fillscreen::cursor#1 )
  fillscreen::screen#2 = phi( fillscreen/fillscreen::screen#1, fillscreen::@2/fillscreen::screen#3 )
  fillscreen::$0 = fillscreen::screen#2 + $3e8
  fillscreen::$1 = fillscreen::cursor#2 < fillscreen::$0
  if(fillscreen::$1) goto fillscreen::@2
  to:fillscreen::@return
fillscreen::@2: scope:[fillscreen]  from fillscreen::@1
  fillscreen::screen#3 = phi( fillscreen::@1/fillscreen::screen#2 )
  fillscreen::cursor#3 = phi( fillscreen::@1/fillscreen::cursor#2 )
  fillscreen::fill#1 = phi( fillscreen::@1/fillscreen::fill#2 )
  *fillscreen::cursor#3 = fillscreen::fill#1
  fillscreen::cursor#1 = ++ fillscreen::cursor#3
  to:fillscreen::@1
fillscreen::@return: scope:[fillscreen]  from fillscreen::@1
  return 
  to:@return

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

SYMBOL TABLE SSA
__constant char OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
__constant char OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16
__constant char OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
__constant char * const SCREEN = (char *)$400
__constant const char TEXT[] = "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =-     "
__constant struct MOS6569_VICII * const VICII = (struct MOS6569_VICII *)$d000
void __start()
void fillscreen(char *screen , char fill)
char *fillscreen::$0
bool fillscreen::$1
char *fillscreen::cursor
char *fillscreen::cursor#0
char *fillscreen::cursor#1
char *fillscreen::cursor#2
char *fillscreen::cursor#3
char fillscreen::fill
char fillscreen::fill#0
char fillscreen::fill#1
char fillscreen::fill#2
char fillscreen::fill#3
char *fillscreen::screen
char *fillscreen::screen#0
char *fillscreen::screen#1
char *fillscreen::screen#2
char *fillscreen::screen#3
void main()
bool main::$1
bool main::$2
bool main::$4
bool main::$5
bool main::$6
number main::$7
bool main::$8
bool main::$9
char main::c
char main::c#0
char main::c#1
char main::c#2
char main::i
char main::i#0
char main::i#1
char main::i#2
char main::i#3
__constant char * const main::line = SCREEN+$28
char *main::nxt
char *main::nxt#0
char *main::nxt#1
char *main::nxt#10
char *main::nxt#11
char *main::nxt#2
char *main::nxt#3
char *main::nxt#4
char *main::nxt#5
char *main::nxt#6
char *main::nxt#7
char *main::nxt#8
char *main::nxt#9
char main::scroll
char main::scroll#0
char main::scroll#1
char main::scroll#10
char main::scroll#11
char main::scroll#2
char main::scroll#3
char main::scroll#4
char main::scroll#5
char main::scroll#6
char main::scroll#7
char main::scroll#8
char main::scroll#9

Adding number conversion cast (unumber) $28 in 
Adding number conversion cast (unumber) $20 in fillscreen::fill#0 = $20
Adding number conversion cast (unumber) $fe in main::$1 = *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) != $fe
Adding number conversion cast (unumber) $ff in main::$2 = *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) != $ff
Adding number conversion cast (unumber) $ff in main::$4 = main::scroll#1 == $ff
Adding number conversion cast (unumber) 7 in main::scroll#2 = 7
Adding number conversion cast (unumber) $27 in main::$6 = main::i#2 != $27
Adding number conversion cast (unumber) 1 in main::$7 = main::i#3 + 1
Adding number conversion cast (unumber) main::$7 in main::$7 = main::i#3 + (unumber)1
Adding number conversion cast (unumber) 0 in main::$8 = main::c#0 == 0
Adding number conversion cast (unumber) $27 in main::line[$27] = main::c#2
Adding number conversion cast (unumber) $3e8 in fillscreen::$0 = fillscreen::screen#2 + $3e8
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast fillscreen::fill#0 = (unumber)$20
Inlining cast main::scroll#2 = (unumber)7
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (struct MOS6569_VICII *) 53248
Simplifying constant pointer cast (char *) 1024
Simplifying constant integer cast $28
Simplifying constant integer cast $20
Simplifying constant integer cast $fe
Simplifying constant integer cast $ff
Simplifying constant integer cast $ff
Simplifying constant integer cast 7
Simplifying constant integer cast $27
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast $27
Simplifying constant integer cast $3e8
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) $28
Finalized unsigned number type (char) $20
Finalized unsigned number type (char) $fe
Finalized unsigned number type (char) $ff
Finalized unsigned number type (char) $ff
Finalized unsigned number type (char) 7
Finalized unsigned number type (char) $27
Finalized unsigned number type (char) 1
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) $27
Finalized unsigned number type (unsigned int) $3e8
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to char in main::$7 = main::i#3 + 1
Inversing boolean not [15] main::$5 = main::scroll#1 != $ff from [14] main::$4 = main::scroll#1 == $ff
Inversing boolean not [34] main::$9 = main::c#0 != 0 from [33] main::$8 = main::c#0 == 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias main::scroll#3 = main::scroll#5 
Alias main::nxt#6 = main::nxt#8 main::nxt#9 
Alias main::i#2 = main::i#3 
Alias main::nxt#3 = main::nxt#7 main::nxt#5 
Alias main::scroll#10 = main::scroll#11 main::scroll#8 main::scroll#9 
Alias fillscreen::cursor#0 = fillscreen::screen#1 
Alias fillscreen::fill#1 = fillscreen::fill#2 
Alias fillscreen::cursor#2 = fillscreen::cursor#3 
Alias fillscreen::screen#2 = fillscreen::screen#3 
Successful SSA optimization Pass2AliasElimination
Alias main::scroll#10 = main::scroll#6 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values main::scroll#3 main::scroll#7
Identical Phi Values main::nxt#6 main::nxt#10
Identical Phi Values main::nxt#3 main::nxt#6
Identical Phi Values main::scroll#10 main::scroll#2
Identical Phi Values fillscreen::cursor#0 fillscreen::screen#0
Identical Phi Values fillscreen::fill#3 fillscreen::fill#0
Identical Phi Values fillscreen::screen#2 fillscreen::cursor#0
Identical Phi Values fillscreen::fill#1 fillscreen::fill#3
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition main::$1 [7] if(*((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fe) goto main::@1
Simple Condition main::$2 [10] if(*((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$ff) goto main::@2
Simple Condition main::$5 [14] if(main::scroll#1!=$ff) goto main::@5
Simple Condition main::$6 [23] if(main::i#2!=$27) goto main::@7
Simple Condition main::$9 [29] if(main::c#0!=0) goto main::@10
Simple Condition fillscreen::$1 [40] if(fillscreen::cursor#2<fillscreen::$0) goto fillscreen::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant fillscreen::screen#0 = SCREEN
Constant fillscreen::fill#0 = $20
Constant main::scroll#0 = 7
Constant main::nxt#0 = TEXT
Constant main::scroll#2 = 7
Constant main::i#0 = 0
Constant main::nxt#2 = TEXT
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [18] if(true) goto main::@1
Successful SSA optimization Pass2ConstantIfs
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Constant right-side identified [22] fillscreen::$0 = fillscreen::screen#0 + $3e8
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant fillscreen::$0 = fillscreen::screen#0+$3e8
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with var siblings main::scroll#0
Inlining constant with var siblings main::nxt#0
Inlining constant with var siblings main::scroll#2
Inlining constant with var siblings main::i#0
Inlining constant with var siblings main::nxt#2
Constant inlined main::nxt#0 = TEXT
Constant inlined main::scroll#0 = 7
Constant inlined fillscreen::screen#0 = SCREEN
Constant inlined fillscreen::$0 = SCREEN+$3e8
Constant inlined main::scroll#2 = 7
Constant inlined main::i#0 = 0
Constant inlined main::nxt#2 = TEXT
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in assignment (main::line+1)[main::$7]
Consolidated array index constant in *(main::line+$27)
Successful SSA optimization Pass2ConstantAdditionElimination
Alias main::i#2 = main::$7 
Successful SSA optimization Pass2AliasElimination
Added new block during phi lifting main::@12(between main::@1 and main::@1)
Added new block during phi lifting main::@13(between main::@3 and main::@5)
Added new block during phi lifting main::@14(between main::@8 and main::@10)
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@11
Adding NOP phi() at start of main::@4
Adding NOP phi() at start of fillscreen
CALL GRAPH
Calls in [main] to fillscreen:1 

Created 8 initial phi equivalence classes
Coalesced [15] main::c#4 = main::c#1
Coalesced [19] main::nxt#14 = main::nxt#1
Coalesced [23] main::scroll#13 = main::scroll#4
Coalesced [24] main::nxt#13 = main::nxt#11
Coalesced [25] main::c#3 = main::c#0
Coalesced [26] main::nxt#16 = main::nxt#10
Coalesced [29] main::i#4 = main::i#1
Coalesced [30] main::scroll#14 = main::scroll#1
Coalesced (already) [31] main::nxt#15 = main::nxt#10
Coalesced (already) [32] main::scroll#12 = main::scroll#7
Coalesced (already) [33] main::nxt#12 = main::nxt#10
Coalesced [40] fillscreen::cursor#4 = fillscreen::cursor#1
Coalesced down to 5 phi equivalence classes
Culled Empty Block label main::@11
Culled Empty Block label main::@4
Culled Empty Block label main::@14
Culled Empty Block label main::@13
Culled Empty Block label main::@12
Renumbering block main::@5 to main::@4
Renumbering block main::@6 to main::@5
Renumbering block main::@7 to main::@6
Renumbering block main::@8 to main::@7
Renumbering block main::@9 to main::@8
Renumbering block main::@10 to main::@9
Adding NOP phi() at start of main
Adding NOP phi() at start of fillscreen

FINAL CONTROL FLOW GRAPH

void main()
main: scope:[main]  from
  [0] phi()
  [1] call fillscreen
  to:main::@1
main::@1: scope:[main]  from main main::@1 main::@4
  [2] main::nxt#10 = phi( main::@1/main::nxt#10, main/TEXT, main::@4/main::nxt#11 )
  [2] main::scroll#7 = phi( main::@1/main::scroll#7, main/7, main::@4/main::scroll#4 )
  [3] if(*((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fe) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@1 main::@2
  [4] if(*((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$ff) goto main::@2
  to:main::@3
main::@3: scope:[main]  from main::@2
  [5] *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) = ++ *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR)
  [6] main::scroll#1 = -- main::scroll#7
  [7] if(main::scroll#1!=$ff) goto main::@4
  to:main::@5
main::@5: scope:[main]  from main::@3 main::@6
  [8] main::i#2 = phi( main::@3/0, main::@6/main::i#1 )
  [9] if(main::i#2!=$27) goto main::@6
  to:main::@7
main::@7: scope:[main]  from main::@5
  [10] main::c#0 = *main::nxt#10
  [11] if(main::c#0!=0) goto main::@9
  to:main::@8
main::@8: scope:[main]  from main::@7
  [12] main::c#1 = *TEXT
  to:main::@9
main::@9: scope:[main]  from main::@7 main::@8
  [13] main::nxt#4 = phi( main::@7/main::nxt#10, main::@8/TEXT )
  [13] main::c#2 = phi( main::@7/main::c#0, main::@8/main::c#1 )
  [14] *(main::line+$27) = main::c#2
  [15] main::nxt#1 = ++ main::nxt#4
  to:main::@4
main::@4: scope:[main]  from main::@3 main::@9
  [16] main::nxt#11 = phi( main::@9/main::nxt#1, main::@3/main::nxt#10 )
  [16] main::scroll#4 = phi( main::@9/7, main::@3/main::scroll#1 )
  [17] *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2) = main::scroll#4
  [18] *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) = -- *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR)
  to:main::@1
main::@6: scope:[main]  from main::@5
  [19] main::line[main::i#2] = (main::line+1)[main::i#2]
  [20] main::i#1 = ++ main::i#2
  to:main::@5

void fillscreen(char *screen , char fill)
fillscreen: scope:[fillscreen]  from main
  [21] phi()
  to:fillscreen::@1
fillscreen::@1: scope:[fillscreen]  from fillscreen fillscreen::@2
  [22] fillscreen::cursor#2 = phi( fillscreen/SCREEN, fillscreen::@2/fillscreen::cursor#1 )
  [23] if(fillscreen::cursor#2<SCREEN+$3e8) goto fillscreen::@2
  to:fillscreen::@return
fillscreen::@return: scope:[fillscreen]  from fillscreen::@1
  [24] return 
  to:@return
fillscreen::@2: scope:[fillscreen]  from fillscreen::@1
  [25] *fillscreen::cursor#2 = fillscreen::fill#0
  [26] fillscreen::cursor#1 = ++ fillscreen::cursor#2
  to:fillscreen::@1


VARIABLE REGISTER WEIGHTS
void fillscreen(char *screen , char fill)
char *fillscreen::cursor
char *fillscreen::cursor#1 // 202.0
char *fillscreen::cursor#2 // 134.66666666666666
char fillscreen::fill
char *fillscreen::screen
void main()
char main::c
char main::c#0 // 16.5
char main::c#1 // 22.0
char main::c#2 // 33.0
char main::i
char main::i#1 // 202.0
char main::i#2 // 168.33333333333331
char *main::nxt
char *main::nxt#1 // 22.0
char *main::nxt#10 // 20.500000000000004
char *main::nxt#11 // 11.0
char *main::nxt#4 // 11.0
char main::scroll
char main::scroll#1 // 16.5
char main::scroll#4 // 11.0
char main::scroll#7 // 56.0

Initial phi equivalence classes
[ main::scroll#7 main::scroll#4 main::scroll#1 ]
[ main::i#2 main::i#1 ]
[ main::c#2 main::c#0 main::c#1 ]
[ main::nxt#4 main::nxt#10 main::nxt#11 main::nxt#1 ]
[ fillscreen::cursor#2 fillscreen::cursor#1 ]
Complete equivalence classes
[ main::scroll#7 main::scroll#4 main::scroll#1 ]
[ main::i#2 main::i#1 ]
[ main::c#2 main::c#0 main::c#1 ]
[ main::nxt#4 main::nxt#10 main::nxt#11 main::nxt#1 ]
[ fillscreen::cursor#2 fillscreen::cursor#1 ]
Allocated zp[1]:2 [ main::i#2 main::i#1 ]
Allocated zp[2]:3 [ fillscreen::cursor#2 fillscreen::cursor#1 ]
Allocated zp[1]:5 [ main::scroll#7 main::scroll#4 main::scroll#1 ]
Allocated zp[1]:6 [ main::c#2 main::c#0 main::c#1 ]
Allocated zp[2]:7 [ main::nxt#4 main::nxt#10 main::nxt#11 main::nxt#1 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [3] if(*((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fe) goto main::@1 [ main::scroll#7 main::nxt#10 ] (  [ main::scroll#7 main::nxt#10 ] { }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:5 [ main::scroll#7 main::scroll#4 main::scroll#1 ]
Statement [4] if(*((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$ff) goto main::@2 [ main::scroll#7 main::nxt#10 ] (  [ main::scroll#7 main::nxt#10 ] { }  ) always clobbers reg byte a 
Statement [10] main::c#0 = *main::nxt#10 [ main::nxt#10 main::c#0 ] (  [ main::nxt#10 main::c#0 ] { }  ) always clobbers reg byte a reg byte y 
Statement [19] main::line[main::i#2] = (main::line+1)[main::i#2] [ main::nxt#10 main::i#2 ] (  [ main::nxt#10 main::i#2 ] { }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::i#2 main::i#1 ]
Statement [23] if(fillscreen::cursor#2<SCREEN+$3e8) goto fillscreen::@2 [ fillscreen::cursor#2 ] ( fillscreen:1 [ fillscreen::cursor#2 ] { }  ) always clobbers reg byte a 
Statement [25] *fillscreen::cursor#2 = fillscreen::fill#0 [ fillscreen::cursor#2 ] ( fillscreen:1 [ fillscreen::cursor#2 ] { }  ) always clobbers reg byte a reg byte y 
Statement [3] if(*((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fe) goto main::@1 [ main::scroll#7 main::nxt#10 ] (  [ main::scroll#7 main::nxt#10 ] { }  ) always clobbers reg byte a 
Statement [4] if(*((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$ff) goto main::@2 [ main::scroll#7 main::nxt#10 ] (  [ main::scroll#7 main::nxt#10 ] { }  ) always clobbers reg byte a 
Statement [10] main::c#0 = *main::nxt#10 [ main::nxt#10 main::c#0 ] (  [ main::nxt#10 main::c#0 ] { }  ) always clobbers reg byte a reg byte y 
Statement [19] main::line[main::i#2] = (main::line+1)[main::i#2] [ main::nxt#10 main::i#2 ] (  [ main::nxt#10 main::i#2 ] { }  ) always clobbers reg byte a 
Statement [23] if(fillscreen::cursor#2<SCREEN+$3e8) goto fillscreen::@2 [ fillscreen::cursor#2 ] ( fillscreen:1 [ fillscreen::cursor#2 ] { }  ) always clobbers reg byte a 
Statement [25] *fillscreen::cursor#2 = fillscreen::fill#0 [ fillscreen::cursor#2 ] ( fillscreen:1 [ fillscreen::cursor#2 ] { }  ) always clobbers reg byte a reg byte y 
Potential registers zp[1]:5 [ main::scroll#7 main::scroll#4 main::scroll#1 ] : zp[1]:5 , reg byte x , reg byte y , 
Potential registers zp[1]:2 [ main::i#2 main::i#1 ] : zp[1]:2 , reg byte x , reg byte y , 
Potential registers zp[1]:6 [ main::c#2 main::c#0 main::c#1 ] : zp[1]:6 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:7 [ main::nxt#4 main::nxt#10 main::nxt#11 main::nxt#1 ] : zp[2]:7 , 
Potential registers zp[2]:3 [ fillscreen::cursor#2 fillscreen::cursor#1 ] : zp[2]:3 , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 370.33: zp[1]:2 [ main::i#2 main::i#1 ] 83.5: zp[1]:5 [ main::scroll#7 main::scroll#4 main::scroll#1 ] 71.5: zp[1]:6 [ main::c#2 main::c#0 main::c#1 ] 64.5: zp[2]:7 [ main::nxt#4 main::nxt#10 main::nxt#11 main::nxt#1 ] 
Uplift Scope [fillscreen] 336.67: zp[2]:3 [ fillscreen::cursor#2 fillscreen::cursor#1 ] 
Uplift Scope [MOS6526_CIA] 
Uplift Scope [MOS6569_VICII] 
Uplift Scope [MOS6581_SID] 
Uplift Scope [] 

Uplifting [main] best 8272 combination reg byte x [ main::i#2 main::i#1 ] reg byte x [ main::scroll#7 main::scroll#4 main::scroll#1 ] reg byte x [ main::c#2 main::c#0 main::c#1 ] zp[2]:7 [ main::nxt#4 main::nxt#10 main::nxt#11 main::nxt#1 ] 
Uplifting [fillscreen] best 8272 combination zp[2]:3 [ fillscreen::cursor#2 fillscreen::cursor#1 ] 
Uplifting [MOS6526_CIA] best 8272 combination 
Uplifting [MOS6569_VICII] best 8272 combination 
Uplifting [MOS6581_SID] best 8272 combination 
Uplifting [] best 8272 combination 
Allocated (was zp[2]:3) zp[2]:2 [ fillscreen::cursor#2 fillscreen::cursor#1 ]
Allocated (was zp[2]:7) zp[2]:4 [ main::nxt#4 main::nxt#10 main::nxt#11 main::nxt#1 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
/// @file
/// Commodore 64 Registers and Constants
/// @file
/// The MOS 6526 Complex Interface Adapter (CIA)
///
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
  // Upstart
  // Commodore 64 PRG executable file
.file [name="scroll.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
  // Global Constants & labels
  .const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
  .const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
  .const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16
  /// The VIC-II MOS 6567/6569
  .label VICII = $d000
  .label SCREEN = $400
.segment Code
  // main
main: {
    .label line = SCREEN+$28
    .label nxt = 4
    // [1] call fillscreen
    // [21] phi from main to fillscreen [phi:main->fillscreen]
  fillscreen_from_main:
    jsr fillscreen
    // [2] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [2] phi main::nxt#10 = TEXT [phi:main->main::@1#0] -- pbuz1=pbuc1 
    lda #<TEXT
    sta.z nxt
    lda #>TEXT
    sta.z nxt+1
    // [2] phi main::scroll#7 = 7 [phi:main->main::@1#1] -- vbuxx=vbuc1 
    ldx #7
    jmp __b1
  // Wait for raster
    // [2] phi from main::@1 main::@4 to main::@1 [phi:main::@1/main::@4->main::@1]
  __b1_from___b1:
  __b1_from___b4:
    // [2] phi main::nxt#10 = main::nxt#10 [phi:main::@1/main::@4->main::@1#0] -- register_copy 
    // [2] phi main::scroll#7 = main::scroll#7 [phi:main::@1/main::@4->main::@1#1] -- register_copy 
    jmp __b1
    // main::@1
  __b1:
    // [3] if(*((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$fe
    cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
    bne __b1_from___b1
    jmp __b2
    // main::@2
  __b2:
    // [4] if(*((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$ff
    cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
    bne __b2
    jmp __b3
    // main::@3
  __b3:
    // [5] *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) = ++ *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
    // [6] main::scroll#1 = -- main::scroll#7 -- vbuxx=_dec_vbuxx 
    dex
    // [7] if(main::scroll#1!=$ff) goto main::@4 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$ff
    bne __b4_from___b3
    // [8] phi from main::@3 to main::@5 [phi:main::@3->main::@5]
  __b5_from___b3:
    // [8] phi main::i#2 = 0 [phi:main::@3->main::@5#0] -- vbuxx=vbuc1 
    ldx #0
    jmp __b5
  // Hard scroll
    // main::@5
  __b5:
    // [9] if(main::i#2!=$27) goto main::@6 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$27
    bne __b6
    jmp __b7
    // main::@7
  __b7:
    // [10] main::c#0 = *main::nxt#10 -- vbuxx=_deref_pbuz1 
    // Render next char
    ldy #0
    lda (nxt),y
    tax
    // [11] if(main::c#0!=0) goto main::@9 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne __b9_from___b7
    jmp __b8
    // main::@8
  __b8:
    // [12] main::c#1 = *TEXT -- vbuxx=_deref_pbuc1 
    ldx TEXT
    // [13] phi from main::@8 to main::@9 [phi:main::@8->main::@9]
  __b9_from___b8:
    // [13] phi main::nxt#4 = TEXT [phi:main::@8->main::@9#0] -- pbuz1=pbuc1 
    lda #<TEXT
    sta.z nxt
    lda #>TEXT
    sta.z nxt+1
    // [13] phi main::c#2 = main::c#1 [phi:main::@8->main::@9#1] -- register_copy 
    jmp __b9
    // [13] phi from main::@7 to main::@9 [phi:main::@7->main::@9]
  __b9_from___b7:
    // [13] phi main::nxt#4 = main::nxt#10 [phi:main::@7->main::@9#0] -- register_copy 
    // [13] phi main::c#2 = main::c#0 [phi:main::@7->main::@9#1] -- register_copy 
    jmp __b9
    // main::@9
  __b9:
    // [14] *(main::line+$27) = main::c#2 -- _deref_pbuc1=vbuxx 
    stx line+$27
    // [15] main::nxt#1 = ++ main::nxt#4 -- pbuz1=_inc_pbuz1 
    inc.z nxt
    bne !+
    inc.z nxt+1
  !:
    // [16] phi from main::@9 to main::@4 [phi:main::@9->main::@4]
  __b4_from___b9:
    // [16] phi main::nxt#11 = main::nxt#1 [phi:main::@9->main::@4#0] -- register_copy 
    // [16] phi main::scroll#4 = 7 [phi:main::@9->main::@4#1] -- vbuxx=vbuc1 
    ldx #7
    jmp __b4
    // [16] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
  __b4_from___b3:
    // [16] phi main::nxt#11 = main::nxt#10 [phi:main::@3->main::@4#0] -- register_copy 
    // [16] phi main::scroll#4 = main::scroll#1 [phi:main::@3->main::@4#1] -- register_copy 
    jmp __b4
    // main::@4
  __b4:
    // [17] *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2) = main::scroll#4 -- _deref_pbuc1=vbuxx 
    stx VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2
    // [18] *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) = -- *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1 
    dec VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
    jmp __b1_from___b4
    // main::@6
  __b6:
    // [19] main::line[main::i#2] = (main::line+1)[main::i#2] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda line+1,x
    sta line,x
    // [20] main::i#1 = ++ main::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [8] phi from main::@6 to main::@5 [phi:main::@6->main::@5]
  __b5_from___b6:
    // [8] phi main::i#2 = main::i#1 [phi:main::@6->main::@5#0] -- register_copy 
    jmp __b5
}
  // fillscreen
// void fillscreen(char *screen, char fill)
fillscreen: {
    .const fill = $20
    .label cursor = 2
    // [22] phi from fillscreen to fillscreen::@1 [phi:fillscreen->fillscreen::@1]
  __b1_from_fillscreen:
    // [22] phi fillscreen::cursor#2 = SCREEN [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z cursor
    lda #>SCREEN
    sta.z cursor+1
    jmp __b1
    // fillscreen::@1
  __b1:
    // [23] if(fillscreen::cursor#2<SCREEN+$3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 
    lda.z cursor+1
    cmp #>SCREEN+$3e8
    bcc __b2
    bne !+
    lda.z cursor
    cmp #<SCREEN+$3e8
    bcc __b2
  !:
    jmp __breturn
    // fillscreen::@return
  __breturn:
    // [24] return 
    rts
    // fillscreen::@2
  __b2:
    // [25] *fillscreen::cursor#2 = fillscreen::fill#0 -- _deref_pbuz1=vbuc1 
    lda #fill
    ldy #0
    sta (cursor),y
    // [26] fillscreen::cursor#1 = ++ fillscreen::cursor#2 -- pbuz1=_inc_pbuz1 
    inc.z cursor
    bne !+
    inc.z cursor+1
  !:
    // [22] phi from fillscreen::@2 to fillscreen::@1 [phi:fillscreen::@2->fillscreen::@1]
  __b1_from___b2:
    // [22] phi fillscreen::cursor#2 = fillscreen::cursor#1 [phi:fillscreen::@2->fillscreen::@1#0] -- register_copy 
    jmp __b1
}
  // File Data
.segment Data
  TEXT: .text "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =-     "
  .byte 0

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b3
Removing instruction jmp __b5
Removing instruction jmp __b7
Removing instruction jmp __b8
Removing instruction jmp __b9
Removing instruction jmp __b4
Removing instruction jmp __b1
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __b1_from___b1 with __b1
Replacing label __b4_from___b3 with __b4
Replacing label __b9_from___b7 with __b9
Replacing label __b1_from___b4 with __b1
Removing instruction __b1_from___b1:
Removing instruction __b1_from___b4:
Removing instruction __b9_from___b7:
Removing instruction __b4_from___b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction fillscreen_from_main:
Removing instruction __b1_from_main:
Removing instruction __b3:
Removing instruction __b5_from___b3:
Removing instruction __b7:
Removing instruction __b8:
Removing instruction __b9_from___b8:
Removing instruction __b4_from___b9:
Removing instruction __b5_from___b6:
Removing instruction __b1_from_fillscreen:
Removing instruction __breturn:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing instruction jmp __b1
Removing instruction jmp __b9
Removing instruction jmp __b4
Succesful ASM optimization Pass5NextJumpElimination

FINAL SYMBOL TABLE
__constant char OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
__constant char OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16
__constant char OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
__constant char * const SCREEN = (char *) 1024
__constant const char TEXT[] = "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =-     "
__constant struct MOS6569_VICII * const VICII = (struct MOS6569_VICII *) 53248
void fillscreen(char *screen , char fill)
char *fillscreen::cursor
char *fillscreen::cursor#1 // cursor zp[2]:2 202.0
char *fillscreen::cursor#2 // cursor zp[2]:2 134.66666666666666
char fillscreen::fill
__constant char fillscreen::fill#0 = $20 // fill
char *fillscreen::screen
void main()
char main::c
char main::c#0 // reg byte x 16.5
char main::c#1 // reg byte x 22.0
char main::c#2 // reg byte x 33.0
char main::i
char main::i#1 // reg byte x 202.0
char main::i#2 // reg byte x 168.33333333333331
__constant char * const main::line = SCREEN+$28
char *main::nxt
char *main::nxt#1 // nxt zp[2]:4 22.0
char *main::nxt#10 // nxt zp[2]:4 20.500000000000004
char *main::nxt#11 // nxt zp[2]:4 11.0
char *main::nxt#4 // nxt zp[2]:4 11.0
char main::scroll
char main::scroll#1 // reg byte x 16.5
char main::scroll#4 // reg byte x 11.0
char main::scroll#7 // reg byte x 56.0

reg byte x [ main::scroll#7 main::scroll#4 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[2]:4 [ main::nxt#4 main::nxt#10 main::nxt#11 main::nxt#1 ]
zp[2]:2 [ fillscreen::cursor#2 fillscreen::cursor#1 ]


FINAL ASSEMBLER
Score: 6262

  // File Comments
/// @file
/// Commodore 64 Registers and Constants
/// @file
/// The MOS 6526 Complex Interface Adapter (CIA)
///
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
  // Upstart
  // Commodore 64 PRG executable file
.file [name="scroll.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
  // Global Constants & labels
  .const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
  .const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
  .const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16
  /// The VIC-II MOS 6567/6569
  .label VICII = $d000
  .label SCREEN = $400
.segment Code
  // main
main: {
    .label line = SCREEN+$28
    .label nxt = 4
    // fillscreen(SCREEN, $20)
    // [1] call fillscreen
    // [21] phi from main to fillscreen [phi:main->fillscreen]
    jsr fillscreen
    // [2] phi from main to main::@1 [phi:main->main::@1]
    // [2] phi main::nxt#10 = TEXT [phi:main->main::@1#0] -- pbuz1=pbuc1 
    lda #<TEXT
    sta.z nxt
    lda #>TEXT
    sta.z nxt+1
    // [2] phi main::scroll#7 = 7 [phi:main->main::@1#1] -- vbuxx=vbuc1 
    ldx #7
  // Wait for raster
    // [2] phi from main::@1 main::@4 to main::@1 [phi:main::@1/main::@4->main::@1]
    // [2] phi main::nxt#10 = main::nxt#10 [phi:main::@1/main::@4->main::@1#0] -- register_copy 
    // [2] phi main::scroll#7 = main::scroll#7 [phi:main::@1/main::@4->main::@1#1] -- register_copy 
    // main::@1
  __b1:
    // while(VICII->RASTER!=$fe)
    // [3] if(*((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$fe
    cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
    bne __b1
    // main::@2
  __b2:
    // while(VICII->RASTER!=$ff)
    // [4] if(*((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda #$ff
    cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
    bne __b2
    // main::@3
    // ++VICII->BG_COLOR;
    // [5] *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) = ++ *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
    // if(--scroll==$ff)
    // [6] main::scroll#1 = -- main::scroll#7 -- vbuxx=_dec_vbuxx 
    dex
    // [7] if(main::scroll#1!=$ff) goto main::@4 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$ff
    bne __b4
    // [8] phi from main::@3 to main::@5 [phi:main::@3->main::@5]
    // [8] phi main::i#2 = 0 [phi:main::@3->main::@5#0] -- vbuxx=vbuc1 
    ldx #0
  // Hard scroll
    // main::@5
  __b5:
    // for(char i=0;i!=39;i++)
    // [9] if(main::i#2!=$27) goto main::@6 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$27
    bne __b6
    // main::@7
    // char c = *nxt
    // [10] main::c#0 = *main::nxt#10 -- vbuxx=_deref_pbuz1 
    // Render next char
    ldy #0
    lda (nxt),y
    tax
    // if(c==0)
    // [11] if(main::c#0!=0) goto main::@9 -- vbuxx_neq_0_then_la1 
    cpx #0
    bne __b9
    // main::@8
    // c = *nxt
    // [12] main::c#1 = *TEXT -- vbuxx=_deref_pbuc1 
    ldx TEXT
    // [13] phi from main::@8 to main::@9 [phi:main::@8->main::@9]
    // [13] phi main::nxt#4 = TEXT [phi:main::@8->main::@9#0] -- pbuz1=pbuc1 
    lda #<TEXT
    sta.z nxt
    lda #>TEXT
    sta.z nxt+1
    // [13] phi main::c#2 = main::c#1 [phi:main::@8->main::@9#1] -- register_copy 
    // [13] phi from main::@7 to main::@9 [phi:main::@7->main::@9]
    // [13] phi main::nxt#4 = main::nxt#10 [phi:main::@7->main::@9#0] -- register_copy 
    // [13] phi main::c#2 = main::c#0 [phi:main::@7->main::@9#1] -- register_copy 
    // main::@9
  __b9:
    // line[39] = c
    // [14] *(main::line+$27) = main::c#2 -- _deref_pbuc1=vbuxx 
    stx line+$27
    // nxt++;
    // [15] main::nxt#1 = ++ main::nxt#4 -- pbuz1=_inc_pbuz1 
    inc.z nxt
    bne !+
    inc.z nxt+1
  !:
    // [16] phi from main::@9 to main::@4 [phi:main::@9->main::@4]
    // [16] phi main::nxt#11 = main::nxt#1 [phi:main::@9->main::@4#0] -- register_copy 
    // [16] phi main::scroll#4 = 7 [phi:main::@9->main::@4#1] -- vbuxx=vbuc1 
    ldx #7
    // [16] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
    // [16] phi main::nxt#11 = main::nxt#10 [phi:main::@3->main::@4#0] -- register_copy 
    // [16] phi main::scroll#4 = main::scroll#1 [phi:main::@3->main::@4#1] -- register_copy 
    // main::@4
  __b4:
    // VICII->CONTROL2 = scroll
    // [17] *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2) = main::scroll#4 -- _deref_pbuc1=vbuxx 
    stx VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2
    // --VICII->BG_COLOR;
    // [18] *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) = -- *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1 
    dec VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
    jmp __b1
    // main::@6
  __b6:
    // line[i]=line[i+1]
    // [19] main::line[main::i#2] = (main::line+1)[main::i#2] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx 
    lda line+1,x
    sta line,x
    // for(char i=0;i!=39;i++)
    // [20] main::i#1 = ++ main::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [8] phi from main::@6 to main::@5 [phi:main::@6->main::@5]
    // [8] phi main::i#2 = main::i#1 [phi:main::@6->main::@5#0] -- register_copy 
    jmp __b5
}
  // fillscreen
// void fillscreen(char *screen, char fill)
fillscreen: {
    .const fill = $20
    .label cursor = 2
    // [22] phi from fillscreen to fillscreen::@1 [phi:fillscreen->fillscreen::@1]
    // [22] phi fillscreen::cursor#2 = SCREEN [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z cursor
    lda #>SCREEN
    sta.z cursor+1
    // fillscreen::@1
  __b1:
    // for( char* cursor = screen; cursor < screen+1000; cursor++)
    // [23] if(fillscreen::cursor#2<SCREEN+$3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 
    lda.z cursor+1
    cmp #>SCREEN+$3e8
    bcc __b2
    bne !+
    lda.z cursor
    cmp #<SCREEN+$3e8
    bcc __b2
  !:
    // fillscreen::@return
    // }
    // [24] return 
    rts
    // fillscreen::@2
  __b2:
    // *cursor = fill
    // [25] *fillscreen::cursor#2 = fillscreen::fill#0 -- _deref_pbuz1=vbuc1 
    lda #fill
    ldy #0
    sta (cursor),y
    // for( char* cursor = screen; cursor < screen+1000; cursor++)
    // [26] fillscreen::cursor#1 = ++ fillscreen::cursor#2 -- pbuz1=_inc_pbuz1 
    inc.z cursor
    bne !+
    inc.z cursor+1
  !:
    // [22] phi from fillscreen::@2 to fillscreen::@1 [phi:fillscreen::@2->fillscreen::@1]
    // [22] phi fillscreen::cursor#2 = fillscreen::cursor#1 [phi:fillscreen::@2->fillscreen::@1#0] -- register_copy 
    jmp __b1
}
  // File Data
.segment Data
  TEXT: .text "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =-     "
  .byte 0

