Resolved forward reference rand_seed to (word) rand_seed
Fixing struct type size struct node to 4
Setting inferred volatile on symbol affected by address-of (word) last_time
Setting inferred volatile on symbol affected by address-of (word) rand_seed
Fixing pointer addition (word*~) bsearch16u::$7 ← (word*) bsearch16u::items + (byte~) bsearch16u::$6
Fixing pointer addition (word*~) bsearch16u::$15 ← (word*) bsearch16u::pivot + (number) 1
Fixing pointer addition (word*~) bsearch16u::$1 ← (word*) bsearch16u::items - (number) 1
Fixing pointer addition (struct node*~) alloc::$0 ← (const struct node*) heap + (word) free_
Fixing pointer array-indexing *((word*) utoa::digit_values + (byte) utoa::digit)
Fixing pointer array-indexing *((dword*) ultoa::digit_values + (byte) ultoa::digit)
Replacing struct member reference *((struct node*) prepend::new).next with member unwinding reference *((struct node**~) prepend::$1)
Replacing struct member reference *((struct node*) prepend::new).value with member unwinding reference *((word*~) prepend::$2)
Replacing struct member reference *((struct node*) sum::current).value with member unwinding reference *((word*~) sum::$0)
Replacing struct member reference *((struct node*) sum::current).next with member unwinding reference *((struct node**~) sum::$1)
Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src)
Warning! Adding boolean cast to non-boolean condition *((byte*) strlen::str)
Warning! Adding boolean cast to non-boolean condition *((byte*) print_str_lines::str)
Warning! Adding boolean cast to non-boolean condition (byte) print_str_lines::ch
Warning! Adding boolean cast to non-boolean condition *((byte*) print_str::str)
Warning! Adding boolean cast to non-boolean condition *((byte*) print_str_at::str)
Warning! Adding boolean cast to non-boolean condition (struct node*) sum::current
Warning! Adding boolean cast to non-boolean sub-expression (byte) print_str_lines::ch
Identified constant variable (byte*) HEAP_TOP
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx 
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) @4
Culled Empty Block (label) @5
Culled Empty Block (label) @6
Culled Empty Block (label) @7
Culled Empty Block (label) @8
Culled Empty Block (label) @9
Culled Empty Block (label) @10
Culled Empty Block (label) @11
Culled Empty Block (label) @12
Culled Empty Block (label) @14
Culled Empty Block (label) @15
Culled Empty Block (label) @16
Culled Empty Block (label) @17
Culled Empty Block (label) @18
Culled Empty Block (label) @19
Culled Empty Block (label) @20
Culled Empty Block (label) @21
Culled Empty Block (label) @22
Culled Empty Block (label) @23
Culled Empty Block (label) @24
Culled Empty Block (label) @25
Culled Empty Block (label) @26
Culled Empty Block (label) @27
Culled Empty Block (label) @28
Culled Empty Block (label) @29
Culled Empty Block (label) @30
Culled Empty Block (label) @31
Culled Empty Block (label) @32
Culled Empty Block (label) @33
Culled Empty Block (label) @34
Culled Empty Block (label) @35
Culled Empty Block (label) @36
Culled Empty Block (label) @37
Culled Empty Block (label) @38
Culled Empty Block (label) @39
Culled Empty Block (label) @40
Culled Empty Block (label) @41
Culled Empty Block (label) @42
Culled Empty Block (label) @44
Culled Empty Block (label) @47
Culled Empty Block (label) alloc::@1
Culled Empty Block (label) @48
Culled Empty Block (label) @49
Culled Empty Block (label) sum::@4
Culled Empty Block (label) sum::@5
Culled Empty Block (label) sum::@6
Culled Empty Block (label) sum::@7
Culled Empty Block (label) @50

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@13
@13: scope:[]  from @begin
  (byte*) print_screen#0 ← (byte*)(number) $400
  (byte*) print_line_cursor#0 ← (byte*) print_screen#0
  (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
  to:@43

(void()) print_ln()
print_ln: scope:[print_ln]  from end::@2
  (byte*) print_char_cursor#35 ← phi( end::@2/(byte*) print_char_cursor#11 )
  (byte*) print_line_cursor#16 ← phi( end::@2/(byte*) print_line_cursor#17 )
  to:print_ln::@1
print_ln::@1: scope:[print_ln]  from print_ln print_ln::@1
  (byte*) print_char_cursor#18 ← phi( print_ln/(byte*) print_char_cursor#35 print_ln::@1/(byte*) print_char_cursor#18 )
  (byte*) print_line_cursor#8 ← phi( print_ln/(byte*) print_line_cursor#16 print_ln::@1/(byte*) print_line_cursor#1 )
  (byte*~) print_ln::$0 ← (byte*) print_line_cursor#8 + (number) $28
  (byte*) print_line_cursor#1 ← (byte*~) print_ln::$0
  (bool~) print_ln::$1 ← (byte*) print_line_cursor#1 < (byte*) print_char_cursor#18
  if((bool~) print_ln::$1) goto print_ln::@1
  to:print_ln::@2
print_ln::@2: scope:[print_ln]  from print_ln::@1
  (byte*) print_line_cursor#9 ← phi( print_ln::@1/(byte*) print_line_cursor#1 )
  (byte*) print_char_cursor#1 ← (byte*) print_line_cursor#9
  to:print_ln::@return
print_ln::@return: scope:[print_ln]  from print_ln::@2
  (byte*) print_char_cursor#19 ← phi( print_ln::@2/(byte*) print_char_cursor#1 )
  (byte*) print_line_cursor#10 ← phi( print_ln::@2/(byte*) print_line_cursor#9 )
  (byte*) print_line_cursor#2 ← (byte*) print_line_cursor#10
  (byte*) print_char_cursor#2 ← (byte*) print_char_cursor#19
  return 
  to:@return

(void()) print_word((word) print_word::w)
print_word: scope:[print_word]  from end::@1
  (byte*) print_char_cursor#36 ← phi( end::@1/(byte*) print_char_cursor#39 )
  (word) print_word::w#1 ← phi( end::@1/(word) print_word::w#0 )
  (byte~) print_word::$0 ← > (word) print_word::w#1
  (byte) print_byte::b#0 ← (byte~) print_word::$0
  call print_byte 
  to:print_word::@1
print_word::@1: scope:[print_word]  from print_word
  (word) print_word::w#2 ← phi( print_word/(word) print_word::w#1 )
  (byte*) print_char_cursor#20 ← phi( print_word/(byte*) print_char_cursor#8 )
  (byte*) print_char_cursor#3 ← (byte*) print_char_cursor#20
  (byte~) print_word::$2 ← < (word) print_word::w#2
  (byte) print_byte::b#1 ← (byte~) print_word::$2
  call print_byte 
  to:print_word::@2
print_word::@2: scope:[print_word]  from print_word::@1
  (byte*) print_char_cursor#21 ← phi( print_word::@1/(byte*) print_char_cursor#8 )
  (byte*) print_char_cursor#4 ← (byte*) print_char_cursor#21
  to:print_word::@return
print_word::@return: scope:[print_word]  from print_word::@2
  (byte*) print_char_cursor#22 ← phi( print_word::@2/(byte*) print_char_cursor#4 )
  (byte*) print_char_cursor#5 ← (byte*) print_char_cursor#22
  return 
  to:@return

(void()) print_byte((byte) print_byte::b)
print_byte: scope:[print_byte]  from print_word print_word::@1
  (byte*) print_char_cursor#37 ← phi( print_word/(byte*) print_char_cursor#36 print_word::@1/(byte*) print_char_cursor#3 )
  (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
  (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (number) 4
  (byte) print_char::ch#0 ← *((const byte*) print_hextab + (byte~) print_byte::$0)
  call print_char 
  to:print_byte::@1
print_byte::@1: scope:[print_byte]  from print_byte
  (byte) print_byte::b#3 ← phi( print_byte/(byte) print_byte::b#2 )
  (byte*) print_char_cursor#23 ← phi( print_byte/(byte*) print_char_cursor#10 )
  (byte*) print_char_cursor#6 ← (byte*) print_char_cursor#23
  (number~) print_byte::$2 ← (byte) print_byte::b#3 & (number) $f
  (byte) print_char::ch#1 ← *((const byte*) print_hextab + (number~) print_byte::$2)
  call print_char 
  to:print_byte::@2
print_byte::@2: scope:[print_byte]  from print_byte::@1
  (byte*) print_char_cursor#24 ← phi( print_byte::@1/(byte*) print_char_cursor#10 )
  (byte*) print_char_cursor#7 ← (byte*) print_char_cursor#24
  to:print_byte::@return
print_byte::@return: scope:[print_byte]  from print_byte::@2
  (byte*) print_char_cursor#25 ← phi( print_byte::@2/(byte*) print_char_cursor#7 )
  (byte*) print_char_cursor#8 ← (byte*) print_char_cursor#25
  return 
  to:@return

(void()) print_char((byte) print_char::ch)
print_char: scope:[print_char]  from main::@8 print_byte print_byte::@1
  (byte*) print_char_cursor#26 ← phi( main::@8/(byte*) print_char_cursor#38 print_byte/(byte*) print_char_cursor#37 print_byte::@1/(byte*) print_char_cursor#6 )
  (byte) print_char::ch#3 ← phi( main::@8/(byte) print_char::ch#2 print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
  *((byte*) print_char_cursor#26) ← (byte) print_char::ch#3
  (byte*) print_char_cursor#9 ← ++ (byte*) print_char_cursor#26
  to:print_char::@return
print_char::@return: scope:[print_char]  from print_char
  (byte*) print_char_cursor#27 ← phi( print_char/(byte*) print_char_cursor#9 )
  (byte*) print_char_cursor#10 ← (byte*) print_char_cursor#27
  return 
  to:@return
@43: scope:[]  from @13
  (byte*) print_line_cursor#26 ← phi( @13/(byte*) print_line_cursor#0 )
  (byte*) print_char_cursor#47 ← phi( @13/(byte*) print_char_cursor#0 )
  (word) last_time ← (word) 0
  (word) Ticks#0 ← (word) 0
  to:@45

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

(void()) end()
end: scope:[end]  from main::@4
  (byte*) print_line_cursor#23 ← phi( main::@4/(byte*) print_line_cursor#18 )
  (byte*) print_char_cursor#42 ← phi( main::@4/(byte*) print_char_cursor#40 )
  (word) Ticks#1 ← (word) last_time
  call start 
  to:end::@1
end::@1: scope:[end]  from end
  (byte*) print_line_cursor#20 ← phi( end/(byte*) print_line_cursor#23 )
  (byte*) print_char_cursor#39 ← phi( end/(byte*) print_char_cursor#42 )
  (word) Ticks#7 ← phi( end/(word) Ticks#1 )
  (word) last_time ← (word) last_time - (word) Ticks#7
  (word) Ticks#2 ← (word) last_time
  (word) print_word::w#0 ← (word) Ticks#2
  call print_word 
  to:end::@2
end::@2: scope:[end]  from end::@1
  (word) Ticks#15 ← phi( end::@1/(word) Ticks#2 )
  (byte*) print_line_cursor#17 ← phi( end::@1/(byte*) print_line_cursor#20 )
  (byte*) print_char_cursor#28 ← phi( end::@1/(byte*) print_char_cursor#5 )
  (byte*) print_char_cursor#11 ← (byte*) print_char_cursor#28
  call print_ln 
  to:end::@3
end::@3: scope:[end]  from end::@2
  (word) Ticks#12 ← phi( end::@2/(word) Ticks#15 )
  (byte*) print_char_cursor#29 ← phi( end::@2/(byte*) print_char_cursor#2 )
  (byte*) print_line_cursor#11 ← phi( end::@2/(byte*) print_line_cursor#2 )
  (byte*) print_line_cursor#3 ← (byte*) print_line_cursor#11
  (byte*) print_char_cursor#12 ← (byte*) print_char_cursor#29
  to:end::@return
end::@return: scope:[end]  from end::@3
  (byte*) print_line_cursor#12 ← phi( end::@3/(byte*) print_line_cursor#3 )
  (byte*) print_char_cursor#30 ← phi( end::@3/(byte*) print_char_cursor#12 )
  (word) Ticks#8 ← phi( end::@3/(word) Ticks#12 )
  (word) Ticks#3 ← (word) Ticks#8
  (byte*) print_char_cursor#13 ← (byte*) print_char_cursor#30
  (byte*) print_line_cursor#4 ← (byte*) print_line_cursor#12
  return 
  to:@return
@45: scope:[]  from @43
  (byte*) print_line_cursor#24 ← phi( @43/(byte*) print_line_cursor#26 )
  (word) Ticks#18 ← phi( @43/(word) Ticks#0 )
  (byte*) print_char_cursor#45 ← phi( @43/(byte*) print_char_cursor#47 )
  (word) rand_seed ← (word) 0
  to:@46
@46: scope:[]  from @45
  (byte*) print_line_cursor#22 ← phi( @45/(byte*) print_line_cursor#24 )
  (word) Ticks#17 ← phi( @45/(word) Ticks#18 )
  (byte*) print_char_cursor#44 ← phi( @45/(byte*) print_char_cursor#45 )
  (word) free_#0 ← (word) 0
  (struct node*) root#0 ← (struct node*) 0
  to:@51

(void()) init()
init: scope:[init]  from main::@1
  (word) free_#1 ← (number) 0
  (struct node*) root#1 ← ((struct node*)) (number) 0
  to:init::@return
init::@return: scope:[init]  from init
  (struct node*) root#9 ← phi( init/(struct node*) root#1 )
  (word) free_#11 ← phi( init/(word) free_#1 )
  (word) free_#2 ← (word) free_#11
  (struct node*) root#2 ← (struct node*) root#9
  return 
  to:@return

(struct node*()) alloc()
alloc: scope:[alloc]  from prepend
  (word) free_#12 ← phi( prepend/(word) free_#20 )
  (struct node*) alloc::result#0 ← (struct node*) 0
  (word~) alloc::$1 ← (word) free_#12 * (const byte) SIZEOF_STRUCT_NODE
  (struct node*~) alloc::$0 ← (const struct node*) heap + (word~) alloc::$1
  (struct node*) alloc::result#1 ← (struct node*~) alloc::$0
  (word) free_#3 ← ++ (word) free_#12
  (struct node*) alloc::return#0 ← (struct node*) alloc::result#1
  to:alloc::@return
alloc::@return: scope:[alloc]  from alloc
  (word) free_#13 ← phi( alloc/(word) free_#3 )
  (struct node*) alloc::return#3 ← phi( alloc/(struct node*) alloc::return#0 )
  (struct node*) alloc::return#1 ← (struct node*) alloc::return#3
  (word) free_#4 ← (word) free_#13
  return 
  to:@return

(void()) prepend((word) prepend::x)
prepend: scope:[prepend]  from main::@2
  (word) prepend::x#2 ← phi( main::@2/(word) prepend::x#0 )
  (struct node*) root#17 ← phi( main::@2/(struct node*) root#20 )
  (word) free_#20 ← phi( main::@2/(word) free_#22 )
  (struct node*) prepend::new#0 ← (struct node*) 0
  call alloc 
  (struct node*) alloc::return#2 ← (struct node*) alloc::return#1
  to:prepend::@1
prepend::@1: scope:[prepend]  from prepend
  (word) prepend::x#1 ← phi( prepend/(word) prepend::x#2 )
  (struct node*) root#10 ← phi( prepend/(struct node*) root#17 )
  (word) free_#14 ← phi( prepend/(word) free_#4 )
  (struct node*) alloc::return#4 ← phi( prepend/(struct node*) alloc::return#2 )
  (struct node*~) prepend::$0 ← (struct node*) alloc::return#4
  (word) free_#5 ← (word) free_#14
  (struct node*) prepend::new#1 ← (struct node*~) prepend::$0
  (struct node**~) prepend::$1 ← (struct node**)(struct node*) prepend::new#1 + (const byte) OFFSET_STRUCT_NODE_NEXT
  *((struct node**~) prepend::$1) ← (struct node*) root#10
  (word*~) prepend::$2 ← (word*)(struct node*) prepend::new#1 + (const byte) OFFSET_STRUCT_NODE_VALUE
  *((word*~) prepend::$2) ← (word) prepend::x#1
  (struct node*) root#3 ← (struct node*) prepend::new#1
  to:prepend::@return
prepend::@return: scope:[prepend]  from prepend::@1
  (struct node*) root#11 ← phi( prepend::@1/(struct node*) root#3 )
  (word) free_#15 ← phi( prepend::@1/(word) free_#5 )
  (word) free_#6 ← (word) free_#15
  (struct node*) root#4 ← (struct node*) root#11
  return 
  to:@return

(word()) sum()
sum: scope:[sum]  from main::@3
  (struct node*) root#12 ← phi( main::@3/(struct node*) root#18 )
  (struct node*) sum::current#0 ← (struct node*) 0
  (word) sum::s#0 ← (word) 0
  (word) sum::s#1 ← (number) 0
  (struct node*) sum::current#1 ← (struct node*) root#12
  to:sum::@1
sum::@1: scope:[sum]  from sum sum::@2
  (word) sum::s#5 ← phi( sum/(word) sum::s#1 sum::@2/(word) sum::s#2 )
  (struct node*) sum::current#3 ← phi( sum/(struct node*) sum::current#1 sum::@2/(struct node*) sum::current#2 )
  (bool~) sum::$2 ← (struct node*)(word) 0 != (struct node*) sum::current#3
  if((bool~) sum::$2) goto sum::@2
  to:sum::@3
sum::@2: scope:[sum]  from sum::@1
  (word) sum::s#3 ← phi( sum::@1/(word) sum::s#5 )
  (struct node*) sum::current#4 ← phi( sum::@1/(struct node*) sum::current#3 )
  (word*~) sum::$0 ← (word*)(struct node*) sum::current#4 + (const byte) OFFSET_STRUCT_NODE_VALUE
  (word) sum::s#2 ← (word) sum::s#3 + *((word*~) sum::$0)
  (struct node**~) sum::$1 ← (struct node**)(struct node*) sum::current#4 + (const byte) OFFSET_STRUCT_NODE_NEXT
  (struct node*) sum::current#2 ← *((struct node**~) sum::$1)
  to:sum::@1
sum::@3: scope:[sum]  from sum::@1
  (word) sum::s#4 ← phi( sum::@1/(word) sum::s#5 )
  (word) sum::return#0 ← (word) sum::s#4
  to:sum::@return
sum::@return: scope:[sum]  from sum::@3
  (word) sum::return#3 ← phi( sum::@3/(word) sum::return#0 )
  (word) sum::return#1 ← (word) sum::return#3
  return 
  to:@return

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

SYMBOL TABLE SSA
(label) @13
(label) @43
(label) @45
(label) @46
(label) @51
(label) @52
(label) @begin
(label) @end
(const byte) OFFSET_STRUCT_NODE_NEXT = (byte) 0
(const byte) OFFSET_STRUCT_NODE_VALUE = (byte) 2
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10
(const byte) RADIX::OCTAL = (number) 8
(const byte) SIZEOF_STRUCT_NODE = (byte) 4
(word) Ticks
(word) Ticks#0
(word) Ticks#1
(word) Ticks#10
(word) Ticks#11
(word) Ticks#12
(word) Ticks#13
(word) Ticks#14
(word) Ticks#15
(word) Ticks#16
(word) Ticks#17
(word) Ticks#18
(word) Ticks#19
(word) Ticks#2
(word) Ticks#20
(word) Ticks#21
(word) Ticks#22
(word) Ticks#23
(word) Ticks#24
(word) Ticks#25
(word) Ticks#26
(word) Ticks#3
(word) Ticks#4
(word) Ticks#5
(word) Ticks#6
(word) Ticks#7
(word) Ticks#8
(word) Ticks#9
(struct node*()) alloc()
(struct node*~) alloc::$0
(word~) alloc::$1
(label) alloc::@return
(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()
(label) end::@1
(label) end::@2
(label) end::@3
(label) end::@return
(word) free_
(word) free_#0
(word) free_#1
(word) free_#10
(word) free_#11
(word) free_#12
(word) free_#13
(word) free_#14
(word) free_#15
(word) free_#16
(word) free_#17
(word) free_#18
(word) free_#19
(word) free_#2
(word) free_#20
(word) free_#21
(word) free_#22
(word) free_#23
(word) free_#24
(word) free_#25
(word) free_#26
(word) free_#27
(word) free_#28
(word) free_#29
(word) free_#3
(word) free_#30
(word) free_#4
(word) free_#5
(word) free_#6
(word) free_#7
(word) free_#8
(word) free_#9
(const struct node*) heap[(number) $fa0]  = { fill( $fa0, 0) }
(void()) init()
(label) init::@return
(word) last_time loadstore
(void()) main()
(bool~) main::$4
(word~) main::$5
(byte~) main::$6
(bool~) main::$8
(label) main::@1
(label) main::@10
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@8
(label) main::@9
(label) main::@return
(byte) main::c
(byte) main::c#0
(byte) main::c#1
(byte) main::c#2
(byte) main::c#3
(byte) main::c#4
(byte) main::c#5
(byte) main::c#6
(byte) main::c#7
(byte) main::c#8
(byte) main::c#9
(word) main::i
(word) main::i#0
(word) main::i#1
(word) main::i#2
(word) main::i#3
(word) main::i#4
(struct node*) node::next
(word) node::value
(void()) prepend((word) prepend::x)
(struct node*~) prepend::$0
(struct node**~) prepend::$1
(word*~) prepend::$2
(label) prepend::@1
(label) prepend::@return
(struct node*) prepend::new
(struct node*) prepend::new#0
(struct node*) prepend::new#1
(word) prepend::x
(word) prepend::x#0
(word) prepend::x#1
(word) prepend::x#2
(void()) print_byte((byte) print_byte::b)
(byte~) print_byte::$0
(number~) print_byte::$2
(label) print_byte::@1
(label) print_byte::@2
(label) print_byte::@return
(byte) print_byte::b
(byte) print_byte::b#0
(byte) print_byte::b#1
(byte) print_byte::b#2
(byte) print_byte::b#3
(void()) print_char((byte) print_char::ch)
(label) print_char::@return
(byte) print_char::ch
(byte) print_char::ch#0
(byte) print_char::ch#1
(byte) print_char::ch#2
(byte) print_char::ch#3
(byte*) print_char_cursor
(byte*) print_char_cursor#0
(byte*) print_char_cursor#1
(byte*) print_char_cursor#10
(byte*) print_char_cursor#11
(byte*) print_char_cursor#12
(byte*) print_char_cursor#13
(byte*) print_char_cursor#14
(byte*) print_char_cursor#15
(byte*) print_char_cursor#16
(byte*) print_char_cursor#17
(byte*) print_char_cursor#18
(byte*) print_char_cursor#19
(byte*) print_char_cursor#2
(byte*) print_char_cursor#20
(byte*) print_char_cursor#21
(byte*) print_char_cursor#22
(byte*) print_char_cursor#23
(byte*) print_char_cursor#24
(byte*) print_char_cursor#25
(byte*) print_char_cursor#26
(byte*) print_char_cursor#27
(byte*) print_char_cursor#28
(byte*) print_char_cursor#29
(byte*) print_char_cursor#3
(byte*) print_char_cursor#30
(byte*) print_char_cursor#31
(byte*) print_char_cursor#32
(byte*) print_char_cursor#33
(byte*) print_char_cursor#34
(byte*) print_char_cursor#35
(byte*) print_char_cursor#36
(byte*) print_char_cursor#37
(byte*) print_char_cursor#38
(byte*) print_char_cursor#39
(byte*) print_char_cursor#4
(byte*) print_char_cursor#40
(byte*) print_char_cursor#41
(byte*) print_char_cursor#42
(byte*) print_char_cursor#43
(byte*) print_char_cursor#44
(byte*) print_char_cursor#45
(byte*) print_char_cursor#46
(byte*) print_char_cursor#47
(byte*) print_char_cursor#48
(byte*) print_char_cursor#49
(byte*) print_char_cursor#5
(byte*) print_char_cursor#50
(byte*) print_char_cursor#51
(byte*) print_char_cursor#52
(byte*) print_char_cursor#6
(byte*) print_char_cursor#7
(byte*) print_char_cursor#8
(byte*) print_char_cursor#9
(const byte*) print_hextab[]  = (string) "0123456789abcdef"z
(byte*) print_line_cursor
(byte*) print_line_cursor#0
(byte*) print_line_cursor#1
(byte*) print_line_cursor#10
(byte*) print_line_cursor#11
(byte*) print_line_cursor#12
(byte*) print_line_cursor#13
(byte*) print_line_cursor#14
(byte*) print_line_cursor#15
(byte*) print_line_cursor#16
(byte*) print_line_cursor#17
(byte*) print_line_cursor#18
(byte*) print_line_cursor#19
(byte*) print_line_cursor#2
(byte*) print_line_cursor#20
(byte*) print_line_cursor#21
(byte*) print_line_cursor#22
(byte*) print_line_cursor#23
(byte*) print_line_cursor#24
(byte*) print_line_cursor#25
(byte*) print_line_cursor#26
(byte*) print_line_cursor#27
(byte*) print_line_cursor#28
(byte*) print_line_cursor#29
(byte*) print_line_cursor#3
(byte*) print_line_cursor#30
(byte*) print_line_cursor#31
(byte*) print_line_cursor#32
(byte*) print_line_cursor#33
(byte*) print_line_cursor#4
(byte*) print_line_cursor#5
(byte*) print_line_cursor#6
(byte*) print_line_cursor#7
(byte*) print_line_cursor#8
(byte*) print_line_cursor#9
(void()) print_ln()
(byte*~) print_ln::$0
(bool~) print_ln::$1
(label) print_ln::@1
(label) print_ln::@2
(label) print_ln::@return
(byte*) print_screen
(byte*) print_screen#0
(void()) print_word((word) print_word::w)
(byte~) print_word::$0
(byte~) print_word::$2
(label) print_word::@1
(label) print_word::@2
(label) print_word::@return
(word) print_word::w
(word) print_word::w#0
(word) print_word::w#1
(word) print_word::w#2
(word) rand_seed loadstore
(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#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()
(label) start::@return
(const word*) start::LAST_TIME = &(word) last_time
(word()) sum()
(word*~) sum::$0
(struct node**~) sum::$1
(bool~) sum::$2
(label) sum::@1
(label) sum::@2
(label) sum::@3
(label) sum::@return
(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
(word) sum::return
(word) sum::return#0
(word) sum::return#1
(word) sum::return#2
(word) sum::return#3
(word) sum::return#4
(word) sum::s
(word) sum::s#0
(word) sum::s#1
(word) sum::s#2
(word) sum::s#3
(word) sum::s#4
(word) sum::s#5

Adding number conversion cast (unumber) $28 in (byte*~) print_ln::$0 ← (byte*) print_line_cursor#8 + (number) $28
Adding number conversion cast (unumber) 4 in (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (number) 4
Adding number conversion cast (unumber) $f in (number~) print_byte::$2 ← (byte) print_byte::b#3 & (number) $f
Adding number conversion cast (unumber) print_byte::$2 in (number~) print_byte::$2 ← (byte) print_byte::b#3 & (unumber)(number) $f
Adding number conversion cast (unumber) $194a in (word) rand_seed ← (number) $194a
Adding number conversion cast (unumber) 0 in (word) free_#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (word) sum::s#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) main::c#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (word) main::i#1 ← (number) 0
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (word) rand_seed ← (unumber)(number) $194a
Inlining cast (word) free_#1 ← (unumber)(number) 0
Inlining cast (struct node*) root#1 ← (struct node*)(number) 0
Inlining cast (word) sum::s#1 ← (unumber)(number) 0
Inlining cast (byte) main::c#1 ← (unumber)(number) 0
Inlining cast (word) main::i#1 ← (unumber)(number) 0
Inlining cast (byte~) main::$6 ← (byte)(word~) main::$5
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $28
Simplifying constant integer cast 4
Simplifying constant integer cast $f
Simplifying constant integer cast $194a
Simplifying constant integer cast 0
Simplifying constant pointer cast (struct node*) 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) $f
Finalized unsigned number type (word) $194a
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) print_byte::$2 ← (byte) print_byte::b#3 & (byte) $f
Alias (byte*) print_char_cursor#0 = (byte*) print_line_cursor#0 (byte*) print_screen#0 (byte*) print_char_cursor#47 (byte*) print_line_cursor#26 (byte*) print_char_cursor#45 (byte*) print_line_cursor#24 (byte*) print_char_cursor#44 (byte*) print_line_cursor#22 (byte*) print_char_cursor#41 (byte*) print_line_cursor#19 
Alias (byte*) print_line_cursor#1 = (byte*~) print_ln::$0 (byte*) print_line_cursor#9 (byte*) print_char_cursor#1 (byte*) print_line_cursor#10 (byte*) print_char_cursor#19 (byte*) print_line_cursor#2 (byte*) print_char_cursor#2 
Alias (byte) print_byte::b#0 = (byte~) print_word::$0 
Alias (word) print_word::w#1 = (word) print_word::w#2 
Alias (byte*) print_char_cursor#20 = (byte*) print_char_cursor#3 
Alias (byte) print_byte::b#1 = (byte~) print_word::$2 
Alias (byte*) print_char_cursor#21 = (byte*) print_char_cursor#4 (byte*) print_char_cursor#22 (byte*) print_char_cursor#5 
Alias (byte) print_byte::b#2 = (byte) print_byte::b#3 
Alias (byte*) print_char_cursor#23 = (byte*) print_char_cursor#6 
Alias (byte*) print_char_cursor#24 = (byte*) print_char_cursor#7 (byte*) print_char_cursor#25 (byte*) print_char_cursor#8 
Alias (byte*) print_char_cursor#10 = (byte*) print_char_cursor#27 (byte*) print_char_cursor#9 
Alias (word) Ticks#1 = (word) Ticks#7 
Alias (byte*) print_char_cursor#39 = (byte*) print_char_cursor#42 
Alias (byte*) print_line_cursor#17 = (byte*) print_line_cursor#20 (byte*) print_line_cursor#23 
Alias (word) Ticks#12 = (word) Ticks#15 (word) Ticks#2 (word) Ticks#8 (word) Ticks#3 
Alias (byte*) print_char_cursor#11 = (byte*) print_char_cursor#28 
Alias (byte*) print_line_cursor#11 = (byte*) print_line_cursor#3 (byte*) print_line_cursor#12 (byte*) print_line_cursor#4 
Alias (byte*) print_char_cursor#12 = (byte*) print_char_cursor#29 (byte*) print_char_cursor#30 (byte*) print_char_cursor#13 
Alias (word) Ticks#0 = (word) Ticks#18 (word) Ticks#17 (word) Ticks#14 
Alias (word) free_#1 = (word) free_#11 (word) free_#2 
Alias (struct node*) root#1 = (struct node*) root#9 (struct node*) root#2 
Alias (struct node*) alloc::return#0 = (struct node*) alloc::result#1 (struct node*~) alloc::$0 (struct node*) alloc::return#3 (struct node*) alloc::return#1 
Alias (word) free_#13 = (word) free_#3 (word) free_#4 
Alias (struct node*) alloc::return#2 = (struct node*) alloc::return#4 
Alias (struct node*) root#10 = (struct node*) root#17 
Alias (word) prepend::x#1 = (word) prepend::x#2 
Alias (word) free_#14 = (word) free_#5 (word) free_#15 (word) free_#6 
Alias (struct node*) prepend::new#1 = (struct node*~) prepend::$0 
Alias (struct node*) root#11 = (struct node*) root#3 (struct node*) root#4 
Alias (struct node*) sum::current#3 = (struct node*) sum::current#4 
Alias (word) sum::s#3 = (word) sum::s#5 (word) sum::s#4 (word) sum::return#0 (word) sum::return#3 (word) sum::return#1 
Alias (word) free_#25 = (word) free_#28 
Alias (struct node*) root#23 = (struct node*) root#26 
Alias (byte*) print_char_cursor#51 = (byte*) print_char_cursor#52 
Alias (word) Ticks#25 = (word) Ticks#26 
Alias (byte*) print_line_cursor#32 = (byte*) print_line_cursor#33 
Alias (byte*) print_char_cursor#49 = (byte*) print_char_cursor#50 
Alias (byte) main::c#8 = (byte) main::c#9 
Alias (word) Ticks#23 = (word) Ticks#24 
Alias (byte*) print_line_cursor#30 = (byte*) print_line_cursor#31 
Alias (word) free_#16 = (word) free_#7 
Alias (struct node*) root#13 = (struct node*) root#5 
Alias (word) main::i#3 = (word) main::i#4 
Alias (byte*) print_char_cursor#38 = (byte*) print_char_cursor#46 (byte*) print_char_cursor#48 (byte*) print_char_cursor#43 
Alias (byte) main::c#3 = (byte) main::c#6 (byte) main::c#7 (byte) main::c#5 (byte) main::c#4 
Alias (word) Ticks#13 = (word) Ticks#21 (word) Ticks#22 (word) Ticks#20 (word) Ticks#19 (word) Ticks#16 
Alias (byte*) print_line_cursor#18 = (byte*) print_line_cursor#28 (byte*) print_line_cursor#29 (byte*) print_line_cursor#27 (byte*) print_line_cursor#25 (byte*) print_line_cursor#21 
Alias (word) free_#17 = (word) free_#8 (word) free_#30 (word) free_#29 (word) free_#26 (word) free_#27 (word) free_#23 (word) free_#18 (word) free_#9 
Alias (struct node*) root#14 = (struct node*) root#6 (struct node*) root#18 (struct node*) root#27 (struct node*) root#24 (struct node*) root#25 (struct node*) root#21 (struct node*) root#15 (struct node*) root#7 
Alias (word) sum::return#2 = (word) sum::return#4 
Alias (byte) print_char::ch#2 = (byte~) main::$6 
Alias (byte*) print_char_cursor#14 = (byte*) print_char_cursor#31 (byte*) print_char_cursor#40 
Alias (word) Ticks#10 = (word) Ticks#4 (word) Ticks#9 (word) Ticks#5 
Alias (byte*) print_char_cursor#15 = (byte*) print_char_cursor#32 (byte*) print_char_cursor#33 (byte*) print_char_cursor#16 
Alias (byte*) print_line_cursor#13 = (byte*) print_line_cursor#5 (byte*) print_line_cursor#14 (byte*) print_line_cursor#6 
Alias (word) free_#0 = (word) free_#24 
Alias (struct node*) root#0 = (struct node*) root#22 
Alias (word) free_#10 = (word) free_#19 
Alias (struct node*) root#16 = (struct node*) root#8 
Alias (byte*) print_char_cursor#17 = (byte*) print_char_cursor#34 
Alias (word) Ticks#11 = (word) Ticks#6 
Alias (byte*) print_line_cursor#15 = (byte*) print_line_cursor#7 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte*) print_line_cursor#16 (byte*) print_line_cursor#17
Identical Phi Values (byte*) print_char_cursor#35 (byte*) print_char_cursor#11
Identical Phi Values (byte*) print_char_cursor#18 (byte*) print_char_cursor#35
Identical Phi Values (word) print_word::w#1 (word) print_word::w#0
Identical Phi Values (byte*) print_char_cursor#36 (byte*) print_char_cursor#39
Identical Phi Values (byte*) print_char_cursor#20 (byte*) print_char_cursor#24
Identical Phi Values (byte*) print_char_cursor#21 (byte*) print_char_cursor#24
Identical Phi Values (byte*) print_char_cursor#23 (byte*) print_char_cursor#10
Identical Phi Values (byte*) print_char_cursor#24 (byte*) print_char_cursor#10
Identical Phi Values (byte*) print_char_cursor#39 (byte*) print_char_cursor#14
Identical Phi Values (byte*) print_line_cursor#17 (byte*) print_line_cursor#18
Identical Phi Values (byte*) print_char_cursor#11 (byte*) print_char_cursor#21
Identical Phi Values (byte*) print_line_cursor#11 (byte*) print_line_cursor#1
Identical Phi Values (byte*) print_char_cursor#12 (byte*) print_line_cursor#1
Identical Phi Values (word) free_#12 (word) free_#20
Identical Phi Values (word) free_#20 (word) free_#22
Identical Phi Values (struct node*) root#10 (struct node*) root#20
Identical Phi Values (word) prepend::x#1 (word) prepend::x#0
Identical Phi Values (word) free_#14 (word) free_#13
Identical Phi Values (struct node*) root#12 (struct node*) root#14
Identical Phi Values (word) free_#25 (word) free_#0
Identical Phi Values (struct node*) root#23 (struct node*) root#0
Identical Phi Values (byte*) print_char_cursor#51 (byte*) print_char_cursor#0
Identical Phi Values (word) Ticks#25 (word) Ticks#0
Identical Phi Values (byte*) print_line_cursor#32 (byte*) print_char_cursor#0
Identical Phi Values (word) free_#16 (word) free_#1
Identical Phi Values (struct node*) root#13 (struct node*) root#1
Identical Phi Values (byte*) print_char_cursor#38 (byte*) print_char_cursor#49
Identical Phi Values (byte) main::c#3 (byte) main::c#8
Identical Phi Values (word) Ticks#13 (word) Ticks#23
Identical Phi Values (byte*) print_line_cursor#18 (byte*) print_line_cursor#30
Identical Phi Values (word) free_#17 (word) free_#14
Identical Phi Values (struct node*) root#14 (struct node*) root#11
Identical Phi Values (byte*) print_char_cursor#14 (byte*) print_char_cursor#10
Identical Phi Values (word) Ticks#10 (word) Ticks#12
Identical Phi Values (byte*) print_char_cursor#15 (byte*) print_char_cursor#12
Identical Phi Values (byte*) print_line_cursor#13 (byte*) print_line_cursor#11
Identical Phi Values (word) free_#10 (word) free_#17
Identical Phi Values (struct node*) root#16 (struct node*) root#14
Identical Phi Values (byte*) print_char_cursor#17 (byte*) print_char_cursor#15
Identical Phi Values (word) Ticks#11 (word) Ticks#10
Identical Phi Values (byte*) print_line_cursor#15 (byte*) print_line_cursor#13
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values (byte*) print_char_cursor#37 (byte*) print_char_cursor#10
Identical Phi Values (word) Ticks#23 (word) Ticks#0
Identical Phi Values (byte*) print_line_cursor#30 (byte*) print_char_cursor#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) print_ln::$1 [8] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#10) goto print_ln::@1
Simple Condition (bool~) sum::$2 [120] if((struct node*)(word) 0!=(struct node*) sum::current#3) goto sum::@2
Simple Condition (bool~) main::$4 [151] if((word) main::i#2!=rangelast(0,$bb7)) goto main::@2
Simple Condition (bool~) main::$8 [164] if((byte) main::c#2!=rangelast(0,4)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) print_char_cursor#0 = (byte*) 1024
Constant (const word) Ticks#0 = 0
Constant (const word) free_#0 = 0
Constant (const struct node*) root#0 = (struct node*) 0
Constant (const word) free_#1 = 0
Constant (const struct node*) root#1 = (struct node*) 0
Constant (const struct node*) alloc::result#0 = (struct node*) 0
Constant (const struct node*) prepend::new#0 = (struct node*) 0
Constant (const struct node*) sum::current#0 = (struct node*) 0
Constant (const word) sum::s#0 = 0
Constant (const word) sum::s#1 = 0
Constant (const word) main::i#0 = 0
Constant (const byte) main::c#0 = 0
Constant (const byte) main::c#1 = 0
Constant (const word) main::i#1 = 0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [149] main::i#2 ← ++ main::i#3 to ++
Resolved ranged comparison value [151] if(main::i#2!=rangelast(0,$bb7)) goto main::@2 to (number) $bb8
Resolved ranged next value [162] main::c#2 ← ++ main::c#8 to ++
Resolved ranged comparison value [164] if(main::c#2!=rangelast(0,4)) goto main::@1 to (number) 5
Converting *(pointer+n) to pointer[n] [105] *((struct node**~) prepend::$1) ← (struct node*) root#20  -- *((struct node**)prepend::new#1 + OFFSET_STRUCT_NODE_NEXT)
Converting *(pointer+n) to pointer[n] [107] *((word*~) prepend::$2) ← (word) prepend::x#0  -- *((word*)prepend::new#1 + OFFSET_STRUCT_NODE_VALUE)
Converting *(pointer+n) to pointer[n] [123] (word) sum::s#2 ← (word) sum::s#3 + *((word*~) sum::$0)  -- *((word*)sum::current#3 + OFFSET_STRUCT_NODE_VALUE)
Converting *(pointer+n) to pointer[n] [125] (struct node*) sum::current#2 ← *((struct node**~) sum::$1)  -- *((struct node**)sum::current#3 + OFFSET_STRUCT_NODE_NEXT)
Successful SSA optimization Pass2InlineDerefIdx
Simplifying expression containing zero (struct node**)prepend::new#1 in [104] (struct node**~) prepend::$1 ← (struct node**)(struct node*) prepend::new#1 + (const byte) OFFSET_STRUCT_NODE_NEXT
Simplifying expression containing zero (struct node**)prepend::new#1 in [105] *((struct node**)(struct node*) prepend::new#1 + (const byte) OFFSET_STRUCT_NODE_NEXT) ← (struct node*) root#20
Simplifying expression containing zero (struct node**)sum::current#3 in [124] (struct node**~) sum::$1 ← (struct node**)(struct node*) sum::current#3 + (const byte) OFFSET_STRUCT_NODE_NEXT
Simplifying expression containing zero (struct node**)sum::current#3 in [125] (struct node*) sum::current#2 ← *((struct node**)(struct node*) sum::current#3 + (const byte) OFFSET_STRUCT_NODE_NEXT)
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (struct node**~) prepend::$1 and assignment [42] (struct node**~) prepend::$1 ← (struct node**)(struct node*) prepend::new#1
Eliminating unused variable (word*~) prepend::$2 and assignment [44] (word*~) prepend::$2 ← (word*)(struct node*) prepend::new#1 + (const byte) OFFSET_STRUCT_NODE_VALUE
Eliminating unused variable (word*~) sum::$0 and assignment [51] (word*~) sum::$0 ← (word*)(struct node*) sum::current#3 + (const byte) OFFSET_STRUCT_NODE_VALUE
Eliminating unused variable (struct node**~) sum::$1 and assignment [53] (struct node**~) sum::$1 ← (struct node**)(struct node*) sum::current#3
Eliminating unused variable - keeping the phi block (word) free_#21
Eliminating unused variable - keeping the phi block (struct node*) root#19
Eliminating unused constant (const struct node*) alloc::result#0
Eliminating unused constant (const struct node*) prepend::new#0
Eliminating unused constant (const struct node*) sum::current#0
Eliminating unused constant (const word) sum::s#0
Eliminating unused constant (const word) main::i#0
Eliminating unused constant (const byte) main::c#0
Eliminating unused constant (const byte) OFFSET_STRUCT_NODE_NEXT
Eliminating unused constant (const word) Ticks#0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const word) free_#0
Eliminating unused constant (const struct node*) root#0
Successful SSA optimization PassNEliminateUnusedVars
Adding number conversion cast (unumber) $bb8 in if((word) main::i#2!=(number) $bb8) goto main::@2
Adding number conversion cast (unumber) 5 in if((byte) main::c#2!=(number) 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 (word) $bb8
Finalized unsigned number type (byte) 5
Successful SSA optimization PassNFinalizeNumberTypeConversions
Rewriting multiplication to use shift [35] (word~) alloc::$1 ← (word) free_#22 * (const byte) SIZEOF_STRUCT_NODE
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const word) sum::s#1
Inlining constant with var siblings (const byte) main::c#1
Inlining constant with var siblings (const word) main::i#1
Inlining constant with var siblings (const byte*) print_char_cursor#0
Inlining constant with var siblings (const word) free_#1
Inlining constant with var siblings (const struct node*) root#1
Constant inlined print_char_cursor#0 = (byte*) 1024
Constant inlined free_#1 = (byte) 0
Constant inlined root#1 = (struct node*) 0
Constant inlined sum::s#1 = (byte) 0
Constant inlined main::i#1 = (byte) 0
Constant inlined main::c#1 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Eliminating unused constant (const byte) SIZEOF_STRUCT_NODE
Successful SSA optimization PassNEliminateUnusedVars
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 @begin
Adding NOP phi() at start of @13
Adding NOP phi() at start of @46
Adding NOP phi() at start of @51
Adding NOP phi() at start of @52
Adding NOP phi() at start of @end
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 end::@2
Adding NOP phi() at start of end::@3
Adding NOP phi() at start of print_ln
Adding NOP phi() at start of print_ln::@2
Adding NOP phi() at start of print_word::@2
Adding NOP phi() at start of print_byte::@2
Adding NOP phi() at start of sum::@3
Adding NOP phi() at start of prepend
Adding NOP phi() at start of init
CALL GRAPH
Calls in [] to main:6 
Calls in [main] to start:10 init:13 prepend:17 sum:21 print_char:27 end:31 
Calls in [end] to start:40 print_word:44 print_ln:46 
Calls in [print_word] to print_byte:58 print_byte:61 
Calls in [print_byte] to print_char:69 print_char:74 
Calls in [prepend] to alloc:95 

Created 11 initial phi equivalence classes
Coalesced [25] print_char::ch#4 ← print_char::ch#2
Coalesced [26] print_char_cursor#53 ← print_char_cursor#49
Coalesced [34] print_char_cursor#56 ← print_char_cursor#10
Coalesced [35] main::c#10 ← main::c#2
Coalesced [36] main::i#5 ← main::i#2
Coalesced [37] free_#31 ← free_#13
Coalesced [38] root#28 ← root#11
Coalesced [55] print_line_cursor#34 ← print_line_cursor#1
Coalesced [57] print_byte::b#4 ← print_byte::b#0
Coalesced [60] print_byte::b#5 ← print_byte::b#1
Coalesced [67] print_char::ch#5 ← print_char::ch#0
Coalesced (already) [68] print_char_cursor#54 ← print_char_cursor#10
Coalesced [72] print_char::ch#6 ← print_char::ch#1
Coalesced (already) [73] print_char_cursor#55 ← print_char_cursor#10
Coalesced [85] sum::current#5 ← sum::current#1
Coalesced [92] sum::current#6 ← sum::current#2
Coalesced [93] sum::s#6 ← sum::s#2
Not coalescing [100] root#11 ← prepend::new#1
Coalesced down to 11 phi equivalence classes
Culled Empty Block (label) @13
Culled Empty Block (label) @46
Culled Empty Block (label) @52
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) end::@3
Culled Empty Block (label) print_ln::@2
Culled Empty Block (label) print_ln::@3
Culled Empty Block (label) print_word::@2
Culled Empty Block (label) print_byte::@2
Culled Empty Block (label) sum::@3
Renumbering block @43 to @1
Renumbering block @45 to @2
Renumbering block @51 to @3
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 @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @end
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 end::@2
Adding NOP phi() at start of print_ln
Adding NOP phi() at start of prepend
Adding NOP phi() at start of init

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  [1] (word) last_time ← (word) 0
  to:@2
@2: scope:[]  from @1
  [2] (word) rand_seed ← (word) 0
  to:@3
@3: scope:[]  from @2
  [3] phi()
  [4] call main 
  to:@end
@end: scope:[]  from @3
  [5] phi()

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

(void()) end()
end: scope:[end]  from main::@4
  [26] (word) Ticks#1 ← (word) last_time
  [27] call start 
  to:end::@1
end::@1: scope:[end]  from end
  [28] (word) last_time ← (word) last_time - (word) Ticks#1
  [29] (word) Ticks#12 ← (word) last_time
  [30] (word) print_word::w#0 ← (word) Ticks#12
  [31] call print_word 
  to:end::@2
end::@2: scope:[end]  from end::@1
  [32] phi()
  [33] call print_ln 
  to:end::@return
end::@return: scope:[end]  from end::@2
  [34] return 
  to:@return

(void()) print_ln()
print_ln: scope:[print_ln]  from end::@2
  [35] phi()
  to:print_ln::@1
print_ln::@1: scope:[print_ln]  from print_ln print_ln::@1
  [36] (byte*) print_line_cursor#8 ← phi( print_ln/(byte*) 1024 print_ln::@1/(byte*) print_line_cursor#1 )
  [37] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28
  [38] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#10) goto print_ln::@1
  to:print_ln::@return
print_ln::@return: scope:[print_ln]  from print_ln::@1
  [39] return 
  to:@return

(void()) print_word((word) print_word::w)
print_word: scope:[print_word]  from end::@1
  [40] (byte) print_byte::b#0 ← > (word) print_word::w#0
  [41] call print_byte 
  to:print_word::@1
print_word::@1: scope:[print_word]  from print_word
  [42] (byte) print_byte::b#1 ← < (word) print_word::w#0
  [43] call print_byte 
  to:print_word::@return
print_word::@return: scope:[print_word]  from print_word::@1
  [44] return 
  to:@return

(void()) print_byte((byte) print_byte::b)
print_byte: scope:[print_byte]  from print_word print_word::@1
  [45] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
  [46] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4
  [47] (byte) print_char::ch#0 ← *((const byte*) print_hextab + (byte~) print_byte::$0)
  [48] call print_char 
  to:print_byte::@1
print_byte::@1: scope:[print_byte]  from print_byte
  [49] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f
  [50] (byte) print_char::ch#1 ← *((const byte*) print_hextab + (byte~) print_byte::$2)
  [51] call print_char 
  to:print_byte::@return
print_byte::@return: scope:[print_byte]  from print_byte::@1
  [52] return 
  to:@return

(void()) print_char((byte) print_char::ch)
print_char: scope:[print_char]  from main::@6 print_byte print_byte::@1
  [53] (byte*) print_char_cursor#26 ← phi( main::@6/(byte*) print_char_cursor#49 print_byte/(byte*) print_char_cursor#10 print_byte::@1/(byte*) print_char_cursor#10 )
  [53] (byte) print_char::ch#3 ← phi( main::@6/(byte) print_char::ch#2 print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
  [54] *((byte*) print_char_cursor#26) ← (byte) print_char::ch#3
  [55] (byte*) print_char_cursor#10 ← ++ (byte*) print_char_cursor#26
  to:print_char::@return
print_char::@return: scope:[print_char]  from print_char
  [56] return 
  to:@return

(void()) start()
start: scope:[start]  from end main
  asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1  }
  [58] (word) rand_seed ← (word) $194a
  to:start::@return
start::@return: scope:[start]  from start
  [59] return 
  to:@return

(word()) sum()
sum: scope:[sum]  from main::@3
  [60] (struct node*) sum::current#1 ← (struct node*) root#11
  to:sum::@1
sum::@1: scope:[sum]  from sum sum::@2
  [61] (word) sum::s#3 ← phi( sum/(byte) 0 sum::@2/(word) sum::s#2 )
  [61] (struct node*) sum::current#3 ← phi( sum/(struct node*) sum::current#1 sum::@2/(struct node*) sum::current#2 )
  [62] if((struct node*)(word) 0!=(struct node*) sum::current#3) goto sum::@2
  to:sum::@return
sum::@return: scope:[sum]  from sum::@1
  [63] return 
  to:@return
sum::@2: scope:[sum]  from sum::@1
  [64] (word) sum::s#2 ← (word) sum::s#3 + *((word*)(struct node*) sum::current#3 + (const byte) OFFSET_STRUCT_NODE_VALUE)
  [65] (struct node*) sum::current#2 ← *((struct node**)(struct node*) sum::current#3)
  to:sum::@1

(void()) prepend((word) prepend::x)
prepend: scope:[prepend]  from main::@2
  [66] phi()
  [67] call alloc 
  [68] (struct node*) alloc::return#2 ← (struct node*) alloc::return#0
  to:prepend::@1
prepend::@1: scope:[prepend]  from prepend
  [69] (struct node*) prepend::new#1 ← (struct node*) alloc::return#2
  [70] *((struct node**)(struct node*) prepend::new#1) ← (struct node*) root#20
  [71] *((word*)(struct node*) prepend::new#1 + (const byte) OFFSET_STRUCT_NODE_VALUE) ← (word) prepend::x#0
  [72] (struct node*) root#11 ← (struct node*) prepend::new#1
  to:prepend::@return
prepend::@return: scope:[prepend]  from prepend::@1
  [73] return 
  to:@return

(struct node*()) alloc()
alloc: scope:[alloc]  from prepend
  [74] (word~) alloc::$1 ← (word) free_#22 << (byte) 2
  [75] (struct node*) alloc::return#0 ← (const struct node*) heap + (word~) alloc::$1
  [76] (word) free_#13 ← ++ (word) free_#22
  to:alloc::@return
alloc::@return: scope:[alloc]  from alloc
  [77] return 
  to:@return

(void()) init()
init: scope:[init]  from main::@1
  [78] phi()
  to:init::@return
init::@return: scope:[init]  from init
  [79] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(word) Ticks
(word) Ticks#1 2.0
(word) Ticks#12 4.0
(struct node*()) alloc()
(word~) alloc::$1 4.0
(struct node*) alloc::result
(struct node*) alloc::return
(struct node*) alloc::return#0 1.0
(struct node*) alloc::return#2 4.0
(void()) end()
(word) free_
(word) free_#13 8.583333333333332
(word) free_#22 20.999999999999996
(void()) init()
(word) last_time loadstore 0.4545454545454546
(void()) main()
(word~) main::$5 11.0
(byte) main::c
(byte) main::c#2 16.5
(byte) main::c#8 1.6923076923076923
(word) main::i
(word) main::i#2 151.5
(word) main::i#3 101.0
(struct node*) node::next
(word) node::value
(void()) prepend((word) prepend::x)
(struct node*) prepend::new
(struct node*) prepend::new#1 1.3333333333333333
(word) prepend::x
(word) prepend::x#0 17.166666666666664
(void()) print_byte((byte) print_byte::b)
(byte~) print_byte::$0 4.0
(byte~) print_byte::$2 4.0
(byte) print_byte::b
(byte) print_byte::b#0 4.0
(byte) print_byte::b#1 4.0
(byte) print_byte::b#2 2.0
(void()) print_char((byte) print_char::ch)
(byte) print_char::ch
(byte) print_char::ch#0 4.0
(byte) print_char::ch#1 4.0
(byte) print_char::ch#2 22.0
(byte) print_char::ch#3 17.0
(byte*) print_char_cursor
(byte*) print_char_cursor#10 0.9333333333333332
(byte*) print_char_cursor#26 9.5
(byte*) print_char_cursor#49 1.8333333333333333
(byte*) print_line_cursor
(byte*) print_line_cursor#1 16.5
(byte*) print_line_cursor#8 22.0
(void()) print_ln()
(byte*) print_screen
(void()) print_word((word) print_word::w)
(word) print_word::w
(word) print_word::w#0 2.0
(word) rand_seed loadstore 40.0
(struct node*) root
(struct node*) root#11 17.499999999999996
(struct node*) root#20 17.166666666666664
(void()) start()
(word()) sum()
(struct node*) sum::current
(struct node*) sum::current#1 4.0
(struct node*) sum::current#2 202.0
(struct node*) sum::current#3 68.0
(word) sum::return
(word) sum::return#2 22.0
(word) sum::s
(word) sum::s#2 101.0
(word) sum::s#3 53.25

Initial phi equivalence classes
[ main::c#8 main::c#2 ]
[ main::i#3 main::i#2 ]
[ free_#22 free_#13 ]
[ root#20 root#11 ]
[ print_line_cursor#8 print_line_cursor#1 ]
[ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
[ print_char::ch#3 print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
[ print_char_cursor#26 print_char_cursor#49 print_char_cursor#10 ]
[ sum::current#3 sum::current#1 sum::current#2 ]
[ sum::s#3 sum::s#2 ]
Added variable last_time to live range equivalence class [ last_time ]
Added variable rand_seed to live range equivalence class [ rand_seed ]
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 Ticks#1 to live range equivalence class [ Ticks#1 ]
Added variable Ticks#12 to live range equivalence class [ Ticks#12 ]
Added variable print_word::w#0 to live range equivalence class [ print_word::w#0 ]
Added variable print_byte::$0 to live range equivalence class [ print_byte::$0 ]
Added variable print_byte::$2 to live range equivalence class [ print_byte::$2 ]
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 alloc::$1 to live range equivalence class [ alloc::$1 ]
Added variable alloc::return#0 to live range equivalence class [ alloc::return#0 ]
Complete equivalence classes
[ main::c#8 main::c#2 ]
[ main::i#3 main::i#2 ]
[ free_#22 free_#13 ]
[ root#20 root#11 ]
[ print_line_cursor#8 print_line_cursor#1 ]
[ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
[ print_char::ch#3 print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
[ print_char_cursor#26 print_char_cursor#49 print_char_cursor#10 ]
[ sum::current#3 sum::current#1 sum::current#2 ]
[ sum::s#3 sum::s#2 ]
[ last_time ]
[ rand_seed ]
[ prepend::x#0 ]
[ sum::return#2 ]
[ main::$5 ]
[ Ticks#1 ]
[ Ticks#12 ]
[ print_word::w#0 ]
[ print_byte::$0 ]
[ print_byte::$2 ]
[ alloc::return#2 ]
[ prepend::new#1 ]
[ alloc::$1 ]
[ alloc::return#0 ]
Allocated zp[1]:2 [ main::c#8 main::c#2 ]
Allocated zp[2]:3 [ main::i#3 main::i#2 ]
Allocated zp[2]:5 [ free_#22 free_#13 ]
Allocated zp[2]:7 [ root#20 root#11 ]
Allocated zp[2]:9 [ print_line_cursor#8 print_line_cursor#1 ]
Allocated zp[1]:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
Allocated zp[1]:12 [ print_char::ch#3 print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
Allocated zp[2]:13 [ print_char_cursor#26 print_char_cursor#49 print_char_cursor#10 ]
Allocated zp[2]:15 [ sum::current#3 sum::current#1 sum::current#2 ]
Allocated zp[2]:17 [ sum::s#3 sum::s#2 ]
Allocated zp[2]:19 [ last_time ]
Allocated zp[2]:21 [ rand_seed ]
Allocated zp[2]:23 [ prepend::x#0 ]
Allocated zp[2]:25 [ sum::return#2 ]
Allocated zp[2]:27 [ main::$5 ]
Allocated zp[2]:29 [ Ticks#1 ]
Allocated zp[2]:31 [ Ticks#12 ]
Allocated zp[2]:33 [ print_word::w#0 ]
Allocated zp[1]:35 [ print_byte::$0 ]
Allocated zp[1]:36 [ print_byte::$2 ]
Allocated zp[2]:37 [ alloc::return#2 ]
Allocated zp[2]:39 [ prepend::new#1 ]
Allocated zp[2]:41 [ alloc::$1 ]
Allocated zp[2]:43 [ alloc::return#0 ]

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .const OFFSET_STRUCT_NODE_VALUE = 2
  .label last_time = $13
  .label rand_seed = $15
  .label print_line_cursor = 9
  .label print_char_cursor = $d
  .label Ticks = $1d
  .label free_ = 5
  .label root = 7
  .label Ticks_1 = $1f
  // @begin
__bbegin:
  jmp __b1
  // @1
__b1:
  // [1] (word) last_time ← (word) 0 -- vwuz1=vwuc1 
  lda #<0
  sta.z last_time
  lda #>0
  sta.z last_time+1
  jmp __b2
  // @2
__b2:
  // [2] (word) rand_seed ← (word) 0 -- vwuz1=vwuc1 
  lda #<0
  sta.z rand_seed
  lda #>0
  sta.z rand_seed+1
  // [3] phi from @2 to @3 [phi:@2->@3]
__b3_from___b2:
  jmp __b3
  // @3
__b3:
  // [4] call main 
  // [6] phi from @3 to main [phi:@3->main]
main_from___b3:
  jsr main
  // [5] phi from @3 to @end [phi:@3->@end]
__bend_from___b3:
  jmp __bend
  // @end
__bend:
  // main
main: {
    .label __5 = $1b
    .label i = 3
    .label c = 2
    // [7] call start 
    jsr start
    // [8] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [8] phi (byte) main::c#8 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z c
    // [8] phi (byte*) print_char_cursor#49 = (byte*) 1024 [phi:main->main::@1#1] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_char_cursor
    lda #>$400
    sta.z print_char_cursor+1
    jmp __b1
    // [8] phi from main::@7 to main::@1 [phi:main::@7->main::@1]
  __b1_from___b7:
    // [8] phi (byte) main::c#8 = (byte) main::c#2 [phi:main::@7->main::@1#0] -- register_copy 
    // [8] phi (byte*) print_char_cursor#49 = (byte*) print_char_cursor#10 [phi:main::@7->main::@1#1] -- register_copy 
    jmp __b1
    // main::@1
  __b1:
    // [9] call init 
    // [78] phi from main::@1 to init [phi:main::@1->init]
  init_from___b1:
    jsr init
    // [10] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  __b2_from___b1:
    // [10] phi (struct node*) root#20 = (struct node*) 0 [phi:main::@1->main::@2#0] -- pssz1=pssc1 
    lda #<0
    sta.z root
    lda #>0
    sta.z root+1
    // [10] phi (word) free_#22 = (byte) 0 [phi:main::@1->main::@2#1] -- vwuz1=vbuc1 
    lda #<0
    sta.z free_
    lda #>0
    sta.z free_+1
    // [10] phi (word) main::i#3 = (byte) 0 [phi:main::@1->main::@2#2] -- vwuz1=vbuc1 
    lda #<0
    sta.z i
    lda #>0
    sta.z i+1
    jmp __b2
    // [10] phi from main::@5 to main::@2 [phi:main::@5->main::@2]
  __b2_from___b5:
    // [10] phi (struct node*) root#20 = (struct node*) root#11 [phi:main::@5->main::@2#0] -- register_copy 
    // [10] phi (word) free_#22 = (word) free_#13 [phi:main::@5->main::@2#1] -- register_copy 
    // [10] phi (word) main::i#3 = (word) main::i#2 [phi:main::@5->main::@2#2] -- register_copy 
    jmp __b2
    // main::@2
  __b2:
    // [11] (word) prepend::x#0 ← (word) main::i#3 -- vwuz1=vwuz2 
    lda.z i
    sta.z prepend.x
    lda.z i+1
    sta.z prepend.x+1
    // [12] call prepend 
    // [66] phi from main::@2 to prepend [phi:main::@2->prepend]
  prepend_from___b2:
    jsr prepend
    jmp __b5
    // main::@5
  __b5:
    // [13] (word) main::i#2 ← ++ (word) main::i#3 -- vwuz1=_inc_vwuz1 
    inc.z i
    bne !+
    inc.z i+1
  !:
    // [14] if((word) main::i#2!=(word) $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
    // [15] phi from main::@5 to main::@3 [phi:main::@5->main::@3]
  __b3_from___b5:
    jmp __b3
    // main::@3
  __b3:
    // [16] call sum 
    jsr sum
    // [17] (word) sum::return#2 ← (word) sum::s#3 -- vwuz1=vwuz2 
    lda.z sum.s
    sta.z sum.return
    lda.z sum.s+1
    sta.z sum.return+1
    jmp __b6
    // main::@6
  __b6:
    // [18] (word~) main::$5 ← (word) sum::return#2 -- vwuz1=vwuz2 
    lda.z sum.return
    sta.z __5
    lda.z sum.return+1
    sta.z __5+1
    // [19] (byte) print_char::ch#2 ← (byte)(word~) main::$5 -- vbuz1=_byte_vwuz2 
    lda.z __5
    sta.z print_char.ch
    // [20] call print_char 
    // [53] phi from main::@6 to print_char [phi:main::@6->print_char]
  print_char_from___b6:
    // [53] phi (byte*) print_char_cursor#26 = (byte*) print_char_cursor#49 [phi:main::@6->print_char#0] -- register_copy 
    // [53] phi (byte) print_char::ch#3 = (byte) print_char::ch#2 [phi:main::@6->print_char#1] -- register_copy 
    jsr print_char
    jmp __b7
    // main::@7
  __b7:
    // [21] (byte) main::c#2 ← ++ (byte) main::c#8 -- vbuz1=_inc_vbuz1 
    inc.z c
    // [22] if((byte) main::c#2!=(byte) 5) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #5
    cmp.z c
    bne __b1_from___b7
    // [23] phi from main::@7 to main::@4 [phi:main::@7->main::@4]
  __b4_from___b7:
    jmp __b4
    // main::@4
  __b4:
    // [24] call end 
    jsr end
    jmp __breturn
    // main::@return
  __breturn:
    // [25] return 
    rts
}
  // end
end: {
    // [26] (word) Ticks#1 ← (word) last_time -- vwuz1=vwuz2 
    lda.z last_time
    sta.z Ticks
    lda.z last_time+1
    sta.z Ticks+1
    // [27] call start 
    jsr start
    jmp __b1
    // end::@1
  __b1:
    // [28] (word) last_time ← (word) last_time - (word) Ticks#1 -- 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
    // [29] (word) Ticks#12 ← (word) last_time -- vwuz1=vwuz2 
    lda.z last_time
    sta.z Ticks_1
    lda.z last_time+1
    sta.z Ticks_1+1
    // [30] (word) print_word::w#0 ← (word) Ticks#12 -- vwuz1=vwuz2 
    lda.z Ticks_1
    sta.z print_word.w
    lda.z Ticks_1+1
    sta.z print_word.w+1
    // [31] call print_word 
    jsr print_word
    // [32] phi from end::@1 to end::@2 [phi:end::@1->end::@2]
  __b2_from___b1:
    jmp __b2
    // end::@2
  __b2:
    // [33] call print_ln 
    // [35] phi from end::@2 to print_ln [phi:end::@2->print_ln]
  print_ln_from___b2:
    jsr print_ln
    jmp __breturn
    // end::@return
  __breturn:
    // [34] return 
    rts
}
  // print_ln
// Print a newline
print_ln: {
    // [36] phi from print_ln to print_ln::@1 [phi:print_ln->print_ln::@1]
  __b1_from_print_ln:
    // [36] phi (byte*) print_line_cursor#8 = (byte*) 1024 [phi:print_ln->print_ln::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_line_cursor
    lda #>$400
    sta.z print_line_cursor+1
    jmp __b1
    // [36] phi from print_ln::@1 to print_ln::@1 [phi:print_ln::@1->print_ln::@1]
  __b1_from___b1:
    // [36] phi (byte*) print_line_cursor#8 = (byte*) print_line_cursor#1 [phi:print_ln::@1->print_ln::@1#0] -- register_copy 
    jmp __b1
    // print_ln::@1
  __b1:
    // [37] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $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
  !:
    // [38] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#10) 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:
    // [39] return 
    rts
}
  // print_word
// Print a word as HEX
// print_word(word zp($21) w)
print_word: {
    .label w = $21
    // [40] (byte) print_byte::b#0 ← > (word) print_word::w#0 -- vbuz1=_hi_vwuz2 
    lda.z w+1
    sta.z print_byte.b
    // [41] call print_byte 
    // [45] phi from print_word to print_byte [phi:print_word->print_byte]
  print_byte_from_print_word:
    // [45] phi (byte) print_byte::b#2 = (byte) print_byte::b#0 [phi:print_word->print_byte#0] -- register_copy 
    jsr print_byte
    jmp __b1
    // print_word::@1
  __b1:
    // [42] (byte) print_byte::b#1 ← < (word) print_word::w#0 -- vbuz1=_lo_vwuz2 
    lda.z w
    sta.z print_byte.b
    // [43] call print_byte 
    // [45] phi from print_word::@1 to print_byte [phi:print_word::@1->print_byte]
  print_byte_from___b1:
    // [45] phi (byte) print_byte::b#2 = (byte) print_byte::b#1 [phi:print_word::@1->print_byte#0] -- register_copy 
    jsr print_byte
    jmp __breturn
    // print_word::@return
  __breturn:
    // [44] return 
    rts
}
  // print_byte
// Print a byte as HEX
// print_byte(byte zp($b) b)
print_byte: {
    .label __0 = $23
    .label __2 = $24
    .label b = $b
    // [46] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4 -- vbuz1=vbuz2_ror_4 
    lda.z b
    lsr
    lsr
    lsr
    lsr
    sta.z __0
    // [47] (byte) print_char::ch#0 ← *((const byte*) print_hextab + (byte~) print_byte::$0) -- vbuz1=pbuc1_derefidx_vbuz2 
    ldy.z __0
    lda print_hextab,y
    sta.z print_char.ch
    // [48] call print_char 
    // [53] phi from print_byte to print_char [phi:print_byte->print_char]
  print_char_from_print_byte:
    // [53] phi (byte*) print_char_cursor#26 = (byte*) print_char_cursor#10 [phi:print_byte->print_char#0] -- register_copy 
    // [53] phi (byte) print_char::ch#3 = (byte) print_char::ch#0 [phi:print_byte->print_char#1] -- register_copy 
    jsr print_char
    jmp __b1
    // print_byte::@1
  __b1:
    // [49] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f -- vbuz1=vbuz2_band_vbuc1 
    lda #$f
    and.z b
    sta.z __2
    // [50] (byte) print_char::ch#1 ← *((const byte*) print_hextab + (byte~) print_byte::$2) -- vbuz1=pbuc1_derefidx_vbuz2 
    ldy.z __2
    lda print_hextab,y
    sta.z print_char.ch
    // [51] call print_char 
    // [53] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char]
  print_char_from___b1:
    // [53] phi (byte*) print_char_cursor#26 = (byte*) print_char_cursor#10 [phi:print_byte::@1->print_char#0] -- register_copy 
    // [53] phi (byte) print_char::ch#3 = (byte) print_char::ch#1 [phi:print_byte::@1->print_char#1] -- register_copy 
    jsr print_char
    jmp __breturn
    // print_byte::@return
  __breturn:
    // [52] return 
    rts
}
  // print_char
// Print a single char
// print_char(byte zp($c) ch)
print_char: {
    .label ch = $c
    // [54] *((byte*) print_char_cursor#26) ← (byte) print_char::ch#3 -- _deref_pbuz1=vbuz2 
    lda.z ch
    ldy #0
    sta (print_char_cursor),y
    // [55] (byte*) print_char_cursor#10 ← ++ (byte*) print_char_cursor#26 -- pbuz1=_inc_pbuz1 
    inc.z print_char_cursor
    bne !+
    inc.z print_char_cursor+1
  !:
    jmp __breturn
    // print_char::@return
  __breturn:
    // [56] 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
    // [58] (word) rand_seed ← (word) $194a -- vwuz1=vwuc1 
    lda #<$194a
    sta.z rand_seed
    lda #>$194a
    sta.z rand_seed+1
    jmp __breturn
    // start::@return
  __breturn:
    // [59] return 
    rts
}
  // sum
sum: {
    .label current = $f
    .label s = $11
    .label return = $19
    // [60] (struct node*) sum::current#1 ← (struct node*) root#11 -- pssz1=pssz2 
    lda.z root
    sta.z current
    lda.z root+1
    sta.z current+1
    // [61] phi from sum to sum::@1 [phi:sum->sum::@1]
  __b1_from_sum:
    // [61] phi (word) sum::s#3 = (byte) 0 [phi:sum->sum::@1#0] -- vwuz1=vbuc1 
    lda #<0
    sta.z s
    lda #>0
    sta.z s+1
    // [61] phi (struct node*) sum::current#3 = (struct node*) sum::current#1 [phi:sum->sum::@1#1] -- register_copy 
    jmp __b1
    // sum::@1
  __b1:
    // [62] if((struct node*)(word) 0!=(struct node*) 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:
    // [63] return 
    rts
    // sum::@2
  __b2:
    // [64] (word) sum::s#2 ← (word) sum::s#3 + *((word*)(struct node*) sum::current#3 + (const byte) 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
    // [65] (struct node*) sum::current#2 ← *((struct node**)(struct node*) sum::current#3) -- pssz1=_deref_pptz1 
    ldy #0
    lda (current),y
    pha
    iny
    lda (current),y
    sta.z current+1
    pla
    sta.z current
    // [61] phi from sum::@2 to sum::@1 [phi:sum::@2->sum::@1]
  __b1_from___b2:
    // [61] phi (word) sum::s#3 = (word) sum::s#2 [phi:sum::@2->sum::@1#0] -- register_copy 
    // [61] phi (struct node*) sum::current#3 = (struct node*) sum::current#2 [phi:sum::@2->sum::@1#1] -- register_copy 
    jmp __b1
}
  // prepend
// prepend(word zp($17) x)
prepend: {
    .label new = $27
    .label x = $17
    // [67] call alloc 
    jsr alloc
    // [68] (struct node*) alloc::return#2 ← (struct node*) alloc::return#0 -- pssz1=pssz2 
    lda.z alloc.return
    sta.z alloc.return_1
    lda.z alloc.return+1
    sta.z alloc.return_1+1
    jmp __b1
    // prepend::@1
  __b1:
    // [69] (struct node*) prepend::new#1 ← (struct node*) alloc::return#2 -- pssz1=pssz2 
    lda.z alloc.return_1
    sta.z new
    lda.z alloc.return_1+1
    sta.z new+1
    // [70] *((struct node**)(struct node*) prepend::new#1) ← (struct node*) root#20 -- _deref_pptz1=pssz2 
    ldy #0
    lda.z root
    sta (new),y
    iny
    lda.z root+1
    sta (new),y
    // [71] *((word*)(struct node*) prepend::new#1 + (const byte) OFFSET_STRUCT_NODE_VALUE) ← (word) 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
    // [72] (struct node*) root#11 ← (struct node*) prepend::new#1 -- pssz1=pssz2 
    lda.z new
    sta.z root
    lda.z new+1
    sta.z root+1
    jmp __breturn
    // prepend::@return
  __breturn:
    // [73] return 
    rts
}
  // alloc
alloc: {
    .label __1 = $29
    .label return = $2b
    .label return_1 = $25
    // [74] (word~) alloc::$1 ← (word) free_#22 << (byte) 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
    // [75] (struct node*) alloc::return#0 ← (const struct node*) heap + (word~) alloc::$1 -- pssz1=pssc1_plus_vwuz2 
    lda.z __1
    clc
    adc #<heap
    sta.z return
    lda.z __1+1
    adc #>heap
    sta.z return+1
    // [76] (word) free_#13 ← ++ (word) free_#22 -- vwuz1=_inc_vwuz1 
    inc.z free_
    bne !+
    inc.z free_+1
  !:
    jmp __breturn
    // alloc::@return
  __breturn:
    // [77] return 
    rts
}
  // init
init: {
    jmp __breturn
    // init::@return
  __breturn:
    // [79] return 
    rts
}
  // File Data
  print_hextab: .text "0123456789abcdef"
  heap: .fill 4*$fa0, 0

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [1] (word) last_time ← (word) 0 [ last_time ] (  [ last_time ] ) always clobbers reg byte a 
Statement [2] (word) rand_seed ← (word) 0 [ last_time ] (  [ last_time ] ) always clobbers reg byte a 
Statement [11] (word) prepend::x#0 ← (word) main::i#3 [ last_time print_char_cursor#49 main::c#8 main::i#3 free_#22 root#20 prepend::x#0 ] ( main:4 [ last_time print_char_cursor#49 main::c#8 main::i#3 free_#22 root#20 prepend::x#0 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::c#8 main::c#2 ]
Statement [14] if((word) main::i#2!=(word) $bb8) goto main::@2 [ last_time print_char_cursor#49 main::c#8 main::i#2 free_#13 root#11 ] ( main:4 [ last_time print_char_cursor#49 main::c#8 main::i#2 free_#13 root#11 ] ) always clobbers reg byte a 
Statement [17] (word) sum::return#2 ← (word) sum::s#3 [ last_time print_char_cursor#49 main::c#8 sum::return#2 ] ( main:4 [ last_time print_char_cursor#49 main::c#8 sum::return#2 ] ) always clobbers reg byte a 
Statement [18] (word~) main::$5 ← (word) sum::return#2 [ last_time print_char_cursor#49 main::c#8 main::$5 ] ( main:4 [ last_time print_char_cursor#49 main::c#8 main::$5 ] ) always clobbers reg byte a 
Statement [19] (byte) print_char::ch#2 ← (byte)(word~) main::$5 [ last_time print_char_cursor#49 main::c#8 print_char::ch#2 ] ( main:4 [ last_time print_char_cursor#49 main::c#8 print_char::ch#2 ] ) always clobbers reg byte a 
Statement [26] (word) Ticks#1 ← (word) last_time [ print_char_cursor#10 Ticks#1 ] ( main:4::end:24 [ print_char_cursor#10 Ticks#1 ] ) always clobbers reg byte a 
Statement [28] (word) last_time ← (word) last_time - (word) Ticks#1 [ last_time print_char_cursor#10 ] ( main:4::end:24 [ last_time print_char_cursor#10 ] ) always clobbers reg byte a 
Statement [29] (word) Ticks#12 ← (word) last_time [ print_char_cursor#10 Ticks#12 ] ( main:4::end:24 [ print_char_cursor#10 Ticks#12 ] ) always clobbers reg byte a 
Statement [30] (word) print_word::w#0 ← (word) Ticks#12 [ print_char_cursor#10 print_word::w#0 ] ( main:4::end:24 [ print_char_cursor#10 print_word::w#0 ] ) always clobbers reg byte a 
Statement [37] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28 [ print_char_cursor#10 print_line_cursor#1 ] ( main:4::end:24::print_ln:33 [ print_char_cursor#10 print_line_cursor#1 ] ) always clobbers reg byte a 
Statement [38] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#10) goto print_ln::@1 [ print_char_cursor#10 print_line_cursor#1 ] ( main:4::end:24::print_ln:33 [ print_char_cursor#10 print_line_cursor#1 ] ) always clobbers reg byte a 
Statement [40] (byte) print_byte::b#0 ← > (word) print_word::w#0 [ print_char_cursor#10 print_word::w#0 print_byte::b#0 ] ( main:4::end:24::print_word:31 [ print_char_cursor#10 print_word::w#0 print_byte::b#0 ] ) always clobbers reg byte a 
Statement [42] (byte) print_byte::b#1 ← < (word) print_word::w#0 [ print_char_cursor#10 print_byte::b#1 ] ( main:4::end:24::print_word:31 [ print_char_cursor#10 print_byte::b#1 ] ) always clobbers reg byte a 
Statement [46] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4 [ print_char_cursor#10 print_byte::b#2 print_byte::$0 ] ( main:4::end:24::print_word:31::print_byte:41 [ print_word::w#0 print_char_cursor#10 print_byte::b#2 print_byte::$0 ] main:4::end:24::print_word:31::print_byte:43 [ print_char_cursor#10 print_byte::b#2 print_byte::$0 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
Statement [49] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f [ print_char_cursor#10 print_byte::$2 ] ( main:4::end:24::print_word:31::print_byte:41 [ print_word::w#0 print_char_cursor#10 print_byte::$2 ] main:4::end:24::print_word:31::print_byte:43 [ print_char_cursor#10 print_byte::$2 ] ) always clobbers reg byte a 
Statement [54] *((byte*) print_char_cursor#26) ← (byte) print_char::ch#3 [ print_char_cursor#26 ] ( main:4::print_char:20 [ last_time main::c#8 print_char_cursor#26 ] main:4::end:24::print_word:31::print_byte:41::print_char:48 [ print_word::w#0 print_byte::b#2 print_char_cursor#26 ] main:4::end:24::print_word:31::print_byte:43::print_char:48 [ print_byte::b#2 print_char_cursor#26 ] main:4::end:24::print_word:31::print_byte:41::print_char:51 [ print_word::w#0 print_char_cursor#26 ] main:4::end:24::print_word:31::print_byte:43::print_char:51 [ print_char_cursor#26 ] ) always clobbers reg byte y 
Removing always clobbered register reg byte y as potential for zp[1]:2 [ main::c#8 main::c#2 ]
Removing always clobbered register reg byte y as potential for zp[1]:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
Statement asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1  } always clobbers reg byte a reg byte x reg byte y 
Statement [58] (word) rand_seed ← (word) $194a [ ] ( main:4::start:7 [ last_time ] main:4::end:24::start:27 [ print_char_cursor#10 Ticks#1 ] ) always clobbers reg byte a 
Statement [60] (struct node*) sum::current#1 ← (struct node*) root#11 [ sum::current#1 ] ( main:4::sum:16 [ last_time print_char_cursor#49 main::c#8 sum::current#1 ] ) always clobbers reg byte a 
Statement [62] if((struct node*)(word) 0!=(struct node*) sum::current#3) goto sum::@2 [ sum::s#3 sum::current#3 ] ( main:4::sum:16 [ last_time print_char_cursor#49 main::c#8 sum::s#3 sum::current#3 ] ) always clobbers reg byte a 
Statement [64] (word) sum::s#2 ← (word) sum::s#3 + *((word*)(struct node*) sum::current#3 + (const byte) OFFSET_STRUCT_NODE_VALUE) [ sum::current#3 sum::s#2 ] ( main:4::sum:16 [ last_time print_char_cursor#49 main::c#8 sum::current#3 sum::s#2 ] ) always clobbers reg byte a reg byte y 
Statement [65] (struct node*) sum::current#2 ← *((struct node**)(struct node*) sum::current#3) [ sum::current#2 sum::s#2 ] ( main:4::sum:16 [ last_time print_char_cursor#49 main::c#8 sum::current#2 sum::s#2 ] ) always clobbers reg byte a reg byte y 
Statement [68] (struct node*) alloc::return#2 ← (struct node*) alloc::return#0 [ root#20 free_#13 prepend::x#0 alloc::return#2 ] ( main:4::prepend:12 [ last_time print_char_cursor#49 main::c#8 main::i#3 root#20 free_#13 prepend::x#0 alloc::return#2 ] ) always clobbers reg byte a 
Statement [69] (struct node*) prepend::new#1 ← (struct node*) alloc::return#2 [ root#20 free_#13 prepend::x#0 prepend::new#1 ] ( main:4::prepend:12 [ last_time print_char_cursor#49 main::c#8 main::i#3 root#20 free_#13 prepend::x#0 prepend::new#1 ] ) always clobbers reg byte a 
Statement [70] *((struct node**)(struct node*) prepend::new#1) ← (struct node*) root#20 [ free_#13 prepend::x#0 prepend::new#1 ] ( main:4::prepend:12 [ last_time print_char_cursor#49 main::c#8 main::i#3 free_#13 prepend::x#0 prepend::new#1 ] ) always clobbers reg byte a reg byte y 
Statement [71] *((word*)(struct node*) prepend::new#1 + (const byte) OFFSET_STRUCT_NODE_VALUE) ← (word) prepend::x#0 [ free_#13 prepend::new#1 ] ( main:4::prepend:12 [ last_time print_char_cursor#49 main::c#8 main::i#3 free_#13 prepend::new#1 ] ) always clobbers reg byte a reg byte y 
Statement [72] (struct node*) root#11 ← (struct node*) prepend::new#1 [ free_#13 root#11 ] ( main:4::prepend:12 [ last_time print_char_cursor#49 main::c#8 main::i#3 free_#13 root#11 ] ) always clobbers reg byte a 
Statement [74] (word~) alloc::$1 ← (word) free_#22 << (byte) 2 [ free_#22 alloc::$1 ] ( main:4::prepend:12::alloc:67 [ last_time print_char_cursor#49 main::c#8 main::i#3 root#20 prepend::x#0 free_#22 alloc::$1 ] ) always clobbers reg byte a 
Statement [75] (struct node*) alloc::return#0 ← (const struct node*) heap + (word~) alloc::$1 [ free_#22 alloc::return#0 ] ( main:4::prepend:12::alloc:67 [ last_time print_char_cursor#49 main::c#8 main::i#3 root#20 prepend::x#0 free_#22 alloc::return#0 ] ) always clobbers reg byte a 
Statement [1] (word) last_time ← (word) 0 [ last_time ] (  [ last_time ] ) always clobbers reg byte a 
Statement [2] (word) rand_seed ← (word) 0 [ last_time ] (  [ last_time ] ) always clobbers reg byte a 
Statement [11] (word) prepend::x#0 ← (word) main::i#3 [ last_time print_char_cursor#49 main::c#8 main::i#3 free_#22 root#20 prepend::x#0 ] ( main:4 [ last_time print_char_cursor#49 main::c#8 main::i#3 free_#22 root#20 prepend::x#0 ] ) always clobbers reg byte a 
Statement [14] if((word) main::i#2!=(word) $bb8) goto main::@2 [ last_time print_char_cursor#49 main::c#8 main::i#2 free_#13 root#11 ] ( main:4 [ last_time print_char_cursor#49 main::c#8 main::i#2 free_#13 root#11 ] ) always clobbers reg byte a 
Statement [17] (word) sum::return#2 ← (word) sum::s#3 [ last_time print_char_cursor#49 main::c#8 sum::return#2 ] ( main:4 [ last_time print_char_cursor#49 main::c#8 sum::return#2 ] ) always clobbers reg byte a 
Statement [18] (word~) main::$5 ← (word) sum::return#2 [ last_time print_char_cursor#49 main::c#8 main::$5 ] ( main:4 [ last_time print_char_cursor#49 main::c#8 main::$5 ] ) always clobbers reg byte a 
Statement [19] (byte) print_char::ch#2 ← (byte)(word~) main::$5 [ last_time print_char_cursor#49 main::c#8 print_char::ch#2 ] ( main:4 [ last_time print_char_cursor#49 main::c#8 print_char::ch#2 ] ) always clobbers reg byte a 
Statement [26] (word) Ticks#1 ← (word) last_time [ print_char_cursor#10 Ticks#1 ] ( main:4::end:24 [ print_char_cursor#10 Ticks#1 ] ) always clobbers reg byte a 
Statement [28] (word) last_time ← (word) last_time - (word) Ticks#1 [ last_time print_char_cursor#10 ] ( main:4::end:24 [ last_time print_char_cursor#10 ] ) always clobbers reg byte a 
Statement [29] (word) Ticks#12 ← (word) last_time [ print_char_cursor#10 Ticks#12 ] ( main:4::end:24 [ print_char_cursor#10 Ticks#12 ] ) always clobbers reg byte a 
Statement [30] (word) print_word::w#0 ← (word) Ticks#12 [ print_char_cursor#10 print_word::w#0 ] ( main:4::end:24 [ print_char_cursor#10 print_word::w#0 ] ) always clobbers reg byte a 
Statement [37] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28 [ print_char_cursor#10 print_line_cursor#1 ] ( main:4::end:24::print_ln:33 [ print_char_cursor#10 print_line_cursor#1 ] ) always clobbers reg byte a 
Statement [38] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#10) goto print_ln::@1 [ print_char_cursor#10 print_line_cursor#1 ] ( main:4::end:24::print_ln:33 [ print_char_cursor#10 print_line_cursor#1 ] ) always clobbers reg byte a 
Statement [40] (byte) print_byte::b#0 ← > (word) print_word::w#0 [ print_char_cursor#10 print_word::w#0 print_byte::b#0 ] ( main:4::end:24::print_word:31 [ print_char_cursor#10 print_word::w#0 print_byte::b#0 ] ) always clobbers reg byte a 
Statement [42] (byte) print_byte::b#1 ← < (word) print_word::w#0 [ print_char_cursor#10 print_byte::b#1 ] ( main:4::end:24::print_word:31 [ print_char_cursor#10 print_byte::b#1 ] ) always clobbers reg byte a 
Statement [46] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4 [ print_char_cursor#10 print_byte::b#2 print_byte::$0 ] ( main:4::end:24::print_word:31::print_byte:41 [ print_word::w#0 print_char_cursor#10 print_byte::b#2 print_byte::$0 ] main:4::end:24::print_word:31::print_byte:43 [ print_char_cursor#10 print_byte::b#2 print_byte::$0 ] ) always clobbers reg byte a 
Statement [49] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f [ print_char_cursor#10 print_byte::$2 ] ( main:4::end:24::print_word:31::print_byte:41 [ print_word::w#0 print_char_cursor#10 print_byte::$2 ] main:4::end:24::print_word:31::print_byte:43 [ print_char_cursor#10 print_byte::$2 ] ) always clobbers reg byte a 
Statement [54] *((byte*) print_char_cursor#26) ← (byte) print_char::ch#3 [ print_char_cursor#26 ] ( main:4::print_char:20 [ last_time main::c#8 print_char_cursor#26 ] main:4::end:24::print_word:31::print_byte:41::print_char:48 [ print_word::w#0 print_byte::b#2 print_char_cursor#26 ] main:4::end:24::print_word:31::print_byte:43::print_char:48 [ print_byte::b#2 print_char_cursor#26 ] main:4::end:24::print_word:31::print_byte:41::print_char:51 [ print_word::w#0 print_char_cursor#26 ] main:4::end:24::print_word:31::print_byte:43::print_char:51 [ print_char_cursor#26 ] ) always clobbers reg byte y 
Statement asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1  } always clobbers reg byte a reg byte x reg byte y 
Statement [58] (word) rand_seed ← (word) $194a [ ] ( main:4::start:7 [ last_time ] main:4::end:24::start:27 [ print_char_cursor#10 Ticks#1 ] ) always clobbers reg byte a 
Statement [60] (struct node*) sum::current#1 ← (struct node*) root#11 [ sum::current#1 ] ( main:4::sum:16 [ last_time print_char_cursor#49 main::c#8 sum::current#1 ] ) always clobbers reg byte a 
Statement [62] if((struct node*)(word) 0!=(struct node*) sum::current#3) goto sum::@2 [ sum::s#3 sum::current#3 ] ( main:4::sum:16 [ last_time print_char_cursor#49 main::c#8 sum::s#3 sum::current#3 ] ) always clobbers reg byte a 
Statement [64] (word) sum::s#2 ← (word) sum::s#3 + *((word*)(struct node*) sum::current#3 + (const byte) OFFSET_STRUCT_NODE_VALUE) [ sum::current#3 sum::s#2 ] ( main:4::sum:16 [ last_time print_char_cursor#49 main::c#8 sum::current#3 sum::s#2 ] ) always clobbers reg byte a reg byte y 
Statement [65] (struct node*) sum::current#2 ← *((struct node**)(struct node*) sum::current#3) [ sum::current#2 sum::s#2 ] ( main:4::sum:16 [ last_time print_char_cursor#49 main::c#8 sum::current#2 sum::s#2 ] ) always clobbers reg byte a reg byte y 
Statement [68] (struct node*) alloc::return#2 ← (struct node*) alloc::return#0 [ root#20 free_#13 prepend::x#0 alloc::return#2 ] ( main:4::prepend:12 [ last_time print_char_cursor#49 main::c#8 main::i#3 root#20 free_#13 prepend::x#0 alloc::return#2 ] ) always clobbers reg byte a 
Statement [69] (struct node*) prepend::new#1 ← (struct node*) alloc::return#2 [ root#20 free_#13 prepend::x#0 prepend::new#1 ] ( main:4::prepend:12 [ last_time print_char_cursor#49 main::c#8 main::i#3 root#20 free_#13 prepend::x#0 prepend::new#1 ] ) always clobbers reg byte a 
Statement [70] *((struct node**)(struct node*) prepend::new#1) ← (struct node*) root#20 [ free_#13 prepend::x#0 prepend::new#1 ] ( main:4::prepend:12 [ last_time print_char_cursor#49 main::c#8 main::i#3 free_#13 prepend::x#0 prepend::new#1 ] ) always clobbers reg byte a reg byte y 
Statement [71] *((word*)(struct node*) prepend::new#1 + (const byte) OFFSET_STRUCT_NODE_VALUE) ← (word) prepend::x#0 [ free_#13 prepend::new#1 ] ( main:4::prepend:12 [ last_time print_char_cursor#49 main::c#8 main::i#3 free_#13 prepend::new#1 ] ) always clobbers reg byte a reg byte y 
Statement [72] (struct node*) root#11 ← (struct node*) prepend::new#1 [ free_#13 root#11 ] ( main:4::prepend:12 [ last_time print_char_cursor#49 main::c#8 main::i#3 free_#13 root#11 ] ) always clobbers reg byte a 
Statement [74] (word~) alloc::$1 ← (word) free_#22 << (byte) 2 [ free_#22 alloc::$1 ] ( main:4::prepend:12::alloc:67 [ last_time print_char_cursor#49 main::c#8 main::i#3 root#20 prepend::x#0 free_#22 alloc::$1 ] ) always clobbers reg byte a 
Statement [75] (struct node*) alloc::return#0 ← (const struct node*) heap + (word~) alloc::$1 [ free_#22 alloc::return#0 ] ( main:4::prepend:12::alloc:67 [ last_time print_char_cursor#49 main::c#8 main::i#3 root#20 prepend::x#0 free_#22 alloc::return#0 ] ) always clobbers reg byte a 
Potential registers zp[1]:2 [ main::c#8 main::c#2 ] : zp[1]:2 , reg byte x , 
Potential registers zp[2]:3 [ main::i#3 main::i#2 ] : zp[2]:3 , 
Potential registers zp[2]:5 [ free_#22 free_#13 ] : zp[2]:5 , 
Potential registers zp[2]:7 [ root#20 root#11 ] : zp[2]:7 , 
Potential registers zp[2]:9 [ print_line_cursor#8 print_line_cursor#1 ] : zp[2]:9 , 
Potential registers zp[1]:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] : zp[1]:11 , reg byte x , 
Potential registers zp[1]:12 [ print_char::ch#3 print_char::ch#2 print_char::ch#0 print_char::ch#1 ] : zp[1]:12 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:13 [ print_char_cursor#26 print_char_cursor#49 print_char_cursor#10 ] : zp[2]:13 , 
Potential registers zp[2]:15 [ sum::current#3 sum::current#1 sum::current#2 ] : zp[2]:15 , 
Potential registers zp[2]:17 [ sum::s#3 sum::s#2 ] : zp[2]:17 , 
Potential registers zp[2]:19 [ last_time ] : zp[2]:19 , 
Potential registers zp[2]:21 [ rand_seed ] : zp[2]:21 , 
Potential registers zp[2]:23 [ prepend::x#0 ] : zp[2]:23 , 
Potential registers zp[2]:25 [ sum::return#2 ] : zp[2]:25 , 
Potential registers zp[2]:27 [ main::$5 ] : zp[2]:27 , 
Potential registers zp[2]:29 [ Ticks#1 ] : zp[2]:29 , 
Potential registers zp[2]:31 [ Ticks#12 ] : zp[2]:31 , 
Potential registers zp[2]:33 [ print_word::w#0 ] : zp[2]:33 , 
Potential registers zp[1]:35 [ print_byte::$0 ] : zp[1]:35 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:36 [ print_byte::$2 ] : zp[1]:36 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:37 [ alloc::return#2 ] : zp[2]:37 , 
Potential registers zp[2]:39 [ prepend::new#1 ] : zp[2]:39 , 
Potential registers zp[2]:41 [ alloc::$1 ] : zp[2]:41 , 
Potential registers zp[2]:43 [ alloc::return#0 ] : zp[2]:43 , 

REGISTER UPLIFT SCOPES
Uplift Scope [sum] 274: zp[2]:15 [ sum::current#3 sum::current#1 sum::current#2 ] 154.25: zp[2]:17 [ sum::s#3 sum::s#2 ] 22: zp[2]:25 [ sum::return#2 ] 
Uplift Scope [main] 252.5: zp[2]:3 [ main::i#3 main::i#2 ] 18.19: zp[1]:2 [ main::c#8 main::c#2 ] 11: zp[2]:27 [ main::$5 ] 
Uplift Scope [] 40: zp[2]:21 [ rand_seed ] 38.5: zp[2]:9 [ print_line_cursor#8 print_line_cursor#1 ] 34.67: zp[2]:7 [ root#20 root#11 ] 29.58: zp[2]:5 [ free_#22 free_#13 ] 12.27: zp[2]:13 [ print_char_cursor#26 print_char_cursor#49 print_char_cursor#10 ] 4: zp[2]:31 [ Ticks#12 ] 2: zp[2]:29 [ Ticks#1 ] 0.45: zp[2]:19 [ last_time ] 
Uplift Scope [print_char] 47: zp[1]:12 [ print_char::ch#3 print_char::ch#2 print_char::ch#0 print_char::ch#1 ] 
Uplift Scope [prepend] 17.17: zp[2]:23 [ prepend::x#0 ] 1.33: zp[2]:39 [ prepend::new#1 ] 
Uplift Scope [print_byte] 10: zp[1]:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] 4: zp[1]:35 [ print_byte::$0 ] 4: zp[1]:36 [ print_byte::$2 ] 
Uplift Scope [alloc] 4: zp[2]:37 [ alloc::return#2 ] 4: zp[2]:41 [ alloc::$1 ] 1: zp[2]:43 [ alloc::return#0 ] 
Uplift Scope [print_word] 2: zp[2]:33 [ print_word::w#0 ] 
Uplift Scope [RADIX] 
Uplift Scope [print_ln] 
Uplift Scope [start] 
Uplift Scope [end] 
Uplift Scope [node] 
Uplift Scope [init] 

Uplifting [sum] best 18557 combination zp[2]:15 [ sum::current#3 sum::current#1 sum::current#2 ] zp[2]:17 [ sum::s#3 sum::s#2 ] zp[2]:25 [ sum::return#2 ] 
Uplifting [main] best 18467 combination zp[2]:3 [ main::i#3 main::i#2 ] reg byte x [ main::c#8 main::c#2 ] zp[2]:27 [ main::$5 ] 
Uplifting [] best 18467 combination zp[2]:21 [ rand_seed ] zp[2]:9 [ print_line_cursor#8 print_line_cursor#1 ] zp[2]:7 [ root#20 root#11 ] zp[2]:5 [ free_#22 free_#13 ] zp[2]:13 [ print_char_cursor#26 print_char_cursor#49 print_char_cursor#10 ] zp[2]:31 [ Ticks#12 ] zp[2]:29 [ Ticks#1 ] zp[2]:19 [ last_time ] 
Uplifting [print_char] best 18428 combination reg byte a [ print_char::ch#3 print_char::ch#2 print_char::ch#0 print_char::ch#1 ] 
Uplifting [prepend] best 18428 combination zp[2]:23 [ prepend::x#0 ] zp[2]:39 [ prepend::new#1 ] 
Uplifting [print_byte] best 18414 combination reg byte x [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte a [ print_byte::$0 ] reg byte x [ print_byte::$2 ] 
Uplifting [alloc] best 18414 combination zp[2]:37 [ alloc::return#2 ] zp[2]:41 [ alloc::$1 ] zp[2]:43 [ alloc::return#0 ] 
Uplifting [print_word] best 18414 combination zp[2]:33 [ print_word::w#0 ] 
Uplifting [RADIX] best 18414 combination 
Uplifting [print_ln] best 18414 combination 
Uplifting [start] best 18414 combination 
Uplifting [end] best 18414 combination 
Uplifting [node] best 18414 combination 
Uplifting [init] best 18414 combination 
Coalescing zero page register [ zp[2]:3 [ main::i#3 main::i#2 ] ] with [ zp[2]:23 [ prepend::x#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:7 [ root#20 root#11 ] ] with [ zp[2]:15 [ sum::current#3 sum::current#1 sum::current#2 ] ] - score: 1
Coalescing zero page register [ zp[2]:17 [ sum::s#3 sum::s#2 ] ] with [ zp[2]:25 [ sum::return#2 ] ] - score: 1
Coalescing zero page register [ zp[2]:31 [ Ticks#12 ] ] with [ zp[2]:33 [ print_word::w#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:37 [ alloc::return#2 ] ] with [ zp[2]:39 [ prepend::new#1 ] ] - score: 1
Coalescing zero page register [ zp[2]:37 [ alloc::return#2 prepend::new#1 ] ] with [ zp[2]:43 [ alloc::return#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:17 [ sum::s#3 sum::s#2 sum::return#2 ] ] with [ zp[2]:27 [ main::$5 ] ] - score: 1
Coalescing zero page register [ zp[2]:37 [ alloc::return#2 prepend::new#1 alloc::return#0 ] ] with [ zp[2]:41 [ alloc::$1 ] ] - score: 1
Coalescing zero page register [ zp[2]:9 [ print_line_cursor#8 print_line_cursor#1 ] ] with [ zp[2]:3 [ main::i#3 main::i#2 prepend::x#0 ] ]
Coalescing zero page register [ zp[2]:17 [ sum::s#3 sum::s#2 sum::return#2 main::$5 ] ] with [ zp[2]:5 [ free_#22 free_#13 ] ]
Coalescing zero page register [ zp[2]:37 [ alloc::return#2 prepend::new#1 alloc::return#0 alloc::$1 ] ] with [ zp[2]:29 [ Ticks#1 ] ]
Allocated (was zp[2]:7) zp[2]:2 [ root#20 root#11 sum::current#3 sum::current#1 sum::current#2 ]
Allocated (was zp[2]:9) zp[2]:4 [ print_line_cursor#8 print_line_cursor#1 main::i#3 main::i#2 prepend::x#0 ]
Allocated (was zp[2]:13) zp[2]:6 [ print_char_cursor#26 print_char_cursor#49 print_char_cursor#10 ]
Allocated (was zp[2]:17) zp[2]:8 [ sum::s#3 sum::s#2 sum::return#2 main::$5 free_#22 free_#13 ]
Allocated (was zp[2]:19) zp[2]:10 [ last_time ]
Allocated (was zp[2]:21) zp[2]:12 [ rand_seed ]
Allocated (was zp[2]:31) zp[2]:14 [ Ticks#12 print_word::w#0 ]
Allocated (was zp[2]:37) zp[2]:16 [ alloc::return#2 prepend::new#1 alloc::return#0 alloc::$1 Ticks#1 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .const OFFSET_STRUCT_NODE_VALUE = 2
  .label last_time = $a
  .label rand_seed = $c
  .label print_line_cursor = 4
  .label print_char_cursor = 6
  .label Ticks = $10
  .label free_ = 8
  .label root = 2
  .label Ticks_1 = $e
  // @begin
__bbegin:
  jmp __b1
  // @1
__b1:
  // [1] (word) last_time ← (word) 0 -- vwuz1=vwuc1 
  lda #<0
  sta.z last_time
  lda #>0
  sta.z last_time+1
  jmp __b2
  // @2
__b2:
  // [2] (word) rand_seed ← (word) 0 -- vwuz1=vwuc1 
  lda #<0
  sta.z rand_seed
  lda #>0
  sta.z rand_seed+1
  // [3] phi from @2 to @3 [phi:@2->@3]
__b3_from___b2:
  jmp __b3
  // @3
__b3:
  // [4] call main 
  // [6] phi from @3 to main [phi:@3->main]
main_from___b3:
  jsr main
  // [5] phi from @3 to @end [phi:@3->@end]
__bend_from___b3:
  jmp __bend
  // @end
__bend:
  // main
main: {
    .label __5 = 8
    .label i = 4
    // [7] call start 
    jsr start
    // [8] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [8] phi (byte) main::c#8 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 
    ldx #0
    // [8] phi (byte*) print_char_cursor#49 = (byte*) 1024 [phi:main->main::@1#1] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_char_cursor
    lda #>$400
    sta.z print_char_cursor+1
    jmp __b1
    // [8] phi from main::@7 to main::@1 [phi:main::@7->main::@1]
  __b1_from___b7:
    // [8] phi (byte) main::c#8 = (byte) main::c#2 [phi:main::@7->main::@1#0] -- register_copy 
    // [8] phi (byte*) print_char_cursor#49 = (byte*) print_char_cursor#10 [phi:main::@7->main::@1#1] -- register_copy 
    jmp __b1
    // main::@1
  __b1:
    // [9] call init 
    // [78] phi from main::@1 to init [phi:main::@1->init]
  init_from___b1:
    jsr init
    // [10] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  __b2_from___b1:
    // [10] phi (struct node*) root#20 = (struct node*) 0 [phi:main::@1->main::@2#0] -- pssz1=pssc1 
    lda #<0
    sta.z root
    lda #>0
    sta.z root+1
    // [10] phi (word) free_#22 = (byte) 0 [phi:main::@1->main::@2#1] -- vwuz1=vbuc1 
    lda #<0
    sta.z free_
    lda #>0
    sta.z free_+1
    // [10] phi (word) main::i#3 = (byte) 0 [phi:main::@1->main::@2#2] -- vwuz1=vbuc1 
    lda #<0
    sta.z i
    lda #>0
    sta.z i+1
    jmp __b2
    // [10] phi from main::@5 to main::@2 [phi:main::@5->main::@2]
  __b2_from___b5:
    // [10] phi (struct node*) root#20 = (struct node*) root#11 [phi:main::@5->main::@2#0] -- register_copy 
    // [10] phi (word) free_#22 = (word) free_#13 [phi:main::@5->main::@2#1] -- register_copy 
    // [10] phi (word) main::i#3 = (word) main::i#2 [phi:main::@5->main::@2#2] -- register_copy 
    jmp __b2
    // main::@2
  __b2:
    // [11] (word) prepend::x#0 ← (word) main::i#3
    // [12] call prepend 
    // [66] phi from main::@2 to prepend [phi:main::@2->prepend]
  prepend_from___b2:
    jsr prepend
    jmp __b5
    // main::@5
  __b5:
    // [13] (word) main::i#2 ← ++ (word) main::i#3 -- vwuz1=_inc_vwuz1 
    inc.z i
    bne !+
    inc.z i+1
  !:
    // [14] if((word) main::i#2!=(word) $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
    // [15] phi from main::@5 to main::@3 [phi:main::@5->main::@3]
  __b3_from___b5:
    jmp __b3
    // main::@3
  __b3:
    // [16] call sum 
    jsr sum
    // [17] (word) sum::return#2 ← (word) sum::s#3
    jmp __b6
    // main::@6
  __b6:
    // [18] (word~) main::$5 ← (word) sum::return#2
    // [19] (byte) print_char::ch#2 ← (byte)(word~) main::$5 -- vbuaa=_byte_vwuz1 
    lda.z __5
    // [20] call print_char 
    // [53] phi from main::@6 to print_char [phi:main::@6->print_char]
  print_char_from___b6:
    // [53] phi (byte*) print_char_cursor#26 = (byte*) print_char_cursor#49 [phi:main::@6->print_char#0] -- register_copy 
    // [53] phi (byte) print_char::ch#3 = (byte) print_char::ch#2 [phi:main::@6->print_char#1] -- register_copy 
    jsr print_char
    jmp __b7
    // main::@7
  __b7:
    // [21] (byte) main::c#2 ← ++ (byte) main::c#8 -- vbuxx=_inc_vbuxx 
    inx
    // [22] if((byte) main::c#2!=(byte) 5) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #5
    bne __b1_from___b7
    // [23] phi from main::@7 to main::@4 [phi:main::@7->main::@4]
  __b4_from___b7:
    jmp __b4
    // main::@4
  __b4:
    // [24] call end 
    jsr end
    jmp __breturn
    // main::@return
  __breturn:
    // [25] return 
    rts
}
  // end
end: {
    // [26] (word) Ticks#1 ← (word) last_time -- vwuz1=vwuz2 
    lda.z last_time
    sta.z Ticks
    lda.z last_time+1
    sta.z Ticks+1
    // [27] call start 
    jsr start
    jmp __b1
    // end::@1
  __b1:
    // [28] (word) last_time ← (word) last_time - (word) Ticks#1 -- 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
    // [29] (word) Ticks#12 ← (word) last_time -- vwuz1=vwuz2 
    lda.z last_time
    sta.z Ticks_1
    lda.z last_time+1
    sta.z Ticks_1+1
    // [30] (word) print_word::w#0 ← (word) Ticks#12
    // [31] call print_word 
    jsr print_word
    // [32] phi from end::@1 to end::@2 [phi:end::@1->end::@2]
  __b2_from___b1:
    jmp __b2
    // end::@2
  __b2:
    // [33] call print_ln 
    // [35] phi from end::@2 to print_ln [phi:end::@2->print_ln]
  print_ln_from___b2:
    jsr print_ln
    jmp __breturn
    // end::@return
  __breturn:
    // [34] return 
    rts
}
  // print_ln
// Print a newline
print_ln: {
    // [36] phi from print_ln to print_ln::@1 [phi:print_ln->print_ln::@1]
  __b1_from_print_ln:
    // [36] phi (byte*) print_line_cursor#8 = (byte*) 1024 [phi:print_ln->print_ln::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_line_cursor
    lda #>$400
    sta.z print_line_cursor+1
    jmp __b1
    // [36] phi from print_ln::@1 to print_ln::@1 [phi:print_ln::@1->print_ln::@1]
  __b1_from___b1:
    // [36] phi (byte*) print_line_cursor#8 = (byte*) print_line_cursor#1 [phi:print_ln::@1->print_ln::@1#0] -- register_copy 
    jmp __b1
    // print_ln::@1
  __b1:
    // [37] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $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
  !:
    // [38] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#10) 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:
    // [39] return 
    rts
}
  // print_word
// Print a word as HEX
// print_word(word zp($e) w)
print_word: {
    .label w = $e
    // [40] (byte) print_byte::b#0 ← > (word) print_word::w#0 -- vbuxx=_hi_vwuz1 
    lda.z w+1
    tax
    // [41] call print_byte 
    // [45] phi from print_word to print_byte [phi:print_word->print_byte]
  print_byte_from_print_word:
    // [45] phi (byte) print_byte::b#2 = (byte) print_byte::b#0 [phi:print_word->print_byte#0] -- register_copy 
    jsr print_byte
    jmp __b1
    // print_word::@1
  __b1:
    // [42] (byte) print_byte::b#1 ← < (word) print_word::w#0 -- vbuxx=_lo_vwuz1 
    lda.z w
    tax
    // [43] call print_byte 
    // [45] phi from print_word::@1 to print_byte [phi:print_word::@1->print_byte]
  print_byte_from___b1:
    // [45] phi (byte) print_byte::b#2 = (byte) print_byte::b#1 [phi:print_word::@1->print_byte#0] -- register_copy 
    jsr print_byte
    jmp __breturn
    // print_word::@return
  __breturn:
    // [44] return 
    rts
}
  // print_byte
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
    // [46] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4 -- vbuaa=vbuxx_ror_4 
    txa
    lsr
    lsr
    lsr
    lsr
    // [47] (byte) print_char::ch#0 ← *((const byte*) print_hextab + (byte~) print_byte::$0) -- vbuaa=pbuc1_derefidx_vbuaa 
    tay
    lda print_hextab,y
    // [48] call print_char 
    // [53] phi from print_byte to print_char [phi:print_byte->print_char]
  print_char_from_print_byte:
    // [53] phi (byte*) print_char_cursor#26 = (byte*) print_char_cursor#10 [phi:print_byte->print_char#0] -- register_copy 
    // [53] phi (byte) print_char::ch#3 = (byte) print_char::ch#0 [phi:print_byte->print_char#1] -- register_copy 
    jsr print_char
    jmp __b1
    // print_byte::@1
  __b1:
    // [49] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f -- vbuxx=vbuxx_band_vbuc1 
    lda #$f
    axs #0
    // [50] (byte) print_char::ch#1 ← *((const byte*) print_hextab + (byte~) print_byte::$2) -- vbuaa=pbuc1_derefidx_vbuxx 
    lda print_hextab,x
    // [51] call print_char 
    // [53] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char]
  print_char_from___b1:
    // [53] phi (byte*) print_char_cursor#26 = (byte*) print_char_cursor#10 [phi:print_byte::@1->print_char#0] -- register_copy 
    // [53] phi (byte) print_char::ch#3 = (byte) print_char::ch#1 [phi:print_byte::@1->print_char#1] -- register_copy 
    jsr print_char
    jmp __breturn
    // print_byte::@return
  __breturn:
    // [52] return 
    rts
}
  // print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
    // [54] *((byte*) print_char_cursor#26) ← (byte) print_char::ch#3 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (print_char_cursor),y
    // [55] (byte*) print_char_cursor#10 ← ++ (byte*) print_char_cursor#26 -- pbuz1=_inc_pbuz1 
    inc.z print_char_cursor
    bne !+
    inc.z print_char_cursor+1
  !:
    jmp __breturn
    // print_char::@return
  __breturn:
    // [56] 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
    // [58] (word) rand_seed ← (word) $194a -- vwuz1=vwuc1 
    lda #<$194a
    sta.z rand_seed
    lda #>$194a
    sta.z rand_seed+1
    jmp __breturn
    // start::@return
  __breturn:
    // [59] return 
    rts
}
  // sum
sum: {
    .label current = 2
    .label s = 8
    .label return = 8
    // [60] (struct node*) sum::current#1 ← (struct node*) root#11
    // [61] phi from sum to sum::@1 [phi:sum->sum::@1]
  __b1_from_sum:
    // [61] phi (word) sum::s#3 = (byte) 0 [phi:sum->sum::@1#0] -- vwuz1=vbuc1 
    lda #<0
    sta.z s
    lda #>0
    sta.z s+1
    // [61] phi (struct node*) sum::current#3 = (struct node*) sum::current#1 [phi:sum->sum::@1#1] -- register_copy 
    jmp __b1
    // sum::@1
  __b1:
    // [62] if((struct node*)(word) 0!=(struct node*) 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:
    // [63] return 
    rts
    // sum::@2
  __b2:
    // [64] (word) sum::s#2 ← (word) sum::s#3 + *((word*)(struct node*) sum::current#3 + (const byte) 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
    // [65] (struct node*) sum::current#2 ← *((struct node**)(struct node*) sum::current#3) -- pssz1=_deref_pptz1 
    ldy #0
    lda (current),y
    pha
    iny
    lda (current),y
    sta.z current+1
    pla
    sta.z current
    // [61] phi from sum::@2 to sum::@1 [phi:sum::@2->sum::@1]
  __b1_from___b2:
    // [61] phi (word) sum::s#3 = (word) sum::s#2 [phi:sum::@2->sum::@1#0] -- register_copy 
    // [61] phi (struct node*) sum::current#3 = (struct node*) sum::current#2 [phi:sum::@2->sum::@1#1] -- register_copy 
    jmp __b1
}
  // prepend
// prepend(word zp(4) x)
prepend: {
    .label new = $10
    .label x = 4
    // [67] call alloc 
    jsr alloc
    // [68] (struct node*) alloc::return#2 ← (struct node*) alloc::return#0
    jmp __b1
    // prepend::@1
  __b1:
    // [69] (struct node*) prepend::new#1 ← (struct node*) alloc::return#2
    // [70] *((struct node**)(struct node*) prepend::new#1) ← (struct node*) root#20 -- _deref_pptz1=pssz2 
    ldy #0
    lda.z root
    sta (new),y
    iny
    lda.z root+1
    sta (new),y
    // [71] *((word*)(struct node*) prepend::new#1 + (const byte) OFFSET_STRUCT_NODE_VALUE) ← (word) 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
    // [72] (struct node*) root#11 ← (struct node*) prepend::new#1 -- pssz1=pssz2 
    lda.z new
    sta.z root
    lda.z new+1
    sta.z root+1
    jmp __breturn
    // prepend::@return
  __breturn:
    // [73] return 
    rts
}
  // alloc
alloc: {
    .label __1 = $10
    .label return = $10
    // [74] (word~) alloc::$1 ← (word) free_#22 << (byte) 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
    // [75] (struct node*) alloc::return#0 ← (const struct node*) heap + (word~) alloc::$1 -- pssz1=pssc1_plus_vwuz1 
    clc
    lda.z return
    adc #<heap
    sta.z return
    lda.z return+1
    adc #>heap
    sta.z return+1
    // [76] (word) free_#13 ← ++ (word) free_#22 -- vwuz1=_inc_vwuz1 
    inc.z free_
    bne !+
    inc.z free_+1
  !:
    jmp __breturn
    // alloc::@return
  __breturn:
    // [77] return 
    rts
}
  // init
init: {
    jmp __breturn
    // init::@return
  __breturn:
    // [79] return 
    rts
}
  // File Data
  print_hextab: .text "0123456789abcdef"
  heap: .fill 4*$fa0, 0

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b3
Removing instruction jmp __bend
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 __b1
Removing instruction jmp __b2
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
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 __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
Removing instruction lda #>0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label __bbegin with __b1
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 __bbegin:
Removing instruction __b3_from___b2:
Removing instruction main_from___b3:
Removing instruction __bend_from___b3:
Removing instruction __b1_from___b7:
Removing instruction init_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 __b2:
Removing instruction __b3:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b2_from___b1:
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 __b1:
Removing instruction __b2:
Removing instruction __breturn:
Removing instruction __b1_from_print_ln:
Removing instruction __breturn:
Removing instruction print_byte_from_print_word:
Removing instruction __b1:
Removing instruction print_byte_from___b1:
Removing instruction __breturn:
Removing instruction print_char_from_print_byte:
Removing instruction __b1:
Removing instruction print_char_from___b1:
Removing instruction __breturn:
Removing instruction __breturn:
Removing instruction __breturn:
Removing instruction __b1_from_sum:
Removing instruction __breturn:
Removing instruction __b1_from___b2:
Removing instruction __b1:
Removing instruction __breturn:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Adding RTS to root block 
Succesful ASM optimization Pass5AddMainRts
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #<0
Succesful ASM optimization Pass5UnnecesaryLoadElimination

FINAL SYMBOL TABLE
(label) @1
(label) @2
(label) @3
(label) @begin
(label) @end
(const byte) OFFSET_STRUCT_NODE_VALUE = (byte) 2
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10
(const byte) RADIX::OCTAL = (number) 8
(word) Ticks
(word) Ticks#1 Ticks zp[2]:16 2.0
(word) Ticks#12 Ticks_1 zp[2]:14 4.0
(struct node*()) alloc()
(word~) alloc::$1 zp[2]:16 4.0
(label) alloc::@return
(struct node*) alloc::result
(struct node*) alloc::return
(struct node*) alloc::return#0 return zp[2]:16 1.0
(struct node*) alloc::return#2 return zp[2]:16 4.0
(void()) end()
(label) end::@1
(label) end::@2
(label) end::@return
(word) free_
(word) free_#13 free_ zp[2]:8 8.583333333333332
(word) free_#22 free_ zp[2]:8 20.999999999999996
(const struct node*) heap[(number) $fa0]  = { fill( $fa0, 0) }
(void()) init()
(label) init::@return
(word) last_time loadstore zp[2]:10 0.4545454545454546
(void()) main()
(word~) main::$5 zp[2]:8 11.0
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@return
(byte) main::c
(byte) main::c#2 reg byte x 16.5
(byte) main::c#8 reg byte x 1.6923076923076923
(word) main::i
(word) main::i#2 i zp[2]:4 151.5
(word) main::i#3 i zp[2]:4 101.0
(struct node*) node::next
(word) node::value
(void()) prepend((word) prepend::x)
(label) prepend::@1
(label) prepend::@return
(struct node*) prepend::new
(struct node*) prepend::new#1 new zp[2]:16 1.3333333333333333
(word) prepend::x
(word) prepend::x#0 x zp[2]:4 17.166666666666664
(void()) print_byte((byte) print_byte::b)
(byte~) print_byte::$0 reg byte a 4.0
(byte~) print_byte::$2 reg byte x 4.0
(label) print_byte::@1
(label) print_byte::@return
(byte) print_byte::b
(byte) print_byte::b#0 reg byte x 4.0
(byte) print_byte::b#1 reg byte x 4.0
(byte) print_byte::b#2 reg byte x 2.0
(void()) print_char((byte) print_char::ch)
(label) print_char::@return
(byte) print_char::ch
(byte) print_char::ch#0 reg byte a 4.0
(byte) print_char::ch#1 reg byte a 4.0
(byte) print_char::ch#2 reg byte a 22.0
(byte) print_char::ch#3 reg byte a 17.0
(byte*) print_char_cursor
(byte*) print_char_cursor#10 print_char_cursor zp[2]:6 0.9333333333333332
(byte*) print_char_cursor#26 print_char_cursor zp[2]:6 9.5
(byte*) print_char_cursor#49 print_char_cursor zp[2]:6 1.8333333333333333
(const byte*) print_hextab[]  = (string) "0123456789abcdef"z
(byte*) print_line_cursor
(byte*) print_line_cursor#1 print_line_cursor zp[2]:4 16.5
(byte*) print_line_cursor#8 print_line_cursor zp[2]:4 22.0
(void()) print_ln()
(label) print_ln::@1
(label) print_ln::@return
(byte*) print_screen
(void()) print_word((word) print_word::w)
(label) print_word::@1
(label) print_word::@return
(word) print_word::w
(word) print_word::w#0 w zp[2]:14 2.0
(word) rand_seed loadstore zp[2]:12 40.0
(struct node*) root
(struct node*) root#11 root zp[2]:2 17.499999999999996
(struct node*) root#20 root zp[2]:2 17.166666666666664
(void()) start()
(label) start::@return
(const word*) start::LAST_TIME = &(word) last_time
(word()) sum()
(label) sum::@1
(label) sum::@2
(label) sum::@return
(struct node*) sum::current
(struct node*) sum::current#1 current zp[2]:2 4.0
(struct node*) sum::current#2 current zp[2]:2 202.0
(struct node*) sum::current#3 current zp[2]:2 68.0
(word) sum::return
(word) sum::return#2 return zp[2]:8 22.0
(word) sum::s
(word) sum::s#2 s zp[2]:8 101.0
(word) sum::s#3 s zp[2]:8 53.25

reg byte x [ main::c#8 main::c#2 ]
zp[2]:2 [ root#20 root#11 sum::current#3 sum::current#1 sum::current#2 ]
zp[2]:4 [ print_line_cursor#8 print_line_cursor#1 main::i#3 main::i#2 prepend::x#0 ]
reg byte x [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
reg byte a [ print_char::ch#3 print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
zp[2]:6 [ print_char_cursor#26 print_char_cursor#49 print_char_cursor#10 ]
zp[2]:8 [ sum::s#3 sum::s#2 sum::return#2 main::$5 free_#22 free_#13 ]
zp[2]:10 [ last_time ]
zp[2]:12 [ rand_seed ]
zp[2]:14 [ Ticks#12 print_word::w#0 ]
reg byte a [ print_byte::$0 ]
reg byte x [ print_byte::$2 ]
zp[2]:16 [ alloc::return#2 prepend::new#1 alloc::return#0 alloc::$1 Ticks#1 ]


FINAL ASSEMBLER
Score: 14199

  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__b1)
.pc = $80d "Program"
  // Global Constants & labels
  .const OFFSET_STRUCT_NODE_VALUE = 2
  .label last_time = $a
  .label rand_seed = $c
  .label print_line_cursor = 4
  .label print_char_cursor = 6
  .label Ticks = $10
  .label free_ = 8
  .label root = 2
  .label Ticks_1 = $e
  // @begin
  // @1
__b1:
  // last_time
  // [1] (word) last_time ← (word) 0 -- vwuz1=vwuc1 
  lda #<0
  sta.z last_time
  sta.z last_time+1
  // @2
  // rand_seed
  // [2] (word) rand_seed ← (word) 0 -- vwuz1=vwuc1 
  sta.z rand_seed
  sta.z rand_seed+1
  // [3] phi from @2 to @3 [phi:@2->@3]
  // @3
  // [4] call main 
  // [6] phi from @3 to main [phi:@3->main]
  jsr main
  rts
  // [5] phi from @3 to @end [phi:@3->@end]
  // @end
  // main
main: {
    .label __5 = 8
    .label i = 4
    // start()
    // [7] call start 
    jsr start
    // [8] phi from main to main::@1 [phi:main->main::@1]
    // [8] phi (byte) main::c#8 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 
    ldx #0
    // [8] phi (byte*) print_char_cursor#49 = (byte*) 1024 [phi:main->main::@1#1] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_char_cursor
    lda #>$400
    sta.z print_char_cursor+1
    // [8] phi from main::@7 to main::@1 [phi:main::@7->main::@1]
    // [8] phi (byte) main::c#8 = (byte) main::c#2 [phi:main::@7->main::@1#0] -- register_copy 
    // [8] phi (byte*) print_char_cursor#49 = (byte*) print_char_cursor#10 [phi:main::@7->main::@1#1] -- register_copy 
    // main::@1
  __b1:
    // init()
    // [9] call init 
    // [78] phi from main::@1 to init [phi:main::@1->init]
    jsr init
    // [10] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
    // [10] phi (struct node*) root#20 = (struct node*) 0 [phi:main::@1->main::@2#0] -- pssz1=pssc1 
    lda #<0
    sta.z root
    sta.z root+1
    // [10] phi (word) free_#22 = (byte) 0 [phi:main::@1->main::@2#1] -- vwuz1=vbuc1 
    sta.z free_
    sta.z free_+1
    // [10] phi (word) main::i#3 = (byte) 0 [phi:main::@1->main::@2#2] -- vwuz1=vbuc1 
    sta.z i
    sta.z i+1
    // [10] phi from main::@5 to main::@2 [phi:main::@5->main::@2]
    // [10] phi (struct node*) root#20 = (struct node*) root#11 [phi:main::@5->main::@2#0] -- register_copy 
    // [10] phi (word) free_#22 = (word) free_#13 [phi:main::@5->main::@2#1] -- register_copy 
    // [10] phi (word) main::i#3 = (word) main::i#2 [phi:main::@5->main::@2#2] -- register_copy 
    // main::@2
  __b2:
    // prepend(i)
    // [11] (word) prepend::x#0 ← (word) main::i#3
    // [12] call prepend 
    // [66] phi from main::@2 to prepend [phi:main::@2->prepend]
    jsr prepend
    // main::@5
    // for(i : 0..2999)
    // [13] (word) main::i#2 ← ++ (word) main::i#3 -- vwuz1=_inc_vwuz1 
    inc.z i
    bne !+
    inc.z i+1
  !:
    // [14] if((word) main::i#2!=(word) $bb8) goto main::@2 -- vwuz1_neq_vwuc1_then_la1 
    lda.z i+1
    cmp #>$bb8
    bne __b2
    lda.z i
    cmp #<$bb8
    bne __b2
    // [15] phi from main::@5 to main::@3 [phi:main::@5->main::@3]
    // main::@3
    // sum()
    // [16] call sum 
    jsr sum
    // [17] (word) sum::return#2 ← (word) sum::s#3
    // main::@6
    // [18] (word~) main::$5 ← (word) sum::return#2
    // print_char((byte)sum())
    // [19] (byte) print_char::ch#2 ← (byte)(word~) main::$5 -- vbuaa=_byte_vwuz1 
    lda.z __5
    // [20] call print_char 
    // [53] phi from main::@6 to print_char [phi:main::@6->print_char]
    // [53] phi (byte*) print_char_cursor#26 = (byte*) print_char_cursor#49 [phi:main::@6->print_char#0] -- register_copy 
    // [53] phi (byte) print_char::ch#3 = (byte) print_char::ch#2 [phi:main::@6->print_char#1] -- register_copy 
    jsr print_char
    // main::@7
    // for(c : 0..4)
    // [21] (byte) main::c#2 ← ++ (byte) main::c#8 -- vbuxx=_inc_vbuxx 
    inx
    // [22] if((byte) main::c#2!=(byte) 5) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #5
    bne __b1
    // [23] phi from main::@7 to main::@4 [phi:main::@7->main::@4]
    // main::@4
    // end()
    // [24] call end 
    jsr end
    // main::@return
    // }
    // [25] return 
    rts
}
  // end
end: {
    // Ticks = last_time
    // [26] (word) Ticks#1 ← (word) last_time -- vwuz1=vwuz2 
    lda.z last_time
    sta.z Ticks
    lda.z last_time+1
    sta.z Ticks+1
    // start()
    // [27] call start 
    jsr start
    // end::@1
    // last_time -= Ticks
    // [28] (word) last_time ← (word) last_time - (word) Ticks#1 -- 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
    // [29] (word) Ticks#12 ← (word) last_time -- vwuz1=vwuz2 
    lda.z last_time
    sta.z Ticks_1
    lda.z last_time+1
    sta.z Ticks_1+1
    // print_word(Ticks)
    // [30] (word) print_word::w#0 ← (word) Ticks#12
    // [31] call print_word 
    jsr print_word
    // [32] phi from end::@1 to end::@2 [phi:end::@1->end::@2]
    // end::@2
    // print_ln()
    // [33] call print_ln 
    // [35] phi from end::@2 to print_ln [phi:end::@2->print_ln]
    jsr print_ln
    // end::@return
    // }
    // [34] return 
    rts
}
  // print_ln
// Print a newline
print_ln: {
    // [36] phi from print_ln to print_ln::@1 [phi:print_ln->print_ln::@1]
    // [36] phi (byte*) print_line_cursor#8 = (byte*) 1024 [phi:print_ln->print_ln::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_line_cursor
    lda #>$400
    sta.z print_line_cursor+1
    // [36] phi from print_ln::@1 to print_ln::@1 [phi:print_ln::@1->print_ln::@1]
    // [36] phi (byte*) print_line_cursor#8 = (byte*) print_line_cursor#1 [phi:print_ln::@1->print_ln::@1#0] -- register_copy 
    // print_ln::@1
  __b1:
    // print_line_cursor + $28
    // [37] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $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)
    // [38] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#10) 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
    // }
    // [39] return 
    rts
}
  // print_word
// Print a word as HEX
// print_word(word zp($e) w)
print_word: {
    .label w = $e
    // print_byte(>w)
    // [40] (byte) print_byte::b#0 ← > (word) print_word::w#0 -- vbuxx=_hi_vwuz1 
    lda.z w+1
    tax
    // [41] call print_byte 
    // [45] phi from print_word to print_byte [phi:print_word->print_byte]
    // [45] phi (byte) print_byte::b#2 = (byte) print_byte::b#0 [phi:print_word->print_byte#0] -- register_copy 
    jsr print_byte
    // print_word::@1
    // print_byte(<w)
    // [42] (byte) print_byte::b#1 ← < (word) print_word::w#0 -- vbuxx=_lo_vwuz1 
    lda.z w
    tax
    // [43] call print_byte 
    // [45] phi from print_word::@1 to print_byte [phi:print_word::@1->print_byte]
    // [45] phi (byte) print_byte::b#2 = (byte) print_byte::b#1 [phi:print_word::@1->print_byte#0] -- register_copy 
    jsr print_byte
    // print_word::@return
    // }
    // [44] return 
    rts
}
  // print_byte
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
    // b>>4
    // [46] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4 -- vbuaa=vbuxx_ror_4 
    txa
    lsr
    lsr
    lsr
    lsr
    // print_char(print_hextab[b>>4])
    // [47] (byte) print_char::ch#0 ← *((const byte*) print_hextab + (byte~) print_byte::$0) -- vbuaa=pbuc1_derefidx_vbuaa 
    tay
    lda print_hextab,y
    // [48] call print_char 
    // [53] phi from print_byte to print_char [phi:print_byte->print_char]
    // [53] phi (byte*) print_char_cursor#26 = (byte*) print_char_cursor#10 [phi:print_byte->print_char#0] -- register_copy 
    // [53] phi (byte) print_char::ch#3 = (byte) print_char::ch#0 [phi:print_byte->print_char#1] -- register_copy 
    jsr print_char
    // print_byte::@1
    // b&$f
    // [49] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f -- vbuxx=vbuxx_band_vbuc1 
    lda #$f
    axs #0
    // print_char(print_hextab[b&$f])
    // [50] (byte) print_char::ch#1 ← *((const byte*) print_hextab + (byte~) print_byte::$2) -- vbuaa=pbuc1_derefidx_vbuxx 
    lda print_hextab,x
    // [51] call print_char 
    // [53] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char]
    // [53] phi (byte*) print_char_cursor#26 = (byte*) print_char_cursor#10 [phi:print_byte::@1->print_char#0] -- register_copy 
    // [53] phi (byte) print_char::ch#3 = (byte) print_char::ch#1 [phi:print_byte::@1->print_char#1] -- register_copy 
    jsr print_char
    // print_byte::@return
    // }
    // [52] return 
    rts
}
  // print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
    // *(print_char_cursor++) = ch
    // [54] *((byte*) print_char_cursor#26) ← (byte) print_char::ch#3 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (print_char_cursor),y
    // *(print_char_cursor++) = ch;
    // [55] (byte*) print_char_cursor#10 ← ++ (byte*) print_char_cursor#26 -- pbuz1=_inc_pbuz1 
    inc.z print_char_cursor
    bne !+
    inc.z print_char_cursor+1
  !:
    // print_char::@return
    // }
    // [56] 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
    // rand_seed = 6474
    // [58] (word) rand_seed ← (word) $194a -- vwuz1=vwuc1 
    lda #<$194a
    sta.z rand_seed
    lda #>$194a
    sta.z rand_seed+1
    // start::@return
    // }
    // [59] return 
    rts
}
  // sum
sum: {
    .label current = 2
    .label s = 8
    .label return = 8
    // current = root
    // [60] (struct node*) sum::current#1 ← (struct node*) root#11
    // [61] phi from sum to sum::@1 [phi:sum->sum::@1]
    // [61] phi (word) sum::s#3 = (byte) 0 [phi:sum->sum::@1#0] -- vwuz1=vbuc1 
    lda #<0
    sta.z s
    sta.z s+1
    // [61] phi (struct node*) sum::current#3 = (struct node*) sum::current#1 [phi:sum->sum::@1#1] -- register_copy 
    // sum::@1
  __b1:
    // while (current)
    // [62] if((struct node*)(word) 0!=(struct node*) 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
    // }
    // [63] return 
    rts
    // sum::@2
  __b2:
    // s += current->value
    // [64] (word) sum::s#2 ← (word) sum::s#3 + *((word*)(struct node*) sum::current#3 + (const byte) 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
    // [65] (struct node*) sum::current#2 ← *((struct node**)(struct node*) sum::current#3) -- pssz1=_deref_pptz1 
    ldy #0
    lda (current),y
    pha
    iny
    lda (current),y
    sta.z current+1
    pla
    sta.z current
    // [61] phi from sum::@2 to sum::@1 [phi:sum::@2->sum::@1]
    // [61] phi (word) sum::s#3 = (word) sum::s#2 [phi:sum::@2->sum::@1#0] -- register_copy 
    // [61] phi (struct node*) sum::current#3 = (struct node*) sum::current#2 [phi:sum::@2->sum::@1#1] -- register_copy 
    jmp __b1
}
  // prepend
// prepend(word zp(4) x)
prepend: {
    .label new = $10
    .label x = 4
    // alloc()
    // [67] call alloc 
    jsr alloc
    // [68] (struct node*) alloc::return#2 ← (struct node*) alloc::return#0
    // prepend::@1
    // new = alloc()
    // [69] (struct node*) prepend::new#1 ← (struct node*) alloc::return#2
    // new->next = root
    // [70] *((struct node**)(struct node*) prepend::new#1) ← (struct node*) root#20 -- _deref_pptz1=pssz2 
    ldy #0
    lda.z root
    sta (new),y
    iny
    lda.z root+1
    sta (new),y
    // new->value = x
    // [71] *((word*)(struct node*) prepend::new#1 + (const byte) OFFSET_STRUCT_NODE_VALUE) ← (word) 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
    // [72] (struct node*) root#11 ← (struct node*) prepend::new#1 -- pssz1=pssz2 
    lda.z new
    sta.z root
    lda.z new+1
    sta.z root+1
    // prepend::@return
    // }
    // [73] return 
    rts
}
  // alloc
alloc: {
    .label __1 = $10
    .label return = $10
    // heap + free_
    // [74] (word~) alloc::$1 ← (word) free_#22 << (byte) 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
    // [75] (struct node*) alloc::return#0 ← (const struct node*) heap + (word~) alloc::$1 -- pssz1=pssc1_plus_vwuz1 
    clc
    lda.z return
    adc #<heap
    sta.z return
    lda.z return+1
    adc #>heap
    sta.z return+1
    // free_++;
    // [76] (word) free_#13 ← ++ (word) free_#22 -- vwuz1=_inc_vwuz1 
    inc.z free_
    bne !+
    inc.z free_+1
  !:
    // alloc::@return
    // }
    // [77] return 
    rts
}
  // init
init: {
    // init::@return
    // [79] return 
    rts
}
  // File Data
  print_hextab: .text "0123456789abcdef"
  heap: .fill 4*$fa0, 0

