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
Warning! Adding boolean cast to non-boolean sub-expression *((byte*) main::sieve_i)
Warning! Adding boolean cast to non-boolean sub-expression *((byte*) sieve + (word) main::i)
Identified constant variable (byte*) HEAP_TOP
Identified constant variable (byte*) sieve
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx 
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) memset::@7
Culled Empty Block (label) memset::@6
Culled Empty Block (label) memset::@8
Culled Empty Block (label) memset::@9
Culled Empty Block (label) memset::@3
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) @13
Culled Empty Block (label) @14
Culled Empty Block (label) @15
Culled Empty Block (label) @16
Culled Empty Block (label) @17
Culled Empty Block (label) @18
Culled Empty Block (label) @19
Culled Empty Block (label) @20
Culled Empty Block (label) @21
Culled Empty Block (label) @22
Culled Empty Block (label) @23
Culled Empty Block (label) @24
Culled Empty Block (label) @25
Culled Empty Block (label) @26
Culled Empty Block (label) @28
Culled Empty Block (label) @29
Culled Empty Block (label) @30
Culled Empty Block (label) @31
Culled Empty Block (label) @32
Culled Empty Block (label) @33
Culled Empty Block (label) @34
Culled Empty Block (label) @35
Culled Empty Block (label) @36
Culled Empty Block (label) @37
Culled Empty Block (label) @38
Culled Empty Block (label) @39
Culled Empty Block (label) @40
Culled Empty Block (label) @41
Culled Empty Block (label) @42
Culled Empty Block (label) @43
Culled Empty Block (label) @44
Culled Empty Block (label) @45
Culled Empty Block (label) @46
Culled Empty Block (label) @47
Culled Empty Block (label) @48
Culled Empty Block (label) @49
Culled Empty Block (label) @50
Culled Empty Block (label) @51
Culled Empty Block (label) main::@11
Culled Empty Block (label) main::@12
Culled Empty Block (label) main::@8
Culled Empty Block (label) main::@7
Culled Empty Block (label) main::@9
Culled Empty Block (label) main::@10
Culled Empty Block (label) main::@14
Culled Empty Block (label) main::@19
Culled Empty Block (label) main::@17
Culled Empty Block (label) main::@20
Culled Empty Block (label) main::@22
Culled Empty Block (label) main::@26
Culled Empty Block (label) main::@25
Culled Empty Block (label) main::@27
Culled Empty Block (label) main::@28

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@27

