Fixing struct type size struct node to 4
Setting inferred volatile on symbol affected by address-of last_time
Inlined call vicSelectGfxBank::$0 = call toDd00(vicSelectGfxBank::gfx)
Inlined call call __init

CONTROL FLOW GRAPH SSA

void print_ln()
print_ln: scope:[print_ln]  from end::@2
  print_char_cursor#37 = phi( end::@2/print_char_cursor#10 )
  print_line_cursor#18 = phi( end::@2/print_line_cursor#19 )
  to:print_ln::@1
print_ln::@1: scope:[print_ln]  from print_ln print_ln::@1
  print_char_cursor#19 = phi( print_ln/print_char_cursor#37, print_ln::@1/print_char_cursor#19 )
  print_line_cursor#9 = phi( print_ln/print_line_cursor#18, print_ln::@1/print_line_cursor#0 )
  print_ln::$0 = print_line_cursor#9 + $28
  print_line_cursor#0 = print_ln::$0
  print_ln::$1 = print_line_cursor#0 < print_char_cursor#19
  if(print_ln::$1) goto print_ln::@1
  to:print_ln::@2
print_ln::@2: scope:[print_ln]  from print_ln::@1
  print_line_cursor#10 = phi( print_ln::@1/print_line_cursor#0 )
  print_char_cursor#0 = print_line_cursor#10
  to:print_ln::@return
print_ln::@return: scope:[print_ln]  from print_ln::@2
  print_char_cursor#20 = phi( print_ln::@2/print_char_cursor#0 )
  print_line_cursor#11 = phi( print_ln::@2/print_line_cursor#10 )
  print_line_cursor#1 = print_line_cursor#11
  print_char_cursor#1 = print_char_cursor#20
  return 
  to:@return

void print_uint(unsigned int w)
print_uint: scope:[print_uint]  from end::@1
  print_char_cursor#38 = phi( end::@1/print_char_cursor#41 )
  print_uint::w#1 = phi( end::@1/print_uint::w#0 )
  print_uint::$0 = byte1  print_uint::w#1
  print_uchar::b#0 = print_uint::$0
  call print_uchar
  to:print_uint::@1
print_uint::@1: scope:[print_uint]  from print_uint
  print_uint::w#2 = phi( print_uint/print_uint::w#1 )
  print_char_cursor#21 = phi( print_uint/print_char_cursor#7 )
  print_char_cursor#2 = print_char_cursor#21
  print_uint::$2 = byte0  print_uint::w#2
  print_uchar::b#1 = print_uint::$2
  call print_uchar
  to:print_uint::@2
print_uint::@2: scope:[print_uint]  from print_uint::@1
  print_char_cursor#22 = phi( print_uint::@1/print_char_cursor#7 )
  print_char_cursor#3 = print_char_cursor#22
  to:print_uint::@return
print_uint::@return: scope:[print_uint]  from print_uint::@2
  print_char_cursor#23 = phi( print_uint::@2/print_char_cursor#3 )
  print_char_cursor#4 = print_char_cursor#23
  return 
  to:@return

void print_uchar(char b)
print_uchar: scope:[print_uchar]  from print_uint print_uint::@1
  print_char_cursor#39 = phi( print_uint/print_char_cursor#38, print_uint::@1/print_char_cursor#2 )
  print_uchar::b#2 = phi( print_uint/print_uchar::b#0, print_uint::@1/print_uchar::b#1 )
  print_uchar::$0 = print_uchar::b#2 >> 4
  print_char::ch#0 = print_hextab[print_uchar::$0]
  call print_char
  to:print_uchar::@1
print_uchar::@1: scope:[print_uchar]  from print_uchar
  print_uchar::b#3 = phi( print_uchar/print_uchar::b#2 )
  print_char_cursor#24 = phi( print_uchar/print_char_cursor#9 )
  print_char_cursor#5 = print_char_cursor#24
  print_uchar::$2 = print_uchar::b#3 & $f
  print_char::ch#1 = print_hextab[print_uchar::$2]
  call print_char
  to:print_uchar::@2
print_uchar::@2: scope:[print_uchar]  from print_uchar::@1
  print_char_cursor#25 = phi( print_uchar::@1/print_char_cursor#9 )
  print_char_cursor#6 = print_char_cursor#25
  to:print_uchar::@return
print_uchar::@return: scope:[print_uchar]  from print_uchar::@2
  print_char_cursor#26 = phi( print_uchar::@2/print_char_cursor#6 )
  print_char_cursor#7 = print_char_cursor#26
  return 
  to:@return

void print_char(char ch)
print_char: scope:[print_char]  from main::@8 print_uchar print_uchar::@1
  print_char_cursor#27 = phi( main::@8/print_char_cursor#40, print_uchar/print_char_cursor#39, print_uchar::@1/print_char_cursor#5 )
  print_char::ch#3 = phi( main::@8/print_char::ch#2, print_uchar/print_char::ch#0, print_uchar::@1/print_char::ch#1 )
  *print_char_cursor#27 = print_char::ch#3
  print_char_cursor#8 = ++ print_char_cursor#27
  to:print_char::@return
print_char::@return: scope:[print_char]  from print_char
  print_char_cursor#28 = phi( print_char/print_char_cursor#8 )
  print_char_cursor#9 = print_char_cursor#28
  return 
  to:@return

void start()
start: scope:[start]  from end main
  asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1  }
  to:start::@return
start::@return: scope:[start]  from start
  return 
  to:@return

void end()
end: scope:[end]  from main::@4
  print_line_cursor#24 = phi( main::@4/print_line_cursor#20 )
  print_char_cursor#44 = phi( main::@4/print_char_cursor#42 )
  Ticks#0 = last_time
  call start
  to:end::@1
end::@1: scope:[end]  from end
  print_line_cursor#22 = phi( end/print_line_cursor#24 )
  print_char_cursor#41 = phi( end/print_char_cursor#44 )
  Ticks#8 = phi( end/Ticks#0 )
  last_time = last_time - Ticks#8
  Ticks#1 = last_time
  print_uint::w#0 = Ticks#1
  call print_uint
  to:end::@2
end::@2: scope:[end]  from end::@1
  Ticks#17 = phi( end::@1/Ticks#1 )
  print_line_cursor#19 = phi( end::@1/print_line_cursor#22 )
  print_char_cursor#29 = phi( end::@1/print_char_cursor#4 )
  print_char_cursor#10 = print_char_cursor#29
  call print_ln
  to:end::@3
end::@3: scope:[end]  from end::@2
  Ticks#14 = phi( end::@2/Ticks#17 )
  print_char_cursor#30 = phi( end::@2/print_char_cursor#1 )
  print_line_cursor#12 = phi( end::@2/print_line_cursor#1 )
  print_line_cursor#2 = print_line_cursor#12
  print_char_cursor#11 = print_char_cursor#30
  to:end::@return
end::@return: scope:[end]  from end::@3
  print_line_cursor#13 = phi( end::@3/print_line_cursor#2 )
  print_char_cursor#31 = phi( end::@3/print_char_cursor#11 )
  Ticks#9 = phi( end::@3/Ticks#14 )
  Ticks#2 = Ticks#9
  print_char_cursor#12 = print_char_cursor#31
  print_line_cursor#3 = print_line_cursor#13
  return 
  to:@return

void init()
init: scope:[init]  from main::@1
  free_#0 = 0
  root#0 = ((struct node *)) (void *)0
  to:init::@return
init::@return: scope:[init]  from init
  root#10 = phi( init/root#0 )
  free_#12 = phi( init/free_#0 )
  free_#1 = free_#12
  root#1 = root#10
  return 
  to:@return

struct node * alloc()
alloc: scope:[alloc]  from prepend
  free_#13 = phi( prepend/free_#22 )
  alloc::result#0 = (struct node *) 0
  alloc::$1 = free_#13 * SIZEOF_STRUCT_NODE
  alloc::$0 = heap + alloc::$1
  alloc::result#1 = alloc::$0
  free_#2 = ++ free_#13
  alloc::return#0 = alloc::result#1
  to:alloc::@return
alloc::@return: scope:[alloc]  from alloc
  free_#14 = phi( alloc/free_#2 )
  alloc::return#3 = phi( alloc/alloc::return#0 )
  alloc::return#1 = alloc::return#3
  free_#3 = free_#14
  return 
  to:@return

void prepend(unsigned int x)
prepend: scope:[prepend]  from main::@2
  prepend::x#2 = phi( main::@2/prepend::x#0 )
  root#19 = phi( main::@2/root#22 )
  free_#22 = phi( main::@2/free_#24 )
  prepend::new#0 = (struct node *) 0
  call alloc
  alloc::return#2 = alloc::return#1
  to:prepend::@1
prepend::@1: scope:[prepend]  from prepend
  prepend::x#1 = phi( prepend/prepend::x#2 )
  root#11 = phi( prepend/root#19 )
  free_#15 = phi( prepend/free_#3 )
  alloc::return#4 = phi( prepend/alloc::return#2 )
  prepend::$0 = alloc::return#4
  free_#4 = free_#15
  prepend::new#1 = prepend::$0
  prepend::$3 = (struct node **)prepend::new#1
  prepend::$1 = prepend::$3 + OFFSET_STRUCT_NODE_NEXT
  *prepend::$1 = root#11
  prepend::$4 = (unsigned int *)prepend::new#1
  prepend::$2 = prepend::$4 + OFFSET_STRUCT_NODE_VALUE
  *prepend::$2 = prepend::x#1
  root#2 = prepend::new#1
  to:prepend::@return
prepend::@return: scope:[prepend]  from prepend::@1
  root#12 = phi( prepend::@1/root#2 )
  free_#16 = phi( prepend::@1/free_#4 )
  free_#5 = free_#16
  root#3 = root#12
  return 
  to:@return

unsigned int sum()
sum: scope:[sum]  from main::@3
  root#13 = phi( main::@3/root#20 )
  sum::current#0 = (struct node *) 0
  sum::s#0 = 0
  sum::s#1 = 0
  sum::current#1 = root#13
  to:sum::@1
sum::@1: scope:[sum]  from sum sum::@2
  sum::s#5 = phi( sum/sum::s#1, sum::@2/sum::s#2 )
  sum::current#3 = phi( sum/sum::current#1, sum::@2/sum::current#2 )
  sum::$4 = (struct node *)0 != sum::current#3
  if(sum::$4) goto sum::@2
  to:sum::@3
sum::@2: scope:[sum]  from sum::@1
  sum::s#3 = phi( sum::@1/sum::s#5 )
  sum::current#4 = phi( sum::@1/sum::current#3 )
  sum::$2 = (unsigned int *)sum::current#4
  sum::$0 = sum::$2 + OFFSET_STRUCT_NODE_VALUE
  sum::s#2 = sum::s#3 + *sum::$0
  sum::$3 = (struct node **)sum::current#4
  sum::$1 = sum::$3 + OFFSET_STRUCT_NODE_NEXT
  sum::current#2 = *sum::$1
  to:sum::@1
sum::@3: scope:[sum]  from sum::@1
  sum::s#4 = phi( sum::@1/sum::s#5 )
  sum::return#0 = sum::s#4
  to:sum::@return
sum::@return: scope:[sum]  from sum::@3
  sum::return#3 = phi( sum::@3/sum::return#0 )
  sum::return#1 = sum::return#3
  return 
  to:@return

void main()
main: scope:[main]  from __start::@1
  print_line_cursor#32 = phi( __start::@1/print_line_cursor#21 )
  Ticks#26 = phi( __start::@1/Ticks#16 )
  print_char_cursor#51 = phi( __start::@1/print_char_cursor#43 )
  root#28 = phi( __start::@1/root#24 )
  free_#30 = phi( __start::@1/free_#26 )
  call start
  to:main::@5
main::@5: scope:[main]  from main
  print_line_cursor#31 = phi( main/print_line_cursor#32 )
  Ticks#25 = phi( main/Ticks#26 )
  print_char_cursor#50 = phi( main/print_char_cursor#51 )
  root#25 = phi( main/root#28 )
  free_#27 = phi( main/free_#30 )
  main::c#0 = 0
  to:main::@1
main::@1: scope:[main]  from main::@5 main::@9
  print_line_cursor#30 = phi( main::@5/print_line_cursor#31, main::@9/print_line_cursor#23 )
  Ticks#24 = phi( main::@5/Ticks#25, main::@9/Ticks#18 )
  main::c#8 = phi( main::@5/main::c#0, main::@9/main::c#1 )
  print_char_cursor#49 = phi( main::@5/print_char_cursor#50, main::@9/print_char_cursor#13 )
  root#21 = phi( main::@5/root#25, main::@9/root#26 )
  free_#23 = phi( main::@5/free_#27, main::@9/free_#28 )
  call init
  to:main::@6
main::@6: scope:[main]  from main::@1
  print_line_cursor#29 = phi( main::@1/print_line_cursor#30 )
  Ticks#23 = phi( main::@1/Ticks#24 )
  main::c#7 = phi( main::@1/main::c#8 )
  print_char_cursor#48 = phi( main::@1/print_char_cursor#49 )
  root#14 = phi( main::@1/root#1 )
  free_#17 = phi( main::@1/free_#1 )
  free_#6 = free_#17
  root#4 = root#14
  main::i#0 = 0
  to:main::@2
main::@2: scope:[main]  from main::@6 main::@7
  print_line_cursor#28 = phi( main::@6/print_line_cursor#29, main::@7/print_line_cursor#27 )
  Ticks#22 = phi( main::@6/Ticks#23, main::@7/Ticks#21 )
  main::c#6 = phi( main::@6/main::c#7, main::@7/main::c#5 )
  print_char_cursor#47 = phi( main::@6/print_char_cursor#48, main::@7/print_char_cursor#46 )
  root#22 = phi( main::@6/root#4, main::@7/root#5 )
  free_#24 = phi( main::@6/free_#6, main::@7/free_#7 )
  main::i#2 = phi( main::@6/main::i#0, main::@7/main::i#1 )
  prepend::x#0 = main::i#2
  call prepend
  to:main::@7
main::@7: scope:[main]  from main::@2
  print_line_cursor#27 = phi( main::@2/print_line_cursor#28 )
  Ticks#21 = phi( main::@2/Ticks#22 )
  main::c#5 = phi( main::@2/main::c#6 )
  print_char_cursor#46 = phi( main::@2/print_char_cursor#47 )
  main::i#3 = phi( main::@2/main::i#2 )
  root#15 = phi( main::@2/root#3 )
  free_#18 = phi( main::@2/free_#5 )
  free_#7 = free_#18
  root#5 = root#15
  main::i#1 = main::i#3 + rangenext(0,$bb7)
  main::$4 = main::i#1 != rangelast(0,$bb7)
  if(main::$4) goto main::@2
  to:main::@3
main::@3: scope:[main]  from main::@7
  print_line_cursor#26 = phi( main::@7/print_line_cursor#27 )
  Ticks#20 = phi( main::@7/Ticks#21 )
  free_#32 = phi( main::@7/free_#7 )
  main::c#4 = phi( main::@7/main::c#5 )
  print_char_cursor#45 = phi( main::@7/print_char_cursor#46 )
  root#20 = phi( main::@7/root#5 )
  call sum
  sum::return#2 = sum::return#1
  to:main::@8
