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*) 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 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) @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) print_sword::@4
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) main::@2

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:@38

(void()) print_ln()
print_ln: scope:[print_ln]  from main::@5
  (byte*) print_char_cursor#41 ← phi( main::@5/(byte*) print_char_cursor#17 )
  (byte*) print_line_cursor#12 ← phi( main::@5/(byte*) print_line_cursor#13 )
  to:print_ln::@1
print_ln::@1: scope:[print_ln]  from print_ln print_ln::@1
  (byte*) print_char_cursor#21 ← phi( print_ln/(byte*) print_char_cursor#41 print_ln::@1/(byte*) print_char_cursor#21 )
  (byte*) print_line_cursor#6 ← phi( print_ln/(byte*) print_line_cursor#12 print_ln::@1/(byte*) print_line_cursor#1 )
  (byte*~) print_ln::$0 ← (byte*) print_line_cursor#6 + (number) $28
  (byte*) print_line_cursor#1 ← (byte*~) print_ln::$0
  (bool~) print_ln::$1 ← (byte*) print_line_cursor#1 < (byte*) print_char_cursor#21
  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#7 ← phi( print_ln::@1/(byte*) print_line_cursor#1 )
  (byte*) print_char_cursor#1 ← (byte*) print_line_cursor#7
  to:print_ln::@return
print_ln::@return: scope:[print_ln]  from print_ln::@2
  (byte*) print_char_cursor#22 ← phi( print_ln::@2/(byte*) print_char_cursor#1 )
  (byte*) print_line_cursor#8 ← phi( print_ln::@2/(byte*) print_line_cursor#7 )
  (byte*) print_line_cursor#2 ← (byte*) print_line_cursor#8
  (byte*) print_char_cursor#2 ← (byte*) print_char_cursor#22
  return 
  to:@return

(void()) print_sword((signed word) print_sword::w)
print_sword: scope:[print_sword]  from main::@1
  (byte*) print_char_cursor#49 ← phi( main::@1/(byte*) print_char_cursor#47 )
  (signed word) print_sword::w#2 ← phi( main::@1/(signed word) print_sword::w#1 )
  (bool~) print_sword::$0 ← (signed word) print_sword::w#2 < (number) 0
  if((bool~) print_sword::$0) goto print_sword::@1
  to:print_sword::@3
print_sword::@1: scope:[print_sword]  from print_sword
  (signed word) print_sword::w#5 ← phi( print_sword/(signed word) print_sword::w#2 )
  (byte*) print_char_cursor#42 ← phi( print_sword/(byte*) print_char_cursor#49 )
  (byte) print_char::ch#0 ← (byte) '-'
  call print_char 
  to:print_sword::@5
print_sword::@5: scope:[print_sword]  from print_sword::@1
  (signed word) print_sword::w#3 ← phi( print_sword::@1/(signed word) print_sword::w#5 )
  (byte*) print_char_cursor#23 ← phi( print_sword::@1/(byte*) print_char_cursor#14 )
  (byte*) print_char_cursor#3 ← (byte*) print_char_cursor#23
  (signed word~) print_sword::$5 ← - (signed word) print_sword::w#3
  (signed word) print_sword::w#0 ← (signed word~) print_sword::$5
  to:print_sword::@2
print_sword::@3: scope:[print_sword]  from print_sword
  (signed word) print_sword::w#7 ← phi( print_sword/(signed word) print_sword::w#2 )
  (byte*) print_char_cursor#43 ← phi( print_sword/(byte*) print_char_cursor#49 )
  (byte) print_char::ch#1 ← (byte) ' '
  call print_char 
  to:print_sword::@6
print_sword::@6: scope:[print_sword]  from print_sword::@3
  (signed word) print_sword::w#6 ← phi( print_sword::@3/(signed word) print_sword::w#7 )
  (byte*) print_char_cursor#24 ← phi( print_sword::@3/(byte*) print_char_cursor#14 )
  (byte*) print_char_cursor#4 ← (byte*) print_char_cursor#24
  to:print_sword::@2
print_sword::@2: scope:[print_sword]  from print_sword::@5 print_sword::@6
  (byte*) print_char_cursor#44 ← phi( print_sword::@5/(byte*) print_char_cursor#3 print_sword::@6/(byte*) print_char_cursor#4 )
  (signed word) print_sword::w#4 ← phi( print_sword::@5/(signed word) print_sword::w#0 print_sword::@6/(signed word) print_sword::w#6 )
  (word~) print_sword::$1 ← ((word)) (signed word) print_sword::w#4
  (word) print_word::w#0 ← (word~) print_sword::$1
  call print_word 
  to:print_sword::@7
print_sword::@7: scope:[print_sword]  from print_sword::@2
  (byte*) print_char_cursor#25 ← phi( print_sword::@2/(byte*) print_char_cursor#9 )
  (byte*) print_char_cursor#5 ← (byte*) print_char_cursor#25
  to:print_sword::@return
print_sword::@return: scope:[print_sword]  from print_sword::@7
  (byte*) print_char_cursor#26 ← phi( print_sword::@7/(byte*) print_char_cursor#5 )
  (byte*) print_char_cursor#6 ← (byte*) print_char_cursor#26
  return 
  to:@return