(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
memset: scope:[memset]  from main
  (byte) memset::c#4 ← phi( main/(byte) memset::c#0 )
  (void*) memset::str#3 ← phi( main/(void*) memset::str#0 )
  (word) memset::num#1 ← phi( main/(word) memset::num#0 )
  (bool~) memset::$0 ← (word) memset::num#1 > (number) 0
  (bool~) memset::$1 ← ! (bool~) memset::$0
  if((bool~) memset::$1) goto memset::@1
  to:memset::@2
memset::@1: scope:[memset]  from memset memset::@4
  (void*) memset::str#1 ← phi( memset/(void*) memset::str#3 memset::@4/(void*) memset::str#4 )
  (void*) memset::return#0 ← (void*) memset::str#1
  to:memset::@return
memset::@2: scope:[memset]  from memset
  (byte) memset::c#3 ← phi( memset/(byte) memset::c#4 )
  (word) memset::num#2 ← phi( memset/(word) memset::num#1 )
  (void*) memset::str#2 ← phi( memset/(void*) memset::str#3 )
  (byte*~) memset::$2 ← ((byte*)) (void*) memset::str#2
  (byte*~) memset::$3 ← (byte*~) memset::$2 + (word) memset::num#2
  (byte*) memset::end#0 ← (byte*~) memset::$3
  (byte*) memset::dst#0 ← ((byte*)) (void*) memset::str#2
  to:memset::@4
memset::@4: scope:[memset]  from memset::@2 memset::@5
  (byte) memset::c#2 ← phi( memset::@2/(byte) memset::c#3 memset::@5/(byte) memset::c#1 )
  (void*) memset::str#4 ← phi( memset::@2/(void*) memset::str#2 memset::@5/(void*) memset::str#5 )
  (byte*) memset::end#1 ← phi( memset::@2/(byte*) memset::end#0 memset::@5/(byte*) memset::end#2 )
  (byte*) memset::dst#2 ← phi( memset::@2/(byte*) memset::dst#0 memset::@5/(byte*) memset::dst#1 )
  (bool~) memset::$4 ← (byte*) memset::dst#2 != (byte*) memset::end#1
  if((bool~) memset::$4) goto memset::@5
  to:memset::@1
memset::@5: scope:[memset]  from memset::@4
  (void*) memset::str#5 ← phi( memset::@4/(void*) memset::str#4 )
  (byte*) memset::end#2 ← phi( memset::@4/(byte*) memset::end#1 )
  (byte*) memset::dst#3 ← phi( memset::@4/(byte*) memset::dst#2 )
  (byte) memset::c#1 ← phi( memset::@4/(byte) memset::c#2 )
  *((byte*) memset::dst#3) ← (byte) memset::c#1
  (byte*) memset::dst#1 ← ++ (byte*) memset::dst#3
  to:memset::@4
memset::@return: scope:[memset]  from memset::@1
  (void*) memset::return#3 ← phi( memset::@1/(void*) memset::return#0 )
  (void*) memset::return#1 ← (void*) memset::return#3
  return 
  to:@return
@27: 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:@52

(void()) print_word((word) print_word::w)
print_word: scope:[print_word]  from main::@21
  (byte*) print_char_cursor#25 ← phi( main::@21/(byte*) print_char_cursor#27 )
  (word) print_word::w#1 ← phi( main::@21/(word) print_word::w#0 )
  (byte~) print_word::$0 ← > (word) print_word::w#1
  (byte) print_byte::b#0 ← (byte~) print_word::$0
  call print_byte 
  to:print_word::@1
print_word::@1: scope:[print_word]  from print_word
  (word) print_word::w#2 ← phi( print_word/(word) print_word::w#1 )
  (byte*) print_char_cursor#13 ← phi( print_word/(byte*) print_char_cursor#6 )
  (byte*) print_char_cursor#1 ← (byte*) print_char_cursor#13
  (byte~) print_word::$2 ← < (word) print_word::w#2
  (byte) print_byte::b#1 ← (byte~) print_word::$2
  call print_byte 
  to:print_word::@2
print_word::@2: scope:[print_word]  from print_word::@1
  (byte*) print_char_cursor#14 ← phi( print_word::@1/(byte*) print_char_cursor#6 )
  (byte*) print_char_cursor#2 ← (byte*) print_char_cursor#14
  to:print_word::@return
print_word::@return: scope:[print_word]  from print_word::@2
  (byte*) print_char_cursor#15 ← phi( print_word::@2/(byte*) print_char_cursor#2 )
  (byte*) print_char_cursor#3 ← (byte*) print_char_cursor#15
  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#26 ← phi( print_word/(byte*) print_char_cursor#25 print_word::@1/(byte*) print_char_cursor#1 )
  (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
  (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (number) 4
  (byte) print_char::ch#0 ← *((const byte*) print_hextab + (byte~) print_byte::$0)
  call print_char 
  to:print_byte::@1
print_byte::@1: scope:[print_byte]  from print_byte
  (byte) print_byte::b#3 ← phi( print_byte/(byte) print_byte::b#2 )
  (byte*) print_char_cursor#16 ← phi( print_byte/(byte*) print_char_cursor#8 )
  (byte*) print_char_cursor#4 ← (byte*) print_char_cursor#16
  (number~) print_byte::$2 ← (byte) print_byte::b#3 & (number) $f
  (byte) print_char::ch#1 ← *((const byte*) print_hextab + (number~) print_byte::$2)
  call print_char 
  to:print_byte::@2
print_byte::@2: scope:[print_byte]  from print_byte::@1
  (byte*) print_char_cursor#17 ← phi( print_byte::@1/(byte*) print_char_cursor#8 )
  (byte*) print_char_cursor#5 ← (byte*) print_char_cursor#17
  to:print_byte::@return
print_byte::@return: scope:[print_byte]  from print_byte::@2
  (byte*) print_char_cursor#18 ← phi( print_byte::@2/(byte*) print_char_cursor#5 )
  (byte*) print_char_cursor#6 ← (byte*) print_char_cursor#18
  return 
  to:@return

(void()) print_char((byte) print_char::ch)
print_char: scope:[print_char]  from main::@30 print_byte print_byte::@1
  (byte*) print_char_cursor#19 ← phi( main::@30/(byte*) print_char_cursor#9 print_byte/(byte*) print_char_cursor#26 print_byte::@1/(byte*) print_char_cursor#4 )
  (byte) print_char::ch#3 ← phi( main::@30/(byte) print_char::ch#2 print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
  *((byte*) print_char_cursor#19) ← (byte) print_char::ch#3
  (byte*) print_char_cursor#7 ← ++ (byte*) print_char_cursor#19
  to:print_char::@return
print_char::@return: scope:[print_char]  from print_char
  (byte*) print_char_cursor#20 ← phi( print_char/(byte*) print_char_cursor#7 )
  (byte*) print_char_cursor#8 ← (byte*) print_char_cursor#20
  return 
  to:@return

(void()) main()
main: scope:[main]  from @52
  (byte*) print_char_cursor#38 ← phi( @52/(byte*) print_char_cursor#29 )
  (void*) memset::str#0 ← (void*)(const byte*) sieve
  (byte) memset::c#0 ← (number) 0
  (word) memset::num#0 ← (const word) COUNT
  call memset 
  (void*) memset::return#2 ← (void*) memset::return#1
  to:main::@29
main::@29: scope:[main]  from main
  (byte*) print_char_cursor#36 ← phi( main/(byte*) print_char_cursor#38 )
  (word) main::i#0 ← (word) 2
  (byte*~) main::$1 ← & *((const byte*) sieve + (word) main::i#0)
  (byte*) main::sieve_i#0 ← (byte*~) main::$1
  to:main::@1
main::@1: scope:[main]  from main::@29 main::@4
  (byte*) print_char_cursor#35 ← phi( main::@29/(byte*) print_char_cursor#36 main::@4/(byte*) print_char_cursor#37 )
  (byte*) main::sieve_i#4 ← phi( main::@29/(byte*) main::sieve_i#0 main::@4/(byte*) main::sieve_i#1 )
  (word) main::i#4 ← phi( main::@29/(word) main::i#0 main::@4/(word) main::i#2 )
  (bool~) main::$2 ← (word) main::i#4 < (const byte) SQRT_COUNT
  if((bool~) main::$2) goto main::@2
  to:main::@3
main::@2: scope:[main]  from main::@1
  (byte*) print_char_cursor#39 ← phi( main::@1/(byte*) print_char_cursor#35 )
  (word) main::i#12 ← phi( main::@1/(word) main::i#4 )
  (byte*) main::sieve_i#2 ← phi( main::@1/(byte*) main::sieve_i#4 )
  (bool~) main::$14 ← (number) 0 != *((byte*) main::sieve_i#2)
  (bool~) main::$3 ← ! (bool~) main::$14
  (bool~) main::$4 ← ! (bool~) main::$3
  if((bool~) main::$4) goto main::@4
  to:main::@13
main::@3: scope:[main]  from main::@1
  (byte*) print_char_cursor#34 ← phi( main::@1/(byte*) print_char_cursor#35 )
  (word) main::i#1 ← (number) 2
  to:main::@15
main::@4: scope:[main]  from main::@2 main::@5
  (byte*) print_char_cursor#37 ← phi( main::@2/(byte*) print_char_cursor#39 main::@5/(byte*) print_char_cursor#40 )
  (byte*) main::sieve_i#3 ← phi( main::@2/(byte*) main::sieve_i#2 main::@5/(byte*) main::sieve_i#5 )
  (word) main::i#5 ← phi( main::@2/(word) main::i#12 main::@5/(word) main::i#13 )
  (word) main::i#2 ← ++ (word) main::i#5
  (byte*) main::sieve_i#1 ← ++ (byte*) main::sieve_i#3
  to:main::@1
main::@13: scope:[main]  from main::@2
  (byte*) print_char_cursor#41 ← phi( main::@2/(byte*) print_char_cursor#39 )
  (byte*) main::sieve_i#6 ← phi( main::@2/(byte*) main::sieve_i#2 )
  (word) main::i#6 ← phi( main::@2/(word) main::i#12 )
  (number~) main::$5 ← (word) main::i#6 * (number) 2
  (word) main::j#0 ← (number~) main::$5
  (byte*~) main::$6 ← & *((const byte*) sieve + (word) main::j#0)
  (byte*) main::s#0 ← (byte*~) main::$6
  to:main::@5
main::@5: scope:[main]  from main::@13 main::@6
  (byte*) print_char_cursor#40 ← phi( main::@13/(byte*) print_char_cursor#41 main::@6/(byte*) print_char_cursor#42 )
  (byte*) main::s#3 ← phi( main::@13/(byte*) main::s#0 main::@6/(byte*) main::s#1 )
  (byte*) main::sieve_i#5 ← phi( main::@13/(byte*) main::sieve_i#6 main::@6/(byte*) main::sieve_i#7 )
  (word) main::i#13 ← phi( main::@13/(word) main::i#6 main::@6/(word) main::i#7 )
  (word) main::j#2 ← phi( main::@13/(word) main::j#0 main::@6/(word) main::j#1 )
  (bool~) main::$7 ← (word) main::j#2 < (const word) COUNT
  if((bool~) main::$7) goto main::@6
  to:main::@4
main::@6: scope:[main]  from main::@5
  (byte*) print_char_cursor#42 ← phi( main::@5/(byte*) print_char_cursor#40 )
  (byte*) main::sieve_i#7 ← phi( main::@5/(byte*) main::sieve_i#5 )
  (word) main::j#3 ← phi( main::@5/(word) main::j#2 )
  (word) main::i#7 ← phi( main::@5/(word) main::i#13 )
  (byte*) main::s#2 ← phi( main::@5/(byte*) main::s#3 )
  *((byte*) main::s#2) ← (number) 1
  (byte*) main::s#1 ← (byte*) main::s#2 + (word) main::i#7
  (word) main::j#1 ← (word) main::j#3 + (word) main::i#7
  to:main::@5
main::@15: scope:[main]  from main::@18 main::@3
  (byte*) print_char_cursor#31 ← phi( main::@18/(byte*) print_char_cursor#33 main::@3/(byte*) print_char_cursor#34 )
  (word) main::i#8 ← phi( main::@18/(word) main::i#3 main::@3/(word) main::i#1 )
  (bool~) main::$8 ← (word) main::i#8 < (number) $4c7
  if((bool~) main::$8) goto main::@16
  to:main::@23
main::@16: scope:[main]  from main::@15
  (byte*) print_char_cursor#30 ← phi( main::@15/(byte*) print_char_cursor#31 )
  (word) main::i#9 ← phi( main::@15/(word) main::i#8 )
  (bool~) main::$15 ← (number) 0 != *((const byte*) sieve + (word) main::i#9)
  (bool~) main::$9 ← ! (bool~) main::$15
  (bool~) main::$10 ← ! (bool~) main::$9
  if((bool~) main::$10) goto main::@18
  to:main::@21
main::@18: scope:[main]  from main::@16 main::@31
  (byte*) print_char_cursor#33 ← phi( main::@16/(byte*) print_char_cursor#30 main::@31/(byte*) print_char_cursor#10 )
  (word) main::i#10 ← phi( main::@16/(word) main::i#9 main::@31/(word) main::i#14 )
  (word) main::i#3 ← ++ (word) main::i#10
  to:main::@15
main::@21: scope:[main]  from main::@16
  (byte*) print_char_cursor#27 ← phi( main::@16/(byte*) print_char_cursor#30 )
  (word) main::i#11 ← phi( main::@16/(word) main::i#9 )
  (word) print_word::w#0 ← (word) main::i#11
  call print_word 
  to:main::@30
main::@30: scope:[main]  from main::@21
  (word) main::i#15 ← phi( main::@21/(word) main::i#11 )
  (byte*) print_char_cursor#21 ← phi( main::@21/(byte*) print_char_cursor#3 )
  (byte*) print_char_cursor#9 ← (byte*) print_char_cursor#21
  (byte) print_char::ch#2 ← (byte) ' '
  call print_char 
  to:main::@31
main::@31: scope:[main]  from main::@30
  (word) main::i#14 ← phi( main::@30/(word) main::i#15 )
  (byte*) print_char_cursor#22 ← phi( main::@30/(byte*) print_char_cursor#8 )
  (byte*) print_char_cursor#10 ← (byte*) print_char_cursor#22
  to:main::@18
main::@23: scope:[main]  from main::@15 main::@24
  (byte*) print_char_cursor#28 ← phi( main::@15/(byte*) print_char_cursor#31 main::@24/(byte*) print_char_cursor#32 )
  if(true) goto main::@24
  to:main::@return
main::@24: scope:[main]  from main::@23
  (byte*) print_char_cursor#32 ← phi( main::@23/(byte*) print_char_cursor#28 )
  *((const byte*) SCREEN+(number) $3e7) ← ++ *((const byte*) SCREEN+(number) $3e7)
  to:main::@23
main::@return: scope:[main]  from main::@23
  (byte*) print_char_cursor#23 ← phi( main::@23/(byte*) print_char_cursor#28 )
  (byte*) print_char_cursor#11 ← (byte*) print_char_cursor#23
  return 
  to:@return
@52: scope:[]  from @27
  (byte*) print_char_cursor#29 ← phi( @27/(byte*) print_char_cursor#0 )
  call main 
  to:@53
@53: scope:[]  from @52
  (byte*) print_char_cursor#24 ← phi( @52/(byte*) print_char_cursor#11 )
  (byte*) print_char_cursor#12 ← (byte*) print_char_cursor#24
  to:@end
@end: scope:[]  from @53

SYMBOL TABLE SSA
(label) @27
(label) @52
(label) @53
(label) @begin
(label) @end
(const word) COUNT = (word) $4000
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10
(const byte) RADIX::OCTAL = (number) 8
(const byte*) SCREEN = (byte*)(number) $400
(const byte) SQRT_COUNT = (byte) $80
(void()) main()
(byte*~) main::$1
(bool~) main::$10
(bool~) main::$14
(bool~) main::$15
(bool~) main::$2
(bool~) main::$3
(bool~) main::$4
(number~) main::$5
(byte*~) main::$6
(bool~) main::$7
(bool~) main::$8
(bool~) main::$9
(label) main::@1
(label) main::@13
(label) main::@15
(label) main::@16
(label) main::@18
(label) main::@2
(label) main::@21
(label) main::@23
(label) main::@24
(label) main::@29
(label) main::@3
(label) main::@30
(label) main::@31
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@return
(word) main::i
(word) main::i#0
(word) main::i#1
(word) main::i#10
(word) main::i#11
(word) main::i#12
(word) main::i#13
(word) main::i#14
(word) main::i#15
(word) main::i#2
(word) main::i#3
(word) main::i#4
(word) main::i#5
(word) main::i#6
(word) main::i#7
(word) main::i#8
(word) main::i#9
(word) main::j
(word) main::j#0
(word) main::j#1
(word) main::j#2
(word) main::j#3
(byte*) main::s
(byte*) main::s#0
(byte*) main::s#1
(byte*) main::s#2
(byte*) main::s#3
(byte*) main::sieve_i
(byte*) main::sieve_i#0
(byte*) main::sieve_i#1
(byte*) main::sieve_i#2
(byte*) main::sieve_i#3
(byte*) main::sieve_i#4
(byte*) main::sieve_i#5
(byte*) main::sieve_i#6
(byte*) main::sieve_i#7
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(bool~) memset::$0
(bool~) memset::$1
(byte*~) memset::$2
(byte*~) memset::$3
(bool~) memset::$4
(label) memset::@1
(label) memset::@2
(label) memset::@4
(label) memset::@5
(label) memset::@return
(byte) memset::c
(byte) memset::c#0
(byte) memset::c#1
(byte) memset::c#2
(byte) memset::c#3
(byte) memset::c#4
(byte*) memset::dst
(byte*) memset::dst#0
(byte*) memset::dst#1
(byte*) memset::dst#2
(byte*) memset::dst#3
(byte*) memset::end
(byte*) memset::end#0
(byte*) memset::end#1
(byte*) memset::end#2
(word) memset::num
(word) memset::num#0
(word) memset::num#1
(word) memset::num#2
(void*) memset::return
(void*) memset::return#0
(void*) memset::return#1
(void*) memset::return#2
(void*) memset::return#3
(void*) memset::str
(void*) memset::str#0
(void*) memset::str#1
(void*) memset::str#2
(void*) memset::str#3
(void*) memset::str#4
(void*) memset::str#5
(void()) print_byte((byte) print_byte::b)
(byte~) print_byte::$0
(number~) print_byte::$2
(label) print_byte::@1
(label) print_byte::@2
(label) print_byte::@return
(byte) print_byte::b
(byte) print_byte::b#0
(byte) print_byte::b#1
(byte) print_byte::b#2
(byte) print_byte::b#3
(void()) print_char((byte) print_char::ch)
(label) print_char::@return
(byte) print_char::ch
(byte) print_char::ch#0
(byte) print_char::ch#1
(byte) print_char::ch#2
(byte) print_char::ch#3
(byte*) print_char_cursor
(byte*) print_char_cursor#0
(byte*) print_char_cursor#1
(byte*) print_char_cursor#10
(byte*) print_char_cursor#11
(byte*) print_char_cursor#12
(byte*) print_char_cursor#13
(byte*) print_char_cursor#14
(byte*) print_char_cursor#15
(byte*) print_char_cursor#16
(byte*) print_char_cursor#17
(byte*) print_char_cursor#18
(byte*) print_char_cursor#19
(byte*) print_char_cursor#2
(byte*) print_char_cursor#20
(byte*) print_char_cursor#21
(byte*) print_char_cursor#22
(byte*) print_char_cursor#23
(byte*) print_char_cursor#24
(byte*) print_char_cursor#25
(byte*) print_char_cursor#26
(byte*) print_char_cursor#27
(byte*) print_char_cursor#28
(byte*) print_char_cursor#29
(byte*) print_char_cursor#3
(byte*) print_char_cursor#30
(byte*) print_char_cursor#31
(byte*) print_char_cursor#32
(byte*) print_char_cursor#33
(byte*) print_char_cursor#34
(byte*) print_char_cursor#35
(byte*) print_char_cursor#36
(byte*) print_char_cursor#37
(byte*) print_char_cursor#38
(byte*) print_char_cursor#39
(byte*) print_char_cursor#4
(byte*) print_char_cursor#40
(byte*) print_char_cursor#41
(byte*) print_char_cursor#42
(byte*) print_char_cursor#5
(byte*) print_char_cursor#6
(byte*) print_char_cursor#7
(byte*) print_char_cursor#8
(byte*) print_char_cursor#9
(const byte*) print_hextab[]  = (byte*) "0123456789abcdef"z
(byte*) print_line_cursor
(byte*) print_line_cursor#0
(byte*) print_screen
(byte*) print_screen#0
(void()) print_word((word) print_word::w)
(byte~) print_word::$0
(byte~) print_word::$2
(label) print_word::@1
(label) print_word::@2
(label) print_word::@return
(word) print_word::w
(word) print_word::w#0
(word) print_word::w#1
(word) print_word::w#2
(const byte*) sieve = (byte*)(number) $1000

Adding number conversion cast (unumber) 0 in (bool~) memset::$0 ← (word) memset::num#1 > (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 (unumber) 0 in (byte) memset::c#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) main::$14 ← (number) 0 != *((byte*) main::sieve_i#2)
Adding number conversion cast (unumber) 2 in (word) main::i#1 ← (number) 2
Adding number conversion cast (unumber) 2 in (number~) main::$5 ← (word) main::i#6 * (number) 2
Adding number conversion cast (unumber) main::$5 in (number~) main::$5 ← (word) main::i#6 * (unumber)(number) 2
Adding number conversion cast (unumber) 1 in *((byte*) main::s#2) ← (number) 1
Adding number conversion cast (unumber) $4c7 in (bool~) main::$8 ← (word) main::i#8 < (number) $4c7
Adding number conversion cast (unumber) 0 in (bool~) main::$15 ← (number) 0 != *((const byte*) sieve + (word) main::i#9)
Adding number conversion cast (unumber) $3e7 in *((const byte*) SCREEN+(number) $3e7) ← ++ *((const byte*) SCREEN+(number) $3e7)
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte) memset::c#0 ← (unumber)(number) 0
Inlining cast (word) main::i#1 ← (unumber)(number) 2
Inlining cast *((byte*) main::s#2) ← (unumber)(number) 1
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 4096
Simplifying constant integer cast 0
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 4
Simplifying constant integer cast $f
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Simplifying constant integer cast 1
Simplifying constant integer cast $4c7
Simplifying constant integer cast 0
Simplifying constant integer cast $3e7
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) $f
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 1
Finalized unsigned number type (word) $4c7
Finalized unsigned number type (byte) 0
Finalized unsigned number type (word) $3e7
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) print_byte::$2 ← (byte) print_byte::b#3 & (byte) $f
Inferred type updated to word in (unumber~) main::$5 ← (word) main::i#6 * (byte) 2
Inversing boolean not [2] (bool~) memset::$1 ← (word) memset::num#1 <= (byte) 0 from [1] (bool~) memset::$0 ← (word) memset::num#1 > (byte) 0
Inversing boolean not [72] (bool~) main::$3 ← (byte) 0 == *((byte*) main::sieve_i#2) from [71] (bool~) main::$14 ← (byte) 0 != *((byte*) main::sieve_i#2)
Inversing boolean not [73] (bool~) main::$4 ← (byte) 0 != *((byte*) main::sieve_i#2) from [72] (bool~) main::$3 ← (byte) 0 == *((byte*) main::sieve_i#2)
Inversing boolean not [97] (bool~) main::$9 ← (byte) 0 == *((const byte*) sieve + (word) main::i#9) from [96] (bool~) main::$15 ← (byte) 0 != *((const byte*) sieve + (word) main::i#9)
Inversing boolean not [98] (bool~) main::$10 ← (byte) 0 != *((const byte*) sieve + (word) main::i#9) from [97] (bool~) main::$9 ← (byte) 0 == *((const byte*) sieve + (word) main::i#9)
Successful SSA optimization Pass2UnaryNotSimplification
Alias (void*) memset::return#0 = (void*) memset::str#1 (void*) memset::return#3 (void*) memset::return#1 
Alias (void*) memset::str#2 = (void*) memset::str#3 
Alias (word) memset::num#1 = (word) memset::num#2 
Alias (byte) memset::c#3 = (byte) memset::c#4 
Alias (byte*) memset::end#0 = (byte*~) memset::$3 
Alias (byte) memset::c#1 = (byte) memset::c#2 
Alias (byte*) memset::dst#2 = (byte*) memset::dst#3 
Alias (byte*) memset::end#1 = (byte*) memset::end#2 
Alias (void*) memset::str#4 = (void*) memset::str#5 
Alias (byte*) print_char_cursor#0 = (byte*) print_line_cursor#0 (byte*) print_screen#0 (byte*) print_char_cursor#29 
Alias (byte) print_byte::b#0 = (byte~) print_word::$0 
Alias (word) print_word::w#1 = (word) print_word::w#2 
Alias (byte*) print_char_cursor#1 = (byte*) print_char_cursor#13 
Alias (byte) print_byte::b#1 = (byte~) print_word::$2 
Alias (byte*) print_char_cursor#14 = (byte*) print_char_cursor#2 (byte*) print_char_cursor#15 (byte*) print_char_cursor#3 
Alias (byte) print_byte::b#2 = (byte) print_byte::b#3 
Alias (byte*) print_char_cursor#16 = (byte*) print_char_cursor#4 
Alias (byte*) print_char_cursor#17 = (byte*) print_char_cursor#5 (byte*) print_char_cursor#18 (byte*) print_char_cursor#6 
Alias (byte*) print_char_cursor#20 = (byte*) print_char_cursor#7 (byte*) print_char_cursor#8 
Alias (byte*) print_char_cursor#36 = (byte*) print_char_cursor#38 
Alias (byte*) main::sieve_i#0 = (byte*~) main::$1 
Alias (byte*) main::sieve_i#2 = (byte*) main::sieve_i#4 (byte*) main::sieve_i#6 
Alias (word) main::i#12 = (word) main::i#4 (word) main::i#6 
Alias (byte*) print_char_cursor#34 = (byte*) print_char_cursor#39 (byte*) print_char_cursor#35 (byte*) print_char_cursor#41 
Alias (word) main::j#0 = (word~) main::$5 
Alias (byte*) main::s#0 = (byte*~) main::$6 
Alias (byte*) main::s#2 = (byte*) main::s#3 
Alias (word) main::i#13 = (word) main::i#7 
Alias (word) main::j#2 = (word) main::j#3 
Alias (byte*) main::sieve_i#5 = (byte*) main::sieve_i#7 
Alias (byte*) print_char_cursor#40 = (byte*) print_char_cursor#42 
Alias (word) main::i#11 = (word) main::i#9 (word) main::i#8 (word) main::i#15 (word) main::i#14 
Alias (byte*) print_char_cursor#27 = (byte*) print_char_cursor#30 (byte*) print_char_cursor#31 
Alias (byte*) print_char_cursor#21 = (byte*) print_char_cursor#9 
Alias (byte*) print_char_cursor#10 = (byte*) print_char_cursor#22 
Alias (byte*) print_char_cursor#11 = (byte*) print_char_cursor#32 (byte*) print_char_cursor#28 (byte*) print_char_cursor#23 
Alias (byte*) print_char_cursor#12 = (byte*) print_char_cursor#24 
Successful SSA optimization Pass2AliasElimination
Alias (word) main::i#10 = (word) main::i#11 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (word) memset::num#1 (word) memset::num#0
Identical Phi Values (void*) memset::str#2 (void*) memset::str#0
Identical Phi Values (byte) memset::c#3 (byte) memset::c#0
Identical Phi Values (byte*) memset::end#1 (byte*) memset::end#0
Identical Phi Values (void*) memset::str#4 (void*) memset::str#2
Identical Phi Values (byte) memset::c#1 (byte) memset::c#3
Identical Phi Values (word) print_word::w#1 (word) print_word::w#0
Identical Phi Values (byte*) print_char_cursor#25 (byte*) print_char_cursor#27
Identical Phi Values (byte*) print_char_cursor#1 (byte*) print_char_cursor#17
Identical Phi Values (byte*) print_char_cursor#14 (byte*) print_char_cursor#17
Identical Phi Values (byte*) print_char_cursor#16 (byte*) print_char_cursor#20
Identical Phi Values (byte*) print_char_cursor#17 (byte*) print_char_cursor#20
Identical Phi Values (byte*) print_char_cursor#36 (byte*) print_char_cursor#0
Identical Phi Values (word) main::i#13 (word) main::i#12
Identical Phi Values (byte*) main::sieve_i#5 (byte*) main::sieve_i#2
Identical Phi Values (byte*) print_char_cursor#40 (byte*) print_char_cursor#34
Identical Phi Values (byte*) print_char_cursor#21 (byte*) print_char_cursor#14
Identical Phi Values (byte*) print_char_cursor#10 (byte*) print_char_cursor#20
Identical Phi Values (byte*) print_char_cursor#11 (byte*) print_char_cursor#27
Identical Phi Values (byte*) print_char_cursor#12 (byte*) print_char_cursor#11
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values (void*) memset::return#0 (void*) memset::str#0
Identical Phi Values (word) main::i#5 (word) main::i#12
Identical Phi Values (byte*) main::sieve_i#3 (byte*) main::sieve_i#2
Identical Phi Values (byte*) print_char_cursor#37 (byte*) print_char_cursor#34
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values (byte*) print_char_cursor#34 (byte*) print_char_cursor#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) memset::$1 [2] if((word) memset::num#0<=(byte) 0) goto memset::@1
Simple Condition (bool~) memset::$4 [9] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@5
Simple Condition (bool~) main::$2 [46] if((word) main::i#12<(const byte) SQRT_COUNT) goto main::@2
Simple Condition (bool~) main::$4 [48] if((byte) 0!=*((byte*) main::sieve_i#2)) goto main::@4
Simple Condition (bool~) main::$7 [57] if((word) main::j#2<(const word) COUNT) goto main::@6
Simple Condition (bool~) main::$8 [63] if((word) main::i#10<(word) $4c7) goto main::@16
Simple Condition (bool~) main::$10 [65] if((byte) 0!=*((const byte*) sieve + (word) main::i#10)) goto main::@18
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting array member address-of to pointer addition [43] (byte*) main::sieve_i#0 ← (const byte*) sieve + (word) main::i#0
Rewriting array member address-of to pointer addition [54] (byte*) main::s#0 ← (const byte*) sieve + (word) main::j#0
Successful SSA optimization PassNArrayElementAddressOfRewriting
Constant right-side identified [37] (void*) memset::str#0 ← (void*)(const byte*) sieve
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) print_char_cursor#0 = (byte*) 1024
Constant (const void*) memset::str#0 = (void*)sieve
Constant (const byte) memset::c#0 = 0
Constant (const word) memset::num#0 = COUNT
Constant (const word) main::i#0 = 2
Constant (const word) main::i#1 = 2
Constant (const byte) print_char::ch#2 = ' '
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) memset::$2 = (byte*)memset::str#0
Constant (const byte*) memset::dst#0 = (byte*)memset::str#0
Constant (const void*) memset::return#2 = memset::str#0
Successful SSA optimization Pass2ConstantIdentification
if() condition always false - eliminating [2] if((const word) memset::num#0<=(byte) 0) goto memset::@1
if() condition always true - replacing block destination [75] if(true) goto main::@24
Successful SSA optimization Pass2ConstantIfs
De-inlining pointer[w] to *(pointer+w)   [65] if((byte) 0!=*((const byte*) sieve + (word) main::i#10)) goto main::@18
Successful SSA optimization Pass2DeInlineWordDerefIdx
Eliminating unused constant (const void*) memset::return#2
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Constant right-side identified [0] (byte*) memset::end#0 ← (const byte*) memset::$2 + (const word) memset::num#0
Constant right-side identified [24] (byte*) main::sieve_i#0 ← (const byte*) sieve + (const word) main::i#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) memset::end#0 = memset::$2+memset::num#0
Constant (const byte*) main::sieve_i#0 = sieve+main::i#0
Successful SSA optimization Pass2ConstantIdentification
Rewriting multiplication to use shift [28] (word) main::j#0 ← (word) main::i#12 * (byte) 2
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const byte*) memset::dst#0
Inlining constant with var siblings (const byte) print_char::ch#2
Inlining constant with var siblings (const word) main::i#0
Inlining constant with var siblings (const word) main::i#1
Inlining constant with var siblings (const byte*) main::sieve_i#0
Inlining constant with var siblings (const byte*) print_char_cursor#0
Constant inlined print_char::ch#2 = (byte) ' '
Constant inlined print_char_cursor#0 = (byte*) 1024
Constant inlined memset::$2 = (byte*)(const void*) memset::str#0
Constant inlined main::i#0 = (word) 2
Constant inlined memset::dst#0 = (byte*)(const void*) memset::str#0
Constant inlined memset::num#0 = (const word) COUNT
Constant inlined main::i#1 = (byte) 2
Constant inlined main::sieve_i#0 = (const byte*) sieve+(word) 2
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@32(between main::@16 and main::@18)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @27
Adding NOP phi() at start of @52
Adding NOP phi() at start of @53
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@29
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of main::@23
Adding NOP phi() at start of print_word::@2
Adding NOP phi() at start of print_byte::@2
Adding NOP phi() at start of memset
Adding NOP phi() at start of memset::@2
Adding NOP phi() at start of memset::@1
CALL GRAPH
Calls in [] to main:3 
Calls in [main] to memset:7 print_word:19 print_char:21 
Calls in [print_word] to print_byte:51 print_byte:55 
Calls in [print_byte] to print_char:63 print_char:68 

Created 12 initial phi equivalence classes
Coalesced [20] print_char_cursor#45 ← print_char_cursor#20
Coalesced [22] print_char_cursor#50 ← print_char_cursor#20
Coalesced [25] main::i#17 ← main::i#3
Coalesced [26] print_char_cursor#48 ← print_char_cursor#33
Coalesced (already) [27] print_char_cursor#49 ← print_char_cursor#27
Coalesced [31] main::j#4 ← main::j#0
Coalesced [32] main::s#4 ← main::s#0
Coalesced [37] main::i#16 ← main::i#2
Coalesced [38] main::sieve_i#8 ← main::sieve_i#1
Coalesced [42] main::j#5 ← main::j#1
Coalesced [43] main::s#5 ← main::s#1
Coalesced [49] print_byte::b#4 ← print_byte::b#0
Coalesced [50] print_char_cursor#43 ← print_char_cursor#27
Coalesced [53] print_byte::b#5 ← print_byte::b#1
Coalesced (already) [54] print_char_cursor#44 ← print_char_cursor#20
Coalesced [61] print_char::ch#4 ← print_char::ch#0
Coalesced (already) [62] print_char_cursor#46 ← print_char_cursor#26
Coalesced [66] print_char::ch#5 ← print_char::ch#1
Coalesced (already) [67] print_char_cursor#47 ← print_char_cursor#20
Coalesced [79] memset::dst#4 ← memset::dst#1
Coalesced down to 9 phi equivalence classes
Culled Empty Block (label) @27
Culled Empty Block (label) @53
Culled Empty Block (label) main::@29
Culled Empty Block (label) main::@3
Culled Empty Block (label) main::@23
Culled Empty Block (label) main::@31
Culled Empty Block (label) main::@32
Culled Empty Block (label) print_word::@2
Culled Empty Block (label) print_byte::@2
Culled Empty Block (label) memset::@2
Culled Empty Block (label) memset::@1
Renumbering block @52 to @1
Renumbering block memset::@4 to memset::@1
Renumbering block memset::@5 to memset::@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::@13 to main::@6
Renumbering block main::@15 to main::@7
Renumbering block main::@16 to main::@8
Renumbering block main::@18 to main::@9
Renumbering block main::@21 to main::@10
Renumbering block main::@24 to main::@11
Renumbering block main::@30 to main::@12
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::@12
Adding NOP phi() at start of memset

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()
  [5] call memset 
  to:main::@1
main::@1: scope:[main]  from main main::@3
  [6] (byte*) main::sieve_i#2 ← phi( main/(const byte*) sieve+(word) 2 main::@3/(byte*) main::sieve_i#1 )
  [6] (word) main::i#12 ← phi( main/(word) 2 main::@3/(word) main::i#2 )
  [7] if((word) main::i#12<(const byte) SQRT_COUNT) goto main::@2
  to:main::@7
main::@7: scope:[main]  from main::@1 main::@9
  [8] (byte*) print_char_cursor#27 ← phi( main::@9/(byte*) print_char_cursor#33 main::@1/(byte*) 1024 )
  [8] (word) main::i#10 ← phi( main::@9/(word) main::i#3 main::@1/(byte) 2 )
  [9] if((word) main::i#10<(word) $4c7) goto main::@8
  to:main::@11
main::@11: scope:[main]  from main::@11 main::@7
  [10] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7)
  to:main::@11
main::@8: scope:[main]  from main::@7
  [11] (byte*~) main::$16 ← (const byte*) sieve + (word) main::i#10
  [12] if((byte) 0!=*((byte*~) main::$16)) goto main::@9
  to:main::@10
main::@10: scope:[main]  from main::@8
  [13] (word) print_word::w#0 ← (word) main::i#10
  [14] call print_word 
  to:main::@12
main::@12: scope:[main]  from main::@10
  [15] phi()
  [16] call print_char 
  to:main::@9
main::@9: scope:[main]  from main::@12 main::@8
  [17] (byte*) print_char_cursor#33 ← phi( main::@8/(byte*) print_char_cursor#27 main::@12/(byte*) print_char_cursor#20 )
  [18] (word) main::i#3 ← ++ (word) main::i#10
  to:main::@7
main::@2: scope:[main]  from main::@1
  [19] if((byte) 0!=*((byte*) main::sieve_i#2)) goto main::@3
  to:main::@6
main::@6: scope:[main]  from main::@2
  [20] (word) main::j#0 ← (word) main::i#12 << (byte) 1
  [21] (byte*) main::s#0 ← (const byte*) sieve + (word) main::j#0
  to:main::@4
main::@4: scope:[main]  from main::@5 main::@6
  [22] (byte*) main::s#2 ← phi( main::@6/(byte*) main::s#0 main::@5/(byte*) main::s#1 )
  [22] (word) main::j#2 ← phi( main::@6/(word) main::j#0 main::@5/(word) main::j#1 )
  [23] if((word) main::j#2<(const word) COUNT) goto main::@5
  to:main::@3
main::@3: scope:[main]  from main::@2 main::@4
  [24] (word) main::i#2 ← ++ (word) main::i#12
  [25] (byte*) main::sieve_i#1 ← ++ (byte*) main::sieve_i#2
  to:main::@1
main::@5: scope:[main]  from main::@4
  [26] *((byte*) main::s#2) ← (byte) 1
  [27] (byte*) main::s#1 ← (byte*) main::s#2 + (word) main::i#12
  [28] (word) main::j#1 ← (word) main::j#2 + (word) main::i#12
  to:main::@4

(void()) print_char((byte) print_char::ch)
print_char: scope:[print_char]  from main::@12 print_byte print_byte::@1
  [29] (byte*) print_char_cursor#19 ← phi( main::@12/(byte*) print_char_cursor#20 print_byte/(byte*) print_char_cursor#26 print_byte::@1/(byte*) print_char_cursor#20 )
  [29] (byte) print_char::ch#3 ← phi( main::@12/(byte) ' ' print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
  [30] *((byte*) print_char_cursor#19) ← (byte) print_char::ch#3
  [31] (byte*) print_char_cursor#20 ← ++ (byte*) print_char_cursor#19
  to:print_char::@return
print_char::@return: scope:[print_char]  from print_char
  [32] return 
  to:@return

(void()) print_word((word) print_word::w)
print_word: scope:[print_word]  from main::@10
  [33] (byte) print_byte::b#0 ← > (word) print_word::w#0
  [34] call print_byte 
  to:print_word::@1
print_word::@1: scope:[print_word]  from print_word
  [35] (byte) print_byte::b#1 ← < (word) print_word::w#0
  [36] call print_byte 
  to:print_word::@return
print_word::@return: scope:[print_word]  from print_word::@1
  [37] return 
  to:@return

(void()) print_byte((byte) print_byte::b)
print_byte: scope:[print_byte]  from print_word print_word::@1
  [38] (byte*) print_char_cursor#26 ← phi( print_word/(byte*) print_char_cursor#27 print_word::@1/(byte*) print_char_cursor#20 )
  [38] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
  [39] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4
  [40] (byte) print_char::ch#0 ← *((const byte*) print_hextab + (byte~) print_byte::$0)
  [41] call print_char 
  to:print_byte::@1
print_byte::@1: scope:[print_byte]  from print_byte
  [42] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f
  [43] (byte) print_char::ch#1 ← *((const byte*) print_hextab + (byte~) print_byte::$2)
  [44] call print_char 
  to:print_byte::@return
print_byte::@return: scope:[print_byte]  from print_byte::@1
  [45] return 
  to:@return

(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
memset: scope:[memset]  from main
  [46] phi()
  to:memset::@1
memset::@1: scope:[memset]  from memset memset::@2
  [47] (byte*) memset::dst#2 ← phi( memset/(byte*)(const void*) memset::str#0 memset::@2/(byte*) memset::dst#1 )
  [48] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2
  to:memset::@return
memset::@return: scope:[memset]  from memset::@1
  [49] return 
  to:@return
memset::@2: scope:[memset]  from memset::@1
  [50] *((byte*) memset::dst#2) ← (const byte) memset::c#0
  [51] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
  to:memset::@1


VARIABLE REGISTER WEIGHTS
(void()) main()
(byte*~) main::$16 22.0
(word) main::i
(word) main::i#10 6.111111111111112
(word) main::i#12 24.6
(word) main::i#2 11.0
(word) main::i#3 22.0
(word) main::j
(word) main::j#0 16.5
(word) main::j#1 202.0
(word) main::j#2 78.5
(byte*) main::s
(byte*) main::s#0 22.0
(byte*) main::s#1 101.0
(byte*) main::s#2 104.66666666666666
(byte*) main::sieve_i
(byte*) main::sieve_i#1 22.0
(byte*) main::sieve_i#2 3.0
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(byte) memset::c
(byte*) memset::dst
(byte*) memset::dst#1 22.0
(byte*) memset::dst#2 14.666666666666666
(byte*) memset::end
(word) memset::num
(void*) memset::return
(void*) memset::str
(void()) print_byte((byte) print_byte::b)
(byte~) print_byte::$0 4.0
(byte~) print_byte::$2 4.0
(byte) print_byte::b
(byte) print_byte::b#0 4.0
(byte) print_byte::b#1 4.0
(byte) print_byte::b#2 2.0
(void()) print_char((byte) print_char::ch)
(byte) print_char::ch
(byte) print_char::ch#0 4.0
(byte) print_char::ch#1 4.0
(byte) print_char::ch#3 6.0
(byte*) print_char_cursor
(byte*) print_char_cursor#19 9.5
(byte*) print_char_cursor#20 1.9999999999999998
(byte*) print_char_cursor#26 2.0
(byte*) print_char_cursor#27 4.0
(byte*) print_char_cursor#33 16.5
(byte*) print_line_cursor
(byte*) print_screen
(void()) print_word((word) print_word::w)
(word) print_word::w
(word) print_word::w#0 5.0

Initial phi equivalence classes
[ main::i#12 main::i#2 ]
[ main::sieve_i#2 main::sieve_i#1 ]
[ main::i#10 main::i#3 ]
[ main::j#2 main::j#0 main::j#1 ]
[ main::s#2 main::s#0 main::s#1 ]
[ print_char::ch#3 print_char::ch#0 print_char::ch#1 ]
[ print_char_cursor#19 print_char_cursor#27 print_char_cursor#33 print_char_cursor#20 print_char_cursor#26 ]
[ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
[ memset::dst#2 memset::dst#1 ]
Added variable main::$16 to live range equivalence class [ main::$16 ]
Added variable print_word::w#0 to live range equivalence class [ print_word::w#0 ]
Added variable print_byte::$0 to live range equivalence class [ print_byte::$0 ]
Added variable print_byte::$2 to live range equivalence class [ print_byte::$2 ]
Complete equivalence classes
[ main::i#12 main::i#2 ]
[ main::sieve_i#2 main::sieve_i#1 ]
[ main::i#10 main::i#3 ]
[ main::j#2 main::j#0 main::j#1 ]
[ main::s#2 main::s#0 main::s#1 ]
[ print_char::ch#3 print_char::ch#0 print_char::ch#1 ]
[ print_char_cursor#19 print_char_cursor#27 print_char_cursor#33 print_char_cursor#20 print_char_cursor#26 ]
[ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
[ memset::dst#2 memset::dst#1 ]
[ main::$16 ]
[ print_word::w#0 ]
[ print_byte::$0 ]
[ print_byte::$2 ]
Allocated zp[2]:2 [ main::i#12 main::i#2 ]
Allocated zp[2]:4 [ main::sieve_i#2 main::sieve_i#1 ]
Allocated zp[2]:6 [ main::i#10 main::i#3 ]
Allocated zp[2]:8 [ main::j#2 main::j#0 main::j#1 ]
Allocated zp[2]:10 [ main::s#2 main::s#0 main::s#1 ]
Allocated zp[1]:12 [ print_char::ch#3 print_char::ch#0 print_char::ch#1 ]
Allocated zp[2]:13 [ print_char_cursor#19 print_char_cursor#27 print_char_cursor#33 print_char_cursor#20 print_char_cursor#26 ]
Allocated zp[1]:15 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
Allocated zp[2]:16 [ memset::dst#2 memset::dst#1 ]
Allocated zp[2]:18 [ main::$16 ]
Allocated zp[2]:20 [ print_word::w#0 ]
Allocated zp[1]:22 [ print_byte::$0 ]
Allocated zp[1]:23 [ print_byte::$2 ]

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label SCREEN = $400
  .const COUNT = $4000
  /* Up to what number? */
  .const SQRT_COUNT = $80
  /* Sqrt of COUNT */
  .label sieve = $1000
  .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 i = 2
    .label sieve_i = 4
    .label j = 8
    .label s = $a
    .label i_1 = 6
    .label __16 = $12
    // [5] call memset 
    // [46] phi from main to memset [phi:main->memset]
  memset_from_main:
    jsr memset
    // [6] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [6] phi (byte*) main::sieve_i#2 = (const byte*) sieve+(word) 2 [phi:main->main::@1#0] -- pbuz1=pbuc1 
    lda #<sieve+2
    sta.z sieve_i
    lda #>sieve+2
    sta.z sieve_i+1
    // [6] phi (word) main::i#12 = (word) 2 [phi:main->main::@1#1] -- vwuz1=vwuc1 
    lda #<2
    sta.z i
    lda #>2
    sta.z i+1
    jmp __b1
    // main::@1
  __b1:
    // [7] if((word) main::i#12<(const byte) SQRT_COUNT) goto main::@2 -- vwuz1_lt_vbuc1_then_la1 
    lda.z i+1
    cmp #>SQRT_COUNT
    bcc __b2
    bne !+
    lda.z i
    cmp #<SQRT_COUNT
    bcc __b2
  !:
    // [8] phi from main::@1 to main::@7 [phi:main::@1->main::@7]
  __b7_from___b1:
    // [8] phi (byte*) print_char_cursor#27 = (byte*) 1024 [phi:main::@1->main::@7#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_char_cursor
    lda #>$400
    sta.z print_char_cursor+1
    // [8] phi (word) main::i#10 = (byte) 2 [phi:main::@1->main::@7#1] -- vwuz1=vbuc1 
    lda #<2
    sta.z i_1
    lda #>2
    sta.z i_1+1
    jmp __b7
    // main::@7
  __b7:
    // [9] if((word) main::i#10<(word) $4c7) goto main::@8 -- vwuz1_lt_vwuc1_then_la1 
    lda.z i_1+1
    cmp #>$4c7
    bcc __b8
    bne !+
    lda.z i_1
    cmp #<$4c7
    bcc __b8
  !:
    jmp __b11
    // main::@11
  __b11:
    // [10] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc SCREEN+$3e7
    jmp __b11
    // main::@8
  __b8:
    // [11] (byte*~) main::$16 ← (const byte*) sieve + (word) main::i#10 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z i_1
    clc
    adc #<sieve
    sta.z __16
    lda.z i_1+1
    adc #>sieve
    sta.z __16+1
    // [12] if((byte) 0!=*((byte*~) main::$16)) goto main::@9 -- vbuc1_neq__deref_pbuz1_then_la1 
    ldy #0
    lda (__16),y
    cmp #0
    bne __b9_from___b8
    jmp __b10
    // main::@10
  __b10:
    // [13] (word) print_word::w#0 ← (word) main::i#10 -- vwuz1=vwuz2 
    lda.z i_1
    sta.z print_word.w
    lda.z i_1+1
    sta.z print_word.w+1
    // [14] call print_word 
    jsr print_word
    // [15] phi from main::@10 to main::@12 [phi:main::@10->main::@12]
  __b12_from___b10:
    jmp __b12
    // main::@12
  __b12:
    // [16] call print_char 
    // [29] phi from main::@12 to print_char [phi:main::@12->print_char]
  print_char_from___b12:
    // [29] phi (byte*) print_char_cursor#19 = (byte*) print_char_cursor#20 [phi:main::@12->print_char#0] -- register_copy 
    // [29] phi (byte) print_char::ch#3 = (byte) ' ' [phi:main::@12->print_char#1] -- vbuz1=vbuc1 
    lda #' '
    sta.z print_char.ch
    jsr print_char
    // [17] phi from main::@12 main::@8 to main::@9 [phi:main::@12/main::@8->main::@9]
  __b9_from___b12:
  __b9_from___b8:
    // [17] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#20 [phi:main::@12/main::@8->main::@9#0] -- register_copy 
    jmp __b9
    // main::@9
  __b9:
    // [18] (word) main::i#3 ← ++ (word) main::i#10 -- vwuz1=_inc_vwuz1 
    inc.z i_1
    bne !+
    inc.z i_1+1
  !:
    // [8] phi from main::@9 to main::@7 [phi:main::@9->main::@7]
  __b7_from___b9:
    // [8] phi (byte*) print_char_cursor#27 = (byte*) print_char_cursor#33 [phi:main::@9->main::@7#0] -- register_copy 
    // [8] phi (word) main::i#10 = (word) main::i#3 [phi:main::@9->main::@7#1] -- register_copy 
    jmp __b7
    // main::@2
  __b2:
    // [19] if((byte) 0!=*((byte*) main::sieve_i#2)) goto main::@3 -- vbuc1_neq__deref_pbuz1_then_la1 
    ldy #0
    lda (sieve_i),y
    cmp #0
    bne __b3
    jmp __b6
    // main::@6
  __b6:
    // [20] (word) main::j#0 ← (word) main::i#12 << (byte) 1 -- vwuz1=vwuz2_rol_1 
    lda.z i
    asl
    sta.z j
    lda.z i+1
    rol
    sta.z j+1
    // [21] (byte*) main::s#0 ← (const byte*) sieve + (word) main::j#0 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z j
    clc
    adc #<sieve
    sta.z s
    lda.z j+1
    adc #>sieve
    sta.z s+1
    // [22] phi from main::@5 main::@6 to main::@4 [phi:main::@5/main::@6->main::@4]
  __b4_from___b5:
  __b4_from___b6:
    // [22] phi (byte*) main::s#2 = (byte*) main::s#1 [phi:main::@5/main::@6->main::@4#0] -- register_copy 
    // [22] phi (word) main::j#2 = (word) main::j#1 [phi:main::@5/main::@6->main::@4#1] -- register_copy 
    jmp __b4
    // main::@4
  __b4:
    // [23] if((word) main::j#2<(const word) COUNT) goto main::@5 -- vwuz1_lt_vwuc1_then_la1 
    lda.z j+1
    cmp #>COUNT
    bcc __b5
    bne !+
    lda.z j
    cmp #<COUNT
    bcc __b5
  !:
    jmp __b3
    // main::@3
  __b3:
    // [24] (word) main::i#2 ← ++ (word) main::i#12 -- vwuz1=_inc_vwuz1 
    inc.z i
    bne !+
    inc.z i+1
  !:
    // [25] (byte*) main::sieve_i#1 ← ++ (byte*) main::sieve_i#2 -- pbuz1=_inc_pbuz1 
    inc.z sieve_i
    bne !+
    inc.z sieve_i+1
  !:
    // [6] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
  __b1_from___b3:
    // [6] phi (byte*) main::sieve_i#2 = (byte*) main::sieve_i#1 [phi:main::@3->main::@1#0] -- register_copy 
    // [6] phi (word) main::i#12 = (word) main::i#2 [phi:main::@3->main::@1#1] -- register_copy 
    jmp __b1
    // main::@5
  __b5:
    // [26] *((byte*) main::s#2) ← (byte) 1 -- _deref_pbuz1=vbuc1 
    lda #1
    ldy #0
    sta (s),y
    // [27] (byte*) main::s#1 ← (byte*) main::s#2 + (word) main::i#12 -- pbuz1=pbuz1_plus_vwuz2 
    lda.z s
    clc
    adc.z i
    sta.z s
    lda.z s+1
    adc.z i+1
    sta.z s+1
    // [28] (word) main::j#1 ← (word) main::j#2 + (word) main::i#12 -- vwuz1=vwuz1_plus_vwuz2 
    lda.z j
    clc
    adc.z i
    sta.z j
    lda.z j+1
    adc.z i+1
    sta.z j+1
    jmp __b4_from___b5
}
  // print_char
// Print a single char
// print_char(byte zp($c) ch)
print_char: {
    .label ch = $c
    // [30] *((byte*) print_char_cursor#19) ← (byte) print_char::ch#3 -- _deref_pbuz1=vbuz2 
    lda.z ch
    ldy #0
    sta (print_char_cursor),y
    // [31] (byte*) print_char_cursor#20 ← ++ (byte*) print_char_cursor#19 -- pbuz1=_inc_pbuz1 
    inc.z print_char_cursor
    bne !+
    inc.z print_char_cursor+1
  !:
    jmp __breturn
    // print_char::@return
  __breturn:
    // [32] return 
    rts
}
  // print_word
// Print a word as HEX
// print_word(word zp($14) w)
print_word: {
    .label w = $14
    // [33] (byte) print_byte::b#0 ← > (word) print_word::w#0 -- vbuz1=_hi_vwuz2 
    lda.z w+1
    sta.z print_byte.b
    // [34] call print_byte 
    // [38] phi from print_word to print_byte [phi:print_word->print_byte]
  print_byte_from_print_word:
    // [38] phi (byte*) print_char_cursor#26 = (byte*) print_char_cursor#27 [phi:print_word->print_byte#0] -- register_copy 
    // [38] phi (byte) print_byte::b#2 = (byte) print_byte::b#0 [phi:print_word->print_byte#1] -- register_copy 
    jsr print_byte
    jmp __b1
    // print_word::@1
  __b1:
    // [35] (byte) print_byte::b#1 ← < (word) print_word::w#0 -- vbuz1=_lo_vwuz2 
    lda.z w
    sta.z print_byte.b
    // [36] call print_byte 
    // [38] phi from print_word::@1 to print_byte [phi:print_word::@1->print_byte]
  print_byte_from___b1:
    // [38] phi (byte*) print_char_cursor#26 = (byte*) print_char_cursor#20 [phi:print_word::@1->print_byte#0] -- register_copy 
    // [38] phi (byte) print_byte::b#2 = (byte) print_byte::b#1 [phi:print_word::@1->print_byte#1] -- register_copy 
    jsr print_byte
    jmp __breturn
    // print_word::@return
  __breturn:
    // [37] return 
    rts
}
  // print_byte
// Print a byte as HEX
// print_byte(byte zp($f) b)
print_byte: {
    .label __0 = $16
    .label __2 = $17
    .label b = $f
    // [39] (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
    // [40] (byte) print_char::ch#0 ← *((const byte*) print_hextab + (byte~) print_byte::$0) -- vbuz1=pbuc1_derefidx_vbuz2 
    ldy.z __0
    lda print_hextab,y
    sta.z print_char.ch
    // [41] call print_char 
    // [29] phi from print_byte to print_char [phi:print_byte->print_char]
  print_char_from_print_byte:
    // [29] phi (byte*) print_char_cursor#19 = (byte*) print_char_cursor#26 [phi:print_byte->print_char#0] -- register_copy 
    // [29] phi (byte) print_char::ch#3 = (byte) print_char::ch#0 [phi:print_byte->print_char#1] -- register_copy 
    jsr print_char
    jmp __b1
    // print_byte::@1
  __b1:
    // [42] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f -- vbuz1=vbuz2_band_vbuc1 
    lda #$f
    and.z b
    sta.z __2
    // [43] (byte) print_char::ch#1 ← *((const byte*) print_hextab + (byte~) print_byte::$2) -- vbuz1=pbuc1_derefidx_vbuz2 
    ldy.z __2
    lda print_hextab,y
    sta.z print_char.ch
    // [44] call print_char 
    // [29] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char]
  print_char_from___b1:
    // [29] phi (byte*) print_char_cursor#19 = (byte*) print_char_cursor#20 [phi:print_byte::@1->print_char#0] -- register_copy 
    // [29] phi (byte) print_char::ch#3 = (byte) print_char::ch#1 [phi:print_byte::@1->print_char#1] -- register_copy 
    jsr print_char
    jmp __breturn
    // print_byte::@return
  __breturn:
    // [45] return 
    rts
}
  // memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
memset: {
    .label str = sieve
    .const c = 0
    .label end = str+COUNT
    .label dst = $10
    // [47] phi from memset to memset::@1 [phi:memset->memset::@1]
  __b1_from_memset:
    // [47] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 
    lda #<str
    sta.z dst
    lda #>str
    sta.z dst+1
    jmp __b1
    // memset::@1
  __b1:
    // [48] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda.z dst+1
    cmp #>end
    bne __b2
    lda.z dst
    cmp #<end
    bne __b2
    jmp __breturn
    // memset::@return
  __breturn:
    // [49] return 
    rts
    // memset::@2
  __b2:
    // [50] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1 
    lda #c
    ldy #0
    sta (dst),y
    // [51] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 
    inc.z dst
    bne !+
    inc.z dst+1
  !:
    // [47] phi from memset::@2 to memset::@1 [phi:memset::@2->memset::@1]
  __b1_from___b2:
    // [47] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy 
    jmp __b1
}
  // File Data
  print_hextab: .text "0123456789abcdef"

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] if((word) main::i#12<(const byte) SQRT_COUNT) goto main::@2 [ main::i#12 main::sieve_i#2 ] ( main:2 [ main::i#12 main::sieve_i#2 ] ) always clobbers reg byte a 
Statement [9] if((word) main::i#10<(word) $4c7) goto main::@8 [ main::i#10 print_char_cursor#27 ] ( main:2 [ main::i#10 print_char_cursor#27 ] ) always clobbers reg byte a 
Statement [11] (byte*~) main::$16 ← (const byte*) sieve + (word) main::i#10 [ main::i#10 print_char_cursor#27 main::$16 ] ( main:2 [ main::i#10 print_char_cursor#27 main::$16 ] ) always clobbers reg byte a 
Statement [12] if((byte) 0!=*((byte*~) main::$16)) goto main::@9 [ main::i#10 print_char_cursor#27 ] ( main:2 [ main::i#10 print_char_cursor#27 ] ) always clobbers reg byte a reg byte y 
Statement [13] (word) print_word::w#0 ← (word) main::i#10 [ main::i#10 print_char_cursor#27 print_word::w#0 ] ( main:2 [ main::i#10 print_char_cursor#27 print_word::w#0 ] ) always clobbers reg byte a 
Statement [19] if((byte) 0!=*((byte*) main::sieve_i#2)) goto main::@3 [ main::i#12 main::sieve_i#2 ] ( main:2 [ main::i#12 main::sieve_i#2 ] ) always clobbers reg byte a reg byte y 
Statement [20] (word) main::j#0 ← (word) main::i#12 << (byte) 1 [ main::i#12 main::sieve_i#2 main::j#0 ] ( main:2 [ main::i#12 main::sieve_i#2 main::j#0 ] ) always clobbers reg byte a 
Statement [21] (byte*) main::s#0 ← (const byte*) sieve + (word) main::j#0 [ main::i#12 main::sieve_i#2 main::j#0 main::s#0 ] ( main:2 [ main::i#12 main::sieve_i#2 main::j#0 main::s#0 ] ) always clobbers reg byte a 
Statement [23] if((word) main::j#2<(const word) COUNT) goto main::@5 [ main::i#12 main::sieve_i#2 main::j#2 main::s#2 ] ( main:2 [ main::i#12 main::sieve_i#2 main::j#2 main::s#2 ] ) always clobbers reg byte a 
Statement [26] *((byte*) main::s#2) ← (byte) 1 [ main::i#12 main::sieve_i#2 main::j#2 main::s#2 ] ( main:2 [ main::i#12 main::sieve_i#2 main::j#2 main::s#2 ] ) always clobbers reg byte a reg byte y 
Statement [27] (byte*) main::s#1 ← (byte*) main::s#2 + (word) main::i#12 [ main::i#12 main::sieve_i#2 main::j#2 main::s#1 ] ( main:2 [ main::i#12 main::sieve_i#2 main::j#2 main::s#1 ] ) always clobbers reg byte a 
Statement [28] (word) main::j#1 ← (word) main::j#2 + (word) main::i#12 [ main::i#12 main::sieve_i#2 main::j#1 main::s#1 ] ( main:2 [ main::i#12 main::sieve_i#2 main::j#1 main::s#1 ] ) always clobbers reg byte a 
Statement [30] *((byte*) print_char_cursor#19) ← (byte) print_char::ch#3 [ print_char_cursor#19 ] ( main:2::print_char:16 [ main::i#10 print_char_cursor#19 ] main:2::print_word:14::print_byte:34::print_char:41 [ main::i#10 print_word::w#0 print_byte::b#2 print_char_cursor#19 ] main:2::print_word:14::print_byte:36::print_char:41 [ main::i#10 print_byte::b#2 print_char_cursor#19 ] main:2::print_word:14::print_byte:34::print_char:44 [ main::i#10 print_word::w#0 print_char_cursor#19 ] main:2::print_word:14::print_byte:36::print_char:44 [ main::i#10 print_char_cursor#19 ] ) always clobbers reg byte y 
Removing always clobbered register reg byte y as potential for zp[1]:15 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
Statement [33] (byte) print_byte::b#0 ← > (word) print_word::w#0 [ print_char_cursor#27 print_word::w#0 print_byte::b#0 ] ( main:2::print_word:14 [ main::i#10 print_char_cursor#27 print_word::w#0 print_byte::b#0 ] ) always clobbers reg byte a 
Statement [35] (byte) print_byte::b#1 ← < (word) print_word::w#0 [ print_char_cursor#20 print_byte::b#1 ] ( main:2::print_word:14 [ main::i#10 print_char_cursor#20 print_byte::b#1 ] ) always clobbers reg byte a 
Statement [39] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4 [ print_char_cursor#26 print_byte::b#2 print_byte::$0 ] ( main:2::print_word:14::print_byte:34 [ main::i#10 print_word::w#0 print_char_cursor#26 print_byte::b#2 print_byte::$0 ] main:2::print_word:14::print_byte:36 [ main::i#10 print_char_cursor#26 print_byte::b#2 print_byte::$0 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:15 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
Statement [42] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f [ print_char_cursor#20 print_byte::$2 ] ( main:2::print_word:14::print_byte:34 [ main::i#10 print_word::w#0 print_char_cursor#20 print_byte::$2 ] main:2::print_word:14::print_byte:36 [ main::i#10 print_char_cursor#20 print_byte::$2 ] ) always clobbers reg byte a 
Statement [48] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::memset:5 [ memset::dst#2 ] ) always clobbers reg byte a 
Statement [50] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::memset:5 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y 
Statement [7] if((word) main::i#12<(const byte) SQRT_COUNT) goto main::@2 [ main::i#12 main::sieve_i#2 ] ( main:2 [ main::i#12 main::sieve_i#2 ] ) always clobbers reg byte a 
Statement [9] if((word) main::i#10<(word) $4c7) goto main::@8 [ main::i#10 print_char_cursor#27 ] ( main:2 [ main::i#10 print_char_cursor#27 ] ) always clobbers reg byte a 
Statement [11] (byte*~) main::$16 ← (const byte*) sieve + (word) main::i#10 [ main::i#10 print_char_cursor#27 main::$16 ] ( main:2 [ main::i#10 print_char_cursor#27 main::$16 ] ) always clobbers reg byte a 
Statement [12] if((byte) 0!=*((byte*~) main::$16)) goto main::@9 [ main::i#10 print_char_cursor#27 ] ( main:2 [ main::i#10 print_char_cursor#27 ] ) always clobbers reg byte a reg byte y 
Statement [13] (word) print_word::w#0 ← (word) main::i#10 [ main::i#10 print_char_cursor#27 print_word::w#0 ] ( main:2 [ main::i#10 print_char_cursor#27 print_word::w#0 ] ) always clobbers reg byte a 
Statement [19] if((byte) 0!=*((byte*) main::sieve_i#2)) goto main::@3 [ main::i#12 main::sieve_i#2 ] ( main:2 [ main::i#12 main::sieve_i#2 ] ) always clobbers reg byte a reg byte y 
Statement [20] (word) main::j#0 ← (word) main::i#12 << (byte) 1 [ main::i#12 main::sieve_i#2 main::j#0 ] ( main:2 [ main::i#12 main::sieve_i#2 main::j#0 ] ) always clobbers reg byte a 
Statement [21] (byte*) main::s#0 ← (const byte*) sieve + (word) main::j#0 [ main::i#12 main::sieve_i#2 main::j#0 main::s#0 ] ( main:2 [ main::i#12 main::sieve_i#2 main::j#0 main::s#0 ] ) always clobbers reg byte a 
Statement [23] if((word) main::j#2<(const word) COUNT) goto main::@5 [ main::i#12 main::sieve_i#2 main::j#2 main::s#2 ] ( main:2 [ main::i#12 main::sieve_i#2 main::j#2 main::s#2 ] ) always clobbers reg byte a 
Statement [26] *((byte*) main::s#2) ← (byte) 1 [ main::i#12 main::sieve_i#2 main::j#2 main::s#2 ] ( main:2 [ main::i#12 main::sieve_i#2 main::j#2 main::s#2 ] ) always clobbers reg byte a reg byte y 
Statement [27] (byte*) main::s#1 ← (byte*) main::s#2 + (word) main::i#12 [ main::i#12 main::sieve_i#2 main::j#2 main::s#1 ] ( main:2 [ main::i#12 main::sieve_i#2 main::j#2 main::s#1 ] ) always clobbers reg byte a 
Statement [28] (word) main::j#1 ← (word) main::j#2 + (word) main::i#12 [ main::i#12 main::sieve_i#2 main::j#1 main::s#1 ] ( main:2 [ main::i#12 main::sieve_i#2 main::j#1 main::s#1 ] ) always clobbers reg byte a 
Statement [30] *((byte*) print_char_cursor#19) ← (byte) print_char::ch#3 [ print_char_cursor#19 ] ( main:2::print_char:16 [ main::i#10 print_char_cursor#19 ] main:2::print_word:14::print_byte:34::print_char:41 [ main::i#10 print_word::w#0 print_byte::b#2 print_char_cursor#19 ] main:2::print_word:14::print_byte:36::print_char:41 [ main::i#10 print_byte::b#2 print_char_cursor#19 ] main:2::print_word:14::print_byte:34::print_char:44 [ main::i#10 print_word::w#0 print_char_cursor#19 ] main:2::print_word:14::print_byte:36::print_char:44 [ main::i#10 print_char_cursor#19 ] ) always clobbers reg byte y 
Statement [33] (byte) print_byte::b#0 ← > (word) print_word::w#0 [ print_char_cursor#27 print_word::w#0 print_byte::b#0 ] ( main:2::print_word:14 [ main::i#10 print_char_cursor#27 print_word::w#0 print_byte::b#0 ] ) always clobbers reg byte a 
Statement [35] (byte) print_byte::b#1 ← < (word) print_word::w#0 [ print_char_cursor#20 print_byte::b#1 ] ( main:2::print_word:14 [ main::i#10 print_char_cursor#20 print_byte::b#1 ] ) always clobbers reg byte a 
Statement [39] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4 [ print_char_cursor#26 print_byte::b#2 print_byte::$0 ] ( main:2::print_word:14::print_byte:34 [ main::i#10 print_word::w#0 print_char_cursor#26 print_byte::b#2 print_byte::$0 ] main:2::print_word:14::print_byte:36 [ main::i#10 print_char_cursor#26 print_byte::b#2 print_byte::$0 ] ) always clobbers reg byte a 
Statement [42] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f [ print_char_cursor#20 print_byte::$2 ] ( main:2::print_word:14::print_byte:34 [ main::i#10 print_word::w#0 print_char_cursor#20 print_byte::$2 ] main:2::print_word:14::print_byte:36 [ main::i#10 print_char_cursor#20 print_byte::$2 ] ) always clobbers reg byte a 
Statement [48] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::memset:5 [ memset::dst#2 ] ) always clobbers reg byte a 
Statement [50] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::memset:5 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y 
Potential registers zp[2]:2 [ main::i#12 main::i#2 ] : zp[2]:2 , 
Potential registers zp[2]:4 [ main::sieve_i#2 main::sieve_i#1 ] : zp[2]:4 , 
Potential registers zp[2]:6 [ main::i#10 main::i#3 ] : zp[2]:6 , 
Potential registers zp[2]:8 [ main::j#2 main::j#0 main::j#1 ] : zp[2]:8 , 
Potential registers zp[2]:10 [ main::s#2 main::s#0 main::s#1 ] : zp[2]:10 , 
Potential registers zp[1]:12 [ print_char::ch#3 print_char::ch#0 print_char::ch#1 ] : zp[1]:12 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:13 [ print_char_cursor#19 print_char_cursor#27 print_char_cursor#33 print_char_cursor#20 print_char_cursor#26 ] : zp[2]:13 , 
Potential registers zp[1]:15 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] : zp[1]:15 , reg byte x , 
Potential registers zp[2]:16 [ memset::dst#2 memset::dst#1 ] : zp[2]:16 , 
Potential registers zp[2]:18 [ main::$16 ] : zp[2]:18 , 
Potential registers zp[2]:20 [ print_word::w#0 ] : zp[2]:20 , 
Potential registers zp[1]:22 [ print_byte::$0 ] : zp[1]:22 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:23 [ print_byte::$2 ] : zp[1]:23 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 297: zp[2]:8 [ main::j#2 main::j#0 main::j#1 ] 227.67: zp[2]:10 [ main::s#2 main::s#0 main::s#1 ] 35.6: zp[2]:2 [ main::i#12 main::i#2 ] 28.11: zp[2]:6 [ main::i#10 main::i#3 ] 25: zp[2]:4 [ main::sieve_i#2 main::sieve_i#1 ] 22: zp[2]:18 [ main::$16 ] 
Uplift Scope [memset] 36.67: zp[2]:16 [ memset::dst#2 memset::dst#1 ] 
Uplift Scope [] 34: zp[2]:13 [ print_char_cursor#19 print_char_cursor#27 print_char_cursor#33 print_char_cursor#20 print_char_cursor#26 ] 
Uplift Scope [print_byte] 10: zp[1]:15 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] 4: zp[1]:22 [ print_byte::$0 ] 4: zp[1]:23 [ print_byte::$2 ] 
Uplift Scope [print_char] 14: zp[1]:12 [ print_char::ch#3 print_char::ch#0 print_char::ch#1 ] 
Uplift Scope [print_word] 5: zp[2]:20 [ print_word::w#0 ] 
Uplift Scope [RADIX] 

Uplifting [main] best 10809 combination zp[2]:8 [ main::j#2 main::j#0 main::j#1 ] zp[2]:10 [ main::s#2 main::s#0 main::s#1 ] zp[2]:2 [ main::i#12 main::i#2 ] zp[2]:6 [ main::i#10 main::i#3 ] zp[2]:4 [ main::sieve_i#2 main::sieve_i#1 ] zp[2]:18 [ main::$16 ] 
Uplifting [memset] best 10809 combination zp[2]:16 [ memset::dst#2 memset::dst#1 ] 
Uplifting [] best 10809 combination zp[2]:13 [ print_char_cursor#19 print_char_cursor#27 print_char_cursor#33 print_char_cursor#20 print_char_cursor#26 ] 
Uplifting [print_byte] best 10795 combination reg byte x [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte a [ print_byte::$0 ] reg byte x [ print_byte::$2 ] 
Uplifting [print_char] best 10783 combination reg byte a [ print_char::ch#3 print_char::ch#0 print_char::ch#1 ] 
Uplifting [print_word] best 10783 combination zp[2]:20 [ print_word::w#0 ] 
Uplifting [RADIX] best 10783 combination 
Coalescing zero page register [ zp[2]:6 [ main::i#10 main::i#3 ] ] with [ zp[2]:20 [ print_word::w#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:13 [ print_char_cursor#19 print_char_cursor#27 print_char_cursor#33 print_char_cursor#20 print_char_cursor#26 ] ] with [ zp[2]:2 [ main::i#12 main::i#2 ] ]
Coalescing zero page register [ zp[2]:16 [ memset::dst#2 memset::dst#1 ] ] with [ zp[2]:4 [ main::sieve_i#2 main::sieve_i#1 ] ]
Allocated (was zp[2]:6) zp[2]:2 [ main::i#10 main::i#3 print_word::w#0 ]
Allocated (was zp[2]:8) zp[2]:4 [ main::j#2 main::j#0 main::j#1 ]
Allocated (was zp[2]:10) zp[2]:6 [ main::s#2 main::s#0 main::s#1 ]
Allocated (was zp[2]:13) zp[2]:8 [ print_char_cursor#19 print_char_cursor#27 print_char_cursor#33 print_char_cursor#20 print_char_cursor#26 main::i#12 main::i#2 ]
Allocated (was zp[2]:16) zp[2]:10 [ memset::dst#2 memset::dst#1 main::sieve_i#2 main::sieve_i#1 ]
Allocated (was zp[2]:18) zp[2]:12 [ main::$16 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label SCREEN = $400
  .const COUNT = $4000
  /* Up to what number? */
  .const SQRT_COUNT = $80
  /* Sqrt of COUNT */
  .label sieve = $1000
  .label print_char_cursor = 8
  // @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 i = 8
    .label sieve_i = $a
    .label j = 4
    .label s = 6
    .label i_1 = 2
    .label __16 = $c
    // [5] call memset 
    // [46] phi from main to memset [phi:main->memset]
  memset_from_main:
    jsr memset
    // [6] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [6] phi (byte*) main::sieve_i#2 = (const byte*) sieve+(word) 2 [phi:main->main::@1#0] -- pbuz1=pbuc1 
    lda #<sieve+2
    sta.z sieve_i
    lda #>sieve+2
    sta.z sieve_i+1
    // [6] phi (word) main::i#12 = (word) 2 [phi:main->main::@1#1] -- vwuz1=vwuc1 
    lda #<2
    sta.z i
    lda #>2
    sta.z i+1
    jmp __b1
    // main::@1
  __b1:
    // [7] if((word) main::i#12<(const byte) SQRT_COUNT) goto main::@2 -- vwuz1_lt_vbuc1_then_la1 
    lda.z i+1
    cmp #>SQRT_COUNT
    bcc __b2
    bne !+
    lda.z i
    cmp #<SQRT_COUNT
    bcc __b2
  !:
    // [8] phi from main::@1 to main::@7 [phi:main::@1->main::@7]
  __b7_from___b1:
    // [8] phi (byte*) print_char_cursor#27 = (byte*) 1024 [phi:main::@1->main::@7#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_char_cursor
    lda #>$400
    sta.z print_char_cursor+1
    // [8] phi (word) main::i#10 = (byte) 2 [phi:main::@1->main::@7#1] -- vwuz1=vbuc1 
    lda #<2
    sta.z i_1
    lda #>2
    sta.z i_1+1
    jmp __b7
    // main::@7
  __b7:
    // [9] if((word) main::i#10<(word) $4c7) goto main::@8 -- vwuz1_lt_vwuc1_then_la1 
    lda.z i_1+1
    cmp #>$4c7
    bcc __b8
    bne !+
    lda.z i_1
    cmp #<$4c7
    bcc __b8
  !:
    jmp __b11
    // main::@11
  __b11:
    // [10] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc SCREEN+$3e7
    jmp __b11
    // main::@8
  __b8:
    // [11] (byte*~) main::$16 ← (const byte*) sieve + (word) main::i#10 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z i_1
    clc
    adc #<sieve
    sta.z __16
    lda.z i_1+1
    adc #>sieve
    sta.z __16+1
    // [12] if((byte) 0!=*((byte*~) main::$16)) goto main::@9 -- vbuc1_neq__deref_pbuz1_then_la1 
    ldy #0
    lda (__16),y
    cmp #0
    bne __b9_from___b8
    jmp __b10
    // main::@10
  __b10:
    // [13] (word) print_word::w#0 ← (word) main::i#10
    // [14] call print_word 
    jsr print_word
    // [15] phi from main::@10 to main::@12 [phi:main::@10->main::@12]
  __b12_from___b10:
    jmp __b12
    // main::@12
  __b12:
    // [16] call print_char 
    // [29] phi from main::@12 to print_char [phi:main::@12->print_char]
  print_char_from___b12:
    // [29] phi (byte*) print_char_cursor#19 = (byte*) print_char_cursor#20 [phi:main::@12->print_char#0] -- register_copy 
    // [29] phi (byte) print_char::ch#3 = (byte) ' ' [phi:main::@12->print_char#1] -- vbuaa=vbuc1 
    lda #' '
    jsr print_char
    // [17] phi from main::@12 main::@8 to main::@9 [phi:main::@12/main::@8->main::@9]
  __b9_from___b12:
  __b9_from___b8:
    // [17] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#20 [phi:main::@12/main::@8->main::@9#0] -- register_copy 
    jmp __b9
    // main::@9
  __b9:
    // [18] (word) main::i#3 ← ++ (word) main::i#10 -- vwuz1=_inc_vwuz1 
    inc.z i_1
    bne !+
    inc.z i_1+1
  !:
    // [8] phi from main::@9 to main::@7 [phi:main::@9->main::@7]
  __b7_from___b9:
    // [8] phi (byte*) print_char_cursor#27 = (byte*) print_char_cursor#33 [phi:main::@9->main::@7#0] -- register_copy 
    // [8] phi (word) main::i#10 = (word) main::i#3 [phi:main::@9->main::@7#1] -- register_copy 
    jmp __b7
    // main::@2
  __b2:
    // [19] if((byte) 0!=*((byte*) main::sieve_i#2)) goto main::@3 -- vbuc1_neq__deref_pbuz1_then_la1 
    ldy #0
    lda (sieve_i),y
    cmp #0
    bne __b3
    jmp __b6
    // main::@6
  __b6:
    // [20] (word) main::j#0 ← (word) main::i#12 << (byte) 1 -- vwuz1=vwuz2_rol_1 
    lda.z i
    asl
    sta.z j
    lda.z i+1
    rol
    sta.z j+1
    // [21] (byte*) main::s#0 ← (const byte*) sieve + (word) main::j#0 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z j
    clc
    adc #<sieve
    sta.z s
    lda.z j+1
    adc #>sieve
    sta.z s+1
    // [22] phi from main::@5 main::@6 to main::@4 [phi:main::@5/main::@6->main::@4]
  __b4_from___b5:
  __b4_from___b6:
    // [22] phi (byte*) main::s#2 = (byte*) main::s#1 [phi:main::@5/main::@6->main::@4#0] -- register_copy 
    // [22] phi (word) main::j#2 = (word) main::j#1 [phi:main::@5/main::@6->main::@4#1] -- register_copy 
    jmp __b4
    // main::@4
  __b4:
    // [23] if((word) main::j#2<(const word) COUNT) goto main::@5 -- vwuz1_lt_vwuc1_then_la1 
    lda.z j+1
    cmp #>COUNT
    bcc __b5
    bne !+
    lda.z j
    cmp #<COUNT
    bcc __b5
  !:
    jmp __b3
    // main::@3
  __b3:
    // [24] (word) main::i#2 ← ++ (word) main::i#12 -- vwuz1=_inc_vwuz1 
    inc.z i
    bne !+
    inc.z i+1
  !:
    // [25] (byte*) main::sieve_i#1 ← ++ (byte*) main::sieve_i#2 -- pbuz1=_inc_pbuz1 
    inc.z sieve_i
    bne !+
    inc.z sieve_i+1
  !:
    // [6] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
  __b1_from___b3:
    // [6] phi (byte*) main::sieve_i#2 = (byte*) main::sieve_i#1 [phi:main::@3->main::@1#0] -- register_copy 
    // [6] phi (word) main::i#12 = (word) main::i#2 [phi:main::@3->main::@1#1] -- register_copy 
    jmp __b1
    // main::@5
  __b5:
    // [26] *((byte*) main::s#2) ← (byte) 1 -- _deref_pbuz1=vbuc1 
    lda #1
    ldy #0
    sta (s),y
    // [27] (byte*) main::s#1 ← (byte*) main::s#2 + (word) main::i#12 -- pbuz1=pbuz1_plus_vwuz2 
    lda.z s
    clc
    adc.z i
    sta.z s
    lda.z s+1
    adc.z i+1
    sta.z s+1
    // [28] (word) main::j#1 ← (word) main::j#2 + (word) main::i#12 -- vwuz1=vwuz1_plus_vwuz2 
    lda.z j
    clc
    adc.z i
    sta.z j
    lda.z j+1
    adc.z i+1
    sta.z j+1
    jmp __b4_from___b5
}
  // print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
    // [30] *((byte*) print_char_cursor#19) ← (byte) print_char::ch#3 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (print_char_cursor),y
    // [31] (byte*) print_char_cursor#20 ← ++ (byte*) print_char_cursor#19 -- pbuz1=_inc_pbuz1 
    inc.z print_char_cursor
    bne !+
    inc.z print_char_cursor+1
  !:
    jmp __breturn
    // print_char::@return
  __breturn:
    // [32] return 
    rts
}
  // print_word
// Print a word as HEX
// print_word(word zp(2) w)
print_word: {
    .label w = 2
    // [33] (byte) print_byte::b#0 ← > (word) print_word::w#0 -- vbuxx=_hi_vwuz1 
    lda.z w+1
    tax
    // [34] call print_byte 
    // [38] phi from print_word to print_byte [phi:print_word->print_byte]
  print_byte_from_print_word:
    // [38] phi (byte*) print_char_cursor#26 = (byte*) print_char_cursor#27 [phi:print_word->print_byte#0] -- register_copy 
    // [38] phi (byte) print_byte::b#2 = (byte) print_byte::b#0 [phi:print_word->print_byte#1] -- register_copy 
    jsr print_byte
    jmp __b1
    // print_word::@1
  __b1:
    // [35] (byte) print_byte::b#1 ← < (word) print_word::w#0 -- vbuxx=_lo_vwuz1 
    lda.z w
    tax
    // [36] call print_byte 
    // [38] phi from print_word::@1 to print_byte [phi:print_word::@1->print_byte]
  print_byte_from___b1:
    // [38] phi (byte*) print_char_cursor#26 = (byte*) print_char_cursor#20 [phi:print_word::@1->print_byte#0] -- register_copy 
    // [38] phi (byte) print_byte::b#2 = (byte) print_byte::b#1 [phi:print_word::@1->print_byte#1] -- register_copy 
    jsr print_byte
    jmp __breturn
    // print_word::@return
  __breturn:
    // [37] return 
    rts
}
  // print_byte
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
    // [39] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4 -- vbuaa=vbuxx_ror_4 
    txa
    lsr
    lsr
    lsr
    lsr
    // [40] (byte) print_char::ch#0 ← *((const byte*) print_hextab + (byte~) print_byte::$0) -- vbuaa=pbuc1_derefidx_vbuaa 
    tay
    lda print_hextab,y
    // [41] call print_char 
    // [29] phi from print_byte to print_char [phi:print_byte->print_char]
  print_char_from_print_byte:
    // [29] phi (byte*) print_char_cursor#19 = (byte*) print_char_cursor#26 [phi:print_byte->print_char#0] -- register_copy 
    // [29] phi (byte) print_char::ch#3 = (byte) print_char::ch#0 [phi:print_byte->print_char#1] -- register_copy 
    jsr print_char
    jmp __b1
    // print_byte::@1
  __b1:
    // [42] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f -- vbuxx=vbuxx_band_vbuc1 
    lda #$f
    axs #0
    // [43] (byte) print_char::ch#1 ← *((const byte*) print_hextab + (byte~) print_byte::$2) -- vbuaa=pbuc1_derefidx_vbuxx 
    lda print_hextab,x
    // [44] call print_char 
    // [29] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char]
  print_char_from___b1:
    // [29] phi (byte*) print_char_cursor#19 = (byte*) print_char_cursor#20 [phi:print_byte::@1->print_char#0] -- register_copy 
    // [29] phi (byte) print_char::ch#3 = (byte) print_char::ch#1 [phi:print_byte::@1->print_char#1] -- register_copy 
    jsr print_char
    jmp __breturn
    // print_byte::@return
  __breturn:
    // [45] return 
    rts
}
  // memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
memset: {
    .label str = sieve
    .const c = 0
    .label end = str+COUNT
    .label dst = $a
    // [47] phi from memset to memset::@1 [phi:memset->memset::@1]
  __b1_from_memset:
    // [47] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 
    lda #<str
    sta.z dst
    lda #>str
    sta.z dst+1
    jmp __b1
    // memset::@1
  __b1:
    // [48] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda.z dst+1
    cmp #>end
    bne __b2
    lda.z dst
    cmp #<end
    bne __b2
    jmp __breturn
    // memset::@return
  __breturn:
    // [49] return 
    rts
    // memset::@2
  __b2:
    // [50] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1 
    lda #c
    ldy #0
    sta (dst),y
    // [51] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 
    inc.z dst
    bne !+
    inc.z dst+1
  !:
    // [47] phi from memset::@2 to memset::@1 [phi:memset::@2->memset::@1]
  __b1_from___b2:
    // [47] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy 
    jmp __b1
}
  // File Data
  print_hextab: .text "0123456789abcdef"

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __bend
Removing instruction jmp __b1
Removing instruction jmp __b7
Removing instruction jmp __b11
Removing instruction jmp __b10
Removing instruction jmp __b12
Removing instruction jmp __b9
Removing instruction jmp __b6
Removing instruction jmp __b4
Removing instruction jmp __b3
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __bbegin with __b1
Replacing label __b9_from___b8 with __b9
Replacing label __b4_from___b5 with __b4
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Removing instruction __b12_from___b10:
Removing instruction print_char_from___b12:
Removing instruction __b9_from___b12:
Removing instruction __b9_from___b8:
Removing instruction __b4_from___b5:
Removing instruction __b4_from___b6:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bend:
Removing instruction memset_from_main:
Removing instruction __b1_from_main:
Removing instruction __b7_from___b1:
Removing instruction __b10:
Removing instruction __b12:
Removing instruction __b7_from___b9:
Removing instruction __b6:
Removing instruction __b1_from___b3:
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 __b1_from_memset:
Removing instruction __breturn:
Removing instruction __b1_from___b2:
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 word) COUNT = (word) $4000
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10
(const byte) RADIX::OCTAL = (number) 8
(const byte*) SCREEN = (byte*) 1024
(const byte) SQRT_COUNT = (byte) $80
(void()) main()
(byte*~) main::$16 zp[2]:12 22.0
(label) main::@1
(label) main::@10
(label) main::@11
(label) main::@12
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@8
(label) main::@9
(word) main::i
(word) main::i#10 i_1 zp[2]:2 6.111111111111112
(word) main::i#12 i zp[2]:8 24.6
(word) main::i#2 i zp[2]:8 11.0
(word) main::i#3 i_1 zp[2]:2 22.0
(word) main::j
(word) main::j#0 j zp[2]:4 16.5
(word) main::j#1 j zp[2]:4 202.0
(word) main::j#2 j zp[2]:4 78.5
(byte*) main::s
(byte*) main::s#0 s zp[2]:6 22.0
(byte*) main::s#1 s zp[2]:6 101.0
(byte*) main::s#2 s zp[2]:6 104.66666666666666
(byte*) main::sieve_i
(byte*) main::sieve_i#1 sieve_i zp[2]:10 22.0
(byte*) main::sieve_i#2 sieve_i zp[2]:10 3.0
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@2
(label) memset::@return
(byte) memset::c
(const byte) memset::c#0 c = (byte) 0
(byte*) memset::dst
(byte*) memset::dst#1 dst zp[2]:10 22.0
(byte*) memset::dst#2 dst zp[2]:10 14.666666666666666
(byte*) memset::end
(const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) COUNT
(word) memset::num
(void*) memset::return
(void*) memset::str
(const void*) memset::str#0 str = (void*)(const byte*) sieve
(void()) print_byte((byte) print_byte::b)
(byte~) print_byte::$0 reg byte a 4.0
(byte~) print_byte::$2 reg byte x 4.0
(label) print_byte::@1
(label) print_byte::@return
(byte) print_byte::b
(byte) print_byte::b#0 reg byte x 4.0
(byte) print_byte::b#1 reg byte x 4.0
(byte) print_byte::b#2 reg byte x 2.0
(void()) print_char((byte) print_char::ch)
(label) print_char::@return
(byte) print_char::ch
(byte) print_char::ch#0 reg byte a 4.0
(byte) print_char::ch#1 reg byte a 4.0
(byte) print_char::ch#3 reg byte a 6.0
(byte*) print_char_cursor
(byte*) print_char_cursor#19 print_char_cursor zp[2]:8 9.5
(byte*) print_char_cursor#20 print_char_cursor zp[2]:8 1.9999999999999998
(byte*) print_char_cursor#26 print_char_cursor zp[2]:8 2.0
(byte*) print_char_cursor#27 print_char_cursor zp[2]:8 4.0
(byte*) print_char_cursor#33 print_char_cursor zp[2]:8 16.5
(const byte*) print_hextab[]  = (byte*) "0123456789abcdef"z
(byte*) print_line_cursor
(byte*) print_screen
(void()) print_word((word) print_word::w)
(label) print_word::@1
(label) print_word::@return
(word) print_word::w
(word) print_word::w#0 w zp[2]:2 5.0
(const byte*) sieve = (byte*) 4096

zp[2]:2 [ main::i#10 main::i#3 print_word::w#0 ]
zp[2]:4 [ main::j#2 main::j#0 main::j#1 ]
zp[2]:6 [ main::s#2 main::s#0 main::s#1 ]
reg byte a [ print_char::ch#3 print_char::ch#0 print_char::ch#1 ]
zp[2]:8 [ print_char_cursor#19 print_char_cursor#27 print_char_cursor#33 print_char_cursor#20 print_char_cursor#26 main::i#12 main::i#2 ]
reg byte x [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
zp[2]:10 [ memset::dst#2 memset::dst#1 main::sieve_i#2 main::sieve_i#1 ]
zp[2]:12 [ main::$16 ]
reg byte a [ print_byte::$0 ]
reg byte x [ print_byte::$2 ]


FINAL ASSEMBLER
Score: 9766

  // File Comments
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .label SCREEN = $400
  .const COUNT = $4000
  /* Up to what number? */
  .const SQRT_COUNT = $80
  /* Sqrt of COUNT */
  .label sieve = $1000
  .label print_char_cursor = 8
  // @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 i = 8
    .label sieve_i = $a
    .label j = 4
    .label s = 6
    .label i_1 = 2
    .label __16 = $c
    // memset(sieve, 0, COUNT)
    // [5] call memset 
    // [46] phi from main to memset [phi:main->memset]
    jsr memset
    // [6] phi from main to main::@1 [phi:main->main::@1]
    // [6] phi (byte*) main::sieve_i#2 = (const byte*) sieve+(word) 2 [phi:main->main::@1#0] -- pbuz1=pbuc1 
    lda #<sieve+2
    sta.z sieve_i
    lda #>sieve+2
    sta.z sieve_i+1
    // [6] phi (word) main::i#12 = (word) 2 [phi:main->main::@1#1] -- vwuz1=vwuc1 
    lda #<2
    sta.z i
    lda #>2
    sta.z i+1
    // main::@1
  __b1:
    // while (i < SQRT_COUNT)
    // [7] if((word) main::i#12<(const byte) SQRT_COUNT) goto main::@2 -- vwuz1_lt_vbuc1_then_la1 
    lda.z i+1
    cmp #>SQRT_COUNT
    bcc __b2
    bne !+
    lda.z i
    cmp #<SQRT_COUNT
    bcc __b2
  !:
    // [8] phi from main::@1 to main::@7 [phi:main::@1->main::@7]
    // [8] phi (byte*) print_char_cursor#27 = (byte*) 1024 [phi:main::@1->main::@7#0] -- pbuz1=pbuc1 
    lda #<$400
    sta.z print_char_cursor
    lda #>$400
    sta.z print_char_cursor+1
    // [8] phi (word) main::i#10 = (byte) 2 [phi:main::@1->main::@7#1] -- vwuz1=vbuc1 
    lda #<2
    sta.z i_1
    lda #>2
    sta.z i_1+1
    // main::@7
  __b7:
    // for (i = 2; i < 0x04c7; ++i)
    // [9] if((word) main::i#10<(word) $4c7) goto main::@8 -- vwuz1_lt_vwuc1_then_la1 
    lda.z i_1+1
    cmp #>$4c7
    bcc __b8
    bne !+
    lda.z i_1
    cmp #<$4c7
    bcc __b8
  !:
    // main::@11
  __b11:
    // (*(SCREEN+999))++;
    // [10] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc SCREEN+$3e7
    jmp __b11
    // main::@8
  __b8:
    // if (!sieve[i])
    // [11] (byte*~) main::$16 ← (const byte*) sieve + (word) main::i#10 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z i_1
    clc
    adc #<sieve
    sta.z __16
    lda.z i_1+1
    adc #>sieve
    sta.z __16+1
    // [12] if((byte) 0!=*((byte*~) main::$16)) goto main::@9 -- vbuc1_neq__deref_pbuz1_then_la1 
    ldy #0
    lda (__16),y
    cmp #0
    bne __b9
    // main::@10
    // print_word(i)
    // [13] (word) print_word::w#0 ← (word) main::i#10
    // [14] call print_word 
    jsr print_word
    // [15] phi from main::@10 to main::@12 [phi:main::@10->main::@12]
    // main::@12
    // print_char(' ')
    // [16] call print_char 
    // [29] phi from main::@12 to print_char [phi:main::@12->print_char]
    // [29] phi (byte*) print_char_cursor#19 = (byte*) print_char_cursor#20 [phi:main::@12->print_char#0] -- register_copy 
    // [29] phi (byte) print_char::ch#3 = (byte) ' ' [phi:main::@12->print_char#1] -- vbuaa=vbuc1 
    lda #' '
    jsr print_char
    // [17] phi from main::@12 main::@8 to main::@9 [phi:main::@12/main::@8->main::@9]
    // [17] phi (byte*) print_char_cursor#33 = (byte*) print_char_cursor#20 [phi:main::@12/main::@8->main::@9#0] -- register_copy 
    // main::@9
  __b9:
    // for (i = 2; i < 0x04c7; ++i)
    // [18] (word) main::i#3 ← ++ (word) main::i#10 -- vwuz1=_inc_vwuz1 
    inc.z i_1
    bne !+
    inc.z i_1+1
  !:
    // [8] phi from main::@9 to main::@7 [phi:main::@9->main::@7]
    // [8] phi (byte*) print_char_cursor#27 = (byte*) print_char_cursor#33 [phi:main::@9->main::@7#0] -- register_copy 
    // [8] phi (word) main::i#10 = (word) main::i#3 [phi:main::@9->main::@7#1] -- register_copy 
    jmp __b7
    // main::@2
  __b2:
    // if (!*sieve_i)
    // [19] if((byte) 0!=*((byte*) main::sieve_i#2)) goto main::@3 -- vbuc1_neq__deref_pbuz1_then_la1 
    ldy #0
    lda (sieve_i),y
    cmp #0
    bne __b3
    // main::@6
    // j = i*2
    // [20] (word) main::j#0 ← (word) main::i#12 << (byte) 1 -- vwuz1=vwuz2_rol_1 
    lda.z i
    asl
    sta.z j
    lda.z i+1
    rol
    sta.z j+1
    // s = &sieve[j]
    // [21] (byte*) main::s#0 ← (const byte*) sieve + (word) main::j#0 -- pbuz1=pbuc1_plus_vwuz2 
    lda.z j
    clc
    adc #<sieve
    sta.z s
    lda.z j+1
    adc #>sieve
    sta.z s+1
    // [22] phi from main::@5 main::@6 to main::@4 [phi:main::@5/main::@6->main::@4]
    // [22] phi (byte*) main::s#2 = (byte*) main::s#1 [phi:main::@5/main::@6->main::@4#0] -- register_copy 
    // [22] phi (word) main::j#2 = (word) main::j#1 [phi:main::@5/main::@6->main::@4#1] -- register_copy 
    // main::@4
  __b4:
    // while (j < COUNT)
    // [23] if((word) main::j#2<(const word) COUNT) goto main::@5 -- vwuz1_lt_vwuc1_then_la1 
    lda.z j+1
    cmp #>COUNT
    bcc __b5
    bne !+
    lda.z j
    cmp #<COUNT
    bcc __b5
  !:
    // main::@3
  __b3:
    // i++;
    // [24] (word) main::i#2 ← ++ (word) main::i#12 -- vwuz1=_inc_vwuz1 
    inc.z i
    bne !+
    inc.z i+1
  !:
    // sieve_i++;
    // [25] (byte*) main::sieve_i#1 ← ++ (byte*) main::sieve_i#2 -- pbuz1=_inc_pbuz1 
    inc.z sieve_i
    bne !+
    inc.z sieve_i+1
  !:
    // [6] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
    // [6] phi (byte*) main::sieve_i#2 = (byte*) main::sieve_i#1 [phi:main::@3->main::@1#0] -- register_copy 
    // [6] phi (word) main::i#12 = (word) main::i#2 [phi:main::@3->main::@1#1] -- register_copy 
    jmp __b1
    // main::@5
  __b5:
    // *s = 1
    // [26] *((byte*) main::s#2) ← (byte) 1 -- _deref_pbuz1=vbuc1 
    lda #1
    ldy #0
    sta (s),y
    // s += i
    // [27] (byte*) main::s#1 ← (byte*) main::s#2 + (word) main::i#12 -- pbuz1=pbuz1_plus_vwuz2 
    lda.z s
    clc
    adc.z i
    sta.z s
    lda.z s+1
    adc.z i+1
    sta.z s+1
    // j += i
    // [28] (word) main::j#1 ← (word) main::j#2 + (word) main::i#12 -- vwuz1=vwuz1_plus_vwuz2 
    lda.z j
    clc
    adc.z i
    sta.z j
    lda.z j+1
    adc.z i+1
    sta.z j+1
    jmp __b4
}
  // print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
    // *(print_char_cursor++) = ch
    // [30] *((byte*) print_char_cursor#19) ← (byte) print_char::ch#3 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (print_char_cursor),y
    // *(print_char_cursor++) = ch;
    // [31] (byte*) print_char_cursor#20 ← ++ (byte*) print_char_cursor#19 -- pbuz1=_inc_pbuz1 
    inc.z print_char_cursor
    bne !+
    inc.z print_char_cursor+1
  !:
    // print_char::@return
    // }
    // [32] return 
    rts
}
  // print_word
// Print a word as HEX
// print_word(word zp(2) w)
print_word: {
    .label w = 2
    // print_byte(>w)
    // [33] (byte) print_byte::b#0 ← > (word) print_word::w#0 -- vbuxx=_hi_vwuz1 
    lda.z w+1
    tax
    // [34] call print_byte 
    // [38] phi from print_word to print_byte [phi:print_word->print_byte]
    // [38] phi (byte*) print_char_cursor#26 = (byte*) print_char_cursor#27 [phi:print_word->print_byte#0] -- register_copy 
    // [38] phi (byte) print_byte::b#2 = (byte) print_byte::b#0 [phi:print_word->print_byte#1] -- register_copy 
    jsr print_byte
    // print_word::@1
    // print_byte(<w)
    // [35] (byte) print_byte::b#1 ← < (word) print_word::w#0 -- vbuxx=_lo_vwuz1 
    lda.z w
    tax
    // [36] call print_byte 
    // [38] phi from print_word::@1 to print_byte [phi:print_word::@1->print_byte]
    // [38] phi (byte*) print_char_cursor#26 = (byte*) print_char_cursor#20 [phi:print_word::@1->print_byte#0] -- register_copy 
    // [38] phi (byte) print_byte::b#2 = (byte) print_byte::b#1 [phi:print_word::@1->print_byte#1] -- register_copy 
    jsr print_byte
    // print_word::@return
    // }
    // [37] return 
    rts
}
  // print_byte
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
    // b>>4
    // [39] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4 -- vbuaa=vbuxx_ror_4 
    txa
    lsr
    lsr
    lsr
    lsr
    // print_char(print_hextab[b>>4])
    // [40] (byte) print_char::ch#0 ← *((const byte*) print_hextab + (byte~) print_byte::$0) -- vbuaa=pbuc1_derefidx_vbuaa 
    tay
    lda print_hextab,y
    // [41] call print_char 
    // [29] phi from print_byte to print_char [phi:print_byte->print_char]
    // [29] phi (byte*) print_char_cursor#19 = (byte*) print_char_cursor#26 [phi:print_byte->print_char#0] -- register_copy 
    // [29] phi (byte) print_char::ch#3 = (byte) print_char::ch#0 [phi:print_byte->print_char#1] -- register_copy 
    jsr print_char
    // print_byte::@1
    // b&$f
    // [42] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f -- vbuxx=vbuxx_band_vbuc1 
    lda #$f
    axs #0
    // print_char(print_hextab[b&$f])
    // [43] (byte) print_char::ch#1 ← *((const byte*) print_hextab + (byte~) print_byte::$2) -- vbuaa=pbuc1_derefidx_vbuxx 
    lda print_hextab,x
    // [44] call print_char 
    // [29] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char]
    // [29] phi (byte*) print_char_cursor#19 = (byte*) print_char_cursor#20 [phi:print_byte::@1->print_char#0] -- register_copy 
    // [29] phi (byte) print_char::ch#3 = (byte) print_char::ch#1 [phi:print_byte::@1->print_char#1] -- register_copy 
    jsr print_char
    // print_byte::@return
    // }
    // [45] return 
    rts
}
  // memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
memset: {
    .label str = sieve
    .const c = 0
    .label end = str+COUNT
    .label dst = $a
    // [47] phi from memset to memset::@1 [phi:memset->memset::@1]
    // [47] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 
    lda #<str
    sta.z dst
    lda #>str
    sta.z dst+1
    // memset::@1
  __b1:
    // for(char* dst = str; dst!=end; dst++)
    // [48] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda.z dst+1
    cmp #>end
    bne __b2
    lda.z dst
    cmp #<end
    bne __b2
    // memset::@return
    // }
    // [49] return 
    rts
    // memset::@2
  __b2:
    // *dst = c
    // [50] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1 
    lda #c
    ldy #0
    sta (dst),y
    // for(char* dst = str; dst!=end; dst++)
    // [51] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 
    inc.z dst
    bne !+
    inc.z dst+1
  !:
    // [47] phi from memset::@2 to memset::@1 [phi:memset::@2->memset::@1]
    // [47] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy 
    jmp __b1
}
  // File Data
  print_hextab: .text "0123456789abcdef"