main::@8: scope:[main]  from main::@3
  print_line_cursor#25 = phi( main::@3/print_line_cursor#26 )
  Ticks#19 = phi( main::@3/Ticks#20 )
  root#29 = phi( main::@3/root#20 )
  free_#31 = phi( main::@3/free_#32 )
  main::c#3 = phi( main::@3/main::c#4 )
  print_char_cursor#40 = phi( main::@3/print_char_cursor#45 )
  sum::return#4 = phi( main::@3/sum::return#2 )
  main::$5 = sum::return#4
  print_char::ch#2 = (char)main::$5
  call print_char
  to:main::@9
main::@9: scope:[main]  from main::@8
  print_line_cursor#23 = phi( main::@8/print_line_cursor#25 )
  Ticks#18 = phi( main::@8/Ticks#19 )
  root#26 = phi( main::@8/root#29 )
  free_#28 = phi( main::@8/free_#31 )
  main::c#2 = phi( main::@8/main::c#3 )
  print_char_cursor#32 = phi( main::@8/print_char_cursor#9 )
  print_char_cursor#13 = print_char_cursor#32
  main::c#1 = main::c#2 + rangenext(0,4)
  main::$7 = main::c#1 != rangelast(0,4)
  if(main::$7) goto main::@1
  to:main::@4
main::@4: scope:[main]  from main::@9
  root#27 = phi( main::@9/root#26 )
  free_#29 = phi( main::@9/free_#28 )
  print_line_cursor#20 = phi( main::@9/print_line_cursor#23 )
  print_char_cursor#42 = phi( main::@9/print_char_cursor#13 )
  Ticks#15 = phi( main::@9/Ticks#18 )
  call end
  to:main::@10
main::@10: scope:[main]  from main::@4
  root#23 = phi( main::@4/root#27 )
  free_#25 = phi( main::@4/free_#29 )
  print_line_cursor#14 = phi( main::@4/print_line_cursor#3 )
  print_char_cursor#33 = phi( main::@4/print_char_cursor#12 )
  Ticks#10 = phi( main::@4/Ticks#2 )
  Ticks#3 = Ticks#10
  print_char_cursor#14 = print_char_cursor#33
  print_line_cursor#4 = print_line_cursor#14
  to:main::@return
main::@return: scope:[main]  from main::@10
  print_line_cursor#15 = phi( main::@10/print_line_cursor#4 )
  Ticks#11 = phi( main::@10/Ticks#3 )
  print_char_cursor#34 = phi( main::@10/print_char_cursor#14 )
  root#16 = phi( main::@10/root#23 )
  free_#19 = phi( main::@10/free_#25 )
  free_#8 = free_#19
  root#6 = root#16
  print_char_cursor#15 = print_char_cursor#34
  Ticks#4 = Ticks#11
  print_line_cursor#5 = print_line_cursor#15
  return 
  to:@return

void __start()
__start: scope:[__start]  from
  to:__start::__init1
__start::__init1: scope:[__start]  from __start
  print_screen#0 = (char *)$400
  print_line_cursor#6 = print_screen#0
  print_char_cursor#16 = print_line_cursor#6
  last_time = 0
  Ticks#5 = 0
  free_#9 = 0
  root#7 = (struct node *) 0
  to:__start::@1
__start::@1: scope:[__start]  from __start::__init1
  print_screen#4 = phi( __start::__init1/print_screen#0 )
  print_line_cursor#21 = phi( __start::__init1/print_line_cursor#6 )
  Ticks#16 = phi( __start::__init1/Ticks#5 )
  print_char_cursor#43 = phi( __start::__init1/print_char_cursor#16 )
  root#24 = phi( __start::__init1/root#7 )
  free_#26 = phi( __start::__init1/free_#9 )
  call main
  to:__start::@2
__start::@2: scope:[__start]  from __start::@1
  print_screen#3 = phi( __start::@1/print_screen#4 )
  print_line_cursor#16 = phi( __start::@1/print_line_cursor#5 )
  Ticks#12 = phi( __start::@1/Ticks#4 )
  print_char_cursor#35 = phi( __start::@1/print_char_cursor#15 )
  root#17 = phi( __start::@1/root#6 )
  free_#20 = phi( __start::@1/free_#8 )
  free_#10 = free_#20
  root#8 = root#17
  print_char_cursor#17 = print_char_cursor#35
  Ticks#6 = Ticks#12
  print_line_cursor#7 = print_line_cursor#16
  to:__start::@return
__start::@return: scope:[__start]  from __start::@2
  root#18 = phi( __start::@2/root#8 )
  free_#21 = phi( __start::@2/free_#10 )
  Ticks#13 = phi( __start::@2/Ticks#6 )
  print_char_cursor#36 = phi( __start::@2/print_char_cursor#17 )
  print_line_cursor#17 = phi( __start::@2/print_line_cursor#7 )
  print_screen#2 = phi( __start::@2/print_screen#3 )
  print_screen#1 = print_screen#2
  print_line_cursor#8 = print_line_cursor#17
  print_char_cursor#18 = print_char_cursor#36
  Ticks#7 = Ticks#13
  free_#11 = free_#21
  root#9 = root#18
  return 
  to:@return

SYMBOL TABLE SSA
__constant char OFFSET_STRUCT_NODE_NEXT = 0
__constant char OFFSET_STRUCT_NODE_VALUE = 2
__constant char RADIX::BINARY = 2
__constant char RADIX::DECIMAL = $a
__constant char RADIX::HEXADECIMAL = $10
__constant char RADIX::OCTAL = 8
__constant char SIZEOF_STRUCT_NODE = 4
unsigned int Ticks
unsigned int Ticks#0
unsigned int Ticks#1
unsigned int Ticks#10
unsigned int Ticks#11
unsigned int Ticks#12
unsigned int Ticks#13
unsigned int Ticks#14
unsigned int Ticks#15
unsigned int Ticks#16
unsigned int Ticks#17
unsigned int Ticks#18
unsigned int Ticks#19
unsigned int Ticks#2
unsigned int Ticks#20
unsigned int Ticks#21
unsigned int Ticks#22
unsigned int Ticks#23
unsigned int Ticks#24
unsigned int Ticks#25
unsigned int Ticks#26
unsigned int Ticks#3
unsigned int Ticks#4
unsigned int Ticks#5
unsigned int Ticks#6
unsigned int Ticks#7
unsigned int Ticks#8
unsigned int Ticks#9
void __start()
struct node * alloc()
struct node *alloc::$0
unsigned int alloc::$1
struct node *alloc::result
struct node *alloc::result#0
struct node *alloc::result#1
struct node *alloc::return
struct node *alloc::return#0
struct node *alloc::return#1
struct node *alloc::return#2
struct node *alloc::return#3
struct node *alloc::return#4
void end()
unsigned int free_
unsigned int free_#0
unsigned int free_#1
unsigned int free_#10
unsigned int free_#11
unsigned int free_#12
unsigned int free_#13
unsigned int free_#14
unsigned int free_#15
unsigned int free_#16
unsigned int free_#17
unsigned int free_#18
unsigned int free_#19
unsigned int free_#2
unsigned int free_#20
unsigned int free_#21
unsigned int free_#22
unsigned int free_#23
unsigned int free_#24
unsigned int free_#25
unsigned int free_#26
unsigned int free_#27
unsigned int free_#28
unsigned int free_#29
unsigned int free_#3
unsigned int free_#30
unsigned int free_#31
unsigned int free_#32
unsigned int free_#4
unsigned int free_#5
unsigned int free_#6
unsigned int free_#7
unsigned int free_#8
unsigned int free_#9
__constant struct node heap[$fa0] = { fill( $fa0, 0) }
void init()
__loadstore volatile unsigned int last_time
void main()
bool main::$4
unsigned int main::$5
bool main::$7
char main::c
char main::c#0
char main::c#1
char main::c#2
char main::c#3
char main::c#4
char main::c#5
char main::c#6
char main::c#7
char main::c#8
unsigned int main::i
unsigned int main::i#0
unsigned int main::i#1
unsigned int main::i#2
unsigned int main::i#3
void prepend(unsigned int x)
struct node *prepend::$0
struct node **prepend::$1
unsigned int *prepend::$2
struct node **prepend::$3
unsigned int *prepend::$4
struct node *prepend::new
struct node *prepend::new#0
struct node *prepend::new#1
unsigned int prepend::x
unsigned int prepend::x#0
unsigned int prepend::x#1
unsigned int prepend::x#2
void print_char(char ch)
char print_char::ch
char print_char::ch#0
char print_char::ch#1
char print_char::ch#2
char print_char::ch#3
char *print_char_cursor
char *print_char_cursor#0
char *print_char_cursor#1
char *print_char_cursor#10
char *print_char_cursor#11
char *print_char_cursor#12
char *print_char_cursor#13
char *print_char_cursor#14
char *print_char_cursor#15
char *print_char_cursor#16
char *print_char_cursor#17
char *print_char_cursor#18
char *print_char_cursor#19
char *print_char_cursor#2
char *print_char_cursor#20
char *print_char_cursor#21
char *print_char_cursor#22
char *print_char_cursor#23
char *print_char_cursor#24
char *print_char_cursor#25
char *print_char_cursor#26
char *print_char_cursor#27
char *print_char_cursor#28
char *print_char_cursor#29
char *print_char_cursor#3
char *print_char_cursor#30
char *print_char_cursor#31
char *print_char_cursor#32
char *print_char_cursor#33
char *print_char_cursor#34
char *print_char_cursor#35
char *print_char_cursor#36
char *print_char_cursor#37
char *print_char_cursor#38
char *print_char_cursor#39
char *print_char_cursor#4
char *print_char_cursor#40
char *print_char_cursor#41
char *print_char_cursor#42
char *print_char_cursor#43
char *print_char_cursor#44
char *print_char_cursor#45
char *print_char_cursor#46
char *print_char_cursor#47
char *print_char_cursor#48
char *print_char_cursor#49
char *print_char_cursor#5
char *print_char_cursor#50
char *print_char_cursor#51
char *print_char_cursor#6
char *print_char_cursor#7
char *print_char_cursor#8
char *print_char_cursor#9
__constant const char print_hextab[] = "0123456789abcdef"z
char *print_line_cursor
char *print_line_cursor#0
char *print_line_cursor#1
char *print_line_cursor#10
char *print_line_cursor#11
char *print_line_cursor#12
char *print_line_cursor#13
char *print_line_cursor#14
char *print_line_cursor#15
char *print_line_cursor#16
char *print_line_cursor#17
char *print_line_cursor#18
char *print_line_cursor#19
char *print_line_cursor#2
char *print_line_cursor#20
char *print_line_cursor#21
char *print_line_cursor#22
char *print_line_cursor#23
char *print_line_cursor#24
char *print_line_cursor#25
char *print_line_cursor#26
char *print_line_cursor#27
char *print_line_cursor#28
char *print_line_cursor#29
char *print_line_cursor#3
char *print_line_cursor#30
char *print_line_cursor#31
char *print_line_cursor#32
char *print_line_cursor#4
char *print_line_cursor#5
char *print_line_cursor#6
char *print_line_cursor#7
char *print_line_cursor#8
char *print_line_cursor#9
void print_ln()
char *print_ln::$0
bool print_ln::$1
char *print_screen
char *print_screen#0
char *print_screen#1
char *print_screen#2
char *print_screen#3
char *print_screen#4
void print_uchar(char b)
char print_uchar::$0
number print_uchar::$2
char print_uchar::b
char print_uchar::b#0
char print_uchar::b#1
char print_uchar::b#2
char print_uchar::b#3
void print_uint(unsigned int w)
char print_uint::$0
char print_uint::$2
unsigned int print_uint::w
unsigned int print_uint::w#0
unsigned int print_uint::w#1
unsigned int print_uint::w#2
struct node *root
struct node *root#0
struct node *root#1
struct node *root#10
struct node *root#11
struct node *root#12
struct node *root#13
struct node *root#14
struct node *root#15
struct node *root#16
struct node *root#17
struct node *root#18
struct node *root#19
struct node *root#2
struct node *root#20
struct node *root#21
struct node *root#22
struct node *root#23
struct node *root#24
struct node *root#25
struct node *root#26
struct node *root#27
struct node *root#28
struct node *root#29
struct node *root#3
struct node *root#4
struct node *root#5
struct node *root#6
struct node *root#7
struct node *root#8
struct node *root#9
void start()
__constant unsigned int * const start::LAST_TIME = &last_time
unsigned int sum()
unsigned int *sum::$0
struct node **sum::$1
unsigned int *sum::$2
struct node **sum::$3
bool sum::$4
struct node *sum::current
struct node *sum::current#0
struct node *sum::current#1
struct node *sum::current#2
struct node *sum::current#3
struct node *sum::current#4
unsigned int sum::return
unsigned int sum::return#0
unsigned int sum::return#1
unsigned int sum::return#2
unsigned int sum::return#3
unsigned int sum::return#4
unsigned int sum::s
unsigned int sum::s#0
unsigned int sum::s#1
unsigned int sum::s#2
unsigned int sum::s#3
unsigned int sum::s#4
unsigned int sum::s#5