(void()) print_word((word) print_word::w)
print_word: scope:[print_word]  from main::@4 print_sword::@2
  (byte*) print_char_cursor#45 ← phi( main::@4/(byte*) print_char_cursor#16 print_sword::@2/(byte*) print_char_cursor#44 )
  (word) print_word::w#2 ← phi( main::@4/(word) print_word::w#1 print_sword::@2/(word) print_word::w#0 )
  (byte~) print_word::$0 ← > (word) print_word::w#2
  (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#3 ← phi( print_word/(word) print_word::w#2 )
  (byte*) print_char_cursor#27 ← phi( print_word/(byte*) print_char_cursor#12 )
  (byte*) print_char_cursor#7 ← (byte*) print_char_cursor#27
  (byte~) print_word::$2 ← < (word) print_word::w#3
  (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#28 ← phi( print_word::@1/(byte*) print_char_cursor#12 )
  (byte*) print_char_cursor#8 ← (byte*) print_char_cursor#28
  to:print_word::@return
print_word::@return: scope:[print_word]  from print_word::@2
  (byte*) print_char_cursor#29 ← phi( print_word::@2/(byte*) print_char_cursor#8 )
  (byte*) print_char_cursor#9 ← (byte*) print_char_cursor#29
  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#46 ← phi( print_word/(byte*) print_char_cursor#45 print_word::@1/(byte*) print_char_cursor#7 )
  (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#2 ← *((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#30 ← phi( print_byte/(byte*) print_char_cursor#14 )
  (byte*) print_char_cursor#10 ← (byte*) print_char_cursor#30
  (number~) print_byte::$2 ← (byte) print_byte::b#3 & (number) $f
  (byte) print_char::ch#3 ← *((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#31 ← phi( print_byte::@1/(byte*) print_char_cursor#14 )
  (byte*) print_char_cursor#11 ← (byte*) print_char_cursor#31
  to:print_byte::@return
print_byte::@return: scope:[print_byte]  from print_byte::@2
  (byte*) print_char_cursor#32 ← phi( print_byte::@2/(byte*) print_char_cursor#11 )
  (byte*) print_char_cursor#12 ← (byte*) print_char_cursor#32
  return 
  to:@return

(void()) print_char((byte) print_char::ch)
print_char: scope:[print_char]  from main::@3 print_byte print_byte::@1 print_sword::@1 print_sword::@3
  (byte*) print_char_cursor#33 ← phi( main::@3/(byte*) print_char_cursor#15 print_byte/(byte*) print_char_cursor#46 print_byte::@1/(byte*) print_char_cursor#10 print_sword::@1/(byte*) print_char_cursor#42 print_sword::@3/(byte*) print_char_cursor#43 )
  (byte) print_char::ch#5 ← phi( main::@3/(byte) print_char::ch#4 print_byte/(byte) print_char::ch#2 print_byte::@1/(byte) print_char::ch#3 print_sword::@1/(byte) print_char::ch#0 print_sword::@3/(byte) print_char::ch#1 )
  *((byte*) print_char_cursor#33) ← (byte) print_char::ch#5
  (byte*) print_char_cursor#13 ← ++ (byte*) print_char_cursor#33
  to:print_char::@return
print_char::@return: scope:[print_char]  from print_char
  (byte*) print_char_cursor#34 ← phi( print_char/(byte*) print_char_cursor#13 )
  (byte*) print_char_cursor#14 ← (byte*) print_char_cursor#34
  return 
  to:@return

(void()) main()
main: scope:[main]  from @38
  (byte*) print_line_cursor#18 ← phi( @38/(byte*) print_line_cursor#14 )
  (byte*) print_char_cursor#50 ← phi( @38/(byte*) print_char_cursor#48 )
  (signed word) main::a#0 ← (signed word) -$3ff
  (word) main::b#0 ← (word) $1024
  (byte) main::i#0 ← (byte) 0
  to:main::@1
main::@1: scope:[main]  from main main::@6
  (byte) main::i#6 ← phi( main/(byte) main::i#0 main::@6/(byte) main::i#1 )
  (byte*) print_line_cursor#17 ← phi( main/(byte*) print_line_cursor#18 main::@6/(byte*) print_line_cursor#3 )
  (byte*) print_char_cursor#47 ← phi( main/(byte*) print_char_cursor#50 main::@6/(byte*) print_char_cursor#18 )
  (word) main::b#2 ← phi( main/(word) main::b#0 main::@6/(word) main::b#4 )
  (signed word) main::a#2 ← phi( main/(signed word) main::a#0 main::@6/(signed word) main::a#3 )
  (signed word) main::a#1 ← (signed word) main::a#2 + (number) -7
  (word) main::b#1 ← (word) main::b#2 + (number) $141
  (signed word) print_sword::w#1 ← (signed word) main::a#1
  call print_sword 
  to:main::@3
main::@3: scope:[main]  from main::@1
  (signed word) main::a#6 ← phi( main::@1/(signed word) main::a#1 )
  (byte) main::i#5 ← phi( main::@1/(byte) main::i#6 )
  (byte*) print_line_cursor#16 ← phi( main::@1/(byte*) print_line_cursor#17 )
  (word) main::b#5 ← phi( main::@1/(word) main::b#1 )
  (byte*) print_char_cursor#35 ← phi( main::@1/(byte*) print_char_cursor#6 )
  (byte*) print_char_cursor#15 ← (byte*) print_char_cursor#35
  (byte) print_char::ch#4 ← (byte) ' '
  call print_char 
  to:main::@4
main::@4: scope:[main]  from main::@3
  (signed word) main::a#5 ← phi( main::@3/(signed word) main::a#6 )
  (byte) main::i#4 ← phi( main::@3/(byte) main::i#5 )
  (byte*) print_line_cursor#15 ← phi( main::@3/(byte*) print_line_cursor#16 )
  (word) main::b#3 ← phi( main::@3/(word) main::b#5 )
  (byte*) print_char_cursor#36 ← phi( main::@3/(byte*) print_char_cursor#14 )
  (byte*) print_char_cursor#16 ← (byte*) print_char_cursor#36
  (word) print_word::w#1 ← (word) main::b#3
  call print_word 
  to:main::@5
main::@5: scope:[main]  from main::@4
  (word) main::b#6 ← phi( main::@4/(word) main::b#3 )
  (signed word) main::a#4 ← phi( main::@4/(signed word) main::a#5 )
  (byte) main::i#3 ← phi( main::@4/(byte) main::i#4 )
  (byte*) print_line_cursor#13 ← phi( main::@4/(byte*) print_line_cursor#15 )
  (byte*) print_char_cursor#37 ← phi( main::@4/(byte*) print_char_cursor#9 )
  (byte*) print_char_cursor#17 ← (byte*) print_char_cursor#37
  call print_ln 
  to:main::@6
main::@6: scope:[main]  from main::@5
  (word) main::b#4 ← phi( main::@5/(word) main::b#6 )
  (signed word) main::a#3 ← phi( main::@5/(signed word) main::a#4 )
  (byte) main::i#2 ← phi( main::@5/(byte) main::i#3 )
  (byte*) print_char_cursor#38 ← phi( main::@5/(byte*) print_char_cursor#2 )
  (byte*) print_line_cursor#9 ← phi( main::@5/(byte*) print_line_cursor#2 )
  (byte*) print_line_cursor#3 ← (byte*) print_line_cursor#9
  (byte*) print_char_cursor#18 ← (byte*) print_char_cursor#38
  (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,5)
  (bool~) main::$4 ← (byte) main::i#1 != rangelast(0,5)
  if((bool~) main::$4) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@6
  (byte*) print_line_cursor#10 ← phi( main::@6/(byte*) print_line_cursor#3 )
  (byte*) print_char_cursor#39 ← phi( main::@6/(byte*) print_char_cursor#18 )
  (byte*) print_char_cursor#19 ← (byte*) print_char_cursor#39
  (byte*) print_line_cursor#4 ← (byte*) print_line_cursor#10
  return 
  to:@return
@38: scope:[]  from @13
  (byte*) print_line_cursor#14 ← phi( @13/(byte*) print_line_cursor#0 )
  (byte*) print_char_cursor#48 ← phi( @13/(byte*) print_char_cursor#0 )
  call main 
  to:@39
@39: scope:[]  from @38
  (byte*) print_line_cursor#11 ← phi( @38/(byte*) print_line_cursor#4 )
  (byte*) print_char_cursor#40 ← phi( @38/(byte*) print_char_cursor#19 )
  (byte*) print_char_cursor#20 ← (byte*) print_char_cursor#40
  (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#11
  to:@end
@end: scope:[]  from @39

SYMBOL TABLE SSA
(label) @13
(label) @38
(label) @39
(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()
(bool~) main::$4
(label) main::@1
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@return
(signed word) main::a
(signed word) main::a#0
(signed word) main::a#1
(signed word) main::a#2
(signed word) main::a#3
(signed word) main::a#4
(signed word) main::a#5
(signed word) main::a#6
(word) main::b
(word) main::b#0
(word) main::b#1
(word) main::b#2
(word) main::b#3
(word) main::b#4
(word) main::b#5
(word) main::b#6
(byte) main::i
(byte) main::i#0
(byte) main::i#1
(byte) main::i#2
(byte) main::i#3
(byte) main::i#4
(byte) main::i#5
(byte) main::i#6
(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::ch#4
(byte) print_char::ch#5
(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#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#2
(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_sword((signed word) print_sword::w)
(bool~) print_sword::$0
(word~) print_sword::$1
(signed word~) print_sword::$5
(label) print_sword::@1
(label) print_sword::@2
(label) print_sword::@3
(label) print_sword::@5
(label) print_sword::@6
(label) print_sword::@7
(label) print_sword::@return
(signed word) print_sword::w
(signed word) print_sword::w#0
(signed word) print_sword::w#1
(signed word) print_sword::w#2
(signed word) print_sword::w#3
(signed word) print_sword::w#4
(signed word) print_sword::w#5
(signed word) print_sword::w#6
(signed word) print_sword::w#7
(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) print_word::w#3

Adding number conversion cast (unumber) $28 in (byte*~) print_ln::$0 ← (byte*) print_line_cursor#6 + (number) $28
Adding number conversion cast (snumber) 0 in (bool~) print_sword::$0 ← (signed word) print_sword::w#2 < (number) 0
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 (snumber) -7 in (signed word) main::a#1 ← (signed word) main::a#2 + (number) -7
Adding number conversion cast (unumber) $141 in (word) main::b#1 ← (word) main::b#2 + (number) $141
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (word~) print_sword::$1 ← (word)(signed word) print_sword::w#4
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $28
Simplifying constant integer cast 0
Simplifying constant integer cast 4
Simplifying constant integer cast $f
Simplifying constant integer cast -7
Simplifying constant integer cast $141
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $28
Finalized signed number type (signed byte) 0
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) $f
Finalized signed number type (signed byte) -7
Finalized unsigned number type (word) $141
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#48 (byte*) print_line_cursor#14 
Alias (byte*) print_line_cursor#1 = (byte*~) print_ln::$0 (byte*) print_line_cursor#7 (byte*) print_char_cursor#1 (byte*) print_line_cursor#8 (byte*) print_char_cursor#22 (byte*) print_line_cursor#2 (byte*) print_char_cursor#2 
Alias (byte*) print_char_cursor#42 = (byte*) print_char_cursor#49 (byte*) print_char_cursor#43 
Alias (signed word) print_sword::w#2 = (signed word) print_sword::w#5 (signed word) print_sword::w#3 (signed word) print_sword::w#7 (signed word) print_sword::w#6 
Alias (byte*) print_char_cursor#23 = (byte*) print_char_cursor#3 
Alias (signed word) print_sword::w#0 = (signed word~) print_sword::$5 
Alias (byte*) print_char_cursor#24 = (byte*) print_char_cursor#4 
Alias (word) print_word::w#0 = (word~) print_sword::$1 
Alias (byte*) print_char_cursor#25 = (byte*) print_char_cursor#5 (byte*) print_char_cursor#26 (byte*) print_char_cursor#6 
Alias (byte) print_byte::b#0 = (byte~) print_word::$0 
Alias (word) print_word::w#2 = (word) print_word::w#3 
Alias (byte*) print_char_cursor#27 = (byte*) print_char_cursor#7 
Alias (byte) print_byte::b#1 = (byte~) print_word::$2 
Alias (byte*) print_char_cursor#28 = (byte*) print_char_cursor#8 (byte*) print_char_cursor#29 (byte*) print_char_cursor#9 
Alias (byte) print_byte::b#2 = (byte) print_byte::b#3 
Alias (byte*) print_char_cursor#10 = (byte*) print_char_cursor#30 
Alias (byte*) print_char_cursor#11 = (byte*) print_char_cursor#31 (byte*) print_char_cursor#32 (byte*) print_char_cursor#12 
Alias (byte*) print_char_cursor#13 = (byte*) print_char_cursor#34 (byte*) print_char_cursor#14 
Alias (word) main::b#1 = (word) main::b#5 (word) main::b#3 (word) main::b#6 (word) main::b#4 
Alias (byte*) print_line_cursor#13 = (byte*) print_line_cursor#16 (byte*) print_line_cursor#17 (byte*) print_line_cursor#15 
Alias (byte) main::i#2 = (byte) main::i#5 (byte) main::i#6 (byte) main::i#4 (byte) main::i#3 
Alias (signed word) main::a#1 = (signed word) main::a#6 (signed word) main::a#5 (signed word) main::a#4 (signed word) main::a#3 
Alias (byte*) print_char_cursor#15 = (byte*) print_char_cursor#35 
Alias (byte*) print_char_cursor#16 = (byte*) print_char_cursor#36 
Alias (byte*) print_char_cursor#17 = (byte*) print_char_cursor#37 
Alias (byte*) print_line_cursor#10 = (byte*) print_line_cursor#3 (byte*) print_line_cursor#9 (byte*) print_line_cursor#4 
Alias (byte*) print_char_cursor#18 = (byte*) print_char_cursor#38 (byte*) print_char_cursor#39 (byte*) print_char_cursor#19 
Alias (byte*) print_char_cursor#20 = (byte*) print_char_cursor#40 
Alias (byte*) print_line_cursor#11 = (byte*) print_line_cursor#5 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte*) print_line_cursor#12 (byte*) print_line_cursor#13
Identical Phi Values (byte*) print_char_cursor#41 (byte*) print_char_cursor#17
Identical Phi Values (byte*) print_char_cursor#21 (byte*) print_char_cursor#41
Identical Phi Values (signed word) print_sword::w#2 (signed word) print_sword::w#1
Identical Phi Values (byte*) print_char_cursor#42 (byte*) print_char_cursor#47
Identical Phi Values (byte*) print_char_cursor#23 (byte*) print_char_cursor#13
Identical Phi Values (byte*) print_char_cursor#24 (byte*) print_char_cursor#13
Identical Phi Values (byte*) print_char_cursor#25 (byte*) print_char_cursor#28
Identical Phi Values (byte*) print_char_cursor#27 (byte*) print_char_cursor#11
Identical Phi Values (byte*) print_char_cursor#28 (byte*) print_char_cursor#11
Identical Phi Values (byte*) print_char_cursor#10 (byte*) print_char_cursor#13
Identical Phi Values (byte*) print_char_cursor#11 (byte*) print_char_cursor#13
Identical Phi Values (byte*) print_char_cursor#50 (byte*) print_char_cursor#0
Identical Phi Values (byte*) print_line_cursor#18 (byte*) print_char_cursor#0
Identical Phi Values (byte*) print_char_cursor#15 (byte*) print_char_cursor#25
Identical Phi Values (byte*) print_char_cursor#16 (byte*) print_char_cursor#13
Identical Phi Values (byte*) print_char_cursor#17 (byte*) print_char_cursor#28
Identical Phi Values (byte*) print_line_cursor#10 (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#20 (byte*) print_char_cursor#18
Identical Phi Values (byte*) print_line_cursor#11 (byte*) print_line_cursor#10
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values (byte*) print_char_cursor#44 (byte*) print_char_cursor#13
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values (byte*) print_char_cursor#45 (byte*) print_char_cursor#13
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values (byte*) print_char_cursor#46 (byte*) print_char_cursor#13
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) print_ln::$1 [8] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#13) goto print_ln::@1
Simple Condition (bool~) print_sword::$0 [17] if((signed word) print_sword::w#1<(signed byte) 0) goto print_sword::@1
Simple Condition (bool~) main::$4 [98] if((byte) main::i#1!=rangelast(0,5)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) print_char_cursor#0 = (byte*) 1024
Constant (const byte) print_char::ch#0 = '-'
Constant (const byte) print_char::ch#1 = ' '
Constant (const signed word) main::a#0 = -$3ff
Constant (const word) main::b#0 = $1024
Constant (const byte) main::i#0 = 0
Constant (const byte) print_char::ch#4 = ' '
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [96] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [98] if(main::i#1!=rangelast(0,5)) goto main::@1 to (number) 6
Adding number conversion cast (unumber) 6 in if((byte) main::i#1!=(number) 6) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 6
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 6
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inlining constant with var siblings (const byte) print_char::ch#0
Inlining constant with var siblings (const byte) print_char::ch#1
Inlining constant with var siblings (const byte) print_char::ch#4
Inlining constant with var siblings (const signed word) main::a#0
Inlining constant with var siblings (const word) main::b#0
Inlining constant with var siblings (const byte) main::i#0
Inlining constant with var siblings (const byte*) print_char_cursor#0
Constant inlined main::a#0 = (signed word) -$3ff
Constant inlined print_char_cursor#0 = (byte*) 1024
Constant inlined print_char::ch#4 = (byte) ' '
Constant inlined main::b#0 = (word) $1024
Constant inlined print_char::ch#1 = (byte) ' '
Constant inlined print_char::ch#0 = (byte) '-'
Constant inlined main::i#0 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1)
Added new block during phi lifting main::@7(between main::@6 and main::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @13
Adding NOP phi() at start of @38
Adding NOP phi() at start of @39
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 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 print_sword::@7
CALL GRAPH
Calls in [] to main:3 
Calls in [main] to print_sword:11 print_char:13 print_word:16 print_ln:18 
Calls in [print_word] to print_byte:37 print_byte:40 
Calls in [print_byte] to print_char:48 print_char:53 
Calls in [print_sword] to print_char:62 print_word:67 print_char:71 

Created 11 initial phi equivalence classes
Coalesced [12] print_char_cursor#51 ← print_char_cursor#13
Coalesced [15] print_word::w#4 ← print_word::w#1
Coalesced [22] main::a#7 ← main::a#1
Coalesced [23] main::b#7 ← main::b#1
Not coalescing [24] print_char_cursor#56 ← print_line_cursor#1
Coalesced [25] print_line_cursor#21 ← print_line_cursor#1
Coalesced [26] main::i#7 ← main::i#1
Coalesced [27] print_line_cursor#19 ← print_line_cursor#13
Coalesced (already) [33] print_line_cursor#20 ← print_line_cursor#1
Coalesced [36] print_byte::b#4 ← print_byte::b#0
Coalesced [39] print_byte::b#5 ← print_byte::b#1
Coalesced [46] print_char::ch#6 ← print_char::ch#2
Coalesced (already) [47] print_char_cursor#52 ← print_char_cursor#13
Coalesced [51] print_char::ch#7 ← print_char::ch#3
Coalesced (already) [52] print_char_cursor#53 ← print_char_cursor#13
Coalesced [61] print_char_cursor#55 ← print_char_cursor#47
Coalesced [63] print_sword::w#9 ← print_sword::w#1
Coalesced [66] print_word::w#5 ← print_word::w#0
Coalesced (already) [70] print_char_cursor#54 ← print_char_cursor#47
Coalesced [73] print_sword::w#8 ← print_sword::w#0
Coalesced down to 9 phi equivalence classes
Culled Empty Block (label) @13
Culled Empty Block (label) @39
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) print_sword::@6
Culled Empty Block (label) print_sword::@7
Renumbering block @38 to @1
Renumbering block print_sword::@5 to print_sword::@4
Renumbering block main::@3 to main::@2
Renumbering block main::@4 to main::@3
Renumbering block main::@5 to main::@4
Renumbering block main::@6 to main::@5
Renumbering block main::@7 to main::@6
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::@2
Adding NOP phi() at start of main::@4
Adding NOP phi() at start of print_ln
Adding NOP phi() at start of print_sword::@3
Adding NOP phi() at start of print_sword::@1

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()

(void()) main()
main: scope:[main]  from @1
  [4] phi()
  to:main::@1
main::@1: scope:[main]  from main main::@6
  [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@6/(byte) main::i#1 )
  [5] (byte*) print_line_cursor#13 ← phi( main/(byte*) 1024 main::@6/(byte*) print_line_cursor#1 )
  [5] (byte*) print_char_cursor#47 ← phi( main/(byte*) 1024 main::@6/(byte*) print_char_cursor#56 )
  [5] (word) main::b#2 ← phi( main/(word) $1024 main::@6/(word) main::b#1 )
  [5] (signed word) main::a#2 ← phi( main/(signed word) -$3ff main::@6/(signed word) main::a#1 )
  [6] (signed word) main::a#1 ← (signed word) main::a#2 + (signed byte) -7
  [7] (word) main::b#1 ← (word) main::b#2 + (word) $141
  [8] (signed word) print_sword::w#1 ← (signed word) main::a#1
  [9] call print_sword 
  to:main::@2
main::@2: scope:[main]  from main::@1
  [10] phi()
  [11] call print_char 
  to:main::@3
main::@3: scope:[main]  from main::@2
  [12] (word) print_word::w#1 ← (word) main::b#1
  [13] call print_word 
  to:main::@4
main::@4: scope:[main]  from main::@3
  [14] phi()
  [15] call print_ln 
  to:main::@5
main::@5: scope:[main]  from main::@4
  [16] (byte) main::i#1 ← ++ (byte) main::i#2
  [17] if((byte) main::i#1!=(byte) 6) goto main::@6
  to:main::@return
main::@return: scope:[main]  from main::@5
  [18] return 
  to:@return
main::@6: scope:[main]  from main::@5
  [19] (byte*) print_char_cursor#56 ← (byte*) print_line_cursor#1
  to:main::@1

(void()) print_ln()
print_ln: scope:[print_ln]  from main::@4
  [20] phi()
  to:print_ln::@1
print_ln::@1: scope:[print_ln]  from print_ln print_ln::@1
  [21] (byte*) print_line_cursor#6 ← phi( print_ln/(byte*) print_line_cursor#13 print_ln::@1/(byte*) print_line_cursor#1 )
  [22] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#6 + (byte) $28
  [23] 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
  [24] return 
  to:@return

(void()) print_word((word) print_word::w)
print_word: scope:[print_word]  from main::@3 print_sword::@2
  [25] (word) print_word::w#2 ← phi( main::@3/(word) print_word::w#1 print_sword::@2/(word) print_word::w#0 )
  [26] (byte) print_byte::b#0 ← > (word) print_word::w#2
  [27] call print_byte 
  to:print_word::@1
print_word::@1: scope:[print_word]  from print_word
  [28] (byte) print_byte::b#1 ← < (word) print_word::w#2
  [29] call print_byte 
  to:print_word::@return
print_word::@return: scope:[print_word]  from print_word::@1
  [30] return 
  to:@return

(void()) print_byte((byte) print_byte::b)
print_byte: scope:[print_byte]  from print_word print_word::@1
  [31] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
  [32] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4
  [33] (byte) print_char::ch#2 ← *((const byte*) print_hextab + (byte~) print_byte::$0)
  [34] call print_char 
  to:print_byte::@1
print_byte::@1: scope:[print_byte]  from print_byte
  [35] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f
  [36] (byte) print_char::ch#3 ← *((const byte*) print_hextab + (byte~) print_byte::$2)
  [37] call print_char 
  to:print_byte::@return
print_byte::@return: scope:[print_byte]  from print_byte::@1
  [38] return 
  to:@return

(void()) print_char((byte) print_char::ch)
print_char: scope:[print_char]  from main::@2 print_byte print_byte::@1 print_sword::@1 print_sword::@3
  [39] (byte*) print_char_cursor#33 ← phi( main::@2/(byte*) print_char_cursor#13 print_byte/(byte*) print_char_cursor#13 print_byte::@1/(byte*) print_char_cursor#13 print_sword::@1/(byte*) print_char_cursor#47 print_sword::@3/(byte*) print_char_cursor#47 )
  [39] (byte) print_char::ch#5 ← phi( main::@2/(byte) ' ' print_byte/(byte) print_char::ch#2 print_byte::@1/(byte) print_char::ch#3 print_sword::@1/(byte) '-' print_sword::@3/(byte) ' ' )
  [40] *((byte*) print_char_cursor#33) ← (byte) print_char::ch#5
  [41] (byte*) print_char_cursor#13 ← ++ (byte*) print_char_cursor#33
  to:print_char::@return
print_char::@return: scope:[print_char]  from print_char
  [42] return 
  to:@return

(void()) print_sword((signed word) print_sword::w)
print_sword: scope:[print_sword]  from main::@1
  [43] if((signed word) print_sword::w#1<(signed byte) 0) goto print_sword::@1
  to:print_sword::@3
print_sword::@3: scope:[print_sword]  from print_sword
  [44] phi()
  [45] call print_char 
  to:print_sword::@2
print_sword::@2: scope:[print_sword]  from print_sword::@3 print_sword::@4
  [46] (signed word) print_sword::w#4 ← phi( print_sword::@4/(signed word) print_sword::w#0 print_sword::@3/(signed word) print_sword::w#1 )
  [47] (word) print_word::w#0 ← (word)(signed word) print_sword::w#4
  [48] call print_word 
  to:print_sword::@return
print_sword::@return: scope:[print_sword]  from print_sword::@2
  [49] return 
  to:@return
print_sword::@1: scope:[print_sword]  from print_sword
  [50] phi()
  [51] call print_char 
  to:print_sword::@4
print_sword::@4: scope:[print_sword]  from print_sword::@1
  [52] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1
  to:print_sword::@2


VARIABLE REGISTER WEIGHTS
(void()) main()
(signed word) main::a
(signed word) main::a#1 2.5384615384615383
(signed word) main::a#2 22.0
(word) main::b
(word) main::b#1 2.75
(word) main::b#2 11.0
(byte) main::i
(byte) main::i#1 11.0
(byte) main::i#2 2.0
(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#2 4.0
(byte) print_char::ch#3 4.0
(byte) print_char::ch#5 6.0
(byte*) print_char_cursor
(byte*) print_char_cursor#13 3.5757575757575757
(byte*) print_char_cursor#33 11.5
(byte*) print_char_cursor#47 2.142857142857143
(byte*) print_char_cursor#56 22.0
(byte*) print_line_cursor
(byte*) print_line_cursor#1 46.42857142857143
(byte*) print_line_cursor#13 1.1818181818181819
(byte*) print_line_cursor#6 204.0
(void()) print_ln()
(byte*) print_screen
(void()) print_sword((signed word) print_sword::w)
(signed word) print_sword::w
(signed word) print_sword::w#0 4.0
(signed word) print_sword::w#1 2.8333333333333335
(signed word) print_sword::w#4 4.0
(void()) print_word((word) print_word::w)
(word) print_word::w
(word) print_word::w#0 4.0
(word) print_word::w#1 22.0
(word) print_word::w#2 5.666666666666667

Initial phi equivalence classes
[ main::a#2 main::a#1 ]
[ main::b#2 main::b#1 ]
[ main::i#2 main::i#1 ]
[ print_line_cursor#6 print_line_cursor#13 print_line_cursor#1 ]
[ print_word::w#2 print_word::w#1 print_word::w#0 ]
[ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
[ print_char::ch#5 print_char::ch#2 print_char::ch#3 ]
[ print_char_cursor#33 print_char_cursor#13 print_char_cursor#47 print_char_cursor#56 ]
[ print_sword::w#4 print_sword::w#0 print_sword::w#1 ]
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 ]
Complete equivalence classes
[ main::a#2 main::a#1 ]
[ main::b#2 main::b#1 ]
[ main::i#2 main::i#1 ]
[ print_line_cursor#6 print_line_cursor#13 print_line_cursor#1 ]
[ print_word::w#2 print_word::w#1 print_word::w#0 ]
[ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
[ print_char::ch#5 print_char::ch#2 print_char::ch#3 ]
[ print_char_cursor#33 print_char_cursor#13 print_char_cursor#47 print_char_cursor#56 ]
[ print_sword::w#4 print_sword::w#0 print_sword::w#1 ]
[ print_byte::$0 ]
[ print_byte::$2 ]
Allocated zp[2]:2 [ main::a#2 main::a#1 ]
Allocated zp[2]:4 [ main::b#2 main::b#1 ]
Allocated zp[1]:6 [ main::i#2 main::i#1 ]
Allocated zp[2]:7 [ print_line_cursor#6 print_line_cursor#13 print_line_cursor#1 ]
Allocated zp[2]:9 [ print_word::w#2 print_word::w#1 print_word::w#0 ]
Allocated zp[1]:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
Allocated zp[1]:12 [ print_char::ch#5 print_char::ch#2 print_char::ch#3 ]
Allocated zp[2]:13 [ print_char_cursor#33 print_char_cursor#13 print_char_cursor#47 print_char_cursor#56 ]
Allocated zp[2]:15 [ print_sword::w#4 print_sword::w#0 print_sword::w#1 ]
Allocated zp[1]:17 [ print_byte::$0 ]
Allocated zp[1]:18 [ print_byte::$2 ]

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
// Tests the special "signed" / "unsigned" without a simple type name
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label print_line_cursor = 7
  .label print_char_cursor = $d
  // @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: {
    .label a = 2
    .label b = 4
    .label i = 6
    // [5] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta.z i
    // [5] phi (byte*) print_line_cursor#13 = (byte*) 1024 [phi:main->main::@1#1] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_line_cursor
    lda #>$400
    sta.z print_line_cursor+1
    // [5] phi (byte*) print_char_cursor#47 = (byte*) 1024 [phi:main->main::@1#2] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_char_cursor
    lda #>$400
    sta.z print_char_cursor+1
    // [5] phi (word) main::b#2 = (word) $1024 [phi:main->main::@1#3] -- vwuz1=vwuc1 
    lda #<$1024
    sta.z b
    lda #>$1024
    sta.z b+1
    // [5] phi (signed word) main::a#2 = (signed word) -$3ff [phi:main->main::@1#4] -- vwsz1=vwsc1 
    lda #<-$3ff
    sta.z a
    lda #>-$3ff
    sta.z a+1
    jmp __b1
    // main::@1
  __b1:
    // [6] (signed word) main::a#1 ← (signed word) main::a#2 + (signed byte) -7 -- vwsz1=vwsz1_plus_vbsc1 
    lda.z a
    clc
    adc #<-7
    sta.z a
    lda.z a+1
    adc #>-7
    sta.z a+1
    // [7] (word) main::b#1 ← (word) main::b#2 + (word) $141 -- vwuz1=vwuz1_plus_vwuc1 
    clc
    lda.z b
    adc #<$141
    sta.z b
    lda.z b+1
    adc #>$141
    sta.z b+1
    // [8] (signed word) print_sword::w#1 ← (signed word) main::a#1 -- vwsz1=vwsz2 
    lda.z a
    sta.z print_sword.w
    lda.z a+1
    sta.z print_sword.w+1
    // [9] call print_sword 
    jsr print_sword
    // [10] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  __b2_from___b1:
    jmp __b2
    // main::@2
  __b2:
    // [11] call print_char 
    // [39] phi from main::@2 to print_char [phi:main::@2->print_char]
  print_char_from___b2:
    // [39] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#13 [phi:main::@2->print_char#0] -- register_copy 
    // [39] phi (byte) print_char::ch#5 = (byte) ' ' [phi:main::@2->print_char#1] -- vbuz1=vbuc1 
    lda #' '
    sta.z print_char.ch
    jsr print_char
    jmp __b3
    // main::@3
  __b3:
    // [12] (word) print_word::w#1 ← (word) main::b#1 -- vwuz1=vwuz2 
    lda.z b
    sta.z print_word.w
    lda.z b+1
    sta.z print_word.w+1
    // [13] call print_word 
    // [25] phi from main::@3 to print_word [phi:main::@3->print_word]
  print_word_from___b3:
    // [25] phi (word) print_word::w#2 = (word) print_word::w#1 [phi:main::@3->print_word#0] -- register_copy 
    jsr print_word
    // [14] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
  __b4_from___b3:
    jmp __b4
    // main::@4
  __b4:
    // [15] call print_ln 
    // [20] phi from main::@4 to print_ln [phi:main::@4->print_ln]
  print_ln_from___b4:
    jsr print_ln
    jmp __b5
    // main::@5
  __b5:
    // [16] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [17] if((byte) main::i#1!=(byte) 6) goto main::@6 -- vbuz1_neq_vbuc1_then_la1 
    lda #6
    cmp.z i
    bne __b6
    jmp __breturn
    // main::@return
  __breturn:
    // [18] return 
    rts
    // main::@6
  __b6:
    // [19] (byte*) print_char_cursor#56 ← (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
    // [5] phi from main::@6 to main::@1 [phi:main::@6->main::@1]
  __b1_from___b6:
    // [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@6->main::@1#0] -- register_copy 
    // [5] phi (byte*) print_line_cursor#13 = (byte*) print_line_cursor#1 [phi:main::@6->main::@1#1] -- register_copy 
    // [5] phi (byte*) print_char_cursor#47 = (byte*) print_char_cursor#56 [phi:main::@6->main::@1#2] -- register_copy 
    // [5] phi (word) main::b#2 = (word) main::b#1 [phi:main::@6->main::@1#3] -- register_copy 
    // [5] phi (signed word) main::a#2 = (signed word) main::a#1 [phi:main::@6->main::@1#4] -- register_copy 
    jmp __b1
}
  // print_ln
// Print a newline
print_ln: {
    // [21] 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:
    // [21] phi (byte*) print_line_cursor#6 = (byte*) print_line_cursor#13 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy 
    jmp __b1
    // print_ln::@1
  __b1:
    // [22] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#6 + (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
  !:
    // [23] 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:
    // [24] return 
    rts
}
  // print_word
// Print a word as HEX
// print_word(word zp(9) w)
print_word: {
    .label w = 9
    // [26] (byte) print_byte::b#0 ← > (word) print_word::w#2 -- vbuz1=_hi_vwuz2 
    lda.z w+1
    sta.z print_byte.b
    // [27] call print_byte 
    // [31] phi from print_word to print_byte [phi:print_word->print_byte]
  print_byte_from_print_word:
    // [31] 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:
    // [28] (byte) print_byte::b#1 ← < (word) print_word::w#2 -- vbuz1=_lo_vwuz2 
    lda.z w
    sta.z print_byte.b
    // [29] call print_byte 
    // [31] phi from print_word::@1 to print_byte [phi:print_word::@1->print_byte]
  print_byte_from___b1:
    // [31] 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:
    // [30] return 
    rts
}
  // print_byte
// Print a byte as HEX
// print_byte(byte zp($b) b)
print_byte: {
    .label __0 = $11
    .label __2 = $12
    .label b = $b
    // [32] (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
    // [33] (byte) print_char::ch#2 ← *((const byte*) print_hextab + (byte~) print_byte::$0) -- vbuz1=pbuc1_derefidx_vbuz2 
    ldy.z __0
    lda print_hextab,y
    sta.z print_char.ch
    // [34] call print_char 
    // [39] phi from print_byte to print_char [phi:print_byte->print_char]
  print_char_from_print_byte:
    // [39] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#13 [phi:print_byte->print_char#0] -- register_copy 
    // [39] phi (byte) print_char::ch#5 = (byte) print_char::ch#2 [phi:print_byte->print_char#1] -- register_copy 
    jsr print_char
    jmp __b1
    // print_byte::@1
  __b1:
    // [35] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f -- vbuz1=vbuz2_band_vbuc1 
    lda #$f
    and.z b
    sta.z __2
    // [36] (byte) print_char::ch#3 ← *((const byte*) print_hextab + (byte~) print_byte::$2) -- vbuz1=pbuc1_derefidx_vbuz2 
    ldy.z __2
    lda print_hextab,y
    sta.z print_char.ch
    // [37] call print_char 
    // [39] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char]
  print_char_from___b1:
    // [39] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#13 [phi:print_byte::@1->print_char#0] -- register_copy 
    // [39] phi (byte) print_char::ch#5 = (byte) print_char::ch#3 [phi:print_byte::@1->print_char#1] -- register_copy 
    jsr print_char
    jmp __breturn
    // print_byte::@return
  __breturn:
    // [38] return 
    rts
}
  // print_char
// Print a single char
// print_char(byte zp($c) ch)
print_char: {
    .label ch = $c
    // [40] *((byte*) print_char_cursor#33) ← (byte) print_char::ch#5 -- _deref_pbuz1=vbuz2 
    lda.z ch
    ldy #0
    sta (print_char_cursor),y
    // [41] (byte*) print_char_cursor#13 ← ++ (byte*) print_char_cursor#33 -- pbuz1=_inc_pbuz1 
    inc.z print_char_cursor
    bne !+
    inc.z print_char_cursor+1
  !:
    jmp __breturn
    // print_char::@return
  __breturn:
    // [42] return 
    rts
}
  // print_sword
// Print a signed word as HEX
// print_sword(signed word zp($f) w)
print_sword: {
    .label w = $f
    // [43] if((signed word) print_sword::w#1<(signed byte) 0) goto print_sword::@1 -- vwsz1_lt_0_then_la1 
    lda.z w+1
    bmi __b1_from_print_sword
    // [44] phi from print_sword to print_sword::@3 [phi:print_sword->print_sword::@3]
  __b3_from_print_sword:
    jmp __b3
    // print_sword::@3
  __b3:
    // [45] call print_char 
    // [39] phi from print_sword::@3 to print_char [phi:print_sword::@3->print_char]
  print_char_from___b3:
    // [39] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#47 [phi:print_sword::@3->print_char#0] -- register_copy 
    // [39] phi (byte) print_char::ch#5 = (byte) ' ' [phi:print_sword::@3->print_char#1] -- vbuz1=vbuc1 
    lda #' '
    sta.z print_char.ch
    jsr print_char
    // [46] phi from print_sword::@3 print_sword::@4 to print_sword::@2 [phi:print_sword::@3/print_sword::@4->print_sword::@2]
  __b2_from___b3:
  __b2_from___b4:
    // [46] phi (signed word) print_sword::w#4 = (signed word) print_sword::w#1 [phi:print_sword::@3/print_sword::@4->print_sword::@2#0] -- register_copy 
    jmp __b2
    // print_sword::@2
  __b2:
    // [47] (word) print_word::w#0 ← (word)(signed word) print_sword::w#4 -- vwuz1=vwuz2 
    lda.z w
    sta.z print_word.w
    lda.z w+1
    sta.z print_word.w+1
    // [48] call print_word 
    // [25] phi from print_sword::@2 to print_word [phi:print_sword::@2->print_word]
  print_word_from___b2:
    // [25] phi (word) print_word::w#2 = (word) print_word::w#0 [phi:print_sword::@2->print_word#0] -- register_copy 
    jsr print_word
    jmp __breturn
    // print_sword::@return
  __breturn:
    // [49] return 
    rts
    // [50] phi from print_sword to print_sword::@1 [phi:print_sword->print_sword::@1]
  __b1_from_print_sword:
    jmp __b1
    // print_sword::@1
  __b1:
    // [51] call print_char 
    // [39] phi from print_sword::@1 to print_char [phi:print_sword::@1->print_char]
  print_char_from___b1:
    // [39] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#47 [phi:print_sword::@1->print_char#0] -- register_copy 
    // [39] phi (byte) print_char::ch#5 = (byte) '-' [phi:print_sword::@1->print_char#1] -- vbuz1=vbuc1 
    lda #'-'
    sta.z print_char.ch
    jsr print_char
    jmp __b4
    // print_sword::@4
  __b4:
    // [52] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 -- vwsz1=_neg_vwsz1 
    sec
    lda #0
    sbc.z w
    sta.z w
    lda #0
    sbc.z w+1
    sta.z w+1
    jmp __b2_from___b4
}
  // File Data
  print_hextab: .text "0123456789abcdef"

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [6] (signed word) main::a#1 ← (signed word) main::a#2 + (signed byte) -7 [ main::b#2 print_char_cursor#47 print_line_cursor#13 main::i#2 main::a#1 ] ( main:2 [ main::b#2 print_char_cursor#47 print_line_cursor#13 main::i#2 main::a#1 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:6 [ main::i#2 main::i#1 ]
Statement [7] (word) main::b#1 ← (word) main::b#2 + (word) $141 [ print_char_cursor#47 print_line_cursor#13 main::i#2 main::a#1 main::b#1 ] ( main:2 [ print_char_cursor#47 print_line_cursor#13 main::i#2 main::a#1 main::b#1 ] ) always clobbers reg byte a 
Statement [8] (signed word) print_sword::w#1 ← (signed word) main::a#1 [ print_char_cursor#47 print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_sword::w#1 ] ( main:2 [ print_char_cursor#47 print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_sword::w#1 ] ) always clobbers reg byte a 
Statement [12] (word) print_word::w#1 ← (word) main::b#1 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#1 print_char_cursor#13 ] ( main:2 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#1 print_char_cursor#13 ] ) always clobbers reg byte a 
Statement [19] (byte*) print_char_cursor#56 ← (byte*) print_line_cursor#1 [ main::a#1 main::b#1 print_char_cursor#56 print_line_cursor#1 main::i#1 ] ( main:2 [ main::a#1 main::b#1 print_char_cursor#56 print_line_cursor#1 main::i#1 ] ) always clobbers reg byte a 
Statement [22] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#6 + (byte) $28 [ print_line_cursor#1 print_char_cursor#13 ] ( main:2::print_ln:15 [ main::i#2 main::a#1 main::b#1 print_line_cursor#1 print_char_cursor#13 ] ) always clobbers reg byte a 
Statement [23] 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:15 [ main::i#2 main::a#1 main::b#1 print_line_cursor#1 print_char_cursor#13 ] ) always clobbers reg byte a 
Statement [26] (byte) print_byte::b#0 ← > (word) print_word::w#2 [ print_char_cursor#13 print_word::w#2 print_byte::b#0 ] ( main:2::print_word:13 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_word::w#2 print_byte::b#0 ] main:2::print_sword:9::print_word:48 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_word::w#2 print_byte::b#0 ] ) always clobbers reg byte a 
Statement [28] (byte) print_byte::b#1 ← < (word) print_word::w#2 [ print_char_cursor#13 print_byte::b#1 ] ( main:2::print_word:13 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_byte::b#1 ] main:2::print_sword:9::print_word:48 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_byte::b#1 ] ) always clobbers reg byte a 
Statement [32] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4 [ print_char_cursor#13 print_byte::b#2 print_byte::$0 ] ( main:2::print_word:13::print_byte:27 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#2 print_char_cursor#13 print_byte::b#2 print_byte::$0 ] main:2::print_sword:9::print_word:48::print_byte:27 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#2 print_char_cursor#13 print_byte::b#2 print_byte::$0 ] main:2::print_word:13::print_byte:29 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_byte::b#2 print_byte::$0 ] main:2::print_sword:9::print_word:48::print_byte:29 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 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 [35] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f [ print_char_cursor#13 print_byte::$2 ] ( main:2::print_word:13::print_byte:27 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#2 print_char_cursor#13 print_byte::$2 ] main:2::print_sword:9::print_word:48::print_byte:27 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#2 print_char_cursor#13 print_byte::$2 ] main:2::print_word:13::print_byte:29 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_byte::$2 ] main:2::print_sword:9::print_word:48::print_byte:29 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_byte::$2 ] ) always clobbers reg byte a 
Statement [40] *((byte*) print_char_cursor#33) ← (byte) print_char::ch#5 [ print_char_cursor#33 ] ( main:2::print_char:11 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#33 ] main:2::print_word:13::print_byte:27::print_char:34 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#2 print_byte::b#2 print_char_cursor#33 ] main:2::print_sword:9::print_word:48::print_byte:27::print_char:34 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#2 print_byte::b#2 print_char_cursor#33 ] main:2::print_word:13::print_byte:29::print_char:34 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_byte::b#2 print_char_cursor#33 ] main:2::print_sword:9::print_word:48::print_byte:29::print_char:34 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_byte::b#2 print_char_cursor#33 ] main:2::print_word:13::print_byte:27::print_char:37 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#2 print_char_cursor#33 ] main:2::print_sword:9::print_word:48::print_byte:27::print_char:37 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#2 print_char_cursor#33 ] main:2::print_word:13::print_byte:29::print_char:37 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#33 ] main:2::print_sword:9::print_word:48::print_byte:29::print_char:37 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#33 ] main:2::print_sword:9::print_char:45 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_sword::w#1 print_char_cursor#33 ] main:2::print_sword:9::print_char:51 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_sword::w#1 print_char_cursor#33 ] ) always clobbers reg byte y 
Removing always clobbered register reg byte y as potential for zp[1]:6 [ main::i#2 main::i#1 ]
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 [43] if((signed word) print_sword::w#1<(signed byte) 0) goto print_sword::@1 [ print_char_cursor#47 print_sword::w#1 ] ( main:2::print_sword:9 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#47 print_sword::w#1 ] ) always clobbers reg byte a 
Statement [47] (word) print_word::w#0 ← (word)(signed word) print_sword::w#4 [ print_char_cursor#13 print_word::w#0 ] ( main:2::print_sword:9 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_word::w#0 ] ) always clobbers reg byte a 
Statement [52] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 [ print_char_cursor#13 print_sword::w#0 ] ( main:2::print_sword:9 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_sword::w#0 ] ) always clobbers reg byte a 
Statement [6] (signed word) main::a#1 ← (signed word) main::a#2 + (signed byte) -7 [ main::b#2 print_char_cursor#47 print_line_cursor#13 main::i#2 main::a#1 ] ( main:2 [ main::b#2 print_char_cursor#47 print_line_cursor#13 main::i#2 main::a#1 ] ) always clobbers reg byte a 
Statement [7] (word) main::b#1 ← (word) main::b#2 + (word) $141 [ print_char_cursor#47 print_line_cursor#13 main::i#2 main::a#1 main::b#1 ] ( main:2 [ print_char_cursor#47 print_line_cursor#13 main::i#2 main::a#1 main::b#1 ] ) always clobbers reg byte a 
Statement [8] (signed word) print_sword::w#1 ← (signed word) main::a#1 [ print_char_cursor#47 print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_sword::w#1 ] ( main:2 [ print_char_cursor#47 print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_sword::w#1 ] ) always clobbers reg byte a 
Statement [12] (word) print_word::w#1 ← (word) main::b#1 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#1 print_char_cursor#13 ] ( main:2 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#1 print_char_cursor#13 ] ) always clobbers reg byte a 
Statement [19] (byte*) print_char_cursor#56 ← (byte*) print_line_cursor#1 [ main::a#1 main::b#1 print_char_cursor#56 print_line_cursor#1 main::i#1 ] ( main:2 [ main::a#1 main::b#1 print_char_cursor#56 print_line_cursor#1 main::i#1 ] ) always clobbers reg byte a 
Statement [22] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#6 + (byte) $28 [ print_line_cursor#1 print_char_cursor#13 ] ( main:2::print_ln:15 [ main::i#2 main::a#1 main::b#1 print_line_cursor#1 print_char_cursor#13 ] ) always clobbers reg byte a 
Statement [23] 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:15 [ main::i#2 main::a#1 main::b#1 print_line_cursor#1 print_char_cursor#13 ] ) always clobbers reg byte a 
Statement [26] (byte) print_byte::b#0 ← > (word) print_word::w#2 [ print_char_cursor#13 print_word::w#2 print_byte::b#0 ] ( main:2::print_word:13 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_word::w#2 print_byte::b#0 ] main:2::print_sword:9::print_word:48 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_word::w#2 print_byte::b#0 ] ) always clobbers reg byte a 
Statement [28] (byte) print_byte::b#1 ← < (word) print_word::w#2 [ print_char_cursor#13 print_byte::b#1 ] ( main:2::print_word:13 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_byte::b#1 ] main:2::print_sword:9::print_word:48 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_byte::b#1 ] ) always clobbers reg byte a 
Statement [32] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4 [ print_char_cursor#13 print_byte::b#2 print_byte::$0 ] ( main:2::print_word:13::print_byte:27 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#2 print_char_cursor#13 print_byte::b#2 print_byte::$0 ] main:2::print_sword:9::print_word:48::print_byte:27 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#2 print_char_cursor#13 print_byte::b#2 print_byte::$0 ] main:2::print_word:13::print_byte:29 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_byte::b#2 print_byte::$0 ] main:2::print_sword:9::print_word:48::print_byte:29 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_byte::b#2 print_byte::$0 ] ) always clobbers reg byte a 
Statement [35] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f [ print_char_cursor#13 print_byte::$2 ] ( main:2::print_word:13::print_byte:27 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#2 print_char_cursor#13 print_byte::$2 ] main:2::print_sword:9::print_word:48::print_byte:27 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#2 print_char_cursor#13 print_byte::$2 ] main:2::print_word:13::print_byte:29 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_byte::$2 ] main:2::print_sword:9::print_word:48::print_byte:29 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_byte::$2 ] ) always clobbers reg byte a 
Statement [40] *((byte*) print_char_cursor#33) ← (byte) print_char::ch#5 [ print_char_cursor#33 ] ( main:2::print_char:11 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#33 ] main:2::print_word:13::print_byte:27::print_char:34 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#2 print_byte::b#2 print_char_cursor#33 ] main:2::print_sword:9::print_word:48::print_byte:27::print_char:34 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#2 print_byte::b#2 print_char_cursor#33 ] main:2::print_word:13::print_byte:29::print_char:34 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_byte::b#2 print_char_cursor#33 ] main:2::print_sword:9::print_word:48::print_byte:29::print_char:34 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_byte::b#2 print_char_cursor#33 ] main:2::print_word:13::print_byte:27::print_char:37 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#2 print_char_cursor#33 ] main:2::print_sword:9::print_word:48::print_byte:27::print_char:37 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_word::w#2 print_char_cursor#33 ] main:2::print_word:13::print_byte:29::print_char:37 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#33 ] main:2::print_sword:9::print_word:48::print_byte:29::print_char:37 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#33 ] main:2::print_sword:9::print_char:45 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_sword::w#1 print_char_cursor#33 ] main:2::print_sword:9::print_char:51 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_sword::w#1 print_char_cursor#33 ] ) always clobbers reg byte y 
Statement [43] if((signed word) print_sword::w#1<(signed byte) 0) goto print_sword::@1 [ print_char_cursor#47 print_sword::w#1 ] ( main:2::print_sword:9 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#47 print_sword::w#1 ] ) always clobbers reg byte a 
Statement [47] (word) print_word::w#0 ← (word)(signed word) print_sword::w#4 [ print_char_cursor#13 print_word::w#0 ] ( main:2::print_sword:9 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_word::w#0 ] ) always clobbers reg byte a 
Statement [52] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 [ print_char_cursor#13 print_sword::w#0 ] ( main:2::print_sword:9 [ print_line_cursor#13 main::i#2 main::a#1 main::b#1 print_char_cursor#13 print_sword::w#0 ] ) always clobbers reg byte a 
Potential registers zp[2]:2 [ main::a#2 main::a#1 ] : zp[2]:2 , 
Potential registers zp[2]:4 [ main::b#2 main::b#1 ] : zp[2]:4 , 
Potential registers zp[1]:6 [ main::i#2 main::i#1 ] : zp[1]:6 , reg byte x , 
Potential registers zp[2]:7 [ print_line_cursor#6 print_line_cursor#13 print_line_cursor#1 ] : zp[2]:7 , 
Potential registers zp[2]:9 [ print_word::w#2 print_word::w#1 print_word::w#0 ] : 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#5 print_char::ch#2 print_char::ch#3 ] : zp[1]:12 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:13 [ print_char_cursor#33 print_char_cursor#13 print_char_cursor#47 print_char_cursor#56 ] : zp[2]:13 , 
Potential registers zp[2]:15 [ print_sword::w#4 print_sword::w#0 print_sword::w#1 ] : zp[2]:15 , 
Potential registers zp[1]:17 [ print_byte::$0 ] : zp[1]:17 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:18 [ print_byte::$2 ] : zp[1]:18 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [] 251.61: zp[2]:7 [ print_line_cursor#6 print_line_cursor#13 print_line_cursor#1 ] 39.22: zp[2]:13 [ print_char_cursor#33 print_char_cursor#13 print_char_cursor#47 print_char_cursor#56 ] 
Uplift Scope [main] 24.54: zp[2]:2 [ main::a#2 main::a#1 ] 13.75: zp[2]:4 [ main::b#2 main::b#1 ] 13: zp[1]:6 [ main::i#2 main::i#1 ] 
Uplift Scope [print_word] 31.67: zp[2]:9 [ print_word::w#2 print_word::w#1 print_word::w#0 ] 
Uplift Scope [print_byte] 10: zp[1]:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] 4: zp[1]:17 [ print_byte::$0 ] 4: zp[1]:18 [ print_byte::$2 ] 
Uplift Scope [print_char] 14: zp[1]:12 [ print_char::ch#5 print_char::ch#2 print_char::ch#3 ] 
Uplift Scope [print_sword] 10.83: zp[2]:15 [ print_sword::w#4 print_sword::w#0 print_sword::w#1 ] 
Uplift Scope [RADIX] 
Uplift Scope [print_ln] 

Uplifting [] best 6079 combination zp[2]:7 [ print_line_cursor#6 print_line_cursor#13 print_line_cursor#1 ] zp[2]:13 [ print_char_cursor#33 print_char_cursor#13 print_char_cursor#47 print_char_cursor#56 ] 
Uplifting [main] best 5989 combination zp[2]:2 [ main::a#2 main::a#1 ] zp[2]:4 [ main::b#2 main::b#1 ] reg byte x [ main::i#2 main::i#1 ] 
Uplifting [print_word] best 5989 combination zp[2]:9 [ print_word::w#2 print_word::w#1 print_word::w#0 ] 
Uplifting [print_byte] best 5981 combination zp[1]:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] 
Uplifting [print_char] best 5963 combination reg byte a [ print_char::ch#5 print_char::ch#2 print_char::ch#3 ] 
Uplifting [print_sword] best 5963 combination zp[2]:15 [ print_sword::w#4 print_sword::w#0 print_sword::w#1 ] 
Uplifting [RADIX] best 5963 combination 
Uplifting [print_ln] best 5963 combination 
Attempting to uplift remaining variables inzp[1]:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
Uplifting [print_byte] best 5963 combination zp[1]:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] 
Coalescing zero page register [ zp[2]:9 [ print_word::w#2 print_word::w#1 print_word::w#0 ] ] with [ zp[2]:15 [ print_sword::w#4 print_sword::w#0 print_sword::w#1 ] ] - score: 1
Allocated (was zp[2]:7) zp[2]:6 [ print_line_cursor#6 print_line_cursor#13 print_line_cursor#1 ]
Allocated (was zp[2]:9) zp[2]:8 [ print_word::w#2 print_word::w#1 print_word::w#0 print_sword::w#4 print_sword::w#0 print_sword::w#1 ]
Allocated (was zp[1]:11) zp[1]:10 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
Allocated (was zp[2]:13) zp[2]:11 [ print_char_cursor#33 print_char_cursor#13 print_char_cursor#47 print_char_cursor#56 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Tests the special "signed" / "unsigned" without a simple type name
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label print_line_cursor = 6
  .label print_char_cursor = $b
  // @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: {
    .label a = 2
    .label b = 4
    // [5] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 
    ldx #0
    // [5] phi (byte*) print_line_cursor#13 = (byte*) 1024 [phi:main->main::@1#1] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_line_cursor
    lda #>$400
    sta.z print_line_cursor+1
    // [5] phi (byte*) print_char_cursor#47 = (byte*) 1024 [phi:main->main::@1#2] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_char_cursor
    lda #>$400
    sta.z print_char_cursor+1
    // [5] phi (word) main::b#2 = (word) $1024 [phi:main->main::@1#3] -- vwuz1=vwuc1 
    lda #<$1024
    sta.z b
    lda #>$1024
    sta.z b+1
    // [5] phi (signed word) main::a#2 = (signed word) -$3ff [phi:main->main::@1#4] -- vwsz1=vwsc1 
    lda #<-$3ff
    sta.z a
    lda #>-$3ff
    sta.z a+1
    jmp __b1
    // main::@1
  __b1:
    // [6] (signed word) main::a#1 ← (signed word) main::a#2 + (signed byte) -7 -- vwsz1=vwsz1_plus_vbsc1 
    lda.z a
    clc
    adc #<-7
    sta.z a
    lda.z a+1
    adc #>-7
    sta.z a+1
    // [7] (word) main::b#1 ← (word) main::b#2 + (word) $141 -- vwuz1=vwuz1_plus_vwuc1 
    clc
    lda.z b
    adc #<$141
    sta.z b
    lda.z b+1
    adc #>$141
    sta.z b+1
    // [8] (signed word) print_sword::w#1 ← (signed word) main::a#1 -- vwsz1=vwsz2 
    lda.z a
    sta.z print_sword.w
    lda.z a+1
    sta.z print_sword.w+1
    // [9] call print_sword 
    jsr print_sword
    // [10] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  __b2_from___b1:
    jmp __b2
    // main::@2
  __b2:
    // [11] call print_char 
    // [39] phi from main::@2 to print_char [phi:main::@2->print_char]
  print_char_from___b2:
    // [39] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#13 [phi:main::@2->print_char#0] -- register_copy 
    // [39] phi (byte) print_char::ch#5 = (byte) ' ' [phi:main::@2->print_char#1] -- vbuaa=vbuc1 
    lda #' '
    jsr print_char
    jmp __b3
    // main::@3
  __b3:
    // [12] (word) print_word::w#1 ← (word) main::b#1 -- vwuz1=vwuz2 
    lda.z b
    sta.z print_word.w
    lda.z b+1
    sta.z print_word.w+1
    // [13] call print_word 
    // [25] phi from main::@3 to print_word [phi:main::@3->print_word]
  print_word_from___b3:
    // [25] phi (word) print_word::w#2 = (word) print_word::w#1 [phi:main::@3->print_word#0] -- register_copy 
    jsr print_word
    // [14] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
  __b4_from___b3:
    jmp __b4
    // main::@4
  __b4:
    // [15] call print_ln 
    // [20] phi from main::@4 to print_ln [phi:main::@4->print_ln]
  print_ln_from___b4:
    jsr print_ln
    jmp __b5
    // main::@5
  __b5:
    // [16] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [17] if((byte) main::i#1!=(byte) 6) goto main::@6 -- vbuxx_neq_vbuc1_then_la1 
    cpx #6
    bne __b6
    jmp __breturn
    // main::@return
  __breturn:
    // [18] return 
    rts
    // main::@6
  __b6:
    // [19] (byte*) print_char_cursor#56 ← (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
    // [5] phi from main::@6 to main::@1 [phi:main::@6->main::@1]
  __b1_from___b6:
    // [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@6->main::@1#0] -- register_copy 
    // [5] phi (byte*) print_line_cursor#13 = (byte*) print_line_cursor#1 [phi:main::@6->main::@1#1] -- register_copy 
    // [5] phi (byte*) print_char_cursor#47 = (byte*) print_char_cursor#56 [phi:main::@6->main::@1#2] -- register_copy 
    // [5] phi (word) main::b#2 = (word) main::b#1 [phi:main::@6->main::@1#3] -- register_copy 
    // [5] phi (signed word) main::a#2 = (signed word) main::a#1 [phi:main::@6->main::@1#4] -- register_copy 
    jmp __b1
}
  // print_ln
// Print a newline
print_ln: {
    // [21] 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:
    // [21] phi (byte*) print_line_cursor#6 = (byte*) print_line_cursor#13 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy 
    jmp __b1
    // print_ln::@1
  __b1:
    // [22] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#6 + (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
  !:
    // [23] 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:
    // [24] return 
    rts
}
  // print_word
// Print a word as HEX
// print_word(word zp(8) w)
print_word: {
    .label w = 8
    // [26] (byte) print_byte::b#0 ← > (word) print_word::w#2 -- vbuz1=_hi_vwuz2 
    lda.z w+1
    sta.z print_byte.b
    // [27] call print_byte 
    // [31] phi from print_word to print_byte [phi:print_word->print_byte]
  print_byte_from_print_word:
    // [31] 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:
    // [28] (byte) print_byte::b#1 ← < (word) print_word::w#2 -- vbuz1=_lo_vwuz2 
    lda.z w
    sta.z print_byte.b
    // [29] call print_byte 
    // [31] phi from print_word::@1 to print_byte [phi:print_word::@1->print_byte]
  print_byte_from___b1:
    // [31] 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:
    // [30] return 
    rts
}
  // print_byte
// Print a byte as HEX
// print_byte(byte zp($a) b)
print_byte: {
    .label b = $a
    // [32] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4 -- vbuaa=vbuz1_ror_4 
    lda.z b
    lsr
    lsr
    lsr
    lsr
    // [33] (byte) print_char::ch#2 ← *((const byte*) print_hextab + (byte~) print_byte::$0) -- vbuaa=pbuc1_derefidx_vbuaa 
    tay
    lda print_hextab,y
    // [34] call print_char 
    // [39] phi from print_byte to print_char [phi:print_byte->print_char]
  print_char_from_print_byte:
    // [39] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#13 [phi:print_byte->print_char#0] -- register_copy 
    // [39] phi (byte) print_char::ch#5 = (byte) print_char::ch#2 [phi:print_byte->print_char#1] -- register_copy 
    jsr print_char
    jmp __b1
    // print_byte::@1
  __b1:
    // [35] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f -- vbuaa=vbuz1_band_vbuc1 
    lda #$f
    and.z b
    // [36] (byte) print_char::ch#3 ← *((const byte*) print_hextab + (byte~) print_byte::$2) -- vbuaa=pbuc1_derefidx_vbuaa 
    tay
    lda print_hextab,y
    // [37] call print_char 
    // [39] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char]
  print_char_from___b1:
    // [39] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#13 [phi:print_byte::@1->print_char#0] -- register_copy 
    // [39] phi (byte) print_char::ch#5 = (byte) print_char::ch#3 [phi:print_byte::@1->print_char#1] -- register_copy 
    jsr print_char
    jmp __breturn
    // print_byte::@return
  __breturn:
    // [38] return 
    rts
}
  // print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
    // [40] *((byte*) print_char_cursor#33) ← (byte) print_char::ch#5 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (print_char_cursor),y
    // [41] (byte*) print_char_cursor#13 ← ++ (byte*) print_char_cursor#33 -- pbuz1=_inc_pbuz1 
    inc.z print_char_cursor
    bne !+
    inc.z print_char_cursor+1
  !:
    jmp __breturn
    // print_char::@return
  __breturn:
    // [42] return 
    rts
}
  // print_sword
// Print a signed word as HEX
// print_sword(signed word zp(8) w)
print_sword: {
    .label w = 8
    // [43] if((signed word) print_sword::w#1<(signed byte) 0) goto print_sword::@1 -- vwsz1_lt_0_then_la1 
    lda.z w+1
    bmi __b1_from_print_sword
    // [44] phi from print_sword to print_sword::@3 [phi:print_sword->print_sword::@3]
  __b3_from_print_sword:
    jmp __b3
    // print_sword::@3
  __b3:
    // [45] call print_char 
    // [39] phi from print_sword::@3 to print_char [phi:print_sword::@3->print_char]
  print_char_from___b3:
    // [39] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#47 [phi:print_sword::@3->print_char#0] -- register_copy 
    // [39] phi (byte) print_char::ch#5 = (byte) ' ' [phi:print_sword::@3->print_char#1] -- vbuaa=vbuc1 
    lda #' '
    jsr print_char
    // [46] phi from print_sword::@3 print_sword::@4 to print_sword::@2 [phi:print_sword::@3/print_sword::@4->print_sword::@2]
  __b2_from___b3:
  __b2_from___b4:
    // [46] phi (signed word) print_sword::w#4 = (signed word) print_sword::w#1 [phi:print_sword::@3/print_sword::@4->print_sword::@2#0] -- register_copy 
    jmp __b2
    // print_sword::@2
  __b2:
    // [47] (word) print_word::w#0 ← (word)(signed word) print_sword::w#4
    // [48] call print_word 
    // [25] phi from print_sword::@2 to print_word [phi:print_sword::@2->print_word]
  print_word_from___b2:
    // [25] phi (word) print_word::w#2 = (word) print_word::w#0 [phi:print_sword::@2->print_word#0] -- register_copy 
    jsr print_word
    jmp __breturn
    // print_sword::@return
  __breturn:
    // [49] return 
    rts
    // [50] phi from print_sword to print_sword::@1 [phi:print_sword->print_sword::@1]
  __b1_from_print_sword:
    jmp __b1
    // print_sword::@1
  __b1:
    // [51] call print_char 
    // [39] phi from print_sword::@1 to print_char [phi:print_sword::@1->print_char]
  print_char_from___b1:
    // [39] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#47 [phi:print_sword::@1->print_char#0] -- register_copy 
    // [39] phi (byte) print_char::ch#5 = (byte) '-' [phi:print_sword::@1->print_char#1] -- vbuaa=vbuc1 
    lda #'-'
    jsr print_char
    jmp __b4
    // print_sword::@4
  __b4:
    // [52] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 -- vwsz1=_neg_vwsz1 
    sec
    lda #0
    sbc.z w
    sta.z w
    lda #0
    sbc.z w+1
    sta.z w+1
    jmp __b2_from___b4
}
  // File Data
  print_hextab: .text "0123456789abcdef"

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
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __breturn
Removing instruction jmp __b3
Removing instruction jmp __b2
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __b4
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __bbegin with __b1
Replacing label __b1_from___b1 with __b1
Replacing label __b1_from___b1 with __b1
Replacing label __b1_from_print_sword with __b1
Replacing label __b2_from___b4 with __b2
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Removing instruction __b2_from___b1:
Removing instruction print_char_from___b2:
Removing instruction __b4_from___b3:
Removing instruction print_ln_from___b4:
Removing instruction __b1_from_print_ln:
Removing instruction __b1_from___b1:
Removing instruction __b3_from_print_sword:
Removing instruction print_char_from___b3:
Removing instruction __b2_from___b3:
Removing instruction __b2_from___b4:
Removing instruction print_word_from___b2:
Removing instruction __b1_from_print_sword:
Removing instruction print_char_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b2:
Removing instruction __b3:
Removing instruction print_word_from___b3:
Removing instruction __b4:
Removing instruction __b5:
Removing instruction __breturn:
Removing instruction __b1_from___b6:
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 __b3:
Removing instruction __breturn:
Removing instruction __b4:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __b1:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(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
(signed word) main::a
(signed word) main::a#1 a zp[2]:2 2.5384615384615383
(signed word) main::a#2 a zp[2]:2 22.0
(word) main::b
(word) main::b#1 b zp[2]:4 2.75
(word) main::b#2 b zp[2]:4 11.0
(byte) main::i
(byte) main::i#1 reg byte x 11.0
(byte) main::i#2 reg byte x 2.0
(void()) print_byte((byte) print_byte::b)
(byte~) print_byte::$0 reg byte a 4.0
(byte~) print_byte::$2 reg byte a 4.0
(label) print_byte::@1
(label) print_byte::@return
(byte) print_byte::b
(byte) print_byte::b#0 b zp[1]:10 4.0
(byte) print_byte::b#1 b zp[1]:10 4.0
(byte) print_byte::b#2 b zp[1]:10 2.0
(void()) print_char((byte) print_char::ch)
(label) print_char::@return
(byte) print_char::ch
(byte) print_char::ch#2 reg byte a 4.0
(byte) print_char::ch#3 reg byte a 4.0
(byte) print_char::ch#5 reg byte a 6.0
(byte*) print_char_cursor
(byte*) print_char_cursor#13 print_char_cursor zp[2]:11 3.5757575757575757
(byte*) print_char_cursor#33 print_char_cursor zp[2]:11 11.5
(byte*) print_char_cursor#47 print_char_cursor zp[2]:11 2.142857142857143
(byte*) print_char_cursor#56 print_char_cursor zp[2]:11 22.0
(const byte*) print_hextab[]  = (string) "0123456789abcdef"z
(byte*) print_line_cursor
(byte*) print_line_cursor#1 print_line_cursor zp[2]:6 46.42857142857143
(byte*) print_line_cursor#13 print_line_cursor zp[2]:6 1.1818181818181819
(byte*) print_line_cursor#6 print_line_cursor zp[2]:6 204.0
(void()) print_ln()
(label) print_ln::@1
(label) print_ln::@return
(byte*) print_screen
(void()) print_sword((signed word) print_sword::w)
(label) print_sword::@1
(label) print_sword::@2
(label) print_sword::@3
(label) print_sword::@4
(label) print_sword::@return
(signed word) print_sword::w
(signed word) print_sword::w#0 w zp[2]:8 4.0
(signed word) print_sword::w#1 w zp[2]:8 2.8333333333333335
(signed word) print_sword::w#4 w zp[2]:8 4.0
(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]:8 4.0
(word) print_word::w#1 w zp[2]:8 22.0
(word) print_word::w#2 w zp[2]:8 5.666666666666667

zp[2]:2 [ main::a#2 main::a#1 ]
zp[2]:4 [ main::b#2 main::b#1 ]
reg byte x [ main::i#2 main::i#1 ]
zp[2]:6 [ print_line_cursor#6 print_line_cursor#13 print_line_cursor#1 ]
zp[2]:8 [ print_word::w#2 print_word::w#1 print_word::w#0 print_sword::w#4 print_sword::w#0 print_sword::w#1 ]
zp[1]:10 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
reg byte a [ print_char::ch#5 print_char::ch#2 print_char::ch#3 ]
zp[2]:11 [ print_char_cursor#33 print_char_cursor#13 print_char_cursor#47 print_char_cursor#56 ]
reg byte a [ print_byte::$0 ]
reg byte a [ print_byte::$2 ]


FINAL ASSEMBLER
Score: 5183

  // File Comments
// Tests the special "signed" / "unsigned" without a simple type name
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .label print_line_cursor = 6
  .label print_char_cursor = $b
  // @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: {
    .label a = 2
    .label b = 4
    // [5] phi from main to main::@1 [phi:main->main::@1]
    // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 
    ldx #0
    // [5] phi (byte*) print_line_cursor#13 = (byte*) 1024 [phi:main->main::@1#1] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_line_cursor
    lda #>$400
    sta.z print_line_cursor+1
    // [5] phi (byte*) print_char_cursor#47 = (byte*) 1024 [phi:main->main::@1#2] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_char_cursor
    lda #>$400
    sta.z print_char_cursor+1
    // [5] phi (word) main::b#2 = (word) $1024 [phi:main->main::@1#3] -- vwuz1=vwuc1 
    lda #<$1024
    sta.z b
    lda #>$1024
    sta.z b+1
    // [5] phi (signed word) main::a#2 = (signed word) -$3ff [phi:main->main::@1#4] -- vwsz1=vwsc1 
    lda #<-$3ff
    sta.z a
    lda #>-$3ff
    sta.z a+1
    // main::@1
  __b1:
    // a += -7
    // [6] (signed word) main::a#1 ← (signed word) main::a#2 + (signed byte) -7 -- vwsz1=vwsz1_plus_vbsc1 
    lda.z a
    clc
    adc #<-7
    sta.z a
    lda.z a+1
    adc #>-7
    sta.z a+1
    // b += 321
    // [7] (word) main::b#1 ← (word) main::b#2 + (word) $141 -- vwuz1=vwuz1_plus_vwuc1 
    clc
    lda.z b
    adc #<$141
    sta.z b
    lda.z b+1
    adc #>$141
    sta.z b+1
    // print_sword(a)
    // [8] (signed word) print_sword::w#1 ← (signed word) main::a#1 -- vwsz1=vwsz2 
    lda.z a
    sta.z print_sword.w
    lda.z a+1
    sta.z print_sword.w+1
    // [9] call print_sword 
    jsr print_sword
    // [10] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
    // main::@2
    // print_char(' ')
    // [11] call print_char 
    // [39] phi from main::@2 to print_char [phi:main::@2->print_char]
    // [39] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#13 [phi:main::@2->print_char#0] -- register_copy 
    // [39] phi (byte) print_char::ch#5 = (byte) ' ' [phi:main::@2->print_char#1] -- vbuaa=vbuc1 
    lda #' '
    jsr print_char
    // main::@3
    // print_word(b)
    // [12] (word) print_word::w#1 ← (word) main::b#1 -- vwuz1=vwuz2 
    lda.z b
    sta.z print_word.w
    lda.z b+1
    sta.z print_word.w+1
    // [13] call print_word 
    // [25] phi from main::@3 to print_word [phi:main::@3->print_word]
    // [25] phi (word) print_word::w#2 = (word) print_word::w#1 [phi:main::@3->print_word#0] -- register_copy 
    jsr print_word
    // [14] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
    // main::@4
    // print_ln()
    // [15] call print_ln 
    // [20] phi from main::@4 to print_ln [phi:main::@4->print_ln]
    jsr print_ln
    // main::@5
    // for( byte i : 0..5 )
    // [16] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [17] if((byte) main::i#1!=(byte) 6) goto main::@6 -- vbuxx_neq_vbuc1_then_la1 
    cpx #6
    bne __b6
    // main::@return
    // }
    // [18] return 
    rts
    // main::@6
  __b6:
    // [19] (byte*) print_char_cursor#56 ← (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
    // [5] phi from main::@6 to main::@1 [phi:main::@6->main::@1]
    // [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@6->main::@1#0] -- register_copy 
    // [5] phi (byte*) print_line_cursor#13 = (byte*) print_line_cursor#1 [phi:main::@6->main::@1#1] -- register_copy 
    // [5] phi (byte*) print_char_cursor#47 = (byte*) print_char_cursor#56 [phi:main::@6->main::@1#2] -- register_copy 
    // [5] phi (word) main::b#2 = (word) main::b#1 [phi:main::@6->main::@1#3] -- register_copy 
    // [5] phi (signed word) main::a#2 = (signed word) main::a#1 [phi:main::@6->main::@1#4] -- register_copy 
    jmp __b1
}
  // print_ln
// Print a newline
print_ln: {
    // [21] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1]
    // [21] phi (byte*) print_line_cursor#6 = (byte*) print_line_cursor#13 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy 
    // print_ln::@1
  __b1:
    // print_line_cursor + $28
    // [22] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#6 + (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)
    // [23] 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
    // }
    // [24] return 
    rts
}
  // print_word
// Print a word as HEX
// print_word(word zp(8) w)
print_word: {
    .label w = 8
    // print_byte(>w)
    // [26] (byte) print_byte::b#0 ← > (word) print_word::w#2 -- vbuz1=_hi_vwuz2 
    lda.z w+1
    sta.z print_byte.b
    // [27] call print_byte 
    // [31] phi from print_word to print_byte [phi:print_word->print_byte]
    // [31] 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)
    // [28] (byte) print_byte::b#1 ← < (word) print_word::w#2 -- vbuz1=_lo_vwuz2 
    lda.z w
    sta.z print_byte.b
    // [29] call print_byte 
    // [31] phi from print_word::@1 to print_byte [phi:print_word::@1->print_byte]
    // [31] 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
    // }
    // [30] return 
    rts
}
  // print_byte
// Print a byte as HEX
// print_byte(byte zp($a) b)
print_byte: {
    .label b = $a
    // b>>4
    // [32] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4 -- vbuaa=vbuz1_ror_4 
    lda.z b
    lsr
    lsr
    lsr
    lsr
    // print_char(print_hextab[b>>4])
    // [33] (byte) print_char::ch#2 ← *((const byte*) print_hextab + (byte~) print_byte::$0) -- vbuaa=pbuc1_derefidx_vbuaa 
    tay
    lda print_hextab,y
    // [34] call print_char 
    // [39] phi from print_byte to print_char [phi:print_byte->print_char]
    // [39] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#13 [phi:print_byte->print_char#0] -- register_copy 
    // [39] phi (byte) print_char::ch#5 = (byte) print_char::ch#2 [phi:print_byte->print_char#1] -- register_copy 
    jsr print_char
    // print_byte::@1
    // b&$f
    // [35] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f -- vbuaa=vbuz1_band_vbuc1 
    lda #$f
    and.z b
    // print_char(print_hextab[b&$f])
    // [36] (byte) print_char::ch#3 ← *((const byte*) print_hextab + (byte~) print_byte::$2) -- vbuaa=pbuc1_derefidx_vbuaa 
    tay
    lda print_hextab,y
    // [37] call print_char 
    // [39] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char]
    // [39] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#13 [phi:print_byte::@1->print_char#0] -- register_copy 
    // [39] phi (byte) print_char::ch#5 = (byte) print_char::ch#3 [phi:print_byte::@1->print_char#1] -- register_copy 
    jsr print_char
    // print_byte::@return
    // }
    // [38] return 
    rts
}
  // print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
    // *(print_char_cursor++) = ch
    // [40] *((byte*) print_char_cursor#33) ← (byte) print_char::ch#5 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (print_char_cursor),y
    // *(print_char_cursor++) = ch;
    // [41] (byte*) print_char_cursor#13 ← ++ (byte*) print_char_cursor#33 -- pbuz1=_inc_pbuz1 
    inc.z print_char_cursor
    bne !+
    inc.z print_char_cursor+1
  !:
    // print_char::@return
    // }
    // [42] return 
    rts
}
  // print_sword
// Print a signed word as HEX
// print_sword(signed word zp(8) w)
print_sword: {
    .label w = 8
    // if(w<0)
    // [43] if((signed word) print_sword::w#1<(signed byte) 0) goto print_sword::@1 -- vwsz1_lt_0_then_la1 
    lda.z w+1
    bmi __b1
    // [44] phi from print_sword to print_sword::@3 [phi:print_sword->print_sword::@3]
    // print_sword::@3
    // print_char(' ')
    // [45] call print_char 
    // [39] phi from print_sword::@3 to print_char [phi:print_sword::@3->print_char]
    // [39] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#47 [phi:print_sword::@3->print_char#0] -- register_copy 
    // [39] phi (byte) print_char::ch#5 = (byte) ' ' [phi:print_sword::@3->print_char#1] -- vbuaa=vbuc1 
    lda #' '
    jsr print_char
    // [46] phi from print_sword::@3 print_sword::@4 to print_sword::@2 [phi:print_sword::@3/print_sword::@4->print_sword::@2]
    // [46] phi (signed word) print_sword::w#4 = (signed word) print_sword::w#1 [phi:print_sword::@3/print_sword::@4->print_sword::@2#0] -- register_copy 
    // print_sword::@2
  __b2:
    // print_word((word)w)
    // [47] (word) print_word::w#0 ← (word)(signed word) print_sword::w#4
    // [48] call print_word 
    // [25] phi from print_sword::@2 to print_word [phi:print_sword::@2->print_word]
    // [25] phi (word) print_word::w#2 = (word) print_word::w#0 [phi:print_sword::@2->print_word#0] -- register_copy 
    jsr print_word
    // print_sword::@return
    // }
    // [49] return 
    rts
    // [50] phi from print_sword to print_sword::@1 [phi:print_sword->print_sword::@1]
    // print_sword::@1
  __b1:
    // print_char('-')
    // [51] call print_char 
    // [39] phi from print_sword::@1 to print_char [phi:print_sword::@1->print_char]
    // [39] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#47 [phi:print_sword::@1->print_char#0] -- register_copy 
    // [39] phi (byte) print_char::ch#5 = (byte) '-' [phi:print_sword::@1->print_char#1] -- vbuaa=vbuc1 
    lda #'-'
    jsr print_char
    // print_sword::@4
    // w = -w
    // [52] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 -- vwsz1=_neg_vwsz1 
    sec
    lda #0
    sbc.z w
    sta.z w
    lda #0
    sbc.z w+1
    sta.z w+1
    jmp __b2
}
  // File Data
  print_hextab: .text "0123456789abcdef"

