Inlined call call __init Eliminating unused variable with no statement div16u8u::$1 Eliminating unused variable with no statement div16u8u::$3 Eliminating unused variable with no statement div16u8u::$4 CONTROL FLOW GRAPH SSA void print_str(char *str) print_str: scope:[print_str] from print_uint_decimal::@1 print_char_cursor#28 = phi( print_uint_decimal::@1/print_char_cursor#25 ) print_str::str#5 = phi( print_uint_decimal::@1/print_str::str#1 ) to:print_str::@1 print_str::@1: scope:[print_str] from print_str print_str::@3 print_char_cursor#24 = phi( print_str/print_char_cursor#28, print_str::@3/print_char_cursor#0 ) print_str::str#2 = phi( print_str/print_str::str#5, print_str::@3/print_str::str#0 ) print_str::$1 = 0 != *print_str::str#2 if(print_str::$1) goto print_str::@2 to:print_str::@return print_str::@2: scope:[print_str] from print_str::@1 print_char_cursor#23 = phi( print_str::@1/print_char_cursor#24 ) print_str::str#3 = phi( print_str::@1/print_str::str#2 ) print_char::ch#0 = *print_str::str#3 call print_char to:print_str::@3 print_str::@3: scope:[print_str] from print_str::@2 print_str::str#4 = phi( print_str::@2/print_str::str#3 ) print_char_cursor#12 = phi( print_str::@2/print_char_cursor#5 ) print_char_cursor#0 = print_char_cursor#12 print_str::str#0 = ++ print_str::str#4 to:print_str::@1 print_str::@return: scope:[print_str] from print_str::@1 print_char_cursor#13 = phi( print_str::@1/print_char_cursor#24 ) print_char_cursor#1 = print_char_cursor#13 return to:@return void print_uint_decimal(unsigned int w) print_uint_decimal: scope:[print_uint_decimal] from main::@6 print_char_cursor#29 = phi( main::@6/print_char_cursor#26 ) print_uint_decimal::w#1 = phi( main::@6/print_uint_decimal::w#0 ) utoa::value#0 = print_uint_decimal::w#1 utoa::buffer#0 = decimal_digits utoa::radix#0 = DECIMAL call utoa to:print_uint_decimal::@1 print_uint_decimal::@1: scope:[print_uint_decimal] from print_uint_decimal print_char_cursor#25 = phi( print_uint_decimal/print_char_cursor#29 ) print_str::str#1 = decimal_digits call print_str to:print_uint_decimal::@2 print_uint_decimal::@2: scope:[print_uint_decimal] from print_uint_decimal::@1 print_char_cursor#14 = phi( print_uint_decimal::@1/print_char_cursor#1 ) print_char_cursor#2 = print_char_cursor#14 to:print_uint_decimal::@return print_uint_decimal::@return: scope:[print_uint_decimal] from print_uint_decimal::@2 print_char_cursor#15 = phi( print_uint_decimal::@2/print_char_cursor#2 ) print_char_cursor#3 = print_char_cursor#15 return to:@return void print_char(char ch) print_char: scope:[print_char] from main::@10 print_str::@2 print_char_cursor#16 = phi( main::@10/print_char_cursor#6, print_str::@2/print_char_cursor#23 ) print_char::ch#2 = phi( main::@10/print_char::ch#1, print_str::@2/print_char::ch#0 ) *print_char_cursor#16 = print_char::ch#2 print_char_cursor#4 = ++ print_char_cursor#16 to:print_char::@return print_char::@return: scope:[print_char] from print_char print_char_cursor#17 = phi( print_char/print_char_cursor#4 ) print_char_cursor#5 = print_char_cursor#17 return to:@return void utoa(unsigned int value , char *buffer , char radix) utoa: scope:[utoa] from print_uint_decimal utoa::buffer#21 = phi( print_uint_decimal/utoa::buffer#0 ) utoa::value#12 = phi( print_uint_decimal/utoa::value#0 ) utoa::radix#1 = phi( print_uint_decimal/utoa::radix#0 ) utoa::max_digits#0 = 0 utoa::digit_values#0 = (unsigned int *) 0 utoa::$0 = utoa::radix#1 == DECIMAL if(utoa::$0) goto utoa::@1 to:utoa::@6 utoa::@1: scope:[utoa] from utoa utoa::buffer#17 = phi( utoa/utoa::buffer#21 ) utoa::value#8 = phi( utoa/utoa::value#12 ) utoa::max_digits#1 = 5 utoa::digit_values#1 = RADIX_DECIMAL_VALUES to:utoa::@5 utoa::@6: scope:[utoa] from utoa utoa::value#13 = phi( utoa/utoa::value#12 ) utoa::buffer#16 = phi( utoa/utoa::buffer#21 ) utoa::radix#2 = phi( utoa/utoa::radix#1 ) utoa::$1 = utoa::radix#2 == HEXADECIMAL if(utoa::$1) goto utoa::@2 to:utoa::@7 utoa::@2: scope:[utoa] from utoa::@6 utoa::buffer#18 = phi( utoa::@6/utoa::buffer#16 ) utoa::value#9 = phi( utoa::@6/utoa::value#13 ) utoa::max_digits#2 = 4 utoa::digit_values#2 = RADIX_HEXADECIMAL_VALUES to:utoa::@5 utoa::@7: scope:[utoa] from utoa::@6 utoa::value#14 = phi( utoa::@6/utoa::value#13 ) utoa::buffer#13 = phi( utoa::@6/utoa::buffer#16 ) utoa::radix#3 = phi( utoa::@6/utoa::radix#2 ) utoa::$2 = utoa::radix#3 == OCTAL if(utoa::$2) goto utoa::@3 to:utoa::@8 utoa::@3: scope:[utoa] from utoa::@7 utoa::buffer#19 = phi( utoa::@7/utoa::buffer#13 ) utoa::value#10 = phi( utoa::@7/utoa::value#14 ) utoa::max_digits#3 = 6 utoa::digit_values#3 = RADIX_OCTAL_VALUES to:utoa::@5 utoa::@8: scope:[utoa] from utoa::@7 utoa::value#15 = phi( utoa::@7/utoa::value#14 ) utoa::buffer#10 = phi( utoa::@7/utoa::buffer#13 ) utoa::radix#4 = phi( utoa::@7/utoa::radix#3 ) utoa::$3 = utoa::radix#4 == BINARY if(utoa::$3) goto utoa::@4 to:utoa::@9 utoa::@4: scope:[utoa] from utoa::@8 utoa::buffer#20 = phi( utoa::@8/utoa::buffer#10 ) utoa::value#11 = phi( utoa::@8/utoa::value#15 ) utoa::max_digits#4 = $10 utoa::digit_values#4 = RADIX_BINARY_VALUES to:utoa::@5 utoa::@9: scope:[utoa] from utoa::@8 utoa::buffer#6 = phi( utoa::@8/utoa::buffer#10 ) *utoa::buffer#6 = 'e' utoa::buffer#1 = ++ utoa::buffer#6 *utoa::buffer#1 = 'r' utoa::buffer#2 = ++ utoa::buffer#1 *utoa::buffer#2 = 'r' utoa::buffer#3 = ++ utoa::buffer#2 *utoa::buffer#3 = 0 to:utoa::@return utoa::@return: scope:[utoa] from utoa::@12 utoa::@9 return to:@return utoa::@5: scope:[utoa] from utoa::@1 utoa::@2 utoa::@3 utoa::@4 utoa::buffer#15 = phi( utoa::@1/utoa::buffer#17, utoa::@2/utoa::buffer#18, utoa::@3/utoa::buffer#19, utoa::@4/utoa::buffer#20 ) utoa::value#7 = phi( utoa::@1/utoa::value#8, utoa::@2/utoa::value#9, utoa::@3/utoa::value#10, utoa::@4/utoa::value#11 ) utoa::digit_values#8 = phi( utoa::@1/utoa::digit_values#1, utoa::@2/utoa::digit_values#2, utoa::@3/utoa::digit_values#3, utoa::@4/utoa::digit_values#4 ) utoa::max_digits#7 = phi( utoa::@1/utoa::max_digits#1, utoa::@2/utoa::max_digits#2, utoa::@3/utoa::max_digits#3, utoa::@4/utoa::max_digits#4 ) utoa::started#0 = 0 utoa::digit#0 = 0 to:utoa::@10 utoa::@10: scope:[utoa] from utoa::@13 utoa::@5 utoa::buffer#11 = phi( utoa::@13/utoa::buffer#14, utoa::@5/utoa::buffer#15 ) utoa::started#3 = phi( utoa::@13/utoa::started#4, utoa::@5/utoa::started#0 ) utoa::value#5 = phi( utoa::@13/utoa::value#6, utoa::@5/utoa::value#7 ) utoa::digit_values#6 = phi( utoa::@13/utoa::digit_values#7, utoa::@5/utoa::digit_values#8 ) utoa::digit#2 = phi( utoa::@13/utoa::digit#1, utoa::@5/utoa::digit#0 ) utoa::max_digits#5 = phi( utoa::@13/utoa::max_digits#6, utoa::@5/utoa::max_digits#7 ) utoa::$4 = utoa::max_digits#5 - 1 utoa::$5 = utoa::digit#2 < utoa::$4 if(utoa::$5) goto utoa::@11 to:utoa::@12 utoa::@11: scope:[utoa] from utoa::@10 utoa::max_digits#8 = phi( utoa::@10/utoa::max_digits#5 ) utoa::buffer#12 = phi( utoa::@10/utoa::buffer#11 ) utoa::started#2 = phi( utoa::@10/utoa::started#3 ) utoa::value#2 = phi( utoa::@10/utoa::value#5 ) utoa::digit_values#5 = phi( utoa::@10/utoa::digit_values#6 ) utoa::digit#3 = phi( utoa::@10/utoa::digit#2 ) utoa::$10 = utoa::digit#3 * SIZEOF_UNSIGNED_INT utoa::digit_value#0 = utoa::digit_values#5[utoa::$10] utoa::$6 = utoa::value#2 >= utoa::digit_value#0 utoa::$7 = utoa::started#2 || utoa::$6 utoa::$8 = ! utoa::$7 if(utoa::$8) goto utoa::@13 to:utoa::@14 utoa::@12: scope:[utoa] from utoa::@10 utoa::buffer#7 = phi( utoa::@10/utoa::buffer#11 ) utoa::value#3 = phi( utoa::@10/utoa::value#5 ) utoa::$11 = (char)utoa::value#3 *utoa::buffer#7 = DIGITS[utoa::$11] utoa::buffer#4 = ++ utoa::buffer#7 *utoa::buffer#4 = 0 to:utoa::@return utoa::@13: scope:[utoa] from utoa::@11 utoa::@15 utoa::buffer#14 = phi( utoa::@11/utoa::buffer#12, utoa::@15/utoa::buffer#5 ) utoa::started#4 = phi( utoa::@11/utoa::started#2, utoa::@15/utoa::started#1 ) utoa::value#6 = phi( utoa::@11/utoa::value#2, utoa::@15/utoa::value#1 ) utoa::digit_values#7 = phi( utoa::@11/utoa::digit_values#5, utoa::@15/utoa::digit_values#9 ) utoa::max_digits#6 = phi( utoa::@11/utoa::max_digits#8, utoa::@15/utoa::max_digits#9 ) utoa::digit#4 = phi( utoa::@11/utoa::digit#3, utoa::@15/utoa::digit#5 ) utoa::digit#1 = ++ utoa::digit#4 to:utoa::@10 utoa::@14: scope:[utoa] from utoa::@11 utoa::digit_values#10 = phi( utoa::@11/utoa::digit_values#5 ) utoa::max_digits#10 = phi( utoa::@11/utoa::max_digits#8 ) utoa::digit#6 = phi( utoa::@11/utoa::digit#3 ) utoa::digit_value#1 = phi( utoa::@11/utoa::digit_value#0 ) utoa::value#4 = phi( utoa::@11/utoa::value#2 ) utoa::buffer#8 = phi( utoa::@11/utoa::buffer#12 ) utoa_append::buffer#0 = utoa::buffer#8 utoa_append::value#0 = utoa::value#4 utoa_append::sub#0 = utoa::digit_value#1 call utoa_append utoa_append::return#0 = utoa_append::return#2 to:utoa::@15 utoa::@15: scope:[utoa] from utoa::@14 utoa::digit_values#9 = phi( utoa::@14/utoa::digit_values#10 ) utoa::max_digits#9 = phi( utoa::@14/utoa::max_digits#10 ) utoa::digit#5 = phi( utoa::@14/utoa::digit#6 ) utoa::buffer#9 = phi( utoa::@14/utoa::buffer#8 ) utoa_append::return#3 = phi( utoa::@14/utoa_append::return#0 ) utoa::$9 = utoa_append::return#3 utoa::value#1 = utoa::$9 utoa::buffer#5 = ++ utoa::buffer#9 utoa::started#1 = 1 to:utoa::@13 unsigned int utoa_append(char *buffer , unsigned int value , unsigned int sub) utoa_append: scope:[utoa_append] from utoa::@14 utoa_append::buffer#3 = phi( utoa::@14/utoa_append::buffer#0 ) utoa_append::sub#3 = phi( utoa::@14/utoa_append::sub#0 ) utoa_append::value#5 = phi( utoa::@14/utoa_append::value#0 ) utoa_append::digit#0 = 0 to:utoa_append::@1 utoa_append::@1: scope:[utoa_append] from utoa_append utoa_append::@2 utoa_append::buffer#2 = phi( utoa_append/utoa_append::buffer#3, utoa_append::@2/utoa_append::buffer#4 ) utoa_append::digit#4 = phi( utoa_append/utoa_append::digit#0, utoa_append::@2/utoa_append::digit#1 ) utoa_append::sub#1 = phi( utoa_append/utoa_append::sub#3, utoa_append::@2/utoa_append::sub#2 ) utoa_append::value#2 = phi( utoa_append/utoa_append::value#5, utoa_append::@2/utoa_append::value#1 ) utoa_append::$0 = utoa_append::value#2 >= utoa_append::sub#1 if(utoa_append::$0) goto utoa_append::@2 to:utoa_append::@3 utoa_append::@2: scope:[utoa_append] from utoa_append::@1 utoa_append::buffer#4 = phi( utoa_append::@1/utoa_append::buffer#2 ) utoa_append::sub#2 = phi( utoa_append::@1/utoa_append::sub#1 ) utoa_append::value#3 = phi( utoa_append::@1/utoa_append::value#2 ) utoa_append::digit#2 = phi( utoa_append::@1/utoa_append::digit#4 ) utoa_append::digit#1 = ++ utoa_append::digit#2 utoa_append::value#1 = utoa_append::value#3 - utoa_append::sub#2 to:utoa_append::@1 utoa_append::@3: scope:[utoa_append] from utoa_append::@1 utoa_append::value#4 = phi( utoa_append::@1/utoa_append::value#2 ) utoa_append::buffer#1 = phi( utoa_append::@1/utoa_append::buffer#2 ) utoa_append::digit#3 = phi( utoa_append::@1/utoa_append::digit#4 ) *utoa_append::buffer#1 = DIGITS[utoa_append::digit#3] utoa_append::return#1 = utoa_append::value#4 to:utoa_append::@return utoa_append::@return: scope:[utoa_append] from utoa_append::@3 utoa_append::return#4 = phi( utoa_append::@3/utoa_append::return#1 ) utoa_append::return#2 = utoa_append::return#4 return to:@return unsigned int mul8u(char a , char b) mul8u: scope:[mul8u] from main::@1 mul8u::a#5 = phi( main::@1/mul8u::a#1 ) mul8u::b#1 = phi( main::@1/mul8u::b#0 ) mul8u::res#0 = 0 mul8u::mb#0 = (unsigned int)mul8u::b#1 to:mul8u::@1 mul8u::@1: scope:[mul8u] from mul8u mul8u::@4 mul8u::mb#5 = phi( mul8u/mul8u::mb#0, mul8u::@4/mul8u::mb#1 ) mul8u::res#4 = phi( mul8u/mul8u::res#0, mul8u::@4/mul8u::res#6 ) mul8u::a#2 = phi( mul8u/mul8u::a#5, mul8u::@4/mul8u::a#0 ) mul8u::$0 = mul8u::a#2 != 0 if(mul8u::$0) goto mul8u::@2 to:mul8u::@3 mul8u::@2: scope:[mul8u] from mul8u::@1 mul8u::res#5 = phi( mul8u::@1/mul8u::res#4 ) mul8u::mb#4 = phi( mul8u::@1/mul8u::mb#5 ) mul8u::a#3 = phi( mul8u::@1/mul8u::a#2 ) mul8u::$1 = mul8u::a#3 & 1 mul8u::$2 = mul8u::$1 != 0 mul8u::$3 = ! mul8u::$2 if(mul8u::$3) goto mul8u::@4 to:mul8u::@5 mul8u::@3: scope:[mul8u] from mul8u::@1 mul8u::res#2 = phi( mul8u::@1/mul8u::res#4 ) mul8u::return#0 = mul8u::res#2 to:mul8u::@return mul8u::@4: scope:[mul8u] from mul8u::@2 mul8u::@5 mul8u::res#6 = phi( mul8u::@2/mul8u::res#5, mul8u::@5/mul8u::res#1 ) mul8u::mb#2 = phi( mul8u::@2/mul8u::mb#4, mul8u::@5/mul8u::mb#3 ) mul8u::a#4 = phi( mul8u::@2/mul8u::a#3, mul8u::@5/mul8u::a#6 ) mul8u::$5 = mul8u::a#4 >> 1 mul8u::a#0 = mul8u::$5 mul8u::$6 = mul8u::mb#2 << 1 mul8u::mb#1 = mul8u::$6 to:mul8u::@1 mul8u::@5: scope:[mul8u] from mul8u::@2 mul8u::a#6 = phi( mul8u::@2/mul8u::a#3 ) mul8u::mb#3 = phi( mul8u::@2/mul8u::mb#4 ) mul8u::res#3 = phi( mul8u::@2/mul8u::res#5 ) mul8u::$4 = mul8u::res#3 + mul8u::mb#3 mul8u::res#1 = mul8u::$4 to:mul8u::@4 mul8u::@return: scope:[mul8u] from mul8u::@3 mul8u::return#3 = phi( mul8u::@3/mul8u::return#0 ) mul8u::return#1 = mul8u::return#3 return to:@return char divr8u(char dividend , char divisor , char rem) divr8u: scope:[divr8u] from div16u8u div16u8u::@1 divr8u::divisor#6 = phi( div16u8u/divr8u::divisor#0, div16u8u::@1/divr8u::divisor#1 ) divr8u::dividend#5 = phi( div16u8u/divr8u::dividend#1, div16u8u::@1/divr8u::dividend#2 ) divr8u::rem#10 = phi( div16u8u/divr8u::rem#3, div16u8u::@1/divr8u::rem#4 ) divr8u::quotient#0 = 0 divr8u::i#0 = 0 to:divr8u::@1 divr8u::@1: scope:[divr8u] from divr8u divr8u::@3 divr8u::i#5 = phi( divr8u/divr8u::i#0, divr8u::@3/divr8u::i#1 ) divr8u::divisor#4 = phi( divr8u/divr8u::divisor#6, divr8u::@3/divr8u::divisor#7 ) divr8u::quotient#6 = phi( divr8u/divr8u::quotient#0, divr8u::@3/divr8u::quotient#8 ) divr8u::dividend#3 = phi( divr8u/divr8u::dividend#5, divr8u::@3/divr8u::dividend#6 ) divr8u::rem#5 = phi( divr8u/divr8u::rem#10, divr8u::@3/divr8u::rem#11 ) divr8u::$0 = divr8u::rem#5 << 1 divr8u::rem#0 = divr8u::$0 divr8u::$1 = divr8u::dividend#3 & $80 divr8u::$2 = divr8u::$1 != 0 divr8u::$3 = ! divr8u::$2 if(divr8u::$3) goto divr8u::@2 to:divr8u::@4 divr8u::@2: scope:[divr8u] from divr8u::@1 divr8u::@4 divr8u::i#3 = phi( divr8u::@1/divr8u::i#5, divr8u::@4/divr8u::i#6 ) divr8u::divisor#2 = phi( divr8u::@1/divr8u::divisor#4, divr8u::@4/divr8u::divisor#5 ) divr8u::rem#6 = phi( divr8u::@1/divr8u::rem#0, divr8u::@4/divr8u::rem#1 ) divr8u::quotient#3 = phi( divr8u::@1/divr8u::quotient#6, divr8u::@4/divr8u::quotient#7 ) divr8u::dividend#4 = phi( divr8u::@1/divr8u::dividend#3, divr8u::@4/divr8u::dividend#7 ) divr8u::$5 = divr8u::dividend#4 << 1 divr8u::dividend#0 = divr8u::$5 divr8u::$6 = divr8u::quotient#3 << 1 divr8u::quotient#1 = divr8u::$6 divr8u::$7 = divr8u::rem#6 >= divr8u::divisor#2 divr8u::$8 = ! divr8u::$7 if(divr8u::$8) goto divr8u::@3 to:divr8u::@5 divr8u::@4: scope:[divr8u] from divr8u::@1 divr8u::i#6 = phi( divr8u::@1/divr8u::i#5 ) divr8u::divisor#5 = phi( divr8u::@1/divr8u::divisor#4 ) divr8u::quotient#7 = phi( divr8u::@1/divr8u::quotient#6 ) divr8u::dividend#7 = phi( divr8u::@1/divr8u::dividend#3 ) divr8u::rem#7 = phi( divr8u::@1/divr8u::rem#0 ) divr8u::$4 = divr8u::rem#7 | 1 divr8u::rem#1 = divr8u::$4 to:divr8u::@2 divr8u::@3: scope:[divr8u] from divr8u::@2 divr8u::@5 divr8u::divisor#7 = phi( divr8u::@2/divr8u::divisor#2, divr8u::@5/divr8u::divisor#3 ) divr8u::quotient#8 = phi( divr8u::@2/divr8u::quotient#1, divr8u::@5/divr8u::quotient#2 ) divr8u::dividend#6 = phi( divr8u::@2/divr8u::dividend#0, divr8u::@5/divr8u::dividend#8 ) divr8u::rem#11 = phi( divr8u::@2/divr8u::rem#6, divr8u::@5/divr8u::rem#2 ) divr8u::i#2 = phi( divr8u::@2/divr8u::i#3, divr8u::@5/divr8u::i#4 ) divr8u::i#1 = divr8u::i#2 + rangenext(0,7) divr8u::$10 = divr8u::i#1 != rangelast(0,7) if(divr8u::$10) goto divr8u::@1 to:divr8u::@6 divr8u::@5: scope:[divr8u] from divr8u::@2 divr8u::dividend#8 = phi( divr8u::@2/divr8u::dividend#0 ) divr8u::i#4 = phi( divr8u::@2/divr8u::i#3 ) divr8u::divisor#3 = phi( divr8u::@2/divr8u::divisor#2 ) divr8u::rem#8 = phi( divr8u::@2/divr8u::rem#6 ) divr8u::quotient#4 = phi( divr8u::@2/divr8u::quotient#1 ) divr8u::quotient#2 = ++ divr8u::quotient#4 divr8u::$9 = divr8u::rem#8 - divr8u::divisor#3 divr8u::rem#2 = divr8u::$9 to:divr8u::@3 divr8u::@6: scope:[divr8u] from divr8u::@3 divr8u::quotient#5 = phi( divr8u::@3/divr8u::quotient#8 ) divr8u::rem#9 = phi( divr8u::@3/divr8u::rem#11 ) rem8u#0 = divr8u::rem#9 divr8u::return#0 = divr8u::quotient#5 to:divr8u::@return divr8u::@return: scope:[divr8u] from divr8u::@6 rem8u#10 = phi( divr8u::@6/rem8u#0 ) divr8u::return#4 = phi( divr8u::@6/divr8u::return#0 ) divr8u::return#1 = divr8u::return#4 rem8u#1 = rem8u#10 return to:@return unsigned int div16u8u(unsigned int dividend , char divisor) div16u8u: scope:[div16u8u] from main::@3 rem8u#18 = phi( main::@3/rem8u#19 ) div16u8u::divisor#1 = phi( main::@3/div16u8u::divisor#0 ) div16u8u::dividend#1 = phi( main::@3/div16u8u::dividend#0 ) div16u8u::$0 = byte1 div16u8u::dividend#1 divr8u::dividend#1 = div16u8u::$0 divr8u::divisor#0 = div16u8u::divisor#1 divr8u::rem#3 = 0 call divr8u divr8u::return#2 = divr8u::return#1 to:div16u8u::@1 div16u8u::@1: scope:[div16u8u] from div16u8u div16u8u::divisor#2 = phi( div16u8u/div16u8u::divisor#1 ) div16u8u::dividend#2 = phi( div16u8u/div16u8u::dividend#1 ) rem8u#11 = phi( div16u8u/rem8u#1 ) divr8u::return#5 = phi( div16u8u/divr8u::return#2 ) div16u8u::quotient_hi#0 = divr8u::return#5 rem8u#2 = rem8u#11 div16u8u::$2 = byte0 div16u8u::dividend#2 divr8u::dividend#2 = div16u8u::$2 divr8u::divisor#1 = div16u8u::divisor#2 divr8u::rem#4 = rem8u#2 call divr8u divr8u::return#3 = divr8u::return#1 to:div16u8u::@2 div16u8u::@2: scope:[div16u8u] from div16u8u::@1 div16u8u::quotient_hi#1 = phi( div16u8u::@1/div16u8u::quotient_hi#0 ) rem8u#12 = phi( div16u8u::@1/rem8u#1 ) divr8u::return#6 = phi( div16u8u::@1/divr8u::return#3 ) div16u8u::quotient_lo#0 = divr8u::return#6 rem8u#3 = rem8u#12 div16u8u::quotient#0 = div16u8u::quotient_hi#1 w= div16u8u::quotient_lo#0 div16u8u::return#0 = div16u8u::quotient#0 to:div16u8u::@return div16u8u::@return: scope:[div16u8u] from div16u8u::@2 rem8u#13 = phi( div16u8u::@2/rem8u#3 ) div16u8u::return#3 = phi( div16u8u::@2/div16u8u::return#0 ) div16u8u::return#1 = div16u8u::return#3 rem8u#4 = rem8u#13 return to:@return void main() main: scope:[main] from __start::@1 print_char_cursor#38 = phi( __start::@1/print_char_cursor#27 ) rem8u#30 = phi( __start::@1/rem8u#21 ) main::$10 = 1 * SIZEOF_UNSIGNED_INT PRIMES[main::$10] = 2 main::$11 = 2 * SIZEOF_UNSIGNED_INT PRIMES[main::$11] = 3 potential#0 = 3 test_last#0 = 2 prime_idx#0 = 2 to:main::@1 main::@1: scope:[main] from main main::@11 print_char_cursor#37 = phi( main/print_char_cursor#38, main::@11/print_char_cursor#7 ) prime_idx#20 = phi( main/prime_idx#0, main::@11/prime_idx#7 ) rem8u#29 = phi( main/rem8u#30, main::@11/rem8u#20 ) potential#15 = phi( main/potential#0, main::@11/potential#19 ) test_last#6 = phi( main/test_last#0, main::@11/test_last#12 ) main::$12 = test_last#6 * SIZEOF_UNSIGNED_INT main::p#0 = (char)PRIMES[main::$12] mul8u::a#1 = main::p#0 mul8u::b#0 = main::p#0 call mul8u mul8u::return#2 = mul8u::return#1 to:main::@8 main::@8: scope:[main] from main::@1 print_char_cursor#36 = phi( main::@1/print_char_cursor#37 ) prime_idx#19 = phi( main::@1/prime_idx#20 ) rem8u#26 = phi( main::@1/rem8u#29 ) test_last#13 = phi( main::@1/test_last#6 ) potential#7 = phi( main::@1/potential#15 ) mul8u::return#4 = phi( main::@1/mul8u::return#2 ) main::$0 = mul8u::return#4 main::$1 = potential#7 > main::$0 main::$2 = ! main::$1 if(main::$2) goto main::@2 to:main::@7 main::@2: scope:[main] from main::@7 main::@8 print_char_cursor#34 = phi( main::@7/print_char_cursor#35, main::@8/print_char_cursor#36 ) prime_idx#17 = phi( main::@7/prime_idx#18, main::@8/prime_idx#19 ) test_last#19 = phi( main::@7/test_last#1, main::@8/test_last#13 ) rem8u#22 = phi( main::@7/rem8u#25, main::@8/rem8u#26 ) potential#8 = phi( main::@7/potential#16, main::@8/potential#7 ) potential#1 = potential#8 + 2 test_idx#0 = 2 to:main::@3 main::@7: scope:[main] from main::@8 print_char_cursor#35 = phi( main::@8/print_char_cursor#36 ) prime_idx#18 = phi( main::@8/prime_idx#19 ) rem8u#25 = phi( main::@8/rem8u#26 ) potential#16 = phi( main::@8/potential#7 ) test_last#7 = phi( main::@8/test_last#13 ) test_last#1 = ++ test_last#7 to:main::@2 main::@3: scope:[main] from main::@2 main::@4 print_char_cursor#33 = phi( main::@2/print_char_cursor#34, main::@4/print_char_cursor#30 ) prime_idx#16 = phi( main::@2/prime_idx#17, main::@4/prime_idx#11 ) test_last#17 = phi( main::@2/test_last#19, main::@4/test_last#8 ) rem8u#19 = phi( main::@2/rem8u#22, main::@4/rem8u#23 ) potential#9 = phi( main::@2/potential#1, main::@4/potential#17 ) test_idx#7 = phi( main::@2/test_idx#0, main::@4/test_idx#9 ) main::$13 = test_idx#7 * SIZEOF_UNSIGNED_INT div16u8u::dividend#0 = potential#9 div16u8u::divisor#0 = (char)PRIMES[main::$13] call div16u8u div16u8u::return#2 = div16u8u::return#1 to:main::@9 main::@9: scope:[main] from main::@3 print_char_cursor#32 = phi( main::@3/print_char_cursor#33 ) prime_idx#15 = phi( main::@3/prime_idx#16 ) potential#18 = phi( main::@3/potential#9 ) test_last#15 = phi( main::@3/test_last#17 ) test_idx#8 = phi( main::@3/test_idx#7 ) rem8u#14 = phi( main::@3/rem8u#4 ) rem8u#5 = rem8u#14 test_idx#1 = ++ test_idx#8 main::$4 = rem8u#5 == 0 main::$5 = ! main::$4 if(main::$5) goto main::@4 to:main::@5 main::@4: scope:[main] from main::@5 main::@9 print_char_cursor#30 = phi( main::@5/print_char_cursor#31, main::@9/print_char_cursor#32 ) rem8u#23 = phi( main::@5/rem8u#27, main::@9/rem8u#5 ) prime_idx#11 = phi( main::@5/prime_idx#14, main::@9/prime_idx#15 ) potential#17 = phi( main::@5/potential#2, main::@9/potential#18 ) test_last#8 = phi( main::@5/test_last#14, main::@9/test_last#15 ) test_idx#9 = phi( main::@5/test_idx#2, main::@9/test_idx#1 ) main::$6 = test_idx#9 <= test_last#8 if(main::$6) goto main::@3 to:main::@6 main::@5: scope:[main] from main::@9 print_char_cursor#31 = phi( main::@9/print_char_cursor#32 ) rem8u#27 = phi( main::@9/rem8u#5 ) prime_idx#14 = phi( main::@9/prime_idx#15 ) test_last#14 = phi( main::@9/test_last#15 ) potential#10 = phi( main::@9/potential#18 ) potential#2 = potential#10 + 2 test_idx#2 = 2 to:main::@4 main::@6: scope:[main] from main::@4 rem8u#28 = phi( main::@4/rem8u#23 ) test_idx#16 = phi( main::@4/test_idx#9 ) test_last#20 = phi( main::@4/test_last#8 ) print_char_cursor#26 = phi( main::@4/print_char_cursor#30 ) potential#11 = phi( main::@4/potential#17 ) prime_idx#6 = phi( main::@4/prime_idx#11 ) prime_idx#1 = ++ prime_idx#6 main::$14 = prime_idx#1 * SIZEOF_UNSIGNED_INT PRIMES[main::$14] = potential#11 print_uint_decimal::w#0 = potential#11 call print_uint_decimal to:main::@10 main::@10: scope:[main] from main::@6 rem8u#24 = phi( main::@6/rem8u#28 ) test_idx#15 = phi( main::@6/test_idx#16 ) potential#21 = phi( main::@6/potential#11 ) test_last#18 = phi( main::@6/test_last#20 ) prime_idx#12 = phi( main::@6/prime_idx#1 ) print_char_cursor#18 = phi( main::@6/print_char_cursor#3 ) print_char_cursor#6 = print_char_cursor#18 print_char::ch#1 = ' ' call print_char to:main::@11 main::@11: scope:[main] from main::@10 rem8u#20 = phi( main::@10/rem8u#24 ) test_idx#13 = phi( main::@10/test_idx#15 ) potential#19 = phi( main::@10/potential#21 ) test_last#12 = phi( main::@10/test_last#18 ) prime_idx#7 = phi( main::@10/prime_idx#12 ) print_char_cursor#19 = phi( main::@10/print_char_cursor#5 ) print_char_cursor#7 = print_char_cursor#19 main::$9 = prime_idx#7 < $3e8 if(main::$9) goto main::@1 to:main::@return main::@return: scope:[main] from main::@11 print_char_cursor#20 = phi( main::@11/print_char_cursor#7 ) rem8u#15 = phi( main::@11/rem8u#20 ) test_idx#10 = phi( main::@11/test_idx#13 ) prime_idx#8 = phi( main::@11/prime_idx#7 ) test_last#9 = phi( main::@11/test_last#12 ) potential#12 = phi( main::@11/potential#19 ) potential#3 = potential#12 test_last#2 = test_last#9 prime_idx#2 = prime_idx#8 test_idx#3 = test_idx#10 rem8u#6 = rem8u#15 print_char_cursor#8 = print_char_cursor#20 return to:@return void __start() __start: scope:[__start] from to:__start::__init1 __start::__init1: scope:[__start] from __start print_screen#0 = (char *)$400 print_line_cursor#0 = print_screen#0 print_char_cursor#9 = print_line_cursor#0 rem8u#7 = 0 prime_idx#3 = 0 potential#4 = 0 test_idx#4 = 0 test_last#3 = 0 to:__start::@1 __start::@1: scope:[__start] from __start::__init1 print_line_cursor#4 = phi( __start::__init1/print_line_cursor#0 ) print_screen#4 = phi( __start::__init1/print_screen#0 ) print_char_cursor#27 = phi( __start::__init1/print_char_cursor#9 ) rem8u#21 = phi( __start::__init1/rem8u#7 ) test_idx#14 = phi( __start::__init1/test_idx#4 ) prime_idx#13 = phi( __start::__init1/prime_idx#3 ) test_last#16 = phi( __start::__init1/test_last#3 ) potential#20 = phi( __start::__init1/potential#4 ) call main to:__start::@2 __start::@2: scope:[__start] from __start::@1 print_line_cursor#3 = phi( __start::@1/print_line_cursor#4 ) print_screen#3 = phi( __start::@1/print_screen#4 ) print_char_cursor#21 = phi( __start::@1/print_char_cursor#8 ) rem8u#16 = phi( __start::@1/rem8u#6 ) test_idx#11 = phi( __start::@1/test_idx#3 ) prime_idx#9 = phi( __start::@1/prime_idx#2 ) test_last#10 = phi( __start::@1/test_last#2 ) potential#13 = phi( __start::@1/potential#3 ) potential#5 = potential#13 test_last#4 = test_last#10 prime_idx#4 = prime_idx#9 test_idx#5 = test_idx#11 rem8u#8 = rem8u#16 print_char_cursor#10 = print_char_cursor#21 to:__start::@return __start::@return: scope:[__start] from __start::@2 test_last#11 = phi( __start::@2/test_last#4 ) test_idx#12 = phi( __start::@2/test_idx#5 ) potential#14 = phi( __start::@2/potential#5 ) prime_idx#10 = phi( __start::@2/prime_idx#4 ) rem8u#17 = phi( __start::@2/rem8u#8 ) print_char_cursor#22 = phi( __start::@2/print_char_cursor#10 ) print_line_cursor#2 = phi( __start::@2/print_line_cursor#3 ) print_screen#2 = phi( __start::@2/print_screen#3 ) print_screen#1 = print_screen#2 print_line_cursor#1 = print_line_cursor#2 print_char_cursor#11 = print_char_cursor#22 rem8u#9 = rem8u#17 prime_idx#5 = prime_idx#10 potential#6 = potential#14 test_idx#6 = test_idx#12 test_last#5 = test_last#11 return to:@return SYMBOL TABLE SSA __constant char BINARY = 2 __constant char DECIMAL = $a __constant char DIGITS[] = "0123456789abcdef"z __constant char HEXADECIMAL = $10 __constant char OCTAL = 8 __constant unsigned int PRIMES[$3e8] = { fill( $3e8, 0) } __constant char RADIX::BINARY = 2 __constant char RADIX::DECIMAL = $a __constant char RADIX::HEXADECIMAL = $10 __constant char RADIX::OCTAL = 8 __constant unsigned int RADIX_BINARY_VALUES[] = { $8000, $4000, $2000, $1000, $800, $400, $200, $100, $80, $40, $20, $10, 8, 4, 2 } __constant unsigned int RADIX_DECIMAL_VALUES[] = { $2710, $3e8, $64, $a } __constant unsigned int RADIX_HEXADECIMAL_VALUES[] = { $1000, $100, $10 } __constant unsigned int RADIX_OCTAL_VALUES[] = { $8000, $1000, $200, $40, 8 } __constant char SIZEOF_UNSIGNED_INT = 2 void __start() __constant char decimal_digits[6] = { fill( 6, 0) } unsigned int div16u8u(unsigned int dividend , char divisor) char div16u8u::$0 char div16u8u::$2 unsigned int div16u8u::dividend unsigned int div16u8u::dividend#0 unsigned int div16u8u::dividend#1 unsigned int div16u8u::dividend#2 char div16u8u::divisor char div16u8u::divisor#0 char div16u8u::divisor#1 char div16u8u::divisor#2 unsigned int div16u8u::quotient unsigned int div16u8u::quotient#0 char div16u8u::quotient_hi char div16u8u::quotient_hi#0 char div16u8u::quotient_hi#1 char div16u8u::quotient_lo char div16u8u::quotient_lo#0 unsigned int div16u8u::return unsigned int div16u8u::return#0 unsigned int div16u8u::return#1 unsigned int div16u8u::return#2 unsigned int div16u8u::return#3 char divr8u(char dividend , char divisor , char rem) char divr8u::$0 number divr8u::$1 bool divr8u::$10 bool divr8u::$2 bool divr8u::$3 number divr8u::$4 char divr8u::$5 char divr8u::$6 bool divr8u::$7 bool divr8u::$8 char divr8u::$9 char divr8u::dividend char divr8u::dividend#0 char divr8u::dividend#1 char divr8u::dividend#2 char divr8u::dividend#3 char divr8u::dividend#4 char divr8u::dividend#5 char divr8u::dividend#6 char divr8u::dividend#7 char divr8u::dividend#8 char divr8u::divisor char divr8u::divisor#0 char divr8u::divisor#1 char divr8u::divisor#2 char divr8u::divisor#3 char divr8u::divisor#4 char divr8u::divisor#5 char divr8u::divisor#6 char divr8u::divisor#7 char divr8u::i char divr8u::i#0 char divr8u::i#1 char divr8u::i#2 char divr8u::i#3 char divr8u::i#4 char divr8u::i#5 char divr8u::i#6 char divr8u::quotient char divr8u::quotient#0 char divr8u::quotient#1 char divr8u::quotient#2 char divr8u::quotient#3 char divr8u::quotient#4 char divr8u::quotient#5 char divr8u::quotient#6 char divr8u::quotient#7 char divr8u::quotient#8 char divr8u::rem char divr8u::rem#0 char divr8u::rem#1 char divr8u::rem#10 char divr8u::rem#11 char divr8u::rem#2 char divr8u::rem#3 char divr8u::rem#4 char divr8u::rem#5 char divr8u::rem#6 char divr8u::rem#7 char divr8u::rem#8 char divr8u::rem#9 char divr8u::return char divr8u::return#0 char divr8u::return#1 char divr8u::return#2 char divr8u::return#3 char divr8u::return#4 char divr8u::return#5 char divr8u::return#6 void main() unsigned int main::$0 bool main::$1 number main::$10 number main::$11 char main::$12 char main::$13 unsigned int main::$14 bool main::$2 bool main::$4 bool main::$5 bool main::$6 bool main::$9 char main::p char main::p#0 unsigned int mul8u(char a , char b) bool mul8u::$0 number mul8u::$1 bool mul8u::$2 bool mul8u::$3 unsigned int mul8u::$4 char mul8u::$5 unsigned int mul8u::$6 char mul8u::a char mul8u::a#0 char mul8u::a#1 char mul8u::a#2 char mul8u::a#3 char mul8u::a#4 char mul8u::a#5 char mul8u::a#6 char mul8u::b char mul8u::b#0 char mul8u::b#1 unsigned int mul8u::mb unsigned int mul8u::mb#0 unsigned int mul8u::mb#1 unsigned int mul8u::mb#2 unsigned int mul8u::mb#3 unsigned int mul8u::mb#4 unsigned int mul8u::mb#5 unsigned int mul8u::res unsigned int mul8u::res#0 unsigned int mul8u::res#1 unsigned int mul8u::res#2 unsigned int mul8u::res#3 unsigned int mul8u::res#4 unsigned int mul8u::res#5 unsigned int mul8u::res#6 unsigned int mul8u::return unsigned int mul8u::return#0 unsigned int mul8u::return#1 unsigned int mul8u::return#2 unsigned int mul8u::return#3 unsigned int mul8u::return#4 unsigned int potential unsigned int potential#0 unsigned int potential#1 unsigned int potential#10 unsigned int potential#11 unsigned int potential#12 unsigned int potential#13 unsigned int potential#14 unsigned int potential#15 unsigned int potential#16 unsigned int potential#17 unsigned int potential#18 unsigned int potential#19 unsigned int potential#2 unsigned int potential#20 unsigned int potential#21 unsigned int potential#3 unsigned int potential#4 unsigned int potential#5 unsigned int potential#6 unsigned int potential#7 unsigned int potential#8 unsigned int potential#9 unsigned int prime_idx unsigned int prime_idx#0 unsigned int prime_idx#1 unsigned int prime_idx#10 unsigned int prime_idx#11 unsigned int prime_idx#12 unsigned int prime_idx#13 unsigned int prime_idx#14 unsigned int prime_idx#15 unsigned int prime_idx#16 unsigned int prime_idx#17 unsigned int prime_idx#18 unsigned int prime_idx#19 unsigned int prime_idx#2 unsigned int prime_idx#20 unsigned int prime_idx#3 unsigned int prime_idx#4 unsigned int prime_idx#5 unsigned int prime_idx#6 unsigned int prime_idx#7 unsigned int prime_idx#8 unsigned int prime_idx#9 void print_char(char ch) char print_char::ch char print_char::ch#0 char print_char::ch#1 char print_char::ch#2 char *print_char_cursor char *print_char_cursor#0 char *print_char_cursor#1 char *print_char_cursor#10 char *print_char_cursor#11 char *print_char_cursor#12 char *print_char_cursor#13 char *print_char_cursor#14 char *print_char_cursor#15 char *print_char_cursor#16 char *print_char_cursor#17 char *print_char_cursor#18 char *print_char_cursor#19 char *print_char_cursor#2 char *print_char_cursor#20 char *print_char_cursor#21 char *print_char_cursor#22 char *print_char_cursor#23 char *print_char_cursor#24 char *print_char_cursor#25 char *print_char_cursor#26 char *print_char_cursor#27 char *print_char_cursor#28 char *print_char_cursor#29 char *print_char_cursor#3 char *print_char_cursor#30 char *print_char_cursor#31 char *print_char_cursor#32 char *print_char_cursor#33 char *print_char_cursor#34 char *print_char_cursor#35 char *print_char_cursor#36 char *print_char_cursor#37 char *print_char_cursor#38 char *print_char_cursor#4 char *print_char_cursor#5 char *print_char_cursor#6 char *print_char_cursor#7 char *print_char_cursor#8 char *print_char_cursor#9 char *print_line_cursor char *print_line_cursor#0 char *print_line_cursor#1 char *print_line_cursor#2 char *print_line_cursor#3 char *print_line_cursor#4 char *print_screen char *print_screen#0 char *print_screen#1 char *print_screen#2 char *print_screen#3 char *print_screen#4 void print_str(char *str) bool print_str::$1 char *print_str::str char *print_str::str#0 char *print_str::str#1 char *print_str::str#2 char *print_str::str#3 char *print_str::str#4 char *print_str::str#5 void print_uint_decimal(unsigned int w) unsigned int print_uint_decimal::w unsigned int print_uint_decimal::w#0 unsigned int print_uint_decimal::w#1 char rem8u char rem8u#0 char rem8u#1 char rem8u#10 char rem8u#11 char rem8u#12 char rem8u#13 char rem8u#14 char rem8u#15 char rem8u#16 char rem8u#17 char rem8u#18 char rem8u#19 char rem8u#2 char rem8u#20 char rem8u#21 char rem8u#22 char rem8u#23 char rem8u#24 char rem8u#25 char rem8u#26 char rem8u#27 char rem8u#28 char rem8u#29 char rem8u#3 char rem8u#30 char rem8u#4 char rem8u#5 char rem8u#6 char rem8u#7 char rem8u#8 char rem8u#9 char test_idx char test_idx#0 char test_idx#1 char test_idx#10 char test_idx#11 char test_idx#12 char test_idx#13 char test_idx#14 char test_idx#15 char test_idx#16 char test_idx#2 char test_idx#3 char test_idx#4 char test_idx#5 char test_idx#6 char test_idx#7 char test_idx#8 char test_idx#9 char test_last char test_last#0 char test_last#1 char test_last#10 char test_last#11 char test_last#12 char test_last#13 char test_last#14 char test_last#15 char test_last#16 char test_last#17 char test_last#18 char test_last#19 char test_last#2 char test_last#20 char test_last#3 char test_last#4 char test_last#5 char test_last#6 char test_last#7 char test_last#8 char test_last#9 void utoa(unsigned int value , char *buffer , char radix) bool utoa::$0 bool utoa::$1 char utoa::$10 char utoa::$11 bool utoa::$2 bool utoa::$3 number utoa::$4 bool utoa::$5 bool utoa::$6 bool utoa::$7 bool utoa::$8 unsigned int utoa::$9 char *utoa::buffer char *utoa::buffer#0 char *utoa::buffer#1 char *utoa::buffer#10 char *utoa::buffer#11 char *utoa::buffer#12 char *utoa::buffer#13 char *utoa::buffer#14 char *utoa::buffer#15 char *utoa::buffer#16 char *utoa::buffer#17 char *utoa::buffer#18 char *utoa::buffer#19 char *utoa::buffer#2 char *utoa::buffer#20 char *utoa::buffer#21 char *utoa::buffer#3 char *utoa::buffer#4 char *utoa::buffer#5 char *utoa::buffer#6 char *utoa::buffer#7 char *utoa::buffer#8 char *utoa::buffer#9 char utoa::digit char utoa::digit#0 char utoa::digit#1 char utoa::digit#2 char utoa::digit#3 char utoa::digit#4 char utoa::digit#5 char utoa::digit#6 unsigned int utoa::digit_value unsigned int utoa::digit_value#0 unsigned int utoa::digit_value#1 unsigned int *utoa::digit_values unsigned int *utoa::digit_values#0 unsigned int *utoa::digit_values#1 unsigned int *utoa::digit_values#10 unsigned int *utoa::digit_values#2 unsigned int *utoa::digit_values#3 unsigned int *utoa::digit_values#4 unsigned int *utoa::digit_values#5 unsigned int *utoa::digit_values#6 unsigned int *utoa::digit_values#7 unsigned int *utoa::digit_values#8 unsigned int *utoa::digit_values#9 char utoa::max_digits char utoa::max_digits#0 char utoa::max_digits#1 char utoa::max_digits#10 char utoa::max_digits#2 char utoa::max_digits#3 char utoa::max_digits#4 char utoa::max_digits#5 char utoa::max_digits#6 char utoa::max_digits#7 char utoa::max_digits#8 char utoa::max_digits#9 char utoa::radix char utoa::radix#0 char utoa::radix#1 char utoa::radix#2 char utoa::radix#3 char utoa::radix#4 char utoa::started char utoa::started#0 char utoa::started#1 char utoa::started#2 char utoa::started#3 char utoa::started#4 unsigned int utoa::value unsigned int utoa::value#0 unsigned int utoa::value#1 unsigned int utoa::value#10 unsigned int utoa::value#11 unsigned int utoa::value#12 unsigned int utoa::value#13 unsigned int utoa::value#14 unsigned int utoa::value#15 unsigned int utoa::value#2 unsigned int utoa::value#3 unsigned int utoa::value#4 unsigned int utoa::value#5 unsigned int utoa::value#6 unsigned int utoa::value#7 unsigned int utoa::value#8 unsigned int utoa::value#9 unsigned int utoa_append(char *buffer , unsigned int value , unsigned int sub) bool utoa_append::$0 char *utoa_append::buffer char *utoa_append::buffer#0 char *utoa_append::buffer#1 char *utoa_append::buffer#2 char *utoa_append::buffer#3 char *utoa_append::buffer#4 char utoa_append::digit char utoa_append::digit#0 char utoa_append::digit#1 char utoa_append::digit#2 char utoa_append::digit#3 char utoa_append::digit#4 unsigned int utoa_append::return unsigned int utoa_append::return#0 unsigned int utoa_append::return#1 unsigned int utoa_append::return#2 unsigned int utoa_append::return#3 unsigned int utoa_append::return#4 unsigned int utoa_append::sub unsigned int utoa_append::sub#0 unsigned int utoa_append::sub#1 unsigned int utoa_append::sub#2 unsigned int utoa_append::sub#3 unsigned int utoa_append::value unsigned int utoa_append::value#0 unsigned int utoa_append::value#1 unsigned int utoa_append::value#2 unsigned int utoa_append::value#3 unsigned int utoa_append::value#4 unsigned int utoa_append::value#5 Adding number conversion cast (unumber) 0 in print_str::$1 = 0 != *print_str::str#2 Adding number conversion cast (unumber) 5 in utoa::max_digits#1 = 5 Adding number conversion cast (unumber) 4 in utoa::max_digits#2 = 4 Adding number conversion cast (unumber) 6 in utoa::max_digits#3 = 6 Adding number conversion cast (unumber) $10 in utoa::max_digits#4 = $10 Adding number conversion cast (unumber) 0 in *utoa::buffer#3 = 0 Adding number conversion cast (unumber) 1 in utoa::$4 = utoa::max_digits#5 - 1 Adding number conversion cast (unumber) utoa::$4 in utoa::$4 = utoa::max_digits#5 - (unumber)1 Adding number conversion cast (unumber) 0 in *utoa::buffer#4 = 0 Adding number conversion cast (unumber) 1 in utoa::started#1 = 1 Adding number conversion cast (unumber) 0 in mul8u::$0 = mul8u::a#2 != 0 Adding number conversion cast (unumber) 1 in mul8u::$1 = mul8u::a#3 & 1 Adding number conversion cast (unumber) mul8u::$1 in mul8u::$1 = mul8u::a#3 & (unumber)1 Adding number conversion cast (unumber) 0 in mul8u::$2 = mul8u::$1 != 0 Adding number conversion cast (unumber) 1 in mul8u::$5 = mul8u::a#4 >> 1 Adding number conversion cast (unumber) 1 in mul8u::$6 = mul8u::mb#2 << 1 Adding number conversion cast (unumber) 1 in divr8u::$0 = divr8u::rem#5 << 1 Adding number conversion cast (unumber) $80 in divr8u::$1 = divr8u::dividend#3 & $80 Adding number conversion cast (unumber) divr8u::$1 in divr8u::$1 = divr8u::dividend#3 & (unumber)$80 Adding number conversion cast (unumber) 0 in divr8u::$2 = divr8u::$1 != 0 Adding number conversion cast (unumber) 1 in divr8u::$5 = divr8u::dividend#4 << 1 Adding number conversion cast (unumber) 1 in divr8u::$6 = divr8u::quotient#3 << 1 Adding number conversion cast (unumber) 1 in divr8u::$4 = divr8u::rem#7 | 1 Adding number conversion cast (unumber) divr8u::$4 in divr8u::$4 = divr8u::rem#7 | (unumber)1 Adding number conversion cast (unumber) 0 in divr8u::rem#3 = 0 Adding number conversion cast (unumber) 1 in main::$10 = 1 * SIZEOF_UNSIGNED_INT Adding number conversion cast (unumber) main::$10 in main::$10 = (unumber)1 * SIZEOF_UNSIGNED_INT Adding number conversion cast (unumber) 2 in PRIMES[main::$10] = 2 Adding number conversion cast (unumber) 2 in main::$11 = 2 * SIZEOF_UNSIGNED_INT Adding number conversion cast (unumber) main::$11 in main::$11 = (unumber)2 * SIZEOF_UNSIGNED_INT Adding number conversion cast (unumber) 3 in PRIMES[main::$11] = 3 Adding number conversion cast (unumber) 3 in potential#0 = 3 Adding number conversion cast (unumber) 2 in test_last#0 = 2 Adding number conversion cast (unumber) 2 in prime_idx#0 = 2 Adding number conversion cast (unumber) 2 in potential#1 = potential#8 + 2 Adding number conversion cast (unumber) 2 in test_idx#0 = 2 Adding number conversion cast (unumber) 0 in main::$4 = rem8u#5 == 0 Adding number conversion cast (unumber) 2 in potential#2 = potential#10 + 2 Adding number conversion cast (unumber) 2 in test_idx#2 = 2 Adding number conversion cast (unumber) $3e8 in main::$9 = prime_idx#7 < $3e8 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast utoa::max_digits#1 = (unumber)5 Inlining cast utoa::max_digits#2 = (unumber)4 Inlining cast utoa::max_digits#3 = (unumber)6 Inlining cast utoa::max_digits#4 = (unumber)$10 Inlining cast *utoa::buffer#3 = (unumber)0 Inlining cast *utoa::buffer#4 = (unumber)0 Inlining cast utoa::started#1 = (unumber)1 Inlining cast divr8u::rem#3 = (unumber)0 Inlining cast PRIMES[main::$10] = (unumber)2 Inlining cast PRIMES[main::$11] = (unumber)3 Inlining cast potential#0 = (unumber)3 Inlining cast test_last#0 = (unumber)2 Inlining cast prime_idx#0 = (unumber)2 Inlining cast test_idx#0 = (unumber)2 Inlining cast test_idx#2 = (unumber)2 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 0 Simplifying constant integer cast 5 Simplifying constant integer cast 4 Simplifying constant integer cast 6 Simplifying constant integer cast $10 Simplifying constant integer cast 0 Simplifying constant integer cast 1 Simplifying constant integer cast 0 Simplifying constant integer cast 1 Simplifying constant integer cast 0 Simplifying constant integer cast 1 Simplifying constant integer cast 0 Simplifying constant integer cast 1 Simplifying constant integer cast 1 Simplifying constant integer cast 1 Simplifying constant integer cast $80 Simplifying constant integer cast 0 Simplifying constant integer cast 1 Simplifying constant integer cast 1 Simplifying constant integer cast 1 Simplifying constant integer cast 0 Simplifying constant integer cast 1 Simplifying constant integer cast 2 Simplifying constant integer cast 2 Simplifying constant integer cast 3 Simplifying constant integer cast 3 Simplifying constant integer cast 2 Simplifying constant integer cast 2 Simplifying constant integer cast 2 Simplifying constant integer cast 2 Simplifying constant integer cast 0 Simplifying constant integer cast 2 Simplifying constant integer cast 2 Simplifying constant integer cast $3e8 Simplifying constant pointer cast (char *) 1024 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (char) 0 Finalized unsigned number type (char) 5 Finalized unsigned number type (char) 4 Finalized unsigned number type (char) 6 Finalized unsigned number type (char) $10 Finalized unsigned number type (char) 0 Finalized unsigned number type (char) 1 Finalized unsigned number type (char) 0 Finalized unsigned number type (char) 1 Finalized unsigned number type (char) 0 Finalized unsigned number type (char) 1 Finalized unsigned number type (char) 0 Finalized unsigned number type (char) 1 Finalized unsigned number type (char) 1 Finalized unsigned number type (char) 1 Finalized unsigned number type (char) $80 Finalized unsigned number type (char) 0 Finalized unsigned number type (char) 1 Finalized unsigned number type (char) 1 Finalized unsigned number type (char) 1 Finalized unsigned number type (char) 0 Finalized unsigned number type (char) 1 Finalized unsigned number type (char) 2 Finalized unsigned number type (char) 2 Finalized unsigned number type (char) 3 Finalized unsigned number type (char) 3 Finalized unsigned number type (char) 2 Finalized unsigned number type (char) 2 Finalized unsigned number type (char) 2 Finalized unsigned number type (char) 2 Finalized unsigned number type (char) 0 Finalized unsigned number type (char) 2 Finalized unsigned number type (char) 2 Finalized unsigned number type (unsigned int) $3e8 Successful SSA optimization PassNFinalizeNumberTypeConversions Inferred type updated to char in utoa::$4 = utoa::max_digits#5 - 1 Inferred type updated to char in mul8u::$1 = mul8u::a#3 & 1 Inferred type updated to char in divr8u::$1 = divr8u::dividend#3 & $80 Inferred type updated to char in divr8u::$4 = divr8u::rem#7 | 1 Inferred type updated to char in main::$10 = 1 * SIZEOF_UNSIGNED_INT Inferred type updated to char in main::$11 = 2 * SIZEOF_UNSIGNED_INT Inversing boolean not [122] mul8u::$3 = mul8u::$1 == 0 from [121] mul8u::$2 = mul8u::$1 != 0 Inversing boolean not [145] divr8u::$3 = divr8u::$1 == 0 from [144] divr8u::$2 = divr8u::$1 != 0 Inversing boolean not [153] divr8u::$8 = divr8u::rem#6 < divr8u::divisor#2 from [152] divr8u::$7 = divr8u::rem#6 >= divr8u::divisor#2 Inversing boolean not [216] main::$2 = potential#7 <= main::$0 from [215] main::$1 = potential#7 > main::$0 Inversing boolean not [233] main::$5 = rem8u#5 != 0 from [232] main::$4 = rem8u#5 == 0 Successful SSA optimization Pass2UnaryNotSimplification Alias print_str::str#2 = print_str::str#3 print_str::str#4 Alias print_char_cursor#1 = print_char_cursor#23 print_char_cursor#24 print_char_cursor#13 Alias print_char_cursor#0 = print_char_cursor#12 Alias print_char_cursor#25 = print_char_cursor#29 Alias print_char_cursor#14 = print_char_cursor#2 print_char_cursor#15 print_char_cursor#3 Alias print_char_cursor#17 = print_char_cursor#4 print_char_cursor#5 Alias utoa::value#10 = utoa::value#8 utoa::value#12 utoa::value#13 utoa::value#9 utoa::value#14 utoa::value#15 utoa::value#11 Alias utoa::buffer#10 = utoa::buffer#17 utoa::buffer#21 utoa::buffer#16 utoa::buffer#18 utoa::buffer#13 utoa::buffer#19 utoa::buffer#20 utoa::buffer#6 Alias utoa::radix#1 = utoa::radix#2 utoa::radix#3 utoa::radix#4 Alias utoa::digit#2 = utoa::digit#3 utoa::digit#6 utoa::digit#5 Alias utoa::digit_values#10 = utoa::digit_values#5 utoa::digit_values#6 utoa::digit_values#9 Alias utoa::value#2 = utoa::value#5 utoa::value#3 utoa::value#4 Alias utoa::started#2 = utoa::started#3 Alias utoa::buffer#11 = utoa::buffer#12 utoa::buffer#7 utoa::buffer#8 utoa::buffer#9 Alias utoa::max_digits#10 = utoa::max_digits#8 utoa::max_digits#5 utoa::max_digits#9 Alias utoa::digit_value#0 = utoa::digit_value#1 Alias utoa_append::return#0 = utoa_append::return#3 Alias utoa::value#1 = utoa::$9 Alias utoa_append::digit#2 = utoa_append::digit#4 utoa_append::digit#3 Alias utoa_append::value#2 = utoa_append::value#3 utoa_append::value#4 utoa_append::return#1 utoa_append::return#4 utoa_append::return#2 Alias utoa_append::sub#1 = utoa_append::sub#2 Alias utoa_append::buffer#1 = utoa_append::buffer#4 utoa_append::buffer#2 Alias mul8u::a#2 = mul8u::a#3 mul8u::a#6 Alias mul8u::mb#3 = mul8u::mb#4 mul8u::mb#5 Alias mul8u::res#2 = mul8u::res#5 mul8u::res#4 mul8u::return#0 mul8u::res#3 mul8u::return#3 mul8u::return#1 Alias mul8u::a#0 = mul8u::$5 Alias mul8u::mb#1 = mul8u::$6 Alias mul8u::res#1 = mul8u::$4 Alias divr8u::rem#0 = divr8u::$0 divr8u::rem#7 Alias divr8u::dividend#0 = divr8u::$5 divr8u::dividend#8 Alias divr8u::quotient#1 = divr8u::$6 divr8u::quotient#4 Alias divr8u::dividend#3 = divr8u::dividend#7 Alias divr8u::quotient#6 = divr8u::quotient#7 Alias divr8u::divisor#4 = divr8u::divisor#5 Alias divr8u::i#5 = divr8u::i#6 Alias divr8u::rem#1 = divr8u::$4 Alias divr8u::rem#6 = divr8u::rem#8 Alias divr8u::divisor#2 = divr8u::divisor#3 Alias divr8u::i#3 = divr8u::i#4 Alias divr8u::rem#2 = divr8u::$9 Alias divr8u::rem#11 = divr8u::rem#9 Alias divr8u::return#0 = divr8u::quotient#5 divr8u::quotient#8 divr8u::return#4 divr8u::return#1 Alias rem8u#0 = rem8u#10 rem8u#1 Alias divr8u::dividend#1 = div16u8u::$0 Alias divr8u::return#2 = divr8u::return#5 Alias div16u8u::dividend#1 = div16u8u::dividend#2 Alias div16u8u::divisor#1 = div16u8u::divisor#2 Alias rem8u#11 = rem8u#2 Alias divr8u::dividend#2 = div16u8u::$2 Alias divr8u::return#3 = divr8u::return#6 Alias div16u8u::quotient_hi#0 = div16u8u::quotient_hi#1 Alias rem8u#12 = rem8u#3 rem8u#13 rem8u#4 Alias div16u8u::return#0 = div16u8u::quotient#0 div16u8u::return#3 div16u8u::return#1 Alias mul8u::return#2 = mul8u::return#4 Alias potential#15 = potential#7 potential#16 Alias test_last#13 = test_last#6 test_last#7 Alias rem8u#25 = rem8u#26 rem8u#29 Alias prime_idx#18 = prime_idx#19 prime_idx#20 Alias print_char_cursor#35 = print_char_cursor#36 print_char_cursor#37 Alias test_idx#7 = test_idx#8 Alias test_last#14 = test_last#15 test_last#17 Alias potential#10 = potential#18 potential#9 Alias prime_idx#14 = prime_idx#15 prime_idx#16 Alias print_char_cursor#31 = print_char_cursor#32 print_char_cursor#33 Alias rem8u#14 = rem8u#5 rem8u#27 Alias prime_idx#11 = prime_idx#6 Alias potential#11 = potential#17 potential#21 potential#19 potential#12 potential#3 Alias print_char_cursor#26 = print_char_cursor#30 Alias test_last#12 = test_last#20 test_last#8 test_last#18 test_last#9 test_last#2 Alias test_idx#10 = test_idx#16 test_idx#9 test_idx#15 test_idx#13 test_idx#3 Alias rem8u#15 = rem8u#28 rem8u#23 rem8u#24 rem8u#20 rem8u#6 Alias prime_idx#1 = prime_idx#12 prime_idx#7 prime_idx#8 prime_idx#2 Alias print_char_cursor#18 = print_char_cursor#6 Alias print_char_cursor#19 = print_char_cursor#7 print_char_cursor#20 print_char_cursor#8 Alias print_screen#0 = print_line_cursor#0 print_char_cursor#9 print_char_cursor#27 print_screen#4 print_line_cursor#4 print_screen#3 print_line_cursor#3 print_screen#2 print_line_cursor#2 print_screen#1 print_line_cursor#1 Alias potential#20 = potential#4 Alias test_last#16 = test_last#3 Alias prime_idx#13 = prime_idx#3 Alias test_idx#14 = test_idx#4 Alias rem8u#21 = rem8u#7 Alias potential#13 = potential#5 potential#14 potential#6 Alias test_last#10 = test_last#4 test_last#11 test_last#5 Alias prime_idx#10 = prime_idx#4 prime_idx#9 prime_idx#5 Alias test_idx#11 = test_idx#5 test_idx#12 test_idx#6 Alias rem8u#16 = rem8u#8 rem8u#17 rem8u#9 Alias print_char_cursor#10 = print_char_cursor#21 print_char_cursor#22 print_char_cursor#11 Successful SSA optimization Pass2AliasElimination Alias utoa::value#10 = utoa::value#7 Alias utoa::buffer#10 = utoa::buffer#15 Alias utoa::digit#2 = utoa::digit#4 Alias utoa::max_digits#10 = utoa::max_digits#6 Alias utoa::digit_values#10 = utoa::digit_values#7 Alias mul8u::a#2 = mul8u::a#4 Alias mul8u::mb#2 = mul8u::mb#3 Alias divr8u::dividend#3 = divr8u::dividend#4 Alias divr8u::quotient#3 = divr8u::quotient#6 Alias divr8u::divisor#2 = divr8u::divisor#4 divr8u::divisor#7 Alias divr8u::i#2 = divr8u::i#3 divr8u::i#5 Alias divr8u::dividend#0 = divr8u::dividend#6 Alias potential#15 = potential#8 Alias rem8u#22 = rem8u#25 Alias prime_idx#17 = prime_idx#18 Alias print_char_cursor#34 = print_char_cursor#35 Alias test_last#12 = test_last#14 Alias prime_idx#11 = prime_idx#14 Alias rem8u#14 = rem8u#15 Alias print_char_cursor#26 = print_char_cursor#31 Successful SSA optimization Pass2AliasElimination Identical Phi Values print_str::str#5 print_str::str#1 Identical Phi Values print_char_cursor#28 print_char_cursor#25 Identical Phi Values print_char_cursor#0 print_char_cursor#17 Identical Phi Values print_uint_decimal::w#1 print_uint_decimal::w#0 Identical Phi Values print_char_cursor#25 print_char_cursor#26 Identical Phi Values print_char_cursor#14 print_char_cursor#1 Identical Phi Values utoa::radix#1 utoa::radix#0 Identical Phi Values utoa::value#10 utoa::value#0 Identical Phi Values utoa::buffer#10 utoa::buffer#0 Identical Phi Values utoa::max_digits#10 utoa::max_digits#7 Identical Phi Values utoa::digit_values#10 utoa::digit_values#8 Identical Phi Values utoa_append::value#5 utoa_append::value#0 Identical Phi Values utoa_append::sub#3 utoa_append::sub#0 Identical Phi Values utoa_append::buffer#3 utoa_append::buffer#0 Identical Phi Values utoa_append::sub#1 utoa_append::sub#3 Identical Phi Values utoa_append::buffer#1 utoa_append::buffer#3 Identical Phi Values mul8u::b#1 mul8u::b#0 Identical Phi Values mul8u::a#5 mul8u::a#1 Identical Phi Values divr8u::divisor#2 divr8u::divisor#6 Identical Phi Values div16u8u::dividend#1 div16u8u::dividend#0 Identical Phi Values div16u8u::divisor#1 div16u8u::divisor#0 Identical Phi Values rem8u#18 rem8u#19 Identical Phi Values rem8u#11 rem8u#0 Identical Phi Values rem8u#12 rem8u#0 Identical Phi Values rem8u#30 rem8u#21 Identical Phi Values print_char_cursor#38 print_screen#0 Identical Phi Values test_last#12 test_last#19 Identical Phi Values prime_idx#11 prime_idx#17 Identical Phi Values print_char_cursor#26 print_char_cursor#34 Identical Phi Values rem8u#14 rem8u#12 Identical Phi Values print_char_cursor#18 print_char_cursor#14 Identical Phi Values print_char_cursor#19 print_char_cursor#17 Identical Phi Values potential#13 potential#11 Identical Phi Values test_last#10 test_last#12 Identical Phi Values prime_idx#10 prime_idx#1 Identical Phi Values test_idx#11 test_idx#10 Identical Phi Values rem8u#16 rem8u#14 Identical Phi Values print_char_cursor#10 print_char_cursor#19 Successful SSA optimization Pass2IdenticalPhiElimination Identical Phi Values print_char_cursor#16 print_char_cursor#1 Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition print_str::$1 [3] if(0!=*print_str::str#2) goto print_str::@2 Simple Condition utoa::$0 [26] if(utoa::radix#0==DECIMAL) goto utoa::@1 Simple Condition utoa::$1 [30] if(utoa::radix#0==HEXADECIMAL) goto utoa::@2 Simple Condition utoa::$2 [34] if(utoa::radix#0==OCTAL) goto utoa::@3 Simple Condition utoa::$3 [38] if(utoa::radix#0==BINARY) goto utoa::@4 Simple Condition utoa::$5 [55] if(utoa::digit#2=utoa_append::sub#0) goto utoa_append::@2 Simple Condition mul8u::$0 [90] if(mul8u::a#2!=0) goto mul8u::@2 Simple Condition mul8u::$3 [93] if(mul8u::$1==0) goto mul8u::@4 Simple Condition divr8u::$3 [106] if(divr8u::$1==0) goto divr8u::@2 Simple Condition divr8u::$8 [111] if(divr8u::rem#6=utoa::digit_value#0) goto utoa::@14 Successful SSA optimization Pass2ConditionalJumpSimplification Constant right-side identified [17] utoa::$4 = utoa::max_digits#1 - 1 Successful SSA optimization Pass2ConstantRValueConsolidation Constant utoa::$4 = utoa::max_digits#1-1 Successful SSA optimization Pass2ConstantIdentification Rewriting multiplication to use shift [17] utoa::$10 = utoa::digit#2 * SIZEOF_UNSIGNED_INT Rewriting multiplication to use shift [78] main::$12 = test_last#13 * SIZEOF_UNSIGNED_INT Rewriting multiplication to use shift [90] main::$13 = test_idx#7 * SIZEOF_UNSIGNED_INT Rewriting multiplication to use shift [100] main::$14 = prime_idx#1 * SIZEOF_UNSIGNED_INT Successful SSA optimization Pass2MultiplyToShiftRewriting Inlining constant with var siblings print_str::str#1 Inlining constant with var siblings print_char::ch#1 Inlining constant with var siblings utoa::buffer#0 Inlining constant with var siblings utoa::started#0 Inlining constant with var siblings utoa::digit#0 Inlining constant with var siblings utoa::started#1 Inlining constant with var siblings utoa_append::digit#0 Inlining constant with var siblings mul8u::res#0 Inlining constant with var siblings divr8u::quotient#0 Inlining constant with var siblings divr8u::i#0 Inlining constant with var siblings divr8u::rem#3 Inlining constant with var siblings potential#0 Inlining constant with var siblings test_last#0 Inlining constant with var siblings prime_idx#0 Inlining constant with var siblings test_idx#0 Inlining constant with var siblings test_idx#2 Constant inlined utoa_append::digit#0 = 0 Constant inlined utoa::digit_values#1 = RADIX_DECIMAL_VALUES Constant inlined utoa::buffer#0 = decimal_digits Constant inlined divr8u::rem#3 = 0 Constant inlined utoa::started#1 = 1 Constant inlined test_idx#0 = 2 Constant inlined utoa::started#0 = 0 Constant inlined test_idx#2 = 2 Constant inlined main::$10 = 1*SIZEOF_UNSIGNED_INT Constant inlined main::$11 = 2*SIZEOF_UNSIGNED_INT Constant inlined divr8u::i#0 = 0 Constant inlined divr8u::quotient#0 = 0 Constant inlined mul8u::res#0 = 0 Constant inlined utoa::digit#0 = 0 Constant inlined print_char::ch#1 = ' ' Constant inlined prime_idx#0 = 2 Constant inlined utoa::$4 = utoa::max_digits#1-1 Constant inlined test_last#0 = 2 Constant inlined print_str::str#1 = decimal_digits Constant inlined potential#0 = 3 Successful SSA optimization Pass2ConstantInlining Consolidated array index constant in *(PRIMES+1*SIZEOF_UNSIGNED_INT) Consolidated array index constant in *(PRIMES+2*SIZEOF_UNSIGNED_INT) Successful SSA optimization Pass2ConstantAdditionElimination Finalized unsigned number type (char) 2 Finalized unsigned number type (char) 8 Finalized unsigned number type (char) $a Finalized unsigned number type (char) $10 Finalized unsigned number type (char) 6 Finalized unsigned number type (char) 6 Finalized unsigned number type (unsigned int) $3e8 Finalized unsigned number type (unsigned int) $3e8 Successful SSA optimization PassNFinalizeNumberTypeConversions Added new block during phi lifting utoa::@17(between utoa::@16 and utoa::@13) Added new block during phi lifting mul8u::@6(between mul8u::@2 and mul8u::@4) Added new block during phi lifting divr8u::@7(between divr8u::@3 and divr8u::@1) Added new block during phi lifting divr8u::@8(between divr8u::@1 and divr8u::@2) Added new block during phi lifting divr8u::@9(between divr8u::@2 and divr8u::@3) Added new block during phi lifting main::@12(between main::@11 and main::@1) Added new block during phi lifting main::@13(between main::@8 and main::@2) Added new block during phi lifting main::@14(between main::@4 and main::@3) Added new block during phi lifting main::@15(between main::@9 and main::@4) Adding NOP phi() at start of main::@10 Adding NOP phi() at start of mul8u::@3 Adding NOP phi() at start of div16u8u::@2 Adding NOP phi() at start of print_uint_decimal::@1 Adding NOP phi() at start of print_uint_decimal::@2 Adding NOP phi() at start of utoa Adding NOP phi() at start of utoa::@1 CALL GRAPH Calls in [main] to mul8u:7 div16u8u:20 print_uint_decimal:32 print_char:34 Calls in [div16u8u] to divr8u:68 divr8u:75 Calls in [print_uint_decimal] to utoa:79 print_str:81 Calls in [utoa] to utoa_append:143 Calls in [print_str] to print_char:155 Created 35 initial phi equivalence classes Coalesced [12] test_last#22 = test_last#1 Coalesced [15] potential#23 = potential#1 Coalesced [24] potential#25 = potential#2 Coalesced [37] test_last#21 = test_last#19 Coalesced [38] potential#22 = potential#11 Coalesced [39] prime_idx#21 = prime_idx#1 Coalesced [40] print_char_cursor#41 = print_char_cursor#17 Coalesced [41] test_idx#17 = test_idx#10 Coalesced [42] potential#24 = potential#11 Coalesced [43] test_idx#18 = test_idx#1 Coalesced (already) [44] potential#26 = potential#10 Coalesced (already) [45] test_last#23 = test_last#13 Coalesced [47] mul8u::a#7 = mul8u::a#1 Coalesced [48] mul8u::mb#6 = mul8u::mb#0 Coalesced [56] mul8u::res#9 = mul8u::res#1 Coalesced [60] mul8u::a#8 = mul8u::a#0 Coalesced [61] mul8u::res#7 = mul8u::res#6 Coalesced [62] mul8u::mb#7 = mul8u::mb#1 Coalesced (already) [63] mul8u::res#8 = mul8u::res#2 Coalesced [66] divr8u::dividend#9 = divr8u::dividend#1 Coalesced [67] divr8u::divisor#8 = divr8u::divisor#0 Coalesced [72] divr8u::rem#12 = divr8u::rem#4 Coalesced [73] divr8u::dividend#10 = divr8u::dividend#2 Coalesced [74] divr8u::divisor#9 = divr8u::divisor#1 Coalesced [89] divr8u::rem#13 = divr8u::rem#10 Coalesced [90] divr8u::dividend#11 = divr8u::dividend#5 Coalesced [96] divr8u::rem#16 = divr8u::rem#1 Coalesced [103] divr8u::rem#18 = divr8u::rem#2 Coalesced [104] divr8u::return#8 = divr8u::quotient#2 Coalesced [110] divr8u::rem#14 = divr8u::rem#11 Coalesced [111] divr8u::dividend#12 = divr8u::dividend#0 Coalesced [112] divr8u::quotient#9 = divr8u::return#0 Coalesced [113] divr8u::i#7 = divr8u::i#1 Coalesced [114] divr8u::rem#17 = divr8u::rem#6 Coalesced [115] divr8u::return#7 = divr8u::quotient#1 Coalesced [116] divr8u::rem#15 = divr8u::rem#0 Coalesced [119] utoa::value#17 = utoa::value#0 Coalesced [131] utoa::value#18 = utoa::value#2 Coalesced [132] utoa::started#6 = utoa::started#2 Coalesced [133] utoa::buffer#23 = utoa::buffer#11 Coalesced [136] utoa::digit#7 = utoa::digit#1 Coalesced (already) [137] utoa::value#16 = utoa::value#6 Coalesced (already) [138] utoa::started#5 = utoa::started#4 Coalesced (already) [139] utoa::buffer#22 = utoa::buffer#14 Coalesced [147] utoa::value#19 = utoa::value#1 Coalesced [148] utoa::buffer#24 = utoa::buffer#5 Coalesced [149] print_char_cursor#39 = print_char_cursor#34 Coalesced [154] print_char::ch#3 = print_char::ch#0 Coalesced [157] print_str::str#6 = print_str::str#0 Coalesced (already) [158] print_char_cursor#40 = print_char_cursor#17 Coalesced [159] utoa_append::value#6 = utoa_append::value#0 Coalesced [166] utoa_append::value#7 = utoa_append::value#1 Coalesced [167] utoa_append::digit#5 = utoa_append::digit#1 Coalesced down to 21 phi equivalence classes Culled Empty Block label main::@12 Culled Empty Block label main::@14 Culled Empty Block label main::@15 Culled Empty Block label main::@13 Culled Empty Block label mul8u::@3 Culled Empty Block label mul8u::@6 Culled Empty Block label div16u8u::@2 Culled Empty Block label print_uint_decimal::@2 Culled Empty Block label divr8u::@7 Culled Empty Block label divr8u::@9 Culled Empty Block label divr8u::@8 Culled Empty Block label utoa::@1 Culled Empty Block label utoa::@5 Culled Empty Block label utoa::@17 Renumbering block utoa::@10 to utoa::@1 Renumbering block utoa::@11 to utoa::@2 Renumbering block utoa::@12 to utoa::@3 Renumbering block utoa::@13 to utoa::@4 Renumbering block utoa::@14 to utoa::@5 Renumbering block utoa::@15 to utoa::@6 Renumbering block utoa::@16 to utoa::@7 Renumbering block mul8u::@4 to mul8u::@3 Renumbering block mul8u::@5 to mul8u::@4 Adding NOP phi() at start of main::@10 Adding NOP phi() at start of print_uint_decimal::@1 Adding NOP phi() at start of utoa Adding NOP phi() at start of print_str Adding NOP phi() at start of utoa_append FINAL CONTROL FLOW GRAPH void main() main: scope:[main] from [0] *(PRIMES+1*SIZEOF_UNSIGNED_INT) = 2 [1] *(PRIMES+2*SIZEOF_UNSIGNED_INT) = 3 to:main::@1 main::@1: scope:[main] from main main::@11 [2] print_char_cursor#34 = phi( main/print_screen#0, main::@11/print_char_cursor#17 ) [2] prime_idx#17 = phi( main/2, main::@11/prime_idx#1 ) [2] potential#15 = phi( main/3, main::@11/potential#11 ) [2] test_last#13 = phi( main/2, main::@11/test_last#19 ) [3] main::$12 = test_last#13 << 1 [4] main::p#0 = (char)PRIMES[main::$12] [5] mul8u::a#1 = main::p#0 [6] mul8u::b#0 = main::p#0 [7] call mul8u [8] mul8u::return#2 = mul8u::res#2 to:main::@8 main::@8: scope:[main] from main::@1 [9] main::$0 = mul8u::return#2 [10] if(potential#15<=main::$0) goto main::@2 to:main::@7 main::@7: scope:[main] from main::@8 [11] test_last#1 = ++ test_last#13 to:main::@2 main::@2: scope:[main] from main::@7 main::@8 [12] test_last#19 = phi( main::@7/test_last#1, main::@8/test_last#13 ) [13] potential#1 = potential#15 + 2 to:main::@3 main::@3: scope:[main] from main::@2 main::@4 [14] potential#10 = phi( main::@2/potential#1, main::@4/potential#11 ) [14] test_idx#7 = phi( main::@2/2, main::@4/test_idx#10 ) [15] main::$13 = test_idx#7 << 1 [16] div16u8u::dividend#0 = potential#10 [17] div16u8u::divisor#0 = (char)PRIMES[main::$13] [18] call div16u8u to:main::@9 main::@9: scope:[main] from main::@3 [19] test_idx#1 = ++ test_idx#7 [20] if(rem8u#0!=0) goto main::@4 to:main::@5 main::@5: scope:[main] from main::@9 [21] potential#2 = potential#10 + 2 to:main::@4 main::@4: scope:[main] from main::@5 main::@9 [22] potential#11 = phi( main::@5/potential#2, main::@9/potential#10 ) [22] test_idx#10 = phi( main::@5/2, main::@9/test_idx#1 ) [23] if(test_idx#10<=test_last#19) goto main::@3 to:main::@6 main::@6: scope:[main] from main::@4 [24] prime_idx#1 = ++ prime_idx#17 [25] main::$14 = prime_idx#1 << 1 [26] main::$15 = PRIMES + main::$14 [27] *main::$15 = potential#11 [28] print_uint_decimal::w#0 = potential#11 [29] call print_uint_decimal to:main::@10 main::@10: scope:[main] from main::@6 [30] phi() [31] call print_char to:main::@11 main::@11: scope:[main] from main::@10 [32] if(prime_idx#1<$3e8) goto main::@1 to:main::@return main::@return: scope:[main] from main::@11 [33] return to:@return unsigned int mul8u(char a , char b) mul8u: scope:[mul8u] from main::@1 [34] mul8u::mb#0 = (unsigned int)mul8u::b#0 to:mul8u::@1 mul8u::@1: scope:[mul8u] from mul8u mul8u::@3 [35] mul8u::mb#2 = phi( mul8u/mul8u::mb#0, mul8u::@3/mul8u::mb#1 ) [35] mul8u::res#2 = phi( mul8u/0, mul8u::@3/mul8u::res#6 ) [35] mul8u::a#2 = phi( mul8u/mul8u::a#1, mul8u::@3/mul8u::a#0 ) [36] if(mul8u::a#2!=0) goto mul8u::@2 to:mul8u::@return mul8u::@return: scope:[mul8u] from mul8u::@1 [37] return to:@return mul8u::@2: scope:[mul8u] from mul8u::@1 [38] mul8u::$1 = mul8u::a#2 & 1 [39] if(mul8u::$1==0) goto mul8u::@3 to:mul8u::@4 mul8u::@4: scope:[mul8u] from mul8u::@2 [40] mul8u::res#1 = mul8u::res#2 + mul8u::mb#2 to:mul8u::@3 mul8u::@3: scope:[mul8u] from mul8u::@2 mul8u::@4 [41] mul8u::res#6 = phi( mul8u::@2/mul8u::res#2, mul8u::@4/mul8u::res#1 ) [42] mul8u::a#0 = mul8u::a#2 >> 1 [43] mul8u::mb#1 = mul8u::mb#2 << 1 to:mul8u::@1 unsigned int div16u8u(unsigned int dividend , char divisor) div16u8u: scope:[div16u8u] from main::@3 [44] divr8u::dividend#1 = byte1 div16u8u::dividend#0 [45] divr8u::divisor#0 = div16u8u::divisor#0 [46] call divr8u to:div16u8u::@1 div16u8u::@1: scope:[div16u8u] from div16u8u [47] divr8u::dividend#2 = byte0 div16u8u::dividend#0 [48] divr8u::divisor#1 = div16u8u::divisor#0 [49] divr8u::rem#4 = rem8u#0 [50] call divr8u to:div16u8u::@return div16u8u::@return: scope:[div16u8u] from div16u8u::@1 [51] return to:@return void print_uint_decimal(unsigned int w) print_uint_decimal: scope:[print_uint_decimal] from main::@6 [52] utoa::value#0 = print_uint_decimal::w#0 [53] call utoa to:print_uint_decimal::@1 print_uint_decimal::@1: scope:[print_uint_decimal] from print_uint_decimal [54] phi() [55] call print_str to:print_uint_decimal::@return print_uint_decimal::@return: scope:[print_uint_decimal] from print_uint_decimal::@1 [56] return to:@return void print_char(char ch) print_char: scope:[print_char] from main::@10 print_str::@2 [57] print_char::ch#2 = phi( main::@10/' ', print_str::@2/print_char::ch#0 ) [58] *print_char_cursor#1 = print_char::ch#2 [59] print_char_cursor#17 = ++ print_char_cursor#1 to:print_char::@return print_char::@return: scope:[print_char] from print_char [60] return to:@return char divr8u(char dividend , char divisor , char rem) divr8u: scope:[divr8u] from div16u8u div16u8u::@1 [61] divr8u::divisor#6 = phi( div16u8u/divr8u::divisor#0, div16u8u::@1/divr8u::divisor#1 ) [61] divr8u::dividend#5 = phi( div16u8u/divr8u::dividend#1, div16u8u::@1/divr8u::dividend#2 ) [61] divr8u::rem#10 = phi( div16u8u/0, div16u8u::@1/divr8u::rem#4 ) to:divr8u::@1 divr8u::@1: scope:[divr8u] from divr8u divr8u::@3 [62] divr8u::i#2 = phi( divr8u/0, divr8u::@3/divr8u::i#1 ) [62] divr8u::quotient#3 = phi( divr8u/0, divr8u::@3/divr8u::return#0 ) [62] divr8u::dividend#3 = phi( divr8u/divr8u::dividend#5, divr8u::@3/divr8u::dividend#0 ) [62] divr8u::rem#5 = phi( divr8u/divr8u::rem#10, divr8u::@3/divr8u::rem#11 ) [63] divr8u::rem#0 = divr8u::rem#5 << 1 [64] divr8u::$1 = divr8u::dividend#3 & $80 [65] if(divr8u::$1==0) goto divr8u::@2 to:divr8u::@4 divr8u::@4: scope:[divr8u] from divr8u::@1 [66] divr8u::rem#1 = divr8u::rem#0 | 1 to:divr8u::@2 divr8u::@2: scope:[divr8u] from divr8u::@1 divr8u::@4 [67] divr8u::rem#6 = phi( divr8u::@1/divr8u::rem#0, divr8u::@4/divr8u::rem#1 ) [68] divr8u::dividend#0 = divr8u::dividend#3 << 1 [69] divr8u::quotient#1 = divr8u::quotient#3 << 1 [70] if(divr8u::rem#6=utoa::digit_value#0) goto utoa::@5 to:utoa::@4 utoa::@4: scope:[utoa] from utoa::@6 utoa::@7 [90] utoa::buffer#14 = phi( utoa::@7/utoa::buffer#11, utoa::@6/utoa::buffer#5 ) [90] utoa::started#4 = phi( utoa::@7/utoa::started#2, utoa::@6/1 ) [90] utoa::value#6 = phi( utoa::@7/utoa::value#2, utoa::@6/utoa::value#1 ) [91] utoa::digit#1 = ++ utoa::digit#2 to:utoa::@1 utoa::@5: scope:[utoa] from utoa::@2 utoa::@7 [92] utoa_append::buffer#0 = utoa::buffer#11 [93] utoa_append::value#0 = utoa::value#2 [94] utoa_append::sub#0 = utoa::digit_value#0 [95] call utoa_append [96] utoa_append::return#0 = utoa_append::value#2 to:utoa::@6 utoa::@6: scope:[utoa] from utoa::@5 [97] utoa::value#1 = utoa_append::return#0 [98] utoa::buffer#5 = ++ utoa::buffer#11 to:utoa::@4 void print_str(char *str) print_str: scope:[print_str] from print_uint_decimal::@1 [99] phi() to:print_str::@1 print_str::@1: scope:[print_str] from print_str print_str::@3 [100] print_char_cursor#1 = phi( print_str/print_char_cursor#34, print_str::@3/print_char_cursor#17 ) [100] print_str::str#2 = phi( print_str/decimal_digits, print_str::@3/print_str::str#0 ) [101] if(0!=*print_str::str#2) goto print_str::@2 to:print_str::@return print_str::@return: scope:[print_str] from print_str::@1 [102] return to:@return print_str::@2: scope:[print_str] from print_str::@1 [103] print_char::ch#0 = *print_str::str#2 [104] call print_char to:print_str::@3 print_str::@3: scope:[print_str] from print_str::@2 [105] print_str::str#0 = ++ print_str::str#2 to:print_str::@1 unsigned int utoa_append(char *buffer , unsigned int value , unsigned int sub) utoa_append: scope:[utoa_append] from utoa::@5 [106] phi() to:utoa_append::@1 utoa_append::@1: scope:[utoa_append] from utoa_append utoa_append::@2 [107] utoa_append::digit#2 = phi( utoa_append/0, utoa_append::@2/utoa_append::digit#1 ) [107] utoa_append::value#2 = phi( utoa_append/utoa_append::value#0, utoa_append::@2/utoa_append::value#1 ) [108] if(utoa_append::value#2>=utoa_append::sub#0) goto utoa_append::@2 to:utoa_append::@3 utoa_append::@3: scope:[utoa_append] from utoa_append::@1 [109] *utoa_append::buffer#0 = DIGITS[utoa_append::digit#2] to:utoa_append::@return utoa_append::@return: scope:[utoa_append] from utoa_append::@3 [110] return to:@return utoa_append::@2: scope:[utoa_append] from utoa_append::@1 [111] utoa_append::digit#1 = ++ utoa_append::digit#2 [112] utoa_append::value#1 = utoa_append::value#2 - utoa_append::sub#0 to:utoa_append::@1 null depth in calling loop Loop head: print_str::@1 tails: print_str::@3 blocks: print_str::@3 print_str::@2 print_str::@1 in scope print_char VARIABLE REGISTER WEIGHTS unsigned int div16u8u(unsigned int dividend , char divisor) unsigned int div16u8u::dividend unsigned int div16u8u::dividend#0 // 420.59999999999997 char div16u8u::divisor char div16u8u::divisor#0 // 420.59999999999997 unsigned int div16u8u::quotient char div16u8u::quotient_hi char div16u8u::quotient_lo unsigned int div16u8u::return char divr8u(char dividend , char divisor , char rem) char divr8u::$1 // 2.0000002E7 char divr8u::dividend char divr8u::dividend#0 // 2500000.25 char divr8u::dividend#1 // 1001.0 char divr8u::dividend#2 // 667.3333333333334 char divr8u::dividend#3 // 5001667.333333333 char divr8u::dividend#5 // 12003.0 char divr8u::divisor char divr8u::divisor#0 // 2002.0 char divr8u::divisor#1 // 1001.0 char divr8u::divisor#6 // 1333466.933333333 char divr8u::i char divr8u::i#1 // 1.50000015E7 char divr8u::i#2 // 1666666.8333333333 char divr8u::quotient char divr8u::quotient#1 // 1.50000015E7 char divr8u::quotient#2 // 1.0000001E7 char divr8u::quotient#3 // 2857143.1428571427 char divr8u::rem char divr8u::rem#0 // 1.0000001E7 char divr8u::rem#1 // 2.0000002E7 char divr8u::rem#10 // 11002.0 char divr8u::rem#11 // 1.0003334666666666E7 char divr8u::rem#2 // 2.0000002E7 char divr8u::rem#4 // 2002.0 char divr8u::rem#5 // 2.0010003E7 char divr8u::rem#6 // 1.0000001E7 char divr8u::return char divr8u::return#0 // 1.0000001E7 void main() unsigned int main::$0 // 22.0 char main::$12 // 11.0 char main::$13 // 50.5 unsigned int main::$14 // 22.0 unsigned int *main::$15 // 22.0 char main::p char main::p#0 // 16.5 unsigned int mul8u(char a , char b) char mul8u::$1 // 20002.0 char mul8u::a char mul8u::a#0 // 10001.0 char mul8u::a#1 // 37.33333333333333 char mul8u::a#2 // 6684.166666666666 char mul8u::b char mul8u::b#0 // 11.0 unsigned int mul8u::mb unsigned int mul8u::mb#0 // 202.0 unsigned int mul8u::mb#1 // 20002.0 unsigned int mul8u::mb#2 // 4300.571428571429 unsigned int mul8u::res unsigned int mul8u::res#1 // 20002.0 unsigned int mul8u::res#2 // 5002.333333333333 unsigned int mul8u::res#6 // 10001.0 unsigned int mul8u::return unsigned int mul8u::return#2 // 22.0 unsigned int potential unsigned int potential#1 // 22.0 unsigned int potential#10 // 59.28571428571429 unsigned int potential#11 // 30.545454545454547 unsigned int potential#15 // 3.0 unsigned int potential#2 // 202.0 unsigned int prime_idx unsigned int prime_idx#1 // 4.888888888888889 unsigned int prime_idx#17 // 1.0 void print_char(char ch) char print_char::ch char print_char::ch#0 // 200002.0 char print_char::ch#2 // 1100002.0 char *print_char_cursor char *print_char_cursor#1 // 210100.40000000002 char *print_char_cursor#17 // 183335.50000000003 char *print_char_cursor#34 // 32.64516129032258 char *print_line_cursor char *print_screen void print_str(char *str) char *print_str::str char *print_str::str#0 // 200002.0 char *print_str::str#2 // 100001.0 void print_uint_decimal(unsigned int w) unsigned int print_uint_decimal::w unsigned int print_uint_decimal::w#0 // 112.0 char rem8u char rem8u#0 // 1233.6666666666665 char test_idx char test_idx#1 // 101.0 char test_idx#10 // 151.5 char test_idx#7 // 60.599999999999994 char test_last char test_last#1 // 22.0 char test_last#13 // 4.888888888888889 char test_last#19 // 6.380952380952381 void utoa(unsigned int value , char *buffer , char radix) char utoa::$10 // 200002.0 char utoa::$11 // 2002.0 char *utoa::buffer char *utoa::buffer#11 // 28714.714285714286 char *utoa::buffer#14 // 150001.5 char *utoa::buffer#4 // 2002.0 char *utoa::buffer#5 // 200002.0 char utoa::digit char utoa::digit#1 // 200002.0 char utoa::digit#2 // 28571.714285714286 unsigned int utoa::digit_value unsigned int utoa::digit_value#0 // 60000.600000000006 unsigned int *utoa::digit_values char utoa::max_digits char utoa::radix char utoa::started char utoa::started#2 // 50000.5 char utoa::started#4 // 100001.0 unsigned int utoa::value unsigned int utoa::value#0 // 551.0 unsigned int utoa::value#1 // 100001.0 unsigned int utoa::value#2 // 57286.42857142857 unsigned int utoa::value#6 // 150001.5 unsigned int utoa_append(char *buffer , unsigned int value , unsigned int sub) char *utoa_append::buffer char *utoa_append::buffer#0 // 137500.25 char utoa_append::digit char utoa_append::digit#1 // 1.000000001E9 char utoa_append::digit#2 // 1.0005000015E9 unsigned int utoa_append::return unsigned int utoa_append::return#0 // 200002.0 unsigned int utoa_append::sub unsigned int utoa_append::sub#0 // 3.333500005E8 unsigned int utoa_append::value unsigned int utoa_append::value#0 // 366667.3333333334 unsigned int utoa_append::value#1 // 2.000000002E9 unsigned int utoa_append::value#2 // 5.0018333416666675E8 Initial phi equivalence classes [ test_last#13 test_last#19 test_last#1 ] [ prime_idx#17 prime_idx#1 ] [ test_idx#7 test_idx#10 test_idx#1 ] [ potential#10 potential#1 potential#15 potential#11 potential#2 ] [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] [ mul8u::mb#2 mul8u::mb#0 mul8u::mb#1 ] [ print_char::ch#2 print_char::ch#0 ] [ divr8u::divisor#6 divr8u::divisor#0 divr8u::divisor#1 ] [ divr8u::rem#5 divr8u::rem#10 divr8u::rem#4 divr8u::rem#11 divr8u::rem#6 divr8u::rem#0 divr8u::rem#1 divr8u::rem#2 ] [ divr8u::dividend#3 divr8u::dividend#5 divr8u::dividend#1 divr8u::dividend#2 divr8u::dividend#0 ] [ divr8u::quotient#3 divr8u::return#0 divr8u::quotient#1 divr8u::quotient#2 ] [ divr8u::i#2 divr8u::i#1 ] [ utoa::digit#2 utoa::digit#1 ] [ utoa::value#2 utoa::value#6 utoa::value#0 utoa::value#1 ] [ utoa::started#2 utoa::started#4 ] [ utoa::buffer#11 utoa::buffer#14 utoa::buffer#5 ] [ print_str::str#2 print_str::str#0 ] [ print_char_cursor#1 print_char_cursor#34 print_char_cursor#17 ] [ utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 ] [ utoa_append::digit#2 utoa_append::digit#1 ] Added variable main::$12 to live range equivalence class [ main::$12 ] Added variable main::p#0 to live range equivalence class [ main::p#0 ] Added variable mul8u::b#0 to live range equivalence class [ mul8u::b#0 ] Added variable mul8u::return#2 to live range equivalence class [ mul8u::return#2 ] Added variable main::$0 to live range equivalence class [ main::$0 ] Added variable main::$13 to live range equivalence class [ main::$13 ] Added variable div16u8u::dividend#0 to live range equivalence class [ div16u8u::dividend#0 ] Added variable div16u8u::divisor#0 to live range equivalence class [ div16u8u::divisor#0 ] Added variable main::$14 to live range equivalence class [ main::$14 ] Added variable main::$15 to live range equivalence class [ main::$15 ] Added variable print_uint_decimal::w#0 to live range equivalence class [ print_uint_decimal::w#0 ] Added variable mul8u::$1 to live range equivalence class [ mul8u::$1 ] Added variable divr8u::$1 to live range equivalence class [ divr8u::$1 ] Added variable rem8u#0 to live range equivalence class [ rem8u#0 ] Added variable utoa::$11 to live range equivalence class [ utoa::$11 ] Added variable utoa::buffer#4 to live range equivalence class [ utoa::buffer#4 ] Added variable utoa::$10 to live range equivalence class [ utoa::$10 ] Added variable utoa::digit_value#0 to live range equivalence class [ utoa::digit_value#0 ] Added variable utoa_append::buffer#0 to live range equivalence class [ utoa_append::buffer#0 ] Added variable utoa_append::sub#0 to live range equivalence class [ utoa_append::sub#0 ] Added variable utoa_append::return#0 to live range equivalence class [ utoa_append::return#0 ] Complete equivalence classes [ test_last#13 test_last#19 test_last#1 ] [ prime_idx#17 prime_idx#1 ] [ test_idx#7 test_idx#10 test_idx#1 ] [ potential#10 potential#1 potential#15 potential#11 potential#2 ] [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] [ mul8u::mb#2 mul8u::mb#0 mul8u::mb#1 ] [ print_char::ch#2 print_char::ch#0 ] [ divr8u::divisor#6 divr8u::divisor#0 divr8u::divisor#1 ] [ divr8u::rem#5 divr8u::rem#10 divr8u::rem#4 divr8u::rem#11 divr8u::rem#6 divr8u::rem#0 divr8u::rem#1 divr8u::rem#2 ] [ divr8u::dividend#3 divr8u::dividend#5 divr8u::dividend#1 divr8u::dividend#2 divr8u::dividend#0 ] [ divr8u::quotient#3 divr8u::return#0 divr8u::quotient#1 divr8u::quotient#2 ] [ divr8u::i#2 divr8u::i#1 ] [ utoa::digit#2 utoa::digit#1 ] [ utoa::value#2 utoa::value#6 utoa::value#0 utoa::value#1 ] [ utoa::started#2 utoa::started#4 ] [ utoa::buffer#11 utoa::buffer#14 utoa::buffer#5 ] [ print_str::str#2 print_str::str#0 ] [ print_char_cursor#1 print_char_cursor#34 print_char_cursor#17 ] [ utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 ] [ utoa_append::digit#2 utoa_append::digit#1 ] [ main::$12 ] [ main::p#0 ] [ mul8u::b#0 ] [ mul8u::return#2 ] [ main::$0 ] [ main::$13 ] [ div16u8u::dividend#0 ] [ div16u8u::divisor#0 ] [ main::$14 ] [ main::$15 ] [ print_uint_decimal::w#0 ] [ mul8u::$1 ] [ divr8u::$1 ] [ rem8u#0 ] [ utoa::$11 ] [ utoa::buffer#4 ] [ utoa::$10 ] [ utoa::digit_value#0 ] [ utoa_append::buffer#0 ] [ utoa_append::sub#0 ] [ utoa_append::return#0 ] Allocated zp[2]:2 [ utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 ] Allocated zp[1]:4 [ utoa_append::digit#2 utoa_append::digit#1 ] Allocated zp[2]:5 [ utoa_append::sub#0 ] Allocated zp[1]:7 [ divr8u::rem#5 divr8u::rem#10 divr8u::rem#4 divr8u::rem#11 divr8u::rem#6 divr8u::rem#0 divr8u::rem#1 divr8u::rem#2 ] Allocated zp[1]:8 [ divr8u::quotient#3 divr8u::return#0 divr8u::quotient#1 divr8u::quotient#2 ] Allocated zp[1]:9 [ divr8u::$1 ] Allocated zp[1]:10 [ divr8u::i#2 divr8u::i#1 ] Allocated zp[1]:11 [ divr8u::dividend#3 divr8u::dividend#5 divr8u::dividend#1 divr8u::dividend#2 divr8u::dividend#0 ] Allocated zp[1]:12 [ divr8u::divisor#6 divr8u::divisor#0 divr8u::divisor#1 ] Allocated zp[1]:13 [ print_char::ch#2 print_char::ch#0 ] Allocated zp[2]:14 [ print_char_cursor#1 print_char_cursor#34 print_char_cursor#17 ] Allocated zp[2]:16 [ utoa::buffer#11 utoa::buffer#14 utoa::buffer#5 ] Allocated zp[2]:18 [ utoa::value#2 utoa::value#6 utoa::value#0 utoa::value#1 ] Allocated zp[2]:20 [ print_str::str#2 print_str::str#0 ] Allocated zp[1]:22 [ utoa::digit#2 utoa::digit#1 ] Allocated zp[1]:23 [ utoa::$10 ] Allocated zp[2]:24 [ utoa_append::return#0 ] Allocated zp[1]:26 [ utoa::started#2 utoa::started#4 ] Allocated zp[2]:27 [ utoa_append::buffer#0 ] Allocated zp[2]:29 [ utoa::digit_value#0 ] Allocated zp[2]:31 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] Allocated zp[2]:33 [ mul8u::mb#2 mul8u::mb#0 mul8u::mb#1 ] Allocated zp[1]:35 [ mul8u::$1 ] Allocated zp[1]:36 [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] Allocated zp[1]:37 [ utoa::$11 ] Allocated zp[2]:38 [ utoa::buffer#4 ] Allocated zp[1]:40 [ rem8u#0 ] Allocated zp[2]:41 [ div16u8u::dividend#0 ] Allocated zp[1]:43 [ div16u8u::divisor#0 ] Allocated zp[2]:44 [ potential#10 potential#1 potential#15 potential#11 potential#2 ] Allocated zp[1]:46 [ test_idx#7 test_idx#10 test_idx#1 ] Allocated zp[2]:47 [ print_uint_decimal::w#0 ] Allocated zp[1]:49 [ main::$13 ] Allocated zp[1]:50 [ test_last#13 test_last#19 test_last#1 ] Allocated zp[2]:51 [ mul8u::return#2 ] Allocated zp[2]:53 [ main::$0 ] Allocated zp[2]:55 [ main::$14 ] Allocated zp[2]:57 [ main::$15 ] Allocated zp[1]:59 [ main::p#0 ] Allocated zp[1]:60 [ main::$12 ] Allocated zp[1]:61 [ mul8u::b#0 ] Allocated zp[2]:62 [ prime_idx#17 prime_idx#1 ] REGISTER UPLIFT POTENTIAL REGISTERS Statement [0] *(PRIMES+1*SIZEOF_UNSIGNED_INT) = 2 [ ] ( [ ] { } ) always clobbers reg byte a Statement [1] *(PRIMES+2*SIZEOF_UNSIGNED_INT) = 3 [ ] ( [ ] { } ) always clobbers reg byte a Statement [3] main::$12 = test_last#13 << 1 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::$12 ] ( [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::$12 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:50 [ test_last#13 test_last#19 test_last#1 ] Statement [4] main::p#0 = (char)PRIMES[main::$12] [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::p#0 ] ( [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::p#0 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Statement [8] mul8u::return#2 = mul8u::res#2 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 mul8u::return#2 ] ( [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 mul8u::return#2 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Statement [9] main::$0 = mul8u::return#2 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::$0 ] ( [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::$0 ] { } ) always clobbers reg byte a Statement [10] if(potential#15<=main::$0) goto main::@2 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 ] ( [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 ] { } ) always clobbers reg byte a Statement [13] potential#1 = potential#15 + 2 [ prime_idx#17 print_char_cursor#34 test_last#19 potential#1 ] ( [ prime_idx#17 print_char_cursor#34 test_last#19 potential#1 ] { } ) always clobbers reg byte a Statement [15] main::$13 = test_idx#7 << 1 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 main::$13 ] ( [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 main::$13 ] { { potential#10 = div16u8u::dividend#0 } } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:46 [ test_idx#7 test_idx#10 test_idx#1 ] Statement [16] div16u8u::dividend#0 = potential#10 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 main::$13 div16u8u::dividend#0 ] ( [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 main::$13 div16u8u::dividend#0 ] { { potential#10 = div16u8u::dividend#0 } } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:49 [ main::$13 ] Statement [17] div16u8u::divisor#0 = (char)PRIMES[main::$13] [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 div16u8u::dividend#0 div16u8u::divisor#0 ] ( [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 div16u8u::dividend#0 div16u8u::divisor#0 ] { { potential#10 = div16u8u::dividend#0 } } ) always clobbers reg byte a Statement [21] potential#2 = potential#10 + 2 [ prime_idx#17 print_char_cursor#34 test_last#19 potential#2 ] ( [ prime_idx#17 print_char_cursor#34 test_last#19 potential#2 ] { } ) always clobbers reg byte a Statement [25] main::$14 = prime_idx#1 << 1 [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 main::$14 ] ( [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 main::$14 ] { { potential#11 = print_uint_decimal::w#0 } } ) always clobbers reg byte a Statement [26] main::$15 = PRIMES + main::$14 [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 main::$15 ] ( [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 main::$15 ] { { potential#11 = print_uint_decimal::w#0 } } ) always clobbers reg byte a Statement [27] *main::$15 = potential#11 [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 ] ( [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 ] { { potential#11 = print_uint_decimal::w#0 } } ) always clobbers reg byte a reg byte y Removing always clobbered register reg byte y as potential for zp[1]:50 [ test_last#13 test_last#19 test_last#1 ] Statement [28] print_uint_decimal::w#0 = potential#11 [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 print_uint_decimal::w#0 ] ( [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 print_uint_decimal::w#0 ] { { potential#11 = print_uint_decimal::w#0 } } ) always clobbers reg byte a Statement [32] if(prime_idx#1<$3e8) goto main::@1 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#17 ] ( [ test_last#19 potential#11 prime_idx#1 print_char_cursor#17 ] { } ) always clobbers reg byte a Statement [34] mul8u::mb#0 = (unsigned int)mul8u::b#0 [ mul8u::a#1 mul8u::mb#0 ] ( mul8u:7 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 mul8u::a#1 mul8u::mb#0 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:36 [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] Statement [38] mul8u::$1 = mul8u::a#2 & 1 [ mul8u::res#2 mul8u::a#2 mul8u::mb#2 mul8u::$1 ] ( mul8u:7 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 mul8u::res#2 mul8u::a#2 mul8u::mb#2 mul8u::$1 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Statement [40] mul8u::res#1 = mul8u::res#2 + mul8u::mb#2 [ mul8u::a#2 mul8u::mb#2 mul8u::res#1 ] ( mul8u:7 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 mul8u::a#2 mul8u::mb#2 mul8u::res#1 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Statement [52] utoa::value#0 = print_uint_decimal::w#0 [ print_char_cursor#34 utoa::value#0 ] ( print_uint_decimal:29 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::value#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [58] *print_char_cursor#1 = print_char::ch#2 [ print_char_cursor#1 ] ( print_char:31 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#1 ] { } print_uint_decimal:29::print_str:55::print_char:104 [ test_last#19 potential#11 prime_idx#1 print_str::str#2 print_char_cursor#1 ] { { potential#11 = print_uint_decimal::w#0 } { print_char::ch#0 = print_char::ch#2 } } ) always clobbers reg byte y Statement [66] divr8u::rem#1 = divr8u::rem#0 | 1 [ divr8u::divisor#6 divr8u::dividend#3 divr8u::quotient#3 divr8u::i#2 divr8u::rem#1 ] ( div16u8u:18::divr8u:46 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 div16u8u::dividend#0 div16u8u::divisor#0 divr8u::divisor#6 divr8u::dividend#3 divr8u::quotient#3 divr8u::i#2 divr8u::rem#1 ] { { potential#10 = div16u8u::dividend#0 } { divr8u::dividend#1 = divr8u::dividend#5 } { divr8u::divisor#0 = divr8u::divisor#6 div16u8u::divisor#0 } } div16u8u:18::divr8u:50 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 divr8u::divisor#6 divr8u::dividend#3 divr8u::quotient#3 divr8u::i#2 divr8u::rem#1 ] { { potential#10 = div16u8u::dividend#0 } { divr8u::rem#10 = divr8u::rem#4 rem8u#0 } { divr8u::dividend#2 = divr8u::dividend#5 } { divr8u::divisor#1 = divr8u::divisor#6 div16u8u::divisor#0 } } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:43 [ div16u8u::divisor#0 ] Removing always clobbered register reg byte a as potential for zp[1]:12 [ divr8u::divisor#6 divr8u::divisor#0 divr8u::divisor#1 ] Removing always clobbered register reg byte a as potential for zp[1]:11 [ divr8u::dividend#3 divr8u::dividend#5 divr8u::dividend#1 divr8u::dividend#2 divr8u::dividend#0 ] Removing always clobbered register reg byte a as potential for zp[1]:8 [ divr8u::quotient#3 divr8u::return#0 divr8u::quotient#1 divr8u::quotient#2 ] Removing always clobbered register reg byte a as potential for zp[1]:10 [ divr8u::i#2 divr8u::i#1 ] Statement [72] divr8u::rem#2 = divr8u::rem#6 - divr8u::divisor#6 [ divr8u::divisor#6 divr8u::i#2 divr8u::dividend#0 divr8u::quotient#2 divr8u::rem#2 ] ( div16u8u:18::divr8u:46 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 div16u8u::dividend#0 div16u8u::divisor#0 divr8u::divisor#6 divr8u::i#2 divr8u::dividend#0 divr8u::quotient#2 divr8u::rem#2 ] { { potential#10 = div16u8u::dividend#0 } { divr8u::dividend#1 = divr8u::dividend#5 } { divr8u::divisor#0 = divr8u::divisor#6 div16u8u::divisor#0 } } div16u8u:18::divr8u:50 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 divr8u::divisor#6 divr8u::i#2 divr8u::dividend#0 divr8u::quotient#2 divr8u::rem#2 ] { { potential#10 = div16u8u::dividend#0 } { divr8u::rem#10 = divr8u::rem#4 rem8u#0 } { divr8u::dividend#2 = divr8u::dividend#5 } { divr8u::divisor#1 = divr8u::divisor#6 div16u8u::divisor#0 } } ) always clobbers reg byte a Statement [82] *utoa::buffer#11 = DIGITS[utoa::$11] [ utoa::buffer#11 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::buffer#11 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a reg byte y Statement [83] utoa::buffer#4 = ++ utoa::buffer#11 [ utoa::buffer#4 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::buffer#4 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [84] *utoa::buffer#4 = 0 [ ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a reg byte y Statement [86] utoa::$10 = utoa::digit#2 << 1 [ utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::$10 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::$10 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:22 [ utoa::digit#2 utoa::digit#1 ] Removing always clobbered register reg byte a as potential for zp[1]:26 [ utoa::started#2 utoa::started#4 ] Statement [87] utoa::digit_value#0 = RADIX_DECIMAL_VALUES[utoa::$10] [ utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::digit_value#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::digit_value#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [89] if(utoa::value#2>=utoa::digit_value#0) goto utoa::@5 [ utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::digit_value#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::digit_value#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [92] utoa_append::buffer#0 = utoa::buffer#11 [ utoa::digit#2 utoa::value#2 utoa::buffer#11 utoa::digit_value#0 utoa_append::buffer#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::value#2 utoa::buffer#11 utoa::digit_value#0 utoa_append::buffer#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Statement [93] utoa_append::value#0 = utoa::value#2 [ utoa::digit#2 utoa::buffer#11 utoa::digit_value#0 utoa_append::buffer#0 utoa_append::value#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa::digit_value#0 utoa_append::buffer#0 utoa_append::value#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Statement [94] utoa_append::sub#0 = utoa::digit_value#0 [ utoa::digit#2 utoa::buffer#11 utoa_append::buffer#0 utoa_append::value#0 utoa_append::sub#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa_append::buffer#0 utoa_append::value#0 utoa_append::sub#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Statement [96] utoa_append::return#0 = utoa_append::value#2 [ utoa::digit#2 utoa::buffer#11 utoa_append::return#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa_append::return#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Statement [97] utoa::value#1 = utoa_append::return#0 [ utoa::digit#2 utoa::buffer#11 utoa::value#1 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa::value#1 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [101] if(0!=*print_str::str#2) goto print_str::@2 [ print_char_cursor#1 print_str::str#2 ] ( print_uint_decimal:29::print_str:55 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#1 print_str::str#2 ] { { potential#11 = print_uint_decimal::w#0 } } ) always clobbers reg byte a reg byte y Statement [103] print_char::ch#0 = *print_str::str#2 [ print_char::ch#0 print_char_cursor#1 print_str::str#2 ] ( print_uint_decimal:29::print_str:55 [ test_last#19 potential#11 prime_idx#1 print_char::ch#0 print_char_cursor#1 print_str::str#2 ] { { potential#11 = print_uint_decimal::w#0 } { print_char::ch#0 = print_char::ch#2 } } ) always clobbers reg byte a reg byte y Statement [108] if(utoa_append::value#2>=utoa_append::sub#0) goto utoa_append::@2 [ utoa_append::buffer#0 utoa_append::sub#0 utoa_append::value#2 utoa_append::digit#2 ] ( print_uint_decimal:29::utoa:53::utoa_append:95 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa_append::buffer#0 utoa_append::sub#0 utoa_append::value#2 utoa_append::digit#2 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:4 [ utoa_append::digit#2 utoa_append::digit#1 ] Statement [109] *utoa_append::buffer#0 = DIGITS[utoa_append::digit#2] [ utoa_append::value#2 ] ( print_uint_decimal:29::utoa:53::utoa_append:95 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa_append::value#2 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a reg byte y Removing always clobbered register reg byte y as potential for zp[1]:22 [ utoa::digit#2 utoa::digit#1 ] Statement [112] utoa_append::value#1 = utoa_append::value#2 - utoa_append::sub#0 [ utoa_append::buffer#0 utoa_append::sub#0 utoa_append::value#1 utoa_append::digit#1 ] ( print_uint_decimal:29::utoa:53::utoa_append:95 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa_append::buffer#0 utoa_append::sub#0 utoa_append::value#1 utoa_append::digit#1 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Statement [0] *(PRIMES+1*SIZEOF_UNSIGNED_INT) = 2 [ ] ( [ ] { } ) always clobbers reg byte a Statement [1] *(PRIMES+2*SIZEOF_UNSIGNED_INT) = 3 [ ] ( [ ] { } ) always clobbers reg byte a Statement [3] main::$12 = test_last#13 << 1 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::$12 ] ( [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::$12 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Statement [4] main::p#0 = (char)PRIMES[main::$12] [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::p#0 ] ( [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::p#0 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Statement [8] mul8u::return#2 = mul8u::res#2 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 mul8u::return#2 ] ( [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 mul8u::return#2 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Statement [9] main::$0 = mul8u::return#2 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::$0 ] ( [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::$0 ] { } ) always clobbers reg byte a Statement [10] if(potential#15<=main::$0) goto main::@2 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 ] ( [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 ] { } ) always clobbers reg byte a Statement [13] potential#1 = potential#15 + 2 [ prime_idx#17 print_char_cursor#34 test_last#19 potential#1 ] ( [ prime_idx#17 print_char_cursor#34 test_last#19 potential#1 ] { } ) always clobbers reg byte a Statement [15] main::$13 = test_idx#7 << 1 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 main::$13 ] ( [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 main::$13 ] { { potential#10 = div16u8u::dividend#0 } } ) always clobbers reg byte a Statement [16] div16u8u::dividend#0 = potential#10 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 main::$13 div16u8u::dividend#0 ] ( [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 main::$13 div16u8u::dividend#0 ] { { potential#10 = div16u8u::dividend#0 } } ) always clobbers reg byte a Statement [17] div16u8u::divisor#0 = (char)PRIMES[main::$13] [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 div16u8u::dividend#0 div16u8u::divisor#0 ] ( [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 div16u8u::dividend#0 div16u8u::divisor#0 ] { { potential#10 = div16u8u::dividend#0 } } ) always clobbers reg byte a Statement [21] potential#2 = potential#10 + 2 [ prime_idx#17 print_char_cursor#34 test_last#19 potential#2 ] ( [ prime_idx#17 print_char_cursor#34 test_last#19 potential#2 ] { } ) always clobbers reg byte a Statement [25] main::$14 = prime_idx#1 << 1 [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 main::$14 ] ( [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 main::$14 ] { { potential#11 = print_uint_decimal::w#0 } } ) always clobbers reg byte a Statement [26] main::$15 = PRIMES + main::$14 [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 main::$15 ] ( [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 main::$15 ] { { potential#11 = print_uint_decimal::w#0 } } ) always clobbers reg byte a Statement [27] *main::$15 = potential#11 [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 ] ( [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 ] { { potential#11 = print_uint_decimal::w#0 } } ) always clobbers reg byte a reg byte y Statement [28] print_uint_decimal::w#0 = potential#11 [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 print_uint_decimal::w#0 ] ( [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 print_uint_decimal::w#0 ] { { potential#11 = print_uint_decimal::w#0 } } ) always clobbers reg byte a Statement [32] if(prime_idx#1<$3e8) goto main::@1 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#17 ] ( [ test_last#19 potential#11 prime_idx#1 print_char_cursor#17 ] { } ) always clobbers reg byte a Statement [34] mul8u::mb#0 = (unsigned int)mul8u::b#0 [ mul8u::a#1 mul8u::mb#0 ] ( mul8u:7 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 mul8u::a#1 mul8u::mb#0 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Statement [38] mul8u::$1 = mul8u::a#2 & 1 [ mul8u::res#2 mul8u::a#2 mul8u::mb#2 mul8u::$1 ] ( mul8u:7 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 mul8u::res#2 mul8u::a#2 mul8u::mb#2 mul8u::$1 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Statement [40] mul8u::res#1 = mul8u::res#2 + mul8u::mb#2 [ mul8u::a#2 mul8u::mb#2 mul8u::res#1 ] ( mul8u:7 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 mul8u::a#2 mul8u::mb#2 mul8u::res#1 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Statement [52] utoa::value#0 = print_uint_decimal::w#0 [ print_char_cursor#34 utoa::value#0 ] ( print_uint_decimal:29 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::value#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [58] *print_char_cursor#1 = print_char::ch#2 [ print_char_cursor#1 ] ( print_char:31 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#1 ] { } print_uint_decimal:29::print_str:55::print_char:104 [ test_last#19 potential#11 prime_idx#1 print_str::str#2 print_char_cursor#1 ] { { potential#11 = print_uint_decimal::w#0 } { print_char::ch#0 = print_char::ch#2 } } ) always clobbers reg byte y Statement [64] divr8u::$1 = divr8u::dividend#3 & $80 [ divr8u::divisor#6 divr8u::dividend#3 divr8u::quotient#3 divr8u::i#2 divr8u::rem#0 divr8u::$1 ] ( div16u8u:18::divr8u:46 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 div16u8u::dividend#0 div16u8u::divisor#0 divr8u::divisor#6 divr8u::dividend#3 divr8u::quotient#3 divr8u::i#2 divr8u::rem#0 divr8u::$1 ] { { potential#10 = div16u8u::dividend#0 } { divr8u::dividend#1 = divr8u::dividend#5 } { divr8u::divisor#0 = divr8u::divisor#6 div16u8u::divisor#0 } } div16u8u:18::divr8u:50 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 divr8u::divisor#6 divr8u::dividend#3 divr8u::quotient#3 divr8u::i#2 divr8u::rem#0 divr8u::$1 ] { { potential#10 = div16u8u::dividend#0 } { divr8u::rem#10 = divr8u::rem#4 rem8u#0 } { divr8u::dividend#2 = divr8u::dividend#5 } { divr8u::divisor#1 = divr8u::divisor#6 div16u8u::divisor#0 } } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:7 [ divr8u::rem#5 divr8u::rem#10 divr8u::rem#4 divr8u::rem#11 divr8u::rem#6 divr8u::rem#0 divr8u::rem#1 divr8u::rem#2 ] Statement [66] divr8u::rem#1 = divr8u::rem#0 | 1 [ divr8u::divisor#6 divr8u::dividend#3 divr8u::quotient#3 divr8u::i#2 divr8u::rem#1 ] ( div16u8u:18::divr8u:46 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 div16u8u::dividend#0 div16u8u::divisor#0 divr8u::divisor#6 divr8u::dividend#3 divr8u::quotient#3 divr8u::i#2 divr8u::rem#1 ] { { potential#10 = div16u8u::dividend#0 } { divr8u::dividend#1 = divr8u::dividend#5 } { divr8u::divisor#0 = divr8u::divisor#6 div16u8u::divisor#0 } } div16u8u:18::divr8u:50 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 divr8u::divisor#6 divr8u::dividend#3 divr8u::quotient#3 divr8u::i#2 divr8u::rem#1 ] { { potential#10 = div16u8u::dividend#0 } { divr8u::rem#10 = divr8u::rem#4 rem8u#0 } { divr8u::dividend#2 = divr8u::dividend#5 } { divr8u::divisor#1 = divr8u::divisor#6 div16u8u::divisor#0 } } ) always clobbers reg byte a Statement [72] divr8u::rem#2 = divr8u::rem#6 - divr8u::divisor#6 [ divr8u::divisor#6 divr8u::i#2 divr8u::dividend#0 divr8u::quotient#2 divr8u::rem#2 ] ( div16u8u:18::divr8u:46 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 div16u8u::dividend#0 div16u8u::divisor#0 divr8u::divisor#6 divr8u::i#2 divr8u::dividend#0 divr8u::quotient#2 divr8u::rem#2 ] { { potential#10 = div16u8u::dividend#0 } { divr8u::dividend#1 = divr8u::dividend#5 } { divr8u::divisor#0 = divr8u::divisor#6 div16u8u::divisor#0 } } div16u8u:18::divr8u:50 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 divr8u::divisor#6 divr8u::i#2 divr8u::dividend#0 divr8u::quotient#2 divr8u::rem#2 ] { { potential#10 = div16u8u::dividend#0 } { divr8u::rem#10 = divr8u::rem#4 rem8u#0 } { divr8u::dividend#2 = divr8u::dividend#5 } { divr8u::divisor#1 = divr8u::divisor#6 div16u8u::divisor#0 } } ) always clobbers reg byte a Statement [82] *utoa::buffer#11 = DIGITS[utoa::$11] [ utoa::buffer#11 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::buffer#11 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a reg byte y Statement [83] utoa::buffer#4 = ++ utoa::buffer#11 [ utoa::buffer#4 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::buffer#4 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [84] *utoa::buffer#4 = 0 [ ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a reg byte y Statement [86] utoa::$10 = utoa::digit#2 << 1 [ utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::$10 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::$10 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [87] utoa::digit_value#0 = RADIX_DECIMAL_VALUES[utoa::$10] [ utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::digit_value#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::digit_value#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [89] if(utoa::value#2>=utoa::digit_value#0) goto utoa::@5 [ utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::digit_value#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::digit_value#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [92] utoa_append::buffer#0 = utoa::buffer#11 [ utoa::digit#2 utoa::value#2 utoa::buffer#11 utoa::digit_value#0 utoa_append::buffer#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::value#2 utoa::buffer#11 utoa::digit_value#0 utoa_append::buffer#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Statement [93] utoa_append::value#0 = utoa::value#2 [ utoa::digit#2 utoa::buffer#11 utoa::digit_value#0 utoa_append::buffer#0 utoa_append::value#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa::digit_value#0 utoa_append::buffer#0 utoa_append::value#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Statement [94] utoa_append::sub#0 = utoa::digit_value#0 [ utoa::digit#2 utoa::buffer#11 utoa_append::buffer#0 utoa_append::value#0 utoa_append::sub#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa_append::buffer#0 utoa_append::value#0 utoa_append::sub#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Statement [96] utoa_append::return#0 = utoa_append::value#2 [ utoa::digit#2 utoa::buffer#11 utoa_append::return#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa_append::return#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Statement [97] utoa::value#1 = utoa_append::return#0 [ utoa::digit#2 utoa::buffer#11 utoa::value#1 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa::value#1 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [101] if(0!=*print_str::str#2) goto print_str::@2 [ print_char_cursor#1 print_str::str#2 ] ( print_uint_decimal:29::print_str:55 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#1 print_str::str#2 ] { { potential#11 = print_uint_decimal::w#0 } } ) always clobbers reg byte a reg byte y Statement [103] print_char::ch#0 = *print_str::str#2 [ print_char::ch#0 print_char_cursor#1 print_str::str#2 ] ( print_uint_decimal:29::print_str:55 [ test_last#19 potential#11 prime_idx#1 print_char::ch#0 print_char_cursor#1 print_str::str#2 ] { { potential#11 = print_uint_decimal::w#0 } { print_char::ch#0 = print_char::ch#2 } } ) always clobbers reg byte a reg byte y Statement [108] if(utoa_append::value#2>=utoa_append::sub#0) goto utoa_append::@2 [ utoa_append::buffer#0 utoa_append::sub#0 utoa_append::value#2 utoa_append::digit#2 ] ( print_uint_decimal:29::utoa:53::utoa_append:95 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa_append::buffer#0 utoa_append::sub#0 utoa_append::value#2 utoa_append::digit#2 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Statement [109] *utoa_append::buffer#0 = DIGITS[utoa_append::digit#2] [ utoa_append::value#2 ] ( print_uint_decimal:29::utoa:53::utoa_append:95 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa_append::value#2 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a reg byte y Statement [112] utoa_append::value#1 = utoa_append::value#2 - utoa_append::sub#0 [ utoa_append::buffer#0 utoa_append::sub#0 utoa_append::value#1 utoa_append::digit#1 ] ( print_uint_decimal:29::utoa:53::utoa_append:95 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa_append::buffer#0 utoa_append::sub#0 utoa_append::value#1 utoa_append::digit#1 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Statement [0] *(PRIMES+1*SIZEOF_UNSIGNED_INT) = 2 [ ] ( [ ] { } ) always clobbers reg byte a Statement [1] *(PRIMES+2*SIZEOF_UNSIGNED_INT) = 3 [ ] ( [ ] { } ) always clobbers reg byte a Statement [3] main::$12 = test_last#13 << 1 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::$12 ] ( [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::$12 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Statement [4] main::p#0 = (char)PRIMES[main::$12] [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::p#0 ] ( [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::p#0 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Statement [8] mul8u::return#2 = mul8u::res#2 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 mul8u::return#2 ] ( [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 mul8u::return#2 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Statement [9] main::$0 = mul8u::return#2 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::$0 ] ( [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 main::$0 ] { } ) always clobbers reg byte a Statement [10] if(potential#15<=main::$0) goto main::@2 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 ] ( [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 ] { } ) always clobbers reg byte a Statement [13] potential#1 = potential#15 + 2 [ prime_idx#17 print_char_cursor#34 test_last#19 potential#1 ] ( [ prime_idx#17 print_char_cursor#34 test_last#19 potential#1 ] { } ) always clobbers reg byte a Statement [15] main::$13 = test_idx#7 << 1 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 main::$13 ] ( [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 main::$13 ] { { potential#10 = div16u8u::dividend#0 } } ) always clobbers reg byte a Statement [16] div16u8u::dividend#0 = potential#10 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 main::$13 div16u8u::dividend#0 ] ( [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 main::$13 div16u8u::dividend#0 ] { { potential#10 = div16u8u::dividend#0 } } ) always clobbers reg byte a Statement [17] div16u8u::divisor#0 = (char)PRIMES[main::$13] [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 div16u8u::dividend#0 div16u8u::divisor#0 ] ( [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 div16u8u::dividend#0 div16u8u::divisor#0 ] { { potential#10 = div16u8u::dividend#0 } } ) always clobbers reg byte a Statement [21] potential#2 = potential#10 + 2 [ prime_idx#17 print_char_cursor#34 test_last#19 potential#2 ] ( [ prime_idx#17 print_char_cursor#34 test_last#19 potential#2 ] { } ) always clobbers reg byte a Statement [25] main::$14 = prime_idx#1 << 1 [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 main::$14 ] ( [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 main::$14 ] { { potential#11 = print_uint_decimal::w#0 } } ) always clobbers reg byte a Statement [26] main::$15 = PRIMES + main::$14 [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 main::$15 ] ( [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 main::$15 ] { { potential#11 = print_uint_decimal::w#0 } } ) always clobbers reg byte a Statement [27] *main::$15 = potential#11 [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 ] ( [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 ] { { potential#11 = print_uint_decimal::w#0 } } ) always clobbers reg byte a reg byte y Statement [28] print_uint_decimal::w#0 = potential#11 [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 print_uint_decimal::w#0 ] ( [ print_char_cursor#34 test_last#19 potential#11 prime_idx#1 print_uint_decimal::w#0 ] { { potential#11 = print_uint_decimal::w#0 } } ) always clobbers reg byte a Statement [32] if(prime_idx#1<$3e8) goto main::@1 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#17 ] ( [ test_last#19 potential#11 prime_idx#1 print_char_cursor#17 ] { } ) always clobbers reg byte a Statement [34] mul8u::mb#0 = (unsigned int)mul8u::b#0 [ mul8u::a#1 mul8u::mb#0 ] ( mul8u:7 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 mul8u::a#1 mul8u::mb#0 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Statement [38] mul8u::$1 = mul8u::a#2 & 1 [ mul8u::res#2 mul8u::a#2 mul8u::mb#2 mul8u::$1 ] ( mul8u:7 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 mul8u::res#2 mul8u::a#2 mul8u::mb#2 mul8u::$1 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Statement [40] mul8u::res#1 = mul8u::res#2 + mul8u::mb#2 [ mul8u::a#2 mul8u::mb#2 mul8u::res#1 ] ( mul8u:7 [ test_last#13 potential#15 prime_idx#17 print_char_cursor#34 mul8u::a#2 mul8u::mb#2 mul8u::res#1 ] { { mul8u::a#1 = main::p#0 mul8u::b#0 } { mul8u::return#2 = mul8u::res#2 } } ) always clobbers reg byte a Statement [52] utoa::value#0 = print_uint_decimal::w#0 [ print_char_cursor#34 utoa::value#0 ] ( print_uint_decimal:29 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::value#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [58] *print_char_cursor#1 = print_char::ch#2 [ print_char_cursor#1 ] ( print_char:31 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#1 ] { } print_uint_decimal:29::print_str:55::print_char:104 [ test_last#19 potential#11 prime_idx#1 print_str::str#2 print_char_cursor#1 ] { { potential#11 = print_uint_decimal::w#0 } { print_char::ch#0 = print_char::ch#2 } } ) always clobbers reg byte y Statement [64] divr8u::$1 = divr8u::dividend#3 & $80 [ divr8u::divisor#6 divr8u::dividend#3 divr8u::quotient#3 divr8u::i#2 divr8u::rem#0 divr8u::$1 ] ( div16u8u:18::divr8u:46 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 div16u8u::dividend#0 div16u8u::divisor#0 divr8u::divisor#6 divr8u::dividend#3 divr8u::quotient#3 divr8u::i#2 divr8u::rem#0 divr8u::$1 ] { { potential#10 = div16u8u::dividend#0 } { divr8u::dividend#1 = divr8u::dividend#5 } { divr8u::divisor#0 = divr8u::divisor#6 div16u8u::divisor#0 } } div16u8u:18::divr8u:50 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 divr8u::divisor#6 divr8u::dividend#3 divr8u::quotient#3 divr8u::i#2 divr8u::rem#0 divr8u::$1 ] { { potential#10 = div16u8u::dividend#0 } { divr8u::rem#10 = divr8u::rem#4 rem8u#0 } { divr8u::dividend#2 = divr8u::dividend#5 } { divr8u::divisor#1 = divr8u::divisor#6 div16u8u::divisor#0 } } ) always clobbers reg byte a Statement [66] divr8u::rem#1 = divr8u::rem#0 | 1 [ divr8u::divisor#6 divr8u::dividend#3 divr8u::quotient#3 divr8u::i#2 divr8u::rem#1 ] ( div16u8u:18::divr8u:46 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 div16u8u::dividend#0 div16u8u::divisor#0 divr8u::divisor#6 divr8u::dividend#3 divr8u::quotient#3 divr8u::i#2 divr8u::rem#1 ] { { potential#10 = div16u8u::dividend#0 } { divr8u::dividend#1 = divr8u::dividend#5 } { divr8u::divisor#0 = divr8u::divisor#6 div16u8u::divisor#0 } } div16u8u:18::divr8u:50 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 divr8u::divisor#6 divr8u::dividend#3 divr8u::quotient#3 divr8u::i#2 divr8u::rem#1 ] { { potential#10 = div16u8u::dividend#0 } { divr8u::rem#10 = divr8u::rem#4 rem8u#0 } { divr8u::dividend#2 = divr8u::dividend#5 } { divr8u::divisor#1 = divr8u::divisor#6 div16u8u::divisor#0 } } ) always clobbers reg byte a Statement [72] divr8u::rem#2 = divr8u::rem#6 - divr8u::divisor#6 [ divr8u::divisor#6 divr8u::i#2 divr8u::dividend#0 divr8u::quotient#2 divr8u::rem#2 ] ( div16u8u:18::divr8u:46 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 div16u8u::dividend#0 div16u8u::divisor#0 divr8u::divisor#6 divr8u::i#2 divr8u::dividend#0 divr8u::quotient#2 divr8u::rem#2 ] { { potential#10 = div16u8u::dividend#0 } { divr8u::dividend#1 = divr8u::dividend#5 } { divr8u::divisor#0 = divr8u::divisor#6 div16u8u::divisor#0 } } div16u8u:18::divr8u:50 [ prime_idx#17 print_char_cursor#34 test_last#19 test_idx#7 potential#10 divr8u::divisor#6 divr8u::i#2 divr8u::dividend#0 divr8u::quotient#2 divr8u::rem#2 ] { { potential#10 = div16u8u::dividend#0 } { divr8u::rem#10 = divr8u::rem#4 rem8u#0 } { divr8u::dividend#2 = divr8u::dividend#5 } { divr8u::divisor#1 = divr8u::divisor#6 div16u8u::divisor#0 } } ) always clobbers reg byte a Statement [82] *utoa::buffer#11 = DIGITS[utoa::$11] [ utoa::buffer#11 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::buffer#11 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a reg byte y Statement [83] utoa::buffer#4 = ++ utoa::buffer#11 [ utoa::buffer#4 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::buffer#4 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [84] *utoa::buffer#4 = 0 [ ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a reg byte y Statement [86] utoa::$10 = utoa::digit#2 << 1 [ utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::$10 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::$10 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [87] utoa::digit_value#0 = RADIX_DECIMAL_VALUES[utoa::$10] [ utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::digit_value#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::digit_value#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [89] if(utoa::value#2>=utoa::digit_value#0) goto utoa::@5 [ utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::digit_value#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::value#2 utoa::started#2 utoa::buffer#11 utoa::digit_value#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [92] utoa_append::buffer#0 = utoa::buffer#11 [ utoa::digit#2 utoa::value#2 utoa::buffer#11 utoa::digit_value#0 utoa_append::buffer#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::value#2 utoa::buffer#11 utoa::digit_value#0 utoa_append::buffer#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Statement [93] utoa_append::value#0 = utoa::value#2 [ utoa::digit#2 utoa::buffer#11 utoa::digit_value#0 utoa_append::buffer#0 utoa_append::value#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa::digit_value#0 utoa_append::buffer#0 utoa_append::value#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Statement [94] utoa_append::sub#0 = utoa::digit_value#0 [ utoa::digit#2 utoa::buffer#11 utoa_append::buffer#0 utoa_append::value#0 utoa_append::sub#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa_append::buffer#0 utoa_append::value#0 utoa_append::sub#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Statement [96] utoa_append::return#0 = utoa_append::value#2 [ utoa::digit#2 utoa::buffer#11 utoa_append::return#0 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa_append::return#0 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Statement [97] utoa::value#1 = utoa_append::return#0 [ utoa::digit#2 utoa::buffer#11 utoa::value#1 ] ( print_uint_decimal:29::utoa:53 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa::value#1 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } } ) always clobbers reg byte a Statement [101] if(0!=*print_str::str#2) goto print_str::@2 [ print_char_cursor#1 print_str::str#2 ] ( print_uint_decimal:29::print_str:55 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#1 print_str::str#2 ] { { potential#11 = print_uint_decimal::w#0 } } ) always clobbers reg byte a reg byte y Statement [103] print_char::ch#0 = *print_str::str#2 [ print_char::ch#0 print_char_cursor#1 print_str::str#2 ] ( print_uint_decimal:29::print_str:55 [ test_last#19 potential#11 prime_idx#1 print_char::ch#0 print_char_cursor#1 print_str::str#2 ] { { potential#11 = print_uint_decimal::w#0 } { print_char::ch#0 = print_char::ch#2 } } ) always clobbers reg byte a reg byte y Statement [108] if(utoa_append::value#2>=utoa_append::sub#0) goto utoa_append::@2 [ utoa_append::buffer#0 utoa_append::sub#0 utoa_append::value#2 utoa_append::digit#2 ] ( print_uint_decimal:29::utoa:53::utoa_append:95 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa_append::buffer#0 utoa_append::sub#0 utoa_append::value#2 utoa_append::digit#2 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Statement [109] *utoa_append::buffer#0 = DIGITS[utoa_append::digit#2] [ utoa_append::value#2 ] ( print_uint_decimal:29::utoa:53::utoa_append:95 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa_append::value#2 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a reg byte y Statement [112] utoa_append::value#1 = utoa_append::value#2 - utoa_append::sub#0 [ utoa_append::buffer#0 utoa_append::sub#0 utoa_append::value#1 utoa_append::digit#1 ] ( print_uint_decimal:29::utoa:53::utoa_append:95 [ test_last#19 potential#11 prime_idx#1 print_char_cursor#34 utoa::digit#2 utoa::buffer#11 utoa_append::buffer#0 utoa_append::sub#0 utoa_append::value#1 utoa_append::digit#1 ] { { potential#11 = print_uint_decimal::w#0 utoa::value#0 } { utoa_append::buffer#0 = utoa::buffer#11 } { utoa_append::value#0 = utoa::value#2 } { utoa_append::sub#0 = utoa::digit_value#0 } { utoa_append::return#0 = utoa_append::value#2 } } ) always clobbers reg byte a Potential registers zp[1]:50 [ test_last#13 test_last#19 test_last#1 ] : zp[1]:50 , reg byte x , Potential registers zp[2]:62 [ prime_idx#17 prime_idx#1 ] : zp[2]:62 , Potential registers zp[1]:46 [ test_idx#7 test_idx#10 test_idx#1 ] : zp[1]:46 , reg byte x , reg byte y , Potential registers zp[2]:44 [ potential#10 potential#1 potential#15 potential#11 potential#2 ] : zp[2]:44 , Potential registers zp[1]:36 [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] : zp[1]:36 , reg byte x , reg byte y , Potential registers zp[2]:31 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] : zp[2]:31 , Potential registers zp[2]:33 [ mul8u::mb#2 mul8u::mb#0 mul8u::mb#1 ] : zp[2]:33 , Potential registers zp[1]:13 [ print_char::ch#2 print_char::ch#0 ] : zp[1]:13 , reg byte a , reg byte x , reg byte y , Potential registers zp[1]:12 [ divr8u::divisor#6 divr8u::divisor#0 divr8u::divisor#1 ] : zp[1]:12 , reg byte x , reg byte y , Potential registers zp[1]:7 [ divr8u::rem#5 divr8u::rem#10 divr8u::rem#4 divr8u::rem#11 divr8u::rem#6 divr8u::rem#0 divr8u::rem#1 divr8u::rem#2 ] : zp[1]:7 , reg byte x , reg byte y , Potential registers zp[1]:11 [ divr8u::dividend#3 divr8u::dividend#5 divr8u::dividend#1 divr8u::dividend#2 divr8u::dividend#0 ] : zp[1]:11 , reg byte x , reg byte y , Potential registers zp[1]:8 [ divr8u::quotient#3 divr8u::return#0 divr8u::quotient#1 divr8u::quotient#2 ] : zp[1]:8 , reg byte x , reg byte y , Potential registers zp[1]:10 [ divr8u::i#2 divr8u::i#1 ] : zp[1]:10 , reg byte x , reg byte y , Potential registers zp[1]:22 [ utoa::digit#2 utoa::digit#1 ] : zp[1]:22 , reg byte x , Potential registers zp[2]:18 [ utoa::value#2 utoa::value#6 utoa::value#0 utoa::value#1 ] : zp[2]:18 , Potential registers zp[1]:26 [ utoa::started#2 utoa::started#4 ] : zp[1]:26 , reg byte x , reg byte y , Potential registers zp[2]:16 [ utoa::buffer#11 utoa::buffer#14 utoa::buffer#5 ] : zp[2]:16 , Potential registers zp[2]:20 [ print_str::str#2 print_str::str#0 ] : zp[2]:20 , Potential registers zp[2]:14 [ print_char_cursor#1 print_char_cursor#34 print_char_cursor#17 ] : zp[2]:14 , Potential registers zp[2]:2 [ utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 ] : zp[2]:2 , Potential registers zp[1]:4 [ utoa_append::digit#2 utoa_append::digit#1 ] : zp[1]:4 , reg byte x , reg byte y , Potential registers zp[1]:60 [ main::$12 ] : zp[1]:60 , reg byte a , reg byte x , reg byte y , Potential registers zp[1]:59 [ main::p#0 ] : zp[1]:59 , reg byte a , reg byte x , reg byte y , Potential registers zp[1]:61 [ mul8u::b#0 ] : zp[1]:61 , reg byte a , reg byte x , reg byte y , Potential registers zp[2]:51 [ mul8u::return#2 ] : zp[2]:51 , Potential registers zp[2]:53 [ main::$0 ] : zp[2]:53 , Potential registers zp[1]:49 [ main::$13 ] : zp[1]:49 , reg byte x , reg byte y , Potential registers zp[2]:41 [ div16u8u::dividend#0 ] : zp[2]:41 , Potential registers zp[1]:43 [ div16u8u::divisor#0 ] : zp[1]:43 , reg byte x , reg byte y , Potential registers zp[2]:55 [ main::$14 ] : zp[2]:55 , Potential registers zp[2]:57 [ main::$15 ] : zp[2]:57 , Potential registers zp[2]:47 [ print_uint_decimal::w#0 ] : zp[2]:47 , Potential registers zp[1]:35 [ mul8u::$1 ] : zp[1]:35 , reg byte a , reg byte x , reg byte y , Potential registers zp[1]:9 [ divr8u::$1 ] : zp[1]:9 , reg byte a , reg byte x , reg byte y , Potential registers zp[1]:40 [ rem8u#0 ] : zp[1]:40 , reg byte a , reg byte x , reg byte y , Potential registers zp[1]:37 [ utoa::$11 ] : zp[1]:37 , reg byte a , reg byte x , reg byte y , Potential registers zp[2]:38 [ utoa::buffer#4 ] : zp[2]:38 , Potential registers zp[1]:23 [ utoa::$10 ] : zp[1]:23 , reg byte a , reg byte x , reg byte y , Potential registers zp[2]:29 [ utoa::digit_value#0 ] : zp[2]:29 , Potential registers zp[2]:27 [ utoa_append::buffer#0 ] : zp[2]:27 , Potential registers zp[2]:5 [ utoa_append::sub#0 ] : zp[2]:5 , Potential registers zp[2]:24 [ utoa_append::return#0 ] : zp[2]:24 , REGISTER UPLIFT SCOPES Uplift Scope [utoa_append] 2,500,550,003.5: zp[2]:2 [ utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 ] 2,000,500,002.5: zp[1]:4 [ utoa_append::digit#2 utoa_append::digit#1 ] 333,350,000.5: zp[2]:5 [ utoa_append::sub#0 ] 200,002: zp[2]:24 [ utoa_append::return#0 ] 137,500.25: zp[2]:27 [ utoa_append::buffer#0 ] Uplift Scope [divr8u] 90,026,347.67: zp[1]:7 [ divr8u::rem#5 divr8u::rem#10 divr8u::rem#4 divr8u::rem#11 divr8u::rem#6 divr8u::rem#0 divr8u::rem#1 divr8u::rem#2 ] 37,857,146.64: zp[1]:8 [ divr8u::quotient#3 divr8u::return#0 divr8u::quotient#1 divr8u::quotient#2 ] 20,000,002: zp[1]:9 [ divr8u::$1 ] 16,666,668.33: zp[1]:10 [ divr8u::i#2 divr8u::i#1 ] 7,515,338.92: zp[1]:11 [ divr8u::dividend#3 divr8u::dividend#5 divr8u::dividend#1 divr8u::dividend#2 divr8u::dividend#0 ] 1,336,469.93: zp[1]:12 [ divr8u::divisor#6 divr8u::divisor#0 divr8u::divisor#1 ] Uplift Scope [utoa] 378,718.21: zp[2]:16 [ utoa::buffer#11 utoa::buffer#14 utoa::buffer#5 ] 307,839.93: zp[2]:18 [ utoa::value#2 utoa::value#6 utoa::value#0 utoa::value#1 ] 228,573.71: zp[1]:22 [ utoa::digit#2 utoa::digit#1 ] 200,002: zp[1]:23 [ utoa::$10 ] 150,001.5: zp[1]:26 [ utoa::started#2 utoa::started#4 ] 60,000.6: zp[2]:29 [ utoa::digit_value#0 ] 2,002: zp[1]:37 [ utoa::$11 ] 2,002: zp[2]:38 [ utoa::buffer#4 ] Uplift Scope [print_char] 1,300,004: zp[1]:13 [ print_char::ch#2 print_char::ch#0 ] Uplift Scope [] 393,468.55: zp[2]:14 [ print_char_cursor#1 print_char_cursor#34 print_char_cursor#17 ] 1,233.67: zp[1]:40 [ rem8u#0 ] 316.83: zp[2]:44 [ potential#10 potential#1 potential#15 potential#11 potential#2 ] 313.1: zp[1]:46 [ test_idx#7 test_idx#10 test_idx#1 ] 33.27: zp[1]:50 [ test_last#13 test_last#19 test_last#1 ] 5.89: zp[2]:62 [ prime_idx#17 prime_idx#1 ] Uplift Scope [print_str] 300,003: zp[2]:20 [ print_str::str#2 print_str::str#0 ] Uplift Scope [mul8u] 35,005.33: zp[2]:31 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] 24,504.57: zp[2]:33 [ mul8u::mb#2 mul8u::mb#0 mul8u::mb#1 ] 20,002: zp[1]:35 [ mul8u::$1 ] 16,722.5: zp[1]:36 [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] 22: zp[2]:51 [ mul8u::return#2 ] 11: zp[1]:61 [ mul8u::b#0 ] Uplift Scope [div16u8u] 420.6: zp[2]:41 [ div16u8u::dividend#0 ] 420.6: zp[1]:43 [ div16u8u::divisor#0 ] Uplift Scope [main] 50.5: zp[1]:49 [ main::$13 ] 22: zp[2]:53 [ main::$0 ] 22: zp[2]:55 [ main::$14 ] 22: zp[2]:57 [ main::$15 ] 16.5: zp[1]:59 [ main::p#0 ] 11: zp[1]:60 [ main::$12 ] Uplift Scope [print_uint_decimal] 112: zp[2]:47 [ print_uint_decimal::w#0 ] Uplift Scope [RADIX] Uplifting [utoa_append] best 201828 combination zp[2]:2 [ utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 ] reg byte x [ utoa_append::digit#2 utoa_append::digit#1 ] zp[2]:5 [ utoa_append::sub#0 ] zp[2]:24 [ utoa_append::return#0 ] zp[2]:27 [ utoa_append::buffer#0 ] Uplifting [divr8u] best 182819 combination reg byte y [ divr8u::rem#5 divr8u::rem#10 divr8u::rem#4 divr8u::rem#11 divr8u::rem#6 divr8u::rem#0 divr8u::rem#1 divr8u::rem#2 ] zp[1]:8 [ divr8u::quotient#3 divr8u::return#0 divr8u::quotient#1 divr8u::quotient#2 ] reg byte a [ divr8u::$1 ] reg byte x [ divr8u::i#2 divr8u::i#1 ] zp[1]:11 [ divr8u::dividend#3 divr8u::dividend#5 divr8u::dividend#1 divr8u::dividend#2 divr8u::dividend#0 ] zp[1]:12 [ divr8u::divisor#6 divr8u::divisor#0 divr8u::divisor#1 ] Limited combination testing to 100 combinations of 972 possible. Uplifting [utoa] best 181713 combination zp[2]:16 [ utoa::buffer#11 utoa::buffer#14 utoa::buffer#5 ] zp[2]:18 [ utoa::value#2 utoa::value#6 utoa::value#0 utoa::value#1 ] zp[1]:22 [ utoa::digit#2 utoa::digit#1 ] reg byte a [ utoa::$10 ] reg byte x [ utoa::started#2 utoa::started#4 ] zp[2]:29 [ utoa::digit_value#0 ] reg byte x [ utoa::$11 ] zp[2]:38 [ utoa::buffer#4 ] Uplifting [print_char] best 181407 combination reg byte a [ print_char::ch#2 print_char::ch#0 ] Uplifting [] best 181301 combination zp[2]:14 [ print_char_cursor#1 print_char_cursor#34 print_char_cursor#17 ] reg byte y [ rem8u#0 ] zp[2]:44 [ potential#10 potential#1 potential#15 potential#11 potential#2 ] zp[1]:46 [ test_idx#7 test_idx#10 test_idx#1 ] zp[1]:50 [ test_last#13 test_last#19 test_last#1 ] zp[2]:62 [ prime_idx#17 prime_idx#1 ] Uplifting [print_str] best 181301 combination zp[2]:20 [ print_str::str#2 print_str::str#0 ] Uplifting [mul8u] best 180738 combination zp[2]:31 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] zp[2]:33 [ mul8u::mb#2 mul8u::mb#0 mul8u::mb#1 ] reg byte a [ mul8u::$1 ] reg byte x [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] zp[2]:51 [ mul8u::return#2 ] reg byte a [ mul8u::b#0 ] Uplifting [div16u8u] best 180738 combination zp[2]:41 [ div16u8u::dividend#0 ] zp[1]:43 [ div16u8u::divisor#0 ] Uplifting [main] best 180228 combination reg byte x [ main::$13 ] zp[2]:53 [ main::$0 ] zp[2]:55 [ main::$14 ] zp[2]:57 [ main::$15 ] reg byte a [ main::p#0 ] reg byte a [ main::$12 ] Uplifting [print_uint_decimal] best 180228 combination zp[2]:47 [ print_uint_decimal::w#0 ] Uplifting [RADIX] best 180228 combination Attempting to uplift remaining variables inzp[1]:8 [ divr8u::quotient#3 divr8u::return#0 divr8u::quotient#1 divr8u::quotient#2 ] Uplifting [divr8u] best 180228 combination zp[1]:8 [ divr8u::quotient#3 divr8u::return#0 divr8u::quotient#1 divr8u::quotient#2 ] Attempting to uplift remaining variables inzp[1]:11 [ divr8u::dividend#3 divr8u::dividend#5 divr8u::dividend#1 divr8u::dividend#2 divr8u::dividend#0 ] Uplifting [divr8u] best 180228 combination zp[1]:11 [ divr8u::dividend#3 divr8u::dividend#5 divr8u::dividend#1 divr8u::dividend#2 divr8u::dividend#0 ] Attempting to uplift remaining variables inzp[1]:12 [ divr8u::divisor#6 divr8u::divisor#0 divr8u::divisor#1 ] Uplifting [divr8u] best 180228 combination zp[1]:12 [ divr8u::divisor#6 divr8u::divisor#0 divr8u::divisor#1 ] Attempting to uplift remaining variables inzp[1]:22 [ utoa::digit#2 utoa::digit#1 ] Uplifting [utoa] best 180228 combination zp[1]:22 [ utoa::digit#2 utoa::digit#1 ] Attempting to uplift remaining variables inzp[1]:43 [ div16u8u::divisor#0 ] Uplifting [div16u8u] best 180228 combination zp[1]:43 [ div16u8u::divisor#0 ] Attempting to uplift remaining variables inzp[1]:46 [ test_idx#7 test_idx#10 test_idx#1 ] Uplifting [] best 180228 combination zp[1]:46 [ test_idx#7 test_idx#10 test_idx#1 ] Attempting to uplift remaining variables inzp[1]:50 [ test_last#13 test_last#19 test_last#1 ] Uplifting [] best 180228 combination zp[1]:50 [ test_last#13 test_last#19 test_last#1 ] Coalescing zero page register [ zp[1]:12 [ divr8u::divisor#6 divr8u::divisor#0 divr8u::divisor#1 ] ] with [ zp[1]:43 [ div16u8u::divisor#0 ] ] - score: 2 Coalescing zero page register [ zp[2]:44 [ potential#10 potential#1 potential#15 potential#11 potential#2 ] ] with [ zp[2]:41 [ div16u8u::dividend#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:44 [ potential#10 potential#1 potential#15 potential#11 potential#2 div16u8u::dividend#0 ] ] with [ zp[2]:47 [ print_uint_decimal::w#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:31 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] ] with [ zp[2]:51 [ mul8u::return#2 ] ] - score: 1 Coalescing zero page register [ zp[2]:18 [ utoa::value#2 utoa::value#6 utoa::value#0 utoa::value#1 ] ] with [ zp[2]:2 [ utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 ] ] - score: 1 Coalescing zero page register [ zp[2]:18 [ utoa::value#2 utoa::value#6 utoa::value#0 utoa::value#1 utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 ] ] with [ zp[2]:24 [ utoa_append::return#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:16 [ utoa::buffer#11 utoa::buffer#14 utoa::buffer#5 ] ] with [ zp[2]:38 [ utoa::buffer#4 ] ] - score: 1 Coalescing zero page register [ zp[2]:16 [ utoa::buffer#11 utoa::buffer#14 utoa::buffer#5 utoa::buffer#4 ] ] with [ zp[2]:27 [ utoa_append::buffer#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:55 [ main::$14 ] ] with [ zp[2]:57 [ main::$15 ] ] - score: 1 Coalescing zero page register [ zp[2]:29 [ utoa::digit_value#0 ] ] with [ zp[2]:5 [ utoa_append::sub#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:31 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 ] ] with [ zp[2]:53 [ main::$0 ] ] - score: 1 Coalescing zero page register [ zp[1]:22 [ utoa::digit#2 utoa::digit#1 ] ] with [ zp[1]:46 [ test_idx#7 test_idx#10 test_idx#1 ] ] Coalescing zero page register [ zp[2]:18 [ utoa::value#2 utoa::value#6 utoa::value#0 utoa::value#1 utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 utoa_append::return#0 ] ] with [ zp[2]:33 [ mul8u::mb#2 mul8u::mb#0 mul8u::mb#1 ] ] Coalescing zero page register [ zp[2]:20 [ print_str::str#2 print_str::str#0 ] ] with [ zp[2]:16 [ utoa::buffer#11 utoa::buffer#14 utoa::buffer#5 utoa::buffer#4 utoa_append::buffer#0 ] ] Coalescing zero page register [ zp[2]:55 [ main::$14 main::$15 ] ] with [ zp[2]:18 [ utoa::value#2 utoa::value#6 utoa::value#0 utoa::value#1 utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 utoa_append::return#0 mul8u::mb#2 mul8u::mb#0 mul8u::mb#1 ] ] Allocated (was zp[2]:55) zp[2]:2 [ main::$14 main::$15 utoa::value#2 utoa::value#6 utoa::value#0 utoa::value#1 utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 utoa_append::return#0 mul8u::mb#2 mul8u::mb#0 mul8u::mb#1 ] Allocated (was zp[2]:29) zp[2]:4 [ utoa::digit_value#0 utoa_append::sub#0 ] Allocated (was zp[1]:8) zp[1]:6 [ divr8u::quotient#3 divr8u::return#0 divr8u::quotient#1 divr8u::quotient#2 ] Allocated (was zp[1]:11) zp[1]:7 [ divr8u::dividend#3 divr8u::dividend#5 divr8u::dividend#1 divr8u::dividend#2 divr8u::dividend#0 ] Allocated (was zp[1]:12) zp[1]:8 [ divr8u::divisor#6 divr8u::divisor#0 divr8u::divisor#1 div16u8u::divisor#0 ] Allocated (was zp[2]:20) zp[2]:9 [ print_str::str#2 print_str::str#0 utoa::buffer#11 utoa::buffer#14 utoa::buffer#5 utoa::buffer#4 utoa_append::buffer#0 ] Allocated (was zp[2]:14) zp[2]:11 [ print_char_cursor#1 print_char_cursor#34 print_char_cursor#17 ] Allocated (was zp[1]:22) zp[1]:13 [ utoa::digit#2 utoa::digit#1 test_idx#7 test_idx#10 test_idx#1 ] Allocated (was zp[2]:31) zp[2]:14 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 main::$0 ] Allocated (was zp[2]:44) zp[2]:16 [ potential#10 potential#1 potential#15 potential#11 potential#2 div16u8u::dividend#0 print_uint_decimal::w#0 ] Allocated (was zp[1]:50) zp[1]:18 [ test_last#13 test_last#19 test_last#1 ] Allocated (was zp[2]:62) zp[2]:19 [ prime_idx#17 prime_idx#1 ] ASSEMBLER BEFORE OPTIMIZATION // File Comments // Calculates the 1000 first primes // From A Comparison of Language Speed, The Transactor, March 1987, Volume 7, Issue 5 // http://csbruce.com/cbm/transactor/pdfs/trans_v7_i05.pdf // Upstart // Commodore 64 PRG executable file .file [name="primes-1000-2.prg", type="prg", segments="Program"] .segmentdef Program [segments="Basic, Code, Data"] .segmentdef Basic [start=$0801] .segmentdef Code [start=$80d] .segmentdef Data [startAfter="Code"] .segment Basic :BasicUpstart(main) // Global Constants & labels .const SIZEOF_UNSIGNED_INT = 2 .label print_screen = $400 .label print_char_cursor = $b // The number currently being tested for whether it is a prime .label potential = $10 // The last index to test. It is the smallest index where PRIMES[test_last] > sqr(potential) .label test_last = $12 // The index into PRIMES[] used for prime testing. It runs from 2 to test_last for each number tested. .label test_idx = $d // The index of the last prime we put into the PRIME[] table .label prime_idx = $13 .segment Code // main main: { .label __0 = $e .label __14 = 2 .label __15 = 2 // [0] *(PRIMES+1*SIZEOF_UNSIGNED_INT) = 2 -- _deref_pwuc1=vbuc2 lda #<2 sta PRIMES+1*SIZEOF_UNSIGNED_INT lda #>2 sta PRIMES+1*SIZEOF_UNSIGNED_INT+1 // [1] *(PRIMES+2*SIZEOF_UNSIGNED_INT) = 3 -- _deref_pwuc1=vbuc2 lda #<3 sta PRIMES+2*SIZEOF_UNSIGNED_INT lda #>3 sta PRIMES+2*SIZEOF_UNSIGNED_INT+1 // [2] phi from main to main::@1 [phi:main->main::@1] __b1_from_main: // [2] phi print_char_cursor#34 = print_screen#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #print_screen sta.z print_char_cursor+1 // [2] phi prime_idx#17 = 2 [phi:main->main::@1#1] -- vwuz1=vbuc1 lda #<2 sta.z prime_idx lda #>2 sta.z prime_idx+1 // [2] phi potential#15 = 3 [phi:main->main::@1#2] -- vwuz1=vbuc1 lda #<3 sta.z potential lda #>3 sta.z potential+1 // [2] phi test_last#13 = 2 [phi:main->main::@1#3] -- vbuz1=vbuc1 lda #2 sta.z test_last jmp __b1 // [2] phi from main::@11 to main::@1 [phi:main::@11->main::@1] __b1_from___b11: // [2] phi print_char_cursor#34 = print_char_cursor#17 [phi:main::@11->main::@1#0] -- register_copy // [2] phi prime_idx#17 = prime_idx#1 [phi:main::@11->main::@1#1] -- register_copy // [2] phi potential#15 = potential#11 [phi:main::@11->main::@1#2] -- register_copy // [2] phi test_last#13 = test_last#19 [phi:main::@11->main::@1#3] -- register_copy jmp __b1 // main::@1 __b1: // [3] main::$12 = test_last#13 << 1 -- vbuaa=vbuz1_rol_1 lda.z test_last asl // [4] main::p#0 = (char)PRIMES[main::$12] -- vbuaa=_byte_pwuc1_derefidx_vbuaa tay lda PRIMES,y // [5] mul8u::a#1 = main::p#0 -- vbuxx=vbuaa tax // [6] mul8u::b#0 = main::p#0 // [7] call mul8u jsr mul8u // [8] mul8u::return#2 = mul8u::res#2 jmp __b8 // main::@8 __b8: // [9] main::$0 = mul8u::return#2 // [10] if(potential#15<=main::$0) goto main::@2 -- vwuz1_le_vwuz2_then_la1 lda.z potential+1 cmp.z __0+1 bne !+ lda.z potential cmp.z __0 beq __b2_from___b8 !: bcc __b2_from___b8 jmp __b7 // main::@7 __b7: // [11] test_last#1 = ++ test_last#13 -- vbuz1=_inc_vbuz1 inc.z test_last // [12] phi from main::@7 main::@8 to main::@2 [phi:main::@7/main::@8->main::@2] __b2_from___b7: __b2_from___b8: // [12] phi test_last#19 = test_last#1 [phi:main::@7/main::@8->main::@2#0] -- register_copy jmp __b2 // main::@2 __b2: // [13] potential#1 = potential#15 + 2 -- vwuz1=vwuz1_plus_vbuc1 lda #2 clc adc.z potential sta.z potential bcc !+ inc.z potential+1 !: // [14] phi from main::@2 to main::@3 [phi:main::@2->main::@3] __b3_from___b2: // [14] phi potential#10 = potential#1 [phi:main::@2->main::@3#0] -- register_copy // [14] phi test_idx#7 = 2 [phi:main::@2->main::@3#1] -- vbuz1=vbuc1 lda #2 sta.z test_idx jmp __b3 // [14] phi from main::@4 to main::@3 [phi:main::@4->main::@3] __b3_from___b4: // [14] phi potential#10 = potential#11 [phi:main::@4->main::@3#0] -- register_copy // [14] phi test_idx#7 = test_idx#10 [phi:main::@4->main::@3#1] -- register_copy jmp __b3 // main::@3 __b3: // [15] main::$13 = test_idx#7 << 1 -- vbuxx=vbuz1_rol_1 lda.z test_idx asl tax // [16] div16u8u::dividend#0 = potential#10 // [17] div16u8u::divisor#0 = (char)PRIMES[main::$13] -- vbuz1=_byte_pwuc1_derefidx_vbuxx lda PRIMES,x sta.z div16u8u.divisor // [18] call div16u8u jsr div16u8u jmp __b9 // main::@9 __b9: // [19] test_idx#1 = ++ test_idx#7 -- vbuz1=_inc_vbuz1 inc.z test_idx // [20] if(rem8u#0!=0) goto main::@4 -- vbuyy_neq_0_then_la1 cpy #0 bne __b4_from___b9 jmp __b5 // main::@5 __b5: // [21] potential#2 = potential#10 + 2 -- vwuz1=vwuz1_plus_vbuc1 lda #2 clc adc.z potential sta.z potential bcc !+ inc.z potential+1 !: // [22] phi from main::@5 to main::@4 [phi:main::@5->main::@4] __b4_from___b5: // [22] phi potential#11 = potential#2 [phi:main::@5->main::@4#0] -- register_copy // [22] phi test_idx#10 = 2 [phi:main::@5->main::@4#1] -- vbuz1=vbuc1 lda #2 sta.z test_idx jmp __b4 // [22] phi from main::@9 to main::@4 [phi:main::@9->main::@4] __b4_from___b9: // [22] phi potential#11 = potential#10 [phi:main::@9->main::@4#0] -- register_copy // [22] phi test_idx#10 = test_idx#1 [phi:main::@9->main::@4#1] -- register_copy jmp __b4 // main::@4 __b4: // [23] if(test_idx#10<=test_last#19) goto main::@3 -- vbuz1_le_vbuz2_then_la1 lda.z test_last cmp.z test_idx bcs __b3_from___b4 jmp __b6 // main::@6 __b6: // [24] prime_idx#1 = ++ prime_idx#17 -- vwuz1=_inc_vwuz1 inc.z prime_idx bne !+ inc.z prime_idx+1 !: // [25] main::$14 = prime_idx#1 << 1 -- vwuz1=vwuz2_rol_1 lda.z prime_idx asl sta.z __14 lda.z prime_idx+1 rol sta.z __14+1 // [26] main::$15 = PRIMES + main::$14 -- pwuz1=pwuc1_plus_vwuz1 lda.z __15 clc adc #PRIMES sta.z __15+1 // [27] *main::$15 = potential#11 -- _deref_pwuz1=vwuz2 ldy #0 lda.z potential sta (__15),y iny lda.z potential+1 sta (__15),y // [28] print_uint_decimal::w#0 = potential#11 // [29] call print_uint_decimal jsr print_uint_decimal // [30] phi from main::@6 to main::@10 [phi:main::@6->main::@10] __b10_from___b6: jmp __b10 // main::@10 __b10: // [31] call print_char // [57] phi from main::@10 to print_char [phi:main::@10->print_char] print_char_from___b10: // [57] phi print_char::ch#2 = ' ' [phi:main::@10->print_char#0] -- vbuaa=vbuc1 lda #' ' jsr print_char jmp __b11 // main::@11 __b11: // [32] if(prime_idx#1<$3e8) goto main::@1 -- vwuz1_lt_vwuc1_then_la1 lda.z prime_idx+1 cmp #>$3e8 bcc __b1_from___b11 bne !+ lda.z prime_idx cmp #<$3e8 bcc __b1_from___b11 !: jmp __breturn // main::@return __breturn: // [33] return rts } // mul8u // Perform binary multiplication of two unsigned 8-bit chars into a 16-bit unsigned int // __zp($e) unsigned int mul8u(__register(X) char a, __register(A) char b) mul8u: { .label mb = 2 .label res = $e .label return = $e // [34] mul8u::mb#0 = (unsigned int)mul8u::b#0 -- vwuz1=_word_vbuaa sta.z mb lda #0 sta.z mb+1 // [35] phi from mul8u to mul8u::@1 [phi:mul8u->mul8u::@1] __b1_from_mul8u: // [35] phi mul8u::mb#2 = mul8u::mb#0 [phi:mul8u->mul8u::@1#0] -- register_copy // [35] phi mul8u::res#2 = 0 [phi:mul8u->mul8u::@1#1] -- vwuz1=vwuc1 lda #<0 sta.z res lda #>0 sta.z res+1 // [35] phi mul8u::a#2 = mul8u::a#1 [phi:mul8u->mul8u::@1#2] -- register_copy jmp __b1 // mul8u::@1 __b1: // [36] if(mul8u::a#2!=0) goto mul8u::@2 -- vbuxx_neq_0_then_la1 cpx #0 bne __b2 jmp __breturn // mul8u::@return __breturn: // [37] return rts // mul8u::@2 __b2: // [38] mul8u::$1 = mul8u::a#2 & 1 -- vbuaa=vbuxx_band_vbuc1 txa and #1 // [39] if(mul8u::$1==0) goto mul8u::@3 -- vbuaa_eq_0_then_la1 cmp #0 beq __b3_from___b2 jmp __b4 // mul8u::@4 __b4: // [40] mul8u::res#1 = mul8u::res#2 + mul8u::mb#2 -- vwuz1=vwuz1_plus_vwuz2 clc lda.z res adc.z mb sta.z res lda.z res+1 adc.z mb+1 sta.z res+1 // [41] phi from mul8u::@2 mul8u::@4 to mul8u::@3 [phi:mul8u::@2/mul8u::@4->mul8u::@3] __b3_from___b2: __b3_from___b4: // [41] phi mul8u::res#6 = mul8u::res#2 [phi:mul8u::@2/mul8u::@4->mul8u::@3#0] -- register_copy jmp __b3 // mul8u::@3 __b3: // [42] mul8u::a#0 = mul8u::a#2 >> 1 -- vbuxx=vbuxx_ror_1 txa lsr tax // [43] mul8u::mb#1 = mul8u::mb#2 << 1 -- vwuz1=vwuz1_rol_1 asl.z mb rol.z mb+1 // [35] phi from mul8u::@3 to mul8u::@1 [phi:mul8u::@3->mul8u::@1] __b1_from___b3: // [35] phi mul8u::mb#2 = mul8u::mb#1 [phi:mul8u::@3->mul8u::@1#0] -- register_copy // [35] phi mul8u::res#2 = mul8u::res#6 [phi:mul8u::@3->mul8u::@1#1] -- register_copy // [35] phi mul8u::a#2 = mul8u::a#0 [phi:mul8u::@3->mul8u::@1#2] -- register_copy jmp __b1 } // div16u8u // Divide unsigned 16-bit unsigned long dividend with a 8-bit unsigned char divisor // The 8-bit unsigned char remainder can be found in rem8u after the division // unsigned int div16u8u(__zp($10) unsigned int dividend, __zp(8) char divisor) div16u8u: { .label dividend = $10 .label divisor = 8 // [44] divr8u::dividend#1 = byte1 div16u8u::dividend#0 -- vbuz1=_byte1_vwuz2 lda.z dividend+1 sta.z divr8u.dividend // [45] divr8u::divisor#0 = div16u8u::divisor#0 // [46] call divr8u // [61] phi from div16u8u to divr8u [phi:div16u8u->divr8u] divr8u_from_div16u8u: // [61] phi divr8u::divisor#6 = divr8u::divisor#0 [phi:div16u8u->divr8u#0] -- register_copy // [61] phi divr8u::dividend#5 = divr8u::dividend#1 [phi:div16u8u->divr8u#1] -- register_copy // [61] phi divr8u::rem#10 = 0 [phi:div16u8u->divr8u#2] -- vbuyy=vbuc1 ldy #0 jsr divr8u jmp __b1 // div16u8u::@1 __b1: // [47] divr8u::dividend#2 = byte0 div16u8u::dividend#0 -- vbuz1=_byte0_vwuz2 lda.z dividend sta.z divr8u.dividend // [48] divr8u::divisor#1 = div16u8u::divisor#0 // [49] divr8u::rem#4 = rem8u#0 // [50] call divr8u // [61] phi from div16u8u::@1 to divr8u [phi:div16u8u::@1->divr8u] divr8u_from___b1: // [61] phi divr8u::divisor#6 = divr8u::divisor#1 [phi:div16u8u::@1->divr8u#0] -- register_copy // [61] phi divr8u::dividend#5 = divr8u::dividend#2 [phi:div16u8u::@1->divr8u#1] -- register_copy // [61] phi divr8u::rem#10 = divr8u::rem#4 [phi:div16u8u::@1->divr8u#2] -- register_copy jsr divr8u jmp __breturn // div16u8u::@return __breturn: // [51] return rts } // print_uint_decimal // Print a unsigned int as DECIMAL // void print_uint_decimal(__zp($10) unsigned int w) print_uint_decimal: { .label w = $10 // [52] utoa::value#0 = print_uint_decimal::w#0 -- vwuz1=vwuz2 lda.z w sta.z utoa.value lda.z w+1 sta.z utoa.value+1 // [53] call utoa // [78] phi from print_uint_decimal to utoa [phi:print_uint_decimal->utoa] utoa_from_print_uint_decimal: jsr utoa // [54] phi from print_uint_decimal to print_uint_decimal::@1 [phi:print_uint_decimal->print_uint_decimal::@1] __b1_from_print_uint_decimal: jmp __b1 // print_uint_decimal::@1 __b1: // [55] call print_str // [99] phi from print_uint_decimal::@1 to print_str [phi:print_uint_decimal::@1->print_str] print_str_from___b1: jsr print_str jmp __breturn // print_uint_decimal::@return __breturn: // [56] return rts } // print_char // Print a single char // void print_char(__register(A) char ch) print_char: { // [58] *print_char_cursor#1 = print_char::ch#2 -- _deref_pbuz1=vbuaa ldy #0 sta (print_char_cursor),y // [59] print_char_cursor#17 = ++ print_char_cursor#1 -- pbuz1=_inc_pbuz1 inc.z print_char_cursor bne !+ inc.z print_char_cursor+1 !: jmp __breturn // print_char::@return __breturn: // [60] return rts } // divr8u // Performs division on two 8 bit unsigned chars and an initial remainder // Returns dividend/divisor. // The final remainder will be set into the global variable rem8u // Implemented using simple binary division // __zp(6) char divr8u(__zp(7) char dividend, __zp(8) char divisor, __register(Y) char rem) divr8u: { .label dividend = 7 .label quotient = 6 .label return = 6 .label divisor = 8 // [62] phi from divr8u to divr8u::@1 [phi:divr8u->divr8u::@1] __b1_from_divr8u: // [62] phi divr8u::i#2 = 0 [phi:divr8u->divr8u::@1#0] -- vbuxx=vbuc1 ldx #0 // [62] phi divr8u::quotient#3 = 0 [phi:divr8u->divr8u::@1#1] -- vbuz1=vbuc1 lda #0 sta.z quotient // [62] phi divr8u::dividend#3 = divr8u::dividend#5 [phi:divr8u->divr8u::@1#2] -- register_copy // [62] phi divr8u::rem#5 = divr8u::rem#10 [phi:divr8u->divr8u::@1#3] -- register_copy jmp __b1 // [62] phi from divr8u::@3 to divr8u::@1 [phi:divr8u::@3->divr8u::@1] __b1_from___b3: // [62] phi divr8u::i#2 = divr8u::i#1 [phi:divr8u::@3->divr8u::@1#0] -- register_copy // [62] phi divr8u::quotient#3 = divr8u::return#0 [phi:divr8u::@3->divr8u::@1#1] -- register_copy // [62] phi divr8u::dividend#3 = divr8u::dividend#0 [phi:divr8u::@3->divr8u::@1#2] -- register_copy // [62] phi divr8u::rem#5 = divr8u::rem#11 [phi:divr8u::@3->divr8u::@1#3] -- register_copy jmp __b1 // divr8u::@1 __b1: // [63] divr8u::rem#0 = divr8u::rem#5 << 1 -- vbuyy=vbuyy_rol_1 tya asl tay // [64] divr8u::$1 = divr8u::dividend#3 & $80 -- vbuaa=vbuz1_band_vbuc1 lda #$80 and.z dividend // [65] if(divr8u::$1==0) goto divr8u::@2 -- vbuaa_eq_0_then_la1 cmp #0 beq __b2_from___b1 jmp __b4 // divr8u::@4 __b4: // [66] divr8u::rem#1 = divr8u::rem#0 | 1 -- vbuyy=vbuyy_bor_vbuc1 tya ora #1 tay // [67] phi from divr8u::@1 divr8u::@4 to divr8u::@2 [phi:divr8u::@1/divr8u::@4->divr8u::@2] __b2_from___b1: __b2_from___b4: // [67] phi divr8u::rem#6 = divr8u::rem#0 [phi:divr8u::@1/divr8u::@4->divr8u::@2#0] -- register_copy jmp __b2 // divr8u::@2 __b2: // [68] divr8u::dividend#0 = divr8u::dividend#3 << 1 -- vbuz1=vbuz1_rol_1 asl.z dividend // [69] divr8u::quotient#1 = divr8u::quotient#3 << 1 -- vbuz1=vbuz1_rol_1 asl.z quotient // [70] if(divr8u::rem#6divr8u::@3] __b3_from___b2: __b3_from___b5: // [73] phi divr8u::return#0 = divr8u::quotient#1 [phi:divr8u::@2/divr8u::@5->divr8u::@3#0] -- register_copy // [73] phi divr8u::rem#11 = divr8u::rem#6 [phi:divr8u::@2/divr8u::@5->divr8u::@3#1] -- register_copy jmp __b3 // divr8u::@3 __b3: // [74] divr8u::i#1 = ++ divr8u::i#2 -- vbuxx=_inc_vbuxx inx // [75] if(divr8u::i#1!=8) goto divr8u::@1 -- vbuxx_neq_vbuc1_then_la1 cpx #8 bne __b1_from___b3 jmp __b6 // divr8u::@6 __b6: // [76] rem8u#0 = divr8u::rem#11 jmp __breturn // divr8u::@return __breturn: // [77] return rts } // utoa // Converts unsigned number value to a string representing it in RADIX format. // If the leading digits are zero they are not included in the string. // - value : The number to be converted to RADIX // - buffer : receives the string representing the number and zero-termination. // - radix : The radix to convert the number to (from the enum RADIX) // void utoa(__zp(2) unsigned int value, __zp(9) char *buffer, char radix) utoa: { .const max_digits = 5 .label value = 2 .label digit_value = 4 .label buffer = 9 .label digit = $d // [79] phi from utoa to utoa::@1 [phi:utoa->utoa::@1] __b1_from_utoa: // [79] phi utoa::buffer#11 = decimal_digits [phi:utoa->utoa::@1#0] -- pbuz1=pbuc1 lda #decimal_digits sta.z buffer+1 // [79] phi utoa::started#2 = 0 [phi:utoa->utoa::@1#1] -- vbuxx=vbuc1 ldx #0 // [79] phi utoa::value#2 = utoa::value#0 [phi:utoa->utoa::@1#2] -- register_copy // [79] phi utoa::digit#2 = 0 [phi:utoa->utoa::@1#3] -- vbuz1=vbuc1 lda #0 sta.z digit jmp __b1 // utoa::@1 __b1: // [80] if(utoa::digit#2=utoa::digit_value#0) goto utoa::@5 -- vwuz1_ge_vwuz2_then_la1 lda.z digit_value+1 cmp.z value+1 bne !+ lda.z digit_value cmp.z value beq __b5 !: bcc __b5 // [90] phi from utoa::@7 to utoa::@4 [phi:utoa::@7->utoa::@4] __b4_from___b7: // [90] phi utoa::buffer#14 = utoa::buffer#11 [phi:utoa::@7->utoa::@4#0] -- register_copy // [90] phi utoa::started#4 = utoa::started#2 [phi:utoa::@7->utoa::@4#1] -- register_copy // [90] phi utoa::value#6 = utoa::value#2 [phi:utoa::@7->utoa::@4#2] -- register_copy jmp __b4 // utoa::@4 __b4: // [91] utoa::digit#1 = ++ utoa::digit#2 -- vbuz1=_inc_vbuz1 inc.z digit // [79] phi from utoa::@4 to utoa::@1 [phi:utoa::@4->utoa::@1] __b1_from___b4: // [79] phi utoa::buffer#11 = utoa::buffer#14 [phi:utoa::@4->utoa::@1#0] -- register_copy // [79] phi utoa::started#2 = utoa::started#4 [phi:utoa::@4->utoa::@1#1] -- register_copy // [79] phi utoa::value#2 = utoa::value#6 [phi:utoa::@4->utoa::@1#2] -- register_copy // [79] phi utoa::digit#2 = utoa::digit#1 [phi:utoa::@4->utoa::@1#3] -- register_copy jmp __b1 // utoa::@5 __b5: // [92] utoa_append::buffer#0 = utoa::buffer#11 // [93] utoa_append::value#0 = utoa::value#2 // [94] utoa_append::sub#0 = utoa::digit_value#0 // [95] call utoa_append // [106] phi from utoa::@5 to utoa_append [phi:utoa::@5->utoa_append] utoa_append_from___b5: jsr utoa_append // [96] utoa_append::return#0 = utoa_append::value#2 jmp __b6 // utoa::@6 __b6: // [97] utoa::value#1 = utoa_append::return#0 // [98] utoa::buffer#5 = ++ utoa::buffer#11 -- pbuz1=_inc_pbuz1 inc.z buffer bne !+ inc.z buffer+1 !: // [90] phi from utoa::@6 to utoa::@4 [phi:utoa::@6->utoa::@4] __b4_from___b6: // [90] phi utoa::buffer#14 = utoa::buffer#5 [phi:utoa::@6->utoa::@4#0] -- register_copy // [90] phi utoa::started#4 = 1 [phi:utoa::@6->utoa::@4#1] -- vbuxx=vbuc1 ldx #1 // [90] phi utoa::value#6 = utoa::value#1 [phi:utoa::@6->utoa::@4#2] -- register_copy jmp __b4 } // print_str // Print a zero-terminated string // void print_str(__zp(9) char *str) print_str: { .label str = 9 // [100] phi from print_str to print_str::@1 [phi:print_str->print_str::@1] __b1_from_print_str: // [100] phi print_char_cursor#1 = print_char_cursor#34 [phi:print_str->print_str::@1#0] -- register_copy // [100] phi print_str::str#2 = decimal_digits [phi:print_str->print_str::@1#1] -- pbuz1=pbuc1 lda #decimal_digits sta.z str+1 jmp __b1 // print_str::@1 __b1: // [101] if(0!=*print_str::str#2) goto print_str::@2 -- 0_neq__deref_pbuz1_then_la1 ldy #0 lda (str),y cmp #0 bne __b2 jmp __breturn // print_str::@return __breturn: // [102] return rts // print_str::@2 __b2: // [103] print_char::ch#0 = *print_str::str#2 -- vbuaa=_deref_pbuz1 ldy #0 lda (str),y // [104] call print_char // [57] phi from print_str::@2 to print_char [phi:print_str::@2->print_char] print_char_from___b2: // [57] phi print_char::ch#2 = print_char::ch#0 [phi:print_str::@2->print_char#0] -- register_copy jsr print_char jmp __b3 // print_str::@3 __b3: // [105] print_str::str#0 = ++ print_str::str#2 -- pbuz1=_inc_pbuz1 inc.z str bne !+ inc.z str+1 !: // [100] phi from print_str::@3 to print_str::@1 [phi:print_str::@3->print_str::@1] __b1_from___b3: // [100] phi print_char_cursor#1 = print_char_cursor#17 [phi:print_str::@3->print_str::@1#0] -- register_copy // [100] phi print_str::str#2 = print_str::str#0 [phi:print_str::@3->print_str::@1#1] -- register_copy jmp __b1 } // utoa_append // Used to convert a single digit of an unsigned number value to a string representation // Counts a single digit up from '0' as long as the value is larger than sub. // Each time the digit is increased sub is subtracted from value. // - buffer : pointer to the char that receives the digit // - value : The value where the digit will be derived from // - sub : the value of a '1' in the digit. Subtracted continually while the digit is increased. // (For decimal the subs used are 10000, 1000, 100, 10, 1) // returns : the value reduced by sub * digit so that it is less than sub. // __zp(2) unsigned int utoa_append(__zp(9) char *buffer, __zp(2) unsigned int value, __zp(4) unsigned int sub) utoa_append: { .label buffer = 9 .label value = 2 .label sub = 4 .label return = 2 // [107] phi from utoa_append to utoa_append::@1 [phi:utoa_append->utoa_append::@1] __b1_from_utoa_append: // [107] phi utoa_append::digit#2 = 0 [phi:utoa_append->utoa_append::@1#0] -- vbuxx=vbuc1 ldx #0 // [107] phi utoa_append::value#2 = utoa_append::value#0 [phi:utoa_append->utoa_append::@1#1] -- register_copy jmp __b1 // utoa_append::@1 __b1: // [108] if(utoa_append::value#2>=utoa_append::sub#0) goto utoa_append::@2 -- vwuz1_ge_vwuz2_then_la1 lda.z sub+1 cmp.z value+1 bne !+ lda.z sub cmp.z value beq __b2 !: bcc __b2 jmp __b3 // utoa_append::@3 __b3: // [109] *utoa_append::buffer#0 = DIGITS[utoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbuxx lda DIGITS,x ldy #0 sta (buffer),y jmp __breturn // utoa_append::@return __breturn: // [110] return rts // utoa_append::@2 __b2: // [111] utoa_append::digit#1 = ++ utoa_append::digit#2 -- vbuxx=_inc_vbuxx inx // [112] utoa_append::value#1 = utoa_append::value#2 - utoa_append::sub#0 -- vwuz1=vwuz1_minus_vwuz2 lda.z value sec sbc.z sub sta.z value lda.z value+1 sbc.z sub+1 sta.z value+1 // [107] phi from utoa_append::@2 to utoa_append::@1 [phi:utoa_append::@2->utoa_append::@1] __b1_from___b2: // [107] phi utoa_append::digit#2 = utoa_append::digit#1 [phi:utoa_append::@2->utoa_append::@1#0] -- register_copy // [107] phi utoa_append::value#2 = utoa_append::value#1 [phi:utoa_append::@2->utoa_append::@1#1] -- register_copy jmp __b1 } // File Data .segment Data // The digits used for numbers DIGITS: .text "0123456789abcdef" // Values of decimal digits RADIX_DECIMAL_VALUES: .word $2710, $3e8, $64, $a // Digits used for storing the decimal unsigned int decimal_digits: .fill 6, 0 // Table that is filled with the primes we are finding PRIMES: .fill 2*$3e8, 0 ASSEMBLER OPTIMIZATIONS Removing instruction jmp __b1 Removing instruction jmp __b8 Removing instruction jmp __b7 Removing instruction jmp __b2 Removing instruction jmp __b3 Removing instruction jmp __b9 Removing instruction jmp __b5 Removing instruction jmp __b4 Removing instruction jmp __b6 Removing instruction jmp __b10 Removing instruction jmp __b11 Removing instruction jmp __breturn Removing instruction jmp __b1 Removing instruction jmp __breturn Removing instruction jmp __b4 Removing instruction jmp __b3 Removing instruction jmp __b1 Removing instruction jmp __breturn Removing instruction jmp __b1 Removing instruction jmp __breturn Removing instruction jmp __breturn Removing instruction jmp __b1 Removing instruction jmp __b4 Removing instruction jmp __b2 Removing instruction jmp __b5 Removing instruction jmp __b3 Removing instruction jmp __b6 Removing instruction jmp __breturn Removing instruction jmp __b1 Removing instruction jmp __b3 Removing instruction jmp __breturn Removing instruction jmp __b7 Removing instruction jmp __b4 Removing instruction jmp __b6 Removing instruction jmp __b1 Removing instruction jmp __breturn Removing instruction jmp __b3 Removing instruction jmp __b1 Removing instruction jmp __b3 Removing instruction jmp __breturn Succesful ASM optimization Pass5NextJumpElimination Removing instruction lda #>0 Replacing instruction lda #0 with TXA Replacing instruction lda #0 with TXA Replacing instruction ldy #0 with TAY Succesful ASM optimization Pass5UnnecesaryLoadElimination Replacing label __b2_from___b8 with __b2 Replacing label __b2_from___b8 with __b2 Replacing label __b4_from___b9 with __b4 Replacing label __b3_from___b4 with __b3 Replacing label __b1_from___b11 with __b1 Replacing label __b1_from___b11 with __b1 Replacing label __b3_from___b2 with __b3 Replacing label __b2_from___b1 with __b2 Replacing label __b3_from___b2 with __b3 Replacing label __b1_from___b3 with __b1 Removing instruction __b1_from___b11: Removing instruction __b2_from___b7: Removing instruction __b2_from___b8: Removing instruction __b3_from___b4: Removing instruction __b4_from___b9: Removing instruction __b10_from___b6: Removing instruction print_char_from___b10: Removing instruction __b3_from___b2: Removing instruction __b3_from___b4: Removing instruction __b1_from_print_uint_decimal: Removing instruction print_str_from___b1: Removing instruction __b1_from___b3: Removing instruction __b2_from___b1: Removing instruction __b2_from___b4: Removing instruction __b3_from___b2: Removing instruction __b3_from___b5: Removing instruction __breturn: Removing instruction __b4_from___b7: Removing instruction utoa_append_from___b5: Succesful ASM optimization Pass5RedundantLabelElimination Removing instruction __b1_from_main: Removing instruction __b8: Removing instruction __b7: Removing instruction __b3_from___b2: Removing instruction __b9: Removing instruction __b5: Removing instruction __b4_from___b5: Removing instruction __b6: Removing instruction __b10: Removing instruction __b11: Removing instruction __breturn: Removing instruction __b1_from_mul8u: Removing instruction __breturn: Removing instruction __b4: Removing instruction __b1_from___b3: Removing instruction divr8u_from_div16u8u: Removing instruction __b1: Removing instruction divr8u_from___b1: Removing instruction __breturn: Removing instruction utoa_from_print_uint_decimal: Removing instruction __b1: Removing instruction __breturn: Removing instruction __breturn: Removing instruction __b1_from_divr8u: Removing instruction __b4: Removing instruction __b5: Removing instruction __b6: Removing instruction __b1_from_utoa: Removing instruction __b3: Removing instruction __breturn: Removing instruction __b7: Removing instruction __b1_from___b4: Removing instruction __b6: Removing instruction __b4_from___b6: Removing instruction __b1_from_print_str: Removing instruction __breturn: Removing instruction print_char_from___b2: Removing instruction __b3: Removing instruction __b1_from___b3: Removing instruction __b1_from_utoa_append: Removing instruction __b3: Removing instruction __breturn: Removing instruction __b1_from___b2: Succesful ASM optimization Pass5UnusedLabelElimination Removing instruction jmp __b1 Removing instruction jmp __b3 Removing instruction jmp __b4 Removing instruction jmp __b1 Succesful ASM optimization Pass5NextJumpElimination Removing instruction lda #<0 Removing instruction lda.z digit_value+1 Succesful ASM optimization Pass5UnnecesaryLoadElimination Fixing long branch [126] bcc __b1 to bcs Fixing long branch [132] bcc __b1 to bcs FINAL SYMBOL TABLE __constant char DIGITS[] = "0123456789abcdef"z __constant unsigned int PRIMES[$3e8] = { fill( $3e8, 0) } __constant char RADIX::BINARY = 2 __constant char RADIX::DECIMAL = $a __constant char RADIX::HEXADECIMAL = $10 __constant char RADIX::OCTAL = 8 __constant unsigned int RADIX_DECIMAL_VALUES[] = { $2710, $3e8, $64, $a } __constant char SIZEOF_UNSIGNED_INT = 2 __constant char decimal_digits[6] = { fill( 6, 0) } unsigned int div16u8u(unsigned int dividend , char divisor) unsigned int div16u8u::dividend unsigned int div16u8u::dividend#0 // dividend zp[2]:16 420.59999999999997 char div16u8u::divisor char div16u8u::divisor#0 // divisor zp[1]:8 420.59999999999997 unsigned int div16u8u::quotient char div16u8u::quotient_hi char div16u8u::quotient_lo unsigned int div16u8u::return char divr8u(char dividend , char divisor , char rem) char divr8u::$1 // reg byte a 2.0000002E7 char divr8u::dividend char divr8u::dividend#0 // dividend zp[1]:7 2500000.25 char divr8u::dividend#1 // dividend zp[1]:7 1001.0 char divr8u::dividend#2 // dividend zp[1]:7 667.3333333333334 char divr8u::dividend#3 // dividend zp[1]:7 5001667.333333333 char divr8u::dividend#5 // dividend zp[1]:7 12003.0 char divr8u::divisor char divr8u::divisor#0 // divisor zp[1]:8 2002.0 char divr8u::divisor#1 // divisor zp[1]:8 1001.0 char divr8u::divisor#6 // divisor zp[1]:8 1333466.933333333 char divr8u::i char divr8u::i#1 // reg byte x 1.50000015E7 char divr8u::i#2 // reg byte x 1666666.8333333333 char divr8u::quotient char divr8u::quotient#1 // quotient zp[1]:6 1.50000015E7 char divr8u::quotient#2 // quotient zp[1]:6 1.0000001E7 char divr8u::quotient#3 // quotient zp[1]:6 2857143.1428571427 char divr8u::rem char divr8u::rem#0 // reg byte y 1.0000001E7 char divr8u::rem#1 // reg byte y 2.0000002E7 char divr8u::rem#10 // reg byte y 11002.0 char divr8u::rem#11 // reg byte y 1.0003334666666666E7 char divr8u::rem#2 // reg byte y 2.0000002E7 char divr8u::rem#4 // reg byte y 2002.0 char divr8u::rem#5 // reg byte y 2.0010003E7 char divr8u::rem#6 // reg byte y 1.0000001E7 char divr8u::return char divr8u::return#0 // return zp[1]:6 1.0000001E7 void main() unsigned int main::$0 // zp[2]:14 22.0 char main::$12 // reg byte a 11.0 char main::$13 // reg byte x 50.5 unsigned int main::$14 // zp[2]:2 22.0 unsigned int *main::$15 // zp[2]:2 22.0 char main::p char main::p#0 // reg byte a 16.5 unsigned int mul8u(char a , char b) char mul8u::$1 // reg byte a 20002.0 char mul8u::a char mul8u::a#0 // reg byte x 10001.0 char mul8u::a#1 // reg byte x 37.33333333333333 char mul8u::a#2 // reg byte x 6684.166666666666 char mul8u::b char mul8u::b#0 // reg byte a 11.0 unsigned int mul8u::mb unsigned int mul8u::mb#0 // mb zp[2]:2 202.0 unsigned int mul8u::mb#1 // mb zp[2]:2 20002.0 unsigned int mul8u::mb#2 // mb zp[2]:2 4300.571428571429 unsigned int mul8u::res unsigned int mul8u::res#1 // res zp[2]:14 20002.0 unsigned int mul8u::res#2 // res zp[2]:14 5002.333333333333 unsigned int mul8u::res#6 // res zp[2]:14 10001.0 unsigned int mul8u::return unsigned int mul8u::return#2 // return zp[2]:14 22.0 unsigned int potential unsigned int potential#1 // potential zp[2]:16 22.0 unsigned int potential#10 // potential zp[2]:16 59.28571428571429 unsigned int potential#11 // potential zp[2]:16 30.545454545454547 unsigned int potential#15 // potential zp[2]:16 3.0 unsigned int potential#2 // potential zp[2]:16 202.0 unsigned int prime_idx unsigned int prime_idx#1 // prime_idx zp[2]:19 4.888888888888889 unsigned int prime_idx#17 // prime_idx zp[2]:19 1.0 void print_char(char ch) char print_char::ch char print_char::ch#0 // reg byte a 200002.0 char print_char::ch#2 // reg byte a 1100002.0 char *print_char_cursor char *print_char_cursor#1 // print_char_cursor zp[2]:11 210100.40000000002 char *print_char_cursor#17 // print_char_cursor zp[2]:11 183335.50000000003 char *print_char_cursor#34 // print_char_cursor zp[2]:11 32.64516129032258 char *print_line_cursor char *print_screen __constant char *print_screen#0 = (char *) 1024 // print_screen void print_str(char *str) char *print_str::str char *print_str::str#0 // str zp[2]:9 200002.0 char *print_str::str#2 // str zp[2]:9 100001.0 void print_uint_decimal(unsigned int w) unsigned int print_uint_decimal::w unsigned int print_uint_decimal::w#0 // w zp[2]:16 112.0 char rem8u char rem8u#0 // reg byte y 1233.6666666666665 char test_idx char test_idx#1 // test_idx zp[1]:13 101.0 char test_idx#10 // test_idx zp[1]:13 151.5 char test_idx#7 // test_idx zp[1]:13 60.599999999999994 char test_last char test_last#1 // test_last zp[1]:18 22.0 char test_last#13 // test_last zp[1]:18 4.888888888888889 char test_last#19 // test_last zp[1]:18 6.380952380952381 void utoa(unsigned int value , char *buffer , char radix) char utoa::$10 // reg byte a 200002.0 char utoa::$11 // reg byte x 2002.0 char *utoa::buffer char *utoa::buffer#11 // buffer zp[2]:9 28714.714285714286 char *utoa::buffer#14 // buffer zp[2]:9 150001.5 char *utoa::buffer#4 // buffer zp[2]:9 2002.0 char *utoa::buffer#5 // buffer zp[2]:9 200002.0 char utoa::digit char utoa::digit#1 // digit zp[1]:13 200002.0 char utoa::digit#2 // digit zp[1]:13 28571.714285714286 unsigned int utoa::digit_value unsigned int utoa::digit_value#0 // digit_value zp[2]:4 60000.600000000006 unsigned int *utoa::digit_values char utoa::max_digits __constant char utoa::max_digits#1 = 5 // max_digits char utoa::radix char utoa::started char utoa::started#2 // reg byte x 50000.5 char utoa::started#4 // reg byte x 100001.0 unsigned int utoa::value unsigned int utoa::value#0 // value zp[2]:2 551.0 unsigned int utoa::value#1 // value zp[2]:2 100001.0 unsigned int utoa::value#2 // value zp[2]:2 57286.42857142857 unsigned int utoa::value#6 // value zp[2]:2 150001.5 unsigned int utoa_append(char *buffer , unsigned int value , unsigned int sub) char *utoa_append::buffer char *utoa_append::buffer#0 // buffer zp[2]:9 137500.25 char utoa_append::digit char utoa_append::digit#1 // reg byte x 1.000000001E9 char utoa_append::digit#2 // reg byte x 1.0005000015E9 unsigned int utoa_append::return unsigned int utoa_append::return#0 // return zp[2]:2 200002.0 unsigned int utoa_append::sub unsigned int utoa_append::sub#0 // sub zp[2]:4 3.333500005E8 unsigned int utoa_append::value unsigned int utoa_append::value#0 // value zp[2]:2 366667.3333333334 unsigned int utoa_append::value#1 // value zp[2]:2 2.000000002E9 unsigned int utoa_append::value#2 // value zp[2]:2 5.0018333416666675E8 zp[1]:18 [ test_last#13 test_last#19 test_last#1 ] zp[2]:19 [ prime_idx#17 prime_idx#1 ] zp[2]:16 [ potential#10 potential#1 potential#15 potential#11 potential#2 div16u8u::dividend#0 print_uint_decimal::w#0 ] reg byte x [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] zp[2]:14 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 main::$0 ] reg byte a [ print_char::ch#2 print_char::ch#0 ] zp[1]:8 [ divr8u::divisor#6 divr8u::divisor#0 divr8u::divisor#1 div16u8u::divisor#0 ] reg byte y [ divr8u::rem#5 divr8u::rem#10 divr8u::rem#4 divr8u::rem#11 divr8u::rem#6 divr8u::rem#0 divr8u::rem#1 divr8u::rem#2 ] zp[1]:7 [ divr8u::dividend#3 divr8u::dividend#5 divr8u::dividend#1 divr8u::dividend#2 divr8u::dividend#0 ] zp[1]:6 [ divr8u::quotient#3 divr8u::return#0 divr8u::quotient#1 divr8u::quotient#2 ] reg byte x [ divr8u::i#2 divr8u::i#1 ] zp[1]:13 [ utoa::digit#2 utoa::digit#1 test_idx#7 test_idx#10 test_idx#1 ] reg byte x [ utoa::started#2 utoa::started#4 ] zp[2]:9 [ print_str::str#2 print_str::str#0 utoa::buffer#11 utoa::buffer#14 utoa::buffer#5 utoa::buffer#4 utoa_append::buffer#0 ] zp[2]:11 [ print_char_cursor#1 print_char_cursor#34 print_char_cursor#17 ] reg byte x [ utoa_append::digit#2 utoa_append::digit#1 ] reg byte a [ main::$12 ] reg byte a [ main::p#0 ] reg byte a [ mul8u::b#0 ] reg byte x [ main::$13 ] zp[2]:2 [ main::$14 main::$15 utoa::value#2 utoa::value#6 utoa::value#0 utoa::value#1 utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 utoa_append::return#0 mul8u::mb#2 mul8u::mb#0 mul8u::mb#1 ] reg byte a [ mul8u::$1 ] reg byte a [ divr8u::$1 ] reg byte y [ rem8u#0 ] reg byte x [ utoa::$11 ] reg byte a [ utoa::$10 ] zp[2]:4 [ utoa::digit_value#0 utoa_append::sub#0 ] FINAL ASSEMBLER Score: 139370 // File Comments // Calculates the 1000 first primes // From A Comparison of Language Speed, The Transactor, March 1987, Volume 7, Issue 5 // http://csbruce.com/cbm/transactor/pdfs/trans_v7_i05.pdf // Upstart // Commodore 64 PRG executable file .file [name="primes-1000-2.prg", type="prg", segments="Program"] .segmentdef Program [segments="Basic, Code, Data"] .segmentdef Basic [start=$0801] .segmentdef Code [start=$80d] .segmentdef Data [startAfter="Code"] .segment Basic :BasicUpstart(main) // Global Constants & labels .const SIZEOF_UNSIGNED_INT = 2 .label print_screen = $400 .label print_char_cursor = $b // The number currently being tested for whether it is a prime .label potential = $10 // The last index to test. It is the smallest index where PRIMES[test_last] > sqr(potential) .label test_last = $12 // The index into PRIMES[] used for prime testing. It runs from 2 to test_last for each number tested. .label test_idx = $d // The index of the last prime we put into the PRIME[] table .label prime_idx = $13 .segment Code // main main: { .label __0 = $e .label __14 = 2 .label __15 = 2 // PRIMES[1] = 2 // [0] *(PRIMES+1*SIZEOF_UNSIGNED_INT) = 2 -- _deref_pwuc1=vbuc2 lda #<2 sta PRIMES+1*SIZEOF_UNSIGNED_INT lda #>2 sta PRIMES+1*SIZEOF_UNSIGNED_INT+1 // PRIMES[2] = 3 // [1] *(PRIMES+2*SIZEOF_UNSIGNED_INT) = 3 -- _deref_pwuc1=vbuc2 lda #<3 sta PRIMES+2*SIZEOF_UNSIGNED_INT lda #>3 sta PRIMES+2*SIZEOF_UNSIGNED_INT+1 // [2] phi from main to main::@1 [phi:main->main::@1] // [2] phi print_char_cursor#34 = print_screen#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #print_screen sta.z print_char_cursor+1 // [2] phi prime_idx#17 = 2 [phi:main->main::@1#1] -- vwuz1=vbuc1 lda #<2 sta.z prime_idx lda #>2 sta.z prime_idx+1 // [2] phi potential#15 = 3 [phi:main->main::@1#2] -- vwuz1=vbuc1 lda #<3 sta.z potential lda #>3 sta.z potential+1 // [2] phi test_last#13 = 2 [phi:main->main::@1#3] -- vbuz1=vbuc1 lda #2 sta.z test_last // [2] phi from main::@11 to main::@1 [phi:main::@11->main::@1] // [2] phi print_char_cursor#34 = print_char_cursor#17 [phi:main::@11->main::@1#0] -- register_copy // [2] phi prime_idx#17 = prime_idx#1 [phi:main::@11->main::@1#1] -- register_copy // [2] phi potential#15 = potential#11 [phi:main::@11->main::@1#2] -- register_copy // [2] phi test_last#13 = test_last#19 [phi:main::@11->main::@1#3] -- register_copy // main::@1 __b1: // char p = (char)PRIMES[test_last] // [3] main::$12 = test_last#13 << 1 -- vbuaa=vbuz1_rol_1 lda.z test_last asl // [4] main::p#0 = (char)PRIMES[main::$12] -- vbuaa=_byte_pwuc1_derefidx_vbuaa tay lda PRIMES,y // mul8u(p, p) // [5] mul8u::a#1 = main::p#0 -- vbuxx=vbuaa tax // [6] mul8u::b#0 = main::p#0 // [7] call mul8u jsr mul8u // [8] mul8u::return#2 = mul8u::res#2 // main::@8 // [9] main::$0 = mul8u::return#2 // if(potential > mul8u(p, p)) // [10] if(potential#15<=main::$0) goto main::@2 -- vwuz1_le_vwuz2_then_la1 lda.z potential+1 cmp.z __0+1 bne !+ lda.z potential cmp.z __0 beq __b2 !: bcc __b2 // main::@7 // test_last++; // [11] test_last#1 = ++ test_last#13 -- vbuz1=_inc_vbuz1 inc.z test_last // [12] phi from main::@7 main::@8 to main::@2 [phi:main::@7/main::@8->main::@2] // [12] phi test_last#19 = test_last#1 [phi:main::@7/main::@8->main::@2#0] -- register_copy // main::@2 __b2: // potential +=2 // [13] potential#1 = potential#15 + 2 -- vwuz1=vwuz1_plus_vbuc1 lda #2 clc adc.z potential sta.z potential bcc !+ inc.z potential+1 !: // [14] phi from main::@2 to main::@3 [phi:main::@2->main::@3] // [14] phi potential#10 = potential#1 [phi:main::@2->main::@3#0] -- register_copy // [14] phi test_idx#7 = 2 [phi:main::@2->main::@3#1] -- vbuz1=vbuc1 lda #2 sta.z test_idx // [14] phi from main::@4 to main::@3 [phi:main::@4->main::@3] // [14] phi potential#10 = potential#11 [phi:main::@4->main::@3#0] -- register_copy // [14] phi test_idx#7 = test_idx#10 [phi:main::@4->main::@3#1] -- register_copy // main::@3 __b3: // div16u8u(potential, (char)PRIMES[test_idx++]) // [15] main::$13 = test_idx#7 << 1 -- vbuxx=vbuz1_rol_1 lda.z test_idx asl tax // [16] div16u8u::dividend#0 = potential#10 // [17] div16u8u::divisor#0 = (char)PRIMES[main::$13] -- vbuz1=_byte_pwuc1_derefidx_vbuxx lda PRIMES,x sta.z div16u8u.divisor // [18] call div16u8u jsr div16u8u // main::@9 // div16u8u(potential, (char)PRIMES[test_idx++]); // [19] test_idx#1 = ++ test_idx#7 -- vbuz1=_inc_vbuz1 inc.z test_idx // if(rem8u == 0) // [20] if(rem8u#0!=0) goto main::@4 -- vbuyy_neq_0_then_la1 cpy #0 bne __b4 // main::@5 // potential +=2 // [21] potential#2 = potential#10 + 2 -- vwuz1=vwuz1_plus_vbuc1 lda #2 clc adc.z potential sta.z potential bcc !+ inc.z potential+1 !: // [22] phi from main::@5 to main::@4 [phi:main::@5->main::@4] // [22] phi potential#11 = potential#2 [phi:main::@5->main::@4#0] -- register_copy // [22] phi test_idx#10 = 2 [phi:main::@5->main::@4#1] -- vbuz1=vbuc1 lda #2 sta.z test_idx // [22] phi from main::@9 to main::@4 [phi:main::@9->main::@4] // [22] phi potential#11 = potential#10 [phi:main::@9->main::@4#0] -- register_copy // [22] phi test_idx#10 = test_idx#1 [phi:main::@9->main::@4#1] -- register_copy // main::@4 __b4: // while (test_idx<=test_last) // [23] if(test_idx#10<=test_last#19) goto main::@3 -- vbuz1_le_vbuz2_then_la1 lda.z test_last cmp.z test_idx bcs __b3 // main::@6 // PRIMES[++prime_idx] = potential; // [24] prime_idx#1 = ++ prime_idx#17 -- vwuz1=_inc_vwuz1 inc.z prime_idx bne !+ inc.z prime_idx+1 !: // PRIMES[++prime_idx] = potential // [25] main::$14 = prime_idx#1 << 1 -- vwuz1=vwuz2_rol_1 lda.z prime_idx asl sta.z __14 lda.z prime_idx+1 rol sta.z __14+1 // [26] main::$15 = PRIMES + main::$14 -- pwuz1=pwuc1_plus_vwuz1 lda.z __15 clc adc #PRIMES sta.z __15+1 // [27] *main::$15 = potential#11 -- _deref_pwuz1=vwuz2 ldy #0 lda.z potential sta (__15),y iny lda.z potential+1 sta (__15),y // print_uint_decimal(potential) // [28] print_uint_decimal::w#0 = potential#11 // [29] call print_uint_decimal jsr print_uint_decimal // [30] phi from main::@6 to main::@10 [phi:main::@6->main::@10] // main::@10 // print_char(' ') // [31] call print_char // [57] phi from main::@10 to print_char [phi:main::@10->print_char] // [57] phi print_char::ch#2 = ' ' [phi:main::@10->print_char#0] -- vbuaa=vbuc1 lda #' ' jsr print_char // main::@11 // while(prime_idx$3e8 bcs !__b1+ jmp __b1 !__b1: bne !+ lda.z prime_idx cmp #<$3e8 bcs !__b1+ jmp __b1 !__b1: !: // main::@return // } // [33] return rts } // mul8u // Perform binary multiplication of two unsigned 8-bit chars into a 16-bit unsigned int // __zp($e) unsigned int mul8u(__register(X) char a, __register(A) char b) mul8u: { .label mb = 2 .label res = $e .label return = $e // unsigned int mb = b // [34] mul8u::mb#0 = (unsigned int)mul8u::b#0 -- vwuz1=_word_vbuaa sta.z mb lda #0 sta.z mb+1 // [35] phi from mul8u to mul8u::@1 [phi:mul8u->mul8u::@1] // [35] phi mul8u::mb#2 = mul8u::mb#0 [phi:mul8u->mul8u::@1#0] -- register_copy // [35] phi mul8u::res#2 = 0 [phi:mul8u->mul8u::@1#1] -- vwuz1=vwuc1 sta.z res sta.z res+1 // [35] phi mul8u::a#2 = mul8u::a#1 [phi:mul8u->mul8u::@1#2] -- register_copy // mul8u::@1 __b1: // while(a!=0) // [36] if(mul8u::a#2!=0) goto mul8u::@2 -- vbuxx_neq_0_then_la1 cpx #0 bne __b2 // mul8u::@return // } // [37] return rts // mul8u::@2 __b2: // a&1 // [38] mul8u::$1 = mul8u::a#2 & 1 -- vbuaa=vbuxx_band_vbuc1 txa and #1 // if( (a&1) != 0) // [39] if(mul8u::$1==0) goto mul8u::@3 -- vbuaa_eq_0_then_la1 cmp #0 beq __b3 // mul8u::@4 // res = res + mb // [40] mul8u::res#1 = mul8u::res#2 + mul8u::mb#2 -- vwuz1=vwuz1_plus_vwuz2 clc lda.z res adc.z mb sta.z res lda.z res+1 adc.z mb+1 sta.z res+1 // [41] phi from mul8u::@2 mul8u::@4 to mul8u::@3 [phi:mul8u::@2/mul8u::@4->mul8u::@3] // [41] phi mul8u::res#6 = mul8u::res#2 [phi:mul8u::@2/mul8u::@4->mul8u::@3#0] -- register_copy // mul8u::@3 __b3: // a = a>>1 // [42] mul8u::a#0 = mul8u::a#2 >> 1 -- vbuxx=vbuxx_ror_1 txa lsr tax // mb = mb<<1 // [43] mul8u::mb#1 = mul8u::mb#2 << 1 -- vwuz1=vwuz1_rol_1 asl.z mb rol.z mb+1 // [35] phi from mul8u::@3 to mul8u::@1 [phi:mul8u::@3->mul8u::@1] // [35] phi mul8u::mb#2 = mul8u::mb#1 [phi:mul8u::@3->mul8u::@1#0] -- register_copy // [35] phi mul8u::res#2 = mul8u::res#6 [phi:mul8u::@3->mul8u::@1#1] -- register_copy // [35] phi mul8u::a#2 = mul8u::a#0 [phi:mul8u::@3->mul8u::@1#2] -- register_copy jmp __b1 } // div16u8u // Divide unsigned 16-bit unsigned long dividend with a 8-bit unsigned char divisor // The 8-bit unsigned char remainder can be found in rem8u after the division // unsigned int div16u8u(__zp($10) unsigned int dividend, __zp(8) char divisor) div16u8u: { .label dividend = $10 .label divisor = 8 // unsigned char quotient_hi = divr8u(BYTE1(dividend), divisor, 0) // [44] divr8u::dividend#1 = byte1 div16u8u::dividend#0 -- vbuz1=_byte1_vwuz2 lda.z dividend+1 sta.z divr8u.dividend // [45] divr8u::divisor#0 = div16u8u::divisor#0 // [46] call divr8u // [61] phi from div16u8u to divr8u [phi:div16u8u->divr8u] // [61] phi divr8u::divisor#6 = divr8u::divisor#0 [phi:div16u8u->divr8u#0] -- register_copy // [61] phi divr8u::dividend#5 = divr8u::dividend#1 [phi:div16u8u->divr8u#1] -- register_copy // [61] phi divr8u::rem#10 = 0 [phi:div16u8u->divr8u#2] -- vbuyy=vbuc1 ldy #0 jsr divr8u // div16u8u::@1 // unsigned char quotient_lo = divr8u(BYTE0(dividend), divisor, rem8u) // [47] divr8u::dividend#2 = byte0 div16u8u::dividend#0 -- vbuz1=_byte0_vwuz2 lda.z dividend sta.z divr8u.dividend // [48] divr8u::divisor#1 = div16u8u::divisor#0 // [49] divr8u::rem#4 = rem8u#0 // [50] call divr8u // [61] phi from div16u8u::@1 to divr8u [phi:div16u8u::@1->divr8u] // [61] phi divr8u::divisor#6 = divr8u::divisor#1 [phi:div16u8u::@1->divr8u#0] -- register_copy // [61] phi divr8u::dividend#5 = divr8u::dividend#2 [phi:div16u8u::@1->divr8u#1] -- register_copy // [61] phi divr8u::rem#10 = divr8u::rem#4 [phi:div16u8u::@1->divr8u#2] -- register_copy jsr divr8u // div16u8u::@return // } // [51] return rts } // print_uint_decimal // Print a unsigned int as DECIMAL // void print_uint_decimal(__zp($10) unsigned int w) print_uint_decimal: { .label w = $10 // utoa(w, decimal_digits, DECIMAL) // [52] utoa::value#0 = print_uint_decimal::w#0 -- vwuz1=vwuz2 lda.z w sta.z utoa.value lda.z w+1 sta.z utoa.value+1 // [53] call utoa // [78] phi from print_uint_decimal to utoa [phi:print_uint_decimal->utoa] jsr utoa // [54] phi from print_uint_decimal to print_uint_decimal::@1 [phi:print_uint_decimal->print_uint_decimal::@1] // print_uint_decimal::@1 // print_str(decimal_digits) // [55] call print_str // [99] phi from print_uint_decimal::@1 to print_str [phi:print_uint_decimal::@1->print_str] jsr print_str // print_uint_decimal::@return // } // [56] return rts } // print_char // Print a single char // void print_char(__register(A) char ch) print_char: { // *(print_char_cursor++) = ch // [58] *print_char_cursor#1 = print_char::ch#2 -- _deref_pbuz1=vbuaa ldy #0 sta (print_char_cursor),y // *(print_char_cursor++) = ch; // [59] print_char_cursor#17 = ++ print_char_cursor#1 -- pbuz1=_inc_pbuz1 inc.z print_char_cursor bne !+ inc.z print_char_cursor+1 !: // print_char::@return // } // [60] return rts } // divr8u // Performs division on two 8 bit unsigned chars and an initial remainder // Returns dividend/divisor. // The final remainder will be set into the global variable rem8u // Implemented using simple binary division // __zp(6) char divr8u(__zp(7) char dividend, __zp(8) char divisor, __register(Y) char rem) divr8u: { .label dividend = 7 .label quotient = 6 .label return = 6 .label divisor = 8 // [62] phi from divr8u to divr8u::@1 [phi:divr8u->divr8u::@1] // [62] phi divr8u::i#2 = 0 [phi:divr8u->divr8u::@1#0] -- vbuxx=vbuc1 ldx #0 // [62] phi divr8u::quotient#3 = 0 [phi:divr8u->divr8u::@1#1] -- vbuz1=vbuc1 txa sta.z quotient // [62] phi divr8u::dividend#3 = divr8u::dividend#5 [phi:divr8u->divr8u::@1#2] -- register_copy // [62] phi divr8u::rem#5 = divr8u::rem#10 [phi:divr8u->divr8u::@1#3] -- register_copy // [62] phi from divr8u::@3 to divr8u::@1 [phi:divr8u::@3->divr8u::@1] // [62] phi divr8u::i#2 = divr8u::i#1 [phi:divr8u::@3->divr8u::@1#0] -- register_copy // [62] phi divr8u::quotient#3 = divr8u::return#0 [phi:divr8u::@3->divr8u::@1#1] -- register_copy // [62] phi divr8u::dividend#3 = divr8u::dividend#0 [phi:divr8u::@3->divr8u::@1#2] -- register_copy // [62] phi divr8u::rem#5 = divr8u::rem#11 [phi:divr8u::@3->divr8u::@1#3] -- register_copy // divr8u::@1 __b1: // rem = rem << 1 // [63] divr8u::rem#0 = divr8u::rem#5 << 1 -- vbuyy=vbuyy_rol_1 tya asl tay // dividend & 0x80 // [64] divr8u::$1 = divr8u::dividend#3 & $80 -- vbuaa=vbuz1_band_vbuc1 lda #$80 and.z dividend // if( (dividend & 0x80) != 0 ) // [65] if(divr8u::$1==0) goto divr8u::@2 -- vbuaa_eq_0_then_la1 cmp #0 beq __b2 // divr8u::@4 // rem = rem | 1 // [66] divr8u::rem#1 = divr8u::rem#0 | 1 -- vbuyy=vbuyy_bor_vbuc1 tya ora #1 tay // [67] phi from divr8u::@1 divr8u::@4 to divr8u::@2 [phi:divr8u::@1/divr8u::@4->divr8u::@2] // [67] phi divr8u::rem#6 = divr8u::rem#0 [phi:divr8u::@1/divr8u::@4->divr8u::@2#0] -- register_copy // divr8u::@2 __b2: // dividend = dividend << 1 // [68] divr8u::dividend#0 = divr8u::dividend#3 << 1 -- vbuz1=vbuz1_rol_1 asl.z dividend // quotient = quotient << 1 // [69] divr8u::quotient#1 = divr8u::quotient#3 << 1 -- vbuz1=vbuz1_rol_1 asl.z quotient // if(rem>=divisor) // [70] if(divr8u::rem#6divr8u::@3] // [73] phi divr8u::return#0 = divr8u::quotient#1 [phi:divr8u::@2/divr8u::@5->divr8u::@3#0] -- register_copy // [73] phi divr8u::rem#11 = divr8u::rem#6 [phi:divr8u::@2/divr8u::@5->divr8u::@3#1] -- register_copy // divr8u::@3 __b3: // for( char i : 0..7) // [74] divr8u::i#1 = ++ divr8u::i#2 -- vbuxx=_inc_vbuxx inx // [75] if(divr8u::i#1!=8) goto divr8u::@1 -- vbuxx_neq_vbuc1_then_la1 cpx #8 bne __b1 // divr8u::@6 // rem8u = rem // [76] rem8u#0 = divr8u::rem#11 // divr8u::@return // } // [77] return rts } // utoa // Converts unsigned number value to a string representing it in RADIX format. // If the leading digits are zero they are not included in the string. // - value : The number to be converted to RADIX // - buffer : receives the string representing the number and zero-termination. // - radix : The radix to convert the number to (from the enum RADIX) // void utoa(__zp(2) unsigned int value, __zp(9) char *buffer, char radix) utoa: { .const max_digits = 5 .label value = 2 .label digit_value = 4 .label buffer = 9 .label digit = $d // [79] phi from utoa to utoa::@1 [phi:utoa->utoa::@1] // [79] phi utoa::buffer#11 = decimal_digits [phi:utoa->utoa::@1#0] -- pbuz1=pbuc1 lda #decimal_digits sta.z buffer+1 // [79] phi utoa::started#2 = 0 [phi:utoa->utoa::@1#1] -- vbuxx=vbuc1 ldx #0 // [79] phi utoa::value#2 = utoa::value#0 [phi:utoa->utoa::@1#2] -- register_copy // [79] phi utoa::digit#2 = 0 [phi:utoa->utoa::@1#3] -- vbuz1=vbuc1 txa sta.z digit // utoa::@1 __b1: // for( char digit=0; digit= digit_value) // [88] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1 cpx #0 bne __b5 // utoa::@7 // [89] if(utoa::value#2>=utoa::digit_value#0) goto utoa::@5 -- vwuz1_ge_vwuz2_then_la1 cmp.z value+1 bne !+ lda.z digit_value cmp.z value beq __b5 !: bcc __b5 // [90] phi from utoa::@7 to utoa::@4 [phi:utoa::@7->utoa::@4] // [90] phi utoa::buffer#14 = utoa::buffer#11 [phi:utoa::@7->utoa::@4#0] -- register_copy // [90] phi utoa::started#4 = utoa::started#2 [phi:utoa::@7->utoa::@4#1] -- register_copy // [90] phi utoa::value#6 = utoa::value#2 [phi:utoa::@7->utoa::@4#2] -- register_copy // utoa::@4 __b4: // for( char digit=0; digitutoa::@1] // [79] phi utoa::buffer#11 = utoa::buffer#14 [phi:utoa::@4->utoa::@1#0] -- register_copy // [79] phi utoa::started#2 = utoa::started#4 [phi:utoa::@4->utoa::@1#1] -- register_copy // [79] phi utoa::value#2 = utoa::value#6 [phi:utoa::@4->utoa::@1#2] -- register_copy // [79] phi utoa::digit#2 = utoa::digit#1 [phi:utoa::@4->utoa::@1#3] -- register_copy jmp __b1 // utoa::@5 __b5: // utoa_append(buffer++, value, digit_value) // [92] utoa_append::buffer#0 = utoa::buffer#11 // [93] utoa_append::value#0 = utoa::value#2 // [94] utoa_append::sub#0 = utoa::digit_value#0 // [95] call utoa_append // [106] phi from utoa::@5 to utoa_append [phi:utoa::@5->utoa_append] jsr utoa_append // utoa_append(buffer++, value, digit_value) // [96] utoa_append::return#0 = utoa_append::value#2 // utoa::@6 // value = utoa_append(buffer++, value, digit_value) // [97] utoa::value#1 = utoa_append::return#0 // value = utoa_append(buffer++, value, digit_value); // [98] utoa::buffer#5 = ++ utoa::buffer#11 -- pbuz1=_inc_pbuz1 inc.z buffer bne !+ inc.z buffer+1 !: // [90] phi from utoa::@6 to utoa::@4 [phi:utoa::@6->utoa::@4] // [90] phi utoa::buffer#14 = utoa::buffer#5 [phi:utoa::@6->utoa::@4#0] -- register_copy // [90] phi utoa::started#4 = 1 [phi:utoa::@6->utoa::@4#1] -- vbuxx=vbuc1 ldx #1 // [90] phi utoa::value#6 = utoa::value#1 [phi:utoa::@6->utoa::@4#2] -- register_copy jmp __b4 } // print_str // Print a zero-terminated string // void print_str(__zp(9) char *str) print_str: { .label str = 9 // [100] phi from print_str to print_str::@1 [phi:print_str->print_str::@1] // [100] phi print_char_cursor#1 = print_char_cursor#34 [phi:print_str->print_str::@1#0] -- register_copy // [100] phi print_str::str#2 = decimal_digits [phi:print_str->print_str::@1#1] -- pbuz1=pbuc1 lda #decimal_digits sta.z str+1 // print_str::@1 __b1: // while(*str) // [101] if(0!=*print_str::str#2) goto print_str::@2 -- 0_neq__deref_pbuz1_then_la1 ldy #0 lda (str),y cmp #0 bne __b2 // print_str::@return // } // [102] return rts // print_str::@2 __b2: // print_char(*(str++)) // [103] print_char::ch#0 = *print_str::str#2 -- vbuaa=_deref_pbuz1 ldy #0 lda (str),y // [104] call print_char // [57] phi from print_str::@2 to print_char [phi:print_str::@2->print_char] // [57] phi print_char::ch#2 = print_char::ch#0 [phi:print_str::@2->print_char#0] -- register_copy jsr print_char // print_str::@3 // print_char(*(str++)); // [105] print_str::str#0 = ++ print_str::str#2 -- pbuz1=_inc_pbuz1 inc.z str bne !+ inc.z str+1 !: // [100] phi from print_str::@3 to print_str::@1 [phi:print_str::@3->print_str::@1] // [100] phi print_char_cursor#1 = print_char_cursor#17 [phi:print_str::@3->print_str::@1#0] -- register_copy // [100] phi print_str::str#2 = print_str::str#0 [phi:print_str::@3->print_str::@1#1] -- register_copy jmp __b1 } // utoa_append // Used to convert a single digit of an unsigned number value to a string representation // Counts a single digit up from '0' as long as the value is larger than sub. // Each time the digit is increased sub is subtracted from value. // - buffer : pointer to the char that receives the digit // - value : The value where the digit will be derived from // - sub : the value of a '1' in the digit. Subtracted continually while the digit is increased. // (For decimal the subs used are 10000, 1000, 100, 10, 1) // returns : the value reduced by sub * digit so that it is less than sub. // __zp(2) unsigned int utoa_append(__zp(9) char *buffer, __zp(2) unsigned int value, __zp(4) unsigned int sub) utoa_append: { .label buffer = 9 .label value = 2 .label sub = 4 .label return = 2 // [107] phi from utoa_append to utoa_append::@1 [phi:utoa_append->utoa_append::@1] // [107] phi utoa_append::digit#2 = 0 [phi:utoa_append->utoa_append::@1#0] -- vbuxx=vbuc1 ldx #0 // [107] phi utoa_append::value#2 = utoa_append::value#0 [phi:utoa_append->utoa_append::@1#1] -- register_copy // utoa_append::@1 __b1: // while (value >= sub) // [108] if(utoa_append::value#2>=utoa_append::sub#0) goto utoa_append::@2 -- vwuz1_ge_vwuz2_then_la1 lda.z sub+1 cmp.z value+1 bne !+ lda.z sub cmp.z value beq __b2 !: bcc __b2 // utoa_append::@3 // *buffer = DIGITS[digit] // [109] *utoa_append::buffer#0 = DIGITS[utoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbuxx lda DIGITS,x ldy #0 sta (buffer),y // utoa_append::@return // } // [110] return rts // utoa_append::@2 __b2: // digit++; // [111] utoa_append::digit#1 = ++ utoa_append::digit#2 -- vbuxx=_inc_vbuxx inx // value -= sub // [112] utoa_append::value#1 = utoa_append::value#2 - utoa_append::sub#0 -- vwuz1=vwuz1_minus_vwuz2 lda.z value sec sbc.z sub sta.z value lda.z value+1 sbc.z sub+1 sta.z value+1 // [107] phi from utoa_append::@2 to utoa_append::@1 [phi:utoa_append::@2->utoa_append::@1] // [107] phi utoa_append::digit#2 = utoa_append::digit#1 [phi:utoa_append::@2->utoa_append::@1#0] -- register_copy // [107] phi utoa_append::value#2 = utoa_append::value#1 [phi:utoa_append::@2->utoa_append::@1#1] -- register_copy jmp __b1 } // File Data .segment Data // The digits used for numbers DIGITS: .text "0123456789abcdef" // Values of decimal digits RADIX_DECIMAL_VALUES: .word $2710, $3e8, $64, $a // Digits used for storing the decimal unsigned int decimal_digits: .fill 6, 0 // Table that is filled with the primes we are finding PRIMES: .fill 2*$3e8, 0