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 array-indexing *((word*) utoa::digit_values + (byte) utoa::digit)
Fixing pointer array-indexing *((dword*) ultoa::digit_values + (byte) ultoa::digit)
Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src)
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 sub-expression (byte) print_str_lines::ch
Identified constant variable (byte*) HEAP_TOP
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) @13
Culled Empty Block (label) @14
Culled Empty Block (label) print_str::@4
Culled Empty Block (label) print_str::@3
Culled Empty Block (label) print_str::@5
Culled Empty Block (label) print_str::@6
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

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@12
@12: 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:@36
print_str: scope:[print_str]  from main main::@2 main::@4
  (byte*) print_char_cursor#29 ← phi( main/(byte*) print_char_cursor#27 main::@2/(byte*) print_char_cursor#6 main::@4/(byte*) print_char_cursor#8 )
  (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 )
  to:print_str::@1
print_str::@1: scope:[print_str]  from print_str print_str::@2
  (byte*) print_char_cursor#25 ← phi( print_str/(byte*) print_char_cursor#29 print_str::@2/(byte*) print_char_cursor#1 )
  (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 )
  (bool~) print_str::$0 ← (number) 0 != *((byte*) print_str::str#4)
  if((bool~) print_str::$0) goto print_str::@2
  to:print_str::@return
print_str::@2: scope:[print_str]  from print_str::@1
  (byte*) print_char_cursor#13 ← phi( print_str::@1/(byte*) print_char_cursor#25 )
  (byte*) print_str::str#5 ← phi( print_str::@1/(byte*) print_str::str#4 )
  *((byte*) print_char_cursor#13) ← *((byte*) print_str::str#5)
  (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#13
  (byte*) print_str::str#0 ← ++ (byte*) print_str::str#5
  to:print_str::@1
print_str::@return: scope:[print_str]  from print_str::@1
  (byte*) print_char_cursor#14 ← phi( print_str::@1/(byte*) print_char_cursor#25 )
  (byte*) print_char_cursor#2 ← (byte*) print_char_cursor#14
  return 
  to:@return
print_ln: scope:[print_ln]  from main::@1 main::@3 main::@5
  (byte*) print_char_cursor#26 ← phi( main::@1/(byte*) print_char_cursor#5 main::@3/(byte*) print_char_cursor#7 main::@5/(byte*) print_char_cursor#9 )
  (byte*) print_line_cursor#16 ← phi( main::@1/(byte*) print_line_cursor#17 main::@3/(byte*) print_line_cursor#18 main::@5/(byte*) print_line_cursor#19 )
  to:print_ln::@1
print_ln::@1: scope:[print_ln]  from print_ln print_ln::@1
  (byte*) print_char_cursor#15 ← phi( print_ln/(byte*) print_char_cursor#26 print_ln::@1/(byte*) print_char_cursor#15 )
  (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#15
  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#3 ← (byte*) print_line_cursor#9
  to:print_ln::@return
print_ln::@return: scope:[print_ln]  from print_ln::@2
  (byte*) print_char_cursor#16 ← phi( print_ln::@2/(byte*) print_char_cursor#3 )
  (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#4 ← (byte*) print_char_cursor#16
  return 
  to:@return
@36: scope:[]  from @12
  (byte*) print_line_cursor#22 ← phi( @12/(byte*) print_line_cursor#0 )
  (byte*) print_char_cursor#30 ← phi( @12/(byte*) print_char_cursor#0 )
  (byte[]) msg#0 ← (const string) $0
  (byte[]) msg2#0 ← (const string) $1
  (byte[]) msg3#0 ← (const string) $2
  to:@37
main: scope:[main]  from @37
  (byte*) print_line_cursor#21 ← phi( @37/(byte*) print_line_cursor#20 )
  (byte*) print_char_cursor#27 ← phi( @37/(byte*) print_char_cursor#28 )
  (byte*) print_str::str#1 ← (byte[]) msg#0
  call print_str 
  to:main::@1
main::@1: scope:[main]  from main
  (byte*) print_line_cursor#17 ← phi( main/(byte*) print_line_cursor#21 )
  (byte*) print_char_cursor#17 ← phi( main/(byte*) print_char_cursor#2 )
  (byte*) print_char_cursor#5 ← (byte*) print_char_cursor#17
  call print_ln 
  to:main::@2
main::@2: scope:[main]  from main::@1
  (byte*) print_char_cursor#18 ← phi( main::@1/(byte*) print_char_cursor#4 )
  (byte*) print_line_cursor#11 ← phi( main::@1/(byte*) print_line_cursor#2 )
  (byte*) print_line_cursor#3 ← (byte*) print_line_cursor#11
  (byte*) print_char_cursor#6 ← (byte*) print_char_cursor#18
  (byte*) print_str::str#2 ← (byte[]) msg2#0
  call print_str 
  to:main::@3
main::@3: scope:[main]  from main::@2
  (byte*) print_line_cursor#18 ← phi( main::@2/(byte*) print_line_cursor#3 )
  (byte*) print_char_cursor#19 ← phi( main::@2/(byte*) print_char_cursor#2 )
  (byte*) print_char_cursor#7 ← (byte*) print_char_cursor#19
  call print_ln 
  to:main::@4
main::@4: scope:[main]  from main::@3
  (byte*) print_char_cursor#20 ← phi( main::@3/(byte*) print_char_cursor#4 )
  (byte*) print_line_cursor#12 ← phi( main::@3/(byte*) print_line_cursor#2 )
  (byte*) print_line_cursor#4 ← (byte*) print_line_cursor#12
  (byte*) print_char_cursor#8 ← (byte*) print_char_cursor#20
  (byte*) print_str::str#3 ← (byte[]) msg3#0
  call print_str 
  to:main::@5
main::@5: scope:[main]  from main::@4
  (byte*) print_line_cursor#19 ← phi( main::@4/(byte*) print_line_cursor#4 )
  (byte*) print_char_cursor#21 ← phi( main::@4/(byte*) print_char_cursor#2 )
  (byte*) print_char_cursor#9 ← (byte*) print_char_cursor#21
  call print_ln 
  to:main::@6
main::@6: scope:[main]  from main::@5
  (byte*) print_char_cursor#22 ← phi( main::@5/(byte*) print_char_cursor#4 )
  (byte*) print_line_cursor#13 ← phi( main::@5/(byte*) print_line_cursor#2 )
  (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#13
  (byte*) print_char_cursor#10 ← (byte*) print_char_cursor#22
  to:main::@return
main::@return: scope:[main]  from main::@6
  (byte*) print_line_cursor#14 ← phi( main::@6/(byte*) print_line_cursor#5 )
  (byte*) print_char_cursor#23 ← phi( main::@6/(byte*) print_char_cursor#10 )
  (byte*) print_char_cursor#11 ← (byte*) print_char_cursor#23
  (byte*) print_line_cursor#6 ← (byte*) print_line_cursor#14
  return 
  to:@return
@37: scope:[]  from @36
  (byte*) print_line_cursor#20 ← phi( @36/(byte*) print_line_cursor#22 )
  (byte*) print_char_cursor#28 ← phi( @36/(byte*) print_char_cursor#30 )
  call main 
  to:@38
@38: scope:[]  from @37
  (byte*) print_line_cursor#15 ← phi( @37/(byte*) print_line_cursor#6 )
  (byte*) print_char_cursor#24 ← phi( @37/(byte*) print_char_cursor#11 )
  (byte*) print_char_cursor#12 ← (byte*) print_char_cursor#24
  (byte*) print_line_cursor#7 ← (byte*) print_line_cursor#15
  to:@end
@end: scope:[]  from @38

SYMBOL TABLE SSA
(const string) $0 = (string) "hello world! "
(const string) $1 = (string) "hello c64! "
(const string) $2 = (string) "hello 2017! "
(label) @12
(label) @36
(label) @37
(label) @38
(label) @begin
(label) @end
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10
(const byte) RADIX::OCTAL = (number) 8
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@return
(byte[]) msg
(byte[]) msg#0
(byte[]) msg2
(byte[]) msg2#0
(byte[]) msg3
(byte[]) msg3#0
(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#4
(byte*) print_char_cursor#5
(byte*) print_char_cursor#6
(byte*) print_char_cursor#7
(byte*) print_char_cursor#8
(byte*) print_char_cursor#9
(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#3
(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_str((byte*) print_str::str)
(bool~) print_str::$0
(label) print_str::@1
(label) print_str::@2
(label) print_str::@return
(byte*) print_str::str
(byte*) print_str::str#0
(byte*) print_str::str#1
(byte*) print_str::str#2
(byte*) print_str::str#3
(byte*) print_str::str#4
(byte*) print_str::str#5
(byte*) print_str::str#6

Adding number conversion cast (unumber) 0 in (bool~) print_str::$0 ← (number) 0 != *((byte*) print_str::str#4)
Adding number conversion cast (unumber) $28 in (byte*~) print_ln::$0 ← (byte*) print_line_cursor#8 + (number) $28
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast $28
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $28
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte*) print_char_cursor#0 = (byte*) print_line_cursor#0 (byte*) print_screen#0 (byte*) print_char_cursor#30 (byte*) print_line_cursor#22 (byte*) print_char_cursor#28 (byte*) print_line_cursor#20 
Alias (byte*) print_str::str#4 = (byte*) print_str::str#5 
Alias (byte*) print_char_cursor#13 = (byte*) print_char_cursor#25 (byte*) print_char_cursor#14 (byte*) print_char_cursor#2 
Alias (byte*) print_line_cursor#1 = (byte*~) print_ln::$0 (byte*) print_line_cursor#9 (byte*) print_char_cursor#3 (byte*) print_line_cursor#10 (byte*) print_char_cursor#16 (byte*) print_line_cursor#2 (byte*) print_char_cursor#4 
Alias (byte*) print_line_cursor#17 = (byte*) print_line_cursor#21 
Alias (byte*) print_char_cursor#17 = (byte*) print_char_cursor#5 
Alias (byte*) print_line_cursor#11 = (byte*) print_line_cursor#3 (byte*) print_line_cursor#18 
Alias (byte*) print_char_cursor#18 = (byte*) print_char_cursor#6 
Alias (byte*) print_char_cursor#19 = (byte*) print_char_cursor#7 
Alias (byte*) print_line_cursor#12 = (byte*) print_line_cursor#4 (byte*) print_line_cursor#19 
Alias (byte*) print_char_cursor#20 = (byte*) print_char_cursor#8 
Alias (byte*) print_char_cursor#21 = (byte*) print_char_cursor#9 
Alias (byte*) print_line_cursor#13 = (byte*) print_line_cursor#5 (byte*) print_line_cursor#14 (byte*) print_line_cursor#6 
Alias (byte*) print_char_cursor#10 = (byte*) print_char_cursor#22 (byte*) print_char_cursor#23 (byte*) print_char_cursor#11 
Alias (byte*) print_char_cursor#12 = (byte*) print_char_cursor#24 
Alias (byte*) print_line_cursor#15 = (byte*) print_line_cursor#7 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte*) print_char_cursor#15 (byte*) print_char_cursor#26
Identical Phi Values (byte*) print_char_cursor#27 (byte*) print_char_cursor#0
Identical Phi Values (byte*) print_line_cursor#17 (byte*) print_char_cursor#0
Identical Phi Values (byte*) print_char_cursor#17 (byte*) print_char_cursor#13
Identical Phi Values (byte*) print_line_cursor#11 (byte*) print_line_cursor#1
Identical Phi Values (byte*) print_char_cursor#18 (byte*) print_line_cursor#1
Identical Phi Values (byte*) print_char_cursor#19 (byte*) print_char_cursor#13
Identical Phi Values (byte*) print_line_cursor#12 (byte*) print_line_cursor#1
Identical Phi Values (byte*) print_char_cursor#20 (byte*) print_line_cursor#1
Identical Phi Values (byte*) print_char_cursor#21 (byte*) print_char_cursor#13
Identical Phi Values (byte*) print_line_cursor#13 (byte*) print_line_cursor#1
Identical Phi Values (byte*) print_char_cursor#10 (byte*) print_line_cursor#1
Identical Phi Values (byte*) print_char_cursor#12 (byte*) print_char_cursor#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#26 (byte*) print_char_cursor#13
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) print_str::$0 [6] if((byte) 0!=*((byte*) print_str::str#4)) goto print_str::@2
Simple Condition (bool~) print_ln::$1 [19] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#13) goto print_ln::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) print_char_cursor#0 = (byte*) 1024
Constant (const byte[]) msg#0 = $0
Constant (const byte[]) msg2#0 = $1
Constant (const byte[]) msg3#0 = $2
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) print_str::str#1 = msg#0
Constant (const byte*) print_str::str#2 = msg2#0
Constant (const byte*) print_str::str#3 = msg3#0
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with var siblings (const byte*) print_str::str#1
Inlining constant with var siblings (const byte*) print_str::str#2
Inlining constant with var siblings (const byte*) print_str::str#3
Inlining constant with var siblings (const byte*) print_char_cursor#0
Constant inlined print_char_cursor#0 = (byte*) 1024
Constant inlined print_str::str#3 = (const byte[]) msg3#0
Constant inlined print_str::str#2 = (const byte[]) msg2#0
Constant inlined print_str::str#1 = (const byte[]) msg#0
Constant inlined $0 = (const byte[]) msg#0
Constant inlined $1 = (const byte[]) msg2#0
Constant inlined $2 = (const byte[]) msg3#0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @12
Adding NOP phi() at start of @36
Adding NOP phi() at start of @37
Adding NOP phi() at start of @38
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@6
Adding NOP phi() at start of print_ln::@2
CALL GRAPH
Calls in [] to main:4 
Calls in [main] to print_str:8 print_ln:10 print_str:12 print_ln:14 print_str:16 print_ln:18 

Created 6 initial phi equivalence classes
Not coalescing [11] print_char_cursor#31 ← print_line_cursor#1
Coalesced [13] print_line_cursor#23 ← print_line_cursor#1
Not coalescing [15] print_char_cursor#32 ← print_line_cursor#1
Coalesced (already) [17] print_line_cursor#24 ← print_line_cursor#1
Coalesced [22] print_line_cursor#25 ← print_line_cursor#16
Coalesced (already) [28] print_line_cursor#26 ← print_line_cursor#1
Coalesced [30] print_str::str#7 ← print_str::str#6
Coalesced [31] print_char_cursor#33 ← print_char_cursor#29
Coalesced [38] print_str::str#8 ← print_str::str#0
Coalesced [39] print_char_cursor#34 ← print_char_cursor#1
Coalesced down to 3 phi equivalence classes
Culled Empty Block (label) @12
Culled Empty Block (label) @36
Culled Empty Block (label) @38
Culled Empty Block (label) main::@6
Culled Empty Block (label) print_ln::@2
Culled Empty Block (label) print_ln::@3
Renumbering block @37 to @1
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of main::@5

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  [1] phi()
  [2] call main 
  to:@end
@end: scope:[]  from @1
  [3] phi()
main: scope:[main]  from @1
  [4] phi()
  [5] call print_str 
  to:main::@1
main::@1: scope:[main]  from main
  [6] phi()
  [7] call print_ln 
  to:main::@2
main::@2: scope:[main]  from main::@1
  [8] (byte*~) print_char_cursor#31 ← (byte*) print_line_cursor#1
  [9] call print_str 
  to:main::@3
main::@3: scope:[main]  from main::@2
  [10] phi()
  [11] call print_ln 
  to:main::@4
main::@4: scope:[main]  from main::@3
  [12] (byte*~) print_char_cursor#32 ← (byte*) print_line_cursor#1
  [13] call print_str 
  to:main::@5
main::@5: scope:[main]  from main::@4
  [14] phi()
  [15] call print_ln 
  to:main::@return
main::@return: scope:[main]  from main::@5
  [16] return 
  to:@return
print_ln: scope:[print_ln]  from main::@1 main::@3 main::@5
  [17] (byte*) print_line_cursor#16 ← phi( main::@1/(byte*) 1024 main::@3/(byte*) print_line_cursor#1 main::@5/(byte*) print_line_cursor#1 )
  to:print_ln::@1
print_ln::@1: scope:[print_ln]  from print_ln print_ln::@1
  [18] (byte*) print_line_cursor#8 ← phi( print_ln/(byte*) print_line_cursor#16 print_ln::@1/(byte*) print_line_cursor#1 )
  [19] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28
  [20] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#13) goto print_ln::@1
  to:print_ln::@return
print_ln::@return: scope:[print_ln]  from print_ln::@1
  [21] return 
  to:@return
print_str: scope:[print_str]  from main main::@2 main::@4
  [22] (byte*) print_char_cursor#29 ← phi( main/(byte*) 1024 main::@2/(byte*~) print_char_cursor#31 main::@4/(byte*~) print_char_cursor#32 )
  [22] (byte*) print_str::str#6 ← phi( main/(const byte[]) msg#0 main::@2/(const byte[]) msg2#0 main::@4/(const byte[]) msg3#0 )
  to:print_str::@1
print_str::@1: scope:[print_str]  from print_str print_str::@2
  [23] (byte*) print_char_cursor#13 ← phi( print_str/(byte*) print_char_cursor#29 print_str::@2/(byte*) print_char_cursor#1 )
  [23] (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 )
  [24] if((byte) 0!=*((byte*) print_str::str#4)) goto print_str::@2
  to:print_str::@return
print_str::@return: scope:[print_str]  from print_str::@1
  [25] return 
  to:@return
print_str::@2: scope:[print_str]  from print_str::@1
  [26] *((byte*) print_char_cursor#13) ← *((byte*) print_str::str#4)
  [27] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#13
  [28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4
  to:print_str::@1


VARIABLE REGISTER WEIGHTS
(void()) main()
(byte[]) msg
(byte[]) msg2
(byte[]) msg3
(byte*) print_char_cursor
(byte*) print_char_cursor#1 11.0
(byte*) print_char_cursor#13 3.2857142857142856
(byte*) print_char_cursor#29 6.0
(byte*~) print_char_cursor#31 4.0
(byte*~) print_char_cursor#32 4.0
(byte*) print_line_cursor
(byte*) print_line_cursor#1 3.7272727272727275
(byte*) print_line_cursor#16 6.0
(byte*) print_line_cursor#8 24.0
(void()) print_ln()
(byte*) print_screen
(void()) print_str((byte*) print_str::str)
(byte*) print_str::str
(byte*) print_str::str#0 22.0
(byte*) print_str::str#4 11.5
(byte*) print_str::str#6 2.0

Initial phi equivalence classes
[ print_line_cursor#8 print_line_cursor#16 print_line_cursor#1 ]
[ print_str::str#4 print_str::str#6 print_str::str#0 ]
[ print_char_cursor#13 print_char_cursor#29 print_char_cursor#31 print_char_cursor#32 print_char_cursor#1 ]
Complete equivalence classes
[ print_line_cursor#8 print_line_cursor#16 print_line_cursor#1 ]
[ print_str::str#4 print_str::str#6 print_str::str#0 ]
[ print_char_cursor#13 print_char_cursor#29 print_char_cursor#31 print_char_cursor#32 print_char_cursor#1 ]
Allocated zp ZP_WORD:2 [ print_line_cursor#8 print_line_cursor#16 print_line_cursor#1 ]
Allocated zp ZP_WORD:4 [ print_str::str#4 print_str::str#6 print_str::str#0 ]
Allocated zp ZP_WORD:6 [ print_char_cursor#13 print_char_cursor#29 print_char_cursor#31 print_char_cursor#32 print_char_cursor#1 ]

INITIAL ASM
Target platform is c64basic
  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label print_char_cursor = 6
  .label print_line_cursor = 2
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from_b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    // [5] call print_str 
    // [22] phi from main to print_str [phi:main->print_str]
  print_str_from_main:
    // [22] phi (byte*) print_char_cursor#29 = (byte*) 1024 [phi:main->print_str#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_char_cursor
    lda #>$400
    sta.z print_char_cursor+1
    // [22] phi (byte*) print_str::str#6 = (const byte[]) msg#0 [phi:main->print_str#1] -- pbuz1=pbuc1 
    lda #<msg
    sta.z print_str.str
    lda #>msg
    sta.z print_str.str+1
    jsr print_str
    // [6] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    jmp b1
    // main::@1
  b1:
    // [7] call print_ln 
    // [17] phi from main::@1 to print_ln [phi:main::@1->print_ln]
  print_ln_from_b1:
    // [17] phi (byte*) print_line_cursor#16 = (byte*) 1024 [phi:main::@1->print_ln#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_line_cursor
    lda #>$400
    sta.z print_line_cursor+1
    jsr print_ln
    jmp b2
    // main::@2
  b2:
    // [8] (byte*~) print_char_cursor#31 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 
    lda.z print_line_cursor
    sta.z print_char_cursor
    lda.z print_line_cursor+1
    sta.z print_char_cursor+1
    // [9] call print_str 
    // [22] phi from main::@2 to print_str [phi:main::@2->print_str]
  print_str_from_b2:
    // [22] phi (byte*) print_char_cursor#29 = (byte*~) print_char_cursor#31 [phi:main::@2->print_str#0] -- register_copy 
    // [22] phi (byte*) print_str::str#6 = (const byte[]) msg2#0 [phi:main::@2->print_str#1] -- pbuz1=pbuc1 
    lda #<msg2
    sta.z print_str.str
    lda #>msg2
    sta.z print_str.str+1
    jsr print_str
    // [10] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
  b3_from_b2:
    jmp b3
    // main::@3
  b3:
    // [11] call print_ln 
    // [17] phi from main::@3 to print_ln [phi:main::@3->print_ln]
  print_ln_from_b3:
    // [17] phi (byte*) print_line_cursor#16 = (byte*) print_line_cursor#1 [phi:main::@3->print_ln#0] -- register_copy 
    jsr print_ln
    jmp b4
    // main::@4
  b4:
    // [12] (byte*~) print_char_cursor#32 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 
    lda.z print_line_cursor
    sta.z print_char_cursor
    lda.z print_line_cursor+1
    sta.z print_char_cursor+1
    // [13] call print_str 
    // [22] phi from main::@4 to print_str [phi:main::@4->print_str]
  print_str_from_b4:
    // [22] phi (byte*) print_char_cursor#29 = (byte*~) print_char_cursor#32 [phi:main::@4->print_str#0] -- register_copy 
    // [22] phi (byte*) print_str::str#6 = (const byte[]) msg3#0 [phi:main::@4->print_str#1] -- pbuz1=pbuc1 
    lda #<msg3
    sta.z print_str.str
    lda #>msg3
    sta.z print_str.str+1
    jsr print_str
    // [14] phi from main::@4 to main::@5 [phi:main::@4->main::@5]
  b5_from_b4:
    jmp b5
    // main::@5
  b5:
    // [15] call print_ln 
    // [17] phi from main::@5 to print_ln [phi:main::@5->print_ln]
  print_ln_from_b5:
    // [17] phi (byte*) print_line_cursor#16 = (byte*) print_line_cursor#1 [phi:main::@5->print_ln#0] -- register_copy 
    jsr print_ln
    jmp breturn
    // main::@return
  breturn:
    // [16] return 
    rts
}
  // print_ln
// Print a newline
print_ln: {
    // [18] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1]
  b1_from_print_ln:
  b1_from_b1:
    // [18] phi (byte*) print_line_cursor#8 = (byte*) print_line_cursor#16 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy 
    jmp b1
    // print_ln::@1
  b1:
    // [19] (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
  !:
    // [20] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#13) 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:
    // [21] return 
    rts
}
  // print_str
// Print a zero-terminated string
// print_str(byte* zeropage(4) str)
print_str: {
    .label str = 4
    // [23] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
  b1_from_print_str:
  b1_from_b2:
    // [23] phi (byte*) print_char_cursor#13 = (byte*) print_char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy 
    // [23] phi (byte*) print_str::str#4 = (byte*) print_str::str#6 [phi:print_str/print_str::@2->print_str::@1#1] -- register_copy 
    jmp b1
    // print_str::@1
  b1:
    // [24] if((byte) 0!=*((byte*) print_str::str#4)) goto print_str::@2 -- vbuc1_neq__deref_pbuz1_then_la1 
    ldy #0
    lda (str),y
    cmp #0
    bne b2
    jmp breturn
    // print_str::@return
  breturn:
    // [25] return 
    rts
    // print_str::@2
  b2:
    // [26] *((byte*) print_char_cursor#13) ← *((byte*) print_str::str#4) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (str),y
    ldy #0
    sta (print_char_cursor),y
    // [27] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#13 -- pbuz1=_inc_pbuz1 
    inc.z print_char_cursor
    bne !+
    inc.z print_char_cursor+1
  !:
    // [28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 -- pbuz1=_inc_pbuz1 
    inc.z str
    bne !+
    inc.z str+1
  !:
    jmp b1_from_b2
}
  // File Data
  msg: .text "hello world! "
  .byte 0
  msg2: .text "hello c64! "
  .byte 0
  msg3: .text "hello 2017! "
  .byte 0

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [8] (byte*~) print_char_cursor#31 ← (byte*) print_line_cursor#1 [ print_char_cursor#31 print_line_cursor#1 ] ( main:2 [ print_char_cursor#31 print_line_cursor#1 ] ) always clobbers reg byte a 
Statement [12] (byte*~) print_char_cursor#32 ← (byte*) print_line_cursor#1 [ print_line_cursor#1 print_char_cursor#32 ] ( main:2 [ print_line_cursor#1 print_char_cursor#32 ] ) always clobbers reg byte a 
Statement [19] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28 [ print_line_cursor#1 print_char_cursor#13 ] ( main:2::print_ln:7 [ print_line_cursor#1 print_char_cursor#13 ] main:2::print_ln:11 [ print_line_cursor#1 print_char_cursor#13 ] main:2::print_ln:15 [ print_line_cursor#1 print_char_cursor#13 ] ) always clobbers reg byte a 
Statement [20] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#13) goto print_ln::@1 [ print_line_cursor#1 print_char_cursor#13 ] ( main:2::print_ln:7 [ print_line_cursor#1 print_char_cursor#13 ] main:2::print_ln:11 [ print_line_cursor#1 print_char_cursor#13 ] main:2::print_ln:15 [ print_line_cursor#1 print_char_cursor#13 ] ) always clobbers reg byte a 
Statement [24] if((byte) 0!=*((byte*) print_str::str#4)) goto print_str::@2 [ print_char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ print_char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_line_cursor#1 print_char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_line_cursor#1 print_char_cursor#13 print_str::str#4 ] ) always clobbers reg byte a reg byte y 
Statement [26] *((byte*) print_char_cursor#13) ← *((byte*) print_str::str#4) [ print_char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ print_char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_line_cursor#1 print_char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_line_cursor#1 print_char_cursor#13 print_str::str#4 ] ) always clobbers reg byte a reg byte y 
Potential registers zp ZP_WORD:2 [ print_line_cursor#8 print_line_cursor#16 print_line_cursor#1 ] : zp ZP_WORD:2 , 
Potential registers zp ZP_WORD:4 [ print_str::str#4 print_str::str#6 print_str::str#0 ] : zp ZP_WORD:4 , 
Potential registers zp ZP_WORD:6 [ print_char_cursor#13 print_char_cursor#29 print_char_cursor#31 print_char_cursor#32 print_char_cursor#1 ] : zp ZP_WORD:6 , 

REGISTER UPLIFT SCOPES
Uplift Scope [] 33.73: zp ZP_WORD:2 [ print_line_cursor#8 print_line_cursor#16 print_line_cursor#1 ] 28.29: zp ZP_WORD:6 [ print_char_cursor#13 print_char_cursor#29 print_char_cursor#31 print_char_cursor#32 print_char_cursor#1 ] 
Uplift Scope [print_str] 35.5: zp ZP_WORD:4 [ print_str::str#4 print_str::str#6 print_str::str#0 ] 
Uplift Scope [RADIX] 
Uplift Scope [print_ln] 
Uplift Scope [main] 

Uplifting [] best 1203 combination zp ZP_WORD:2 [ print_line_cursor#8 print_line_cursor#16 print_line_cursor#1 ] zp ZP_WORD:6 [ print_char_cursor#13 print_char_cursor#29 print_char_cursor#31 print_char_cursor#32 print_char_cursor#1 ] 
Uplifting [print_str] best 1203 combination zp ZP_WORD:4 [ print_str::str#4 print_str::str#6 print_str::str#0 ] 
Uplifting [RADIX] best 1203 combination 
Uplifting [print_ln] best 1203 combination 
Uplifting [main] best 1203 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label print_char_cursor = 6
  .label print_line_cursor = 2
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from_b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    // [5] call print_str 
    // [22] phi from main to print_str [phi:main->print_str]
  print_str_from_main:
    // [22] phi (byte*) print_char_cursor#29 = (byte*) 1024 [phi:main->print_str#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_char_cursor
    lda #>$400
    sta.z print_char_cursor+1
    // [22] phi (byte*) print_str::str#6 = (const byte[]) msg#0 [phi:main->print_str#1] -- pbuz1=pbuc1 
    lda #<msg
    sta.z print_str.str
    lda #>msg
    sta.z print_str.str+1
    jsr print_str
    // [6] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    jmp b1
    // main::@1
  b1:
    // [7] call print_ln 
    // [17] phi from main::@1 to print_ln [phi:main::@1->print_ln]
  print_ln_from_b1:
    // [17] phi (byte*) print_line_cursor#16 = (byte*) 1024 [phi:main::@1->print_ln#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_line_cursor
    lda #>$400
    sta.z print_line_cursor+1
    jsr print_ln
    jmp b2
    // main::@2
  b2:
    // [8] (byte*~) print_char_cursor#31 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 
    lda.z print_line_cursor
    sta.z print_char_cursor
    lda.z print_line_cursor+1
    sta.z print_char_cursor+1
    // [9] call print_str 
    // [22] phi from main::@2 to print_str [phi:main::@2->print_str]
  print_str_from_b2:
    // [22] phi (byte*) print_char_cursor#29 = (byte*~) print_char_cursor#31 [phi:main::@2->print_str#0] -- register_copy 
    // [22] phi (byte*) print_str::str#6 = (const byte[]) msg2#0 [phi:main::@2->print_str#1] -- pbuz1=pbuc1 
    lda #<msg2
    sta.z print_str.str
    lda #>msg2
    sta.z print_str.str+1
    jsr print_str
    // [10] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
  b3_from_b2:
    jmp b3
    // main::@3
  b3:
    // [11] call print_ln 
    // [17] phi from main::@3 to print_ln [phi:main::@3->print_ln]
  print_ln_from_b3:
    // [17] phi (byte*) print_line_cursor#16 = (byte*) print_line_cursor#1 [phi:main::@3->print_ln#0] -- register_copy 
    jsr print_ln
    jmp b4
    // main::@4
  b4:
    // [12] (byte*~) print_char_cursor#32 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 
    lda.z print_line_cursor
    sta.z print_char_cursor
    lda.z print_line_cursor+1
    sta.z print_char_cursor+1
    // [13] call print_str 
    // [22] phi from main::@4 to print_str [phi:main::@4->print_str]
  print_str_from_b4:
    // [22] phi (byte*) print_char_cursor#29 = (byte*~) print_char_cursor#32 [phi:main::@4->print_str#0] -- register_copy 
    // [22] phi (byte*) print_str::str#6 = (const byte[]) msg3#0 [phi:main::@4->print_str#1] -- pbuz1=pbuc1 
    lda #<msg3
    sta.z print_str.str
    lda #>msg3
    sta.z print_str.str+1
    jsr print_str
    // [14] phi from main::@4 to main::@5 [phi:main::@4->main::@5]
  b5_from_b4:
    jmp b5
    // main::@5
  b5:
    // [15] call print_ln 
    // [17] phi from main::@5 to print_ln [phi:main::@5->print_ln]
  print_ln_from_b5:
    // [17] phi (byte*) print_line_cursor#16 = (byte*) print_line_cursor#1 [phi:main::@5->print_ln#0] -- register_copy 
    jsr print_ln
    jmp breturn
    // main::@return
  breturn:
    // [16] return 
    rts
}
  // print_ln
// Print a newline
print_ln: {
    // [18] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1]
  b1_from_print_ln:
  b1_from_b1:
    // [18] phi (byte*) print_line_cursor#8 = (byte*) print_line_cursor#16 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy 
    jmp b1
    // print_ln::@1
  b1:
    // [19] (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
  !:
    // [20] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#13) 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:
    // [21] return 
    rts
}
  // print_str
// Print a zero-terminated string
// print_str(byte* zeropage(4) str)
print_str: {
    .label str = 4
    // [23] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
  b1_from_print_str:
  b1_from_b2:
    // [23] phi (byte*) print_char_cursor#13 = (byte*) print_char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy 
    // [23] phi (byte*) print_str::str#4 = (byte*) print_str::str#6 [phi:print_str/print_str::@2->print_str::@1#1] -- register_copy 
    jmp b1
    // print_str::@1
  b1:
    // [24] if((byte) 0!=*((byte*) print_str::str#4)) goto print_str::@2 -- vbuc1_neq__deref_pbuz1_then_la1 
    ldy #0
    lda (str),y
    cmp #0
    bne b2
    jmp breturn
    // print_str::@return
  breturn:
    // [25] return 
    rts
    // print_str::@2
  b2:
    // [26] *((byte*) print_char_cursor#13) ← *((byte*) print_str::str#4) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (str),y
    ldy #0
    sta (print_char_cursor),y
    // [27] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#13 -- pbuz1=_inc_pbuz1 
    inc.z print_char_cursor
    bne !+
    inc.z print_char_cursor+1
  !:
    // [28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 -- pbuz1=_inc_pbuz1 
    inc.z str
    bne !+
    inc.z str+1
  !:
    jmp b1_from_b2
}
  // File Data
  msg: .text "hello world! "
  .byte 0
  msg2: .text "hello c64! "
  .byte 0
  msg3: .text "hello 2017! "
  .byte 0

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp b4
Removing instruction jmp b5
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction ldy #0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label b1_from_b1 with b1
Replacing label b1_from_b1 with b1
Replacing label b1_from_b2 with b1
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Removing instruction b1_from_main:
Removing instruction print_ln_from_b1:
Removing instruction b3_from_b2:
Removing instruction print_ln_from_b3:
Removing instruction b5_from_b4:
Removing instruction print_ln_from_b5:
Removing instruction b1_from_print_ln:
Removing instruction b1_from_b1:
Removing instruction b1_from_print_str:
Removing instruction b1_from_b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction print_str_from_main:
Removing instruction b1:
Removing instruction b2:
Removing instruction print_str_from_b2:
Removing instruction b3:
Removing instruction b4:
Removing instruction print_str_from_b4:
Removing instruction b5:
Removing instruction breturn:
Removing instruction breturn:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const byte) RADIX::BINARY BINARY = (number) 2
(const byte) RADIX::DECIMAL DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10
(const byte) RADIX::OCTAL OCTAL = (number) 8
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@return
(byte[]) msg
(const byte[]) msg#0 msg = (string) "hello world! "
(byte[]) msg2
(const byte[]) msg2#0 msg2 = (string) "hello c64! "
(byte[]) msg3
(const byte[]) msg3#0 msg3 = (string) "hello 2017! "
(byte*) print_char_cursor
(byte*) print_char_cursor#1 print_char_cursor zp ZP_WORD:6 11.0
(byte*) print_char_cursor#13 print_char_cursor zp ZP_WORD:6 3.2857142857142856
(byte*) print_char_cursor#29 print_char_cursor zp ZP_WORD:6 6.0
(byte*~) print_char_cursor#31 print_char_cursor zp ZP_WORD:6 4.0
(byte*~) print_char_cursor#32 print_char_cursor zp ZP_WORD:6 4.0
(byte*) print_line_cursor
(byte*) print_line_cursor#1 print_line_cursor zp ZP_WORD:2 3.7272727272727275
(byte*) print_line_cursor#16 print_line_cursor zp ZP_WORD:2 6.0
(byte*) print_line_cursor#8 print_line_cursor zp ZP_WORD:2 24.0
(void()) print_ln()
(label) print_ln::@1
(label) print_ln::@return
(byte*) print_screen
(void()) print_str((byte*) print_str::str)
(label) print_str::@1
(label) print_str::@2
(label) print_str::@return
(byte*) print_str::str
(byte*) print_str::str#0 str zp ZP_WORD:4 22.0
(byte*) print_str::str#4 str zp ZP_WORD:4 11.5
(byte*) print_str::str#6 str zp ZP_WORD:4 2.0

zp ZP_WORD:2 [ print_line_cursor#8 print_line_cursor#16 print_line_cursor#1 ]
zp ZP_WORD:4 [ print_str::str#4 print_str::str#6 print_str::str#0 ]
zp ZP_WORD:6 [ print_char_cursor#13 print_char_cursor#29 print_char_cursor#31 print_char_cursor#32 print_char_cursor#1 ]


FINAL ASSEMBLER
Score: 1033

  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .label print_char_cursor = 6
  .label print_line_cursor = 2
  // @begin
  // [1] phi from @begin to @1 [phi:@begin->@1]
  // @1
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
  // [3] phi from @1 to @end [phi:@1->@end]
  // @end
  // main
main: {
    // print_str(msg)
    // [5] call print_str 
    // [22] phi from main to print_str [phi:main->print_str]
    // [22] phi (byte*) print_char_cursor#29 = (byte*) 1024 [phi:main->print_str#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_char_cursor
    lda #>$400
    sta.z print_char_cursor+1
    // [22] phi (byte*) print_str::str#6 = (const byte[]) msg#0 [phi:main->print_str#1] -- pbuz1=pbuc1 
    lda #<msg
    sta.z print_str.str
    lda #>msg
    sta.z print_str.str+1
    jsr print_str
    // [6] phi from main to main::@1 [phi:main->main::@1]
    // main::@1
    // print_ln()
    // [7] call print_ln 
    // [17] phi from main::@1 to print_ln [phi:main::@1->print_ln]
    // [17] phi (byte*) print_line_cursor#16 = (byte*) 1024 [phi:main::@1->print_ln#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_line_cursor
    lda #>$400
    sta.z print_line_cursor+1
    jsr print_ln
    // main::@2
    // [8] (byte*~) print_char_cursor#31 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 
    lda.z print_line_cursor
    sta.z print_char_cursor
    lda.z print_line_cursor+1
    sta.z print_char_cursor+1
    // print_str(msg2)
    // [9] call print_str 
    // [22] phi from main::@2 to print_str [phi:main::@2->print_str]
    // [22] phi (byte*) print_char_cursor#29 = (byte*~) print_char_cursor#31 [phi:main::@2->print_str#0] -- register_copy 
    // [22] phi (byte*) print_str::str#6 = (const byte[]) msg2#0 [phi:main::@2->print_str#1] -- pbuz1=pbuc1 
    lda #<msg2
    sta.z print_str.str
    lda #>msg2
    sta.z print_str.str+1
    jsr print_str
    // [10] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
    // main::@3
    // print_ln()
    // [11] call print_ln 
    // [17] phi from main::@3 to print_ln [phi:main::@3->print_ln]
    // [17] phi (byte*) print_line_cursor#16 = (byte*) print_line_cursor#1 [phi:main::@3->print_ln#0] -- register_copy 
    jsr print_ln
    // main::@4
    // [12] (byte*~) print_char_cursor#32 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2 
    lda.z print_line_cursor
    sta.z print_char_cursor
    lda.z print_line_cursor+1
    sta.z print_char_cursor+1
    // print_str(msg3)
    // [13] call print_str 
    // [22] phi from main::@4 to print_str [phi:main::@4->print_str]
    // [22] phi (byte*) print_char_cursor#29 = (byte*~) print_char_cursor#32 [phi:main::@4->print_str#0] -- register_copy 
    // [22] phi (byte*) print_str::str#6 = (const byte[]) msg3#0 [phi:main::@4->print_str#1] -- pbuz1=pbuc1 
    lda #<msg3
    sta.z print_str.str
    lda #>msg3
    sta.z print_str.str+1
    jsr print_str
    // [14] phi from main::@4 to main::@5 [phi:main::@4->main::@5]
    // main::@5
    // print_ln()
    // [15] call print_ln 
    // [17] phi from main::@5 to print_ln [phi:main::@5->print_ln]
    // [17] phi (byte*) print_line_cursor#16 = (byte*) print_line_cursor#1 [phi:main::@5->print_ln#0] -- register_copy 
    jsr print_ln
    // main::@return
    // }
    // [16] return 
    rts
}
  // print_ln
// Print a newline
print_ln: {
    // [18] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1]
    // [18] phi (byte*) print_line_cursor#8 = (byte*) print_line_cursor#16 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy 
    // print_ln::@1
  b1:
    // print_line_cursor + $28
    // [19] (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)
    // [20] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#13) 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
    // }
    // [21] return 
    rts
}
  // print_str
// Print a zero-terminated string
// print_str(byte* zeropage(4) str)
print_str: {
    .label str = 4
    // [23] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
    // [23] phi (byte*) print_char_cursor#13 = (byte*) print_char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy 
    // [23] phi (byte*) print_str::str#4 = (byte*) print_str::str#6 [phi:print_str/print_str::@2->print_str::@1#1] -- register_copy 
    // print_str::@1
  b1:
    // while(*str)
    // [24] if((byte) 0!=*((byte*) print_str::str#4)) goto print_str::@2 -- vbuc1_neq__deref_pbuz1_then_la1 
    ldy #0
    lda (str),y
    cmp #0
    bne b2
    // print_str::@return
    // }
    // [25] return 
    rts
    // print_str::@2
  b2:
    // *(print_char_cursor++) = *(str++)
    // [26] *((byte*) print_char_cursor#13) ← *((byte*) print_str::str#4) -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (str),y
    sta (print_char_cursor),y
    // *(print_char_cursor++) = *(str++);
    // [27] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#13 -- pbuz1=_inc_pbuz1 
    inc.z print_char_cursor
    bne !+
    inc.z print_char_cursor+1
  !:
    // [28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 -- pbuz1=_inc_pbuz1 
    inc.z str
    bne !+
    inc.z str+1
  !:
    jmp b1
}
  // File Data
  msg: .text "hello world! "
  .byte 0
  msg2: .text "hello c64! "
  .byte 0
  msg3: .text "hello 2017! "
  .byte 0