Adding number conversion cast (unumber) $28 in print_ln::$0 = print_line_cursor#9 + $28
Adding number conversion cast (unumber) 4 in print_uchar::$0 = print_uchar::b#2 >> 4
Adding number conversion cast (unumber) $f in print_uchar::$2 = print_uchar::b#3 & $f
Adding number conversion cast (unumber) print_uchar::$2 in print_uchar::$2 = print_uchar::b#3 & (unumber)$f
Adding number conversion cast (unumber) 0 in free_#0 = 0
Adding number conversion cast (unumber) 0 in sum::s#1 = 0
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast free_#0 = (unumber)0
Inlining cast root#0 = (struct node *)(void *)0
Inlining cast sum::s#1 = (unumber)0
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast $28
Simplifying constant integer cast 4
Simplifying constant integer cast $f
Simplifying constant integer cast 0
Simplifying constant pointer cast (void *) 0
Simplifying constant integer cast 0
Simplifying constant pointer cast (char *) 1024
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) $28
Finalized unsigned number type (char) 4
Finalized unsigned number type (char) $f
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to char in print_uchar::$2 = print_uchar::b#3 & $f
Alias print_line_cursor#0 = print_ln::$0 print_line_cursor#10 print_char_cursor#0 print_line_cursor#11 print_char_cursor#20 print_line_cursor#1 print_char_cursor#1 
Alias print_uchar::b#0 = print_uint::$0 
Alias print_uint::w#1 = print_uint::w#2 
Alias print_char_cursor#2 = print_char_cursor#21 
Alias print_uchar::b#1 = print_uint::$2 
Alias print_char_cursor#22 = print_char_cursor#3 print_char_cursor#23 print_char_cursor#4 
Alias print_uchar::b#2 = print_uchar::b#3 
Alias print_char_cursor#24 = print_char_cursor#5 
Alias print_char_cursor#25 = print_char_cursor#6 print_char_cursor#26 print_char_cursor#7 
Alias print_char_cursor#28 = print_char_cursor#8 print_char_cursor#9 
Alias Ticks#0 = Ticks#8 
Alias print_char_cursor#41 = print_char_cursor#44 
Alias print_line_cursor#19 = print_line_cursor#22 print_line_cursor#24 
Alias Ticks#1 = Ticks#17 Ticks#14 Ticks#9 Ticks#2 
Alias print_char_cursor#10 = print_char_cursor#29 
Alias print_line_cursor#12 = print_line_cursor#2 print_line_cursor#13 print_line_cursor#3 
Alias print_char_cursor#11 = print_char_cursor#30 print_char_cursor#31 print_char_cursor#12 
Alias free_#0 = free_#12 free_#1 
Alias root#0 = root#10 root#1 
Alias alloc::return#0 = alloc::result#1 alloc::$0 alloc::return#3 alloc::return#1 
Alias free_#14 = free_#2 free_#3 
Alias alloc::return#2 = alloc::return#4 
Alias root#11 = root#19 
Alias prepend::x#1 = prepend::x#2 
Alias free_#15 = free_#4 free_#16 free_#5 
Alias prepend::new#1 = prepend::$0 
Alias root#12 = root#2 root#3 
Alias sum::current#3 = sum::current#4 
Alias sum::s#3 = sum::s#5 sum::s#4 sum::return#0 sum::return#3 sum::return#1 
Alias free_#27 = free_#30 
Alias root#25 = root#28 
Alias print_char_cursor#50 = print_char_cursor#51 
Alias Ticks#25 = Ticks#26 
Alias print_line_cursor#31 = print_line_cursor#32 
Alias print_char_cursor#48 = print_char_cursor#49 
Alias main::c#7 = main::c#8 
Alias Ticks#23 = Ticks#24 
Alias print_line_cursor#29 = print_line_cursor#30 
Alias free_#17 = free_#6 
Alias root#14 = root#4 
Alias main::i#2 = main::i#3 
Alias print_char_cursor#40 = print_char_cursor#46 print_char_cursor#47 print_char_cursor#45 
Alias main::c#2 = main::c#5 main::c#6 main::c#4 main::c#3 
Alias Ticks#15 = Ticks#21 Ticks#22 Ticks#20 Ticks#19 Ticks#18 
Alias print_line_cursor#20 = print_line_cursor#27 print_line_cursor#28 print_line_cursor#26 print_line_cursor#25 print_line_cursor#23 
Alias free_#18 = free_#7 free_#32 free_#31 free_#28 free_#29 free_#25 free_#19 free_#8 
Alias root#15 = root#5 root#20 root#29 root#26 root#27 root#23 root#16 root#6 
Alias sum::return#2 = sum::return#4 
Alias print_char_cursor#13 = print_char_cursor#32 print_char_cursor#42 
Alias Ticks#10 = Ticks#3 Ticks#11 Ticks#4 
Alias print_char_cursor#14 = print_char_cursor#33 print_char_cursor#34 print_char_cursor#15 
Alias print_line_cursor#14 = print_line_cursor#4 print_line_cursor#15 print_line_cursor#5 
Alias print_screen#0 = print_line_cursor#6 print_char_cursor#16 print_char_cursor#43 print_line_cursor#21 print_screen#4 print_screen#3 print_screen#2 print_screen#1 
Alias free_#26 = free_#9 
Alias root#24 = root#7 
Alias Ticks#16 = Ticks#5 
Alias free_#10 = free_#20 free_#21 free_#11 
Alias root#17 = root#8 root#18 root#9 
Alias print_char_cursor#17 = print_char_cursor#35 print_char_cursor#36 print_char_cursor#18 
Alias Ticks#12 = Ticks#6 Ticks#13 Ticks#7 
Alias print_line_cursor#16 = print_line_cursor#7 print_line_cursor#17 print_line_cursor#8 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values print_line_cursor#18 print_line_cursor#19
Identical Phi Values print_char_cursor#37 print_char_cursor#10
Identical Phi Values print_char_cursor#19 print_char_cursor#37
Identical Phi Values print_uint::w#1 print_uint::w#0
Identical Phi Values print_char_cursor#38 print_char_cursor#41
Identical Phi Values print_char_cursor#2 print_char_cursor#25
Identical Phi Values print_char_cursor#22 print_char_cursor#25
Identical Phi Values print_char_cursor#24 print_char_cursor#28
Identical Phi Values print_char_cursor#25 print_char_cursor#28
Identical Phi Values print_char_cursor#41 print_char_cursor#13
Identical Phi Values print_line_cursor#19 print_line_cursor#20
Identical Phi Values print_char_cursor#10 print_char_cursor#22
Identical Phi Values print_line_cursor#12 print_line_cursor#0
Identical Phi Values print_char_cursor#11 print_line_cursor#0
Identical Phi Values free_#13 free_#22
Identical Phi Values free_#22 free_#24
Identical Phi Values root#11 root#22
Identical Phi Values prepend::x#1 prepend::x#0
Identical Phi Values free_#15 free_#14
Identical Phi Values root#13 root#15
Identical Phi Values free_#27 free_#26
Identical Phi Values root#25 root#24
Identical Phi Values print_char_cursor#50 print_screen#0
Identical Phi Values Ticks#25 Ticks#16
Identical Phi Values print_line_cursor#31 print_screen#0
Identical Phi Values free_#17 free_#0
Identical Phi Values root#14 root#0
Identical Phi Values print_char_cursor#40 print_char_cursor#48
Identical Phi Values main::c#2 main::c#7
Identical Phi Values Ticks#15 Ticks#23
Identical Phi Values print_line_cursor#20 print_line_cursor#29
Identical Phi Values free_#18 free_#15
Identical Phi Values root#15 root#12
Identical Phi Values print_char_cursor#13 print_char_cursor#28
Identical Phi Values Ticks#10 Ticks#1
Identical Phi Values print_char_cursor#14 print_char_cursor#11
Identical Phi Values print_line_cursor#14 print_line_cursor#12
Identical Phi Values free_#10 free_#18
Identical Phi Values root#17 root#15
Identical Phi Values print_char_cursor#17 print_char_cursor#14
Identical Phi Values Ticks#12 Ticks#10
Identical Phi Values print_line_cursor#16 print_line_cursor#14
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values print_char_cursor#39 print_char_cursor#28
Identical Phi Values Ticks#23 Ticks#16
Identical Phi Values print_line_cursor#29 print_screen#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition print_ln::$1 [4] if(print_line_cursor#0<print_char_cursor#28) goto print_ln::@1
Simple Condition sum::$4 [71] if((struct node *)0!=sum::current#3) goto sum::@2
Simple Condition main::$4 [92] if(main::i#1!=rangelast(0,$bb7)) goto main::@2
Simple Condition main::$7 [101] if(main::c#1!=rangelast(0,4)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [42] root#0 = (struct node *)(void *) 0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant free_#0 = 0
Constant root#0 = (struct node *)(void *) 0
Constant alloc::result#0 = (struct node *) 0
Constant prepend::new#0 = (struct node *) 0
Constant sum::current#0 = (struct node *) 0
Constant sum::s#0 = 0
Constant sum::s#1 = 0
Constant main::c#0 = 0
Constant main::i#0 = 0
Constant print_screen#0 = (char *) 1024
Constant Ticks#16 = 0
Constant free_#26 = 0
Constant root#24 = (struct node *) 0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [90] main::i#1 = ++ main::i#2 to ++
Resolved ranged comparison value [92] if(main::i#1!=rangelast(0,$bb7)) goto main::@2 to $bb8
Resolved ranged next value [99] main::c#1 = ++ main::c#7 to ++
Resolved ranged comparison value [101] if(main::c#1!=rangelast(0,4)) goto main::@1 to 5
Converting *(pointer+n) to pointer[n] [58] *prepend::$1 = root#22  -- prepend::$3[OFFSET_STRUCT_NODE_NEXT]
Converting *(pointer+n) to pointer[n] [61] *prepend::$2 = prepend::x#0  -- prepend::$4[OFFSET_STRUCT_NODE_VALUE]
Converting *(pointer+n) to pointer[n] [74] sum::s#2 = sum::s#3 + *sum::$0  -- sum::$2[OFFSET_STRUCT_NODE_VALUE]
Converting *(pointer+n) to pointer[n] [77] sum::current#2 = *sum::$1  -- sum::$3[OFFSET_STRUCT_NODE_NEXT]
Successful SSA optimization Pass2InlineDerefIdx
Simplifying expression containing zero prepend::$3 in [57] prepend::$1 = prepend::$3 + OFFSET_STRUCT_NODE_NEXT
Simplifying expression containing zero prepend::$3 in [58] prepend::$3[OFFSET_STRUCT_NODE_NEXT] = root#22
Simplifying expression containing zero sum::$3 in [76] sum::$1 = sum::$3 + OFFSET_STRUCT_NODE_NEXT
Simplifying expression containing zero sum::$3 in [77] sum::current#2 = sum::$3[OFFSET_STRUCT_NODE_NEXT]
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable prepend::$1 and assignment [40] prepend::$1 = prepend::$3
Eliminating unused variable prepend::$2 and assignment [43] prepend::$2 = prepend::$4 + OFFSET_STRUCT_NODE_VALUE
Eliminating unused variable sum::$0 and assignment [51] sum::$0 = sum::$2 + OFFSET_STRUCT_NODE_VALUE
Eliminating unused variable sum::$1 and assignment [54] sum::$1 = sum::$3
Eliminating unused variable - keeping the phi block free_#23
Eliminating unused variable - keeping the phi block root#21
Eliminating unused constant alloc::result#0
Eliminating unused constant prepend::new#0
Eliminating unused constant sum::current#0
Eliminating unused constant sum::s#0
Eliminating unused constant OFFSET_STRUCT_NODE_NEXT
Eliminating unused constant Ticks#16
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant free_#26
Eliminating unused constant root#24
Successful SSA optimization PassNEliminateUnusedVars
Removing call to empty/unused procedure [55] call init
Removing unused procedure init
Removing unused procedure block init
Removing unused procedure block init::@return
Successful SSA optimization PassNEliminateEmptyProcedure
Adding number conversion cast (unumber) $bb8 in [60] if(main::i#1!=$bb8) goto main::@2
Adding number conversion cast (unumber) 5 in [67] if(main::c#1!=5) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast $bb8
Simplifying constant integer cast 5
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (unsigned int) $bb8
Finalized unsigned number type (char) 5
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inlining Noop Cast [38] prepend::$3 = (struct node **)prepend::new#1 keeping prepend::new#1
Inlining Noop Cast [40] prepend::$4 = (unsigned int *)prepend::new#1 keeping prepend::new#1
Inlining Noop Cast [47] sum::$2 = (unsigned int *)sum::current#3 keeping sum::current#3
Inlining Noop Cast [49] sum::$3 = (struct node **)sum::current#3 keeping sum::current#3
Successful SSA optimization Pass2NopCastInlining
Rewriting multiplication to use shift [31] alloc::$1 = free_#24 * SIZEOF_STRUCT_NODE
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings sum::s#1
Inlining constant with var siblings main::c#0
Inlining constant with var siblings main::i#0
Inlining constant with var siblings free_#0
Inlining constant with var siblings root#0
Constant inlined main::i#0 = 0
Constant inlined main::c#0 = 0
Constant inlined free_#0 = 0
Constant inlined sum::s#1 = 0
Constant inlined root#0 = (struct node *)(void *) 0
Successful SSA optimization Pass2ConstantInlining
Eliminating unused constant SIZEOF_STRUCT_NODE
Successful SSA optimization PassNEliminateUnusedVars
Finalized unsigned number type (char) 2
Finalized unsigned number type (char) 8
Finalized unsigned number type (char) $a
Finalized unsigned number type (char) $10
Finalized unsigned number type (unsigned int) $fa0
Finalized unsigned number type (unsigned int) $fa0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1)
Added new block during phi lifting main::@11(between main::@9 and main::@1)
Added new block during phi lifting main::@12(between main::@7 and main::@2)
Adding NOP phi() at start of __start
Adding NOP phi() at start of __start::@1
Adding NOP phi() at start of __start::@2
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@5
Adding NOP phi() at start of main::@6
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of main::@4
Adding NOP phi() at start of main::@10
Adding NOP phi() at start of prepend
Adding NOP phi() at start of sum::@3
Adding NOP phi() at start of end::@2
Adding NOP phi() at start of end::@3
Adding NOP phi() at start of print_uint::@2
Adding NOP phi() at start of print_ln
Adding NOP phi() at start of print_ln::@2
Adding NOP phi() at start of print_uchar::@2
CALL GRAPH
Calls in [__start] to main:3 
Calls in [main] to start:7 prepend:13 sum:17 print_char:23 end:27 
Calls in [prepend] to alloc:38 
Calls in [end] to start:60 print_uint:64 print_ln:66 
Calls in [print_uint] to print_uchar:75 print_uchar:78 
Calls in [print_uchar] to print_char:93 print_char:98 

Created 11 initial phi equivalence classes
Coalesced [21] print_char::ch#4 = print_char::ch#2
Coalesced [22] print_char_cursor#52 = print_char_cursor#48
Coalesced [30] print_char_cursor#55 = print_char_cursor#28
Coalesced [31] main::c#9 = main::c#1
Coalesced [32] main::i#4 = main::i#1
Coalesced [33] free_#33 = free_#14
Coalesced [34] root#30 = root#12
Not coalescing [43] root#12 = prepend::new#1
Coalesced [46] sum::current#5 = sum::current#1
Coalesced [53] sum::current#6 = sum::current#2
Coalesced [54] sum::s#6 = sum::s#2
Coalesced [74] print_uchar::b#4 = print_uchar::b#0
Coalesced [77] print_uchar::b#5 = print_uchar::b#1
Coalesced [87] print_line_cursor#33 = print_line_cursor#0
Coalesced [91] print_char::ch#5 = print_char::ch#0
Coalesced (already) [92] print_char_cursor#53 = print_char_cursor#28
Coalesced [96] print_char::ch#6 = print_char::ch#1
Coalesced (already) [97] print_char_cursor#54 = print_char_cursor#28
Coalesced down to 11 phi equivalence classes
Culled Empty Block label __start::@2
Culled Empty Block label main::@5
Culled Empty Block label main::@6
Culled Empty Block label main::@10
Culled Empty Block label main::@11
Culled Empty Block label main::@12
Culled Empty Block label sum::@3
Culled Empty Block label end::@3
Culled Empty Block label print_uint::@2
Culled Empty Block label print_ln::@2
Culled Empty Block label print_ln::@3
Culled Empty Block label print_uchar::@2
Renumbering block main::@7 to main::@5
Renumbering block main::@8 to main::@6
Renumbering block main::@9 to main::@7
Adding NOP phi() at start of __start
Adding NOP phi() at start of __start::@1
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of main::@4
Adding NOP phi() at start of prepend
Adding NOP phi() at start of end::@2
Adding NOP phi() at start of print_ln

FINAL CONTROL FLOW GRAPH

void __start()
__start: scope:[__start]  from
  [0] phi()
  to:__start::__init1
__start::__init1: scope:[__start]  from __start
  [1] last_time = 0
  to:__start::@1
__start::@1: scope:[__start]  from __start::__init1
  [2] phi()
  [3] call main
  to:__start::@return
__start::@return: scope:[__start]  from __start::@1
  [4] return 
  to:@return

void main()
main: scope:[main]  from __start::@1
  [5] phi()
  [6] call start
  to:main::@1
main::@1: scope:[main]  from main main::@7
  [7] main::c#7 = phi( main/0, main::@7/main::c#1 )
  [7] print_char_cursor#48 = phi( main/print_screen#0, main::@7/print_char_cursor#28 )
  to:main::@2
main::@2: scope:[main]  from main::@1 main::@5
  [8] root#22 = phi( main::@1/(struct node *)(void *) 0, main::@5/root#12 )
  [8] free_#24 = phi( main::@1/0, main::@5/free_#14 )
  [8] main::i#2 = phi( main::@1/0, main::@5/main::i#1 )
  [9] prepend::x#0 = main::i#2
  [10] call prepend
  to:main::@5
main::@5: scope:[main]  from main::@2
  [11] main::i#1 = ++ main::i#2
  [12] if(main::i#1!=$bb8) goto main::@2
  to:main::@3
main::@3: scope:[main]  from main::@5
  [13] phi()
  [14] call sum
  [15] sum::return#2 = sum::s#3
  to:main::@6
main::@6: scope:[main]  from main::@3
  [16] main::$5 = sum::return#2
  [17] print_char::ch#2 = (char)main::$5
  [18] call print_char
  to:main::@7
main::@7: scope:[main]  from main::@6
  [19] main::c#1 = ++ main::c#7
  [20] if(main::c#1!=5) goto main::@1
  to:main::@4
main::@4: scope:[main]  from main::@7
  [21] phi()
  [22] call end
  to:main::@return
main::@return: scope:[main]  from main::@4
  [23] return 
  to:@return

void start()
start: scope:[start]  from end main
  asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1  }
  to:start::@return
start::@return: scope:[start]  from start
  [25] return 
  to:@return

void prepend(unsigned int x)
prepend: scope:[prepend]  from main::@2
  [26] phi()
  [27] call alloc
  [28] alloc::return#2 = alloc::return#0
  to:prepend::@1
prepend::@1: scope:[prepend]  from prepend
  [29] prepend::new#1 = alloc::return#2
  [30] *((struct node **)prepend::new#1) = root#22
  [31] ((unsigned int *)prepend::new#1)[OFFSET_STRUCT_NODE_VALUE] = prepend::x#0
  [32] root#12 = prepend::new#1
  to:prepend::@return
prepend::@return: scope:[prepend]  from prepend::@1
  [33] return 
  to:@return

unsigned int sum()
sum: scope:[sum]  from main::@3
  [34] sum::current#1 = root#12
  to:sum::@1
sum::@1: scope:[sum]  from sum sum::@2
  [35] sum::s#3 = phi( sum/0, sum::@2/sum::s#2 )
  [35] sum::current#3 = phi( sum/sum::current#1, sum::@2/sum::current#2 )
  [36] if((struct node *)0!=sum::current#3) goto sum::@2
  to:sum::@return
sum::@return: scope:[sum]  from sum::@1
  [37] return 
  to:@return
sum::@2: scope:[sum]  from sum::@1
  [38] sum::s#2 = sum::s#3 + ((unsigned int *)sum::current#3)[OFFSET_STRUCT_NODE_VALUE]
  [39] sum::current#2 = *((struct node **)sum::current#3)
  to:sum::@1

void print_char(char ch)
print_char: scope:[print_char]  from main::@6 print_uchar print_uchar::@1
  [40] print_char_cursor#27 = phi( main::@6/print_char_cursor#48, print_uchar/print_char_cursor#28, print_uchar::@1/print_char_cursor#28 )
  [40] print_char::ch#3 = phi( main::@6/print_char::ch#2, print_uchar/print_char::ch#0, print_uchar::@1/print_char::ch#1 )
  [41] *print_char_cursor#27 = print_char::ch#3
  [42] print_char_cursor#28 = ++ print_char_cursor#27
  to:print_char::@return
print_char::@return: scope:[print_char]  from print_char
  [43] return 
  to:@return

void end()
end: scope:[end]  from main::@4
  [44] Ticks#0 = last_time
  [45] call start
  to:end::@1
end::@1: scope:[end]  from end
  [46] last_time = last_time - Ticks#0
  [47] Ticks#1 = last_time
  [48] print_uint::w#0 = Ticks#1
  [49] call print_uint
  to:end::@2
end::@2: scope:[end]  from end::@1
  [50] phi()
  [51] call print_ln
  to:end::@return
end::@return: scope:[end]  from end::@2
  [52] return 
  to:@return

struct node * alloc()
alloc: scope:[alloc]  from prepend
  [53] alloc::$1 = free_#24 << 2
  [54] alloc::return#0 = heap + alloc::$1
  [55] free_#14 = ++ free_#24
  to:alloc::@return
alloc::@return: scope:[alloc]  from alloc
  [56] return 
  to:@return

void print_uint(unsigned int w)
print_uint: scope:[print_uint]  from end::@1
  [57] print_uchar::b#0 = byte1  print_uint::w#0
  [58] call print_uchar
  to:print_uint::@1
print_uint::@1: scope:[print_uint]  from print_uint
  [59] print_uchar::b#1 = byte0  print_uint::w#0
  [60] call print_uchar
  to:print_uint::@return
print_uint::@return: scope:[print_uint]  from print_uint::@1
  [61] return 
  to:@return

void print_ln()
print_ln: scope:[print_ln]  from end::@2
  [62] phi()
  to:print_ln::@1
print_ln::@1: scope:[print_ln]  from print_ln print_ln::@1
  [63] print_line_cursor#9 = phi( print_ln/print_screen#0, print_ln::@1/print_line_cursor#0 )
  [64] print_line_cursor#0 = print_line_cursor#9 + $28
  [65] if(print_line_cursor#0<print_char_cursor#28) goto print_ln::@1
  to:print_ln::@return
print_ln::@return: scope:[print_ln]  from print_ln::@1
  [66] return 
  to:@return

void print_uchar(char b)
print_uchar: scope:[print_uchar]  from print_uint print_uint::@1
  [67] print_uchar::b#2 = phi( print_uint/print_uchar::b#0, print_uint::@1/print_uchar::b#1 )
  [68] print_uchar::$0 = print_uchar::b#2 >> 4
  [69] print_char::ch#0 = print_hextab[print_uchar::$0]
  [70] call print_char
  to:print_uchar::@1
print_uchar::@1: scope:[print_uchar]  from print_uchar
  [71] print_uchar::$2 = print_uchar::b#2 & $f
  [72] print_char::ch#1 = print_hextab[print_uchar::$2]
  [73] call print_char
  to:print_uchar::@return
print_uchar::@return: scope:[print_uchar]  from print_uchar::@1
  [74] return 
  to:@return


VARIABLE REGISTER WEIGHTS
unsigned int Ticks
unsigned int Ticks#0 // 101.0
unsigned int Ticks#1 // 202.0
void __start()
struct node * alloc()
unsigned int alloc::$1 // 200002.0
struct node *alloc::result
struct node *alloc::return
struct node *alloc::return#0 // 27500.5
struct node *alloc::return#2 // 20002.0
void end()
unsigned int free_
unsigned int free_#14 // 8416.833333333332
unsigned int free_#24 // 40200.600000000006
__loadstore volatile unsigned int last_time // 18.454545454545453
void main()
unsigned int main::$5 // 101.0
char main::c
char main::c#1 // 151.5
char main::c#7 // 16.833333333333332
unsigned int main::i
unsigned int main::i#1 // 1501.5
unsigned int main::i#2 // 1001.0
void prepend(unsigned int x)
struct node *prepend::new
struct node *prepend::new#1 // 6667.333333333333
unsigned int prepend::x
unsigned int prepend::x#0 // 1833.6666666666665
void print_char(char ch)
char print_char::ch
char print_char::ch#0 // 20002.0
char print_char::ch#1 // 20002.0
char print_char::ch#2 // 202.0
char print_char::ch#3 // 120104.0
char *print_char_cursor
char *print_char_cursor#27 // 110052.5
char *print_char_cursor#28 // 4336.833333333333
char *print_char_cursor#48 // 18.363636363636363
char *print_line_cursor
char *print_line_cursor#0 // 15001.5
char *print_line_cursor#9 // 20002.0
void print_ln()
char *print_screen
void print_uchar(char b)
char print_uchar::$0 // 20002.0
char print_uchar::$2 // 20002.0
char print_uchar::b
char print_uchar::b#0 // 2002.0
char print_uchar::b#1 // 2002.0
char print_uchar::b#2 // 5501.0
void print_uint(unsigned int w)
unsigned int print_uint::w
unsigned int print_uint::w#0 // 701.0
struct node *root
struct node *root#12 // 2000.4999999999998
struct node *root#22 // 1833.6666666666665
void start()
unsigned int sum()
struct node *sum::current
struct node *sum::current#1 // 2002.0
struct node *sum::current#2 // 200002.0
struct node *sum::current#3 // 67001.0
unsigned int sum::return
unsigned int sum::return#2 // 202.0
unsigned int sum::s
unsigned int sum::s#2 // 100001.0
unsigned int sum::s#3 // 50025.75

Initial phi equivalence classes
[ main::c#7 main::c#1 ]
[ main::i#2 main::i#1 ]
[ free_#24 free_#14 ]
[ root#22 root#12 ]
[ sum::current#3 sum::current#1 sum::current#2 ]
[ sum::s#3 sum::s#2 ]
[ print_char::ch#3 print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
[ print_char_cursor#27 print_char_cursor#48 print_char_cursor#28 ]
[ print_line_cursor#9 print_line_cursor#0 ]
[ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ]
Added variable last_time to live range equivalence class [ last_time ]
Added variable prepend::x#0 to live range equivalence class [ prepend::x#0 ]
Added variable sum::return#2 to live range equivalence class [ sum::return#2 ]
Added variable main::$5 to live range equivalence class [ main::$5 ]
Added variable alloc::return#2 to live range equivalence class [ alloc::return#2 ]
Added variable prepend::new#1 to live range equivalence class [ prepend::new#1 ]
Added variable Ticks#0 to live range equivalence class [ Ticks#0 ]
Added variable Ticks#1 to live range equivalence class [ Ticks#1 ]
Added variable print_uint::w#0 to live range equivalence class [ print_uint::w#0 ]
Added variable alloc::$1 to live range equivalence class [ alloc::$1 ]
Added variable alloc::return#0 to live range equivalence class [ alloc::return#0 ]
Added variable print_uchar::$0 to live range equivalence class [ print_uchar::$0 ]
Added variable print_uchar::$2 to live range equivalence class [ print_uchar::$2 ]
Complete equivalence classes
[ main::c#7 main::c#1 ]
[ main::i#2 main::i#1 ]
[ free_#24 free_#14 ]
[ root#22 root#12 ]
[ sum::current#3 sum::current#1 sum::current#2 ]
[ sum::s#3 sum::s#2 ]
[ print_char::ch#3 print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
[ print_char_cursor#27 print_char_cursor#48 print_char_cursor#28 ]
[ print_line_cursor#9 print_line_cursor#0 ]
[ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ]
[ last_time ]
[ prepend::x#0 ]
[ sum::return#2 ]
[ main::$5 ]
[ alloc::return#2 ]
[ prepend::new#1 ]
[ Ticks#0 ]
[ Ticks#1 ]
[ print_uint::w#0 ]
[ alloc::$1 ]
[ alloc::return#0 ]
[ print_uchar::$0 ]
[ print_uchar::$2 ]
Allocated zp[2]:2 [ sum::current#3 sum::current#1 sum::current#2 ]
Allocated zp[2]:4 [ alloc::$1 ]
Allocated zp[1]:6 [ print_char::ch#3 print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
Allocated zp[2]:7 [ sum::s#3 sum::s#2 ]
Allocated zp[2]:9 [ print_char_cursor#27 print_char_cursor#48 print_char_cursor#28 ]
Allocated zp[2]:11 [ free_#24 free_#14 ]
Allocated zp[2]:13 [ print_line_cursor#9 print_line_cursor#0 ]
Allocated zp[2]:15 [ alloc::return#0 ]
Allocated zp[2]:17 [ alloc::return#2 ]
Allocated zp[1]:19 [ print_uchar::$0 ]
Allocated zp[1]:20 [ print_uchar::$2 ]
Allocated zp[1]:21 [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ]
Allocated zp[2]:22 [ prepend::new#1 ]
Allocated zp[2]:24 [ root#22 root#12 ]
Allocated zp[2]:26 [ main::i#2 main::i#1 ]
Allocated zp[2]:28 [ prepend::x#0 ]
Allocated zp[2]:30 [ print_uint::w#0 ]
Allocated zp[2]:32 [ sum::return#2 ]
Allocated zp[2]:34 [ Ticks#1 ]
Allocated zp[1]:36 [ main::c#7 main::c#1 ]
Allocated zp[2]:37 [ main::$5 ]
Allocated zp[2]:39 [ Ticks#0 ]
Allocated zp[2]:41 [ last_time ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [1] last_time = 0 [ last_time ] (  [ last_time ] { }  ) always clobbers reg byte a 
Statement [9] prepend::x#0 = main::i#2 [ last_time print_char_cursor#48 main::c#7 main::i#2 free_#24 root#22 prepend::x#0 ] ( main:3 [ last_time print_char_cursor#48 main::c#7 main::i#2 free_#24 root#22 prepend::x#0 ] { { prepend::x#0 = main::i#2 } }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:36 [ main::c#7 main::c#1 ]
Statement [12] if(main::i#1!=$bb8) goto main::@2 [ last_time print_char_cursor#48 main::c#7 main::i#1 free_#14 root#12 ] ( main:3 [ last_time print_char_cursor#48 main::c#7 main::i#1 free_#14 root#12 ] { }  ) always clobbers reg byte a 
Statement [15] sum::return#2 = sum::s#3 [ last_time print_char_cursor#48 main::c#7 sum::return#2 ] ( main:3 [ last_time print_char_cursor#48 main::c#7 sum::return#2 ] { { sum::return#2 = sum::s#3 } }  ) always clobbers reg byte a 
Statement [16] main::$5 = sum::return#2 [ last_time print_char_cursor#48 main::c#7 main::$5 ] ( main:3 [ last_time print_char_cursor#48 main::c#7 main::$5 ] { { print_char::ch#2 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#48 } }  ) always clobbers reg byte a 
Statement asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1  } always clobbers reg byte a reg byte x reg byte y 
Statement [28] alloc::return#2 = alloc::return#0 [ root#22 free_#14 prepend::x#0 alloc::return#2 ] ( main:3::prepend:10 [ last_time print_char_cursor#48 main::c#7 main::i#2 root#22 free_#14 prepend::x#0 alloc::return#2 ] { { prepend::x#0 = main::i#2 } { alloc::return#0 = alloc::return#2 } }  ) always clobbers reg byte a 
Statement [29] prepend::new#1 = alloc::return#2 [ root#22 free_#14 prepend::x#0 prepend::new#1 ] ( main:3::prepend:10 [ last_time print_char_cursor#48 main::c#7 main::i#2 root#22 free_#14 prepend::x#0 prepend::new#1 ] { { prepend::x#0 = main::i#2 } }  ) always clobbers reg byte a 
Statement [30] *((struct node **)prepend::new#1) = root#22 [ free_#14 prepend::x#0 prepend::new#1 ] ( main:3::prepend:10 [ last_time print_char_cursor#48 main::c#7 main::i#2 free_#14 prepend::x#0 prepend::new#1 ] { { prepend::x#0 = main::i#2 } }  ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte y as potential for zp[1]:36 [ main::c#7 main::c#1 ]
Statement [31] ((unsigned int *)prepend::new#1)[OFFSET_STRUCT_NODE_VALUE] = prepend::x#0 [ free_#14 prepend::new#1 ] ( main:3::prepend:10 [ last_time print_char_cursor#48 main::c#7 main::i#2 free_#14 prepend::new#1 ] { { prepend::x#0 = main::i#2 } }  ) always clobbers reg byte a reg byte y 
Statement [32] root#12 = prepend::new#1 [ free_#14 root#12 ] ( main:3::prepend:10 [ last_time print_char_cursor#48 main::c#7 main::i#2 free_#14 root#12 ] { { prepend::x#0 = main::i#2 } }  ) always clobbers reg byte a 
Statement [34] sum::current#1 = root#12 [ sum::current#1 ] ( main:3::sum:14 [ last_time print_char_cursor#48 main::c#7 sum::current#1 ] { { sum::return#2 = sum::s#3 } }  ) always clobbers reg byte a 
Statement [36] if((struct node *)0!=sum::current#3) goto sum::@2 [ sum::s#3 sum::current#3 ] ( main:3::sum:14 [ last_time print_char_cursor#48 main::c#7 sum::s#3 sum::current#3 ] { { sum::return#2 = sum::s#3 } }  ) always clobbers reg byte a 
Statement [38] sum::s#2 = sum::s#3 + ((unsigned int *)sum::current#3)[OFFSET_STRUCT_NODE_VALUE] [ sum::current#3 sum::s#2 ] ( main:3::sum:14 [ last_time print_char_cursor#48 main::c#7 sum::current#3 sum::s#2 ] { { sum::return#2 = sum::s#3 } }  ) always clobbers reg byte a reg byte y 
Statement [39] sum::current#2 = *((struct node **)sum::current#3) [ sum::current#2 sum::s#2 ] ( main:3::sum:14 [ last_time print_char_cursor#48 main::c#7 sum::current#2 sum::s#2 ] { { sum::return#2 = sum::s#3 } }  ) always clobbers reg byte a reg byte y 
Statement [41] *print_char_cursor#27 = print_char::ch#3 [ print_char_cursor#27 ] ( main:3::print_char:18 [ last_time main::c#7 print_char_cursor#27 ] { { print_char::ch#2 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#48 } }  main:3::end:22::print_uint:49::print_uchar:58::print_char:70 [ print_uint::w#0 print_uchar::b#2 print_char_cursor#27 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#0 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#28 } }  main:3::end:22::print_uint:49::print_uchar:60::print_char:70 [ print_uchar::b#2 print_char_cursor#27 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#1 = print_uchar::b#2 } { print_char::ch#0 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#28 } }  main:3::end:22::print_uint:49::print_uchar:58::print_char:73 [ print_uint::w#0 print_char_cursor#27 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#1 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#28 } }  main:3::end:22::print_uint:49::print_uchar:60::print_char:73 [ print_char_cursor#27 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#1 = print_uchar::b#2 } { print_char::ch#1 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#28 } }  ) always clobbers reg byte y 
Removing always clobbered register reg byte y as potential for zp[1]:21 [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ]
Statement [44] Ticks#0 = last_time [ last_time print_char_cursor#28 Ticks#0 ] ( main:3::end:22 [ last_time print_char_cursor#28 Ticks#0 ] { }  ) always clobbers reg byte a 
Statement [46] last_time = last_time - Ticks#0 [ last_time print_char_cursor#28 ] ( main:3::end:22 [ last_time print_char_cursor#28 ] { { Ticks#1 = print_uint::w#0 } }  ) always clobbers reg byte a 
Statement [47] Ticks#1 = last_time [ print_char_cursor#28 Ticks#1 ] ( main:3::end:22 [ print_char_cursor#28 Ticks#1 ] { { Ticks#1 = print_uint::w#0 } }  ) always clobbers reg byte a 
Statement [48] print_uint::w#0 = Ticks#1 [ print_char_cursor#28 print_uint::w#0 ] ( main:3::end:22 [ print_char_cursor#28 print_uint::w#0 ] { { Ticks#1 = print_uint::w#0 } }  ) always clobbers reg byte a 
Statement [53] alloc::$1 = free_#24 << 2 [ free_#24 alloc::$1 ] ( main:3::prepend:10::alloc:27 [ last_time print_char_cursor#48 main::c#7 main::i#2 root#22 prepend::x#0 free_#24 alloc::$1 ] { { prepend::x#0 = main::i#2 } { alloc::return#0 = alloc::return#2 } }  ) always clobbers reg byte a 
Statement [54] alloc::return#0 = heap + alloc::$1 [ free_#24 alloc::return#0 ] ( main:3::prepend:10::alloc:27 [ last_time print_char_cursor#48 main::c#7 main::i#2 root#22 prepend::x#0 free_#24 alloc::return#0 ] { { prepend::x#0 = main::i#2 } { alloc::return#0 = alloc::return#2 } }  ) always clobbers reg byte a 
Statement [64] print_line_cursor#0 = print_line_cursor#9 + $28 [ print_char_cursor#28 print_line_cursor#0 ] ( main:3::end:22::print_ln:51 [ print_char_cursor#28 print_line_cursor#0 ] { }  ) always clobbers reg byte a 
Statement [65] if(print_line_cursor#0<print_char_cursor#28) goto print_ln::@1 [ print_char_cursor#28 print_line_cursor#0 ] ( main:3::end:22::print_ln:51 [ print_char_cursor#28 print_line_cursor#0 ] { }  ) always clobbers reg byte a 
Statement [68] print_uchar::$0 = print_uchar::b#2 >> 4 [ print_char_cursor#28 print_uchar::b#2 print_uchar::$0 ] ( main:3::end:22::print_uint:49::print_uchar:58 [ print_uint::w#0 print_char_cursor#28 print_uchar::b#2 print_uchar::$0 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#0 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#28 } }  main:3::end:22::print_uint:49::print_uchar:60 [ print_char_cursor#28 print_uchar::b#2 print_uchar::$0 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#1 = print_uchar::b#2 } { print_char::ch#0 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#28 } }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:21 [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ]
Statement [71] print_uchar::$2 = print_uchar::b#2 & $f [ print_char_cursor#28 print_uchar::$2 ] ( main:3::end:22::print_uint:49::print_uchar:58 [ print_uint::w#0 print_char_cursor#28 print_uchar::$2 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#1 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#28 } }  main:3::end:22::print_uint:49::print_uchar:60 [ print_char_cursor#28 print_uchar::$2 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#1 = print_uchar::b#2 } { print_char::ch#1 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#28 } }  ) always clobbers reg byte a 
Statement [1] last_time = 0 [ last_time ] (  [ last_time ] { }  ) always clobbers reg byte a 
Statement [9] prepend::x#0 = main::i#2 [ last_time print_char_cursor#48 main::c#7 main::i#2 free_#24 root#22 prepend::x#0 ] ( main:3 [ last_time print_char_cursor#48 main::c#7 main::i#2 free_#24 root#22 prepend::x#0 ] { { prepend::x#0 = main::i#2 } }  ) always clobbers reg byte a 
Statement [12] if(main::i#1!=$bb8) goto main::@2 [ last_time print_char_cursor#48 main::c#7 main::i#1 free_#14 root#12 ] ( main:3 [ last_time print_char_cursor#48 main::c#7 main::i#1 free_#14 root#12 ] { }  ) always clobbers reg byte a 
Statement [15] sum::return#2 = sum::s#3 [ last_time print_char_cursor#48 main::c#7 sum::return#2 ] ( main:3 [ last_time print_char_cursor#48 main::c#7 sum::return#2 ] { { sum::return#2 = sum::s#3 } }  ) always clobbers reg byte a 
Statement [16] main::$5 = sum::return#2 [ last_time print_char_cursor#48 main::c#7 main::$5 ] ( main:3 [ last_time print_char_cursor#48 main::c#7 main::$5 ] { { print_char::ch#2 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#48 } }  ) always clobbers reg byte a 
Statement asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1  } always clobbers reg byte a reg byte x reg byte y 
Statement [28] alloc::return#2 = alloc::return#0 [ root#22 free_#14 prepend::x#0 alloc::return#2 ] ( main:3::prepend:10 [ last_time print_char_cursor#48 main::c#7 main::i#2 root#22 free_#14 prepend::x#0 alloc::return#2 ] { { prepend::x#0 = main::i#2 } { alloc::return#0 = alloc::return#2 } }  ) always clobbers reg byte a 
Statement [29] prepend::new#1 = alloc::return#2 [ root#22 free_#14 prepend::x#0 prepend::new#1 ] ( main:3::prepend:10 [ last_time print_char_cursor#48 main::c#7 main::i#2 root#22 free_#14 prepend::x#0 prepend::new#1 ] { { prepend::x#0 = main::i#2 } }  ) always clobbers reg byte a 
Statement [30] *((struct node **)prepend::new#1) = root#22 [ free_#14 prepend::x#0 prepend::new#1 ] ( main:3::prepend:10 [ last_time print_char_cursor#48 main::c#7 main::i#2 free_#14 prepend::x#0 prepend::new#1 ] { { prepend::x#0 = main::i#2 } }  ) always clobbers reg byte a reg byte y 
Statement [31] ((unsigned int *)prepend::new#1)[OFFSET_STRUCT_NODE_VALUE] = prepend::x#0 [ free_#14 prepend::new#1 ] ( main:3::prepend:10 [ last_time print_char_cursor#48 main::c#7 main::i#2 free_#14 prepend::new#1 ] { { prepend::x#0 = main::i#2 } }  ) always clobbers reg byte a reg byte y 
Statement [32] root#12 = prepend::new#1 [ free_#14 root#12 ] ( main:3::prepend:10 [ last_time print_char_cursor#48 main::c#7 main::i#2 free_#14 root#12 ] { { prepend::x#0 = main::i#2 } }  ) always clobbers reg byte a 
Statement [34] sum::current#1 = root#12 [ sum::current#1 ] ( main:3::sum:14 [ last_time print_char_cursor#48 main::c#7 sum::current#1 ] { { sum::return#2 = sum::s#3 } }  ) always clobbers reg byte a 
Statement [36] if((struct node *)0!=sum::current#3) goto sum::@2 [ sum::s#3 sum::current#3 ] ( main:3::sum:14 [ last_time print_char_cursor#48 main::c#7 sum::s#3 sum::current#3 ] { { sum::return#2 = sum::s#3 } }  ) always clobbers reg byte a 
Statement [38] sum::s#2 = sum::s#3 + ((unsigned int *)sum::current#3)[OFFSET_STRUCT_NODE_VALUE] [ sum::current#3 sum::s#2 ] ( main:3::sum:14 [ last_time print_char_cursor#48 main::c#7 sum::current#3 sum::s#2 ] { { sum::return#2 = sum::s#3 } }  ) always clobbers reg byte a reg byte y 
Statement [39] sum::current#2 = *((struct node **)sum::current#3) [ sum::current#2 sum::s#2 ] ( main:3::sum:14 [ last_time print_char_cursor#48 main::c#7 sum::current#2 sum::s#2 ] { { sum::return#2 = sum::s#3 } }  ) always clobbers reg byte a reg byte y 
Statement [41] *print_char_cursor#27 = print_char::ch#3 [ print_char_cursor#27 ] ( main:3::print_char:18 [ last_time main::c#7 print_char_cursor#27 ] { { print_char::ch#2 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#48 } }  main:3::end:22::print_uint:49::print_uchar:58::print_char:70 [ print_uint::w#0 print_uchar::b#2 print_char_cursor#27 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#0 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#28 } }  main:3::end:22::print_uint:49::print_uchar:60::print_char:70 [ print_uchar::b#2 print_char_cursor#27 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#1 = print_uchar::b#2 } { print_char::ch#0 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#28 } }  main:3::end:22::print_uint:49::print_uchar:58::print_char:73 [ print_uint::w#0 print_char_cursor#27 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#1 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#28 } }  main:3::end:22::print_uint:49::print_uchar:60::print_char:73 [ print_char_cursor#27 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#1 = print_uchar::b#2 } { print_char::ch#1 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#28 } }  ) always clobbers reg byte y 
Statement [44] Ticks#0 = last_time [ last_time print_char_cursor#28 Ticks#0 ] ( main:3::end:22 [ last_time print_char_cursor#28 Ticks#0 ] { }  ) always clobbers reg byte a 
Statement [46] last_time = last_time - Ticks#0 [ last_time print_char_cursor#28 ] ( main:3::end:22 [ last_time print_char_cursor#28 ] { { Ticks#1 = print_uint::w#0 } }  ) always clobbers reg byte a 
Statement [47] Ticks#1 = last_time [ print_char_cursor#28 Ticks#1 ] ( main:3::end:22 [ print_char_cursor#28 Ticks#1 ] { { Ticks#1 = print_uint::w#0 } }  ) always clobbers reg byte a 
Statement [48] print_uint::w#0 = Ticks#1 [ print_char_cursor#28 print_uint::w#0 ] ( main:3::end:22 [ print_char_cursor#28 print_uint::w#0 ] { { Ticks#1 = print_uint::w#0 } }  ) always clobbers reg byte a 
Statement [53] alloc::$1 = free_#24 << 2 [ free_#24 alloc::$1 ] ( main:3::prepend:10::alloc:27 [ last_time print_char_cursor#48 main::c#7 main::i#2 root#22 prepend::x#0 free_#24 alloc::$1 ] { { prepend::x#0 = main::i#2 } { alloc::return#0 = alloc::return#2 } }  ) always clobbers reg byte a 
Statement [54] alloc::return#0 = heap + alloc::$1 [ free_#24 alloc::return#0 ] ( main:3::prepend:10::alloc:27 [ last_time print_char_cursor#48 main::c#7 main::i#2 root#22 prepend::x#0 free_#24 alloc::return#0 ] { { prepend::x#0 = main::i#2 } { alloc::return#0 = alloc::return#2 } }  ) always clobbers reg byte a 
Statement [64] print_line_cursor#0 = print_line_cursor#9 + $28 [ print_char_cursor#28 print_line_cursor#0 ] ( main:3::end:22::print_ln:51 [ print_char_cursor#28 print_line_cursor#0 ] { }  ) always clobbers reg byte a 
Statement [65] if(print_line_cursor#0<print_char_cursor#28) goto print_ln::@1 [ print_char_cursor#28 print_line_cursor#0 ] ( main:3::end:22::print_ln:51 [ print_char_cursor#28 print_line_cursor#0 ] { }  ) always clobbers reg byte a 
Statement [68] print_uchar::$0 = print_uchar::b#2 >> 4 [ print_char_cursor#28 print_uchar::b#2 print_uchar::$0 ] ( main:3::end:22::print_uint:49::print_uchar:58 [ print_uint::w#0 print_char_cursor#28 print_uchar::b#2 print_uchar::$0 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#0 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#28 } }  main:3::end:22::print_uint:49::print_uchar:60 [ print_char_cursor#28 print_uchar::b#2 print_uchar::$0 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#1 = print_uchar::b#2 } { print_char::ch#0 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#28 } }  ) always clobbers reg byte a 
Statement [71] print_uchar::$2 = print_uchar::b#2 & $f [ print_char_cursor#28 print_uchar::$2 ] ( main:3::end:22::print_uint:49::print_uchar:58 [ print_uint::w#0 print_char_cursor#28 print_uchar::$2 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#1 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#28 } }  main:3::end:22::print_uint:49::print_uchar:60 [ print_char_cursor#28 print_uchar::$2 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#1 = print_uchar::b#2 } { print_char::ch#1 = print_char::ch#3 } { print_char_cursor#27 = print_char_cursor#28 } }  ) always clobbers reg byte a 
Potential registers zp[1]:36 [ main::c#7 main::c#1 ] : zp[1]:36 , reg byte x , 
Potential registers zp[2]:26 [ main::i#2 main::i#1 ] : zp[2]:26 , 
Potential registers zp[2]:11 [ free_#24 free_#14 ] : zp[2]:11 , 
Potential registers zp[2]:24 [ root#22 root#12 ] : zp[2]:24 , 
Potential registers zp[2]:2 [ sum::current#3 sum::current#1 sum::current#2 ] : zp[2]:2 , 
Potential registers zp[2]:7 [ sum::s#3 sum::s#2 ] : zp[2]:7 , 
Potential registers zp[1]:6 [ print_char::ch#3 print_char::ch#2 print_char::ch#0 print_char::ch#1 ] : zp[1]:6 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:9 [ print_char_cursor#27 print_char_cursor#48 print_char_cursor#28 ] : zp[2]:9 , 
Potential registers zp[2]:13 [ print_line_cursor#9 print_line_cursor#0 ] : zp[2]:13 , 
Potential registers zp[1]:21 [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ] : zp[1]:21 , reg byte x , 
Potential registers zp[2]:41 [ last_time ] : zp[2]:41 , 
Potential registers zp[2]:28 [ prepend::x#0 ] : zp[2]:28 , 
Potential registers zp[2]:32 [ sum::return#2 ] : zp[2]:32 , 
Potential registers zp[2]:37 [ main::$5 ] : zp[2]:37 , 
Potential registers zp[2]:17 [ alloc::return#2 ] : zp[2]:17 , 
Potential registers zp[2]:22 [ prepend::new#1 ] : zp[2]:22 , 
Potential registers zp[2]:39 [ Ticks#0 ] : zp[2]:39 , 
Potential registers zp[2]:34 [ Ticks#1 ] : zp[2]:34 , 
Potential registers zp[2]:30 [ print_uint::w#0 ] : zp[2]:30 , 
Potential registers zp[2]:4 [ alloc::$1 ] : zp[2]:4 , 
Potential registers zp[2]:15 [ alloc::return#0 ] : zp[2]:15 , 
Potential registers zp[1]:19 [ print_uchar::$0 ] : zp[1]:19 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:20 [ print_uchar::$2 ] : zp[1]:20 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [sum] 269,005: zp[2]:2 [ sum::current#3 sum::current#1 sum::current#2 ] 150,026.75: zp[2]:7 [ sum::s#3 sum::s#2 ] 202: zp[2]:32 [ sum::return#2 ] 
Uplift Scope [alloc] 200,002: zp[2]:4 [ alloc::$1 ] 27,500.5: zp[2]:15 [ alloc::return#0 ] 20,002: zp[2]:17 [ alloc::return#2 ] 
Uplift Scope [] 114,407.7: zp[2]:9 [ print_char_cursor#27 print_char_cursor#48 print_char_cursor#28 ] 48,617.43: zp[2]:11 [ free_#24 free_#14 ] 35,003.5: zp[2]:13 [ print_line_cursor#9 print_line_cursor#0 ] 3,834.17: zp[2]:24 [ root#22 root#12 ] 202: zp[2]:34 [ Ticks#1 ] 101: zp[2]:39 [ Ticks#0 ] 18.45: zp[2]:41 [ last_time ] 
Uplift Scope [print_char] 160,310: zp[1]:6 [ print_char::ch#3 print_char::ch#2 print_char::ch#0 print_char::ch#1 ] 
Uplift Scope [print_uchar] 20,002: zp[1]:19 [ print_uchar::$0 ] 20,002: zp[1]:20 [ print_uchar::$2 ] 9,505: zp[1]:21 [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ] 
Uplift Scope [prepend] 6,667.33: zp[2]:22 [ prepend::new#1 ] 1,833.67: zp[2]:28 [ prepend::x#0 ] 
Uplift Scope [main] 2,502.5: zp[2]:26 [ main::i#2 main::i#1 ] 168.33: zp[1]:36 [ main::c#7 main::c#1 ] 101: zp[2]:37 [ main::$5 ] 
Uplift Scope [print_uint] 701: zp[2]:30 [ print_uint::w#0 ] 
Uplift Scope [print_ln] 
Uplift Scope [RADIX] 
Uplift Scope [MOS6526_CIA] 
Uplift Scope [MOS6569_VICII] 
Uplift Scope [MOS6581_SID] 
Uplift Scope [start] 
Uplift Scope [end] 
Uplift Scope [node] 
Uplift Scope [__start] 

Uplifting [sum] best 18498 combination zp[2]:2 [ sum::current#3 sum::current#1 sum::current#2 ] zp[2]:7 [ sum::s#3 sum::s#2 ] zp[2]:32 [ sum::return#2 ] 
Uplifting [alloc] best 18498 combination zp[2]:4 [ alloc::$1 ] zp[2]:15 [ alloc::return#0 ] zp[2]:17 [ alloc::return#2 ] 
Uplifting [] best 18498 combination zp[2]:9 [ print_char_cursor#27 print_char_cursor#48 print_char_cursor#28 ] zp[2]:11 [ free_#24 free_#14 ] zp[2]:13 [ print_line_cursor#9 print_line_cursor#0 ] zp[2]:24 [ root#22 root#12 ] zp[2]:34 [ Ticks#1 ] zp[2]:39 [ Ticks#0 ] zp[2]:41 [ last_time ] 
Uplifting [print_char] best 18459 combination reg byte a [ print_char::ch#3 print_char::ch#2 print_char::ch#0 print_char::ch#1 ] 
Uplifting [print_uchar] best 18441 combination reg byte a [ print_uchar::$0 ] reg byte x [ print_uchar::$2 ] reg byte x [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ] 
Uplifting [prepend] best 18441 combination zp[2]:22 [ prepend::new#1 ] zp[2]:28 [ prepend::x#0 ] 
Uplifting [main] best 18351 combination zp[2]:26 [ main::i#2 main::i#1 ] reg byte x [ main::c#7 main::c#1 ] zp[2]:37 [ main::$5 ] 
Uplifting [print_uint] best 18351 combination zp[2]:30 [ print_uint::w#0 ] 
Uplifting [print_ln] best 18351 combination 
Uplifting [RADIX] best 18351 combination 
Uplifting [MOS6526_CIA] best 18351 combination 
Uplifting [MOS6569_VICII] best 18351 combination 
Uplifting [MOS6581_SID] best 18351 combination 
Uplifting [start] best 18351 combination 
Uplifting [end] best 18351 combination 
Uplifting [node] best 18351 combination 
Uplifting [__start] best 18351 combination 
Coalescing zero page register [ zp[2]:26 [ main::i#2 main::i#1 ] ] with [ zp[2]:28 [ prepend::x#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:24 [ root#22 root#12 ] ] with [ zp[2]:2 [ sum::current#3 sum::current#1 sum::current#2 ] ] - score: 1
Coalescing zero page register [ zp[2]:7 [ sum::s#3 sum::s#2 ] ] with [ zp[2]:32 [ sum::return#2 ] ] - score: 1
Coalescing zero page register [ zp[2]:17 [ alloc::return#2 ] ] with [ zp[2]:22 [ prepend::new#1 ] ] - score: 1
Coalescing zero page register [ zp[2]:17 [ alloc::return#2 prepend::new#1 ] ] with [ zp[2]:15 [ alloc::return#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:34 [ Ticks#1 ] ] with [ zp[2]:30 [ print_uint::w#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:7 [ sum::s#3 sum::s#2 sum::return#2 ] ] with [ zp[2]:37 [ main::$5 ] ] - score: 1
Coalescing zero page register [ zp[2]:17 [ alloc::return#2 prepend::new#1 alloc::return#0 ] ] with [ zp[2]:4 [ alloc::$1 ] ] - score: 1
Coalescing zero page register [ zp[2]:7 [ sum::s#3 sum::s#2 sum::return#2 main::$5 ] ] with [ zp[2]:11 [ free_#24 free_#14 ] ]
Coalescing zero page register [ zp[2]:13 [ print_line_cursor#9 print_line_cursor#0 ] ] with [ zp[2]:26 [ main::i#2 main::i#1 prepend::x#0 ] ]
Coalescing zero page register [ zp[2]:39 [ Ticks#0 ] ] with [ zp[2]:17 [ alloc::return#2 prepend::new#1 alloc::return#0 alloc::$1 ] ]
Allocated (was zp[2]:24) zp[2]:2 [ root#22 root#12 sum::current#3 sum::current#1 sum::current#2 ]
Allocated (was zp[2]:39) zp[2]:4 [ Ticks#0 alloc::return#2 prepend::new#1 alloc::return#0 alloc::$1 ]
Allocated (was zp[2]:7) zp[2]:6 [ sum::s#3 sum::s#2 sum::return#2 main::$5 free_#24 free_#14 ]
Allocated (was zp[2]:9) zp[2]:8 [ print_char_cursor#27 print_char_cursor#48 print_char_cursor#28 ]
Allocated (was zp[2]:13) zp[2]:10 [ print_line_cursor#9 print_line_cursor#0 main::i#2 main::i#1 prepend::x#0 ]
Allocated (was zp[2]:34) zp[2]:12 [ Ticks#1 print_uint::w#0 ]
Allocated (was zp[2]:41) zp[2]:14 [ last_time ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
/// @file
/// A lightweight library for printing on the C64.
///
/// Printing with this library is done by calling print_ function for each element
  // Upstart
  // Commodore 64 PRG executable file
.file [name="linkedlist-kc.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(__start)
  // Global Constants & labels
  .const OFFSET_STRUCT_NODE_VALUE = 2
  .label print_screen = $400
  .label last_time = $e
  .label print_line_cursor = $a
  .label Ticks = 4
  .label Ticks_1 = $c
  .label print_char_cursor = 8
  .label free_ = 6
  .label root = 2
.segment Code
  // __start
__start: {
    jmp __init1
    // __start::__init1
  __init1:
    // [1] last_time = 0 -- vwuz1=vwuc1 
    lda #<0
    sta.z last_time
    lda #>0
    sta.z last_time+1
    // [2] phi from __start::__init1 to __start::@1 [phi:__start::__init1->__start::@1]
  __b1_from___init1:
    jmp __b1
    // __start::@1
  __b1:
    // [3] call main
    // [5] phi from __start::@1 to main [phi:__start::@1->main]
  main_from___b1:
    jsr main
    jmp __breturn
    // __start::@return
  __breturn:
    // [4] return 
    rts
}
  // main
main: {
    .label __5 = 6
    .label i = $a
    // [6] call start
    jsr start
    // [7] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [7] phi main::c#7 = 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 
    ldx #0
    // [7] phi print_char_cursor#48 = print_screen#0 [phi:main->main::@1#1] -- pbuz1=pbuc1 
    lda #<print_screen
    sta.z print_char_cursor
    lda #>print_screen
    sta.z print_char_cursor+1
    jmp __b1
    // [7] phi from main::@7 to main::@1 [phi:main::@7->main::@1]
  __b1_from___b7:
    // [7] phi main::c#7 = main::c#1 [phi:main::@7->main::@1#0] -- register_copy 
    // [7] phi print_char_cursor#48 = print_char_cursor#28 [phi:main::@7->main::@1#1] -- register_copy 
    jmp __b1
    // main::@1
  __b1:
    // [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  __b2_from___b1:
    // [8] phi root#22 = (struct node *)(void *) 0 [phi:main::@1->main::@2#0] -- pssz1=pssc1 
    lda #<0
    sta.z root
    lda #>0
    sta.z root+1
    // [8] phi free_#24 = 0 [phi:main::@1->main::@2#1] -- vwuz1=vbuc1 
    lda #<0
    sta.z free_
    lda #>0
    sta.z free_+1
    // [8] phi main::i#2 = 0 [phi:main::@1->main::@2#2] -- vwuz1=vwuc1 
    lda #<0
    sta.z i
    lda #>0
    sta.z i+1
    jmp __b2
    // [8] phi from main::@5 to main::@2 [phi:main::@5->main::@2]
  __b2_from___b5:
    // [8] phi root#22 = root#12 [phi:main::@5->main::@2#0] -- register_copy 
    // [8] phi free_#24 = free_#14 [phi:main::@5->main::@2#1] -- register_copy 
    // [8] phi main::i#2 = main::i#1 [phi:main::@5->main::@2#2] -- register_copy 
    jmp __b2
    // main::@2
  __b2:
    // [9] prepend::x#0 = main::i#2
    // [10] call prepend
    // [26] phi from main::@2 to prepend [phi:main::@2->prepend]
  prepend_from___b2:
    jsr prepend
    jmp __b5
    // main::@5
  __b5:
    // [11] main::i#1 = ++ main::i#2 -- vwuz1=_inc_vwuz1 
    inc.z i
    bne !+
    inc.z i+1
  !:
    // [12] if(main::i#1!=$bb8) goto main::@2 -- vwuz1_neq_vwuc1_then_la1 
    lda.z i+1
    cmp #>$bb8
    bne __b2_from___b5
    lda.z i
    cmp #<$bb8
    bne __b2_from___b5
    // [13] phi from main::@5 to main::@3 [phi:main::@5->main::@3]
  __b3_from___b5:
    jmp __b3
    // main::@3
  __b3:
    // [14] call sum
    jsr sum
    // [15] sum::return#2 = sum::s#3
    jmp __b6
    // main::@6
  __b6:
    // [16] main::$5 = sum::return#2
    // [17] print_char::ch#2 = (char)main::$5 -- vbuaa=_byte_vwuz1 
    lda.z __5
    // [18] call print_char
    // [40] phi from main::@6 to print_char [phi:main::@6->print_char]
  print_char_from___b6:
    // [40] phi print_char_cursor#27 = print_char_cursor#48 [phi:main::@6->print_char#0] -- register_copy 
    // [40] phi print_char::ch#3 = print_char::ch#2 [phi:main::@6->print_char#1] -- register_copy 
    jsr print_char
    jmp __b7
    // main::@7
  __b7:
    // [19] main::c#1 = ++ main::c#7 -- vbuxx=_inc_vbuxx 
    inx
    // [20] if(main::c#1!=5) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #5
    bne __b1_from___b7
    // [21] phi from main::@7 to main::@4 [phi:main::@7->main::@4]
  __b4_from___b7:
    jmp __b4
    // main::@4
  __b4:
    // [22] call end
    jsr end
    jmp __breturn
    // main::@return
  __breturn:
    // [23] return 
    rts
}
  // start
start: {
    .label LAST_TIME = last_time
    // asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1  }
    jsr $ffde
    sta LAST_TIME
    stx LAST_TIME+1
    jmp __breturn
    // start::@return
  __breturn:
    // [25] return 
    rts
}
  // prepend
// void prepend(__zp($a) unsigned int x)
prepend: {
    .label new = 4
    .label x = $a
    // [27] call alloc
    jsr alloc
    // [28] alloc::return#2 = alloc::return#0
    jmp __b1
    // prepend::@1
  __b1:
    // [29] prepend::new#1 = alloc::return#2
    // [30] *((struct node **)prepend::new#1) = root#22 -- _deref_qssz1=pssz2 
    ldy #0
    lda.z root
    sta (new),y
    iny
    lda.z root+1
    sta (new),y
    // [31] ((unsigned int *)prepend::new#1)[OFFSET_STRUCT_NODE_VALUE] = prepend::x#0 -- pwuz1_derefidx_vbuc1=vwuz2 
    ldy #OFFSET_STRUCT_NODE_VALUE
    lda.z x
    sta (new),y
    iny
    lda.z x+1
    sta (new),y
    // [32] root#12 = prepend::new#1 -- pssz1=pssz2 
    lda.z new
    sta.z root
    lda.z new+1
    sta.z root+1
    jmp __breturn
    // prepend::@return
  __breturn:
    // [33] return 
    rts
}
  // sum
sum: {
    .label current = 2
    .label s = 6
    .label return = 6
    // [34] sum::current#1 = root#12
    // [35] phi from sum to sum::@1 [phi:sum->sum::@1]
  __b1_from_sum:
    // [35] phi sum::s#3 = 0 [phi:sum->sum::@1#0] -- vwuz1=vbuc1 
    lda #<0
    sta.z s
    lda #>0
    sta.z s+1
    // [35] phi sum::current#3 = sum::current#1 [phi:sum->sum::@1#1] -- register_copy 
    jmp __b1
    // sum::@1
  __b1:
    // [36] if((struct node *)0!=sum::current#3) goto sum::@2 -- pssc1_neq_pssz1_then_la1 
    lda.z current+1
    cmp #>0
    bne __b2
    lda.z current
    cmp #<0
    bne __b2
    jmp __breturn
    // sum::@return
  __breturn:
    // [37] return 
    rts
    // sum::@2
  __b2:
    // [38] sum::s#2 = sum::s#3 + ((unsigned int *)sum::current#3)[OFFSET_STRUCT_NODE_VALUE] -- vwuz1=vwuz1_plus_pwuz2_derefidx_vbuc1 
    ldy #OFFSET_STRUCT_NODE_VALUE
    clc
    lda.z s
    adc (current),y
    sta.z s
    iny
    lda.z s+1
    adc (current),y
    sta.z s+1
    // [39] sum::current#2 = *((struct node **)sum::current#3) -- pssz1=_deref_qssz1 
    ldy #0
    lda (current),y
    pha
    iny
    lda (current),y
    sta.z current+1
    pla
    sta.z current
    // [35] phi from sum::@2 to sum::@1 [phi:sum::@2->sum::@1]
  __b1_from___b2:
    // [35] phi sum::s#3 = sum::s#2 [phi:sum::@2->sum::@1#0] -- register_copy 
    // [35] phi sum::current#3 = sum::current#2 [phi:sum::@2->sum::@1#1] -- register_copy 
    jmp __b1
}
  // print_char
// Print a single char
// void print_char(__register(A) char ch)
print_char: {
    // [41] *print_char_cursor#27 = print_char::ch#3 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (print_char_cursor),y
    // [42] print_char_cursor#28 = ++ print_char_cursor#27 -- pbuz1=_inc_pbuz1 
    inc.z print_char_cursor
    bne !+
    inc.z print_char_cursor+1
  !:
    jmp __breturn
    // print_char::@return
  __breturn:
    // [43] return 
    rts
}
  // end
end: {
    // [44] Ticks#0 = last_time -- vwuz1=vwuz2 
    lda.z last_time
    sta.z Ticks
    lda.z last_time+1
    sta.z Ticks+1
    // [45] call start
    jsr start
    jmp __b1
    // end::@1
  __b1:
    // [46] last_time = last_time - Ticks#0 -- vwuz1=vwuz1_minus_vwuz2 
    lda.z last_time
    sec
    sbc.z Ticks
    sta.z last_time
    lda.z last_time+1
    sbc.z Ticks+1
    sta.z last_time+1
    // [47] Ticks#1 = last_time -- vwuz1=vwuz2 
    lda.z last_time
    sta.z Ticks_1
    lda.z last_time+1
    sta.z Ticks_1+1
    // [48] print_uint::w#0 = Ticks#1
    // [49] call print_uint
    jsr print_uint
    // [50] phi from end::@1 to end::@2 [phi:end::@1->end::@2]
  __b2_from___b1:
    jmp __b2
    // end::@2
  __b2:
    // [51] call print_ln
    // [62] phi from end::@2 to print_ln [phi:end::@2->print_ln]
  print_ln_from___b2:
    jsr print_ln
    jmp __breturn
    // end::@return
  __breturn:
    // [52] return 
    rts
}
  // alloc
alloc: {
    .label __1 = 4
    .label return = 4
    // [53] alloc::$1 = free_#24 << 2 -- vwuz1=vwuz2_rol_2 
    lda.z free_
    asl
    sta.z __1
    lda.z free_+1
    rol
    sta.z __1+1
    asl.z __1
    rol.z __1+1
    // [54] alloc::return#0 = heap + alloc::$1 -- pssz1=pssc1_plus_vwuz1 
    lda.z return
    clc
    adc #<heap
    sta.z return
    lda.z return+1
    adc #>heap
    sta.z return+1
    // [55] free_#14 = ++ free_#24 -- vwuz1=_inc_vwuz1 
    inc.z free_
    bne !+
    inc.z free_+1
  !:
    jmp __breturn
    // alloc::@return
  __breturn:
    // [56] return 
    rts
}
  // print_uint
// Print a unsigned int as HEX
// void print_uint(__zp($c) unsigned int w)
print_uint: {
    .label w = $c
    // [57] print_uchar::b#0 = byte1  print_uint::w#0 -- vbuxx=_byte1_vwuz1 
    ldx.z w+1
    // [58] call print_uchar
    // [67] phi from print_uint to print_uchar [phi:print_uint->print_uchar]
  print_uchar_from_print_uint:
    // [67] phi print_uchar::b#2 = print_uchar::b#0 [phi:print_uint->print_uchar#0] -- register_copy 
    jsr print_uchar
    jmp __b1
    // print_uint::@1
  __b1:
    // [59] print_uchar::b#1 = byte0  print_uint::w#0 -- vbuxx=_byte0_vwuz1 
    ldx.z w
    // [60] call print_uchar
    // [67] phi from print_uint::@1 to print_uchar [phi:print_uint::@1->print_uchar]
  print_uchar_from___b1:
    // [67] phi print_uchar::b#2 = print_uchar::b#1 [phi:print_uint::@1->print_uchar#0] -- register_copy 
    jsr print_uchar
    jmp __breturn
    // print_uint::@return
  __breturn:
    // [61] return 
    rts
}
  // print_ln
// Print a newline
print_ln: {
    // [63] phi from print_ln to print_ln::@1 [phi:print_ln->print_ln::@1]
  __b1_from_print_ln:
    // [63] phi print_line_cursor#9 = print_screen#0 [phi:print_ln->print_ln::@1#0] -- pbuz1=pbuc1 
    lda #<print_screen
    sta.z print_line_cursor
    lda #>print_screen
    sta.z print_line_cursor+1
    jmp __b1
    // [63] phi from print_ln::@1 to print_ln::@1 [phi:print_ln::@1->print_ln::@1]
  __b1_from___b1:
    // [63] phi print_line_cursor#9 = print_line_cursor#0 [phi:print_ln::@1->print_ln::@1#0] -- register_copy 
    jmp __b1
    // print_ln::@1
  __b1:
    // [64] print_line_cursor#0 = print_line_cursor#9 + $28 -- pbuz1=pbuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z print_line_cursor
    sta.z print_line_cursor
    bcc !+
    inc.z print_line_cursor+1
  !:
    // [65] if(print_line_cursor#0<print_char_cursor#28) goto print_ln::@1 -- pbuz1_lt_pbuz2_then_la1 
    lda.z print_line_cursor+1
    cmp.z print_char_cursor+1
    bcc __b1_from___b1
    bne !+
    lda.z print_line_cursor
    cmp.z print_char_cursor
    bcc __b1_from___b1
  !:
    jmp __breturn
    // print_ln::@return
  __breturn:
    // [66] return 
    rts
}
  // print_uchar
// Print a char as HEX
// void print_uchar(__register(X) char b)
print_uchar: {
    // [68] print_uchar::$0 = print_uchar::b#2 >> 4 -- vbuaa=vbuxx_ror_4 
    txa
    lsr
    lsr
    lsr
    lsr
    // [69] print_char::ch#0 = print_hextab[print_uchar::$0] -- vbuaa=pbuc1_derefidx_vbuaa 
    tay
    lda print_hextab,y
    // [70] call print_char
  // Table of hexadecimal digits
    // [40] phi from print_uchar to print_char [phi:print_uchar->print_char]
  print_char_from_print_uchar:
    // [40] phi print_char_cursor#27 = print_char_cursor#28 [phi:print_uchar->print_char#0] -- register_copy 
    // [40] phi print_char::ch#3 = print_char::ch#0 [phi:print_uchar->print_char#1] -- register_copy 
    jsr print_char
    jmp __b1
    // print_uchar::@1
  __b1:
    // [71] print_uchar::$2 = print_uchar::b#2 & $f -- vbuxx=vbuxx_band_vbuc1 
    lda #$f
    axs #0
    // [72] print_char::ch#1 = print_hextab[print_uchar::$2] -- vbuaa=pbuc1_derefidx_vbuxx 
    lda print_hextab,x
    // [73] call print_char
    // [40] phi from print_uchar::@1 to print_char [phi:print_uchar::@1->print_char]
  print_char_from___b1:
    // [40] phi print_char_cursor#27 = print_char_cursor#28 [phi:print_uchar::@1->print_char#0] -- register_copy 
    // [40] phi print_char::ch#3 = print_char::ch#1 [phi:print_uchar::@1->print_char#1] -- register_copy 
    jsr print_char
    jmp __breturn
    // print_uchar::@return
  __breturn:
    // [74] return 
    rts
}
  // File Data
.segment Data
  print_hextab: .text "0123456789abcdef"
  heap: .fill 4*$fa0, 0

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __init1
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b5
Removing instruction jmp __b3
Removing instruction jmp __b6
Removing instruction jmp __b7
Removing instruction jmp __b4
Removing instruction jmp __breturn
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __breturn
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #>0
Removing instruction lda #>0
Removing instruction lda #<0
Removing instruction lda #>0
Removing instruction lda #<0
Removing instruction lda #>0
Removing instruction lda #>0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label __b2_from___b5 with __b2
Replacing label __b2_from___b5 with __b2
Replacing label __b1_from___b7 with __b1
Replacing label __b1_from___b1 with __b1
Replacing label __b1_from___b1 with __b1
Removing instruction __b1_from___init1:
Removing instruction main_from___b1:
Removing instruction __b1_from___b7:
Removing instruction __b2_from___b1:
Removing instruction __b2_from___b5:
Removing instruction prepend_from___b2:
Removing instruction __b3_from___b5:
Removing instruction __b4_from___b7:
Removing instruction __b2_from___b1:
Removing instruction print_ln_from___b2:
Removing instruction __b1_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __init1:
Removing instruction __b1:
Removing instruction __breturn:
Removing instruction __b1_from_main:
Removing instruction __b5:
Removing instruction __b3:
Removing instruction __b6:
Removing instruction print_char_from___b6:
Removing instruction __b7:
Removing instruction __b4:
Removing instruction __breturn:
Removing instruction __breturn:
Removing instruction __b1:
Removing instruction __breturn:
Removing instruction __b1_from_sum:
Removing instruction __breturn:
Removing instruction __b1_from___b2:
Removing instruction __breturn:
Removing instruction __b1:
Removing instruction __b2:
Removing instruction __breturn:
Removing instruction __breturn:
Removing instruction print_uchar_from_print_uint:
Removing instruction __b1:
Removing instruction print_uchar_from___b1:
Removing instruction __breturn:
Removing instruction __b1_from_print_ln:
Removing instruction __breturn:
Removing instruction print_char_from_print_uchar:
Removing instruction __b1:
Removing instruction print_char_from___b1:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination

FINAL SYMBOL TABLE
__constant char OFFSET_STRUCT_NODE_VALUE = 2
__constant char RADIX::BINARY = 2
__constant char RADIX::DECIMAL = $a
__constant char RADIX::HEXADECIMAL = $10
__constant char RADIX::OCTAL = 8
unsigned int Ticks
unsigned int Ticks#0 // Ticks zp[2]:4 101.0
unsigned int Ticks#1 // Ticks_1 zp[2]:12 202.0
void __start()
struct node * alloc()
unsigned int alloc::$1 // zp[2]:4 200002.0
struct node *alloc::result
struct node *alloc::return
struct node *alloc::return#0 // return zp[2]:4 27500.5
struct node *alloc::return#2 // return zp[2]:4 20002.0
void end()
unsigned int free_
unsigned int free_#14 // free_ zp[2]:6 8416.833333333332
unsigned int free_#24 // free_ zp[2]:6 40200.600000000006
__constant struct node heap[$fa0] = { fill( $fa0, 0) }
__loadstore volatile unsigned int last_time // zp[2]:14 18.454545454545453
void main()
unsigned int main::$5 // zp[2]:6 101.0
char main::c
char main::c#1 // reg byte x 151.5
char main::c#7 // reg byte x 16.833333333333332
unsigned int main::i
unsigned int main::i#1 // i zp[2]:10 1501.5
unsigned int main::i#2 // i zp[2]:10 1001.0
void prepend(unsigned int x)
struct node *prepend::new
struct node *prepend::new#1 // new zp[2]:4 6667.333333333333
unsigned int prepend::x
unsigned int prepend::x#0 // x zp[2]:10 1833.6666666666665
void print_char(char ch)
char print_char::ch
char print_char::ch#0 // reg byte a 20002.0
char print_char::ch#1 // reg byte a 20002.0
char print_char::ch#2 // reg byte a 202.0
char print_char::ch#3 // reg byte a 120104.0
char *print_char_cursor
char *print_char_cursor#27 // print_char_cursor zp[2]:8 110052.5
char *print_char_cursor#28 // print_char_cursor zp[2]:8 4336.833333333333
char *print_char_cursor#48 // print_char_cursor zp[2]:8 18.363636363636363
__constant const char print_hextab[] = "0123456789abcdef"z
char *print_line_cursor
char *print_line_cursor#0 // print_line_cursor zp[2]:10 15001.5
char *print_line_cursor#9 // print_line_cursor zp[2]:10 20002.0
void print_ln()
char *print_screen
__constant char *print_screen#0 = (char *) 1024 // print_screen
void print_uchar(char b)
char print_uchar::$0 // reg byte a 20002.0
char print_uchar::$2 // reg byte x 20002.0
char print_uchar::b
char print_uchar::b#0 // reg byte x 2002.0
char print_uchar::b#1 // reg byte x 2002.0
char print_uchar::b#2 // reg byte x 5501.0
void print_uint(unsigned int w)
unsigned int print_uint::w
unsigned int print_uint::w#0 // w zp[2]:12 701.0
struct node *root
struct node *root#12 // root zp[2]:2 2000.4999999999998
struct node *root#22 // root zp[2]:2 1833.6666666666665
void start()
__constant unsigned int * const start::LAST_TIME = &last_time
unsigned int sum()
struct node *sum::current
struct node *sum::current#1 // current zp[2]:2 2002.0
struct node *sum::current#2 // current zp[2]:2 200002.0
struct node *sum::current#3 // current zp[2]:2 67001.0
unsigned int sum::return
unsigned int sum::return#2 // return zp[2]:6 202.0
unsigned int sum::s
unsigned int sum::s#2 // s zp[2]:6 100001.0
unsigned int sum::s#3 // s zp[2]:6 50025.75

reg byte x [ main::c#7 main::c#1 ]
zp[2]:2 [ root#22 root#12 sum::current#3 sum::current#1 sum::current#2 ]
zp[2]:6 [ sum::s#3 sum::s#2 sum::return#2 main::$5 free_#24 free_#14 ]
reg byte a [ print_char::ch#3 print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
zp[2]:8 [ print_char_cursor#27 print_char_cursor#48 print_char_cursor#28 ]
zp[2]:10 [ print_line_cursor#9 print_line_cursor#0 main::i#2 main::i#1 prepend::x#0 ]
reg byte x [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ]
zp[2]:14 [ last_time ]
zp[2]:4 [ Ticks#0 alloc::return#2 prepend::new#1 alloc::return#0 alloc::$1 ]
zp[2]:12 [ Ticks#1 print_uint::w#0 ]
reg byte a [ print_uchar::$0 ]
reg byte x [ print_uchar::$2 ]


FINAL ASSEMBLER
Score: 14167

  // File Comments
/// @file
/// A lightweight library for printing on the C64.
///
/// Printing with this library is done by calling print_ function for each element
  // Upstart
  // Commodore 64 PRG executable file
.file [name="linkedlist-kc.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(__start)
  // Global Constants & labels
  .const OFFSET_STRUCT_NODE_VALUE = 2
  .label print_screen = $400
  .label last_time = $e
  .label print_line_cursor = $a
  .label Ticks = 4
  .label Ticks_1 = $c
  .label print_char_cursor = 8
  .label free_ = 6
  .label root = 2
.segment Code
  // __start
__start: {
    // __start::__init1
    // unsigned int last_time
    // [1] last_time = 0 -- vwuz1=vwuc1 
    lda #<0
    sta.z last_time
    sta.z last_time+1
    // [2] phi from __start::__init1 to __start::@1 [phi:__start::__init1->__start::@1]
    // __start::@1
    // [3] call main
    // [5] phi from __start::@1 to main [phi:__start::@1->main]
    jsr main
    // __start::@return
    // [4] return 
    rts
}
  // main
main: {
    .label __5 = 6
    .label i = $a
    // start()
    // [6] call start
    jsr start
    // [7] phi from main to main::@1 [phi:main->main::@1]
    // [7] phi main::c#7 = 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 
    ldx #0
    // [7] phi print_char_cursor#48 = print_screen#0 [phi:main->main::@1#1] -- pbuz1=pbuc1 
    lda #<print_screen
    sta.z print_char_cursor
    lda #>print_screen
    sta.z print_char_cursor+1
    // [7] phi from main::@7 to main::@1 [phi:main::@7->main::@1]
    // [7] phi main::c#7 = main::c#1 [phi:main::@7->main::@1#0] -- register_copy 
    // [7] phi print_char_cursor#48 = print_char_cursor#28 [phi:main::@7->main::@1#1] -- register_copy 
    // main::@1
  __b1:
    // [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
    // [8] phi root#22 = (struct node *)(void *) 0 [phi:main::@1->main::@2#0] -- pssz1=pssc1 
    lda #<0
    sta.z root
    sta.z root+1
    // [8] phi free_#24 = 0 [phi:main::@1->main::@2#1] -- vwuz1=vbuc1 
    sta.z free_
    sta.z free_+1
    // [8] phi main::i#2 = 0 [phi:main::@1->main::@2#2] -- vwuz1=vwuc1 
    sta.z i
    sta.z i+1
    // [8] phi from main::@5 to main::@2 [phi:main::@5->main::@2]
    // [8] phi root#22 = root#12 [phi:main::@5->main::@2#0] -- register_copy 
    // [8] phi free_#24 = free_#14 [phi:main::@5->main::@2#1] -- register_copy 
    // [8] phi main::i#2 = main::i#1 [phi:main::@5->main::@2#2] -- register_copy 
    // main::@2
  __b2:
    // prepend(i)
    // [9] prepend::x#0 = main::i#2
    // [10] call prepend
    // [26] phi from main::@2 to prepend [phi:main::@2->prepend]
    jsr prepend
    // main::@5
    // for(unsigned int i : 0..2999)
    // [11] main::i#1 = ++ main::i#2 -- vwuz1=_inc_vwuz1 
    inc.z i
    bne !+
    inc.z i+1
  !:
    // [12] if(main::i#1!=$bb8) goto main::@2 -- vwuz1_neq_vwuc1_then_la1 
    lda.z i+1
    cmp #>$bb8
    bne __b2
    lda.z i
    cmp #<$bb8
    bne __b2
    // [13] phi from main::@5 to main::@3 [phi:main::@5->main::@3]
    // main::@3
    // sum()
    // [14] call sum
    jsr sum
    // [15] sum::return#2 = sum::s#3
    // main::@6
    // [16] main::$5 = sum::return#2
    // print_char((byte)sum())
    // [17] print_char::ch#2 = (char)main::$5 -- vbuaa=_byte_vwuz1 
    lda.z __5
    // [18] call print_char
    // [40] phi from main::@6 to print_char [phi:main::@6->print_char]
    // [40] phi print_char_cursor#27 = print_char_cursor#48 [phi:main::@6->print_char#0] -- register_copy 
    // [40] phi print_char::ch#3 = print_char::ch#2 [phi:main::@6->print_char#1] -- register_copy 
    jsr print_char
    // main::@7
    // for(unsigned char c : 0..4)
    // [19] main::c#1 = ++ main::c#7 -- vbuxx=_inc_vbuxx 
    inx
    // [20] if(main::c#1!=5) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #5
    bne __b1
    // [21] phi from main::@7 to main::@4 [phi:main::@7->main::@4]
    // main::@4
    // end()
    // [22] call end
    jsr end
    // main::@return
    // }
    // [23] return 
    rts
}
  // start
start: {
    .label LAST_TIME = last_time
    // asm
    // asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1  }
    jsr $ffde
    sta LAST_TIME
    stx LAST_TIME+1
    // start::@return
    // }
    // [25] return 
    rts
}
  // prepend
// void prepend(__zp($a) unsigned int x)
prepend: {
    .label new = 4
    .label x = $a
    // alloc()
    // [27] call alloc
    jsr alloc
    // [28] alloc::return#2 = alloc::return#0
    // prepend::@1
    // new = alloc()
    // [29] prepend::new#1 = alloc::return#2
    // new->next = root
    // [30] *((struct node **)prepend::new#1) = root#22 -- _deref_qssz1=pssz2 
    ldy #0
    lda.z root
    sta (new),y
    iny
    lda.z root+1
    sta (new),y
    // new->value = x
    // [31] ((unsigned int *)prepend::new#1)[OFFSET_STRUCT_NODE_VALUE] = prepend::x#0 -- pwuz1_derefidx_vbuc1=vwuz2 
    ldy #OFFSET_STRUCT_NODE_VALUE
    lda.z x
    sta (new),y
    iny
    lda.z x+1
    sta (new),y
    // root = new
    // [32] root#12 = prepend::new#1 -- pssz1=pssz2 
    lda.z new
    sta.z root
    lda.z new+1
    sta.z root+1
    // prepend::@return
    // }
    // [33] return 
    rts
}
  // sum
sum: {
    .label current = 2
    .label s = 6
    .label return = 6
    // current = root
    // [34] sum::current#1 = root#12
    // [35] phi from sum to sum::@1 [phi:sum->sum::@1]
    // [35] phi sum::s#3 = 0 [phi:sum->sum::@1#0] -- vwuz1=vbuc1 
    lda #<0
    sta.z s
    sta.z s+1
    // [35] phi sum::current#3 = sum::current#1 [phi:sum->sum::@1#1] -- register_copy 
    // sum::@1
  __b1:
    // while (current)
    // [36] if((struct node *)0!=sum::current#3) goto sum::@2 -- pssc1_neq_pssz1_then_la1 
    lda.z current+1
    cmp #>0
    bne __b2
    lda.z current
    cmp #<0
    bne __b2
    // sum::@return
    // }
    // [37] return 
    rts
    // sum::@2
  __b2:
    // s += current->value
    // [38] sum::s#2 = sum::s#3 + ((unsigned int *)sum::current#3)[OFFSET_STRUCT_NODE_VALUE] -- vwuz1=vwuz1_plus_pwuz2_derefidx_vbuc1 
    ldy #OFFSET_STRUCT_NODE_VALUE
    clc
    lda.z s
    adc (current),y
    sta.z s
    iny
    lda.z s+1
    adc (current),y
    sta.z s+1
    // current = current->next
    // [39] sum::current#2 = *((struct node **)sum::current#3) -- pssz1=_deref_qssz1 
    ldy #0
    lda (current),y
    pha
    iny
    lda (current),y
    sta.z current+1
    pla
    sta.z current
    // [35] phi from sum::@2 to sum::@1 [phi:sum::@2->sum::@1]
    // [35] phi sum::s#3 = sum::s#2 [phi:sum::@2->sum::@1#0] -- register_copy 
    // [35] phi sum::current#3 = sum::current#2 [phi:sum::@2->sum::@1#1] -- register_copy 
    jmp __b1
}
  // print_char
// Print a single char
// void print_char(__register(A) char ch)
print_char: {
    // *(print_char_cursor++) = ch
    // [41] *print_char_cursor#27 = print_char::ch#3 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (print_char_cursor),y
    // *(print_char_cursor++) = ch;
    // [42] print_char_cursor#28 = ++ print_char_cursor#27 -- pbuz1=_inc_pbuz1 
    inc.z print_char_cursor
    bne !+
    inc.z print_char_cursor+1
  !:
    // print_char::@return
    // }
    // [43] return 
    rts
}
  // end
end: {
    // Ticks = last_time
    // [44] Ticks#0 = last_time -- vwuz1=vwuz2 
    lda.z last_time
    sta.z Ticks
    lda.z last_time+1
    sta.z Ticks+1
    // start()
    // [45] call start
    jsr start
    // end::@1
    // last_time -= Ticks
    // [46] last_time = last_time - Ticks#0 -- vwuz1=vwuz1_minus_vwuz2 
    lda.z last_time
    sec
    sbc.z Ticks
    sta.z last_time
    lda.z last_time+1
    sbc.z Ticks+1
    sta.z last_time+1
    // Ticks = last_time
    // [47] Ticks#1 = last_time -- vwuz1=vwuz2 
    lda.z last_time
    sta.z Ticks_1
    lda.z last_time+1
    sta.z Ticks_1+1
    // print_uint(Ticks)
    // [48] print_uint::w#0 = Ticks#1
    // [49] call print_uint
    jsr print_uint
    // [50] phi from end::@1 to end::@2 [phi:end::@1->end::@2]
    // end::@2
    // print_ln()
    // [51] call print_ln
    // [62] phi from end::@2 to print_ln [phi:end::@2->print_ln]
    jsr print_ln
    // end::@return
    // }
    // [52] return 
    rts
}
  // alloc
alloc: {
    .label __1 = 4
    .label return = 4
    // heap + free_
    // [53] alloc::$1 = free_#24 << 2 -- vwuz1=vwuz2_rol_2 
    lda.z free_
    asl
    sta.z __1
    lda.z free_+1
    rol
    sta.z __1+1
    asl.z __1
    rol.z __1+1
    // [54] alloc::return#0 = heap + alloc::$1 -- pssz1=pssc1_plus_vwuz1 
    lda.z return
    clc
    adc #<heap
    sta.z return
    lda.z return+1
    adc #>heap
    sta.z return+1
    // free_++;
    // [55] free_#14 = ++ free_#24 -- vwuz1=_inc_vwuz1 
    inc.z free_
    bne !+
    inc.z free_+1
  !:
    // alloc::@return
    // }
    // [56] return 
    rts
}
  // print_uint
// Print a unsigned int as HEX
// void print_uint(__zp($c) unsigned int w)
print_uint: {
    .label w = $c
    // print_uchar(BYTE1(w))
    // [57] print_uchar::b#0 = byte1  print_uint::w#0 -- vbuxx=_byte1_vwuz1 
    ldx.z w+1
    // [58] call print_uchar
    // [67] phi from print_uint to print_uchar [phi:print_uint->print_uchar]
    // [67] phi print_uchar::b#2 = print_uchar::b#0 [phi:print_uint->print_uchar#0] -- register_copy 
    jsr print_uchar
    // print_uint::@1
    // print_uchar(BYTE0(w))
    // [59] print_uchar::b#1 = byte0  print_uint::w#0 -- vbuxx=_byte0_vwuz1 
    ldx.z w
    // [60] call print_uchar
    // [67] phi from print_uint::@1 to print_uchar [phi:print_uint::@1->print_uchar]
    // [67] phi print_uchar::b#2 = print_uchar::b#1 [phi:print_uint::@1->print_uchar#0] -- register_copy 
    jsr print_uchar
    // print_uint::@return
    // }
    // [61] return 
    rts
}
  // print_ln
// Print a newline
print_ln: {
    // [63] phi from print_ln to print_ln::@1 [phi:print_ln->print_ln::@1]
    // [63] phi print_line_cursor#9 = print_screen#0 [phi:print_ln->print_ln::@1#0] -- pbuz1=pbuc1 
    lda #<print_screen
    sta.z print_line_cursor
    lda #>print_screen
    sta.z print_line_cursor+1
    // [63] phi from print_ln::@1 to print_ln::@1 [phi:print_ln::@1->print_ln::@1]
    // [63] phi print_line_cursor#9 = print_line_cursor#0 [phi:print_ln::@1->print_ln::@1#0] -- register_copy 
    // print_ln::@1
  __b1:
    // print_line_cursor + $28
    // [64] print_line_cursor#0 = print_line_cursor#9 + $28 -- pbuz1=pbuz1_plus_vbuc1 
    lda #$28
    clc
    adc.z print_line_cursor
    sta.z print_line_cursor
    bcc !+
    inc.z print_line_cursor+1
  !:
    // while (print_line_cursor<print_char_cursor)
    // [65] if(print_line_cursor#0<print_char_cursor#28) goto print_ln::@1 -- pbuz1_lt_pbuz2_then_la1 
    lda.z print_line_cursor+1
    cmp.z print_char_cursor+1
    bcc __b1
    bne !+
    lda.z print_line_cursor
    cmp.z print_char_cursor
    bcc __b1
  !:
    // print_ln::@return
    // }
    // [66] return 
    rts
}
  // print_uchar
// Print a char as HEX
// void print_uchar(__register(X) char b)
print_uchar: {
    // b>>4
    // [68] print_uchar::$0 = print_uchar::b#2 >> 4 -- vbuaa=vbuxx_ror_4 
    txa
    lsr
    lsr
    lsr
    lsr
    // print_char(print_hextab[b>>4])
    // [69] print_char::ch#0 = print_hextab[print_uchar::$0] -- vbuaa=pbuc1_derefidx_vbuaa 
    tay
    lda print_hextab,y
    // [70] call print_char
  // Table of hexadecimal digits
    // [40] phi from print_uchar to print_char [phi:print_uchar->print_char]
    // [40] phi print_char_cursor#27 = print_char_cursor#28 [phi:print_uchar->print_char#0] -- register_copy 
    // [40] phi print_char::ch#3 = print_char::ch#0 [phi:print_uchar->print_char#1] -- register_copy 
    jsr print_char
    // print_uchar::@1
    // b&$f
    // [71] print_uchar::$2 = print_uchar::b#2 & $f -- vbuxx=vbuxx_band_vbuc1 
    lda #$f
    axs #0
    // print_char(print_hextab[b&$f])
    // [72] print_char::ch#1 = print_hextab[print_uchar::$2] -- vbuaa=pbuc1_derefidx_vbuxx 
    lda print_hextab,x
    // [73] call print_char
    // [40] phi from print_uchar::@1 to print_char [phi:print_uchar::@1->print_char]
    // [40] phi print_char_cursor#27 = print_char_cursor#28 [phi:print_uchar::@1->print_char#0] -- register_copy 
    // [40] phi print_char::ch#3 = print_char::ch#1 [phi:print_uchar::@1->print_char#1] -- register_copy 
    jsr print_char
    // print_uchar::@return
    // }
    // [74] return 
    rts
}
  // File Data
.segment Data
  print_hextab: .text "0123456789abcdef"
  heap: .fill 4*$fa0, 0

