diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass1PrintfIntrinsicRewrite.java b/src/main/java/dk/camelot64/kickc/passes/Pass1PrintfIntrinsicRewrite.java index f1a255b6e..edd501732 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass1PrintfIntrinsicRewrite.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass1PrintfIntrinsicRewrite.java @@ -8,6 +8,7 @@ import dk.camelot64.kickc.model.statements.Statement; import dk.camelot64.kickc.model.statements.StatementCall; import dk.camelot64.kickc.model.symbols.Procedure; import dk.camelot64.kickc.model.types.SymbolType; +import dk.camelot64.kickc.model.types.SymbolTypeInference; import dk.camelot64.kickc.model.values.*; import java.util.Arrays; @@ -156,10 +157,20 @@ public class Pass1PrintfIntrinsicRewrite extends Pass2SsaOptimization { } if(lengthField == null) { - // Integer (16bit) - printf_number_procedure = signed ? PRINTF_SINT : PRINTF_UINT; + // Check if the parameter type is 8-bit or 32-bit + RValue paramValue = parameters.get(paramIdx); + SymbolType paramType = SymbolTypeInference.inferType(getScope(), paramValue); + if(SymbolType.BYTE.equals(paramType) || SymbolType.SBYTE.equals(paramType)) { + // Integer (8bit) + printf_number_procedure = signed ? PRINTF_SCHAR : PRINTF_UCHAR; + } else if(SymbolType.DWORD.equals(paramType) || SymbolType.SDWORD.equals(paramType)) { + // Integer (32bit) + printf_number_procedure = signed ? PRINTF_SLONG : PRINTF_ULONG; + } else { + // Integer (16bit) + printf_number_procedure = signed ? PRINTF_SINT : PRINTF_UINT; + } } else if(lengthField.equals("hh")) { - // TODO: Handle 8-bits in a better way - since KickC does not do integer promotion! // Integer (8bit) printf_number_procedure = signed ? PRINTF_SCHAR : PRINTF_UCHAR; } else if(lengthField.equals("l")) { diff --git a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java index daca5417b..562933aea 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java @@ -45,6 +45,11 @@ public class TestPrograms { assertError("printf-error-1.c", "Needed printf sub-procedure not found"); } + @Test + public void testPrintf14() throws IOException, URISyntaxException { + compileAndCompare("printf-14.c"); + } + @Test public void testPrintf13() throws IOException, URISyntaxException { compileAndCompare("printf-13.c"); diff --git a/src/test/kc/printf-14.c b/src/test/kc/printf-14.c new file mode 100644 index 000000000..3bee3d266 --- /dev/null +++ b/src/test/kc/printf-14.c @@ -0,0 +1,13 @@ +// Tests printf function call rewriting +// Print a char using %d + +#include + +void main() { + printf_cls(); + + char c = 7; + printf("%hhu", c); + +} + diff --git a/src/test/ref/printf-14.asm b/src/test/ref/printf-14.asm new file mode 100644 index 000000000..5df417c0b --- /dev/null +++ b/src/test/ref/printf-14.asm @@ -0,0 +1,414 @@ +// Tests printf function call rewriting +// Print a char using %d +.pc = $801 "Basic" +:BasicUpstart(__bbegin) +.pc = $80d "Program" + .const OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS = 1 + .label printf_screen = $400 + .const SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER = $c + .label printf_line_cursor = 8 + .label printf_char_cursor = $a +__bbegin: + // printf_line_cursor = PRINTF_SCREEN_ADDRESS + lda #<$400 + sta.z printf_line_cursor + lda #>$400 + sta.z printf_line_cursor+1 + // printf_char_cursor = PRINTF_SCREEN_ADDRESS + lda #<$400 + sta.z printf_char_cursor + lda #>$400 + sta.z printf_char_cursor+1 + jsr main + rts +main: { + .label c = 7 + // printf_cls() + jsr printf_cls + // printf("%hhu", c) + lda #str + sta.z printf_str.str+1 + jsr printf_str + // printf("%hhu", c) + jsr printf_uchar + // printf("%hhu", c) + lda #str + sta.z printf_str.str+1 + jsr printf_str + // } + rts + str: .text "" + .byte 0 +} +// Print a zero-terminated string +// Handles escape codes such as newline +// printf_str(byte* zp(6) str) +printf_str: { + .label str = 6 + __b2: + // ch = *str++ + ldy #0 + lda (str),y + inc.z str + bne !+ + inc.z str+1 + !: + // if(ch==0) + cmp #0 + bne __b3 + // } + rts + __b3: + // if(ch=='\n') + cmp #'\n' + beq __b4 + // printf_char(ch) + jsr printf_char + jmp __b2 + __b4: + // printf_ln() + jsr printf_ln + jmp __b2 +} +// Print a newline +printf_ln: { + __b1: + // printf_line_cursor += PRINTF_SCREEN_WIDTH + lda #$28 + clc + adc.z printf_line_cursor + sta.z printf_line_cursor + bcc !+ + inc.z printf_line_cursor+1 + !: + // while (printf_line_cursor=(printf_screen+PRINTF_SCREEN_BYTES)) + lda.z printf_char_cursor+1 + cmp #>printf_screen+$28*$19 + bcc __breturn + bne !+ + lda.z printf_char_cursor + cmp #printf_screen+$28*$19-$28 + sta.z memset.str+1 + lda #<$28 + sta.z memset.num + lda #>$28 + sta.z memset.num+1 + jsr memset + // printf_char_cursor-PRINTF_SCREEN_WIDTH + lda.z __8 + sec + sbc #<$28 + sta.z __8 + lda.z __8+1 + sbc #>$28 + sta.z __8+1 + // printf_char_cursor = printf_char_cursor-PRINTF_SCREEN_WIDTH + // printf_line_cursor = printf_char_cursor + lda.z printf_char_cursor + sta.z printf_line_cursor + lda.z printf_char_cursor+1 + sta.z printf_line_cursor+1 + __breturn: + // } + rts +} +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +// memset(void* zp(2) str, byte register(X) c, word zp(8) num) +memset: { + .label end = 8 + .label dst = 2 + .label num = 8 + .label str = 2 + // if(num>0) + lda.z num + bne !+ + lda.z num+1 + beq __breturn + !: + // end = (char*)str + num + lda.z end + clc + adc.z str + sta.z end + lda.z end+1 + adc.z str+1 + sta.z end+1 + __b2: + // for(char* dst = str; dst!=end; dst++) + lda.z dst+1 + cmp.z end+1 + bne __b3 + lda.z dst + cmp.z end + bne __b3 + __breturn: + // } + rts + __b3: + // *dst = c + txa + ldy #0 + sta (dst),y + // for(char* dst = str; dst!=end; dst++) + inc.z dst + bne !+ + inc.z dst+1 + !: + jmp __b2 +} +// Copy block of memory (forwards) +// Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination. +memcpy: { + .label destination = printf_screen + .const num = $28*$19-$28 + .label source = printf_screen+$28 + .label src_end = source+num + .label dst = 2 + .label src = 8 + lda #destination + sta.z dst+1 + lda #source + sta.z src+1 + __b1: + // while(src!=src_end) + lda.z src+1 + cmp #>src_end + bne __b2 + lda.z src + cmp #buffer_digits + sta.z printf_str.str+1 + jsr printf_str + // } + rts +} +// 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) +// uctoa(byte register(X) value, byte* zp(6) buffer) +uctoa: { + .const max_digits = 3 + .label digit_value = $c + .label buffer = 6 + .label digit = 4 + .label started = 5 + lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + sta.z buffer+1 + lda #0 + sta.z started + ldx #main.c + sta.z digit + __b1: + // for( char digit=0; digit= digit_value) + lda #0 + cmp.z started + bne __b5 + cpx.z digit_value + bcs __b5 + __b4: + // for( char digit=0; digit= sub) + cpx.z sub + bcs __b2 + // *buffer = DIGITS[digit] + lda DIGITS,y + ldy #0 + sta (buffer),y + // } + rts + __b2: + // digit++; + iny + // value -= sub + txa + sec + sbc.z sub + tax + jmp __b1 +} +// Clear the screen. Also resets current line/char cursor. +printf_cls: { + // memset(printf_screen, ' ', PRINTF_SCREEN_BYTES) + ldx #' ' + lda #printf_screen + sta.z memset.str+1 + lda #<$28*$19 + sta.z memset.num + lda #>$28*$19 + sta.z memset.num+1 + jsr memset + // printf_line_cursor = printf_screen + lda #printf_screen + sta.z printf_line_cursor+1 + // printf_char_cursor = printf_line_cursor + lda.z printf_line_cursor + sta.z printf_char_cursor + lda.z printf_line_cursor+1 + sta.z printf_char_cursor+1 + // } + rts +} + // The digits used for numbers + DIGITS: .text "0123456789abcdef" + // Values of decimal digits + RADIX_DECIMAL_VALUES_CHAR: .byte $64, $a + // Buffer used for stringified number being printed + printf_buffer: .fill SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER, 0 diff --git a/src/test/ref/printf-14.cfg b/src/test/ref/printf-14.cfg new file mode 100644 index 000000000..65ecd7d1e --- /dev/null +++ b/src/test/ref/printf-14.cfg @@ -0,0 +1,254 @@ +@begin: scope:[] from + [0] phi() + to:@1 +@1: scope:[] from @begin + [1] (byte*) printf_line_cursor ← (byte*) 1024 + [2] (byte*) printf_char_cursor ← (byte*) 1024 + to:@2 +@2: scope:[] from @1 + [3] phi() + [4] call main + to:@end +@end: scope:[] from @2 + [5] phi() + +(void()) main() +main: scope:[main] from @2 + [6] phi() + [7] call printf_cls + to:main::@1 +main::@1: scope:[main] from main + [8] phi() + [9] call printf_str + to:main::@2 +main::@2: scope:[main] from main::@1 + [10] phi() + [11] call printf_uchar + to:main::@3 +main::@3: scope:[main] from main::@2 + [12] phi() + [13] call printf_str + to:main::@return +main::@return: scope:[main] from main::@3 + [14] return + to:@return + +(void()) printf_str((byte*) printf_str::str) +printf_str: scope:[printf_str] from main::@1 main::@3 printf_number_buffer::@2 + [15] (byte*) printf_str::str#6 ← phi( main::@1/(const byte*) main::str main::@3/(const byte*) main::str printf_number_buffer::@2/(const byte*) printf_number_buffer::buffer_digits#0 ) + to:printf_str::@1 +printf_str::@1: scope:[printf_str] from printf_str printf_str::@4 printf_str::@5 + [16] (byte*) printf_str::str#4 ← phi( printf_str/(byte*) printf_str::str#6 printf_str::@4/(byte*) printf_str::str#0 printf_str::@5/(byte*) printf_str::str#0 ) + to:printf_str::@2 +printf_str::@2: scope:[printf_str] from printf_str::@1 + [17] (byte) printf_str::ch#0 ← *((byte*) printf_str::str#4) + [18] (byte*) printf_str::str#0 ← ++ (byte*) printf_str::str#4 + [19] if((byte) printf_str::ch#0!=(byte) 0) goto printf_str::@3 + to:printf_str::@return +printf_str::@return: scope:[printf_str] from printf_str::@2 + [20] return + to:@return +printf_str::@3: scope:[printf_str] from printf_str::@2 + [21] if((byte) printf_str::ch#0==(byte) ' +') goto printf_str::@4 + to:printf_str::@5 +printf_str::@5: scope:[printf_str] from printf_str::@3 + [22] (byte) printf_char::ch#1 ← (byte) printf_str::ch#0 + [23] call printf_char + to:printf_str::@1 +printf_str::@4: scope:[printf_str] from printf_str::@3 + [24] phi() + [25] call printf_ln + to:printf_str::@1 + +(void()) printf_ln() +printf_ln: scope:[printf_ln] from printf_str::@4 + [26] phi() + to:printf_ln::@1 +printf_ln::@1: scope:[printf_ln] from printf_ln printf_ln::@1 + [27] (byte*) printf_line_cursor ← (byte*) printf_line_cursor + (byte) $28 + [28] if((byte*) printf_line_cursor<(byte*) printf_char_cursor) goto printf_ln::@1 + to:printf_ln::@2 +printf_ln::@2: scope:[printf_ln] from printf_ln::@1 + [29] (byte*) printf_char_cursor ← (byte*) printf_line_cursor + to:printf_ln::@return +printf_ln::@return: scope:[printf_ln] from printf_ln::@2 + [30] return + to:@return + +(void()) printf_char((byte) printf_char::ch) +printf_char: scope:[printf_char] from printf_number_buffer::@3 printf_str::@5 + [31] (byte) printf_char::ch#3 ← phi( printf_number_buffer::@3/(byte) printf_char::ch#2 printf_str::@5/(byte) printf_char::ch#1 ) + [32] *((byte*) printf_char_cursor) ← (byte) printf_char::ch#3 + [33] (byte*) printf_char_cursor ← ++ (byte*) printf_char_cursor + [34] if((byte*) printf_char_cursor<(const byte*) printf_screen+(word)(number) $28*(number) $19) goto printf_char::@return + to:printf_char::@1 +printf_char::@1: scope:[printf_char] from printf_char + [35] phi() + [36] call memcpy + to:printf_char::@2 +printf_char::@2: scope:[printf_char] from printf_char::@1 + [37] phi() + [38] call memset + to:printf_char::@3 +printf_char::@3: scope:[printf_char] from printf_char::@2 + [39] (byte*~) printf_char::$8 ← (byte*) printf_char_cursor - (byte) $28 + [40] (byte*) printf_char_cursor ← (byte*~) printf_char::$8 + [41] (byte*) printf_line_cursor ← (byte*) printf_char_cursor + to:printf_char::@return +printf_char::@return: scope:[printf_char] from printf_char printf_char::@3 + [42] return + to:@return + +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +memset: scope:[memset] from printf_char::@2 printf_cls + [43] (byte) memset::c#4 ← phi( printf_char::@2/(byte) ' ' printf_cls/(byte) ' ' ) + [43] (void*) memset::str#3 ← phi( printf_char::@2/(void*)(const byte*) printf_screen+(word)(number) $28*(number) $19-(byte) $28 printf_cls/(void*)(const byte*) printf_screen ) + [43] (word) memset::num#2 ← phi( printf_char::@2/(byte) $28 printf_cls/(word)(number) $28*(number) $19 ) + [44] if((word) memset::num#2<=(byte) 0) goto memset::@return + to:memset::@1 +memset::@1: scope:[memset] from memset + [45] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 + [46] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3 + to:memset::@2 +memset::@2: scope:[memset] from memset::@1 memset::@3 + [47] (byte*) memset::dst#2 ← phi( memset::@1/(byte*) memset::dst#4 memset::@3/(byte*) memset::dst#1 ) + [48] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 + to:memset::@return +memset::@return: scope:[memset] from memset memset::@2 + [49] return + to:@return +memset::@3: scope:[memset] from memset::@2 + [50] *((byte*) memset::dst#2) ← (byte) memset::c#4 + [51] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 + to:memset::@2 + +(void*()) memcpy((void*) memcpy::destination , (void*) memcpy::source , (word) memcpy::num) +memcpy: scope:[memcpy] from printf_char::@1 + [52] phi() + to:memcpy::@1 +memcpy::@1: scope:[memcpy] from memcpy memcpy::@2 + [53] (byte*) memcpy::dst#2 ← phi( memcpy/(byte*)(const void*) memcpy::destination#0 memcpy::@2/(byte*) memcpy::dst#1 ) + [53] (byte*) memcpy::src#2 ← phi( memcpy/(byte*)(const void*) memcpy::source#0 memcpy::@2/(byte*) memcpy::src#1 ) + [54] if((byte*) memcpy::src#2!=(const byte*) memcpy::src_end#0) goto memcpy::@2 + to:memcpy::@return +memcpy::@return: scope:[memcpy] from memcpy::@1 + [55] return + to:@return +memcpy::@2: scope:[memcpy] from memcpy::@1 + [56] *((byte*) memcpy::dst#2) ← *((byte*) memcpy::src#2) + [57] (byte*) memcpy::dst#1 ← ++ (byte*) memcpy::dst#2 + [58] (byte*) memcpy::src#1 ← ++ (byte*) memcpy::src#2 + to:memcpy::@1 + +(void()) printf_uchar((byte) printf_uchar::uvalue , (byte) printf_uchar::format_min_length , (byte) printf_uchar::format_justify_left , (byte) printf_uchar::format_sign_always , (byte) printf_uchar::format_zero_padding , (byte) printf_uchar::format_radix) +printf_uchar: scope:[printf_uchar] from main::@2 + [59] phi() + to:printf_uchar::@1 +printf_uchar::@1: scope:[printf_uchar] from printf_uchar + [60] *((byte*)&(struct printf_buffer_number) printf_buffer) ← (byte) 0 + [61] call uctoa + to:printf_uchar::@2 +printf_uchar::@2: scope:[printf_uchar] from printf_uchar::@1 + [62] (byte) printf_number_buffer::buffer_sign#0 ← *((byte*)&(struct printf_buffer_number) printf_buffer) + [63] call printf_number_buffer + to:printf_uchar::@return +printf_uchar::@return: scope:[printf_uchar] from printf_uchar::@2 + [64] return + to:@return + +(void()) printf_number_buffer((byte) printf_number_buffer::buffer_sign , (byte*) printf_number_buffer::buffer_digits , (byte) printf_number_buffer::format_min_length , (byte) printf_number_buffer::format_justify_left , (byte) printf_number_buffer::format_sign_always , (byte) printf_number_buffer::format_zero_padding , (byte) printf_number_buffer::format_radix) +printf_number_buffer: scope:[printf_number_buffer] from printf_uchar::@2 + [65] phi() + to:printf_number_buffer::@1 +printf_number_buffer::@1: scope:[printf_number_buffer] from printf_number_buffer + [66] if((byte) 0==(byte) printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 + to:printf_number_buffer::@3 +printf_number_buffer::@3: scope:[printf_number_buffer] from printf_number_buffer::@1 + [67] (byte) printf_char::ch#2 ← (byte) printf_number_buffer::buffer_sign#0 + [68] call printf_char + to:printf_number_buffer::@2 +printf_number_buffer::@2: scope:[printf_number_buffer] from printf_number_buffer::@1 printf_number_buffer::@3 + [69] phi() + [70] call printf_str + to:printf_number_buffer::@return +printf_number_buffer::@return: scope:[printf_number_buffer] from printf_number_buffer::@2 + [71] return + to:@return + +(void()) uctoa((byte) uctoa::value , (byte*) uctoa::buffer , (byte) uctoa::radix) +uctoa: scope:[uctoa] from printf_uchar::@1 + [72] phi() + to:uctoa::@1 +uctoa::@1: scope:[uctoa] from uctoa uctoa::@4 + [73] (byte*) uctoa::buffer#11 ← phi( uctoa::@4/(byte*) uctoa::buffer#14 uctoa/(byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS ) + [73] (byte) uctoa::started#2 ← phi( uctoa::@4/(byte) uctoa::started#4 uctoa/(byte) 0 ) + [73] (byte) uctoa::value#2 ← phi( uctoa::@4/(byte) uctoa::value#6 uctoa/(const byte) main::c ) + [73] (byte) uctoa::digit#2 ← phi( uctoa::@4/(byte) uctoa::digit#1 uctoa/(byte) 0 ) + [74] if((byte) uctoa::digit#2<(const byte) uctoa::max_digits#1-(byte) 1) goto uctoa::@2 + to:uctoa::@3 +uctoa::@3: scope:[uctoa] from uctoa::@1 + [75] *((byte*) uctoa::buffer#11) ← *((const byte*) DIGITS + (byte) uctoa::value#2) + [76] (byte*) uctoa::buffer#3 ← ++ (byte*) uctoa::buffer#11 + [77] *((byte*) uctoa::buffer#3) ← (byte) 0 + to:uctoa::@return +uctoa::@return: scope:[uctoa] from uctoa::@3 + [78] return + to:@return +uctoa::@2: scope:[uctoa] from uctoa::@1 + [79] (byte) uctoa::digit_value#0 ← *((const byte*) RADIX_DECIMAL_VALUES_CHAR + (byte) uctoa::digit#2) + [80] if((byte) 0!=(byte) uctoa::started#2) goto uctoa::@5 + to:uctoa::@7 +uctoa::@7: scope:[uctoa] from uctoa::@2 + [81] if((byte) uctoa::value#2>=(byte) uctoa::digit_value#0) goto uctoa::@5 + to:uctoa::@4 +uctoa::@4: scope:[uctoa] from uctoa::@6 uctoa::@7 + [82] (byte*) uctoa::buffer#14 ← phi( uctoa::@7/(byte*) uctoa::buffer#11 uctoa::@6/(byte*) uctoa::buffer#4 ) + [82] (byte) uctoa::started#4 ← phi( uctoa::@7/(byte) uctoa::started#2 uctoa::@6/(byte) 1 ) + [82] (byte) uctoa::value#6 ← phi( uctoa::@7/(byte) uctoa::value#2 uctoa::@6/(byte) uctoa::value#0 ) + [83] (byte) uctoa::digit#1 ← ++ (byte) uctoa::digit#2 + to:uctoa::@1 +uctoa::@5: scope:[uctoa] from uctoa::@2 uctoa::@7 + [84] (byte*) uctoa_append::buffer#0 ← (byte*) uctoa::buffer#11 + [85] (byte) uctoa_append::value#0 ← (byte) uctoa::value#2 + [86] (byte) uctoa_append::sub#0 ← (byte) uctoa::digit_value#0 + [87] call uctoa_append + [88] (byte) uctoa_append::return#0 ← (byte) uctoa_append::value#2 + to:uctoa::@6 +uctoa::@6: scope:[uctoa] from uctoa::@5 + [89] (byte) uctoa::value#0 ← (byte) uctoa_append::return#0 + [90] (byte*) uctoa::buffer#4 ← ++ (byte*) uctoa::buffer#11 + to:uctoa::@4 + +(byte()) uctoa_append((byte*) uctoa_append::buffer , (byte) uctoa_append::value , (byte) uctoa_append::sub) +uctoa_append: scope:[uctoa_append] from uctoa::@5 + [91] phi() + to:uctoa_append::@1 +uctoa_append::@1: scope:[uctoa_append] from uctoa_append uctoa_append::@2 + [92] (byte) uctoa_append::digit#2 ← phi( uctoa_append/(byte) 0 uctoa_append::@2/(byte) uctoa_append::digit#1 ) + [92] (byte) uctoa_append::value#2 ← phi( uctoa_append/(byte) uctoa_append::value#0 uctoa_append::@2/(byte) uctoa_append::value#1 ) + [93] if((byte) uctoa_append::value#2>=(byte) uctoa_append::sub#0) goto uctoa_append::@2 + to:uctoa_append::@3 +uctoa_append::@3: scope:[uctoa_append] from uctoa_append::@1 + [94] *((byte*) uctoa_append::buffer#0) ← *((const byte*) DIGITS + (byte) uctoa_append::digit#2) + to:uctoa_append::@return +uctoa_append::@return: scope:[uctoa_append] from uctoa_append::@3 + [95] return + to:@return +uctoa_append::@2: scope:[uctoa_append] from uctoa_append::@1 + [96] (byte) uctoa_append::digit#1 ← ++ (byte) uctoa_append::digit#2 + [97] (byte) uctoa_append::value#1 ← (byte) uctoa_append::value#2 - (byte) uctoa_append::sub#0 + to:uctoa_append::@1 + +(void()) printf_cls() +printf_cls: scope:[printf_cls] from main + [98] phi() + [99] call memset + to:printf_cls::@1 +printf_cls::@1: scope:[printf_cls] from printf_cls + [100] (byte*) printf_line_cursor ← (const byte*) printf_screen + [101] (byte*) printf_char_cursor ← (byte*) printf_line_cursor + to:printf_cls::@return +printf_cls::@return: scope:[printf_cls] from printf_cls::@1 + [102] return + to:@return diff --git a/src/test/ref/printf-14.log b/src/test/ref/printf-14.log new file mode 100644 index 000000000..15b0019e7 --- /dev/null +++ b/src/test/ref/printf-14.log @@ -0,0 +1,5225 @@ +Fixing struct type size struct printf_buffer_number to 12 +Fixing struct type size struct printf_buffer_number to 12 +Fixing struct type SIZE_OF struct printf_buffer_number to 12 +Fixing struct type SIZE_OF struct printf_buffer_number to 12 +Fixing pointer addition (word*~) bsearch16u::$7 ← (word*) bsearch16u::items + (byte~) bsearch16u::$6 +Fixing pointer addition (word*~) bsearch16u::$13 ← (word*) bsearch16u::pivot + (number) 1 +Fixing pointer addition (word*~) bsearch16u::$1 ← (word*) bsearch16u::items - (number) 1 +Fixing pointer array-indexing *((word*) utoa::digit_values + (byte) utoa::digit) +Fixing pointer array-indexing *((dword*) ultoa::digit_values + (byte) ultoa::digit) +Added struct type cast to parameter value list call printf_uchar (byte) main::c (struct printf_format_number){ (byte) 0, (byte) 0, (byte) 0, (byte) 0, (const byte) DECIMAL } +Created struct value member variable (byte) printf_slong::format_min_length +Created struct value member variable (byte) printf_slong::format_justify_left +Created struct value member variable (byte) printf_slong::format_sign_always +Created struct value member variable (byte) printf_slong::format_zero_padding +Created struct value member variable (byte) printf_slong::format_radix +Converted struct value to member variables (struct printf_format_number) printf_slong::format +Created struct value member variable (byte) printf_ulong::format_min_length +Created struct value member variable (byte) printf_ulong::format_justify_left +Created struct value member variable (byte) printf_ulong::format_sign_always +Created struct value member variable (byte) printf_ulong::format_zero_padding +Created struct value member variable (byte) printf_ulong::format_radix +Converted struct value to member variables (struct printf_format_number) printf_ulong::format +Created struct value member variable (byte) printf_sint::format_min_length +Created struct value member variable (byte) printf_sint::format_justify_left +Created struct value member variable (byte) printf_sint::format_sign_always +Created struct value member variable (byte) printf_sint::format_zero_padding +Created struct value member variable (byte) printf_sint::format_radix +Converted struct value to member variables (struct printf_format_number) printf_sint::format +Created struct value member variable (byte) printf_uint::format_min_length +Created struct value member variable (byte) printf_uint::format_justify_left +Created struct value member variable (byte) printf_uint::format_sign_always +Created struct value member variable (byte) printf_uint::format_zero_padding +Created struct value member variable (byte) printf_uint::format_radix +Converted struct value to member variables (struct printf_format_number) printf_uint::format +Created struct value member variable (byte) printf_schar::format_min_length +Created struct value member variable (byte) printf_schar::format_justify_left +Created struct value member variable (byte) printf_schar::format_sign_always +Created struct value member variable (byte) printf_schar::format_zero_padding +Created struct value member variable (byte) printf_schar::format_radix +Converted struct value to member variables (struct printf_format_number) printf_schar::format +Created struct value member variable (byte) printf_uchar::format_min_length +Created struct value member variable (byte) printf_uchar::format_justify_left +Created struct value member variable (byte) printf_uchar::format_sign_always +Created struct value member variable (byte) printf_uchar::format_zero_padding +Created struct value member variable (byte) printf_uchar::format_radix +Converted struct value to member variables (struct printf_format_number) printf_uchar::format +Created struct value member variable (byte) printf_number_buffer::buffer_sign +Created struct value member variable (byte*) printf_number_buffer::buffer_digits +Converted struct value to member variables (struct printf_buffer_number) printf_number_buffer::buffer +Created struct value member variable (byte) printf_number_buffer::format_min_length +Created struct value member variable (byte) printf_number_buffer::format_justify_left +Created struct value member variable (byte) printf_number_buffer::format_sign_always +Created struct value member variable (byte) printf_number_buffer::format_zero_padding +Created struct value member variable (byte) printf_number_buffer::format_radix +Converted struct value to member variables (struct printf_format_number) printf_number_buffer::format +Created struct value member variable (byte) printf_string::format_min_length +Created struct value member variable (byte) printf_string::format_justify_left +Converted struct value to member variables (struct printf_format_string) printf_string::format +Converted procedure struct value parameter to member unwinding (void()) printf_slong((signed dword) printf_slong::value , (byte) printf_slong::format_min_length , (byte) printf_slong::format_justify_left , (byte) printf_slong::format_sign_always , (byte) printf_slong::format_zero_padding , (byte) printf_slong::format_radix) +Converted procedure struct value parameter to member unwinding (void()) printf_ulong((dword) printf_ulong::uvalue , (byte) printf_ulong::format_min_length , (byte) printf_ulong::format_justify_left , (byte) printf_ulong::format_sign_always , (byte) printf_ulong::format_zero_padding , (byte) printf_ulong::format_radix) +Converted procedure struct value parameter to member unwinding (void()) printf_sint((signed word) printf_sint::value , (byte) printf_sint::format_min_length , (byte) printf_sint::format_justify_left , (byte) printf_sint::format_sign_always , (byte) printf_sint::format_zero_padding , (byte) printf_sint::format_radix) +Converted procedure struct value parameter to member unwinding (void()) printf_uint((word) printf_uint::uvalue , (byte) printf_uint::format_min_length , (byte) printf_uint::format_justify_left , (byte) printf_uint::format_sign_always , (byte) printf_uint::format_zero_padding , (byte) printf_uint::format_radix) +Converted procedure struct value parameter to member unwinding (void()) printf_schar((signed byte) printf_schar::value , (byte) printf_schar::format_min_length , (byte) printf_schar::format_justify_left , (byte) printf_schar::format_sign_always , (byte) printf_schar::format_zero_padding , (byte) printf_schar::format_radix) +Converted procedure struct value parameter to member unwinding (void()) printf_uchar((byte) printf_uchar::uvalue , (byte) printf_uchar::format_min_length , (byte) printf_uchar::format_justify_left , (byte) printf_uchar::format_sign_always , (byte) printf_uchar::format_zero_padding , (byte) printf_uchar::format_radix) +Converted procedure struct value parameter to member unwinding (void()) printf_number_buffer((byte) printf_number_buffer::buffer_sign , (byte*) printf_number_buffer::buffer_digits , (byte) printf_number_buffer::format_min_length , (byte) printf_number_buffer::format_justify_left , (byte) printf_number_buffer::format_sign_always , (byte) printf_number_buffer::format_zero_padding , (byte) printf_number_buffer::format_radix) +Converted procedure struct value parameter to member unwinding (void()) printf_string((byte*) printf_string::str , (byte) printf_string::format_min_length , (byte) printf_string::format_justify_left) +Converted call struct value parameter to member unwinding (void~) printf_slong::$2 ← call printf_number_buffer *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS (byte) printf_slong::format_min_length (byte) printf_slong::format_justify_left (byte) printf_slong::format_sign_always (byte) printf_slong::format_zero_padding (byte) printf_slong::format_radix +Converted call struct value parameter to member unwinding (void~) printf_ulong::$4 ← call printf_number_buffer *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS (byte) printf_ulong::format_min_length (byte) printf_ulong::format_justify_left (byte) printf_ulong::format_sign_always (byte) printf_ulong::format_zero_padding (byte) printf_ulong::format_radix +Converted call struct value parameter to member unwinding (void~) printf_sint::$2 ← call printf_number_buffer *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS (byte) printf_sint::format_min_length (byte) printf_sint::format_justify_left (byte) printf_sint::format_sign_always (byte) printf_sint::format_zero_padding (byte) printf_sint::format_radix +Converted call struct value parameter to member unwinding (void~) printf_uint::$4 ← call printf_number_buffer *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS (byte) printf_uint::format_min_length (byte) printf_uint::format_justify_left (byte) printf_uint::format_sign_always (byte) printf_uint::format_zero_padding (byte) printf_uint::format_radix +Converted call struct value parameter to member unwinding (void~) printf_schar::$2 ← call printf_number_buffer *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS (byte) printf_schar::format_min_length (byte) printf_schar::format_justify_left (byte) printf_schar::format_sign_always (byte) printf_schar::format_zero_padding (byte) printf_schar::format_radix +Converted call struct value parameter to member unwinding (void~) printf_uchar::$4 ← call printf_number_buffer *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS (byte) printf_uchar::format_min_length (byte) printf_uchar::format_justify_left (byte) printf_uchar::format_sign_always (byte) printf_uchar::format_zero_padding (byte) printf_uchar::format_radix +Converted call struct value parameter to member unwinding call printf_uchar (byte) main::c (byte) 0 (byte) 0 (byte) 0 (byte) 0 (const byte) DECIMAL +Replacing struct member reference (struct printf_buffer_number) printf_buffer.sign with member unwinding reference *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) +Replacing struct member reference (struct printf_buffer_number) printf_buffer.sign with member unwinding reference *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) +Replacing struct member reference (struct printf_format_number) printf_slong::format.sign_always with member unwinding reference (byte) printf_slong::format_sign_always +Replacing struct member reference (struct printf_buffer_number) printf_buffer.sign with member unwinding reference *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) +Replacing struct member reference (struct printf_buffer_number) printf_buffer.digits with member unwinding reference (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS +Replacing struct member reference (struct printf_format_number) printf_slong::format.radix with member unwinding reference (byte) printf_slong::format_radix +Replacing struct member reference (struct printf_format_number) printf_ulong::format.sign_always with member unwinding reference (byte) printf_ulong::format_sign_always +Replacing struct member reference (struct printf_buffer_number) printf_buffer.sign with member unwinding reference *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) +Replacing struct member reference (struct printf_buffer_number) printf_buffer.digits with member unwinding reference (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS +Replacing struct member reference (struct printf_format_number) printf_ulong::format.radix with member unwinding reference (byte) printf_ulong::format_radix +Replacing struct member reference (struct printf_buffer_number) printf_buffer.sign with member unwinding reference *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) +Replacing struct member reference (struct printf_buffer_number) printf_buffer.sign with member unwinding reference *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) +Replacing struct member reference (struct printf_format_number) printf_sint::format.sign_always with member unwinding reference (byte) printf_sint::format_sign_always +Replacing struct member reference (struct printf_buffer_number) printf_buffer.sign with member unwinding reference *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) +Replacing struct member reference (struct printf_buffer_number) printf_buffer.digits with member unwinding reference (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS +Replacing struct member reference (struct printf_format_number) printf_sint::format.radix with member unwinding reference (byte) printf_sint::format_radix +Replacing struct member reference (struct printf_format_number) printf_uint::format.sign_always with member unwinding reference (byte) printf_uint::format_sign_always +Replacing struct member reference (struct printf_buffer_number) printf_buffer.sign with member unwinding reference *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) +Replacing struct member reference (struct printf_buffer_number) printf_buffer.digits with member unwinding reference (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS +Replacing struct member reference (struct printf_format_number) printf_uint::format.radix with member unwinding reference (byte) printf_uint::format_radix +Replacing struct member reference (struct printf_buffer_number) printf_buffer.sign with member unwinding reference *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) +Replacing struct member reference (struct printf_buffer_number) printf_buffer.sign with member unwinding reference *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) +Replacing struct member reference (struct printf_format_number) printf_schar::format.sign_always with member unwinding reference (byte) printf_schar::format_sign_always +Replacing struct member reference (struct printf_buffer_number) printf_buffer.sign with member unwinding reference *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) +Replacing struct member reference (struct printf_buffer_number) printf_buffer.digits with member unwinding reference (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS +Replacing struct member reference (struct printf_format_number) printf_schar::format.radix with member unwinding reference (byte) printf_schar::format_radix +Replacing struct member reference (struct printf_format_number) printf_uchar::format.sign_always with member unwinding reference (byte) printf_uchar::format_sign_always +Replacing struct member reference (struct printf_buffer_number) printf_buffer.sign with member unwinding reference *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) +Replacing struct member reference (struct printf_buffer_number) printf_buffer.digits with member unwinding reference (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS +Replacing struct member reference (struct printf_format_number) printf_uchar::format.radix with member unwinding reference (byte) printf_uchar::format_radix +Replacing struct member reference (struct printf_format_number) printf_number_buffer::format.min_length with member unwinding reference (byte) printf_number_buffer::format_min_length +Replacing struct member reference (struct printf_format_number) printf_number_buffer::format.justify_left with member unwinding reference (byte) printf_number_buffer::format_justify_left +Replacing struct member reference (struct printf_format_number) printf_number_buffer::format.zero_padding with member unwinding reference (byte) printf_number_buffer::format_zero_padding +Replacing struct member reference (struct printf_buffer_number) printf_number_buffer::buffer.digits with member unwinding reference (byte*) printf_number_buffer::buffer_digits +Replacing struct member reference (struct printf_buffer_number) printf_number_buffer::buffer.sign with member unwinding reference (byte) printf_number_buffer::buffer_sign +Replacing struct member reference (struct printf_format_number) printf_number_buffer::format.min_length with member unwinding reference (byte) printf_number_buffer::format_min_length +Replacing struct member reference (struct printf_buffer_number) printf_number_buffer::buffer.sign with member unwinding reference (byte) printf_number_buffer::buffer_sign +Replacing struct member reference (struct printf_format_number) printf_number_buffer::format.zero_padding with member unwinding reference (byte) printf_number_buffer::format_zero_padding +Replacing struct member reference (struct printf_buffer_number) printf_number_buffer::buffer.sign with member unwinding reference (byte) printf_number_buffer::buffer_sign +Replacing struct member reference (struct printf_buffer_number) printf_number_buffer::buffer.digits with member unwinding reference (byte*) printf_number_buffer::buffer_digits +Replacing struct member reference (struct printf_format_number) printf_number_buffer::format.zero_padding with member unwinding reference (byte) printf_number_buffer::format_zero_padding +Replacing struct member reference (struct printf_format_number) printf_number_buffer::format.justify_left with member unwinding reference (byte) printf_number_buffer::format_justify_left +Replacing struct member reference (struct printf_format_string) printf_string::format.min_length with member unwinding reference (byte) printf_string::format_min_length +Replacing struct member reference (struct printf_format_string) printf_string::format.justify_left with member unwinding reference (byte) printf_string::format_justify_left +Replacing struct member reference (struct printf_format_string) printf_string::format.min_length with member unwinding reference (byte) printf_string::format_min_length +Replacing struct member reference (struct printf_format_string) printf_string::format.justify_left with member unwinding reference (byte) printf_string::format_justify_left +De-inlining cast (byte*)memcpy::source +De-inlining cast (word)memmove::destination +De-inlining cast (word)memmove::source +De-inlining cast (byte*)memmove::source +De-inlining cast (byte*)memmove::destination +De-inlining cast (byte*)memset::str +De-inlining cast (signed word)bsearch16u::key +De-inlining cast (signed word)*(bsearch16u::pivot) +De-inlining cast (byte)uctoa::value +De-inlining cast (byte)utoa::value +De-inlining cast (byte)ultoa::value +De-inlining cast (signed byte)printf_number_buffer::format_min_length +De-inlining cast (signed byte)printf_string::format_min_length +Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src) +Warning! Adding boolean cast to non-boolean condition *((byte*) strlen::str) +Warning! Adding boolean cast to non-boolean condition (byte) printf_ulong::format_sign_always +Warning! Adding boolean cast to non-boolean condition (byte) printf_uint::format_sign_always +Warning! Adding boolean cast to non-boolean condition (byte) printf_uchar::format_sign_always +Warning! Adding boolean cast to non-boolean sub-expression (byte) printf_slong::format_sign_always +Warning! Adding boolean cast to non-boolean sub-expression (byte) printf_sint::format_sign_always +Warning! Adding boolean cast to non-boolean sub-expression (byte) printf_schar::format_sign_always +Warning! Adding boolean cast to non-boolean sub-expression (byte) printf_number_buffer::format_min_length +Warning! Adding boolean cast to non-boolean sub-expression (byte) printf_number_buffer::format_justify_left +Warning! Adding boolean cast to non-boolean sub-expression (byte) printf_number_buffer::format_zero_padding +Warning! Adding boolean cast to non-boolean sub-expression (byte) printf_number_buffer::buffer_sign +Warning! Adding boolean cast to non-boolean sub-expression (byte) printf_number_buffer::buffer_sign +Warning! Adding boolean cast to non-boolean sub-expression (byte) printf_number_buffer::format_zero_padding +Warning! Adding boolean cast to non-boolean sub-expression (byte) printf_string::format_min_length +Warning! Adding boolean cast to non-boolean sub-expression (byte) printf_string::format_justify_left +Identified constant variable (byte*) HEAP_TOP +Identified constant variable (byte*) printf_screen +Identified constant variable (byte) main::c +Eliminating unused variable with no statement (void~) main::$1 +Culled Empty Block (label) memcpy::@4 +Culled Empty Block (label) memcpy::@5 +Culled Empty Block (label) memcpy::@6 +Culled Empty Block (label) memcpy::@7 +Culled Empty Block (label) @1 +Culled Empty Block (label) @2 +Culled Empty Block (label) memset::@7 +Culled Empty Block (label) memset::@6 +Culled Empty Block (label) memset::@8 +Culled Empty Block (label) memset::@9 +Culled Empty Block (label) memset::@3 +Culled Empty Block (label) @3 +Culled Empty Block (label) @4 +Culled Empty Block (label) strlen::@4 +Culled Empty Block (label) strlen::@5 +Culled Empty Block (label) strlen::@6 +Culled Empty Block (label) strlen::@7 +Culled Empty Block (label) @5 +Culled Empty Block (label) @6 +Culled Empty Block (label) @7 +Culled Empty Block (label) @8 +Culled Empty Block (label) @9 +Culled Empty Block (label) uctoa::@13 +Culled Empty Block (label) uctoa::@5 +Culled Empty Block (label) uctoa::@14 +Culled Empty Block (label) uctoa::@6 +Culled Empty Block (label) uctoa::@15 +Culled Empty Block (label) uctoa::@7 +Culled Empty Block (label) uctoa::@16 +Culled Empty Block (label) uctoa::@17 +Culled Empty Block (label) uctoa::@22 +Culled Empty Block (label) uctoa::@23 +Culled Empty Block (label) uctoa::@25 +Culled Empty Block (label) @10 +Culled Empty Block (label) uctoa_append::@4 +Culled Empty Block (label) uctoa_append::@5 +Culled Empty Block (label) uctoa_append::@6 +Culled Empty Block (label) uctoa_append::@7 +Culled Empty Block (label) @11 +Culled Empty Block (label) @12 +Culled Empty Block (label) @13 +Culled Empty Block (label) @14 +Culled Empty Block (label) @16 +Culled Empty Block (label) printf_char::@1 +Culled Empty Block (label) @17 +Culled Empty Block (label) @18 +Culled Empty Block (label) printf_padding::@4 +Culled Empty Block (label) printf_padding::@3 +Culled Empty Block (label) printf_padding::@5 +Culled Empty Block (label) printf_padding::@6 +Culled Empty Block (label) @19 +Culled Empty Block (label) printf_str::@8 +Culled Empty Block (label) printf_str::@3 +Culled Empty Block (label) printf_str::@9 +Culled Empty Block (label) printf_str::@10 +Culled Empty Block (label) printf_str::@5 +Culled Empty Block (label) printf_str::@11 +Culled Empty Block (label) printf_str::@7 +Culled Empty Block (label) printf_str::@13 +Culled Empty Block (label) printf_str::@14 +Culled Empty Block (label) @20 +Culled Empty Block (label) @21 +Culled Empty Block (label) @22 +Culled Empty Block (label) @23 +Culled Empty Block (label) @24 +Culled Empty Block (label) @25 +Culled Empty Block (label) printf_uchar::@4 +Culled Empty Block (label) printf_uchar::@5 +Culled Empty Block (label) @26 +Culled Empty Block (label) printf_number_buffer::@13 +Culled Empty Block (label) printf_number_buffer::@5 +Culled Empty Block (label) @27 +Culled Empty Block (label) @28 + +CONTROL FLOW GRAPH SSA +@begin: scope:[] from + to:@15 + +(void*()) memcpy((void*) memcpy::destination , (void*) memcpy::source , (word) memcpy::num) +memcpy: scope:[memcpy] from printf_char::@2 + (word) memcpy::num#1 ← phi( printf_char::@2/(word) memcpy::num#0 ) + (void*) memcpy::destination#1 ← phi( printf_char::@2/(void*) memcpy::destination#0 ) + (void*) memcpy::source#1 ← phi( printf_char::@2/(void*) memcpy::source#0 ) + (byte*) memcpy::src#0 ← ((byte*)) (void*) memcpy::source#1 + (byte*) memcpy::dst#0 ← ((byte*)) (void*) memcpy::destination#1 + (byte*~) memcpy::$2 ← (byte*)(void*) memcpy::source#1 + (byte*~) memcpy::$0 ← (byte*~) memcpy::$2 + (word) memcpy::num#1 + (byte*) memcpy::src_end#0 ← (byte*~) memcpy::$0 + to:memcpy::@1 +memcpy::@1: scope:[memcpy] from memcpy memcpy::@2 + (void*) memcpy::destination#3 ← phi( memcpy/(void*) memcpy::destination#1 memcpy::@2/(void*) memcpy::destination#4 ) + (byte*) memcpy::dst#3 ← phi( memcpy/(byte*) memcpy::dst#0 memcpy::@2/(byte*) memcpy::dst#1 ) + (byte*) memcpy::src_end#1 ← phi( memcpy/(byte*) memcpy::src_end#0 memcpy::@2/(byte*) memcpy::src_end#2 ) + (byte*) memcpy::src#2 ← phi( memcpy/(byte*) memcpy::src#0 memcpy::@2/(byte*) memcpy::src#1 ) + (bool~) memcpy::$1 ← (byte*) memcpy::src#2 != (byte*) memcpy::src_end#1 + if((bool~) memcpy::$1) goto memcpy::@2 + to:memcpy::@3 +memcpy::@2: scope:[memcpy] from memcpy::@1 + (void*) memcpy::destination#4 ← phi( memcpy::@1/(void*) memcpy::destination#3 ) + (byte*) memcpy::src_end#2 ← phi( memcpy::@1/(byte*) memcpy::src_end#1 ) + (byte*) memcpy::dst#2 ← phi( memcpy::@1/(byte*) memcpy::dst#3 ) + (byte*) memcpy::src#3 ← phi( memcpy::@1/(byte*) memcpy::src#2 ) + *((byte*) memcpy::dst#2) ← *((byte*) memcpy::src#3) + (byte*) memcpy::dst#1 ← ++ (byte*) memcpy::dst#2 + (byte*) memcpy::src#1 ← ++ (byte*) memcpy::src#3 + to:memcpy::@1 +memcpy::@3: scope:[memcpy] from memcpy::@1 + (void*) memcpy::destination#2 ← phi( memcpy::@1/(void*) memcpy::destination#3 ) + (void*) memcpy::return#0 ← (void*) memcpy::destination#2 + to:memcpy::@return +memcpy::@return: scope:[memcpy] from memcpy::@3 + (void*) memcpy::return#3 ← phi( memcpy::@3/(void*) memcpy::return#0 ) + (void*) memcpy::return#1 ← (void*) memcpy::return#3 + return + to:@return + +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +memset: scope:[memset] from printf_char::@3 printf_cls + (byte) memset::c#5 ← phi( printf_char::@3/(byte) memset::c#1 printf_cls/(byte) memset::c#0 ) + (void*) memset::str#4 ← phi( printf_char::@3/(void*) memset::str#1 printf_cls/(void*) memset::str#0 ) + (word) memset::num#2 ← phi( printf_char::@3/(word) memset::num#1 printf_cls/(word) memset::num#0 ) + (bool~) memset::$0 ← (word) memset::num#2 > (number) 0 + (bool~) memset::$1 ← ! (bool~) memset::$0 + if((bool~) memset::$1) goto memset::@1 + to:memset::@2 +memset::@1: scope:[memset] from memset memset::@4 + (void*) memset::str#2 ← phi( memset/(void*) memset::str#4 memset::@4/(void*) memset::str#5 ) + (void*) memset::return#0 ← (void*) memset::str#2 + to:memset::@return +memset::@2: scope:[memset] from memset + (byte) memset::c#4 ← phi( memset/(byte) memset::c#5 ) + (word) memset::num#3 ← phi( memset/(word) memset::num#2 ) + (void*) memset::str#3 ← phi( memset/(void*) memset::str#4 ) + (byte*~) memset::$4 ← (byte*)(void*) memset::str#3 + (byte*~) memset::$2 ← (byte*~) memset::$4 + (word) memset::num#3 + (byte*) memset::end#0 ← (byte*~) memset::$2 + (byte*) memset::dst#0 ← ((byte*)) (void*) memset::str#3 + to:memset::@4 +memset::@4: scope:[memset] from memset::@2 memset::@5 + (byte) memset::c#3 ← phi( memset::@2/(byte) memset::c#4 memset::@5/(byte) memset::c#2 ) + (void*) memset::str#5 ← phi( memset::@2/(void*) memset::str#3 memset::@5/(void*) memset::str#6 ) + (byte*) memset::end#1 ← phi( memset::@2/(byte*) memset::end#0 memset::@5/(byte*) memset::end#2 ) + (byte*) memset::dst#2 ← phi( memset::@2/(byte*) memset::dst#0 memset::@5/(byte*) memset::dst#1 ) + (bool~) memset::$3 ← (byte*) memset::dst#2 != (byte*) memset::end#1 + if((bool~) memset::$3) goto memset::@5 + to:memset::@1 +memset::@5: scope:[memset] from memset::@4 + (void*) memset::str#6 ← phi( memset::@4/(void*) memset::str#5 ) + (byte*) memset::end#2 ← phi( memset::@4/(byte*) memset::end#1 ) + (byte*) memset::dst#3 ← phi( memset::@4/(byte*) memset::dst#2 ) + (byte) memset::c#2 ← phi( memset::@4/(byte) memset::c#3 ) + *((byte*) memset::dst#3) ← (byte) memset::c#2 + (byte*) memset::dst#1 ← ++ (byte*) memset::dst#3 + to:memset::@4 +memset::@return: scope:[memset] from memset::@1 + (void*) memset::return#4 ← phi( memset::@1/(void*) memset::return#0 ) + (void*) memset::return#1 ← (void*) memset::return#4 + return + to:@return + +(word()) strlen((byte*) strlen::str) +strlen: scope:[strlen] from printf_number_buffer::@6 + (byte*) strlen::str#4 ← phi( printf_number_buffer::@6/(byte*) strlen::str#1 ) + (word) strlen::len#0 ← (word) 0 + to:strlen::@1 +strlen::@1: scope:[strlen] from strlen strlen::@2 + (word) strlen::len#4 ← phi( strlen/(word) strlen::len#0 strlen::@2/(word) strlen::len#1 ) + (byte*) strlen::str#2 ← phi( strlen/(byte*) strlen::str#4 strlen::@2/(byte*) strlen::str#0 ) + (bool~) strlen::$0 ← (number) 0 != *((byte*) strlen::str#2) + if((bool~) strlen::$0) goto strlen::@2 + to:strlen::@3 +strlen::@2: scope:[strlen] from strlen::@1 + (byte*) strlen::str#3 ← phi( strlen::@1/(byte*) strlen::str#2 ) + (word) strlen::len#2 ← phi( strlen::@1/(word) strlen::len#4 ) + (word) strlen::len#1 ← ++ (word) strlen::len#2 + (byte*) strlen::str#0 ← ++ (byte*) strlen::str#3 + to:strlen::@1 +strlen::@3: scope:[strlen] from strlen::@1 + (word) strlen::len#3 ← phi( strlen::@1/(word) strlen::len#4 ) + (word) strlen::return#0 ← (word) strlen::len#3 + to:strlen::@return +strlen::@return: scope:[strlen] from strlen::@3 + (word) strlen::return#3 ← phi( strlen::@3/(word) strlen::return#0 ) + (word) strlen::return#1 ← (word) strlen::return#3 + return + to:@return + +(void()) uctoa((byte) uctoa::value , (byte*) uctoa::buffer , (byte) uctoa::radix) +uctoa: scope:[uctoa] from printf_uchar::@3 + (byte*) uctoa::buffer#21 ← phi( printf_uchar::@3/(byte*) uctoa::buffer#5 ) + (byte) uctoa::value#12 ← phi( printf_uchar::@3/(byte) uctoa::value#1 ) + (byte) uctoa::radix#1 ← phi( printf_uchar::@3/(byte) uctoa::radix#0 ) + (byte) uctoa::max_digits#0 ← (byte) 0 + (byte*) uctoa::digit_values#0 ← (byte*) 0 + (bool~) uctoa::$0 ← (byte) uctoa::radix#1 == (const byte) DECIMAL + if((bool~) uctoa::$0) goto uctoa::@1 + to:uctoa::@9 +uctoa::@1: scope:[uctoa] from uctoa + (byte*) uctoa::buffer#17 ← phi( uctoa/(byte*) uctoa::buffer#21 ) + (byte) uctoa::value#8 ← phi( uctoa/(byte) uctoa::value#12 ) + (byte) uctoa::max_digits#1 ← (number) 3 + (byte*) uctoa::digit_values#1 ← (const byte*) RADIX_DECIMAL_VALUES_CHAR + to:uctoa::@8 +uctoa::@9: scope:[uctoa] from uctoa + (byte) uctoa::value#13 ← phi( uctoa/(byte) uctoa::value#12 ) + (byte*) uctoa::buffer#16 ← phi( uctoa/(byte*) uctoa::buffer#21 ) + (byte) uctoa::radix#2 ← phi( uctoa/(byte) uctoa::radix#1 ) + (bool~) uctoa::$1 ← (byte) uctoa::radix#2 == (const byte) HEXADECIMAL + if((bool~) uctoa::$1) goto uctoa::@2 + to:uctoa::@10 +uctoa::@2: scope:[uctoa] from uctoa::@9 + (byte*) uctoa::buffer#18 ← phi( uctoa::@9/(byte*) uctoa::buffer#16 ) + (byte) uctoa::value#9 ← phi( uctoa::@9/(byte) uctoa::value#13 ) + (byte) uctoa::max_digits#2 ← (number) 2 + (byte*) uctoa::digit_values#2 ← (const byte*) RADIX_HEXADECIMAL_VALUES_CHAR + to:uctoa::@8 +uctoa::@10: scope:[uctoa] from uctoa::@9 + (byte) uctoa::value#14 ← phi( uctoa::@9/(byte) uctoa::value#13 ) + (byte*) uctoa::buffer#13 ← phi( uctoa::@9/(byte*) uctoa::buffer#16 ) + (byte) uctoa::radix#3 ← phi( uctoa::@9/(byte) uctoa::radix#2 ) + (bool~) uctoa::$2 ← (byte) uctoa::radix#3 == (const byte) OCTAL + if((bool~) uctoa::$2) goto uctoa::@3 + to:uctoa::@11 +uctoa::@3: scope:[uctoa] from uctoa::@10 + (byte*) uctoa::buffer#19 ← phi( uctoa::@10/(byte*) uctoa::buffer#13 ) + (byte) uctoa::value#10 ← phi( uctoa::@10/(byte) uctoa::value#14 ) + (byte) uctoa::max_digits#3 ← (number) 3 + (byte*) uctoa::digit_values#3 ← (const byte*) RADIX_OCTAL_VALUES_CHAR + to:uctoa::@8 +uctoa::@11: scope:[uctoa] from uctoa::@10 + (byte) uctoa::value#15 ← phi( uctoa::@10/(byte) uctoa::value#14 ) + (byte*) uctoa::buffer#10 ← phi( uctoa::@10/(byte*) uctoa::buffer#13 ) + (byte) uctoa::radix#4 ← phi( uctoa::@10/(byte) uctoa::radix#3 ) + (bool~) uctoa::$3 ← (byte) uctoa::radix#4 == (const byte) BINARY + if((bool~) uctoa::$3) goto uctoa::@4 + to:uctoa::@12 +uctoa::@4: scope:[uctoa] from uctoa::@11 + (byte*) uctoa::buffer#20 ← phi( uctoa::@11/(byte*) uctoa::buffer#10 ) + (byte) uctoa::value#11 ← phi( uctoa::@11/(byte) uctoa::value#15 ) + (byte) uctoa::max_digits#4 ← (number) 8 + (byte*) uctoa::digit_values#4 ← (const byte*) RADIX_BINARY_VALUES_CHAR + to:uctoa::@8 +uctoa::@12: scope:[uctoa] from uctoa::@11 + (byte*) uctoa::buffer#6 ← phi( uctoa::@11/(byte*) uctoa::buffer#10 ) + *((byte*) uctoa::buffer#6) ← (byte) 'e' + (byte*) uctoa::buffer#0 ← ++ (byte*) uctoa::buffer#6 + *((byte*) uctoa::buffer#0) ← (byte) 'r' + (byte*) uctoa::buffer#1 ← ++ (byte*) uctoa::buffer#0 + *((byte*) uctoa::buffer#1) ← (byte) 'r' + (byte*) uctoa::buffer#2 ← ++ (byte*) uctoa::buffer#1 + *((byte*) uctoa::buffer#2) ← (number) 0 + to:uctoa::@return +uctoa::@return: scope:[uctoa] from uctoa::@12 uctoa::@20 + return + to:@return +uctoa::@8: scope:[uctoa] from uctoa::@1 uctoa::@2 uctoa::@3 uctoa::@4 + (byte*) uctoa::buffer#15 ← phi( uctoa::@1/(byte*) uctoa::buffer#17 uctoa::@2/(byte*) uctoa::buffer#18 uctoa::@3/(byte*) uctoa::buffer#19 uctoa::@4/(byte*) uctoa::buffer#20 ) + (byte) uctoa::value#7 ← phi( uctoa::@1/(byte) uctoa::value#8 uctoa::@2/(byte) uctoa::value#9 uctoa::@3/(byte) uctoa::value#10 uctoa::@4/(byte) uctoa::value#11 ) + (byte*) uctoa::digit_values#8 ← phi( uctoa::@1/(byte*) uctoa::digit_values#1 uctoa::@2/(byte*) uctoa::digit_values#2 uctoa::@3/(byte*) uctoa::digit_values#3 uctoa::@4/(byte*) uctoa::digit_values#4 ) + (byte) uctoa::max_digits#7 ← phi( uctoa::@1/(byte) uctoa::max_digits#1 uctoa::@2/(byte) uctoa::max_digits#2 uctoa::@3/(byte) uctoa::max_digits#3 uctoa::@4/(byte) uctoa::max_digits#4 ) + (byte) uctoa::started#0 ← (byte) 0 + (byte) uctoa::digit#0 ← (byte) 0 + to:uctoa::@18 +uctoa::@18: scope:[uctoa] from uctoa::@21 uctoa::@8 + (byte*) uctoa::buffer#11 ← phi( uctoa::@21/(byte*) uctoa::buffer#14 uctoa::@8/(byte*) uctoa::buffer#15 ) + (byte) uctoa::started#3 ← phi( uctoa::@21/(byte) uctoa::started#4 uctoa::@8/(byte) uctoa::started#0 ) + (byte) uctoa::value#5 ← phi( uctoa::@21/(byte) uctoa::value#6 uctoa::@8/(byte) uctoa::value#7 ) + (byte*) uctoa::digit_values#6 ← phi( uctoa::@21/(byte*) uctoa::digit_values#7 uctoa::@8/(byte*) uctoa::digit_values#8 ) + (byte) uctoa::digit#2 ← phi( uctoa::@21/(byte) uctoa::digit#1 uctoa::@8/(byte) uctoa::digit#0 ) + (byte) uctoa::max_digits#5 ← phi( uctoa::@21/(byte) uctoa::max_digits#6 uctoa::@8/(byte) uctoa::max_digits#7 ) + (number~) uctoa::$4 ← (byte) uctoa::max_digits#5 - (number) 1 + (bool~) uctoa::$5 ← (byte) uctoa::digit#2 < (number~) uctoa::$4 + if((bool~) uctoa::$5) goto uctoa::@19 + to:uctoa::@20 +uctoa::@19: scope:[uctoa] from uctoa::@18 + (byte) uctoa::max_digits#8 ← phi( uctoa::@18/(byte) uctoa::max_digits#5 ) + (byte*) uctoa::buffer#12 ← phi( uctoa::@18/(byte*) uctoa::buffer#11 ) + (byte) uctoa::started#2 ← phi( uctoa::@18/(byte) uctoa::started#3 ) + (byte) uctoa::value#2 ← phi( uctoa::@18/(byte) uctoa::value#5 ) + (byte) uctoa::digit#3 ← phi( uctoa::@18/(byte) uctoa::digit#2 ) + (byte*) uctoa::digit_values#5 ← phi( uctoa::@18/(byte*) uctoa::digit_values#6 ) + (byte) uctoa::digit_value#0 ← *((byte*) uctoa::digit_values#5 + (byte) uctoa::digit#3) + (bool~) uctoa::$6 ← (byte) uctoa::value#2 >= (byte) uctoa::digit_value#0 + (bool~) uctoa::$7 ← (byte) uctoa::started#2 || (bool~) uctoa::$6 + (bool~) uctoa::$8 ← ! (bool~) uctoa::$7 + if((bool~) uctoa::$8) goto uctoa::@21 + to:uctoa::@24 +uctoa::@20: scope:[uctoa] from uctoa::@18 + (byte*) uctoa::buffer#7 ← phi( uctoa::@18/(byte*) uctoa::buffer#11 ) + (byte) uctoa::value#3 ← phi( uctoa::@18/(byte) uctoa::value#5 ) + (byte~) uctoa::$10 ← (byte)(byte) uctoa::value#3 + *((byte*) uctoa::buffer#7) ← *((const byte*) DIGITS + (byte~) uctoa::$10) + (byte*) uctoa::buffer#3 ← ++ (byte*) uctoa::buffer#7 + *((byte*) uctoa::buffer#3) ← (number) 0 + to:uctoa::@return +uctoa::@21: scope:[uctoa] from uctoa::@19 uctoa::@26 + (byte*) uctoa::buffer#14 ← phi( uctoa::@19/(byte*) uctoa::buffer#12 uctoa::@26/(byte*) uctoa::buffer#4 ) + (byte) uctoa::started#4 ← phi( uctoa::@19/(byte) uctoa::started#2 uctoa::@26/(byte) uctoa::started#1 ) + (byte) uctoa::value#6 ← phi( uctoa::@19/(byte) uctoa::value#2 uctoa::@26/(byte) uctoa::value#0 ) + (byte*) uctoa::digit_values#7 ← phi( uctoa::@19/(byte*) uctoa::digit_values#5 uctoa::@26/(byte*) uctoa::digit_values#9 ) + (byte) uctoa::max_digits#6 ← phi( uctoa::@19/(byte) uctoa::max_digits#8 uctoa::@26/(byte) uctoa::max_digits#9 ) + (byte) uctoa::digit#4 ← phi( uctoa::@19/(byte) uctoa::digit#3 uctoa::@26/(byte) uctoa::digit#5 ) + (byte) uctoa::digit#1 ← ++ (byte) uctoa::digit#4 + to:uctoa::@18 +uctoa::@24: scope:[uctoa] from uctoa::@19 + (byte*) uctoa::digit_values#10 ← phi( uctoa::@19/(byte*) uctoa::digit_values#5 ) + (byte) uctoa::max_digits#10 ← phi( uctoa::@19/(byte) uctoa::max_digits#8 ) + (byte) uctoa::digit#6 ← phi( uctoa::@19/(byte) uctoa::digit#3 ) + (byte) uctoa::digit_value#1 ← phi( uctoa::@19/(byte) uctoa::digit_value#0 ) + (byte) uctoa::value#4 ← phi( uctoa::@19/(byte) uctoa::value#2 ) + (byte*) uctoa::buffer#8 ← phi( uctoa::@19/(byte*) uctoa::buffer#12 ) + (byte*) uctoa_append::buffer#0 ← (byte*) uctoa::buffer#8 + (byte) uctoa_append::value#0 ← (byte) uctoa::value#4 + (byte) uctoa_append::sub#0 ← (byte) uctoa::digit_value#1 + call uctoa_append + (byte) uctoa_append::return#0 ← (byte) uctoa_append::return#2 + to:uctoa::@26 +uctoa::@26: scope:[uctoa] from uctoa::@24 + (byte*) uctoa::digit_values#9 ← phi( uctoa::@24/(byte*) uctoa::digit_values#10 ) + (byte) uctoa::max_digits#9 ← phi( uctoa::@24/(byte) uctoa::max_digits#10 ) + (byte) uctoa::digit#5 ← phi( uctoa::@24/(byte) uctoa::digit#6 ) + (byte*) uctoa::buffer#9 ← phi( uctoa::@24/(byte*) uctoa::buffer#8 ) + (byte) uctoa_append::return#3 ← phi( uctoa::@24/(byte) uctoa_append::return#0 ) + (byte~) uctoa::$9 ← (byte) uctoa_append::return#3 + (byte) uctoa::value#0 ← (byte~) uctoa::$9 + (byte*) uctoa::buffer#4 ← ++ (byte*) uctoa::buffer#9 + (byte) uctoa::started#1 ← (number) 1 + to:uctoa::@21 + +(byte()) uctoa_append((byte*) uctoa_append::buffer , (byte) uctoa_append::value , (byte) uctoa_append::sub) +uctoa_append: scope:[uctoa_append] from uctoa::@24 + (byte*) uctoa_append::buffer#3 ← phi( uctoa::@24/(byte*) uctoa_append::buffer#0 ) + (byte) uctoa_append::sub#3 ← phi( uctoa::@24/(byte) uctoa_append::sub#0 ) + (byte) uctoa_append::value#5 ← phi( uctoa::@24/(byte) uctoa_append::value#0 ) + (byte) uctoa_append::digit#0 ← (byte) 0 + to:uctoa_append::@1 +uctoa_append::@1: scope:[uctoa_append] from uctoa_append uctoa_append::@2 + (byte*) uctoa_append::buffer#2 ← phi( uctoa_append/(byte*) uctoa_append::buffer#3 uctoa_append::@2/(byte*) uctoa_append::buffer#4 ) + (byte) uctoa_append::digit#4 ← phi( uctoa_append/(byte) uctoa_append::digit#0 uctoa_append::@2/(byte) uctoa_append::digit#1 ) + (byte) uctoa_append::sub#1 ← phi( uctoa_append/(byte) uctoa_append::sub#3 uctoa_append::@2/(byte) uctoa_append::sub#2 ) + (byte) uctoa_append::value#2 ← phi( uctoa_append/(byte) uctoa_append::value#5 uctoa_append::@2/(byte) uctoa_append::value#1 ) + (bool~) uctoa_append::$0 ← (byte) uctoa_append::value#2 >= (byte) uctoa_append::sub#1 + if((bool~) uctoa_append::$0) goto uctoa_append::@2 + to:uctoa_append::@3 +uctoa_append::@2: scope:[uctoa_append] from uctoa_append::@1 + (byte*) uctoa_append::buffer#4 ← phi( uctoa_append::@1/(byte*) uctoa_append::buffer#2 ) + (byte) uctoa_append::sub#2 ← phi( uctoa_append::@1/(byte) uctoa_append::sub#1 ) + (byte) uctoa_append::value#3 ← phi( uctoa_append::@1/(byte) uctoa_append::value#2 ) + (byte) uctoa_append::digit#2 ← phi( uctoa_append::@1/(byte) uctoa_append::digit#4 ) + (byte) uctoa_append::digit#1 ← ++ (byte) uctoa_append::digit#2 + (byte) uctoa_append::value#1 ← (byte) uctoa_append::value#3 - (byte) uctoa_append::sub#2 + to:uctoa_append::@1 +uctoa_append::@3: scope:[uctoa_append] from uctoa_append::@1 + (byte) uctoa_append::value#4 ← phi( uctoa_append::@1/(byte) uctoa_append::value#2 ) + (byte*) uctoa_append::buffer#1 ← phi( uctoa_append::@1/(byte*) uctoa_append::buffer#2 ) + (byte) uctoa_append::digit#3 ← phi( uctoa_append::@1/(byte) uctoa_append::digit#4 ) + *((byte*) uctoa_append::buffer#1) ← *((const byte*) DIGITS + (byte) uctoa_append::digit#3) + (byte) uctoa_append::return#1 ← (byte) uctoa_append::value#4 + to:uctoa_append::@return +uctoa_append::@return: scope:[uctoa_append] from uctoa_append::@3 + (byte) uctoa_append::return#4 ← phi( uctoa_append::@3/(byte) uctoa_append::return#1 ) + (byte) uctoa_append::return#2 ← (byte) uctoa_append::return#4 + return + to:@return +@15: scope:[] from @begin + (byte*) printf_line_cursor ← (byte*)(number) $400 + (byte*) printf_char_cursor ← (byte*)(number) $400 + to:@29 + +(void()) printf_cls() +printf_cls: scope:[printf_cls] from main + (void*) memset::str#0 ← (void*)(const byte*) printf_screen + (byte) memset::c#0 ← (byte) ' ' + (word) memset::num#0 ← (number) $28*(number) $19 + call memset + (void*) memset::return#2 ← (void*) memset::return#1 + to:printf_cls::@1 +printf_cls::@1: scope:[printf_cls] from printf_cls + (byte*) printf_line_cursor ← (const byte*) printf_screen + (byte*) printf_char_cursor ← (byte*) printf_line_cursor + to:printf_cls::@return +printf_cls::@return: scope:[printf_cls] from printf_cls::@1 + return + to:@return + +(void()) printf_char((byte) printf_char::ch) +printf_char: scope:[printf_char] from printf_number_buffer::@9 printf_padding::@2 printf_str::@12 + (byte) printf_char::ch#3 ← phi( printf_number_buffer::@9/(byte) printf_char::ch#2 printf_padding::@2/(byte) printf_char::ch#0 printf_str::@12/(byte) printf_char::ch#1 ) + *((byte*) printf_char_cursor) ← (byte) printf_char::ch#3 + (byte*) printf_char_cursor ← ++ (byte*) printf_char_cursor + (byte*~) printf_char::$0 ← (const byte*) printf_screen + (number) $28*(number) $19 + (bool~) printf_char::$1 ← (byte*) printf_char_cursor >= (byte*~) printf_char::$0 + (bool~) printf_char::$2 ← ! (bool~) printf_char::$1 + if((bool~) printf_char::$2) goto printf_char::@return + to:printf_char::@2 +printf_char::@2: scope:[printf_char] from printf_char + (byte*~) printf_char::$3 ← (const byte*) printf_screen + (number) $28 + (void*) memcpy::destination#0 ← (void*)(const byte*) printf_screen + (void*) memcpy::source#0 ← (void*)(byte*~) printf_char::$3 + (word) memcpy::num#0 ← (number) $28*(number) $19-(number) $28 + call memcpy + (void*) memcpy::return#2 ← (void*) memcpy::return#1 + to:printf_char::@3 +printf_char::@3: scope:[printf_char] from printf_char::@2 + (byte*~) printf_char::$5 ← (const byte*) printf_screen + (number) $28*(number) $19 + (byte*~) printf_char::$6 ← (byte*~) printf_char::$5 - (number) $28 + (void*) memset::str#1 ← (void*)(byte*~) printf_char::$6 + (byte) memset::c#1 ← (byte) ' ' + (word) memset::num#1 ← (number) $28 + call memset + (void*) memset::return#3 ← (void*) memset::return#1 + to:printf_char::@4 +printf_char::@4: scope:[printf_char] from printf_char::@3 + (byte*~) printf_char::$8 ← (byte*) printf_char_cursor - (number) $28 + (byte*) printf_char_cursor ← (byte*~) printf_char::$8 + (byte*) printf_line_cursor ← (byte*) printf_char_cursor + to:printf_char::@return +printf_char::@return: scope:[printf_char] from printf_char printf_char::@4 + return + to:@return + +(void()) printf_ln() +printf_ln: scope:[printf_ln] from printf_str::@6 + to:printf_ln::@1 +printf_ln::@1: scope:[printf_ln] from printf_ln printf_ln::@1 + (byte*) printf_line_cursor ← (byte*) printf_line_cursor + (number) $28 + (bool~) printf_ln::$0 ← (byte*) printf_line_cursor < (byte*) printf_char_cursor + if((bool~) printf_ln::$0) goto printf_ln::@1 + to:printf_ln::@2 +printf_ln::@2: scope:[printf_ln] from printf_ln::@1 + (byte*) printf_char_cursor ← (byte*) printf_line_cursor + to:printf_ln::@return +printf_ln::@return: scope:[printf_ln] from printf_ln::@2 + return + to:@return + +(void()) printf_padding((byte) printf_padding::pad , (byte) printf_padding::length) +printf_padding: scope:[printf_padding] from printf_number_buffer::@10 printf_number_buffer::@11 printf_number_buffer::@8 + (byte) printf_padding::pad#5 ← phi( printf_number_buffer::@10/(byte) printf_padding::pad#1 printf_number_buffer::@11/(byte) printf_padding::pad#2 printf_number_buffer::@8/(byte) printf_padding::pad#0 ) + (byte) printf_padding::length#4 ← phi( printf_number_buffer::@10/(byte) printf_padding::length#1 printf_number_buffer::@11/(byte) printf_padding::length#2 printf_number_buffer::@8/(byte) printf_padding::length#0 ) + (byte) printf_padding::i#0 ← (byte) 0 + to:printf_padding::@1 +printf_padding::@1: scope:[printf_padding] from printf_padding printf_padding::@7 + (byte) printf_padding::pad#4 ← phi( printf_padding/(byte) printf_padding::pad#5 printf_padding::@7/(byte) printf_padding::pad#6 ) + (byte) printf_padding::length#3 ← phi( printf_padding/(byte) printf_padding::length#4 printf_padding::@7/(byte) printf_padding::length#5 ) + (byte) printf_padding::i#2 ← phi( printf_padding/(byte) printf_padding::i#0 printf_padding::@7/(byte) printf_padding::i#1 ) + (bool~) printf_padding::$0 ← (byte) printf_padding::i#2 < (byte) printf_padding::length#3 + if((bool~) printf_padding::$0) goto printf_padding::@2 + to:printf_padding::@return +printf_padding::@2: scope:[printf_padding] from printf_padding::@1 + (byte) printf_padding::length#6 ← phi( printf_padding::@1/(byte) printf_padding::length#3 ) + (byte) printf_padding::i#4 ← phi( printf_padding::@1/(byte) printf_padding::i#2 ) + (byte) printf_padding::pad#3 ← phi( printf_padding::@1/(byte) printf_padding::pad#4 ) + (byte) printf_char::ch#0 ← (byte) printf_padding::pad#3 + call printf_char + to:printf_padding::@7 +printf_padding::@7: scope:[printf_padding] from printf_padding::@2 + (byte) printf_padding::pad#6 ← phi( printf_padding::@2/(byte) printf_padding::pad#3 ) + (byte) printf_padding::length#5 ← phi( printf_padding::@2/(byte) printf_padding::length#6 ) + (byte) printf_padding::i#3 ← phi( printf_padding::@2/(byte) printf_padding::i#4 ) + (byte) printf_padding::i#1 ← ++ (byte) printf_padding::i#3 + to:printf_padding::@1 +printf_padding::@return: scope:[printf_padding] from printf_padding::@1 + return + to:@return + +(void()) printf_str((byte*) printf_str::str) +printf_str: scope:[printf_str] from main::@1 main::@3 printf_number_buffer::@4 + (byte*) printf_str::str#6 ← phi( main::@1/(byte*) printf_str::str#2 main::@3/(byte*) printf_str::str#3 printf_number_buffer::@4/(byte*) printf_str::str#1 ) + to:printf_str::@1 +printf_str::@1: scope:[printf_str] from printf_str printf_str::@15 printf_str::@16 + (byte*) printf_str::str#5 ← phi( printf_str/(byte*) printf_str::str#6 printf_str::@15/(byte*) printf_str::str#7 printf_str::@16/(byte*) printf_str::str#8 ) + if(true) goto printf_str::@2 + to:printf_str::@return +printf_str::@2: scope:[printf_str] from printf_str::@1 + (byte*) printf_str::str#4 ← phi( printf_str::@1/(byte*) printf_str::str#5 ) + (byte) printf_str::ch#0 ← *((byte*) printf_str::str#4) + (byte*) printf_str::str#0 ← ++ (byte*) printf_str::str#4 + (bool~) printf_str::$0 ← (byte) printf_str::ch#0 == (number) 0 + (bool~) printf_str::$1 ← ! (bool~) printf_str::$0 + if((bool~) printf_str::$1) goto printf_str::@4 + to:printf_str::@return +printf_str::@4: scope:[printf_str] from printf_str::@2 + (byte*) printf_str::str#11 ← phi( printf_str::@2/(byte*) printf_str::str#0 ) + (byte) printf_str::ch#1 ← phi( printf_str::@2/(byte) printf_str::ch#0 ) + (bool~) printf_str::$2 ← (byte) printf_str::ch#1 == (byte) ' +' + if((bool~) printf_str::$2) goto printf_str::@6 + to:printf_str::@12 +printf_str::@6: scope:[printf_str] from printf_str::@4 + (byte*) printf_str::str#9 ← phi( printf_str::@4/(byte*) printf_str::str#11 ) + call printf_ln + to:printf_str::@15 +printf_str::@15: scope:[printf_str] from printf_str::@6 + (byte*) printf_str::str#7 ← phi( printf_str::@6/(byte*) printf_str::str#9 ) + to:printf_str::@1 +printf_str::@12: scope:[printf_str] from printf_str::@4 + (byte*) printf_str::str#10 ← phi( printf_str::@4/(byte*) printf_str::str#11 ) + (byte) printf_str::ch#2 ← phi( printf_str::@4/(byte) printf_str::ch#1 ) + (byte) printf_char::ch#1 ← (byte) printf_str::ch#2 + call printf_char + to:printf_str::@16 +printf_str::@16: scope:[printf_str] from printf_str::@12 + (byte*) printf_str::str#8 ← phi( printf_str::@12/(byte*) printf_str::str#10 ) + to:printf_str::@1 +printf_str::@return: scope:[printf_str] from printf_str::@1 printf_str::@2 + return + to:@return + +(void()) printf_uchar((byte) printf_uchar::uvalue , (byte) printf_uchar::format_min_length , (byte) printf_uchar::format_justify_left , (byte) printf_uchar::format_sign_always , (byte) printf_uchar::format_zero_padding , (byte) printf_uchar::format_radix) +printf_uchar: scope:[printf_uchar] from main::@2 + (byte) printf_uchar::format_zero_padding#5 ← phi( main::@2/(byte) printf_uchar::format_zero_padding#0 ) + (byte) printf_uchar::format_justify_left#5 ← phi( main::@2/(byte) printf_uchar::format_justify_left#0 ) + (byte) printf_uchar::format_min_length#5 ← phi( main::@2/(byte) printf_uchar::format_min_length#0 ) + (byte) printf_uchar::format_radix#5 ← phi( main::@2/(byte) printf_uchar::format_radix#0 ) + (byte) printf_uchar::uvalue#4 ← phi( main::@2/(byte) printf_uchar::uvalue#0 ) + (byte) printf_uchar::format_sign_always#1 ← phi( main::@2/(byte) printf_uchar::format_sign_always#0 ) + (bool~) printf_uchar::$5 ← (number) 0 != (byte) printf_uchar::format_sign_always#1 + if((bool~) printf_uchar::$5) goto printf_uchar::@1 + to:printf_uchar::@2 +printf_uchar::@1: scope:[printf_uchar] from printf_uchar + (byte) printf_uchar::format_zero_padding#3 ← phi( printf_uchar/(byte) printf_uchar::format_zero_padding#5 ) + (byte) printf_uchar::format_sign_always#4 ← phi( printf_uchar/(byte) printf_uchar::format_sign_always#1 ) + (byte) printf_uchar::format_justify_left#3 ← phi( printf_uchar/(byte) printf_uchar::format_justify_left#5 ) + (byte) printf_uchar::format_min_length#3 ← phi( printf_uchar/(byte) printf_uchar::format_min_length#5 ) + (byte) printf_uchar::format_radix#3 ← phi( printf_uchar/(byte) printf_uchar::format_radix#5 ) + (byte) printf_uchar::uvalue#2 ← phi( printf_uchar/(byte) printf_uchar::uvalue#4 ) + (byte~) printf_uchar::$1 ← (byte) '+' + to:printf_uchar::@3 +printf_uchar::@2: scope:[printf_uchar] from printf_uchar + (byte) printf_uchar::format_zero_padding#4 ← phi( printf_uchar/(byte) printf_uchar::format_zero_padding#5 ) + (byte) printf_uchar::format_sign_always#5 ← phi( printf_uchar/(byte) printf_uchar::format_sign_always#1 ) + (byte) printf_uchar::format_justify_left#4 ← phi( printf_uchar/(byte) printf_uchar::format_justify_left#5 ) + (byte) printf_uchar::format_min_length#4 ← phi( printf_uchar/(byte) printf_uchar::format_min_length#5 ) + (byte) printf_uchar::format_radix#4 ← phi( printf_uchar/(byte) printf_uchar::format_radix#5 ) + (byte) printf_uchar::uvalue#3 ← phi( printf_uchar/(byte) printf_uchar::uvalue#4 ) + (number~) printf_uchar::$0 ← (number) 0 + to:printf_uchar::@3 +printf_uchar::@3: scope:[printf_uchar] from printf_uchar::@1 printf_uchar::@2 + (byte) printf_uchar::format_zero_padding#2 ← phi( printf_uchar::@1/(byte) printf_uchar::format_zero_padding#3 printf_uchar::@2/(byte) printf_uchar::format_zero_padding#4 ) + (byte) printf_uchar::format_sign_always#3 ← phi( printf_uchar::@1/(byte) printf_uchar::format_sign_always#4 printf_uchar::@2/(byte) printf_uchar::format_sign_always#5 ) + (byte) printf_uchar::format_justify_left#2 ← phi( printf_uchar::@1/(byte) printf_uchar::format_justify_left#3 printf_uchar::@2/(byte) printf_uchar::format_justify_left#4 ) + (byte) printf_uchar::format_min_length#2 ← phi( printf_uchar::@1/(byte) printf_uchar::format_min_length#3 printf_uchar::@2/(byte) printf_uchar::format_min_length#4 ) + (byte) printf_uchar::format_radix#1 ← phi( printf_uchar::@1/(byte) printf_uchar::format_radix#3 printf_uchar::@2/(byte) printf_uchar::format_radix#4 ) + (byte) printf_uchar::uvalue#1 ← phi( printf_uchar::@1/(byte) printf_uchar::uvalue#2 printf_uchar::@2/(byte) printf_uchar::uvalue#3 ) + (number~) printf_uchar::$2 ← phi( printf_uchar::@1/(byte~) printf_uchar::$1 printf_uchar::@2/(number~) printf_uchar::$0 ) + *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) ← (number~) printf_uchar::$2 + (byte) uctoa::value#1 ← (byte) printf_uchar::uvalue#1 + (byte*) uctoa::buffer#5 ← (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + (byte) uctoa::radix#0 ← (byte) printf_uchar::format_radix#1 + call uctoa + to:printf_uchar::@6 +printf_uchar::@6: scope:[printf_uchar] from printf_uchar::@3 + (byte) printf_uchar::format_radix#2 ← phi( printf_uchar::@3/(byte) printf_uchar::format_radix#1 ) + (byte) printf_uchar::format_zero_padding#1 ← phi( printf_uchar::@3/(byte) printf_uchar::format_zero_padding#2 ) + (byte) printf_uchar::format_sign_always#2 ← phi( printf_uchar::@3/(byte) printf_uchar::format_sign_always#3 ) + (byte) printf_uchar::format_justify_left#1 ← phi( printf_uchar::@3/(byte) printf_uchar::format_justify_left#2 ) + (byte) printf_uchar::format_min_length#1 ← phi( printf_uchar::@3/(byte) printf_uchar::format_min_length#2 ) + (byte) printf_number_buffer::buffer_sign#0 ← *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) + (byte*) printf_number_buffer::buffer_digits#0 ← (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + (byte) printf_number_buffer::format_min_length#0 ← (byte) printf_uchar::format_min_length#1 + (byte) printf_number_buffer::format_justify_left#0 ← (byte) printf_uchar::format_justify_left#1 + (byte) printf_number_buffer::format_sign_always#0 ← (byte) printf_uchar::format_sign_always#2 + (byte) printf_number_buffer::format_zero_padding#0 ← (byte) printf_uchar::format_zero_padding#1 + (byte) printf_number_buffer::format_radix#0 ← (byte) printf_uchar::format_radix#2 + call printf_number_buffer + to:printf_uchar::@7 +printf_uchar::@7: scope:[printf_uchar] from printf_uchar::@6 + to:printf_uchar::@return +printf_uchar::@return: scope:[printf_uchar] from printf_uchar::@7 + return + to:@return + +(void()) printf_number_buffer((byte) printf_number_buffer::buffer_sign , (byte*) printf_number_buffer::buffer_digits , (byte) printf_number_buffer::format_min_length , (byte) printf_number_buffer::format_justify_left , (byte) printf_number_buffer::format_sign_always , (byte) printf_number_buffer::format_zero_padding , (byte) printf_number_buffer::format_radix) +printf_number_buffer: scope:[printf_number_buffer] from printf_uchar::@6 + (byte) printf_number_buffer::buffer_sign#7 ← phi( printf_uchar::@6/(byte) printf_number_buffer::buffer_sign#0 ) + (byte*) printf_number_buffer::buffer_digits#3 ← phi( printf_uchar::@6/(byte*) printf_number_buffer::buffer_digits#0 ) + (byte) printf_number_buffer::format_zero_padding#4 ← phi( printf_uchar::@6/(byte) printf_number_buffer::format_zero_padding#0 ) + (byte) printf_number_buffer::format_justify_left#3 ← phi( printf_uchar::@6/(byte) printf_number_buffer::format_justify_left#0 ) + (byte) printf_number_buffer::format_min_length#1 ← phi( printf_uchar::@6/(byte) printf_number_buffer::format_min_length#0 ) + (signed byte) printf_number_buffer::padding#0 ← (signed byte) 0 + (bool~) printf_number_buffer::$24 ← (number) 0 != (byte) printf_number_buffer::format_min_length#1 + (bool~) printf_number_buffer::$0 ← ! (bool~) printf_number_buffer::$24 + if((bool~) printf_number_buffer::$0) goto printf_number_buffer::@1 + to:printf_number_buffer::@6 +printf_number_buffer::@1: scope:[printf_number_buffer] from printf_number_buffer printf_number_buffer::@12 printf_number_buffer::@14 + (byte*) printf_number_buffer::buffer_digits#9 ← phi( printf_number_buffer/(byte*) printf_number_buffer::buffer_digits#3 printf_number_buffer::@12/(byte*) printf_number_buffer::buffer_digits#12 printf_number_buffer::@14/(byte*) printf_number_buffer::buffer_digits#13 ) + (byte) printf_number_buffer::buffer_sign#5 ← phi( printf_number_buffer/(byte) printf_number_buffer::buffer_sign#7 printf_number_buffer::@12/(byte) printf_number_buffer::buffer_sign#8 printf_number_buffer::@14/(byte) printf_number_buffer::buffer_sign#9 ) + (signed byte) printf_number_buffer::padding#3 ← phi( printf_number_buffer/(signed byte) printf_number_buffer::padding#0 printf_number_buffer::@12/(signed byte) printf_number_buffer::padding#1 printf_number_buffer::@14/(signed byte) printf_number_buffer::padding#2 ) + (byte) printf_number_buffer::format_zero_padding#1 ← phi( printf_number_buffer/(byte) printf_number_buffer::format_zero_padding#4 printf_number_buffer::@12/(byte) printf_number_buffer::format_zero_padding#5 printf_number_buffer::@14/(byte) printf_number_buffer::format_zero_padding#6 ) + (byte) printf_number_buffer::format_justify_left#1 ← phi( printf_number_buffer/(byte) printf_number_buffer::format_justify_left#3 printf_number_buffer::@12/(byte) printf_number_buffer::format_justify_left#4 printf_number_buffer::@14/(byte) printf_number_buffer::format_justify_left#5 ) + (bool~) printf_number_buffer::$25 ← (number) 0 != (byte) printf_number_buffer::format_justify_left#1 + (bool~) printf_number_buffer::$1 ← ! (bool~) printf_number_buffer::$25 + (bool~) printf_number_buffer::$26 ← (number) 0 != (byte) printf_number_buffer::format_zero_padding#1 + (bool~) printf_number_buffer::$2 ← ! (bool~) printf_number_buffer::$26 + (bool~) printf_number_buffer::$3 ← (bool~) printf_number_buffer::$1 && (bool~) printf_number_buffer::$2 + (bool~) printf_number_buffer::$4 ← (bool~) printf_number_buffer::$3 && (signed byte) printf_number_buffer::padding#3 + (bool~) printf_number_buffer::$5 ← ! (bool~) printf_number_buffer::$4 + if((bool~) printf_number_buffer::$5) goto printf_number_buffer::@2 + to:printf_number_buffer::@8 +printf_number_buffer::@6: scope:[printf_number_buffer] from printf_number_buffer + (byte) printf_number_buffer::format_zero_padding#15 ← phi( printf_number_buffer/(byte) printf_number_buffer::format_zero_padding#4 ) + (byte) printf_number_buffer::format_justify_left#11 ← phi( printf_number_buffer/(byte) printf_number_buffer::format_justify_left#3 ) + (byte) printf_number_buffer::format_min_length#5 ← phi( printf_number_buffer/(byte) printf_number_buffer::format_min_length#1 ) + (byte) printf_number_buffer::buffer_sign#4 ← phi( printf_number_buffer/(byte) printf_number_buffer::buffer_sign#7 ) + (byte*) printf_number_buffer::buffer_digits#1 ← phi( printf_number_buffer/(byte*) printf_number_buffer::buffer_digits#3 ) + (byte*) strlen::str#1 ← (byte*) printf_number_buffer::buffer_digits#1 + call strlen + (word) strlen::return#2 ← (word) strlen::return#1 + to:printf_number_buffer::@15 +printf_number_buffer::@15: scope:[printf_number_buffer] from printf_number_buffer::@6 + (byte*) printf_number_buffer::buffer_digits#15 ← phi( printf_number_buffer::@6/(byte*) printf_number_buffer::buffer_digits#1 ) + (byte) printf_number_buffer::format_zero_padding#10 ← phi( printf_number_buffer::@6/(byte) printf_number_buffer::format_zero_padding#15 ) + (byte) printf_number_buffer::format_justify_left#7 ← phi( printf_number_buffer::@6/(byte) printf_number_buffer::format_justify_left#11 ) + (byte) printf_number_buffer::format_min_length#3 ← phi( printf_number_buffer::@6/(byte) printf_number_buffer::format_min_length#5 ) + (byte) printf_number_buffer::buffer_sign#1 ← phi( printf_number_buffer::@6/(byte) printf_number_buffer::buffer_sign#4 ) + (word) strlen::return#4 ← phi( printf_number_buffer::@6/(word) strlen::return#2 ) + (word~) printf_number_buffer::$18 ← (word) strlen::return#4 + (signed byte) printf_number_buffer::len#0 ← (signed byte)(word~) printf_number_buffer::$18 + (bool~) printf_number_buffer::$27 ← (number) 0 != (byte) printf_number_buffer::buffer_sign#1 + (bool~) printf_number_buffer::$19 ← ! (bool~) printf_number_buffer::$27 + if((bool~) printf_number_buffer::$19) goto printf_number_buffer::@12 + to:printf_number_buffer::@7 +printf_number_buffer::@12: scope:[printf_number_buffer] from printf_number_buffer::@15 printf_number_buffer::@7 + (byte*) printf_number_buffer::buffer_digits#12 ← phi( printf_number_buffer::@15/(byte*) printf_number_buffer::buffer_digits#15 printf_number_buffer::@7/(byte*) printf_number_buffer::buffer_digits#16 ) + (byte) printf_number_buffer::buffer_sign#8 ← phi( printf_number_buffer::@15/(byte) printf_number_buffer::buffer_sign#1 printf_number_buffer::@7/(byte) printf_number_buffer::buffer_sign#11 ) + (byte) printf_number_buffer::format_zero_padding#5 ← phi( printf_number_buffer::@15/(byte) printf_number_buffer::format_zero_padding#10 printf_number_buffer::@7/(byte) printf_number_buffer::format_zero_padding#11 ) + (byte) printf_number_buffer::format_justify_left#4 ← phi( printf_number_buffer::@15/(byte) printf_number_buffer::format_justify_left#7 printf_number_buffer::@7/(byte) printf_number_buffer::format_justify_left#8 ) + (signed byte) printf_number_buffer::len#2 ← phi( printf_number_buffer::@15/(signed byte) printf_number_buffer::len#0 printf_number_buffer::@7/(signed byte) printf_number_buffer::len#1 ) + (byte) printf_number_buffer::format_min_length#2 ← phi( printf_number_buffer::@15/(byte) printf_number_buffer::format_min_length#3 printf_number_buffer::@7/(byte) printf_number_buffer::format_min_length#4 ) + (signed byte~) printf_number_buffer::$23 ← (signed byte)(byte) printf_number_buffer::format_min_length#2 + (signed byte~) printf_number_buffer::$20 ← (signed byte~) printf_number_buffer::$23 - (signed byte) printf_number_buffer::len#2 + (signed byte) printf_number_buffer::padding#1 ← (signed byte~) printf_number_buffer::$20 + (bool~) printf_number_buffer::$21 ← (signed byte) printf_number_buffer::padding#1 < (number) 0 + (bool~) printf_number_buffer::$22 ← ! (bool~) printf_number_buffer::$21 + if((bool~) printf_number_buffer::$22) goto printf_number_buffer::@1 + to:printf_number_buffer::@14 +printf_number_buffer::@7: scope:[printf_number_buffer] from printf_number_buffer::@15 + (byte*) printf_number_buffer::buffer_digits#16 ← phi( printf_number_buffer::@15/(byte*) printf_number_buffer::buffer_digits#15 ) + (byte) printf_number_buffer::buffer_sign#11 ← phi( printf_number_buffer::@15/(byte) printf_number_buffer::buffer_sign#1 ) + (byte) printf_number_buffer::format_zero_padding#11 ← phi( printf_number_buffer::@15/(byte) printf_number_buffer::format_zero_padding#10 ) + (byte) printf_number_buffer::format_justify_left#8 ← phi( printf_number_buffer::@15/(byte) printf_number_buffer::format_justify_left#7 ) + (byte) printf_number_buffer::format_min_length#4 ← phi( printf_number_buffer::@15/(byte) printf_number_buffer::format_min_length#3 ) + (signed byte) printf_number_buffer::len#3 ← phi( printf_number_buffer::@15/(signed byte) printf_number_buffer::len#0 ) + (signed byte) printf_number_buffer::len#1 ← ++ (signed byte) printf_number_buffer::len#3 + to:printf_number_buffer::@12 +printf_number_buffer::@14: scope:[printf_number_buffer] from printf_number_buffer::@12 + (byte*) printf_number_buffer::buffer_digits#13 ← phi( printf_number_buffer::@12/(byte*) printf_number_buffer::buffer_digits#12 ) + (byte) printf_number_buffer::buffer_sign#9 ← phi( printf_number_buffer::@12/(byte) printf_number_buffer::buffer_sign#8 ) + (byte) printf_number_buffer::format_zero_padding#6 ← phi( printf_number_buffer::@12/(byte) printf_number_buffer::format_zero_padding#5 ) + (byte) printf_number_buffer::format_justify_left#5 ← phi( printf_number_buffer::@12/(byte) printf_number_buffer::format_justify_left#4 ) + (signed byte) printf_number_buffer::padding#2 ← (number) 0 + to:printf_number_buffer::@1 +printf_number_buffer::@2: scope:[printf_number_buffer] from printf_number_buffer::@1 printf_number_buffer::@16 + (byte) printf_number_buffer::format_justify_left#13 ← phi( printf_number_buffer::@1/(byte) printf_number_buffer::format_justify_left#1 printf_number_buffer::@16/(byte) printf_number_buffer::format_justify_left#15 ) + (byte*) printf_number_buffer::buffer_digits#7 ← phi( printf_number_buffer::@1/(byte*) printf_number_buffer::buffer_digits#9 printf_number_buffer::@16/(byte*) printf_number_buffer::buffer_digits#10 ) + (signed byte) printf_number_buffer::padding#10 ← phi( printf_number_buffer::@1/(signed byte) printf_number_buffer::padding#3 printf_number_buffer::@16/(signed byte) printf_number_buffer::padding#12 ) + (byte) printf_number_buffer::format_zero_padding#8 ← phi( printf_number_buffer::@1/(byte) printf_number_buffer::format_zero_padding#1 printf_number_buffer::@16/(byte) printf_number_buffer::format_zero_padding#12 ) + (byte) printf_number_buffer::buffer_sign#2 ← phi( printf_number_buffer::@1/(byte) printf_number_buffer::buffer_sign#5 printf_number_buffer::@16/(byte) printf_number_buffer::buffer_sign#6 ) + (bool~) printf_number_buffer::$28 ← (number) 0 != (byte) printf_number_buffer::buffer_sign#2 + (bool~) printf_number_buffer::$7 ← ! (bool~) printf_number_buffer::$28 + if((bool~) printf_number_buffer::$7) goto printf_number_buffer::@3 + to:printf_number_buffer::@9 +printf_number_buffer::@8: scope:[printf_number_buffer] from printf_number_buffer::@1 + (byte) printf_number_buffer::format_justify_left#17 ← phi( printf_number_buffer::@1/(byte) printf_number_buffer::format_justify_left#1 ) + (byte*) printf_number_buffer::buffer_digits#14 ← phi( printf_number_buffer::@1/(byte*) printf_number_buffer::buffer_digits#9 ) + (byte) printf_number_buffer::format_zero_padding#16 ← phi( printf_number_buffer::@1/(byte) printf_number_buffer::format_zero_padding#1 ) + (byte) printf_number_buffer::buffer_sign#10 ← phi( printf_number_buffer::@1/(byte) printf_number_buffer::buffer_sign#5 ) + (signed byte) printf_number_buffer::padding#4 ← phi( printf_number_buffer::@1/(signed byte) printf_number_buffer::padding#3 ) + (byte) printf_padding::pad#0 ← (byte) ' ' + (byte) printf_padding::length#0 ← (byte)(signed byte) printf_number_buffer::padding#4 + call printf_padding + to:printf_number_buffer::@16 +printf_number_buffer::@16: scope:[printf_number_buffer] from printf_number_buffer::@8 + (byte) printf_number_buffer::format_justify_left#15 ← phi( printf_number_buffer::@8/(byte) printf_number_buffer::format_justify_left#17 ) + (byte*) printf_number_buffer::buffer_digits#10 ← phi( printf_number_buffer::@8/(byte*) printf_number_buffer::buffer_digits#14 ) + (signed byte) printf_number_buffer::padding#12 ← phi( printf_number_buffer::@8/(signed byte) printf_number_buffer::padding#4 ) + (byte) printf_number_buffer::format_zero_padding#12 ← phi( printf_number_buffer::@8/(byte) printf_number_buffer::format_zero_padding#16 ) + (byte) printf_number_buffer::buffer_sign#6 ← phi( printf_number_buffer::@8/(byte) printf_number_buffer::buffer_sign#10 ) + to:printf_number_buffer::@2 +printf_number_buffer::@3: scope:[printf_number_buffer] from printf_number_buffer::@17 printf_number_buffer::@2 + (byte) printf_number_buffer::format_justify_left#10 ← phi( printf_number_buffer::@17/(byte) printf_number_buffer::format_justify_left#12 printf_number_buffer::@2/(byte) printf_number_buffer::format_justify_left#13 ) + (byte*) printf_number_buffer::buffer_digits#5 ← phi( printf_number_buffer::@17/(byte*) printf_number_buffer::buffer_digits#6 printf_number_buffer::@2/(byte*) printf_number_buffer::buffer_digits#7 ) + (signed byte) printf_number_buffer::padding#5 ← phi( printf_number_buffer::@17/(signed byte) printf_number_buffer::padding#9 printf_number_buffer::@2/(signed byte) printf_number_buffer::padding#10 ) + (byte) printf_number_buffer::format_zero_padding#2 ← phi( printf_number_buffer::@17/(byte) printf_number_buffer::format_zero_padding#7 printf_number_buffer::@2/(byte) printf_number_buffer::format_zero_padding#8 ) + (bool~) printf_number_buffer::$9 ← (byte) printf_number_buffer::format_zero_padding#2 && (signed byte) printf_number_buffer::padding#5 + (bool~) printf_number_buffer::$10 ← ! (bool~) printf_number_buffer::$9 + if((bool~) printf_number_buffer::$10) goto printf_number_buffer::@4 + to:printf_number_buffer::@10 +printf_number_buffer::@9: scope:[printf_number_buffer] from printf_number_buffer::@2 + (byte) printf_number_buffer::format_justify_left#16 ← phi( printf_number_buffer::@2/(byte) printf_number_buffer::format_justify_left#13 ) + (byte*) printf_number_buffer::buffer_digits#11 ← phi( printf_number_buffer::@2/(byte*) printf_number_buffer::buffer_digits#7 ) + (signed byte) printf_number_buffer::padding#13 ← phi( printf_number_buffer::@2/(signed byte) printf_number_buffer::padding#10 ) + (byte) printf_number_buffer::format_zero_padding#13 ← phi( printf_number_buffer::@2/(byte) printf_number_buffer::format_zero_padding#8 ) + (byte) printf_number_buffer::buffer_sign#3 ← phi( printf_number_buffer::@2/(byte) printf_number_buffer::buffer_sign#2 ) + (byte) printf_char::ch#2 ← (byte) printf_number_buffer::buffer_sign#3 + call printf_char + to:printf_number_buffer::@17 +printf_number_buffer::@17: scope:[printf_number_buffer] from printf_number_buffer::@9 + (byte) printf_number_buffer::format_justify_left#12 ← phi( printf_number_buffer::@9/(byte) printf_number_buffer::format_justify_left#16 ) + (byte*) printf_number_buffer::buffer_digits#6 ← phi( printf_number_buffer::@9/(byte*) printf_number_buffer::buffer_digits#11 ) + (signed byte) printf_number_buffer::padding#9 ← phi( printf_number_buffer::@9/(signed byte) printf_number_buffer::padding#13 ) + (byte) printf_number_buffer::format_zero_padding#7 ← phi( printf_number_buffer::@9/(byte) printf_number_buffer::format_zero_padding#13 ) + to:printf_number_buffer::@3 +printf_number_buffer::@4: scope:[printf_number_buffer] from printf_number_buffer::@19 printf_number_buffer::@3 + (signed byte) printf_number_buffer::padding#11 ← phi( printf_number_buffer::@19/(signed byte) printf_number_buffer::padding#14 printf_number_buffer::@3/(signed byte) printf_number_buffer::padding#5 ) + (byte) printf_number_buffer::format_justify_left#6 ← phi( printf_number_buffer::@19/(byte) printf_number_buffer::format_justify_left#9 printf_number_buffer::@3/(byte) printf_number_buffer::format_justify_left#10 ) + (byte) printf_number_buffer::format_zero_padding#9 ← phi( printf_number_buffer::@19/(byte) printf_number_buffer::format_zero_padding#14 printf_number_buffer::@3/(byte) printf_number_buffer::format_zero_padding#2 ) + (byte*) printf_number_buffer::buffer_digits#2 ← phi( printf_number_buffer::@19/(byte*) printf_number_buffer::buffer_digits#4 printf_number_buffer::@3/(byte*) printf_number_buffer::buffer_digits#5 ) + (byte*) printf_str::str#1 ← (byte*) printf_number_buffer::buffer_digits#2 + call printf_str + to:printf_number_buffer::@18 +printf_number_buffer::@18: scope:[printf_number_buffer] from printf_number_buffer::@4 + (signed byte) printf_number_buffer::padding#6 ← phi( printf_number_buffer::@4/(signed byte) printf_number_buffer::padding#11 ) + (byte) printf_number_buffer::format_justify_left#2 ← phi( printf_number_buffer::@4/(byte) printf_number_buffer::format_justify_left#6 ) + (byte) printf_number_buffer::format_zero_padding#3 ← phi( printf_number_buffer::@4/(byte) printf_number_buffer::format_zero_padding#9 ) + (bool~) printf_number_buffer::$29 ← (number) 0 != (byte) printf_number_buffer::format_zero_padding#3 + (bool~) printf_number_buffer::$13 ← ! (bool~) printf_number_buffer::$29 + (bool~) printf_number_buffer::$14 ← (byte) printf_number_buffer::format_justify_left#2 && (bool~) printf_number_buffer::$13 + (bool~) printf_number_buffer::$15 ← (bool~) printf_number_buffer::$14 && (signed byte) printf_number_buffer::padding#6 + (bool~) printf_number_buffer::$16 ← ! (bool~) printf_number_buffer::$15 + if((bool~) printf_number_buffer::$16) goto printf_number_buffer::@return + to:printf_number_buffer::@11 +printf_number_buffer::@10: scope:[printf_number_buffer] from printf_number_buffer::@3 + (byte) printf_number_buffer::format_justify_left#14 ← phi( printf_number_buffer::@3/(byte) printf_number_buffer::format_justify_left#10 ) + (byte) printf_number_buffer::format_zero_padding#17 ← phi( printf_number_buffer::@3/(byte) printf_number_buffer::format_zero_padding#2 ) + (byte*) printf_number_buffer::buffer_digits#8 ← phi( printf_number_buffer::@3/(byte*) printf_number_buffer::buffer_digits#5 ) + (signed byte) printf_number_buffer::padding#7 ← phi( printf_number_buffer::@3/(signed byte) printf_number_buffer::padding#5 ) + (byte) printf_padding::pad#1 ← (byte) '0' + (byte) printf_padding::length#1 ← (byte)(signed byte) printf_number_buffer::padding#7 + call printf_padding + to:printf_number_buffer::@19 +printf_number_buffer::@19: scope:[printf_number_buffer] from printf_number_buffer::@10 + (signed byte) printf_number_buffer::padding#14 ← phi( printf_number_buffer::@10/(signed byte) printf_number_buffer::padding#7 ) + (byte) printf_number_buffer::format_justify_left#9 ← phi( printf_number_buffer::@10/(byte) printf_number_buffer::format_justify_left#14 ) + (byte) printf_number_buffer::format_zero_padding#14 ← phi( printf_number_buffer::@10/(byte) printf_number_buffer::format_zero_padding#17 ) + (byte*) printf_number_buffer::buffer_digits#4 ← phi( printf_number_buffer::@10/(byte*) printf_number_buffer::buffer_digits#8 ) + to:printf_number_buffer::@4 +printf_number_buffer::@11: scope:[printf_number_buffer] from printf_number_buffer::@18 + (signed byte) printf_number_buffer::padding#8 ← phi( printf_number_buffer::@18/(signed byte) printf_number_buffer::padding#6 ) + (byte) printf_padding::pad#2 ← (byte) ' ' + (byte) printf_padding::length#2 ← (byte)(signed byte) printf_number_buffer::padding#8 + call printf_padding + to:printf_number_buffer::@20 +printf_number_buffer::@20: scope:[printf_number_buffer] from printf_number_buffer::@11 + to:printf_number_buffer::@return +printf_number_buffer::@return: scope:[printf_number_buffer] from printf_number_buffer::@18 printf_number_buffer::@20 + return + to:@return + +(void()) main() +main: scope:[main] from @29 + call printf_cls + to:main::@1 +main::@1: scope:[main] from main + (byte*) printf_str::str#2 ← (const byte*) main::str + call printf_str + to:main::@2 +main::@2: scope:[main] from main::@1 + (byte) printf_uchar::uvalue#0 ← (const byte) main::c + (byte) printf_uchar::format_min_length#0 ← (byte) 0 + (byte) printf_uchar::format_justify_left#0 ← (byte) 0 + (byte) printf_uchar::format_sign_always#0 ← (byte) 0 + (byte) printf_uchar::format_zero_padding#0 ← (byte) 0 + (byte) printf_uchar::format_radix#0 ← (const byte) DECIMAL + call printf_uchar + to:main::@3 +main::@3: scope:[main] from main::@2 + (byte*) printf_str::str#3 ← (const byte*) main::str1 + call printf_str + to:main::@4 +main::@4: scope:[main] from main::@3 + to:main::@return +main::@return: scope:[main] from main::@4 + return + to:@return +@29: scope:[] from @15 + call main + to:@30 +@30: scope:[] from @29 + to:@end +@end: scope:[] from @30 + +SYMBOL TABLE SSA +(label) @15 +(label) @29 +(label) @30 +(label) @begin +(label) @end +(const byte) BINARY = (number) 2 +(const byte) DECIMAL = (number) $a +(const byte*) DIGITS[] = (byte*) "0123456789abcdef"z +(const byte) HEXADECIMAL = (number) $10 +(const byte) OCTAL = (number) 8 +(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS = (byte) 1 +(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN = (byte) 0 +(const byte) RADIX::BINARY = (number) 2 +(const byte) RADIX::DECIMAL = (number) $a +(const byte) RADIX::HEXADECIMAL = (number) $10 +(const byte) RADIX::OCTAL = (number) 8 +(const byte*) RADIX_BINARY_VALUES_CHAR[] = { (byte) $80, (byte) $40, (byte) $20, (byte) $10, (byte) 8, (byte) 4, (byte) 2 } +(const byte*) RADIX_DECIMAL_VALUES_CHAR[] = { (byte) $64, (byte) $a } +(const byte*) RADIX_HEXADECIMAL_VALUES_CHAR[] = { (byte) $10 } +(const byte*) RADIX_OCTAL_VALUES_CHAR[] = { (byte) $40, (byte) 8 } +(void()) main() +(label) main::@1 +(label) main::@2 +(label) main::@3 +(label) main::@4 +(label) main::@return +(const byte) main::c = (byte) 7 +(const byte*) main::str[(byte) 1] = (byte*) "" +(const byte*) main::str1[(byte) 1] = (byte*) "" +(void*()) memcpy((void*) memcpy::destination , (void*) memcpy::source , (word) memcpy::num) +(byte*~) memcpy::$0 +(bool~) memcpy::$1 +(byte*~) memcpy::$2 +(label) memcpy::@1 +(label) memcpy::@2 +(label) memcpy::@3 +(label) memcpy::@return +(void*) memcpy::destination +(void*) memcpy::destination#0 +(void*) memcpy::destination#1 +(void*) memcpy::destination#2 +(void*) memcpy::destination#3 +(void*) memcpy::destination#4 +(byte*) memcpy::dst +(byte*) memcpy::dst#0 +(byte*) memcpy::dst#1 +(byte*) memcpy::dst#2 +(byte*) memcpy::dst#3 +(word) memcpy::num +(word) memcpy::num#0 +(word) memcpy::num#1 +(void*) memcpy::return +(void*) memcpy::return#0 +(void*) memcpy::return#1 +(void*) memcpy::return#2 +(void*) memcpy::return#3 +(void*) memcpy::source +(void*) memcpy::source#0 +(void*) memcpy::source#1 +(byte*) memcpy::src +(byte*) memcpy::src#0 +(byte*) memcpy::src#1 +(byte*) memcpy::src#2 +(byte*) memcpy::src#3 +(byte*) memcpy::src_end +(byte*) memcpy::src_end#0 +(byte*) memcpy::src_end#1 +(byte*) memcpy::src_end#2 +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +(bool~) memset::$0 +(bool~) memset::$1 +(byte*~) memset::$2 +(bool~) memset::$3 +(byte*~) memset::$4 +(label) memset::@1 +(label) memset::@2 +(label) memset::@4 +(label) memset::@5 +(label) memset::@return +(byte) memset::c +(byte) memset::c#0 +(byte) memset::c#1 +(byte) memset::c#2 +(byte) memset::c#3 +(byte) memset::c#4 +(byte) memset::c#5 +(byte*) memset::dst +(byte*) memset::dst#0 +(byte*) memset::dst#1 +(byte*) memset::dst#2 +(byte*) memset::dst#3 +(byte*) memset::end +(byte*) memset::end#0 +(byte*) memset::end#1 +(byte*) memset::end#2 +(word) memset::num +(word) memset::num#0 +(word) memset::num#1 +(word) memset::num#2 +(word) memset::num#3 +(void*) memset::return +(void*) memset::return#0 +(void*) memset::return#1 +(void*) memset::return#2 +(void*) memset::return#3 +(void*) memset::return#4 +(void*) memset::str +(void*) memset::str#0 +(void*) memset::str#1 +(void*) memset::str#2 +(void*) memset::str#3 +(void*) memset::str#4 +(void*) memset::str#5 +(void*) memset::str#6 +(struct printf_buffer_number) printf_buffer loadstore = {} +(const byte*) printf_buffer_number::digits[(number) $b] = { fill( $b, 0) } +(byte) printf_buffer_number::sign +(void()) printf_char((byte) printf_char::ch) +(byte*~) printf_char::$0 +(bool~) printf_char::$1 +(bool~) printf_char::$2 +(byte*~) printf_char::$3 +(byte*~) printf_char::$5 +(byte*~) printf_char::$6 +(byte*~) printf_char::$8 +(label) printf_char::@2 +(label) printf_char::@3 +(label) printf_char::@4 +(label) printf_char::@return +(byte) printf_char::ch +(byte) printf_char::ch#0 +(byte) printf_char::ch#1 +(byte) printf_char::ch#2 +(byte) printf_char::ch#3 +(byte*) printf_char_cursor loadstore +(void()) printf_cls() +(label) printf_cls::@1 +(label) printf_cls::@return +(byte) printf_format_number::justify_left +(byte) printf_format_number::min_length +(byte) printf_format_number::radix +(byte) printf_format_number::sign_always +(byte) printf_format_number::zero_padding +(byte) printf_format_string::justify_left +(byte) printf_format_string::min_length +(byte*) printf_line_cursor loadstore +(void()) printf_ln() +(bool~) printf_ln::$0 +(label) printf_ln::@1 +(label) printf_ln::@2 +(label) printf_ln::@return +(void()) printf_number_buffer((byte) printf_number_buffer::buffer_sign , (byte*) printf_number_buffer::buffer_digits , (byte) printf_number_buffer::format_min_length , (byte) printf_number_buffer::format_justify_left , (byte) printf_number_buffer::format_sign_always , (byte) printf_number_buffer::format_zero_padding , (byte) printf_number_buffer::format_radix) +(bool~) printf_number_buffer::$0 +(bool~) printf_number_buffer::$1 +(bool~) printf_number_buffer::$10 +(bool~) printf_number_buffer::$13 +(bool~) printf_number_buffer::$14 +(bool~) printf_number_buffer::$15 +(bool~) printf_number_buffer::$16 +(word~) printf_number_buffer::$18 +(bool~) printf_number_buffer::$19 +(bool~) printf_number_buffer::$2 +(signed byte~) printf_number_buffer::$20 +(bool~) printf_number_buffer::$21 +(bool~) printf_number_buffer::$22 +(signed byte~) printf_number_buffer::$23 +(bool~) printf_number_buffer::$24 +(bool~) printf_number_buffer::$25 +(bool~) printf_number_buffer::$26 +(bool~) printf_number_buffer::$27 +(bool~) printf_number_buffer::$28 +(bool~) printf_number_buffer::$29 +(bool~) printf_number_buffer::$3 +(bool~) printf_number_buffer::$4 +(bool~) printf_number_buffer::$5 +(bool~) printf_number_buffer::$7 +(bool~) printf_number_buffer::$9 +(label) printf_number_buffer::@1 +(label) printf_number_buffer::@10 +(label) printf_number_buffer::@11 +(label) printf_number_buffer::@12 +(label) printf_number_buffer::@14 +(label) printf_number_buffer::@15 +(label) printf_number_buffer::@16 +(label) printf_number_buffer::@17 +(label) printf_number_buffer::@18 +(label) printf_number_buffer::@19 +(label) printf_number_buffer::@2 +(label) printf_number_buffer::@20 +(label) printf_number_buffer::@3 +(label) printf_number_buffer::@4 +(label) printf_number_buffer::@6 +(label) printf_number_buffer::@7 +(label) printf_number_buffer::@8 +(label) printf_number_buffer::@9 +(label) printf_number_buffer::@return +(struct printf_buffer_number) printf_number_buffer::buffer +(byte*) printf_number_buffer::buffer_digits +(byte*) printf_number_buffer::buffer_digits#0 +(byte*) printf_number_buffer::buffer_digits#1 +(byte*) printf_number_buffer::buffer_digits#10 +(byte*) printf_number_buffer::buffer_digits#11 +(byte*) printf_number_buffer::buffer_digits#12 +(byte*) printf_number_buffer::buffer_digits#13 +(byte*) printf_number_buffer::buffer_digits#14 +(byte*) printf_number_buffer::buffer_digits#15 +(byte*) printf_number_buffer::buffer_digits#16 +(byte*) printf_number_buffer::buffer_digits#2 +(byte*) printf_number_buffer::buffer_digits#3 +(byte*) printf_number_buffer::buffer_digits#4 +(byte*) printf_number_buffer::buffer_digits#5 +(byte*) printf_number_buffer::buffer_digits#6 +(byte*) printf_number_buffer::buffer_digits#7 +(byte*) printf_number_buffer::buffer_digits#8 +(byte*) printf_number_buffer::buffer_digits#9 +(byte) printf_number_buffer::buffer_sign +(byte) printf_number_buffer::buffer_sign#0 +(byte) printf_number_buffer::buffer_sign#1 +(byte) printf_number_buffer::buffer_sign#10 +(byte) printf_number_buffer::buffer_sign#11 +(byte) printf_number_buffer::buffer_sign#2 +(byte) printf_number_buffer::buffer_sign#3 +(byte) printf_number_buffer::buffer_sign#4 +(byte) printf_number_buffer::buffer_sign#5 +(byte) printf_number_buffer::buffer_sign#6 +(byte) printf_number_buffer::buffer_sign#7 +(byte) printf_number_buffer::buffer_sign#8 +(byte) printf_number_buffer::buffer_sign#9 +(struct printf_format_number) printf_number_buffer::format +(byte) printf_number_buffer::format_justify_left +(byte) printf_number_buffer::format_justify_left#0 +(byte) printf_number_buffer::format_justify_left#1 +(byte) printf_number_buffer::format_justify_left#10 +(byte) printf_number_buffer::format_justify_left#11 +(byte) printf_number_buffer::format_justify_left#12 +(byte) printf_number_buffer::format_justify_left#13 +(byte) printf_number_buffer::format_justify_left#14 +(byte) printf_number_buffer::format_justify_left#15 +(byte) printf_number_buffer::format_justify_left#16 +(byte) printf_number_buffer::format_justify_left#17 +(byte) printf_number_buffer::format_justify_left#2 +(byte) printf_number_buffer::format_justify_left#3 +(byte) printf_number_buffer::format_justify_left#4 +(byte) printf_number_buffer::format_justify_left#5 +(byte) printf_number_buffer::format_justify_left#6 +(byte) printf_number_buffer::format_justify_left#7 +(byte) printf_number_buffer::format_justify_left#8 +(byte) printf_number_buffer::format_justify_left#9 +(byte) printf_number_buffer::format_min_length +(byte) printf_number_buffer::format_min_length#0 +(byte) printf_number_buffer::format_min_length#1 +(byte) printf_number_buffer::format_min_length#2 +(byte) printf_number_buffer::format_min_length#3 +(byte) printf_number_buffer::format_min_length#4 +(byte) printf_number_buffer::format_min_length#5 +(byte) printf_number_buffer::format_radix +(byte) printf_number_buffer::format_radix#0 +(byte) printf_number_buffer::format_sign_always +(byte) printf_number_buffer::format_sign_always#0 +(byte) printf_number_buffer::format_zero_padding +(byte) printf_number_buffer::format_zero_padding#0 +(byte) printf_number_buffer::format_zero_padding#1 +(byte) printf_number_buffer::format_zero_padding#10 +(byte) printf_number_buffer::format_zero_padding#11 +(byte) printf_number_buffer::format_zero_padding#12 +(byte) printf_number_buffer::format_zero_padding#13 +(byte) printf_number_buffer::format_zero_padding#14 +(byte) printf_number_buffer::format_zero_padding#15 +(byte) printf_number_buffer::format_zero_padding#16 +(byte) printf_number_buffer::format_zero_padding#17 +(byte) printf_number_buffer::format_zero_padding#2 +(byte) printf_number_buffer::format_zero_padding#3 +(byte) printf_number_buffer::format_zero_padding#4 +(byte) printf_number_buffer::format_zero_padding#5 +(byte) printf_number_buffer::format_zero_padding#6 +(byte) printf_number_buffer::format_zero_padding#7 +(byte) printf_number_buffer::format_zero_padding#8 +(byte) printf_number_buffer::format_zero_padding#9 +(signed byte) printf_number_buffer::len +(signed byte) printf_number_buffer::len#0 +(signed byte) printf_number_buffer::len#1 +(signed byte) printf_number_buffer::len#2 +(signed byte) printf_number_buffer::len#3 +(signed byte) printf_number_buffer::padding +(signed byte) printf_number_buffer::padding#0 +(signed byte) printf_number_buffer::padding#1 +(signed byte) printf_number_buffer::padding#10 +(signed byte) printf_number_buffer::padding#11 +(signed byte) printf_number_buffer::padding#12 +(signed byte) printf_number_buffer::padding#13 +(signed byte) printf_number_buffer::padding#14 +(signed byte) printf_number_buffer::padding#2 +(signed byte) printf_number_buffer::padding#3 +(signed byte) printf_number_buffer::padding#4 +(signed byte) printf_number_buffer::padding#5 +(signed byte) printf_number_buffer::padding#6 +(signed byte) printf_number_buffer::padding#7 +(signed byte) printf_number_buffer::padding#8 +(signed byte) printf_number_buffer::padding#9 +(void()) printf_padding((byte) printf_padding::pad , (byte) printf_padding::length) +(bool~) printf_padding::$0 +(label) printf_padding::@1 +(label) printf_padding::@2 +(label) printf_padding::@7 +(label) printf_padding::@return +(byte) printf_padding::i +(byte) printf_padding::i#0 +(byte) printf_padding::i#1 +(byte) printf_padding::i#2 +(byte) printf_padding::i#3 +(byte) printf_padding::i#4 +(byte) printf_padding::length +(byte) printf_padding::length#0 +(byte) printf_padding::length#1 +(byte) printf_padding::length#2 +(byte) printf_padding::length#3 +(byte) printf_padding::length#4 +(byte) printf_padding::length#5 +(byte) printf_padding::length#6 +(byte) printf_padding::pad +(byte) printf_padding::pad#0 +(byte) printf_padding::pad#1 +(byte) printf_padding::pad#2 +(byte) printf_padding::pad#3 +(byte) printf_padding::pad#4 +(byte) printf_padding::pad#5 +(byte) printf_padding::pad#6 +(const byte*) printf_screen = (byte*)(number) $400 +(void()) printf_str((byte*) printf_str::str) +(bool~) printf_str::$0 +(bool~) printf_str::$1 +(bool~) printf_str::$2 +(label) printf_str::@1 +(label) printf_str::@12 +(label) printf_str::@15 +(label) printf_str::@16 +(label) printf_str::@2 +(label) printf_str::@4 +(label) printf_str::@6 +(label) printf_str::@return +(byte) printf_str::ch +(byte) printf_str::ch#0 +(byte) printf_str::ch#1 +(byte) printf_str::ch#2 +(byte*) printf_str::str +(byte*) printf_str::str#0 +(byte*) printf_str::str#1 +(byte*) printf_str::str#10 +(byte*) printf_str::str#11 +(byte*) printf_str::str#2 +(byte*) printf_str::str#3 +(byte*) printf_str::str#4 +(byte*) printf_str::str#5 +(byte*) printf_str::str#6 +(byte*) printf_str::str#7 +(byte*) printf_str::str#8 +(byte*) printf_str::str#9 +(void()) printf_uchar((byte) printf_uchar::uvalue , (byte) printf_uchar::format_min_length , (byte) printf_uchar::format_justify_left , (byte) printf_uchar::format_sign_always , (byte) printf_uchar::format_zero_padding , (byte) printf_uchar::format_radix) +(number~) printf_uchar::$0 +(byte~) printf_uchar::$1 +(number~) printf_uchar::$2 +(bool~) printf_uchar::$5 +(label) printf_uchar::@1 +(label) printf_uchar::@2 +(label) printf_uchar::@3 +(label) printf_uchar::@6 +(label) printf_uchar::@7 +(label) printf_uchar::@return +(struct printf_format_number) printf_uchar::format +(byte) printf_uchar::format_justify_left +(byte) printf_uchar::format_justify_left#0 +(byte) printf_uchar::format_justify_left#1 +(byte) printf_uchar::format_justify_left#2 +(byte) printf_uchar::format_justify_left#3 +(byte) printf_uchar::format_justify_left#4 +(byte) printf_uchar::format_justify_left#5 +(byte) printf_uchar::format_min_length +(byte) printf_uchar::format_min_length#0 +(byte) printf_uchar::format_min_length#1 +(byte) printf_uchar::format_min_length#2 +(byte) printf_uchar::format_min_length#3 +(byte) printf_uchar::format_min_length#4 +(byte) printf_uchar::format_min_length#5 +(byte) printf_uchar::format_radix +(byte) printf_uchar::format_radix#0 +(byte) printf_uchar::format_radix#1 +(byte) printf_uchar::format_radix#2 +(byte) printf_uchar::format_radix#3 +(byte) printf_uchar::format_radix#4 +(byte) printf_uchar::format_radix#5 +(byte) printf_uchar::format_sign_always +(byte) printf_uchar::format_sign_always#0 +(byte) printf_uchar::format_sign_always#1 +(byte) printf_uchar::format_sign_always#2 +(byte) printf_uchar::format_sign_always#3 +(byte) printf_uchar::format_sign_always#4 +(byte) printf_uchar::format_sign_always#5 +(byte) printf_uchar::format_zero_padding +(byte) printf_uchar::format_zero_padding#0 +(byte) printf_uchar::format_zero_padding#1 +(byte) printf_uchar::format_zero_padding#2 +(byte) printf_uchar::format_zero_padding#3 +(byte) printf_uchar::format_zero_padding#4 +(byte) printf_uchar::format_zero_padding#5 +(byte) printf_uchar::uvalue +(byte) printf_uchar::uvalue#0 +(byte) printf_uchar::uvalue#1 +(byte) printf_uchar::uvalue#2 +(byte) printf_uchar::uvalue#3 +(byte) printf_uchar::uvalue#4 +(word()) strlen((byte*) strlen::str) +(bool~) strlen::$0 +(label) strlen::@1 +(label) strlen::@2 +(label) strlen::@3 +(label) strlen::@return +(word) strlen::len +(word) strlen::len#0 +(word) strlen::len#1 +(word) strlen::len#2 +(word) strlen::len#3 +(word) strlen::len#4 +(word) strlen::return +(word) strlen::return#0 +(word) strlen::return#1 +(word) strlen::return#2 +(word) strlen::return#3 +(word) strlen::return#4 +(byte*) strlen::str +(byte*) strlen::str#0 +(byte*) strlen::str#1 +(byte*) strlen::str#2 +(byte*) strlen::str#3 +(byte*) strlen::str#4 +(void()) uctoa((byte) uctoa::value , (byte*) uctoa::buffer , (byte) uctoa::radix) +(bool~) uctoa::$0 +(bool~) uctoa::$1 +(byte~) uctoa::$10 +(bool~) uctoa::$2 +(bool~) uctoa::$3 +(number~) uctoa::$4 +(bool~) uctoa::$5 +(bool~) uctoa::$6 +(bool~) uctoa::$7 +(bool~) uctoa::$8 +(byte~) uctoa::$9 +(label) uctoa::@1 +(label) uctoa::@10 +(label) uctoa::@11 +(label) uctoa::@12 +(label) uctoa::@18 +(label) uctoa::@19 +(label) uctoa::@2 +(label) uctoa::@20 +(label) uctoa::@21 +(label) uctoa::@24 +(label) uctoa::@26 +(label) uctoa::@3 +(label) uctoa::@4 +(label) uctoa::@8 +(label) uctoa::@9 +(label) uctoa::@return +(byte*) uctoa::buffer +(byte*) uctoa::buffer#0 +(byte*) uctoa::buffer#1 +(byte*) uctoa::buffer#10 +(byte*) uctoa::buffer#11 +(byte*) uctoa::buffer#12 +(byte*) uctoa::buffer#13 +(byte*) uctoa::buffer#14 +(byte*) uctoa::buffer#15 +(byte*) uctoa::buffer#16 +(byte*) uctoa::buffer#17 +(byte*) uctoa::buffer#18 +(byte*) uctoa::buffer#19 +(byte*) uctoa::buffer#2 +(byte*) uctoa::buffer#20 +(byte*) uctoa::buffer#21 +(byte*) uctoa::buffer#3 +(byte*) uctoa::buffer#4 +(byte*) uctoa::buffer#5 +(byte*) uctoa::buffer#6 +(byte*) uctoa::buffer#7 +(byte*) uctoa::buffer#8 +(byte*) uctoa::buffer#9 +(byte) uctoa::digit +(byte) uctoa::digit#0 +(byte) uctoa::digit#1 +(byte) uctoa::digit#2 +(byte) uctoa::digit#3 +(byte) uctoa::digit#4 +(byte) uctoa::digit#5 +(byte) uctoa::digit#6 +(byte) uctoa::digit_value +(byte) uctoa::digit_value#0 +(byte) uctoa::digit_value#1 +(byte*) uctoa::digit_values +(byte*) uctoa::digit_values#0 +(byte*) uctoa::digit_values#1 +(byte*) uctoa::digit_values#10 +(byte*) uctoa::digit_values#2 +(byte*) uctoa::digit_values#3 +(byte*) uctoa::digit_values#4 +(byte*) uctoa::digit_values#5 +(byte*) uctoa::digit_values#6 +(byte*) uctoa::digit_values#7 +(byte*) uctoa::digit_values#8 +(byte*) uctoa::digit_values#9 +(byte) uctoa::max_digits +(byte) uctoa::max_digits#0 +(byte) uctoa::max_digits#1 +(byte) uctoa::max_digits#10 +(byte) uctoa::max_digits#2 +(byte) uctoa::max_digits#3 +(byte) uctoa::max_digits#4 +(byte) uctoa::max_digits#5 +(byte) uctoa::max_digits#6 +(byte) uctoa::max_digits#7 +(byte) uctoa::max_digits#8 +(byte) uctoa::max_digits#9 +(byte) uctoa::radix +(byte) uctoa::radix#0 +(byte) uctoa::radix#1 +(byte) uctoa::radix#2 +(byte) uctoa::radix#3 +(byte) uctoa::radix#4 +(byte) uctoa::started +(byte) uctoa::started#0 +(byte) uctoa::started#1 +(byte) uctoa::started#2 +(byte) uctoa::started#3 +(byte) uctoa::started#4 +(byte) uctoa::value +(byte) uctoa::value#0 +(byte) uctoa::value#1 +(byte) uctoa::value#10 +(byte) uctoa::value#11 +(byte) uctoa::value#12 +(byte) uctoa::value#13 +(byte) uctoa::value#14 +(byte) uctoa::value#15 +(byte) uctoa::value#2 +(byte) uctoa::value#3 +(byte) uctoa::value#4 +(byte) uctoa::value#5 +(byte) uctoa::value#6 +(byte) uctoa::value#7 +(byte) uctoa::value#8 +(byte) uctoa::value#9 +(byte()) uctoa_append((byte*) uctoa_append::buffer , (byte) uctoa_append::value , (byte) uctoa_append::sub) +(bool~) uctoa_append::$0 +(label) uctoa_append::@1 +(label) uctoa_append::@2 +(label) uctoa_append::@3 +(label) uctoa_append::@return +(byte*) uctoa_append::buffer +(byte*) uctoa_append::buffer#0 +(byte*) uctoa_append::buffer#1 +(byte*) uctoa_append::buffer#2 +(byte*) uctoa_append::buffer#3 +(byte*) uctoa_append::buffer#4 +(byte) uctoa_append::digit +(byte) uctoa_append::digit#0 +(byte) uctoa_append::digit#1 +(byte) uctoa_append::digit#2 +(byte) uctoa_append::digit#3 +(byte) uctoa_append::digit#4 +(byte) uctoa_append::return +(byte) uctoa_append::return#0 +(byte) uctoa_append::return#1 +(byte) uctoa_append::return#2 +(byte) uctoa_append::return#3 +(byte) uctoa_append::return#4 +(byte) uctoa_append::sub +(byte) uctoa_append::sub#0 +(byte) uctoa_append::sub#1 +(byte) uctoa_append::sub#2 +(byte) uctoa_append::sub#3 +(byte) uctoa_append::value +(byte) uctoa_append::value#0 +(byte) uctoa_append::value#1 +(byte) uctoa_append::value#2 +(byte) uctoa_append::value#3 +(byte) uctoa_append::value#4 +(byte) uctoa_append::value#5 + +Adding number conversion cast (unumber) 0 in (bool~) memset::$0 ← (word) memset::num#2 > (number) 0 +Adding number conversion cast (unumber) 0 in (bool~) strlen::$0 ← (number) 0 != *((byte*) strlen::str#2) +Adding number conversion cast (unumber) 3 in (byte) uctoa::max_digits#1 ← (number) 3 +Adding number conversion cast (unumber) 2 in (byte) uctoa::max_digits#2 ← (number) 2 +Adding number conversion cast (unumber) 3 in (byte) uctoa::max_digits#3 ← (number) 3 +Adding number conversion cast (unumber) 8 in (byte) uctoa::max_digits#4 ← (number) 8 +Adding number conversion cast (unumber) 0 in *((byte*) uctoa::buffer#2) ← (number) 0 +Adding number conversion cast (unumber) 1 in (number~) uctoa::$4 ← (byte) uctoa::max_digits#5 - (number) 1 +Adding number conversion cast (unumber) uctoa::$4 in (number~) uctoa::$4 ← (byte) uctoa::max_digits#5 - (unumber)(number) 1 +Adding number conversion cast (unumber) 0 in *((byte*) uctoa::buffer#3) ← (number) 0 +Adding number conversion cast (unumber) 1 in (byte) uctoa::started#1 ← (number) 1 +Adding number conversion cast (unumber) $28*$19 in (word) memset::num#0 ← (number) $28*(number) $19 +Adding number conversion cast (unumber) $28*$19 in (byte*~) printf_char::$0 ← (const byte*) printf_screen + (number) $28*(number) $19 +Adding number conversion cast (unumber) $28 in (byte*~) printf_char::$3 ← (const byte*) printf_screen + (number) $28 +Adding number conversion cast (unumber) $28*$19-$28 in (word) memcpy::num#0 ← (number) $28*(number) $19-(number) $28 +Adding number conversion cast (unumber) $28*$19 in (byte*~) printf_char::$5 ← (const byte*) printf_screen + (number) $28*(number) $19 +Adding number conversion cast (unumber) $28 in (byte*~) printf_char::$6 ← (byte*~) printf_char::$5 - (number) $28 +Adding number conversion cast (unumber) $28 in (word) memset::num#1 ← (number) $28 +Adding number conversion cast (unumber) $28 in (byte*~) printf_char::$8 ← (byte*) printf_char_cursor - (number) $28 +Adding number conversion cast (unumber) $28 in (byte*) printf_line_cursor ← (byte*) printf_line_cursor + (number) $28 +Adding number conversion cast (unumber) 0 in (bool~) printf_str::$0 ← (byte) printf_str::ch#0 == (number) 0 +Adding number conversion cast (unumber) 0 in (bool~) printf_uchar::$5 ← (number) 0 != (byte) printf_uchar::format_sign_always#1 +Adding number conversion cast (unumber) printf_uchar::$2 in (byte) printf_uchar::format_zero_padding#2 ← phi( printf_uchar::@1/(byte) printf_uchar::format_zero_padding#3 printf_uchar::@2/(byte) printf_uchar::format_zero_padding#4 ) + (byte) printf_uchar::format_sign_always#3 ← phi( printf_uchar::@1/(byte) printf_uchar::format_sign_always#4 printf_uchar::@2/(byte) printf_uchar::format_sign_always#5 ) + (byte) printf_uchar::format_justify_left#2 ← phi( printf_uchar::@1/(byte) printf_uchar::format_justify_left#3 printf_uchar::@2/(byte) printf_uchar::format_justify_left#4 ) + (byte) printf_uchar::format_min_length#2 ← phi( printf_uchar::@1/(byte) printf_uchar::format_min_length#3 printf_uchar::@2/(byte) printf_uchar::format_min_length#4 ) + (byte) printf_uchar::format_radix#1 ← phi( printf_uchar::@1/(byte) printf_uchar::format_radix#3 printf_uchar::@2/(byte) printf_uchar::format_radix#4 ) + (byte) printf_uchar::uvalue#1 ← phi( printf_uchar::@1/(byte) printf_uchar::uvalue#2 printf_uchar::@2/(byte) printf_uchar::uvalue#3 ) + (number~) printf_uchar::$2 ← phi( printf_uchar::@1/(byte~) printf_uchar::$1 printf_uchar::@2/(number~) printf_uchar::$0 ) +Adding number conversion cast (unumber) printf_uchar::$0 in (byte) printf_uchar::format_zero_padding#2 ← phi( printf_uchar::@1/(byte) printf_uchar::format_zero_padding#3 printf_uchar::@2/(byte) printf_uchar::format_zero_padding#4 ) + (byte) printf_uchar::format_sign_always#3 ← phi( printf_uchar::@1/(byte) printf_uchar::format_sign_always#4 printf_uchar::@2/(byte) printf_uchar::format_sign_always#5 ) + (byte) printf_uchar::format_justify_left#2 ← phi( printf_uchar::@1/(byte) printf_uchar::format_justify_left#3 printf_uchar::@2/(byte) printf_uchar::format_justify_left#4 ) + (byte) printf_uchar::format_min_length#2 ← phi( printf_uchar::@1/(byte) printf_uchar::format_min_length#3 printf_uchar::@2/(byte) printf_uchar::format_min_length#4 ) + (byte) printf_uchar::format_radix#1 ← phi( printf_uchar::@1/(byte) printf_uchar::format_radix#3 printf_uchar::@2/(byte) printf_uchar::format_radix#4 ) + (byte) printf_uchar::uvalue#1 ← phi( printf_uchar::@1/(byte) printf_uchar::uvalue#2 printf_uchar::@2/(byte) printf_uchar::uvalue#3 ) + (unumber~) printf_uchar::$2 ← phi( printf_uchar::@1/(byte~) printf_uchar::$1 printf_uchar::@2/(number~) printf_uchar::$0 ) +Adding number conversion cast (unumber) 0 in (bool~) printf_number_buffer::$24 ← (number) 0 != (byte) printf_number_buffer::format_min_length#1 +Adding number conversion cast (unumber) 0 in (bool~) printf_number_buffer::$25 ← (number) 0 != (byte) printf_number_buffer::format_justify_left#1 +Adding number conversion cast (unumber) 0 in (bool~) printf_number_buffer::$26 ← (number) 0 != (byte) printf_number_buffer::format_zero_padding#1 +Adding number conversion cast (unumber) 0 in (bool~) printf_number_buffer::$27 ← (number) 0 != (byte) printf_number_buffer::buffer_sign#1 +Adding number conversion cast (snumber) 0 in (bool~) printf_number_buffer::$21 ← (signed byte) printf_number_buffer::padding#1 < (number) 0 +Adding number conversion cast (snumber) 0 in (signed byte) printf_number_buffer::padding#2 ← (number) 0 +Adding number conversion cast (unumber) 0 in (bool~) printf_number_buffer::$28 ← (number) 0 != (byte) printf_number_buffer::buffer_sign#2 +Adding number conversion cast (unumber) 0 in (bool~) printf_number_buffer::$29 ← (number) 0 != (byte) printf_number_buffer::format_zero_padding#3 +Successful SSA optimization PassNAddNumberTypeConversions +Adding number conversion cast (unumber) 0 in (unumber~) printf_uchar::$0 ← (number) 0 +Successful SSA optimization PassNAddNumberTypeConversions +Inlining cast (byte*) memcpy::src#0 ← (byte*)(void*) memcpy::source#1 +Inlining cast (byte*) memcpy::dst#0 ← (byte*)(void*) memcpy::destination#1 +Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3 +Inlining cast (byte) uctoa::max_digits#1 ← (unumber)(number) 3 +Inlining cast (byte) uctoa::max_digits#2 ← (unumber)(number) 2 +Inlining cast (byte) uctoa::max_digits#3 ← (unumber)(number) 3 +Inlining cast (byte) uctoa::max_digits#4 ← (unumber)(number) 8 +Inlining cast *((byte*) uctoa::buffer#2) ← (unumber)(number) 0 +Inlining cast *((byte*) uctoa::buffer#3) ← (unumber)(number) 0 +Inlining cast (byte) uctoa::started#1 ← (unumber)(number) 1 +Inlining cast (word) memset::num#0 ← (unumber)(number) $28*(number) $19 +Inlining cast (word) memcpy::num#0 ← (unumber)(number) $28*(number) $19-(number) $28 +Inlining cast (word) memset::num#1 ← (unumber)(number) $28 +Inlining cast (unumber~) printf_uchar::$0 ← (unumber)(number) 0 +Inlining cast (signed byte) printf_number_buffer::padding#2 ← (snumber)(number) 0 +Successful SSA optimization Pass2InlineCast +Simplifying constant pointer cast (byte*) 1024 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 3 +Simplifying constant integer cast 2 +Simplifying constant integer cast 3 +Simplifying constant integer cast 8 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast (byte) uctoa::value#3 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant pointer cast (byte*) 1024 +Simplifying constant pointer cast (byte*) 1024 +Simplifying constant integer cast $28 +Simplifying constant integer cast $28 +Simplifying constant integer cast $28 +Simplifying constant integer cast $28 +Simplifying constant integer cast $28 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Successful SSA optimization PassNCastSimplification +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) $28 +Finalized unsigned number type (byte) $28 +Finalized unsigned number type (byte) $28 +Finalized unsigned number type (byte) $28 +Finalized unsigned number type (byte) $28 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized signed number type (signed byte) 0 +Finalized signed number type (signed byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Successful SSA optimization PassNFinalizeNumberTypeConversions +Inferred type updated to byte in (unumber~) uctoa::$4 ← (byte) uctoa::max_digits#5 - (byte) 1 +Inferred type updated to byte in (unumber~) printf_uchar::$0 ← (byte) 0 +Inferred type updated to byte for (unumber~) printf_uchar::$2 +Inversing boolean not [20] (bool~) memset::$1 ← (word) memset::num#2 <= (byte) 0 from [19] (bool~) memset::$0 ← (word) memset::num#2 > (byte) 0 +Inversing boolean not [146] (bool~) printf_char::$2 ← (byte*) printf_char_cursor < (byte*~) printf_char::$0 from [145] (bool~) printf_char::$1 ← (byte*) printf_char_cursor >= (byte*~) printf_char::$0 +Inversing boolean not [188] (bool~) printf_str::$1 ← (byte) printf_str::ch#0 != (byte) 0 from [187] (bool~) printf_str::$0 ← (byte) printf_str::ch#0 == (byte) 0 +Inversing boolean not [227] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#1 from [226] (bool~) printf_number_buffer::$24 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#1 +Inversing boolean not [231] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#1 from [230] (bool~) printf_number_buffer::$25 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#1 +Inversing boolean not [233] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#1 from [232] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#1 +Inversing boolean not [246] (bool~) printf_number_buffer::$19 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#1 from [245] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#1 +Inversing boolean not [253] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [252] (bool~) printf_number_buffer::$21 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0 +Inversing boolean not [261] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [260] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2 +Inversing boolean not [281] (bool~) printf_number_buffer::$13 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [280] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3 +Successful SSA optimization Pass2UnaryNotSimplification +Alias candidate removed (volatile)printf_char_cursor = printf_char::$8 +Alias memcpy::src_end#0 = memcpy::$0 +Alias memcpy::src#2 = memcpy::src#3 +Alias memcpy::dst#2 = memcpy::dst#3 +Alias memcpy::src_end#1 = memcpy::src_end#2 +Alias memcpy::destination#2 = memcpy::destination#4 memcpy::destination#3 memcpy::return#0 memcpy::return#3 memcpy::return#1 +Alias memset::return#0 = memset::str#2 memset::return#4 memset::return#1 +Alias memset::str#3 = memset::str#4 +Alias memset::num#2 = memset::num#3 +Alias memset::c#4 = memset::c#5 +Alias memset::end#0 = memset::$2 +Alias memset::c#2 = memset::c#3 +Alias memset::dst#2 = memset::dst#3 +Alias memset::end#1 = memset::end#2 +Alias memset::str#5 = memset::str#6 +Alias strlen::len#2 = strlen::len#4 strlen::len#3 strlen::return#0 strlen::return#3 strlen::return#1 +Alias strlen::str#2 = strlen::str#3 +Alias uctoa::value#10 = uctoa::value#8 uctoa::value#12 uctoa::value#13 uctoa::value#9 uctoa::value#14 uctoa::value#15 uctoa::value#11 +Alias uctoa::buffer#10 = uctoa::buffer#17 uctoa::buffer#21 uctoa::buffer#16 uctoa::buffer#18 uctoa::buffer#13 uctoa::buffer#19 uctoa::buffer#20 uctoa::buffer#6 +Alias uctoa::radix#1 = uctoa::radix#2 uctoa::radix#3 uctoa::radix#4 +Alias uctoa::digit_values#10 = uctoa::digit_values#5 uctoa::digit_values#6 uctoa::digit_values#9 +Alias uctoa::digit#2 = uctoa::digit#3 uctoa::digit#6 uctoa::digit#5 +Alias uctoa::value#2 = uctoa::value#5 uctoa::value#3 uctoa::$10 uctoa::value#4 +Alias uctoa::started#2 = uctoa::started#3 +Alias uctoa::buffer#11 = uctoa::buffer#12 uctoa::buffer#7 uctoa::buffer#8 uctoa::buffer#9 +Alias uctoa::max_digits#10 = uctoa::max_digits#8 uctoa::max_digits#5 uctoa::max_digits#9 +Alias uctoa::digit_value#0 = uctoa::digit_value#1 +Alias uctoa_append::return#0 = uctoa_append::return#3 +Alias uctoa::value#0 = uctoa::$9 +Alias uctoa_append::digit#2 = uctoa_append::digit#4 uctoa_append::digit#3 +Alias uctoa_append::value#2 = uctoa_append::value#3 uctoa_append::value#4 uctoa_append::return#1 uctoa_append::return#4 uctoa_append::return#2 +Alias uctoa_append::sub#1 = uctoa_append::sub#2 +Alias uctoa_append::buffer#1 = uctoa_append::buffer#4 uctoa_append::buffer#2 +Alias printf_padding::pad#3 = printf_padding::pad#4 printf_padding::pad#6 +Alias printf_padding::i#2 = printf_padding::i#4 printf_padding::i#3 +Alias printf_padding::length#3 = printf_padding::length#6 printf_padding::length#5 +Alias printf_str::str#4 = printf_str::str#5 +Alias printf_str::ch#0 = printf_str::ch#1 printf_str::ch#2 +Alias printf_str::str#0 = printf_str::str#11 printf_str::str#9 printf_str::str#7 printf_str::str#10 printf_str::str#8 +Alias printf_uchar::uvalue#2 = printf_uchar::uvalue#4 printf_uchar::uvalue#3 +Alias printf_uchar::format_radix#3 = printf_uchar::format_radix#5 printf_uchar::format_radix#4 +Alias printf_uchar::format_min_length#3 = printf_uchar::format_min_length#5 printf_uchar::format_min_length#4 +Alias printf_uchar::format_justify_left#3 = printf_uchar::format_justify_left#5 printf_uchar::format_justify_left#4 +Alias printf_uchar::format_sign_always#1 = printf_uchar::format_sign_always#4 printf_uchar::format_sign_always#5 +Alias printf_uchar::format_zero_padding#3 = printf_uchar::format_zero_padding#5 printf_uchar::format_zero_padding#4 +Alias printf_uchar::format_min_length#1 = printf_uchar::format_min_length#2 +Alias printf_uchar::format_justify_left#1 = printf_uchar::format_justify_left#2 +Alias printf_uchar::format_sign_always#2 = printf_uchar::format_sign_always#3 +Alias printf_uchar::format_zero_padding#1 = printf_uchar::format_zero_padding#2 +Alias printf_uchar::format_radix#1 = printf_uchar::format_radix#2 +Alias printf_number_buffer::buffer_digits#1 = printf_number_buffer::buffer_digits#3 printf_number_buffer::buffer_digits#15 printf_number_buffer::buffer_digits#16 +Alias printf_number_buffer::buffer_sign#1 = printf_number_buffer::buffer_sign#4 printf_number_buffer::buffer_sign#7 printf_number_buffer::buffer_sign#11 +Alias printf_number_buffer::format_min_length#1 = printf_number_buffer::format_min_length#5 printf_number_buffer::format_min_length#3 printf_number_buffer::format_min_length#4 +Alias printf_number_buffer::format_justify_left#11 = printf_number_buffer::format_justify_left#3 printf_number_buffer::format_justify_left#7 printf_number_buffer::format_justify_left#8 +Alias printf_number_buffer::format_zero_padding#10 = printf_number_buffer::format_zero_padding#15 printf_number_buffer::format_zero_padding#4 printf_number_buffer::format_zero_padding#11 +Alias strlen::return#2 = strlen::return#4 +Alias printf_number_buffer::padding#1 = printf_number_buffer::$20 +Alias printf_number_buffer::len#0 = printf_number_buffer::len#3 +Alias printf_number_buffer::format_justify_left#4 = printf_number_buffer::format_justify_left#5 +Alias printf_number_buffer::format_zero_padding#5 = printf_number_buffer::format_zero_padding#6 +Alias printf_number_buffer::buffer_sign#8 = printf_number_buffer::buffer_sign#9 +Alias printf_number_buffer::buffer_digits#12 = printf_number_buffer::buffer_digits#13 +Alias printf_number_buffer::padding#12 = printf_number_buffer::padding#4 printf_number_buffer::padding#3 +Alias printf_number_buffer::buffer_sign#10 = printf_number_buffer::buffer_sign#5 printf_number_buffer::buffer_sign#6 +Alias printf_number_buffer::format_zero_padding#1 = printf_number_buffer::format_zero_padding#16 printf_number_buffer::format_zero_padding#12 +Alias printf_number_buffer::buffer_digits#10 = printf_number_buffer::buffer_digits#14 printf_number_buffer::buffer_digits#9 +Alias printf_number_buffer::format_justify_left#1 = printf_number_buffer::format_justify_left#17 printf_number_buffer::format_justify_left#15 +Alias printf_number_buffer::buffer_sign#2 = printf_number_buffer::buffer_sign#3 +Alias printf_number_buffer::format_zero_padding#13 = printf_number_buffer::format_zero_padding#8 printf_number_buffer::format_zero_padding#7 +Alias printf_number_buffer::padding#10 = printf_number_buffer::padding#13 printf_number_buffer::padding#9 +Alias printf_number_buffer::buffer_digits#11 = printf_number_buffer::buffer_digits#7 printf_number_buffer::buffer_digits#6 +Alias printf_number_buffer::format_justify_left#12 = printf_number_buffer::format_justify_left#16 printf_number_buffer::format_justify_left#13 +Alias printf_number_buffer::format_zero_padding#3 = printf_number_buffer::format_zero_padding#9 +Alias printf_number_buffer::format_justify_left#2 = printf_number_buffer::format_justify_left#6 +Alias printf_number_buffer::padding#11 = printf_number_buffer::padding#6 printf_number_buffer::padding#8 +Alias printf_number_buffer::padding#14 = printf_number_buffer::padding#7 printf_number_buffer::padding#5 +Alias printf_number_buffer::buffer_digits#4 = printf_number_buffer::buffer_digits#8 printf_number_buffer::buffer_digits#5 +Alias printf_number_buffer::format_zero_padding#14 = printf_number_buffer::format_zero_padding#17 printf_number_buffer::format_zero_padding#2 +Alias printf_number_buffer::format_justify_left#10 = printf_number_buffer::format_justify_left#14 printf_number_buffer::format_justify_left#9 +Successful SSA optimization Pass2AliasElimination +Alias candidate removed (volatile)printf_char_cursor = printf_char::$8 +Alias uctoa::value#10 = uctoa::value#7 +Alias uctoa::buffer#10 = uctoa::buffer#15 +Alias uctoa::digit#2 = uctoa::digit#4 +Alias uctoa::max_digits#10 = uctoa::max_digits#6 +Alias uctoa::digit_values#10 = uctoa::digit_values#7 +Alias printf_uchar::uvalue#1 = printf_uchar::uvalue#2 +Alias printf_uchar::format_radix#1 = printf_uchar::format_radix#3 +Alias printf_uchar::format_min_length#1 = printf_uchar::format_min_length#3 +Alias printf_uchar::format_justify_left#1 = printf_uchar::format_justify_left#3 +Alias printf_uchar::format_sign_always#1 = printf_uchar::format_sign_always#2 +Alias printf_uchar::format_zero_padding#1 = printf_uchar::format_zero_padding#3 +Alias printf_number_buffer::format_min_length#1 = printf_number_buffer::format_min_length#2 +Alias printf_number_buffer::format_justify_left#11 = printf_number_buffer::format_justify_left#4 +Alias printf_number_buffer::format_zero_padding#10 = printf_number_buffer::format_zero_padding#5 +Alias printf_number_buffer::buffer_sign#1 = printf_number_buffer::buffer_sign#8 +Alias printf_number_buffer::buffer_digits#1 = printf_number_buffer::buffer_digits#12 +Alias printf_number_buffer::buffer_sign#10 = printf_number_buffer::buffer_sign#2 +Alias printf_number_buffer::format_zero_padding#1 = printf_number_buffer::format_zero_padding#13 printf_number_buffer::format_zero_padding#14 printf_number_buffer::format_zero_padding#3 +Alias printf_number_buffer::padding#10 = printf_number_buffer::padding#12 printf_number_buffer::padding#14 printf_number_buffer::padding#11 +Alias printf_number_buffer::buffer_digits#10 = printf_number_buffer::buffer_digits#11 printf_number_buffer::buffer_digits#4 printf_number_buffer::buffer_digits#2 +Alias printf_number_buffer::format_justify_left#1 = printf_number_buffer::format_justify_left#12 printf_number_buffer::format_justify_left#10 printf_number_buffer::format_justify_left#2 +Successful SSA optimization Pass2AliasElimination +Alias candidate removed (volatile)printf_char_cursor = printf_char::$8 +Alias printf_number_buffer::format_justify_left#1 = printf_number_buffer::format_justify_left#11 +Alias printf_number_buffer::format_zero_padding#1 = printf_number_buffer::format_zero_padding#10 +Alias printf_number_buffer::buffer_sign#1 = printf_number_buffer::buffer_sign#10 +Alias printf_number_buffer::buffer_digits#1 = printf_number_buffer::buffer_digits#10 +Successful SSA optimization Pass2AliasElimination +Alias candidate removed (volatile)printf_char_cursor = printf_char::$8 +Identical Phi Values (void*) memcpy::source#1 (void*) memcpy::source#0 +Identical Phi Values (void*) memcpy::destination#1 (void*) memcpy::destination#0 +Identical Phi Values (word) memcpy::num#1 (word) memcpy::num#0 +Identical Phi Values (byte*) memcpy::src_end#1 (byte*) memcpy::src_end#0 +Identical Phi Values (void*) memcpy::destination#2 (void*) memcpy::destination#1 +Identical Phi Values (byte*) memset::end#1 (byte*) memset::end#0 +Identical Phi Values (void*) memset::str#5 (void*) memset::str#3 +Identical Phi Values (byte) memset::c#2 (byte) memset::c#4 +Identical Phi Values (byte*) strlen::str#4 (byte*) strlen::str#1 +Identical Phi Values (byte) uctoa::radix#1 (byte) uctoa::radix#0 +Identical Phi Values (byte) uctoa::value#10 (byte) uctoa::value#1 +Identical Phi Values (byte*) uctoa::buffer#10 (byte*) uctoa::buffer#5 +Identical Phi Values (byte) uctoa::max_digits#10 (byte) uctoa::max_digits#7 +Identical Phi Values (byte*) uctoa::digit_values#10 (byte*) uctoa::digit_values#8 +Identical Phi Values (byte) uctoa_append::value#5 (byte) uctoa_append::value#0 +Identical Phi Values (byte) uctoa_append::sub#3 (byte) uctoa_append::sub#0 +Identical Phi Values (byte*) uctoa_append::buffer#3 (byte*) uctoa_append::buffer#0 +Identical Phi Values (byte) uctoa_append::sub#1 (byte) uctoa_append::sub#3 +Identical Phi Values (byte*) uctoa_append::buffer#1 (byte*) uctoa_append::buffer#3 +Identical Phi Values (byte) printf_padding::length#3 (byte) printf_padding::length#4 +Identical Phi Values (byte) printf_padding::pad#3 (byte) printf_padding::pad#5 +Identical Phi Values (byte) printf_uchar::format_sign_always#1 (byte) printf_uchar::format_sign_always#0 +Identical Phi Values (byte) printf_uchar::uvalue#1 (byte) printf_uchar::uvalue#0 +Identical Phi Values (byte) printf_uchar::format_radix#1 (byte) printf_uchar::format_radix#0 +Identical Phi Values (byte) printf_uchar::format_min_length#1 (byte) printf_uchar::format_min_length#0 +Identical Phi Values (byte) printf_uchar::format_justify_left#1 (byte) printf_uchar::format_justify_left#0 +Identical Phi Values (byte) printf_uchar::format_zero_padding#1 (byte) printf_uchar::format_zero_padding#0 +Identical Phi Values (byte) printf_number_buffer::format_min_length#1 (byte) printf_number_buffer::format_min_length#0 +Identical Phi Values (byte) printf_number_buffer::format_justify_left#1 (byte) printf_number_buffer::format_justify_left#0 +Identical Phi Values (byte) printf_number_buffer::format_zero_padding#1 (byte) printf_number_buffer::format_zero_padding#0 +Identical Phi Values (byte*) printf_number_buffer::buffer_digits#1 (byte*) printf_number_buffer::buffer_digits#0 +Identical Phi Values (byte) printf_number_buffer::buffer_sign#1 (byte) printf_number_buffer::buffer_sign#0 +Successful SSA optimization Pass2IdenticalPhiElimination +Identical Phi Values (void*) memset::return#0 (void*) memset::str#3 +Successful SSA optimization Pass2IdenticalPhiElimination +Simple Condition (bool~) memcpy::$1 [7] if((byte*) memcpy::src#2!=(byte*) memcpy::src_end#0) goto memcpy::@2 +Simple Condition (bool~) memset::$1 [14] if((word) memset::num#2<=(byte) 0) goto memset::@1 +Simple Condition (bool~) memset::$3 [21] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@5 +Simple Condition (bool~) strlen::$0 [29] if((byte) 0!=*((byte*) strlen::str#2)) goto strlen::@2 +Simple Condition (bool~) uctoa::$0 [37] if((byte) uctoa::radix#0==(const byte) DECIMAL) goto uctoa::@1 +Simple Condition (bool~) uctoa::$1 [41] if((byte) uctoa::radix#0==(const byte) HEXADECIMAL) goto uctoa::@2 +Simple Condition (bool~) uctoa::$2 [45] if((byte) uctoa::radix#0==(const byte) OCTAL) goto uctoa::@3 +Simple Condition (bool~) uctoa::$3 [49] if((byte) uctoa::radix#0==(const byte) BINARY) goto uctoa::@4 +Simple Condition (bool~) uctoa::$5 [66] if((byte) uctoa::digit#2<(byte~) uctoa::$4) goto uctoa::@19 +Simple Condition (bool~) uctoa_append::$0 [89] if((byte) uctoa_append::value#2>=(byte) uctoa_append::sub#0) goto uctoa_append::@2 +Simple Condition (bool~) printf_char::$2 [109] if((byte*) printf_char_cursor<(byte*~) printf_char::$0) goto printf_char::@return +Simple Condition (bool~) printf_ln::$0 [129] if((byte*) printf_line_cursor<(byte*) printf_char_cursor) goto printf_ln::@1 +Simple Condition (bool~) printf_padding::$0 [136] if((byte) printf_padding::i#2<(byte) printf_padding::length#4) goto printf_padding::@2 +Simple Condition (bool~) printf_str::$1 [147] if((byte) printf_str::ch#0!=(byte) 0) goto printf_str::@4 +Simple Condition (bool~) printf_str::$2 [149] if((byte) printf_str::ch#0==(byte) ' +') goto printf_str::@6 +Simple Condition (bool~) printf_uchar::$5 [156] if((byte) 0!=(byte) printf_uchar::format_sign_always#0) goto printf_uchar::@1 +Simple Condition (bool~) printf_number_buffer::$0 [177] if((byte) 0==(byte) printf_number_buffer::format_min_length#0) goto printf_number_buffer::@1 +Simple Condition (bool~) printf_number_buffer::$19 [191] if((byte) 0==(byte) printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@12 +Simple Condition (bool~) printf_number_buffer::$22 [196] if((signed byte) printf_number_buffer::padding#1>=(signed byte) 0) goto printf_number_buffer::@1 +Simple Condition (bool~) printf_number_buffer::$7 [200] if((byte) 0==(byte) printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@3 +Successful SSA optimization Pass2ConditionalJumpSimplification +Rewriting ! if()-condition to reversed if() [70] (bool~) uctoa::$8 ← ! (bool~) uctoa::$7 +Rewriting || if()-condition to two if()s [69] (bool~) uctoa::$7 ← (byte) uctoa::started#2 || (bool~) uctoa::$6 +Rewriting ! if()-condition to reversed if() [183] (bool~) printf_number_buffer::$5 ← ! (bool~) printf_number_buffer::$4 +Rewriting && if()-condition to two if()s [182] (bool~) printf_number_buffer::$4 ← (bool~) printf_number_buffer::$3 && (signed byte) printf_number_buffer::padding#10 +Rewriting && if()-condition to two if()s [181] (bool~) printf_number_buffer::$3 ← (bool~) printf_number_buffer::$1 && (bool~) printf_number_buffer::$2 +Rewriting ! if()-condition to reversed if() [205] (bool~) printf_number_buffer::$10 ← ! (bool~) printf_number_buffer::$9 +Rewriting && if()-condition to two if()s [204] (bool~) printf_number_buffer::$9 ← (byte) printf_number_buffer::format_zero_padding#0 && (signed byte) printf_number_buffer::padding#10 +Rewriting ! if()-condition to reversed if() [214] (bool~) printf_number_buffer::$16 ← ! (bool~) printf_number_buffer::$15 +Rewriting && if()-condition to two if()s [213] (bool~) printf_number_buffer::$15 ← (bool~) printf_number_buffer::$14 && (signed byte) printf_number_buffer::padding#10 +Rewriting && if()-condition to two if()s [212] (bool~) printf_number_buffer::$14 ← (byte) printf_number_buffer::format_justify_left#0 && (bool~) printf_number_buffer::$13 +Successful SSA optimization Pass2ConditionalAndOrRewriting +Warning! Adding boolean cast to non-boolean condition (byte) uctoa::started#2 +Warning! Adding boolean cast to non-boolean condition (byte) printf_number_buffer::format_zero_padding#0 +Warning! Adding boolean cast to non-boolean condition (byte) printf_number_buffer::format_justify_left#0 +Warning! Adding boolean cast to non-boolean condition (signed byte) printf_number_buffer::padding#10 +Warning! Adding boolean cast to non-boolean condition (signed byte) printf_number_buffer::padding#10 +Warning! Adding boolean cast to non-boolean condition (signed byte) printf_number_buffer::padding#10 +Constant right-side identified [96] (void*) memset::str#0 ← (void*)(const byte*) printf_screen +Constant right-side identified [98] (word) memset::num#0 ← (unumber)(number) $28*(number) $19 +Constant right-side identified [107] (byte*~) printf_char::$0 ← (const byte*) printf_screen + (word)(number) $28*(number) $19 +Constant right-side identified [110] (byte*~) printf_char::$3 ← (const byte*) printf_screen + (byte) $28 +Constant right-side identified [111] (void*) memcpy::destination#0 ← (void*)(const byte*) printf_screen +Constant right-side identified [113] (word) memcpy::num#0 ← (unumber)(number) $28*(number) $19-(number) $28 +Constant right-side identified [116] (byte*~) printf_char::$5 ← (const byte*) printf_screen + (word)(number) $28*(number) $19 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const word) strlen::len#0 = 0 +Constant (const byte) uctoa::max_digits#0 = 0 +Constant (const byte*) uctoa::digit_values#0 = (byte*) 0 +Constant (const byte) uctoa::max_digits#1 = 3 +Constant (const byte*) uctoa::digit_values#1 = RADIX_DECIMAL_VALUES_CHAR +Constant (const byte) uctoa::max_digits#2 = 2 +Constant (const byte*) uctoa::digit_values#2 = RADIX_HEXADECIMAL_VALUES_CHAR +Constant (const byte) uctoa::max_digits#3 = 3 +Constant (const byte*) uctoa::digit_values#3 = RADIX_OCTAL_VALUES_CHAR +Constant (const byte) uctoa::max_digits#4 = 8 +Constant (const byte*) uctoa::digit_values#4 = RADIX_BINARY_VALUES_CHAR +Constant (const byte) uctoa::started#0 = 0 +Constant (const byte) uctoa::digit#0 = 0 +Constant (const byte) uctoa::started#1 = 1 +Constant (const byte) uctoa_append::digit#0 = 0 +Constant (const void*) memset::str#0 = (void*)printf_screen +Constant (const byte) memset::c#0 = ' ' +Constant (const word) memset::num#0 = (unumber)$28*$19 +Constant (const byte*) printf_char::$0 = printf_screen+(word)$28*$19 +Constant (const byte*) printf_char::$3 = printf_screen+$28 +Constant (const void*) memcpy::destination#0 = (void*)printf_screen +Constant (const word) memcpy::num#0 = (unumber)$28*$19-$28 +Constant (const byte*) printf_char::$5 = printf_screen+(word)$28*$19 +Constant (const byte) memset::c#1 = ' ' +Constant (const word) memset::num#1 = $28 +Constant (const byte) printf_padding::i#0 = 0 +Constant (const byte) printf_uchar::$1 = '+' +Constant (const byte) printf_uchar::$0 = 0 +Constant (const byte*) uctoa::buffer#5 = (byte*)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS +Constant (const byte*) printf_number_buffer::buffer_digits#0 = (byte*)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS +Constant (const signed byte) printf_number_buffer::padding#0 = 0 +Constant (const signed byte) printf_number_buffer::padding#2 = 0 +Constant (const byte) printf_padding::pad#0 = ' ' +Constant (const byte) printf_padding::pad#1 = '0' +Constant (const byte) printf_padding::pad#2 = ' ' +Constant (const byte*) printf_str::str#2 = main::str +Constant (const byte) printf_uchar::uvalue#0 = main::c +Constant (const byte) printf_uchar::format_min_length#0 = 0 +Constant (const byte) printf_uchar::format_justify_left#0 = 0 +Constant (const byte) printf_uchar::format_sign_always#0 = 0 +Constant (const byte) printf_uchar::format_zero_padding#0 = 0 +Constant (const byte) printf_uchar::format_radix#0 = DECIMAL +Constant (const byte*) printf_str::str#3 = main::str1 +Successful SSA optimization Pass2ConstantIdentification +Constant (const byte*) memcpy::dst#0 = (byte*)memcpy::destination#0 +Constant (const void*) memcpy::source#0 = (void*)printf_char::$3 +Constant (const void*) memcpy::return#2 = memcpy::destination#0 +Constant (const byte) uctoa::value#1 = printf_uchar::uvalue#0 +Constant (const byte) uctoa::radix#0 = printf_uchar::format_radix#0 +Constant (const byte) printf_number_buffer::format_min_length#0 = printf_uchar::format_min_length#0 +Constant (const byte) printf_number_buffer::format_justify_left#0 = printf_uchar::format_justify_left#0 +Constant (const byte) printf_number_buffer::format_sign_always#0 = printf_uchar::format_sign_always#0 +Constant (const byte) printf_number_buffer::format_zero_padding#0 = printf_uchar::format_zero_padding#0 +Constant (const byte) printf_number_buffer::format_radix#0 = printf_uchar::format_radix#0 +Constant (const byte*) strlen::str#1 = printf_number_buffer::buffer_digits#0 +Constant (const byte*) printf_str::str#1 = printf_number_buffer::buffer_digits#0 +Successful SSA optimization Pass2ConstantIdentification +Constant (const byte*) memcpy::src#0 = (byte*)memcpy::source#0 +Constant (const byte*) memcpy::$2 = (byte*)memcpy::source#0 +Constant (const signed byte) printf_number_buffer::$23 = (signed byte)printf_number_buffer::format_min_length#0 +Successful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [37] if((const byte) uctoa::radix#0==(const byte) DECIMAL) goto uctoa::@1 +if() condition always false - eliminating [41] if((const byte) uctoa::radix#0==(const byte) HEXADECIMAL) goto uctoa::@2 +if() condition always false - eliminating [45] if((const byte) uctoa::radix#0==(const byte) OCTAL) goto uctoa::@3 +if() condition always false - eliminating [49] if((const byte) uctoa::radix#0==(const byte) BINARY) goto uctoa::@4 +if() condition always true - replacing block destination [143] if(true) goto printf_str::@2 +if() condition always false - eliminating [156] if((byte) 0!=(const byte) printf_uchar::format_sign_always#0) goto printf_uchar::@1 +if() condition always true - replacing block destination [177] if((byte) 0==(const byte) printf_number_buffer::format_min_length#0) goto printf_number_buffer::@1 +Successful SSA optimization Pass2ConstantIfs +Consolidated constant strings into (const byte*) main::str +Successful SSA optimization Pass2ConstantStringConsolidation +Simplifying constant evaluating to zero (signed byte)(const byte) printf_number_buffer::format_min_length#0 in +Successful SSA optimization PassNSimplifyConstantZero +Simplifying expression containing zero (byte*)&printf_buffer in [160] *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) ← (byte~) printf_uchar::$2 +Simplifying expression containing zero (byte*)&printf_buffer in [165] (byte) printf_number_buffer::buffer_sign#0 ← *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) +Simplifying expression containing zero printf_number_buffer::len#2 in [194] (signed byte) printf_number_buffer::padding#1 ← (const signed byte) printf_number_buffer::$23 - (signed byte) printf_number_buffer::len#2 +Successful SSA optimization PassNSimplifyExpressionWithZero +Eliminating unused variable (void*) memset::return#2 and assignment [59] (void*) memset::return#2 ← (void*) memset::str#3 +Eliminating unused variable (void*) memset::return#3 and assignment [71] (void*) memset::return#3 ← (void*) memset::str#3 +Eliminating unused constant (const void*) memcpy::return#2 +Eliminating unused constant (const byte) BINARY +Eliminating unused constant (const byte) OCTAL +Eliminating unused constant (const byte) HEXADECIMAL +Eliminating unused constant (const byte) uctoa::max_digits#0 +Eliminating unused constant (const byte*) uctoa::digit_values#0 +Eliminating unused constant (const byte) uctoa::radix#0 +Eliminating unused constant (const byte) printf_number_buffer::format_min_length#0 +Eliminating unused constant (const byte) printf_number_buffer::format_sign_always#0 +Eliminating unused constant (const byte) printf_number_buffer::format_radix#0 +Eliminating unused constant (const signed byte) printf_number_buffer::$23 +Eliminating unused constant (const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN +Successful SSA optimization PassNEliminateUnusedVars +Eliminating unused constant (const byte) printf_uchar::format_min_length#0 +Eliminating unused constant (const byte) printf_uchar::format_sign_always#0 +Eliminating unused constant (const byte) printf_uchar::format_radix#0 +Successful SSA optimization PassNEliminateUnusedVars +Eliminating unused constant (const byte) DECIMAL +Successful SSA optimization PassNEliminateUnusedVars +Eliminating variable (byte*) strlen::str#2 from unused block strlen::@1 +Eliminating variable (word) strlen::len#2 from unused block strlen::@1 +Eliminating variable (word) strlen::len#1 from unused block strlen::@2 +Eliminating variable (byte*) strlen::str#0 from unused block strlen::@2 +Eliminating variable (byte*) uctoa::buffer#0 from unused block uctoa::@12 +Eliminating variable (byte*) uctoa::buffer#1 from unused block uctoa::@12 +Eliminating variable (byte*) uctoa::buffer#2 from unused block uctoa::@12 +Eliminating variable (word) strlen::return#2 from unused block printf_number_buffer::@6 +Eliminating variable (word~) printf_number_buffer::$18 from unused block printf_number_buffer::@15 +Eliminating variable (signed byte) printf_number_buffer::len#0 from unused block printf_number_buffer::@15 +Eliminating variable (signed byte) printf_number_buffer::len#2 from unused block printf_number_buffer::@12 +Eliminating variable (signed byte) printf_number_buffer::padding#1 from unused block printf_number_buffer::@12 +Eliminating variable (signed byte) printf_number_buffer::len#1 from unused block printf_number_buffer::@7 +Removing unused procedure strlen +Removing unused procedure block strlen +Removing PHI-reference to removed block (strlen) in block strlen::@1 +Removing PHI-reference to removed block (strlen) in block strlen::@1 +Removing unused procedure block strlen::@1 +Removing unused procedure block strlen::@2 +Removing unused procedure block strlen::@3 +Removing unused procedure block strlen::@return +Removing unused block uctoa::@9 +Removing PHI-reference to removed block (uctoa::@2) in block uctoa::@8 +Removing PHI-reference to removed block (uctoa::@2) in block uctoa::@8 +Removing unused block uctoa::@2 +Removing unused block uctoa::@10 +Removing PHI-reference to removed block (uctoa::@3) in block uctoa::@8 +Removing PHI-reference to removed block (uctoa::@3) in block uctoa::@8 +Removing unused block uctoa::@3 +Removing unused block uctoa::@11 +Removing PHI-reference to removed block (uctoa::@4) in block uctoa::@8 +Removing PHI-reference to removed block (uctoa::@4) in block uctoa::@8 +Removing unused block uctoa::@4 +Removing unused block uctoa::@12 +Removing PHI-reference to removed block (printf_uchar::@1) in block printf_uchar::@3 +Removing unused block printf_uchar::@1 +Removing unused block printf_number_buffer::@6 +Removing PHI-reference to removed block (printf_number_buffer::@15) in block printf_number_buffer::@12 +Removing unused block printf_number_buffer::@15 +Removing PHI-reference to removed block (printf_number_buffer::@12) in block printf_number_buffer::@1 +Removing unused block printf_number_buffer::@12 +Removing unused block printf_number_buffer::@7 +Removing PHI-reference to removed block (printf_number_buffer::@14) in block printf_number_buffer::@1 +Removing unused block printf_number_buffer::@14 +Successful SSA optimization Pass2EliminateUnusedBlocks +Adding number conversion cast (unumber) 0 in (bool~) uctoa::$11 ← (number) 0 != (byte) uctoa::started#2 +Adding number conversion cast (unumber) 0 in (bool~) printf_number_buffer::$30 ← (number) 0 != (const byte) printf_number_buffer::format_zero_padding#0 +Adding number conversion cast (unumber) 0 in (bool~) printf_number_buffer::$31 ← (number) 0 != (const byte) printf_number_buffer::format_justify_left#0 +Adding number conversion cast (snumber) 0 in (bool~) printf_number_buffer::$32 ← (number) 0 != (signed byte) printf_number_buffer::padding#10 +Adding number conversion cast (snumber) 0 in (bool~) printf_number_buffer::$33 ← (number) 0 != (signed byte) printf_number_buffer::padding#10 +Adding number conversion cast (snumber) 0 in (bool~) printf_number_buffer::$34 ← (number) 0 != (signed byte) printf_number_buffer::padding#10 +Successful SSA optimization PassNAddNumberTypeConversions +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Successful SSA optimization PassNCastSimplification +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized signed number type (signed byte) 0 +Finalized signed number type (signed byte) 0 +Finalized signed number type (signed byte) 0 +Successful SSA optimization PassNFinalizeNumberTypeConversions +Alias candidate removed (volatile)printf_char_cursor = printf_char::$8 +Identical Phi Values (byte) uctoa::max_digits#7 (const byte) uctoa::max_digits#1 +Identical Phi Values (byte*) uctoa::digit_values#8 (const byte*) uctoa::digit_values#1 +Identical Phi Values (byte~) printf_uchar::$2 (const byte) printf_uchar::$0 +Identical Phi Values (signed byte) printf_number_buffer::padding#10 (const signed byte) printf_number_buffer::padding#0 +Successful SSA optimization Pass2IdenticalPhiElimination +Simple Condition (bool~) uctoa::$11 [25] if((byte) 0!=(byte) uctoa::started#2) goto uctoa::@24 +Simple Condition (bool~) printf_number_buffer::$1 [92] if((byte) 0==(const byte) printf_number_buffer::format_justify_left#0) goto printf_number_buffer::@22 +Simple Condition (bool~) printf_number_buffer::$30 [97] if((byte) 0!=(const byte) printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@23 +Simple Condition (bool~) printf_number_buffer::$31 [103] if((byte) 0!=(const byte) printf_number_buffer::format_justify_left#0) goto printf_number_buffer::@25 +Simple Condition (bool~) uctoa::$6 [115] if((byte) uctoa::value#2>=(byte) uctoa::digit_value#0) goto uctoa::@24 +Simple Condition (bool~) printf_number_buffer::$32 [117] if((signed byte) 0!=(const signed byte) printf_number_buffer::padding#0) goto printf_number_buffer::@8 +Simple Condition (bool~) printf_number_buffer::$2 [118] if((byte) 0==(const byte) printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@21 +Simple Condition (bool~) printf_number_buffer::$33 [120] if((signed byte) 0!=(const signed byte) printf_number_buffer::padding#0) goto printf_number_buffer::@10 +Simple Condition (bool~) printf_number_buffer::$34 [122] if((signed byte) 0!=(const signed byte) printf_number_buffer::padding#0) goto printf_number_buffer::@11 +Simple Condition (bool~) printf_number_buffer::$13 [123] if((byte) 0==(const byte) printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@24 +Successful SSA optimization Pass2ConditionalJumpSimplification +Negating conditional jump and destination [92] if((byte) 0!=(const byte) printf_number_buffer::format_justify_left#0) goto printf_number_buffer::@2 +Negating conditional jump and destination [97] if((byte) 0==(const byte) printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@4 +Negating conditional jump and destination [103] if((byte) 0==(const byte) printf_number_buffer::format_justify_left#0) goto printf_number_buffer::@return +Negating conditional jump and destination [118] if((byte) 0!=(const byte) printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@2 +Negating conditional jump and destination [123] if((byte) 0!=(const byte) printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@return +Successful SSA optimization Pass2ConditionalJumpSequenceImprovement +Constant right-side identified [0] (byte*) memcpy::src_end#0 ← (const byte*) memcpy::$2 + (const word) memcpy::num#0 +Constant right-side identified [20] (byte~) uctoa::$4 ← (const byte) uctoa::max_digits#1 - (byte) 1 +Constant right-side identified [55] (byte*~) printf_char::$6 ← (const byte*) printf_char::$5 - (byte) $28 +Constant right-side identified [94] (byte) printf_padding::length#0 ← (byte)(const signed byte) printf_number_buffer::padding#0 +Constant right-side identified [104] (byte) printf_padding::length#1 ← (byte)(const signed byte) printf_number_buffer::padding#0 +Constant right-side identified [106] (byte) printf_padding::length#2 ← (byte)(const signed byte) printf_number_buffer::padding#0 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const byte*) memcpy::src_end#0 = memcpy::$2+memcpy::num#0 +Constant (const byte) uctoa::$4 = uctoa::max_digits#1-1 +Constant (const byte*) printf_char::$6 = printf_char::$5-$28 +Constant (const byte) printf_padding::length#0 = (byte)printf_number_buffer::padding#0 +Constant (const byte) printf_padding::length#1 = (byte)printf_number_buffer::padding#0 +Constant (const byte) printf_padding::length#2 = (byte)printf_number_buffer::padding#0 +Successful SSA optimization Pass2ConstantIdentification +Constant (const void*) memset::str#1 = (void*)printf_char::$6 +Successful SSA optimization Pass2ConstantIdentification +if() condition always false - eliminating [92] if((byte) 0!=(const byte) printf_number_buffer::format_justify_left#0) goto printf_number_buffer::@2 +if() condition always true - replacing block destination [97] if((byte) 0==(const byte) printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@4 +if() condition always true - replacing block destination [103] if((byte) 0==(const byte) printf_number_buffer::format_justify_left#0) goto printf_number_buffer::@return +if() condition always false - eliminating [117] if((signed byte) 0!=(const signed byte) printf_number_buffer::padding#0) goto printf_number_buffer::@8 +if() condition always false - eliminating [118] if((byte) 0!=(const byte) printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@2 +if() condition always false - eliminating [120] if((signed byte) 0!=(const signed byte) printf_number_buffer::padding#0) goto printf_number_buffer::@10 +if() condition always false - eliminating [122] if((signed byte) 0!=(const signed byte) printf_number_buffer::padding#0) goto printf_number_buffer::@11 +if() condition always false - eliminating [123] if((byte) 0!=(const byte) printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@return +Successful SSA optimization Pass2ConstantIfs +Simplifying constant evaluating to zero (byte)(const signed byte) printf_number_buffer::padding#0 in +Simplifying constant evaluating to zero (byte)(const signed byte) printf_number_buffer::padding#0 in +Simplifying constant evaluating to zero (byte)(const signed byte) printf_number_buffer::padding#0 in +Successful SSA optimization PassNSimplifyConstantZero +Eliminating unused constant (const byte) uctoa::max_digits#2 +Eliminating unused constant (const byte*) uctoa::digit_values#2 +Eliminating unused constant (const byte) uctoa::max_digits#3 +Eliminating unused constant (const byte*) uctoa::digit_values#3 +Eliminating unused constant (const byte) uctoa::max_digits#4 +Eliminating unused constant (const byte*) uctoa::digit_values#4 +Eliminating unused constant (const byte) printf_uchar::$1 +Eliminating unused constant (const signed byte) printf_number_buffer::padding#0 +Eliminating unused constant (const signed byte) printf_number_buffer::padding#2 +Eliminating unused constant (const byte) printf_number_buffer::format_justify_left#0 +Eliminating unused constant (const byte) printf_number_buffer::format_zero_padding#0 +Successful SSA optimization PassNEliminateUnusedVars +Eliminating unused constant (const byte*) RADIX_BINARY_VALUES_CHAR +Eliminating unused constant (const byte*) RADIX_OCTAL_VALUES_CHAR +Eliminating unused constant (const byte*) RADIX_HEXADECIMAL_VALUES_CHAR +Eliminating unused constant (const byte) printf_uchar::format_justify_left#0 +Eliminating unused constant (const byte) printf_uchar::format_zero_padding#0 +Successful SSA optimization PassNEliminateUnusedVars +Eliminating variable (byte) printf_padding::length#4 from unused block printf_padding +Eliminating variable (byte) printf_padding::pad#5 from unused block printf_padding +Eliminating variable (byte) printf_padding::i#2 from unused block printf_padding::@1 +Eliminating variable (byte) printf_char::ch#0 from unused block printf_padding::@2 +Eliminating variable (byte) printf_padding::i#1 from unused block printf_padding::@7 +Removing unused procedure printf_padding +Removing unused procedure block printf_padding +Removing PHI-reference to removed block (printf_padding) in block printf_padding::@1 +Removing unused procedure block printf_padding::@1 +Removing unused procedure block printf_padding::@2 +Removing PHI-reference to removed block (printf_padding::@2) in block printf_char +Removing unused procedure block printf_padding::@7 +Removing unused procedure block printf_padding::@return +Removing unused block printf_number_buffer::@8 +Removing unused block printf_number_buffer::@16 +Removing unused block printf_number_buffer::@10 +Removing unused block printf_number_buffer::@19 +Removing unused block printf_number_buffer::@11 +Removing unused block printf_number_buffer::@20 +Removing unused block printf_number_buffer::@23 +Removing unused block printf_number_buffer::@24 +Removing unused block printf_number_buffer::@25 +Successful SSA optimization Pass2EliminateUnusedBlocks +Alias candidate removed (volatile)printf_char_cursor = printf_char::$8 +Inlining Noop Cast [8] (byte*~) memset::$4 ← (byte*)(void*) memset::str#3 keeping memset::str#3 +Inlining Noop Cast [10] (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3 keeping memset::str#3 +Successful SSA optimization Pass2NopCastInlining +Inlining constant with var siblings (const byte*) memcpy::dst#0 +Inlining constant with var siblings (const byte*) memcpy::src#0 +Inlining constant with var siblings (const void*) memset::str#0 +Inlining constant with var siblings (const byte) memset::c#0 +Inlining constant with var siblings (const word) memset::num#0 +Inlining constant with var siblings (const byte) memset::c#1 +Inlining constant with var siblings (const word) memset::num#1 +Inlining constant with var siblings (const void*) memset::str#1 +Inlining constant with var siblings (const byte) uctoa::started#0 +Inlining constant with var siblings (const byte) uctoa::digit#0 +Inlining constant with var siblings (const byte) uctoa::started#1 +Inlining constant with var siblings (const byte*) uctoa::buffer#5 +Inlining constant with var siblings (const byte) uctoa::value#1 +Inlining constant with var siblings (const byte) uctoa_append::digit#0 +Inlining constant with var siblings (const byte*) printf_str::str#2 +Inlining constant with var siblings (const byte*) printf_str::str#3 +Inlining constant with var siblings (const byte*) printf_str::str#1 +Constant inlined uctoa_append::digit#0 = (byte) 0 +Constant inlined uctoa::$4 = (const byte) uctoa::max_digits#1-(byte) 1 +Constant inlined uctoa::started#0 = (byte) 0 +Constant inlined uctoa::digit_values#1 = (const byte*) RADIX_DECIMAL_VALUES_CHAR +Constant inlined uctoa::started#1 = (byte) 1 +Constant inlined printf_uchar::uvalue#0 = (const byte) main::c +Constant inlined memcpy::dst#0 = (byte*)(const void*) memcpy::destination#0 +Constant inlined main::str1 = (const byte*) main::str +Constant inlined printf_uchar::$0 = (byte) 0 +Constant inlined memset::num#1 = (byte) $28 +Constant inlined memcpy::src#0 = (byte*)(const void*) memcpy::source#0 +Constant inlined memset::num#0 = (word)(number) $28*(number) $19 +Constant inlined memcpy::$2 = (byte*)(const void*) memcpy::source#0 +Constant inlined memset::str#1 = (void*)(const byte*) printf_screen+(word)(number) $28*(number) $19-(byte) $28 +Constant inlined uctoa::digit#0 = (byte) 0 +Constant inlined memset::str#0 = (void*)(const byte*) printf_screen +Constant inlined printf_char::$3 = (const byte*) printf_screen+(byte) $28 +Constant inlined printf_char::$0 = (const byte*) printf_screen+(word)(number) $28*(number) $19 +Constant inlined printf_char::$6 = (const byte*) printf_screen+(word)(number) $28*(number) $19-(byte) $28 +Constant inlined uctoa::buffer#5 = (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS +Constant inlined printf_char::$5 = (const byte*) printf_screen+(word)(number) $28*(number) $19 +Constant inlined memset::c#0 = (byte) ' ' +Constant inlined printf_str::str#2 = (const byte*) main::str +Constant inlined memset::c#1 = (byte) ' ' +Constant inlined printf_str::str#1 = (const byte*) printf_number_buffer::buffer_digits#0 +Constant inlined uctoa::value#1 = (const byte) main::c +Constant inlined printf_str::str#3 = (const byte*) main::str +Successful SSA optimization Pass2ConstantInlining +Alias candidate removed (volatile)printf_char_cursor = printf_char::$8 +Alias candidate removed (volatile)printf_char_cursor = printf_char::$8 +Added new block during phi lifting uctoa::@28(between uctoa::@27 and uctoa::@21) +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @29 +Adding NOP phi() at start of @30 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +Adding NOP phi() at start of main::@1 +Adding NOP phi() at start of main::@2 +Adding NOP phi() at start of main::@3 +Adding NOP phi() at start of main::@4 +Adding NOP phi() at start of printf_str::@6 +Adding NOP phi() at start of printf_ln +Adding NOP phi() at start of printf_char::@2 +Adding NOP phi() at start of printf_char::@3 +Adding NOP phi() at start of memset::@1 +Adding NOP phi() at start of memcpy +Adding NOP phi() at start of memcpy::@3 +Adding NOP phi() at start of printf_uchar +Adding NOP phi() at start of printf_uchar::@2 +Adding NOP phi() at start of printf_uchar::@7 +Adding NOP phi() at start of printf_number_buffer +Adding NOP phi() at start of printf_number_buffer::@1 +Adding NOP phi() at start of printf_number_buffer::@22 +Adding NOP phi() at start of printf_number_buffer::@21 +Adding NOP phi() at start of printf_number_buffer::@17 +Adding NOP phi() at start of printf_number_buffer::@3 +Adding NOP phi() at start of printf_number_buffer::@4 +Adding NOP phi() at start of printf_number_buffer::@18 +Adding NOP phi() at start of uctoa +Adding NOP phi() at start of uctoa::@1 +Adding NOP phi() at start of uctoa::@8 +Adding NOP phi() at start of printf_cls +CALL GRAPH +Calls in [] to main:4 +Calls in [main] to printf_cls:8 printf_str:10 printf_uchar:12 printf_str:14 +Calls in [printf_str] to printf_char:27 printf_ln:30 +Calls in [printf_char] to memcpy:42 memset:44 +Calls in [printf_uchar] to uctoa:73 printf_number_buffer:75 +Calls in [printf_number_buffer] to printf_char:85 printf_str:89 +Calls in [uctoa] to uctoa_append:116 +Calls in [printf_cls] to memset:132 + +Created 18 initial phi equivalence classes +Coalesced [18] printf_str::str#12 ← printf_str::str#6 +Coalesced [26] printf_char::ch#5 ← printf_char::ch#1 +Coalesced [28] printf_str::str#14 ← printf_str::str#0 +Coalesced (already) [31] printf_str::str#13 ← printf_str::str#0 +Coalesced [59] memset::dst#5 ← memset::dst#1 +Coalesced [68] memcpy::src#4 ← memcpy::src#1 +Coalesced [69] memcpy::dst#4 ← memcpy::dst#1 +Coalesced [84] printf_char::ch#4 ← printf_char::ch#2 +Coalesced [104] uctoa::value#17 ← uctoa::value#2 +Coalesced [105] uctoa::started#6 ← uctoa::started#2 +Coalesced [106] uctoa::buffer#23 ← uctoa::buffer#11 +Coalesced [109] uctoa::digit#7 ← uctoa::digit#1 +Coalesced (already) [110] uctoa::value#16 ← uctoa::value#6 +Coalesced (already) [111] uctoa::started#5 ← uctoa::started#4 +Coalesced (already) [112] uctoa::buffer#22 ← uctoa::buffer#14 +Coalesced [120] uctoa::value#18 ← uctoa::value#0 +Coalesced [121] uctoa::buffer#24 ← uctoa::buffer#4 +Coalesced [122] uctoa_append::value#6 ← uctoa_append::value#0 +Coalesced [129] uctoa_append::value#7 ← uctoa_append::value#1 +Coalesced [130] uctoa_append::digit#5 ← uctoa_append::digit#1 +Coalesced down to 14 phi equivalence classes +Culled Empty Block (label) @30 +Culled Empty Block (label) main::@4 +Culled Empty Block (label) printf_str::@16 +Culled Empty Block (label) printf_str::@15 +Culled Empty Block (label) memset::@1 +Culled Empty Block (label) memcpy::@3 +Culled Empty Block (label) printf_uchar::@2 +Culled Empty Block (label) printf_uchar::@7 +Culled Empty Block (label) printf_number_buffer::@1 +Culled Empty Block (label) printf_number_buffer::@22 +Culled Empty Block (label) printf_number_buffer::@21 +Culled Empty Block (label) printf_number_buffer::@17 +Culled Empty Block (label) printf_number_buffer::@3 +Culled Empty Block (label) printf_number_buffer::@18 +Culled Empty Block (label) uctoa::@1 +Culled Empty Block (label) uctoa::@8 +Culled Empty Block (label) uctoa::@28 +Renumbering block @15 to @1 +Renumbering block @29 to @2 +Renumbering block memset::@2 to memset::@1 +Renumbering block memset::@4 to memset::@2 +Renumbering block memset::@5 to memset::@3 +Renumbering block uctoa::@18 to uctoa::@1 +Renumbering block uctoa::@19 to uctoa::@2 +Renumbering block uctoa::@20 to uctoa::@3 +Renumbering block uctoa::@21 to uctoa::@4 +Renumbering block uctoa::@24 to uctoa::@5 +Renumbering block uctoa::@26 to uctoa::@6 +Renumbering block uctoa::@27 to uctoa::@7 +Renumbering block printf_char::@2 to printf_char::@1 +Renumbering block printf_char::@3 to printf_char::@2 +Renumbering block printf_char::@4 to printf_char::@3 +Renumbering block printf_str::@4 to printf_str::@3 +Renumbering block printf_str::@6 to printf_str::@4 +Renumbering block printf_str::@12 to printf_str::@5 +Renumbering block printf_uchar::@3 to printf_uchar::@1 +Renumbering block printf_uchar::@6 to printf_uchar::@2 +Renumbering block printf_number_buffer::@2 to printf_number_buffer::@1 +Renumbering block printf_number_buffer::@4 to printf_number_buffer::@2 +Renumbering block printf_number_buffer::@9 to printf_number_buffer::@3 +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @2 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +Adding NOP phi() at start of main::@1 +Adding NOP phi() at start of main::@2 +Adding NOP phi() at start of main::@3 +Adding NOP phi() at start of printf_str::@4 +Adding NOP phi() at start of printf_ln +Adding NOP phi() at start of printf_char::@1 +Adding NOP phi() at start of printf_char::@2 +Adding NOP phi() at start of memcpy +Adding NOP phi() at start of printf_uchar +Adding NOP phi() at start of printf_number_buffer +Adding NOP phi() at start of printf_number_buffer::@2 +Adding NOP phi() at start of uctoa +Adding NOP phi() at start of uctoa_append +Adding NOP phi() at start of printf_cls + +FINAL CONTROL FLOW GRAPH +@begin: scope:[] from + [0] phi() + to:@1 +@1: scope:[] from @begin + [1] (byte*) printf_line_cursor ← (byte*) 1024 + [2] (byte*) printf_char_cursor ← (byte*) 1024 + to:@2 +@2: scope:[] from @1 + [3] phi() + [4] call main + to:@end +@end: scope:[] from @2 + [5] phi() + +(void()) main() +main: scope:[main] from @2 + [6] phi() + [7] call printf_cls + to:main::@1 +main::@1: scope:[main] from main + [8] phi() + [9] call printf_str + to:main::@2 +main::@2: scope:[main] from main::@1 + [10] phi() + [11] call printf_uchar + to:main::@3 +main::@3: scope:[main] from main::@2 + [12] phi() + [13] call printf_str + to:main::@return +main::@return: scope:[main] from main::@3 + [14] return + to:@return + +(void()) printf_str((byte*) printf_str::str) +printf_str: scope:[printf_str] from main::@1 main::@3 printf_number_buffer::@2 + [15] (byte*) printf_str::str#6 ← phi( main::@1/(const byte*) main::str main::@3/(const byte*) main::str printf_number_buffer::@2/(const byte*) printf_number_buffer::buffer_digits#0 ) + to:printf_str::@1 +printf_str::@1: scope:[printf_str] from printf_str printf_str::@4 printf_str::@5 + [16] (byte*) printf_str::str#4 ← phi( printf_str/(byte*) printf_str::str#6 printf_str::@4/(byte*) printf_str::str#0 printf_str::@5/(byte*) printf_str::str#0 ) + to:printf_str::@2 +printf_str::@2: scope:[printf_str] from printf_str::@1 + [17] (byte) printf_str::ch#0 ← *((byte*) printf_str::str#4) + [18] (byte*) printf_str::str#0 ← ++ (byte*) printf_str::str#4 + [19] if((byte) printf_str::ch#0!=(byte) 0) goto printf_str::@3 + to:printf_str::@return +printf_str::@return: scope:[printf_str] from printf_str::@2 + [20] return + to:@return +printf_str::@3: scope:[printf_str] from printf_str::@2 + [21] if((byte) printf_str::ch#0==(byte) ' +') goto printf_str::@4 + to:printf_str::@5 +printf_str::@5: scope:[printf_str] from printf_str::@3 + [22] (byte) printf_char::ch#1 ← (byte) printf_str::ch#0 + [23] call printf_char + to:printf_str::@1 +printf_str::@4: scope:[printf_str] from printf_str::@3 + [24] phi() + [25] call printf_ln + to:printf_str::@1 + +(void()) printf_ln() +printf_ln: scope:[printf_ln] from printf_str::@4 + [26] phi() + to:printf_ln::@1 +printf_ln::@1: scope:[printf_ln] from printf_ln printf_ln::@1 + [27] (byte*) printf_line_cursor ← (byte*) printf_line_cursor + (byte) $28 + [28] if((byte*) printf_line_cursor<(byte*) printf_char_cursor) goto printf_ln::@1 + to:printf_ln::@2 +printf_ln::@2: scope:[printf_ln] from printf_ln::@1 + [29] (byte*) printf_char_cursor ← (byte*) printf_line_cursor + to:printf_ln::@return +printf_ln::@return: scope:[printf_ln] from printf_ln::@2 + [30] return + to:@return + +(void()) printf_char((byte) printf_char::ch) +printf_char: scope:[printf_char] from printf_number_buffer::@3 printf_str::@5 + [31] (byte) printf_char::ch#3 ← phi( printf_number_buffer::@3/(byte) printf_char::ch#2 printf_str::@5/(byte) printf_char::ch#1 ) + [32] *((byte*) printf_char_cursor) ← (byte) printf_char::ch#3 + [33] (byte*) printf_char_cursor ← ++ (byte*) printf_char_cursor + [34] if((byte*) printf_char_cursor<(const byte*) printf_screen+(word)(number) $28*(number) $19) goto printf_char::@return + to:printf_char::@1 +printf_char::@1: scope:[printf_char] from printf_char + [35] phi() + [36] call memcpy + to:printf_char::@2 +printf_char::@2: scope:[printf_char] from printf_char::@1 + [37] phi() + [38] call memset + to:printf_char::@3 +printf_char::@3: scope:[printf_char] from printf_char::@2 + [39] (byte*~) printf_char::$8 ← (byte*) printf_char_cursor - (byte) $28 + [40] (byte*) printf_char_cursor ← (byte*~) printf_char::$8 + [41] (byte*) printf_line_cursor ← (byte*) printf_char_cursor + to:printf_char::@return +printf_char::@return: scope:[printf_char] from printf_char printf_char::@3 + [42] return + to:@return + +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +memset: scope:[memset] from printf_char::@2 printf_cls + [43] (byte) memset::c#4 ← phi( printf_char::@2/(byte) ' ' printf_cls/(byte) ' ' ) + [43] (void*) memset::str#3 ← phi( printf_char::@2/(void*)(const byte*) printf_screen+(word)(number) $28*(number) $19-(byte) $28 printf_cls/(void*)(const byte*) printf_screen ) + [43] (word) memset::num#2 ← phi( printf_char::@2/(byte) $28 printf_cls/(word)(number) $28*(number) $19 ) + [44] if((word) memset::num#2<=(byte) 0) goto memset::@return + to:memset::@1 +memset::@1: scope:[memset] from memset + [45] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 + [46] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3 + to:memset::@2 +memset::@2: scope:[memset] from memset::@1 memset::@3 + [47] (byte*) memset::dst#2 ← phi( memset::@1/(byte*) memset::dst#4 memset::@3/(byte*) memset::dst#1 ) + [48] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 + to:memset::@return +memset::@return: scope:[memset] from memset memset::@2 + [49] return + to:@return +memset::@3: scope:[memset] from memset::@2 + [50] *((byte*) memset::dst#2) ← (byte) memset::c#4 + [51] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 + to:memset::@2 + +(void*()) memcpy((void*) memcpy::destination , (void*) memcpy::source , (word) memcpy::num) +memcpy: scope:[memcpy] from printf_char::@1 + [52] phi() + to:memcpy::@1 +memcpy::@1: scope:[memcpy] from memcpy memcpy::@2 + [53] (byte*) memcpy::dst#2 ← phi( memcpy/(byte*)(const void*) memcpy::destination#0 memcpy::@2/(byte*) memcpy::dst#1 ) + [53] (byte*) memcpy::src#2 ← phi( memcpy/(byte*)(const void*) memcpy::source#0 memcpy::@2/(byte*) memcpy::src#1 ) + [54] if((byte*) memcpy::src#2!=(const byte*) memcpy::src_end#0) goto memcpy::@2 + to:memcpy::@return +memcpy::@return: scope:[memcpy] from memcpy::@1 + [55] return + to:@return +memcpy::@2: scope:[memcpy] from memcpy::@1 + [56] *((byte*) memcpy::dst#2) ← *((byte*) memcpy::src#2) + [57] (byte*) memcpy::dst#1 ← ++ (byte*) memcpy::dst#2 + [58] (byte*) memcpy::src#1 ← ++ (byte*) memcpy::src#2 + to:memcpy::@1 + +(void()) printf_uchar((byte) printf_uchar::uvalue , (byte) printf_uchar::format_min_length , (byte) printf_uchar::format_justify_left , (byte) printf_uchar::format_sign_always , (byte) printf_uchar::format_zero_padding , (byte) printf_uchar::format_radix) +printf_uchar: scope:[printf_uchar] from main::@2 + [59] phi() + to:printf_uchar::@1 +printf_uchar::@1: scope:[printf_uchar] from printf_uchar + [60] *((byte*)&(struct printf_buffer_number) printf_buffer) ← (byte) 0 + [61] call uctoa + to:printf_uchar::@2 +printf_uchar::@2: scope:[printf_uchar] from printf_uchar::@1 + [62] (byte) printf_number_buffer::buffer_sign#0 ← *((byte*)&(struct printf_buffer_number) printf_buffer) + [63] call printf_number_buffer + to:printf_uchar::@return +printf_uchar::@return: scope:[printf_uchar] from printf_uchar::@2 + [64] return + to:@return + +(void()) printf_number_buffer((byte) printf_number_buffer::buffer_sign , (byte*) printf_number_buffer::buffer_digits , (byte) printf_number_buffer::format_min_length , (byte) printf_number_buffer::format_justify_left , (byte) printf_number_buffer::format_sign_always , (byte) printf_number_buffer::format_zero_padding , (byte) printf_number_buffer::format_radix) +printf_number_buffer: scope:[printf_number_buffer] from printf_uchar::@2 + [65] phi() + to:printf_number_buffer::@1 +printf_number_buffer::@1: scope:[printf_number_buffer] from printf_number_buffer + [66] if((byte) 0==(byte) printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 + to:printf_number_buffer::@3 +printf_number_buffer::@3: scope:[printf_number_buffer] from printf_number_buffer::@1 + [67] (byte) printf_char::ch#2 ← (byte) printf_number_buffer::buffer_sign#0 + [68] call printf_char + to:printf_number_buffer::@2 +printf_number_buffer::@2: scope:[printf_number_buffer] from printf_number_buffer::@1 printf_number_buffer::@3 + [69] phi() + [70] call printf_str + to:printf_number_buffer::@return +printf_number_buffer::@return: scope:[printf_number_buffer] from printf_number_buffer::@2 + [71] return + to:@return + +(void()) uctoa((byte) uctoa::value , (byte*) uctoa::buffer , (byte) uctoa::radix) +uctoa: scope:[uctoa] from printf_uchar::@1 + [72] phi() + to:uctoa::@1 +uctoa::@1: scope:[uctoa] from uctoa uctoa::@4 + [73] (byte*) uctoa::buffer#11 ← phi( uctoa::@4/(byte*) uctoa::buffer#14 uctoa/(byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS ) + [73] (byte) uctoa::started#2 ← phi( uctoa::@4/(byte) uctoa::started#4 uctoa/(byte) 0 ) + [73] (byte) uctoa::value#2 ← phi( uctoa::@4/(byte) uctoa::value#6 uctoa/(const byte) main::c ) + [73] (byte) uctoa::digit#2 ← phi( uctoa::@4/(byte) uctoa::digit#1 uctoa/(byte) 0 ) + [74] if((byte) uctoa::digit#2<(const byte) uctoa::max_digits#1-(byte) 1) goto uctoa::@2 + to:uctoa::@3 +uctoa::@3: scope:[uctoa] from uctoa::@1 + [75] *((byte*) uctoa::buffer#11) ← *((const byte*) DIGITS + (byte) uctoa::value#2) + [76] (byte*) uctoa::buffer#3 ← ++ (byte*) uctoa::buffer#11 + [77] *((byte*) uctoa::buffer#3) ← (byte) 0 + to:uctoa::@return +uctoa::@return: scope:[uctoa] from uctoa::@3 + [78] return + to:@return +uctoa::@2: scope:[uctoa] from uctoa::@1 + [79] (byte) uctoa::digit_value#0 ← *((const byte*) RADIX_DECIMAL_VALUES_CHAR + (byte) uctoa::digit#2) + [80] if((byte) 0!=(byte) uctoa::started#2) goto uctoa::@5 + to:uctoa::@7 +uctoa::@7: scope:[uctoa] from uctoa::@2 + [81] if((byte) uctoa::value#2>=(byte) uctoa::digit_value#0) goto uctoa::@5 + to:uctoa::@4 +uctoa::@4: scope:[uctoa] from uctoa::@6 uctoa::@7 + [82] (byte*) uctoa::buffer#14 ← phi( uctoa::@7/(byte*) uctoa::buffer#11 uctoa::@6/(byte*) uctoa::buffer#4 ) + [82] (byte) uctoa::started#4 ← phi( uctoa::@7/(byte) uctoa::started#2 uctoa::@6/(byte) 1 ) + [82] (byte) uctoa::value#6 ← phi( uctoa::@7/(byte) uctoa::value#2 uctoa::@6/(byte) uctoa::value#0 ) + [83] (byte) uctoa::digit#1 ← ++ (byte) uctoa::digit#2 + to:uctoa::@1 +uctoa::@5: scope:[uctoa] from uctoa::@2 uctoa::@7 + [84] (byte*) uctoa_append::buffer#0 ← (byte*) uctoa::buffer#11 + [85] (byte) uctoa_append::value#0 ← (byte) uctoa::value#2 + [86] (byte) uctoa_append::sub#0 ← (byte) uctoa::digit_value#0 + [87] call uctoa_append + [88] (byte) uctoa_append::return#0 ← (byte) uctoa_append::value#2 + to:uctoa::@6 +uctoa::@6: scope:[uctoa] from uctoa::@5 + [89] (byte) uctoa::value#0 ← (byte) uctoa_append::return#0 + [90] (byte*) uctoa::buffer#4 ← ++ (byte*) uctoa::buffer#11 + to:uctoa::@4 + +(byte()) uctoa_append((byte*) uctoa_append::buffer , (byte) uctoa_append::value , (byte) uctoa_append::sub) +uctoa_append: scope:[uctoa_append] from uctoa::@5 + [91] phi() + to:uctoa_append::@1 +uctoa_append::@1: scope:[uctoa_append] from uctoa_append uctoa_append::@2 + [92] (byte) uctoa_append::digit#2 ← phi( uctoa_append/(byte) 0 uctoa_append::@2/(byte) uctoa_append::digit#1 ) + [92] (byte) uctoa_append::value#2 ← phi( uctoa_append/(byte) uctoa_append::value#0 uctoa_append::@2/(byte) uctoa_append::value#1 ) + [93] if((byte) uctoa_append::value#2>=(byte) uctoa_append::sub#0) goto uctoa_append::@2 + to:uctoa_append::@3 +uctoa_append::@3: scope:[uctoa_append] from uctoa_append::@1 + [94] *((byte*) uctoa_append::buffer#0) ← *((const byte*) DIGITS + (byte) uctoa_append::digit#2) + to:uctoa_append::@return +uctoa_append::@return: scope:[uctoa_append] from uctoa_append::@3 + [95] return + to:@return +uctoa_append::@2: scope:[uctoa_append] from uctoa_append::@1 + [96] (byte) uctoa_append::digit#1 ← ++ (byte) uctoa_append::digit#2 + [97] (byte) uctoa_append::value#1 ← (byte) uctoa_append::value#2 - (byte) uctoa_append::sub#0 + to:uctoa_append::@1 + +(void()) printf_cls() +printf_cls: scope:[printf_cls] from main + [98] phi() + [99] call memset + to:printf_cls::@1 +printf_cls::@1: scope:[printf_cls] from printf_cls + [100] (byte*) printf_line_cursor ← (const byte*) printf_screen + [101] (byte*) printf_char_cursor ← (byte*) printf_line_cursor + to:printf_cls::@return +printf_cls::@return: scope:[printf_cls] from printf_cls::@1 + [102] return + to:@return + + +VARIABLE REGISTER WEIGHTS +(void()) main() +(void*()) memcpy((void*) memcpy::destination , (void*) memcpy::source , (word) memcpy::num) +(void*) memcpy::destination +(byte*) memcpy::dst +(byte*) memcpy::dst#1 1.000000001E9 +(byte*) memcpy::dst#2 1.000000001E9 +(word) memcpy::num +(void*) memcpy::return +(void*) memcpy::source +(byte*) memcpy::src +(byte*) memcpy::src#1 2.000000002E9 +(byte*) memcpy::src#2 1.000000001E9 +(byte*) memcpy::src_end +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +(byte) memset::c +(byte) memset::c#4 1.25000000125E8 +(byte*) memset::dst +(byte*) memset::dst#1 2.000000002E9 +(byte*) memset::dst#2 1.3366666683333335E9 +(byte*) memset::dst#4 2.0000002E7 +(byte*) memset::end +(byte*) memset::end#0 1.683333336666667E8 +(word) memset::num +(word) memset::num#2 1.0000001E7 +(void*) memset::return +(void*) memset::str +(void*) memset::str#3 +(struct printf_buffer_number) printf_buffer loadstore = {} +(byte) printf_buffer_number::sign +(void()) printf_char((byte) printf_char::ch) +(byte*~) printf_char::$8 2000002.0 +(byte) printf_char::ch +(byte) printf_char::ch#1 200002.0 +(byte) printf_char::ch#2 2002.0 +(byte) printf_char::ch#3 1101003.0 +(byte*) printf_char_cursor loadstore 2250002.333333332 +(void()) printf_cls() +(byte) printf_format_number::justify_left +(byte) printf_format_number::min_length +(byte) printf_format_number::radix +(byte) printf_format_number::sign_always +(byte) printf_format_number::zero_padding +(byte) printf_format_string::justify_left +(byte) printf_format_string::min_length +(byte*) printf_line_cursor loadstore 6863641.113636365 +(void()) printf_ln() +(void()) printf_number_buffer((byte) printf_number_buffer::buffer_sign , (byte*) printf_number_buffer::buffer_digits , (byte) printf_number_buffer::format_min_length , (byte) printf_number_buffer::format_justify_left , (byte) printf_number_buffer::format_sign_always , (byte) printf_number_buffer::format_zero_padding , (byte) printf_number_buffer::format_radix) +(struct printf_buffer_number) printf_number_buffer::buffer +(byte*) printf_number_buffer::buffer_digits +(byte) printf_number_buffer::buffer_sign +(byte) printf_number_buffer::buffer_sign#0 701.0 +(struct printf_format_number) printf_number_buffer::format +(byte) printf_number_buffer::format_justify_left +(byte) printf_number_buffer::format_min_length +(byte) printf_number_buffer::format_radix +(byte) printf_number_buffer::format_sign_always +(byte) printf_number_buffer::format_zero_padding +(signed byte) printf_number_buffer::len +(signed byte) printf_number_buffer::padding +(void()) printf_str((byte*) printf_str::str) +(byte) printf_str::ch +(byte) printf_str::ch#0 100001.0 +(byte*) printf_str::str +(byte*) printf_str::str#0 42857.57142857143 +(byte*) printf_str::str#4 205002.5 +(byte*) printf_str::str#6 10001.0 +(void()) printf_uchar((byte) printf_uchar::uvalue , (byte) printf_uchar::format_min_length , (byte) printf_uchar::format_justify_left , (byte) printf_uchar::format_sign_always , (byte) printf_uchar::format_zero_padding , (byte) printf_uchar::format_radix) +(struct printf_format_number) printf_uchar::format +(byte) printf_uchar::format_justify_left +(byte) printf_uchar::format_min_length +(byte) printf_uchar::format_radix +(byte) printf_uchar::format_sign_always +(byte) printf_uchar::format_zero_padding +(byte) printf_uchar::uvalue +(void()) uctoa((byte) uctoa::value , (byte*) uctoa::buffer , (byte) uctoa::radix) +(byte*) uctoa::buffer +(byte*) uctoa::buffer#11 3500.4999999999995 +(byte*) uctoa::buffer#14 15001.5 +(byte*) uctoa::buffer#3 2002.0 +(byte*) uctoa::buffer#4 20002.0 +(byte) uctoa::digit +(byte) uctoa::digit#1 20002.0 +(byte) uctoa::digit#2 3077.230769230769 +(byte) uctoa::digit_value +(byte) uctoa::digit_value#0 6000.6 +(byte*) uctoa::digit_values +(byte) uctoa::max_digits +(byte) uctoa::radix +(byte) uctoa::started +(byte) uctoa::started#2 6000.6 +(byte) uctoa::started#4 10001.0 +(byte) uctoa::value +(byte) uctoa::value#0 10001.0 +(byte) uctoa::value#2 6834.166666666666 +(byte) uctoa::value#6 15001.5 +(byte()) uctoa_append((byte*) uctoa_append::buffer , (byte) uctoa_append::value , (byte) uctoa_append::sub) +(byte*) uctoa_append::buffer +(byte*) uctoa_append::buffer#0 13750.25 +(byte) uctoa_append::digit +(byte) uctoa_append::digit#1 1.0000001E7 +(byte) uctoa_append::digit#2 1.00500015E7 +(byte) uctoa_append::return +(byte) uctoa_append::return#0 20002.0 +(byte) uctoa_append::sub +(byte) uctoa_append::sub#0 3335000.5 +(byte) uctoa_append::value +(byte) uctoa_append::value#0 36667.33333333333 +(byte) uctoa_append::value#1 2.0000002E7 +(byte) uctoa_append::value#2 5018334.166666666 + +Initial phi equivalence classes +[ printf_str::str#4 printf_str::str#6 printf_str::str#0 ] +[ printf_char::ch#3 printf_char::ch#2 printf_char::ch#1 ] +[ memset::num#2 ] +[ memset::str#3 ] +[ memset::c#4 ] +[ memset::dst#2 memset::dst#4 memset::dst#1 ] +[ memcpy::src#2 memcpy::src#1 ] +[ memcpy::dst#2 memcpy::dst#1 ] +[ uctoa::digit#2 uctoa::digit#1 ] +[ uctoa::value#2 uctoa::value#6 uctoa::value#0 ] +[ uctoa::started#2 uctoa::started#4 ] +[ uctoa::buffer#11 uctoa::buffer#14 uctoa::buffer#4 ] +[ uctoa_append::value#2 uctoa_append::value#0 uctoa_append::value#1 ] +[ uctoa_append::digit#2 uctoa_append::digit#1 ] +Added variable printf_line_cursor to live range equivalence class [ printf_line_cursor ] +Added variable printf_char_cursor to live range equivalence class [ printf_char_cursor ] +Added variable printf_str::ch#0 to live range equivalence class [ printf_str::ch#0 ] +Added variable printf_char::$8 to live range equivalence class [ printf_char::$8 ] +Added variable memset::end#0 to live range equivalence class [ memset::end#0 ] +Added variable printf_number_buffer::buffer_sign#0 to live range equivalence class [ printf_number_buffer::buffer_sign#0 ] +Added variable uctoa::buffer#3 to live range equivalence class [ uctoa::buffer#3 ] +Added variable uctoa::digit_value#0 to live range equivalence class [ uctoa::digit_value#0 ] +Added variable uctoa_append::buffer#0 to live range equivalence class [ uctoa_append::buffer#0 ] +Added variable uctoa_append::sub#0 to live range equivalence class [ uctoa_append::sub#0 ] +Added variable uctoa_append::return#0 to live range equivalence class [ uctoa_append::return#0 ] +Added variable printf_buffer to live range equivalence class [ printf_buffer ] +Complete equivalence classes +[ printf_str::str#4 printf_str::str#6 printf_str::str#0 ] +[ printf_char::ch#3 printf_char::ch#2 printf_char::ch#1 ] +[ memset::num#2 ] +[ memset::str#3 ] +[ memset::c#4 ] +[ memset::dst#2 memset::dst#4 memset::dst#1 ] +[ memcpy::src#2 memcpy::src#1 ] +[ memcpy::dst#2 memcpy::dst#1 ] +[ uctoa::digit#2 uctoa::digit#1 ] +[ uctoa::value#2 uctoa::value#6 uctoa::value#0 ] +[ uctoa::started#2 uctoa::started#4 ] +[ uctoa::buffer#11 uctoa::buffer#14 uctoa::buffer#4 ] +[ uctoa_append::value#2 uctoa_append::value#0 uctoa_append::value#1 ] +[ uctoa_append::digit#2 uctoa_append::digit#1 ] +[ printf_line_cursor ] +[ printf_char_cursor ] +[ printf_str::ch#0 ] +[ printf_char::$8 ] +[ memset::end#0 ] +[ printf_number_buffer::buffer_sign#0 ] +[ uctoa::buffer#3 ] +[ uctoa::digit_value#0 ] +[ uctoa_append::buffer#0 ] +[ uctoa_append::sub#0 ] +[ uctoa_append::return#0 ] +[ printf_buffer ] +Allocated zp[2]:2 [ printf_str::str#4 printf_str::str#6 printf_str::str#0 ] +Allocated zp[1]:4 [ printf_char::ch#3 printf_char::ch#2 printf_char::ch#1 ] +Allocated zp[2]:5 [ memset::num#2 ] +Allocated zp[2]:7 [ memset::str#3 ] +Allocated zp[1]:9 [ memset::c#4 ] +Allocated zp[2]:10 [ memset::dst#2 memset::dst#4 memset::dst#1 ] +Allocated zp[2]:12 [ memcpy::src#2 memcpy::src#1 ] +Allocated zp[2]:14 [ memcpy::dst#2 memcpy::dst#1 ] +Allocated zp[1]:16 [ uctoa::digit#2 uctoa::digit#1 ] +Allocated zp[1]:17 [ uctoa::value#2 uctoa::value#6 uctoa::value#0 ] +Allocated zp[1]:18 [ uctoa::started#2 uctoa::started#4 ] +Allocated zp[2]:19 [ uctoa::buffer#11 uctoa::buffer#14 uctoa::buffer#4 ] +Allocated zp[1]:21 [ uctoa_append::value#2 uctoa_append::value#0 uctoa_append::value#1 ] +Allocated zp[1]:22 [ uctoa_append::digit#2 uctoa_append::digit#1 ] +Allocated zp[2]:23 [ printf_line_cursor ] +Allocated zp[2]:25 [ printf_char_cursor ] +Allocated zp[1]:27 [ printf_str::ch#0 ] +Allocated zp[2]:28 [ printf_char::$8 ] +Allocated zp[2]:30 [ memset::end#0 ] +Allocated zp[1]:32 [ printf_number_buffer::buffer_sign#0 ] +Allocated zp[2]:33 [ uctoa::buffer#3 ] +Allocated zp[1]:35 [ uctoa::digit_value#0 ] +Allocated zp[2]:36 [ uctoa_append::buffer#0 ] +Allocated zp[1]:38 [ uctoa_append::sub#0 ] +Allocated zp[1]:39 [ uctoa_append::return#0 ] +Allocated mem[12] [ printf_buffer ] + +INITIAL ASM +Target platform is c64basic / MOS6502X + // File Comments +// Tests printf function call rewriting +// Print a char using %d + // Upstart +.pc = $801 "Basic" +:BasicUpstart(__bbegin) +.pc = $80d "Program" + // Global Constants & labels + .const OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS = 1 + .label printf_screen = $400 + .label printf_line_cursor = $17 + .label printf_char_cursor = $19 + // @begin +__bbegin: + jmp __b1 + // @1 +__b1: + // [1] (byte*) printf_line_cursor ← (byte*) 1024 -- pbuz1=pbuc1 + lda #<$400 + sta.z printf_line_cursor + lda #>$400 + sta.z printf_line_cursor+1 + // [2] (byte*) printf_char_cursor ← (byte*) 1024 -- pbuz1=pbuc1 + lda #<$400 + sta.z printf_char_cursor + lda #>$400 + sta.z printf_char_cursor+1 + // [3] phi from @1 to @2 [phi:@1->@2] +__b2_from___b1: + jmp __b2 + // @2 +__b2: + // [4] call main + // [6] phi from @2 to main [phi:@2->main] +main_from___b2: + jsr main + // [5] phi from @2 to @end [phi:@2->@end] +__bend_from___b2: + jmp __bend + // @end +__bend: + // main +main: { + .label c = 7 + // [7] call printf_cls + // [98] phi from main to printf_cls [phi:main->printf_cls] + printf_cls_from_main: + jsr printf_cls + // [8] phi from main to main::@1 [phi:main->main::@1] + __b1_from_main: + jmp __b1 + // main::@1 + __b1: + // [9] call printf_str + // [15] phi from main::@1 to printf_str [phi:main::@1->printf_str] + printf_str_from___b1: + // [15] phi (byte*) printf_str::str#6 = (const byte*) main::str [phi:main::@1->printf_str#0] -- pbuz1=pbuc1 + lda #str + sta.z printf_str.str+1 + jsr printf_str + // [10] phi from main::@1 to main::@2 [phi:main::@1->main::@2] + __b2_from___b1: + jmp __b2 + // main::@2 + __b2: + // [11] call printf_uchar + // [59] phi from main::@2 to printf_uchar [phi:main::@2->printf_uchar] + printf_uchar_from___b2: + jsr printf_uchar + // [12] phi from main::@2 to main::@3 [phi:main::@2->main::@3] + __b3_from___b2: + jmp __b3 + // main::@3 + __b3: + // [13] call printf_str + // [15] phi from main::@3 to printf_str [phi:main::@3->printf_str] + printf_str_from___b3: + // [15] phi (byte*) printf_str::str#6 = (const byte*) main::str [phi:main::@3->printf_str#0] -- pbuz1=pbuc1 + lda #str + sta.z printf_str.str+1 + jsr printf_str + jmp __breturn + // main::@return + __breturn: + // [14] return + rts + str: .text "" + .byte 0 +} + // printf_str +// Print a zero-terminated string +// Handles escape codes such as newline +// printf_str(byte* zp(2) str) +printf_str: { + .label ch = $1b + .label str = 2 + // [16] phi from printf_str printf_str::@4 printf_str::@5 to printf_str::@1 [phi:printf_str/printf_str::@4/printf_str::@5->printf_str::@1] + __b1_from_printf_str: + __b1_from___b4: + __b1_from___b5: + // [16] phi (byte*) printf_str::str#4 = (byte*) printf_str::str#6 [phi:printf_str/printf_str::@4/printf_str::@5->printf_str::@1#0] -- register_copy + jmp __b1 + // printf_str::@1 + __b1: + jmp __b2 + // printf_str::@2 + __b2: + // [17] (byte) printf_str::ch#0 ← *((byte*) printf_str::str#4) -- vbuz1=_deref_pbuz2 + ldy #0 + lda (str),y + sta.z ch + // [18] (byte*) printf_str::str#0 ← ++ (byte*) printf_str::str#4 -- pbuz1=_inc_pbuz1 + inc.z str + bne !+ + inc.z str+1 + !: + // [19] if((byte) printf_str::ch#0!=(byte) 0) goto printf_str::@3 -- vbuz1_neq_0_then_la1 + lda.z ch + cmp #0 + bne __b3 + jmp __breturn + // printf_str::@return + __breturn: + // [20] return + rts + // printf_str::@3 + __b3: + // [21] if((byte) printf_str::ch#0==(byte) ' ') goto printf_str::@4 -- vbuz1_eq_vbuc1_then_la1 + lda #'\n' + cmp.z ch + beq __b4_from___b3 + jmp __b5 + // printf_str::@5 + __b5: + // [22] (byte) printf_char::ch#1 ← (byte) printf_str::ch#0 -- vbuz1=vbuz2 + lda.z ch + sta.z printf_char.ch + // [23] call printf_char + // [31] phi from printf_str::@5 to printf_char [phi:printf_str::@5->printf_char] + printf_char_from___b5: + // [31] phi (byte) printf_char::ch#3 = (byte) printf_char::ch#1 [phi:printf_str::@5->printf_char#0] -- register_copy + jsr printf_char + jmp __b1_from___b5 + // [24] phi from printf_str::@3 to printf_str::@4 [phi:printf_str::@3->printf_str::@4] + __b4_from___b3: + jmp __b4 + // printf_str::@4 + __b4: + // [25] call printf_ln + // [26] phi from printf_str::@4 to printf_ln [phi:printf_str::@4->printf_ln] + printf_ln_from___b4: + jsr printf_ln + jmp __b1_from___b4 +} + // printf_ln +// Print a newline +printf_ln: { + jmp __b1 + // printf_ln::@1 + __b1: + // [27] (byte*) printf_line_cursor ← (byte*) printf_line_cursor + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 + lda #$28 + clc + adc.z printf_line_cursor + sta.z printf_line_cursor + bcc !+ + inc.z printf_line_cursor+1 + !: + // [28] if((byte*) printf_line_cursor<(byte*) printf_char_cursor) goto printf_ln::@1 -- pbuz1_lt_pbuz2_then_la1 + lda.z printf_line_cursor+1 + cmp.z printf_char_cursor+1 + bcc __b1 + bne !+ + lda.z printf_line_cursor + cmp.z printf_char_cursor + bcc __b1 + !: + jmp __b2 + // printf_ln::@2 + __b2: + // [29] (byte*) printf_char_cursor ← (byte*) printf_line_cursor -- pbuz1=pbuz2 + lda.z printf_line_cursor + sta.z printf_char_cursor + lda.z printf_line_cursor+1 + sta.z printf_char_cursor+1 + jmp __breturn + // printf_ln::@return + __breturn: + // [30] return + rts +} + // printf_char +// Print a single char +// If the end of the screen is reached scroll it up one char and place the cursor at the +// printf_char(byte zp(4) ch) +printf_char: { + .label __8 = $1c + .label ch = 4 + // [32] *((byte*) printf_char_cursor) ← (byte) printf_char::ch#3 -- _deref_pbuz1=vbuz2 + lda.z ch + ldy #0 + sta (printf_char_cursor),y + // [33] (byte*) printf_char_cursor ← ++ (byte*) printf_char_cursor -- pbuz1=_inc_pbuz1 + inc.z printf_char_cursor + bne !+ + inc.z printf_char_cursor+1 + !: + // [34] if((byte*) printf_char_cursor<(const byte*) printf_screen+(word)(number) $28*(number) $19) goto printf_char::@return -- pbuz1_lt_pbuc1_then_la1 + lda.z printf_char_cursor+1 + cmp #>printf_screen+$28*$19 + bcc __breturn + bne !+ + lda.z printf_char_cursor + cmp #printf_char::@1] + __b1_from_printf_char: + jmp __b1 + // printf_char::@1 + __b1: + // [36] call memcpy + // [52] phi from printf_char::@1 to memcpy [phi:printf_char::@1->memcpy] + memcpy_from___b1: + jsr memcpy + // [37] phi from printf_char::@1 to printf_char::@2 [phi:printf_char::@1->printf_char::@2] + __b2_from___b1: + jmp __b2 + // printf_char::@2 + __b2: + // [38] call memset + // [43] phi from printf_char::@2 to memset [phi:printf_char::@2->memset] + memset_from___b2: + // [43] phi (byte) memset::c#4 = (byte) ' ' [phi:printf_char::@2->memset#0] -- vbuz1=vbuc1 + lda #' ' + sta.z memset.c + // [43] phi (void*) memset::str#3 = (void*)(const byte*) printf_screen+(word)(number) $28*(number) $19-(byte) $28 [phi:printf_char::@2->memset#1] -- pvoz1=pvoc1 + lda #printf_screen+$28*$19-$28 + sta.z memset.str+1 + // [43] phi (word) memset::num#2 = (byte) $28 [phi:printf_char::@2->memset#2] -- vwuz1=vbuc1 + lda #<$28 + sta.z memset.num + lda #>$28 + sta.z memset.num+1 + jsr memset + jmp __b3 + // printf_char::@3 + __b3: + // [39] (byte*~) printf_char::$8 ← (byte*) printf_char_cursor - (byte) $28 -- pbuz1=pbuz2_minus_vwuc1 + lda.z printf_char_cursor + sec + sbc #<$28 + sta.z __8 + lda.z printf_char_cursor+1 + sbc #>$28 + sta.z __8+1 + // [40] (byte*) printf_char_cursor ← (byte*~) printf_char::$8 -- pbuz1=pbuz2 + lda.z __8 + sta.z printf_char_cursor + lda.z __8+1 + sta.z printf_char_cursor+1 + // [41] (byte*) printf_line_cursor ← (byte*) printf_char_cursor -- pbuz1=pbuz2 + lda.z printf_char_cursor + sta.z printf_line_cursor + lda.z printf_char_cursor+1 + sta.z printf_line_cursor+1 + jmp __breturn + // printf_char::@return + __breturn: + // [42] return + rts +} + // memset +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +// memset(void* zp(7) str, byte zp(9) c, word zp(5) num) +memset: { + .label end = $1e + .label dst = $a + .label num = 5 + .label str = 7 + .label c = 9 + // [44] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1 + lda.z num + bne !+ + lda.z num+1 + beq __breturn + !: + jmp __b1 + // memset::@1 + __b1: + // [45] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz3 + lda.z str + clc + adc.z num + sta.z end + lda.z str+1 + adc.z num+1 + sta.z end+1 + // [46] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3 -- pbuz1=pbuz2 + lda.z str + sta.z dst + lda.z str+1 + sta.z dst+1 + // [47] phi from memset::@1 memset::@3 to memset::@2 [phi:memset::@1/memset::@3->memset::@2] + __b2_from___b1: + __b2_from___b3: + // [47] phi (byte*) memset::dst#2 = (byte*) memset::dst#4 [phi:memset::@1/memset::@3->memset::@2#0] -- register_copy + jmp __b2 + // memset::@2 + __b2: + // [48] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 -- pbuz1_neq_pbuz2_then_la1 + lda.z dst+1 + cmp.z end+1 + bne __b3 + lda.z dst + cmp.z end + bne __b3 + jmp __breturn + // memset::@return + __breturn: + // [49] return + rts + // memset::@3 + __b3: + // [50] *((byte*) memset::dst#2) ← (byte) memset::c#4 -- _deref_pbuz1=vbuz2 + lda.z c + ldy #0 + sta (dst),y + // [51] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 + inc.z dst + bne !+ + inc.z dst+1 + !: + jmp __b2_from___b3 +} + // memcpy +// Copy block of memory (forwards) +// Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination. +memcpy: { + .label destination = printf_screen + .const num = $28*$19-$28 + .label source = printf_screen+$28 + .label src_end = source+num + .label dst = $e + .label src = $c + // [53] phi from memcpy to memcpy::@1 [phi:memcpy->memcpy::@1] + __b1_from_memcpy: + // [53] phi (byte*) memcpy::dst#2 = (byte*)(const void*) memcpy::destination#0 [phi:memcpy->memcpy::@1#0] -- pbuz1=pbuc1 + lda #destination + sta.z dst+1 + // [53] phi (byte*) memcpy::src#2 = (byte*)(const void*) memcpy::source#0 [phi:memcpy->memcpy::@1#1] -- pbuz1=pbuc1 + lda #source + sta.z src+1 + jmp __b1 + // memcpy::@1 + __b1: + // [54] if((byte*) memcpy::src#2!=(const byte*) memcpy::src_end#0) goto memcpy::@2 -- pbuz1_neq_pbuc1_then_la1 + lda.z src+1 + cmp #>src_end + bne __b2 + lda.z src + cmp #memcpy::@1] + __b1_from___b2: + // [53] phi (byte*) memcpy::dst#2 = (byte*) memcpy::dst#1 [phi:memcpy::@2->memcpy::@1#0] -- register_copy + // [53] phi (byte*) memcpy::src#2 = (byte*) memcpy::src#1 [phi:memcpy::@2->memcpy::@1#1] -- register_copy + jmp __b1 +} + // printf_uchar +// Print an unsigned char using a specific format +printf_uchar: { + jmp __b1 + // printf_uchar::@1 + __b1: + // [60] *((byte*)&(struct printf_buffer_number) printf_buffer) ← (byte) 0 -- _deref_pbuc1=vbuc2 + // Handle any sign + lda #0 + sta printf_buffer + // [61] call uctoa + // Format number into buffer + // [72] phi from printf_uchar::@1 to uctoa [phi:printf_uchar::@1->uctoa] + uctoa_from___b1: + jsr uctoa + jmp __b2 + // printf_uchar::@2 + __b2: + // [62] (byte) printf_number_buffer::buffer_sign#0 ← *((byte*)&(struct printf_buffer_number) printf_buffer) -- vbuz1=_deref_pbuc1 + lda printf_buffer + sta.z printf_number_buffer.buffer_sign + // [63] call printf_number_buffer + // Print using format + // [65] phi from printf_uchar::@2 to printf_number_buffer [phi:printf_uchar::@2->printf_number_buffer] + printf_number_buffer_from___b2: + jsr printf_number_buffer + jmp __breturn + // printf_uchar::@return + __breturn: + // [64] return + rts +} + // printf_number_buffer +// Print the contents of the number buffer using a specific format. +// This handles minimum length, zero-filling, and left/right justification from the format +// printf_number_buffer(byte zp($20) buffer_sign) +printf_number_buffer: { + .label buffer_digits = printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + .label buffer_sign = $20 + jmp __b1 + // printf_number_buffer::@1 + __b1: + // [66] if((byte) 0==(byte) printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuz1_then_la1 + lda #0 + cmp.z buffer_sign + beq __b2_from___b1 + jmp __b3 + // printf_number_buffer::@3 + __b3: + // [67] (byte) printf_char::ch#2 ← (byte) printf_number_buffer::buffer_sign#0 -- vbuz1=vbuz2 + lda.z buffer_sign + sta.z printf_char.ch + // [68] call printf_char + // [31] phi from printf_number_buffer::@3 to printf_char [phi:printf_number_buffer::@3->printf_char] + printf_char_from___b3: + // [31] phi (byte) printf_char::ch#3 = (byte) printf_char::ch#2 [phi:printf_number_buffer::@3->printf_char#0] -- register_copy + jsr printf_char + // [69] phi from printf_number_buffer::@1 printf_number_buffer::@3 to printf_number_buffer::@2 [phi:printf_number_buffer::@1/printf_number_buffer::@3->printf_number_buffer::@2] + __b2_from___b1: + __b2_from___b3: + jmp __b2 + // printf_number_buffer::@2 + __b2: + // [70] call printf_str + // [15] phi from printf_number_buffer::@2 to printf_str [phi:printf_number_buffer::@2->printf_str] + printf_str_from___b2: + // [15] phi (byte*) printf_str::str#6 = (const byte*) printf_number_buffer::buffer_digits#0 [phi:printf_number_buffer::@2->printf_str#0] -- pbuz1=pbuc1 + lda #buffer_digits + sta.z printf_str.str+1 + jsr printf_str + jmp __breturn + // printf_number_buffer::@return + __breturn: + // [71] return + rts +} + // uctoa +// 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) +// uctoa(byte zp($11) value, byte* zp($21) buffer) +uctoa: { + .const max_digits = 3 + .label digit_value = $23 + .label buffer = $21 + .label digit = $10 + .label value = $11 + .label buffer_1 = $13 + .label started = $12 + // [73] phi from uctoa to uctoa::@1 [phi:uctoa->uctoa::@1] + __b1_from_uctoa: + // [73] phi (byte*) uctoa::buffer#11 = (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:uctoa->uctoa::@1#0] -- pbuz1=pbuc1 + lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + sta.z buffer_1+1 + // [73] phi (byte) uctoa::started#2 = (byte) 0 [phi:uctoa->uctoa::@1#1] -- vbuz1=vbuc1 + lda #0 + sta.z started + // [73] phi (byte) uctoa::value#2 = (const byte) main::c [phi:uctoa->uctoa::@1#2] -- vbuz1=vbuc1 + lda #main.c + sta.z value + // [73] phi (byte) uctoa::digit#2 = (byte) 0 [phi:uctoa->uctoa::@1#3] -- vbuz1=vbuc1 + lda #0 + sta.z digit + jmp __b1 + // uctoa::@1 + __b1: + // [74] if((byte) uctoa::digit#2<(const byte) uctoa::max_digits#1-(byte) 1) goto uctoa::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z digit + cmp #max_digits-1 + bcc __b2 + jmp __b3 + // uctoa::@3 + __b3: + // [75] *((byte*) uctoa::buffer#11) ← *((const byte*) DIGITS + (byte) uctoa::value#2) -- _deref_pbuz1=pbuc1_derefidx_vbuz2 + ldy.z value + lda DIGITS,y + ldy #0 + sta (buffer_1),y + // [76] (byte*) uctoa::buffer#3 ← ++ (byte*) uctoa::buffer#11 -- pbuz1=_inc_pbuz2 + lda.z buffer_1 + clc + adc #1 + sta.z buffer + lda.z buffer_1+1 + adc #0 + sta.z buffer+1 + // [77] *((byte*) uctoa::buffer#3) ← (byte) 0 -- _deref_pbuz1=vbuc1 + lda #0 + ldy #0 + sta (buffer),y + jmp __breturn + // uctoa::@return + __breturn: + // [78] return + rts + // uctoa::@2 + __b2: + // [79] (byte) uctoa::digit_value#0 ← *((const byte*) RADIX_DECIMAL_VALUES_CHAR + (byte) uctoa::digit#2) -- vbuz1=pbuc1_derefidx_vbuz2 + ldy.z digit + lda RADIX_DECIMAL_VALUES_CHAR,y + sta.z digit_value + // [80] if((byte) 0!=(byte) uctoa::started#2) goto uctoa::@5 -- vbuc1_neq_vbuz1_then_la1 + lda #0 + cmp.z started + bne __b5 + jmp __b7 + // uctoa::@7 + __b7: + // [81] if((byte) uctoa::value#2>=(byte) uctoa::digit_value#0) goto uctoa::@5 -- vbuz1_ge_vbuz2_then_la1 + lda.z value + cmp.z digit_value + bcs __b5 + // [82] phi from uctoa::@7 to uctoa::@4 [phi:uctoa::@7->uctoa::@4] + __b4_from___b7: + // [82] phi (byte*) uctoa::buffer#14 = (byte*) uctoa::buffer#11 [phi:uctoa::@7->uctoa::@4#0] -- register_copy + // [82] phi (byte) uctoa::started#4 = (byte) uctoa::started#2 [phi:uctoa::@7->uctoa::@4#1] -- register_copy + // [82] phi (byte) uctoa::value#6 = (byte) uctoa::value#2 [phi:uctoa::@7->uctoa::@4#2] -- register_copy + jmp __b4 + // uctoa::@4 + __b4: + // [83] (byte) uctoa::digit#1 ← ++ (byte) uctoa::digit#2 -- vbuz1=_inc_vbuz1 + inc.z digit + // [73] phi from uctoa::@4 to uctoa::@1 [phi:uctoa::@4->uctoa::@1] + __b1_from___b4: + // [73] phi (byte*) uctoa::buffer#11 = (byte*) uctoa::buffer#14 [phi:uctoa::@4->uctoa::@1#0] -- register_copy + // [73] phi (byte) uctoa::started#2 = (byte) uctoa::started#4 [phi:uctoa::@4->uctoa::@1#1] -- register_copy + // [73] phi (byte) uctoa::value#2 = (byte) uctoa::value#6 [phi:uctoa::@4->uctoa::@1#2] -- register_copy + // [73] phi (byte) uctoa::digit#2 = (byte) uctoa::digit#1 [phi:uctoa::@4->uctoa::@1#3] -- register_copy + jmp __b1 + // uctoa::@5 + __b5: + // [84] (byte*) uctoa_append::buffer#0 ← (byte*) uctoa::buffer#11 -- pbuz1=pbuz2 + lda.z buffer_1 + sta.z uctoa_append.buffer + lda.z buffer_1+1 + sta.z uctoa_append.buffer+1 + // [85] (byte) uctoa_append::value#0 ← (byte) uctoa::value#2 -- vbuz1=vbuz2 + lda.z value + sta.z uctoa_append.value + // [86] (byte) uctoa_append::sub#0 ← (byte) uctoa::digit_value#0 -- vbuz1=vbuz2 + lda.z digit_value + sta.z uctoa_append.sub + // [87] call uctoa_append + // [91] phi from uctoa::@5 to uctoa_append [phi:uctoa::@5->uctoa_append] + uctoa_append_from___b5: + jsr uctoa_append + // [88] (byte) uctoa_append::return#0 ← (byte) uctoa_append::value#2 -- vbuz1=vbuz2 + lda.z uctoa_append.value + sta.z uctoa_append.return + jmp __b6 + // uctoa::@6 + __b6: + // [89] (byte) uctoa::value#0 ← (byte) uctoa_append::return#0 -- vbuz1=vbuz2 + lda.z uctoa_append.return + sta.z value + // [90] (byte*) uctoa::buffer#4 ← ++ (byte*) uctoa::buffer#11 -- pbuz1=_inc_pbuz1 + inc.z buffer_1 + bne !+ + inc.z buffer_1+1 + !: + // [82] phi from uctoa::@6 to uctoa::@4 [phi:uctoa::@6->uctoa::@4] + __b4_from___b6: + // [82] phi (byte*) uctoa::buffer#14 = (byte*) uctoa::buffer#4 [phi:uctoa::@6->uctoa::@4#0] -- register_copy + // [82] phi (byte) uctoa::started#4 = (byte) 1 [phi:uctoa::@6->uctoa::@4#1] -- vbuz1=vbuc1 + lda #1 + sta.z started + // [82] phi (byte) uctoa::value#6 = (byte) uctoa::value#0 [phi:uctoa::@6->uctoa::@4#2] -- register_copy + jmp __b4 +} + // uctoa_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. +// uctoa_append(byte* zp($24) buffer, byte zp($15) value, byte zp($26) sub) +uctoa_append: { + .label buffer = $24 + .label value = $15 + .label sub = $26 + .label return = $27 + .label digit = $16 + // [92] phi from uctoa_append to uctoa_append::@1 [phi:uctoa_append->uctoa_append::@1] + __b1_from_uctoa_append: + // [92] phi (byte) uctoa_append::digit#2 = (byte) 0 [phi:uctoa_append->uctoa_append::@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z digit + // [92] phi (byte) uctoa_append::value#2 = (byte) uctoa_append::value#0 [phi:uctoa_append->uctoa_append::@1#1] -- register_copy + jmp __b1 + // uctoa_append::@1 + __b1: + // [93] if((byte) uctoa_append::value#2>=(byte) uctoa_append::sub#0) goto uctoa_append::@2 -- vbuz1_ge_vbuz2_then_la1 + lda.z value + cmp.z sub + bcs __b2 + jmp __b3 + // uctoa_append::@3 + __b3: + // [94] *((byte*) uctoa_append::buffer#0) ← *((const byte*) DIGITS + (byte) uctoa_append::digit#2) -- _deref_pbuz1=pbuc1_derefidx_vbuz2 + ldy.z digit + lda DIGITS,y + ldy #0 + sta (buffer),y + jmp __breturn + // uctoa_append::@return + __breturn: + // [95] return + rts + // uctoa_append::@2 + __b2: + // [96] (byte) uctoa_append::digit#1 ← ++ (byte) uctoa_append::digit#2 -- vbuz1=_inc_vbuz1 + inc.z digit + // [97] (byte) uctoa_append::value#1 ← (byte) uctoa_append::value#2 - (byte) uctoa_append::sub#0 -- vbuz1=vbuz1_minus_vbuz2 + lda.z value + sec + sbc.z sub + sta.z value + // [92] phi from uctoa_append::@2 to uctoa_append::@1 [phi:uctoa_append::@2->uctoa_append::@1] + __b1_from___b2: + // [92] phi (byte) uctoa_append::digit#2 = (byte) uctoa_append::digit#1 [phi:uctoa_append::@2->uctoa_append::@1#0] -- register_copy + // [92] phi (byte) uctoa_append::value#2 = (byte) uctoa_append::value#1 [phi:uctoa_append::@2->uctoa_append::@1#1] -- register_copy + jmp __b1 +} + // printf_cls +// Clear the screen. Also resets current line/char cursor. +printf_cls: { + // [99] call memset + // [43] phi from printf_cls to memset [phi:printf_cls->memset] + memset_from_printf_cls: + // [43] phi (byte) memset::c#4 = (byte) ' ' [phi:printf_cls->memset#0] -- vbuz1=vbuc1 + lda #' ' + sta.z memset.c + // [43] phi (void*) memset::str#3 = (void*)(const byte*) printf_screen [phi:printf_cls->memset#1] -- pvoz1=pvoc1 + lda #printf_screen + sta.z memset.str+1 + // [43] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:printf_cls->memset#2] -- vwuz1=vwuc1 + lda #<$28*$19 + sta.z memset.num + lda #>$28*$19 + sta.z memset.num+1 + jsr memset + jmp __b1 + // printf_cls::@1 + __b1: + // [100] (byte*) printf_line_cursor ← (const byte*) printf_screen -- pbuz1=pbuc1 + lda #printf_screen + sta.z printf_line_cursor+1 + // [101] (byte*) printf_char_cursor ← (byte*) printf_line_cursor -- pbuz1=pbuz2 + lda.z printf_line_cursor + sta.z printf_char_cursor + lda.z printf_line_cursor+1 + sta.z printf_char_cursor+1 + jmp __breturn + // printf_cls::@return + __breturn: + // [102] return + rts +} + // File Data + // The digits used for numbers + DIGITS: .text "0123456789abcdef" + // Values of decimal digits + RADIX_DECIMAL_VALUES_CHAR: .byte $64, $a + // Buffer used for stringified number being printed + printf_buffer: .fill SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER, 0 + +REGISTER UPLIFT POTENTIAL REGISTERS +Statement [1] (byte*) printf_line_cursor ← (byte*) 1024 [ printf_buffer ] ( [ printf_buffer ] { } ) always clobbers reg byte a +Statement [2] (byte*) printf_char_cursor ← (byte*) 1024 [ printf_buffer ] ( [ printf_buffer ] { } ) always clobbers reg byte a +Statement [17] (byte) printf_str::ch#0 ← *((byte*) printf_str::str#4) [ printf_line_cursor printf_char_cursor printf_str::str#4 printf_str::ch#0 ] ( main:4::printf_str:9 [ printf_buffer printf_line_cursor printf_char_cursor printf_str::str#4 printf_str::ch#0 ] { } main:4::printf_str:13 [ printf_line_cursor printf_char_cursor printf_str::str#4 printf_str::ch#0 ] { } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70 [ printf_line_cursor printf_char_cursor printf_str::str#4 printf_str::ch#0 ] { } ) always clobbers reg byte a reg byte y +Statement [27] (byte*) printf_line_cursor ← (byte*) printf_line_cursor + (byte) $28 [ printf_line_cursor printf_char_cursor ] ( main:4::printf_str:9::printf_ln:25 [ printf_buffer printf_str::str#0 printf_line_cursor printf_char_cursor ] { } main:4::printf_str:13::printf_ln:25 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_ln:25 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { } ) always clobbers reg byte a +Statement [28] if((byte*) printf_line_cursor<(byte*) printf_char_cursor) goto printf_ln::@1 [ printf_line_cursor printf_char_cursor ] ( main:4::printf_str:9::printf_ln:25 [ printf_buffer printf_str::str#0 printf_line_cursor printf_char_cursor ] { } main:4::printf_str:13::printf_ln:25 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_ln:25 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { } ) always clobbers reg byte a +Statement [29] (byte*) printf_char_cursor ← (byte*) printf_line_cursor [ printf_line_cursor printf_char_cursor ] ( main:4::printf_str:9::printf_ln:25 [ printf_buffer printf_str::str#0 printf_line_cursor printf_char_cursor ] { } main:4::printf_str:13::printf_ln:25 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_ln:25 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { } ) always clobbers reg byte a +Statement [32] *((byte*) printf_char_cursor) ← (byte) printf_char::ch#3 [ printf_line_cursor printf_char_cursor ] ( main:4::printf_str:9::printf_char:23 [ printf_buffer printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68 [ printf_line_cursor printf_char_cursor ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } ) always clobbers reg byte y +Statement [34] if((byte*) printf_char_cursor<(const byte*) printf_screen+(word)(number) $28*(number) $19) goto printf_char::@return [ printf_line_cursor printf_char_cursor ] ( main:4::printf_str:9::printf_char:23 [ printf_buffer printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68 [ printf_line_cursor printf_char_cursor ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } ) always clobbers reg byte a +Statement [39] (byte*~) printf_char::$8 ← (byte*) printf_char_cursor - (byte) $28 [ printf_char::$8 ] ( main:4::printf_str:9::printf_char:23 [ printf_buffer printf_str::str#0 printf_char::$8 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23 [ printf_str::str#0 printf_char::$8 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23 [ printf_str::str#0 printf_char::$8 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68 [ printf_char::$8 ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } ) always clobbers reg byte a +Statement [40] (byte*) printf_char_cursor ← (byte*~) printf_char::$8 [ printf_char_cursor ] ( main:4::printf_str:9::printf_char:23 [ printf_buffer printf_str::str#0 printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23 [ printf_str::str#0 printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23 [ printf_str::str#0 printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68 [ printf_char_cursor ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } ) always clobbers reg byte a +Statement [41] (byte*) printf_line_cursor ← (byte*) printf_char_cursor [ printf_line_cursor printf_char_cursor ] ( main:4::printf_str:9::printf_char:23 [ printf_buffer printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68 [ printf_line_cursor printf_char_cursor ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } ) always clobbers reg byte a +Statement [44] if((word) memset::num#2<=(byte) 0) goto memset::@return [ memset::num#2 memset::str#3 memset::c#4 ] ( main:4::printf_str:9::printf_char:23::memset:38 [ printf_buffer printf_str::str#0 printf_char_cursor memset::num#2 memset::str#3 memset::c#4 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::num#2 memset::str#3 memset::c#4 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::num#2 memset::str#3 memset::c#4 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68::memset:38 [ printf_char_cursor memset::num#2 memset::str#3 memset::c#4 ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } main:4::printf_cls:7::memset:99 [ printf_buffer memset::num#2 memset::str#3 memset::c#4 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:9 [ memset::c#4 ] +Statement [45] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 [ memset::str#3 memset::c#4 memset::end#0 ] ( main:4::printf_str:9::printf_char:23::memset:38 [ printf_buffer printf_str::str#0 printf_char_cursor memset::str#3 memset::c#4 memset::end#0 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::str#3 memset::c#4 memset::end#0 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::str#3 memset::c#4 memset::end#0 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68::memset:38 [ printf_char_cursor memset::str#3 memset::c#4 memset::end#0 ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } main:4::printf_cls:7::memset:99 [ printf_buffer memset::str#3 memset::c#4 memset::end#0 ] { } ) always clobbers reg byte a +Statement [46] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3 [ memset::c#4 memset::end#0 memset::dst#4 ] ( main:4::printf_str:9::printf_char:23::memset:38 [ printf_buffer printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#4 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#4 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#4 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68::memset:38 [ printf_char_cursor memset::c#4 memset::end#0 memset::dst#4 ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } main:4::printf_cls:7::memset:99 [ printf_buffer memset::c#4 memset::end#0 memset::dst#4 ] { } ) always clobbers reg byte a +Statement [48] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 [ memset::c#4 memset::end#0 memset::dst#2 ] ( main:4::printf_str:9::printf_char:23::memset:38 [ printf_buffer printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68::memset:38 [ printf_char_cursor memset::c#4 memset::end#0 memset::dst#2 ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } main:4::printf_cls:7::memset:99 [ printf_buffer memset::c#4 memset::end#0 memset::dst#2 ] { } ) always clobbers reg byte a +Statement [50] *((byte*) memset::dst#2) ← (byte) memset::c#4 [ memset::c#4 memset::end#0 memset::dst#2 ] ( main:4::printf_str:9::printf_char:23::memset:38 [ printf_buffer printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68::memset:38 [ printf_char_cursor memset::c#4 memset::end#0 memset::dst#2 ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } main:4::printf_cls:7::memset:99 [ printf_buffer memset::c#4 memset::end#0 memset::dst#2 ] { } ) always clobbers reg byte a reg byte y +Removing always clobbered register reg byte y as potential for zp[1]:9 [ memset::c#4 ] +Statement [54] if((byte*) memcpy::src#2!=(const byte*) memcpy::src_end#0) goto memcpy::@2 [ memcpy::src#2 memcpy::dst#2 ] ( main:4::printf_str:9::printf_char:23::memcpy:36 [ printf_buffer printf_str::str#0 printf_char_cursor memcpy::src#2 memcpy::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23::memcpy:36 [ printf_str::str#0 printf_char_cursor memcpy::src#2 memcpy::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23::memcpy:36 [ printf_str::str#0 printf_char_cursor memcpy::src#2 memcpy::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68::memcpy:36 [ printf_char_cursor memcpy::src#2 memcpy::dst#2 ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } ) always clobbers reg byte a +Statement [56] *((byte*) memcpy::dst#2) ← *((byte*) memcpy::src#2) [ memcpy::src#2 memcpy::dst#2 ] ( main:4::printf_str:9::printf_char:23::memcpy:36 [ printf_buffer printf_str::str#0 printf_char_cursor memcpy::src#2 memcpy::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23::memcpy:36 [ printf_str::str#0 printf_char_cursor memcpy::src#2 memcpy::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23::memcpy:36 [ printf_str::str#0 printf_char_cursor memcpy::src#2 memcpy::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68::memcpy:36 [ printf_char_cursor memcpy::src#2 memcpy::dst#2 ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } ) always clobbers reg byte a reg byte y +Statement [60] *((byte*)&(struct printf_buffer_number) printf_buffer) ← (byte) 0 [ printf_line_cursor printf_char_cursor printf_buffer ] ( main:4::printf_uchar:11 [ printf_line_cursor printf_char_cursor printf_buffer ] { } ) always clobbers reg byte a +Statement [75] *((byte*) uctoa::buffer#11) ← *((const byte*) DIGITS + (byte) uctoa::value#2) [ printf_buffer uctoa::buffer#11 ] ( main:4::printf_uchar:11::uctoa:61 [ printf_line_cursor printf_char_cursor printf_buffer uctoa::buffer#11 ] { } ) always clobbers reg byte a reg byte y +Statement [76] (byte*) uctoa::buffer#3 ← ++ (byte*) uctoa::buffer#11 [ printf_buffer uctoa::buffer#3 ] ( main:4::printf_uchar:11::uctoa:61 [ printf_line_cursor printf_char_cursor printf_buffer uctoa::buffer#3 ] { } ) always clobbers reg byte a +Statement [77] *((byte*) uctoa::buffer#3) ← (byte) 0 [ printf_buffer ] ( main:4::printf_uchar:11::uctoa:61 [ printf_line_cursor printf_char_cursor printf_buffer ] { } ) always clobbers reg byte a reg byte y +Statement [84] (byte*) uctoa_append::buffer#0 ← (byte*) uctoa::buffer#11 [ printf_buffer uctoa::digit#2 uctoa::value#2 uctoa::buffer#11 uctoa::digit_value#0 uctoa_append::buffer#0 ] ( main:4::printf_uchar:11::uctoa:61 [ printf_line_cursor printf_char_cursor printf_buffer uctoa::digit#2 uctoa::value#2 uctoa::buffer#11 uctoa::digit_value#0 uctoa_append::buffer#0 ] { { uctoa_append::buffer#0 = uctoa::buffer#11 } { uctoa_append::value#0 = uctoa::value#2 } { uctoa_append::sub#0 = uctoa::digit_value#0 } { uctoa_append::return#0 = uctoa_append::value#2 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:16 [ uctoa::digit#2 uctoa::digit#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:17 [ uctoa::value#2 uctoa::value#6 uctoa::value#0 ] +Removing always clobbered register reg byte a as potential for zp[1]:35 [ uctoa::digit_value#0 ] +Statement [94] *((byte*) uctoa_append::buffer#0) ← *((const byte*) DIGITS + (byte) uctoa_append::digit#2) [ uctoa_append::value#2 ] ( main:4::printf_uchar:11::uctoa:61::uctoa_append:87 [ printf_line_cursor printf_char_cursor printf_buffer uctoa::digit#2 uctoa::buffer#11 uctoa_append::value#2 ] { { uctoa_append::buffer#0 = uctoa::buffer#11 } { uctoa_append::value#0 = uctoa::value#2 } { uctoa_append::sub#0 = uctoa::digit_value#0 } { uctoa_append::return#0 = uctoa_append::value#2 } } ) always clobbers reg byte a reg byte y +Removing always clobbered register reg byte y as potential for zp[1]:16 [ uctoa::digit#2 uctoa::digit#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:21 [ uctoa_append::value#2 uctoa_append::value#0 uctoa_append::value#1 ] +Removing always clobbered register reg byte y as potential for zp[1]:21 [ uctoa_append::value#2 uctoa_append::value#0 uctoa_append::value#1 ] +Statement [97] (byte) uctoa_append::value#1 ← (byte) uctoa_append::value#2 - (byte) uctoa_append::sub#0 [ uctoa_append::buffer#0 uctoa_append::sub#0 uctoa_append::value#1 uctoa_append::digit#1 ] ( main:4::printf_uchar:11::uctoa:61::uctoa_append:87 [ printf_line_cursor printf_char_cursor printf_buffer uctoa::digit#2 uctoa::buffer#11 uctoa_append::buffer#0 uctoa_append::sub#0 uctoa_append::value#1 uctoa_append::digit#1 ] { { uctoa_append::buffer#0 = uctoa::buffer#11 } { uctoa_append::value#0 = uctoa::value#2 } { uctoa_append::sub#0 = uctoa::digit_value#0 } { uctoa_append::return#0 = uctoa_append::value#2 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:38 [ uctoa_append::sub#0 ] +Removing always clobbered register reg byte a as potential for zp[1]:22 [ uctoa_append::digit#2 uctoa_append::digit#1 ] +Statement [100] (byte*) printf_line_cursor ← (const byte*) printf_screen [ printf_line_cursor ] ( main:4::printf_cls:7 [ printf_buffer printf_line_cursor ] { } ) always clobbers reg byte a +Statement [101] (byte*) printf_char_cursor ← (byte*) printf_line_cursor [ printf_line_cursor printf_char_cursor ] ( main:4::printf_cls:7 [ printf_buffer printf_line_cursor printf_char_cursor ] { } ) always clobbers reg byte a +Statement [1] (byte*) printf_line_cursor ← (byte*) 1024 [ printf_buffer ] ( [ printf_buffer ] { } ) always clobbers reg byte a +Statement [2] (byte*) printf_char_cursor ← (byte*) 1024 [ printf_buffer ] ( [ printf_buffer ] { } ) always clobbers reg byte a +Statement [17] (byte) printf_str::ch#0 ← *((byte*) printf_str::str#4) [ printf_line_cursor printf_char_cursor printf_str::str#4 printf_str::ch#0 ] ( main:4::printf_str:9 [ printf_buffer printf_line_cursor printf_char_cursor printf_str::str#4 printf_str::ch#0 ] { } main:4::printf_str:13 [ printf_line_cursor printf_char_cursor printf_str::str#4 printf_str::ch#0 ] { } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70 [ printf_line_cursor printf_char_cursor printf_str::str#4 printf_str::ch#0 ] { } ) always clobbers reg byte a reg byte y +Statement [27] (byte*) printf_line_cursor ← (byte*) printf_line_cursor + (byte) $28 [ printf_line_cursor printf_char_cursor ] ( main:4::printf_str:9::printf_ln:25 [ printf_buffer printf_str::str#0 printf_line_cursor printf_char_cursor ] { } main:4::printf_str:13::printf_ln:25 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_ln:25 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { } ) always clobbers reg byte a +Statement [28] if((byte*) printf_line_cursor<(byte*) printf_char_cursor) goto printf_ln::@1 [ printf_line_cursor printf_char_cursor ] ( main:4::printf_str:9::printf_ln:25 [ printf_buffer printf_str::str#0 printf_line_cursor printf_char_cursor ] { } main:4::printf_str:13::printf_ln:25 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_ln:25 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { } ) always clobbers reg byte a +Statement [29] (byte*) printf_char_cursor ← (byte*) printf_line_cursor [ printf_line_cursor printf_char_cursor ] ( main:4::printf_str:9::printf_ln:25 [ printf_buffer printf_str::str#0 printf_line_cursor printf_char_cursor ] { } main:4::printf_str:13::printf_ln:25 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_ln:25 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { } ) always clobbers reg byte a +Statement [32] *((byte*) printf_char_cursor) ← (byte) printf_char::ch#3 [ printf_line_cursor printf_char_cursor ] ( main:4::printf_str:9::printf_char:23 [ printf_buffer printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68 [ printf_line_cursor printf_char_cursor ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } ) always clobbers reg byte y +Statement [34] if((byte*) printf_char_cursor<(const byte*) printf_screen+(word)(number) $28*(number) $19) goto printf_char::@return [ printf_line_cursor printf_char_cursor ] ( main:4::printf_str:9::printf_char:23 [ printf_buffer printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68 [ printf_line_cursor printf_char_cursor ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } ) always clobbers reg byte a +Statement [39] (byte*~) printf_char::$8 ← (byte*) printf_char_cursor - (byte) $28 [ printf_char::$8 ] ( main:4::printf_str:9::printf_char:23 [ printf_buffer printf_str::str#0 printf_char::$8 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23 [ printf_str::str#0 printf_char::$8 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23 [ printf_str::str#0 printf_char::$8 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68 [ printf_char::$8 ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } ) always clobbers reg byte a +Statement [40] (byte*) printf_char_cursor ← (byte*~) printf_char::$8 [ printf_char_cursor ] ( main:4::printf_str:9::printf_char:23 [ printf_buffer printf_str::str#0 printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23 [ printf_str::str#0 printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23 [ printf_str::str#0 printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68 [ printf_char_cursor ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } ) always clobbers reg byte a +Statement [41] (byte*) printf_line_cursor ← (byte*) printf_char_cursor [ printf_line_cursor printf_char_cursor ] ( main:4::printf_str:9::printf_char:23 [ printf_buffer printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23 [ printf_str::str#0 printf_line_cursor printf_char_cursor ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68 [ printf_line_cursor printf_char_cursor ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } ) always clobbers reg byte a +Statement [44] if((word) memset::num#2<=(byte) 0) goto memset::@return [ memset::num#2 memset::str#3 memset::c#4 ] ( main:4::printf_str:9::printf_char:23::memset:38 [ printf_buffer printf_str::str#0 printf_char_cursor memset::num#2 memset::str#3 memset::c#4 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::num#2 memset::str#3 memset::c#4 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::num#2 memset::str#3 memset::c#4 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68::memset:38 [ printf_char_cursor memset::num#2 memset::str#3 memset::c#4 ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } main:4::printf_cls:7::memset:99 [ printf_buffer memset::num#2 memset::str#3 memset::c#4 ] { } ) always clobbers reg byte a +Statement [45] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 [ memset::str#3 memset::c#4 memset::end#0 ] ( main:4::printf_str:9::printf_char:23::memset:38 [ printf_buffer printf_str::str#0 printf_char_cursor memset::str#3 memset::c#4 memset::end#0 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::str#3 memset::c#4 memset::end#0 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::str#3 memset::c#4 memset::end#0 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68::memset:38 [ printf_char_cursor memset::str#3 memset::c#4 memset::end#0 ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } main:4::printf_cls:7::memset:99 [ printf_buffer memset::str#3 memset::c#4 memset::end#0 ] { } ) always clobbers reg byte a +Statement [46] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3 [ memset::c#4 memset::end#0 memset::dst#4 ] ( main:4::printf_str:9::printf_char:23::memset:38 [ printf_buffer printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#4 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#4 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#4 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68::memset:38 [ printf_char_cursor memset::c#4 memset::end#0 memset::dst#4 ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } main:4::printf_cls:7::memset:99 [ printf_buffer memset::c#4 memset::end#0 memset::dst#4 ] { } ) always clobbers reg byte a +Statement [48] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 [ memset::c#4 memset::end#0 memset::dst#2 ] ( main:4::printf_str:9::printf_char:23::memset:38 [ printf_buffer printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68::memset:38 [ printf_char_cursor memset::c#4 memset::end#0 memset::dst#2 ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } main:4::printf_cls:7::memset:99 [ printf_buffer memset::c#4 memset::end#0 memset::dst#2 ] { } ) always clobbers reg byte a +Statement [50] *((byte*) memset::dst#2) ← (byte) memset::c#4 [ memset::c#4 memset::end#0 memset::dst#2 ] ( main:4::printf_str:9::printf_char:23::memset:38 [ printf_buffer printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23::memset:38 [ printf_str::str#0 printf_char_cursor memset::c#4 memset::end#0 memset::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68::memset:38 [ printf_char_cursor memset::c#4 memset::end#0 memset::dst#2 ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } main:4::printf_cls:7::memset:99 [ printf_buffer memset::c#4 memset::end#0 memset::dst#2 ] { } ) always clobbers reg byte a reg byte y +Statement [54] if((byte*) memcpy::src#2!=(const byte*) memcpy::src_end#0) goto memcpy::@2 [ memcpy::src#2 memcpy::dst#2 ] ( main:4::printf_str:9::printf_char:23::memcpy:36 [ printf_buffer printf_str::str#0 printf_char_cursor memcpy::src#2 memcpy::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23::memcpy:36 [ printf_str::str#0 printf_char_cursor memcpy::src#2 memcpy::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23::memcpy:36 [ printf_str::str#0 printf_char_cursor memcpy::src#2 memcpy::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68::memcpy:36 [ printf_char_cursor memcpy::src#2 memcpy::dst#2 ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } ) always clobbers reg byte a +Statement [56] *((byte*) memcpy::dst#2) ← *((byte*) memcpy::src#2) [ memcpy::src#2 memcpy::dst#2 ] ( main:4::printf_str:9::printf_char:23::memcpy:36 [ printf_buffer printf_str::str#0 printf_char_cursor memcpy::src#2 memcpy::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_str:13::printf_char:23::memcpy:36 [ printf_str::str#0 printf_char_cursor memcpy::src#2 memcpy::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_str:70::printf_char:23::memcpy:36 [ printf_str::str#0 printf_char_cursor memcpy::src#2 memcpy::dst#2 ] { { printf_char::ch#1 = printf_char::ch#3 printf_str::ch#0 } } main:4::printf_uchar:11::printf_number_buffer:63::printf_char:68::memcpy:36 [ printf_char_cursor memcpy::src#2 memcpy::dst#2 ] { { printf_char::ch#2 = printf_char::ch#3 printf_number_buffer::buffer_sign#0 } } ) always clobbers reg byte a reg byte y +Statement [60] *((byte*)&(struct printf_buffer_number) printf_buffer) ← (byte) 0 [ printf_line_cursor printf_char_cursor printf_buffer ] ( main:4::printf_uchar:11 [ printf_line_cursor printf_char_cursor printf_buffer ] { } ) always clobbers reg byte a +Statement [75] *((byte*) uctoa::buffer#11) ← *((const byte*) DIGITS + (byte) uctoa::value#2) [ printf_buffer uctoa::buffer#11 ] ( main:4::printf_uchar:11::uctoa:61 [ printf_line_cursor printf_char_cursor printf_buffer uctoa::buffer#11 ] { } ) always clobbers reg byte a reg byte y +Statement [76] (byte*) uctoa::buffer#3 ← ++ (byte*) uctoa::buffer#11 [ printf_buffer uctoa::buffer#3 ] ( main:4::printf_uchar:11::uctoa:61 [ printf_line_cursor printf_char_cursor printf_buffer uctoa::buffer#3 ] { } ) always clobbers reg byte a +Statement [77] *((byte*) uctoa::buffer#3) ← (byte) 0 [ printf_buffer ] ( main:4::printf_uchar:11::uctoa:61 [ printf_line_cursor printf_char_cursor printf_buffer ] { } ) always clobbers reg byte a reg byte y +Statement [84] (byte*) uctoa_append::buffer#0 ← (byte*) uctoa::buffer#11 [ printf_buffer uctoa::digit#2 uctoa::value#2 uctoa::buffer#11 uctoa::digit_value#0 uctoa_append::buffer#0 ] ( main:4::printf_uchar:11::uctoa:61 [ printf_line_cursor printf_char_cursor printf_buffer uctoa::digit#2 uctoa::value#2 uctoa::buffer#11 uctoa::digit_value#0 uctoa_append::buffer#0 ] { { uctoa_append::buffer#0 = uctoa::buffer#11 } { uctoa_append::value#0 = uctoa::value#2 } { uctoa_append::sub#0 = uctoa::digit_value#0 } { uctoa_append::return#0 = uctoa_append::value#2 } } ) always clobbers reg byte a +Statement [94] *((byte*) uctoa_append::buffer#0) ← *((const byte*) DIGITS + (byte) uctoa_append::digit#2) [ uctoa_append::value#2 ] ( main:4::printf_uchar:11::uctoa:61::uctoa_append:87 [ printf_line_cursor printf_char_cursor printf_buffer uctoa::digit#2 uctoa::buffer#11 uctoa_append::value#2 ] { { uctoa_append::buffer#0 = uctoa::buffer#11 } { uctoa_append::value#0 = uctoa::value#2 } { uctoa_append::sub#0 = uctoa::digit_value#0 } { uctoa_append::return#0 = uctoa_append::value#2 } } ) always clobbers reg byte a reg byte y +Statement [97] (byte) uctoa_append::value#1 ← (byte) uctoa_append::value#2 - (byte) uctoa_append::sub#0 [ uctoa_append::buffer#0 uctoa_append::sub#0 uctoa_append::value#1 uctoa_append::digit#1 ] ( main:4::printf_uchar:11::uctoa:61::uctoa_append:87 [ printf_line_cursor printf_char_cursor printf_buffer uctoa::digit#2 uctoa::buffer#11 uctoa_append::buffer#0 uctoa_append::sub#0 uctoa_append::value#1 uctoa_append::digit#1 ] { { uctoa_append::buffer#0 = uctoa::buffer#11 } { uctoa_append::value#0 = uctoa::value#2 } { uctoa_append::sub#0 = uctoa::digit_value#0 } { uctoa_append::return#0 = uctoa_append::value#2 } } ) always clobbers reg byte a +Statement [100] (byte*) printf_line_cursor ← (const byte*) printf_screen [ printf_line_cursor ] ( main:4::printf_cls:7 [ printf_buffer printf_line_cursor ] { } ) always clobbers reg byte a +Statement [101] (byte*) printf_char_cursor ← (byte*) printf_line_cursor [ printf_line_cursor printf_char_cursor ] ( main:4::printf_cls:7 [ printf_buffer printf_line_cursor printf_char_cursor ] { } ) always clobbers reg byte a +Potential registers zp[2]:2 [ printf_str::str#4 printf_str::str#6 printf_str::str#0 ] : zp[2]:2 , +Potential registers zp[1]:4 [ printf_char::ch#3 printf_char::ch#2 printf_char::ch#1 ] : zp[1]:4 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:5 [ memset::num#2 ] : zp[2]:5 , +Potential registers zp[2]:7 [ memset::str#3 ] : zp[2]:7 , +Potential registers zp[1]:9 [ memset::c#4 ] : zp[1]:9 , reg byte x , +Potential registers zp[2]:10 [ memset::dst#2 memset::dst#4 memset::dst#1 ] : zp[2]:10 , +Potential registers zp[2]:12 [ memcpy::src#2 memcpy::src#1 ] : zp[2]:12 , +Potential registers zp[2]:14 [ memcpy::dst#2 memcpy::dst#1 ] : zp[2]:14 , +Potential registers zp[1]:16 [ uctoa::digit#2 uctoa::digit#1 ] : zp[1]:16 , reg byte x , +Potential registers zp[1]:17 [ uctoa::value#2 uctoa::value#6 uctoa::value#0 ] : zp[1]:17 , reg byte x , reg byte y , +Potential registers zp[1]:18 [ uctoa::started#2 uctoa::started#4 ] : zp[1]:18 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:19 [ uctoa::buffer#11 uctoa::buffer#14 uctoa::buffer#4 ] : zp[2]:19 , +Potential registers zp[1]:21 [ uctoa_append::value#2 uctoa_append::value#0 uctoa_append::value#1 ] : zp[1]:21 , reg byte x , +Potential registers zp[1]:22 [ uctoa_append::digit#2 uctoa_append::digit#1 ] : zp[1]:22 , reg byte x , reg byte y , +Potential registers zp[2]:23 [ printf_line_cursor ] : zp[2]:23 , +Potential registers zp[2]:25 [ printf_char_cursor ] : zp[2]:25 , +Potential registers zp[1]:27 [ printf_str::ch#0 ] : zp[1]:27 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:28 [ printf_char::$8 ] : zp[2]:28 , +Potential registers zp[2]:30 [ memset::end#0 ] : zp[2]:30 , +Potential registers zp[1]:32 [ printf_number_buffer::buffer_sign#0 ] : zp[1]:32 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:33 [ uctoa::buffer#3 ] : zp[2]:33 , +Potential registers zp[1]:35 [ uctoa::digit_value#0 ] : zp[1]:35 , reg byte x , reg byte y , +Potential registers zp[2]:36 [ uctoa_append::buffer#0 ] : zp[2]:36 , +Potential registers zp[1]:38 [ uctoa_append::sub#0 ] : zp[1]:38 , reg byte x , reg byte y , +Potential registers zp[1]:39 [ uctoa_append::return#0 ] : zp[1]:39 , reg byte a , reg byte x , reg byte y , +Potential registers mem[12] [ printf_buffer ] : mem[12] , + +REGISTER UPLIFT SCOPES +Uplift Scope [memcpy] 3,000,000,003: zp[2]:12 [ memcpy::src#2 memcpy::src#1 ] 2,000,000,002: zp[2]:14 [ memcpy::dst#2 memcpy::dst#1 ] +Uplift Scope [memset] 3,356,666,672.33: zp[2]:10 [ memset::dst#2 memset::dst#4 memset::dst#1 ] 168,333,333.67: zp[2]:30 [ memset::end#0 ] 125,000,000.12: zp[1]:9 [ memset::c#4 ] 10,000,001: zp[2]:5 [ memset::num#2 ] 0: zp[2]:7 [ memset::str#3 ] +Uplift Scope [uctoa_append] 25,055,003.5: zp[1]:21 [ uctoa_append::value#2 uctoa_append::value#0 uctoa_append::value#1 ] 20,050,002.5: zp[1]:22 [ uctoa_append::digit#2 uctoa_append::digit#1 ] 3,335,000.5: zp[1]:38 [ uctoa_append::sub#0 ] 20,002: zp[1]:39 [ uctoa_append::return#0 ] 13,750.25: zp[2]:36 [ uctoa_append::buffer#0 ] +Uplift Scope [] 6,863,641.11: zp[2]:23 [ printf_line_cursor ] 2,250,002.33: zp[2]:25 [ printf_char_cursor ] 0: mem[12] [ printf_buffer ] +Uplift Scope [printf_char] 2,000,002: zp[2]:28 [ printf_char::$8 ] 1,303,007: zp[1]:4 [ printf_char::ch#3 printf_char::ch#2 printf_char::ch#1 ] +Uplift Scope [printf_str] 257,861.07: zp[2]:2 [ printf_str::str#4 printf_str::str#6 printf_str::str#0 ] 100,001: zp[1]:27 [ printf_str::ch#0 ] +Uplift Scope [uctoa] 38,504: zp[2]:19 [ uctoa::buffer#11 uctoa::buffer#14 uctoa::buffer#4 ] 31,836.67: zp[1]:17 [ uctoa::value#2 uctoa::value#6 uctoa::value#0 ] 23,079.23: zp[1]:16 [ uctoa::digit#2 uctoa::digit#1 ] 16,001.6: zp[1]:18 [ uctoa::started#2 uctoa::started#4 ] 6,000.6: zp[1]:35 [ uctoa::digit_value#0 ] 2,002: zp[2]:33 [ uctoa::buffer#3 ] +Uplift Scope [printf_number_buffer] 701: zp[1]:32 [ printf_number_buffer::buffer_sign#0 ] +Uplift Scope [RADIX] +Uplift Scope [printf_format_number] +Uplift Scope [printf_buffer_number] +Uplift Scope [printf_format_string] +Uplift Scope [printf_cls] +Uplift Scope [printf_ln] +Uplift Scope [printf_uchar] +Uplift Scope [main] + +Uplifting [memcpy] best 23913 combination zp[2]:12 [ memcpy::src#2 memcpy::src#1 ] zp[2]:14 [ memcpy::dst#2 memcpy::dst#1 ] +Uplifting [memset] best 23807 combination zp[2]:10 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:30 [ memset::end#0 ] reg byte x [ memset::c#4 ] zp[2]:5 [ memset::num#2 ] zp[2]:7 [ memset::str#3 ] +Uplifting [uctoa_append] best 22584 combination reg byte x [ uctoa_append::value#2 uctoa_append::value#0 uctoa_append::value#1 ] reg byte y [ uctoa_append::digit#2 uctoa_append::digit#1 ] zp[1]:38 [ uctoa_append::sub#0 ] reg byte x [ uctoa_append::return#0 ] zp[2]:36 [ uctoa_append::buffer#0 ] +Uplifting [] best 22584 combination zp[2]:23 [ printf_line_cursor ] zp[2]:25 [ printf_char_cursor ] mem[12] [ printf_buffer ] +Uplifting [printf_char] best 22548 combination zp[2]:28 [ printf_char::$8 ] reg byte a [ printf_char::ch#3 printf_char::ch#2 printf_char::ch#1 ] +Uplifting [printf_str] best 22428 combination zp[2]:2 [ printf_str::str#4 printf_str::str#6 printf_str::str#0 ] reg byte a [ printf_str::ch#0 ] +Uplifting [uctoa] best 22305 combination zp[2]:19 [ uctoa::buffer#11 uctoa::buffer#14 uctoa::buffer#4 ] reg byte x [ uctoa::value#2 uctoa::value#6 uctoa::value#0 ] zp[1]:16 [ uctoa::digit#2 uctoa::digit#1 ] zp[1]:18 [ uctoa::started#2 uctoa::started#4 ] zp[1]:35 [ uctoa::digit_value#0 ] zp[2]:33 [ uctoa::buffer#3 ] +Uplifting [printf_number_buffer] best 22296 combination reg byte a [ printf_number_buffer::buffer_sign#0 ] +Uplifting [RADIX] best 22296 combination +Uplifting [printf_format_number] best 22296 combination +Uplifting [printf_buffer_number] best 22296 combination +Uplifting [printf_format_string] best 22296 combination +Uplifting [printf_cls] best 22296 combination +Uplifting [printf_ln] best 22296 combination +Uplifting [printf_uchar] best 22296 combination +Uplifting [main] best 22296 combination +Attempting to uplift remaining variables inzp[1]:38 [ uctoa_append::sub#0 ] +Uplifting [uctoa_append] best 22296 combination zp[1]:38 [ uctoa_append::sub#0 ] +Attempting to uplift remaining variables inzp[1]:16 [ uctoa::digit#2 uctoa::digit#1 ] +Uplifting [uctoa] best 22296 combination zp[1]:16 [ uctoa::digit#2 uctoa::digit#1 ] +Attempting to uplift remaining variables inzp[1]:18 [ uctoa::started#2 uctoa::started#4 ] +Uplifting [uctoa] best 22296 combination zp[1]:18 [ uctoa::started#2 uctoa::started#4 ] +Attempting to uplift remaining variables inzp[1]:35 [ uctoa::digit_value#0 ] +Uplifting [uctoa] best 22296 combination zp[1]:35 [ uctoa::digit_value#0 ] +Coalescing zero page register [ zp[2]:25 [ printf_char_cursor ] ] with [ zp[2]:28 [ printf_char::$8 ] ] - score: 2 +Coalescing zero page register [ zp[2]:5 [ memset::num#2 ] ] with [ zp[2]:30 [ memset::end#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:7 [ memset::str#3 ] ] with [ zp[2]:10 [ memset::dst#2 memset::dst#4 memset::dst#1 ] ] - score: 1 +Coalescing zero page register [ zp[2]:19 [ uctoa::buffer#11 uctoa::buffer#14 uctoa::buffer#4 ] ] with [ zp[2]:33 [ uctoa::buffer#3 ] ] - score: 1 +Coalescing zero page register [ zp[2]:19 [ uctoa::buffer#11 uctoa::buffer#14 uctoa::buffer#4 uctoa::buffer#3 ] ] with [ zp[2]:36 [ uctoa_append::buffer#0 ] ] - score: 1 +Coalescing zero page register [ zp[1]:35 [ uctoa::digit_value#0 ] ] with [ zp[1]:38 [ uctoa_append::sub#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:12 [ memcpy::src#2 memcpy::src#1 ] ] with [ zp[2]:5 [ memset::num#2 memset::end#0 ] ] +Coalescing zero page register [ zp[2]:14 [ memcpy::dst#2 memcpy::dst#1 ] ] with [ zp[2]:7 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ] ] +Coalescing zero page register [ zp[2]:19 [ uctoa::buffer#11 uctoa::buffer#14 uctoa::buffer#4 uctoa::buffer#3 uctoa_append::buffer#0 ] ] with [ zp[2]:2 [ printf_str::str#4 printf_str::str#6 printf_str::str#0 ] ] +Coalescing zero page register [ zp[2]:23 [ printf_line_cursor ] ] with [ zp[2]:12 [ memcpy::src#2 memcpy::src#1 memset::num#2 memset::end#0 ] ] +Allocated (was zp[2]:14) zp[2]:2 [ memcpy::dst#2 memcpy::dst#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ] +Allocated (was zp[1]:16) zp[1]:4 [ uctoa::digit#2 uctoa::digit#1 ] +Allocated (was zp[1]:18) zp[1]:5 [ uctoa::started#2 uctoa::started#4 ] +Allocated (was zp[2]:19) zp[2]:6 [ uctoa::buffer#11 uctoa::buffer#14 uctoa::buffer#4 uctoa::buffer#3 uctoa_append::buffer#0 printf_str::str#4 printf_str::str#6 printf_str::str#0 ] +Allocated (was zp[2]:23) zp[2]:8 [ printf_line_cursor memcpy::src#2 memcpy::src#1 memset::num#2 memset::end#0 ] +Allocated (was zp[2]:25) zp[2]:10 [ printf_char_cursor printf_char::$8 ] +Allocated (was zp[1]:35) zp[1]:12 [ uctoa::digit_value#0 uctoa_append::sub#0 ] + +ASSEMBLER BEFORE OPTIMIZATION + // File Comments +// Tests printf function call rewriting +// Print a char using %d + // Upstart +.pc = $801 "Basic" +:BasicUpstart(__bbegin) +.pc = $80d "Program" + // Global Constants & labels + .const OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS = 1 + .label printf_screen = $400 + .const SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER = $c + .label printf_line_cursor = 8 + .label printf_char_cursor = $a + // @begin +__bbegin: + jmp __b1 + // @1 +__b1: + // [1] (byte*) printf_line_cursor ← (byte*) 1024 -- pbuz1=pbuc1 + lda #<$400 + sta.z printf_line_cursor + lda #>$400 + sta.z printf_line_cursor+1 + // [2] (byte*) printf_char_cursor ← (byte*) 1024 -- pbuz1=pbuc1 + lda #<$400 + sta.z printf_char_cursor + lda #>$400 + sta.z printf_char_cursor+1 + // [3] phi from @1 to @2 [phi:@1->@2] +__b2_from___b1: + jmp __b2 + // @2 +__b2: + // [4] call main + // [6] phi from @2 to main [phi:@2->main] +main_from___b2: + jsr main + // [5] phi from @2 to @end [phi:@2->@end] +__bend_from___b2: + jmp __bend + // @end +__bend: + // main +main: { + .label c = 7 + // [7] call printf_cls + // [98] phi from main to printf_cls [phi:main->printf_cls] + printf_cls_from_main: + jsr printf_cls + // [8] phi from main to main::@1 [phi:main->main::@1] + __b1_from_main: + jmp __b1 + // main::@1 + __b1: + // [9] call printf_str + // [15] phi from main::@1 to printf_str [phi:main::@1->printf_str] + printf_str_from___b1: + // [15] phi (byte*) printf_str::str#6 = (const byte*) main::str [phi:main::@1->printf_str#0] -- pbuz1=pbuc1 + lda #str + sta.z printf_str.str+1 + jsr printf_str + // [10] phi from main::@1 to main::@2 [phi:main::@1->main::@2] + __b2_from___b1: + jmp __b2 + // main::@2 + __b2: + // [11] call printf_uchar + // [59] phi from main::@2 to printf_uchar [phi:main::@2->printf_uchar] + printf_uchar_from___b2: + jsr printf_uchar + // [12] phi from main::@2 to main::@3 [phi:main::@2->main::@3] + __b3_from___b2: + jmp __b3 + // main::@3 + __b3: + // [13] call printf_str + // [15] phi from main::@3 to printf_str [phi:main::@3->printf_str] + printf_str_from___b3: + // [15] phi (byte*) printf_str::str#6 = (const byte*) main::str [phi:main::@3->printf_str#0] -- pbuz1=pbuc1 + lda #str + sta.z printf_str.str+1 + jsr printf_str + jmp __breturn + // main::@return + __breturn: + // [14] return + rts + str: .text "" + .byte 0 +} + // printf_str +// Print a zero-terminated string +// Handles escape codes such as newline +// printf_str(byte* zp(6) str) +printf_str: { + .label str = 6 + // [16] phi from printf_str printf_str::@4 printf_str::@5 to printf_str::@1 [phi:printf_str/printf_str::@4/printf_str::@5->printf_str::@1] + __b1_from_printf_str: + __b1_from___b4: + __b1_from___b5: + // [16] phi (byte*) printf_str::str#4 = (byte*) printf_str::str#6 [phi:printf_str/printf_str::@4/printf_str::@5->printf_str::@1#0] -- register_copy + jmp __b1 + // printf_str::@1 + __b1: + jmp __b2 + // printf_str::@2 + __b2: + // [17] (byte) printf_str::ch#0 ← *((byte*) printf_str::str#4) -- vbuaa=_deref_pbuz1 + ldy #0 + lda (str),y + // [18] (byte*) printf_str::str#0 ← ++ (byte*) printf_str::str#4 -- pbuz1=_inc_pbuz1 + inc.z str + bne !+ + inc.z str+1 + !: + // [19] if((byte) printf_str::ch#0!=(byte) 0) goto printf_str::@3 -- vbuaa_neq_0_then_la1 + cmp #0 + bne __b3 + jmp __breturn + // printf_str::@return + __breturn: + // [20] return + rts + // printf_str::@3 + __b3: + // [21] if((byte) printf_str::ch#0==(byte) ' ') goto printf_str::@4 -- vbuaa_eq_vbuc1_then_la1 + cmp #'\n' + beq __b4_from___b3 + jmp __b5 + // printf_str::@5 + __b5: + // [22] (byte) printf_char::ch#1 ← (byte) printf_str::ch#0 + // [23] call printf_char + // [31] phi from printf_str::@5 to printf_char [phi:printf_str::@5->printf_char] + printf_char_from___b5: + // [31] phi (byte) printf_char::ch#3 = (byte) printf_char::ch#1 [phi:printf_str::@5->printf_char#0] -- register_copy + jsr printf_char + jmp __b1_from___b5 + // [24] phi from printf_str::@3 to printf_str::@4 [phi:printf_str::@3->printf_str::@4] + __b4_from___b3: + jmp __b4 + // printf_str::@4 + __b4: + // [25] call printf_ln + // [26] phi from printf_str::@4 to printf_ln [phi:printf_str::@4->printf_ln] + printf_ln_from___b4: + jsr printf_ln + jmp __b1_from___b4 +} + // printf_ln +// Print a newline +printf_ln: { + jmp __b1 + // printf_ln::@1 + __b1: + // [27] (byte*) printf_line_cursor ← (byte*) printf_line_cursor + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 + lda #$28 + clc + adc.z printf_line_cursor + sta.z printf_line_cursor + bcc !+ + inc.z printf_line_cursor+1 + !: + // [28] if((byte*) printf_line_cursor<(byte*) printf_char_cursor) goto printf_ln::@1 -- pbuz1_lt_pbuz2_then_la1 + lda.z printf_line_cursor+1 + cmp.z printf_char_cursor+1 + bcc __b1 + bne !+ + lda.z printf_line_cursor + cmp.z printf_char_cursor + bcc __b1 + !: + jmp __b2 + // printf_ln::@2 + __b2: + // [29] (byte*) printf_char_cursor ← (byte*) printf_line_cursor -- pbuz1=pbuz2 + lda.z printf_line_cursor + sta.z printf_char_cursor + lda.z printf_line_cursor+1 + sta.z printf_char_cursor+1 + jmp __breturn + // printf_ln::@return + __breturn: + // [30] return + rts +} + // printf_char +// Print a single char +// If the end of the screen is reached scroll it up one char and place the cursor at the +// printf_char(byte register(A) ch) +printf_char: { + .label __8 = $a + // [32] *((byte*) printf_char_cursor) ← (byte) printf_char::ch#3 -- _deref_pbuz1=vbuaa + ldy #0 + sta (printf_char_cursor),y + // [33] (byte*) printf_char_cursor ← ++ (byte*) printf_char_cursor -- pbuz1=_inc_pbuz1 + inc.z printf_char_cursor + bne !+ + inc.z printf_char_cursor+1 + !: + // [34] if((byte*) printf_char_cursor<(const byte*) printf_screen+(word)(number) $28*(number) $19) goto printf_char::@return -- pbuz1_lt_pbuc1_then_la1 + lda.z printf_char_cursor+1 + cmp #>printf_screen+$28*$19 + bcc __breturn + bne !+ + lda.z printf_char_cursor + cmp #printf_char::@1] + __b1_from_printf_char: + jmp __b1 + // printf_char::@1 + __b1: + // [36] call memcpy + // [52] phi from printf_char::@1 to memcpy [phi:printf_char::@1->memcpy] + memcpy_from___b1: + jsr memcpy + // [37] phi from printf_char::@1 to printf_char::@2 [phi:printf_char::@1->printf_char::@2] + __b2_from___b1: + jmp __b2 + // printf_char::@2 + __b2: + // [38] call memset + // [43] phi from printf_char::@2 to memset [phi:printf_char::@2->memset] + memset_from___b2: + // [43] phi (byte) memset::c#4 = (byte) ' ' [phi:printf_char::@2->memset#0] -- vbuxx=vbuc1 + ldx #' ' + // [43] phi (void*) memset::str#3 = (void*)(const byte*) printf_screen+(word)(number) $28*(number) $19-(byte) $28 [phi:printf_char::@2->memset#1] -- pvoz1=pvoc1 + lda #printf_screen+$28*$19-$28 + sta.z memset.str+1 + // [43] phi (word) memset::num#2 = (byte) $28 [phi:printf_char::@2->memset#2] -- vwuz1=vbuc1 + lda #<$28 + sta.z memset.num + lda #>$28 + sta.z memset.num+1 + jsr memset + jmp __b3 + // printf_char::@3 + __b3: + // [39] (byte*~) printf_char::$8 ← (byte*) printf_char_cursor - (byte) $28 -- pbuz1=pbuz1_minus_vwuc1 + lda.z __8 + sec + sbc #<$28 + sta.z __8 + lda.z __8+1 + sbc #>$28 + sta.z __8+1 + // [40] (byte*) printf_char_cursor ← (byte*~) printf_char::$8 + // [41] (byte*) printf_line_cursor ← (byte*) printf_char_cursor -- pbuz1=pbuz2 + lda.z printf_char_cursor + sta.z printf_line_cursor + lda.z printf_char_cursor+1 + sta.z printf_line_cursor+1 + jmp __breturn + // printf_char::@return + __breturn: + // [42] return + rts +} + // memset +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +// memset(void* zp(2) str, byte register(X) c, word zp(8) num) +memset: { + .label end = 8 + .label dst = 2 + .label num = 8 + .label str = 2 + // [44] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1 + lda.z num + bne !+ + lda.z num+1 + beq __breturn + !: + jmp __b1 + // memset::@1 + __b1: + // [45] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz1 + lda.z end + clc + adc.z str + sta.z end + lda.z end+1 + adc.z str+1 + sta.z end+1 + // [46] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3 + // [47] phi from memset::@1 memset::@3 to memset::@2 [phi:memset::@1/memset::@3->memset::@2] + __b2_from___b1: + __b2_from___b3: + // [47] phi (byte*) memset::dst#2 = (byte*) memset::dst#4 [phi:memset::@1/memset::@3->memset::@2#0] -- register_copy + jmp __b2 + // memset::@2 + __b2: + // [48] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 -- pbuz1_neq_pbuz2_then_la1 + lda.z dst+1 + cmp.z end+1 + bne __b3 + lda.z dst + cmp.z end + bne __b3 + jmp __breturn + // memset::@return + __breturn: + // [49] return + rts + // memset::@3 + __b3: + // [50] *((byte*) memset::dst#2) ← (byte) memset::c#4 -- _deref_pbuz1=vbuxx + txa + ldy #0 + sta (dst),y + // [51] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 + inc.z dst + bne !+ + inc.z dst+1 + !: + jmp __b2_from___b3 +} + // memcpy +// Copy block of memory (forwards) +// Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination. +memcpy: { + .label destination = printf_screen + .const num = $28*$19-$28 + .label source = printf_screen+$28 + .label src_end = source+num + .label dst = 2 + .label src = 8 + // [53] phi from memcpy to memcpy::@1 [phi:memcpy->memcpy::@1] + __b1_from_memcpy: + // [53] phi (byte*) memcpy::dst#2 = (byte*)(const void*) memcpy::destination#0 [phi:memcpy->memcpy::@1#0] -- pbuz1=pbuc1 + lda #destination + sta.z dst+1 + // [53] phi (byte*) memcpy::src#2 = (byte*)(const void*) memcpy::source#0 [phi:memcpy->memcpy::@1#1] -- pbuz1=pbuc1 + lda #source + sta.z src+1 + jmp __b1 + // memcpy::@1 + __b1: + // [54] if((byte*) memcpy::src#2!=(const byte*) memcpy::src_end#0) goto memcpy::@2 -- pbuz1_neq_pbuc1_then_la1 + lda.z src+1 + cmp #>src_end + bne __b2 + lda.z src + cmp #memcpy::@1] + __b1_from___b2: + // [53] phi (byte*) memcpy::dst#2 = (byte*) memcpy::dst#1 [phi:memcpy::@2->memcpy::@1#0] -- register_copy + // [53] phi (byte*) memcpy::src#2 = (byte*) memcpy::src#1 [phi:memcpy::@2->memcpy::@1#1] -- register_copy + jmp __b1 +} + // printf_uchar +// Print an unsigned char using a specific format +printf_uchar: { + jmp __b1 + // printf_uchar::@1 + __b1: + // [60] *((byte*)&(struct printf_buffer_number) printf_buffer) ← (byte) 0 -- _deref_pbuc1=vbuc2 + // Handle any sign + lda #0 + sta printf_buffer + // [61] call uctoa + // Format number into buffer + // [72] phi from printf_uchar::@1 to uctoa [phi:printf_uchar::@1->uctoa] + uctoa_from___b1: + jsr uctoa + jmp __b2 + // printf_uchar::@2 + __b2: + // [62] (byte) printf_number_buffer::buffer_sign#0 ← *((byte*)&(struct printf_buffer_number) printf_buffer) -- vbuaa=_deref_pbuc1 + lda printf_buffer + // [63] call printf_number_buffer + // Print using format + // [65] phi from printf_uchar::@2 to printf_number_buffer [phi:printf_uchar::@2->printf_number_buffer] + printf_number_buffer_from___b2: + jsr printf_number_buffer + jmp __breturn + // printf_uchar::@return + __breturn: + // [64] return + rts +} + // printf_number_buffer +// Print the contents of the number buffer using a specific format. +// This handles minimum length, zero-filling, and left/right justification from the format +// printf_number_buffer(byte register(A) buffer_sign) +printf_number_buffer: { + .label buffer_digits = printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + jmp __b1 + // printf_number_buffer::@1 + __b1: + // [66] if((byte) 0==(byte) printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1 + cmp #0 + beq __b2_from___b1 + jmp __b3 + // printf_number_buffer::@3 + __b3: + // [67] (byte) printf_char::ch#2 ← (byte) printf_number_buffer::buffer_sign#0 + // [68] call printf_char + // [31] phi from printf_number_buffer::@3 to printf_char [phi:printf_number_buffer::@3->printf_char] + printf_char_from___b3: + // [31] phi (byte) printf_char::ch#3 = (byte) printf_char::ch#2 [phi:printf_number_buffer::@3->printf_char#0] -- register_copy + jsr printf_char + // [69] phi from printf_number_buffer::@1 printf_number_buffer::@3 to printf_number_buffer::@2 [phi:printf_number_buffer::@1/printf_number_buffer::@3->printf_number_buffer::@2] + __b2_from___b1: + __b2_from___b3: + jmp __b2 + // printf_number_buffer::@2 + __b2: + // [70] call printf_str + // [15] phi from printf_number_buffer::@2 to printf_str [phi:printf_number_buffer::@2->printf_str] + printf_str_from___b2: + // [15] phi (byte*) printf_str::str#6 = (const byte*) printf_number_buffer::buffer_digits#0 [phi:printf_number_buffer::@2->printf_str#0] -- pbuz1=pbuc1 + lda #buffer_digits + sta.z printf_str.str+1 + jsr printf_str + jmp __breturn + // printf_number_buffer::@return + __breturn: + // [71] return + rts +} + // uctoa +// 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) +// uctoa(byte register(X) value, byte* zp(6) buffer) +uctoa: { + .const max_digits = 3 + .label digit_value = $c + .label buffer = 6 + .label digit = 4 + .label started = 5 + // [73] phi from uctoa to uctoa::@1 [phi:uctoa->uctoa::@1] + __b1_from_uctoa: + // [73] phi (byte*) uctoa::buffer#11 = (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:uctoa->uctoa::@1#0] -- pbuz1=pbuc1 + lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + sta.z buffer+1 + // [73] phi (byte) uctoa::started#2 = (byte) 0 [phi:uctoa->uctoa::@1#1] -- vbuz1=vbuc1 + lda #0 + sta.z started + // [73] phi (byte) uctoa::value#2 = (const byte) main::c [phi:uctoa->uctoa::@1#2] -- vbuxx=vbuc1 + ldx #main.c + // [73] phi (byte) uctoa::digit#2 = (byte) 0 [phi:uctoa->uctoa::@1#3] -- vbuz1=vbuc1 + lda #0 + sta.z digit + jmp __b1 + // uctoa::@1 + __b1: + // [74] if((byte) uctoa::digit#2<(const byte) uctoa::max_digits#1-(byte) 1) goto uctoa::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z digit + cmp #max_digits-1 + bcc __b2 + jmp __b3 + // uctoa::@3 + __b3: + // [75] *((byte*) uctoa::buffer#11) ← *((const byte*) DIGITS + (byte) uctoa::value#2) -- _deref_pbuz1=pbuc1_derefidx_vbuxx + lda DIGITS,x + ldy #0 + sta (buffer),y + // [76] (byte*) uctoa::buffer#3 ← ++ (byte*) uctoa::buffer#11 -- pbuz1=_inc_pbuz1 + inc.z buffer + bne !+ + inc.z buffer+1 + !: + // [77] *((byte*) uctoa::buffer#3) ← (byte) 0 -- _deref_pbuz1=vbuc1 + lda #0 + ldy #0 + sta (buffer),y + jmp __breturn + // uctoa::@return + __breturn: + // [78] return + rts + // uctoa::@2 + __b2: + // [79] (byte) uctoa::digit_value#0 ← *((const byte*) RADIX_DECIMAL_VALUES_CHAR + (byte) uctoa::digit#2) -- vbuz1=pbuc1_derefidx_vbuz2 + ldy.z digit + lda RADIX_DECIMAL_VALUES_CHAR,y + sta.z digit_value + // [80] if((byte) 0!=(byte) uctoa::started#2) goto uctoa::@5 -- vbuc1_neq_vbuz1_then_la1 + lda #0 + cmp.z started + bne __b5 + jmp __b7 + // uctoa::@7 + __b7: + // [81] if((byte) uctoa::value#2>=(byte) uctoa::digit_value#0) goto uctoa::@5 -- vbuxx_ge_vbuz1_then_la1 + cpx.z digit_value + bcs __b5 + // [82] phi from uctoa::@7 to uctoa::@4 [phi:uctoa::@7->uctoa::@4] + __b4_from___b7: + // [82] phi (byte*) uctoa::buffer#14 = (byte*) uctoa::buffer#11 [phi:uctoa::@7->uctoa::@4#0] -- register_copy + // [82] phi (byte) uctoa::started#4 = (byte) uctoa::started#2 [phi:uctoa::@7->uctoa::@4#1] -- register_copy + // [82] phi (byte) uctoa::value#6 = (byte) uctoa::value#2 [phi:uctoa::@7->uctoa::@4#2] -- register_copy + jmp __b4 + // uctoa::@4 + __b4: + // [83] (byte) uctoa::digit#1 ← ++ (byte) uctoa::digit#2 -- vbuz1=_inc_vbuz1 + inc.z digit + // [73] phi from uctoa::@4 to uctoa::@1 [phi:uctoa::@4->uctoa::@1] + __b1_from___b4: + // [73] phi (byte*) uctoa::buffer#11 = (byte*) uctoa::buffer#14 [phi:uctoa::@4->uctoa::@1#0] -- register_copy + // [73] phi (byte) uctoa::started#2 = (byte) uctoa::started#4 [phi:uctoa::@4->uctoa::@1#1] -- register_copy + // [73] phi (byte) uctoa::value#2 = (byte) uctoa::value#6 [phi:uctoa::@4->uctoa::@1#2] -- register_copy + // [73] phi (byte) uctoa::digit#2 = (byte) uctoa::digit#1 [phi:uctoa::@4->uctoa::@1#3] -- register_copy + jmp __b1 + // uctoa::@5 + __b5: + // [84] (byte*) uctoa_append::buffer#0 ← (byte*) uctoa::buffer#11 + // [85] (byte) uctoa_append::value#0 ← (byte) uctoa::value#2 + // [86] (byte) uctoa_append::sub#0 ← (byte) uctoa::digit_value#0 + // [87] call uctoa_append + // [91] phi from uctoa::@5 to uctoa_append [phi:uctoa::@5->uctoa_append] + uctoa_append_from___b5: + jsr uctoa_append + // [88] (byte) uctoa_append::return#0 ← (byte) uctoa_append::value#2 + jmp __b6 + // uctoa::@6 + __b6: + // [89] (byte) uctoa::value#0 ← (byte) uctoa_append::return#0 + // [90] (byte*) uctoa::buffer#4 ← ++ (byte*) uctoa::buffer#11 -- pbuz1=_inc_pbuz1 + inc.z buffer + bne !+ + inc.z buffer+1 + !: + // [82] phi from uctoa::@6 to uctoa::@4 [phi:uctoa::@6->uctoa::@4] + __b4_from___b6: + // [82] phi (byte*) uctoa::buffer#14 = (byte*) uctoa::buffer#4 [phi:uctoa::@6->uctoa::@4#0] -- register_copy + // [82] phi (byte) uctoa::started#4 = (byte) 1 [phi:uctoa::@6->uctoa::@4#1] -- vbuz1=vbuc1 + lda #1 + sta.z started + // [82] phi (byte) uctoa::value#6 = (byte) uctoa::value#0 [phi:uctoa::@6->uctoa::@4#2] -- register_copy + jmp __b4 +} + // uctoa_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. +// uctoa_append(byte* zp(6) buffer, byte register(X) value, byte zp($c) sub) +uctoa_append: { + .label buffer = 6 + .label sub = $c + // [92] phi from uctoa_append to uctoa_append::@1 [phi:uctoa_append->uctoa_append::@1] + __b1_from_uctoa_append: + // [92] phi (byte) uctoa_append::digit#2 = (byte) 0 [phi:uctoa_append->uctoa_append::@1#0] -- vbuyy=vbuc1 + ldy #0 + // [92] phi (byte) uctoa_append::value#2 = (byte) uctoa_append::value#0 [phi:uctoa_append->uctoa_append::@1#1] -- register_copy + jmp __b1 + // uctoa_append::@1 + __b1: + // [93] if((byte) uctoa_append::value#2>=(byte) uctoa_append::sub#0) goto uctoa_append::@2 -- vbuxx_ge_vbuz1_then_la1 + cpx.z sub + bcs __b2 + jmp __b3 + // uctoa_append::@3 + __b3: + // [94] *((byte*) uctoa_append::buffer#0) ← *((const byte*) DIGITS + (byte) uctoa_append::digit#2) -- _deref_pbuz1=pbuc1_derefidx_vbuyy + lda DIGITS,y + ldy #0 + sta (buffer),y + jmp __breturn + // uctoa_append::@return + __breturn: + // [95] return + rts + // uctoa_append::@2 + __b2: + // [96] (byte) uctoa_append::digit#1 ← ++ (byte) uctoa_append::digit#2 -- vbuyy=_inc_vbuyy + iny + // [97] (byte) uctoa_append::value#1 ← (byte) uctoa_append::value#2 - (byte) uctoa_append::sub#0 -- vbuxx=vbuxx_minus_vbuz1 + txa + sec + sbc.z sub + tax + // [92] phi from uctoa_append::@2 to uctoa_append::@1 [phi:uctoa_append::@2->uctoa_append::@1] + __b1_from___b2: + // [92] phi (byte) uctoa_append::digit#2 = (byte) uctoa_append::digit#1 [phi:uctoa_append::@2->uctoa_append::@1#0] -- register_copy + // [92] phi (byte) uctoa_append::value#2 = (byte) uctoa_append::value#1 [phi:uctoa_append::@2->uctoa_append::@1#1] -- register_copy + jmp __b1 +} + // printf_cls +// Clear the screen. Also resets current line/char cursor. +printf_cls: { + // [99] call memset + // [43] phi from printf_cls to memset [phi:printf_cls->memset] + memset_from_printf_cls: + // [43] phi (byte) memset::c#4 = (byte) ' ' [phi:printf_cls->memset#0] -- vbuxx=vbuc1 + ldx #' ' + // [43] phi (void*) memset::str#3 = (void*)(const byte*) printf_screen [phi:printf_cls->memset#1] -- pvoz1=pvoc1 + lda #printf_screen + sta.z memset.str+1 + // [43] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:printf_cls->memset#2] -- vwuz1=vwuc1 + lda #<$28*$19 + sta.z memset.num + lda #>$28*$19 + sta.z memset.num+1 + jsr memset + jmp __b1 + // printf_cls::@1 + __b1: + // [100] (byte*) printf_line_cursor ← (const byte*) printf_screen -- pbuz1=pbuc1 + lda #printf_screen + sta.z printf_line_cursor+1 + // [101] (byte*) printf_char_cursor ← (byte*) printf_line_cursor -- pbuz1=pbuz2 + lda.z printf_line_cursor + sta.z printf_char_cursor + lda.z printf_line_cursor+1 + sta.z printf_char_cursor+1 + jmp __breturn + // printf_cls::@return + __breturn: + // [102] return + rts +} + // File Data + // The digits used for numbers + DIGITS: .text "0123456789abcdef" + // Values of decimal digits + RADIX_DECIMAL_VALUES_CHAR: .byte $64, $a + // Buffer used for stringified number being printed + printf_buffer: .fill SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER, 0 + +ASSEMBLER OPTIMIZATIONS +Removing instruction jmp __b1 +Removing instruction jmp __b2 +Removing instruction jmp __bend +Removing instruction jmp __b1 +Removing instruction jmp __b2 +Removing instruction jmp __b3 +Removing instruction jmp __breturn +Removing instruction jmp __b1 +Removing instruction jmp __b2 +Removing instruction jmp __breturn +Removing instruction jmp __b5 +Removing instruction jmp __b4 +Removing instruction jmp __b1 +Removing instruction jmp __b2 +Removing instruction jmp __breturn +Removing instruction jmp __b1 +Removing instruction jmp __b2 +Removing instruction jmp __b3 +Removing instruction jmp __breturn +Removing instruction jmp __b1 +Removing instruction jmp __b2 +Removing instruction jmp __breturn +Removing instruction jmp __b1 +Removing instruction jmp __breturn +Removing instruction jmp __b1 +Removing instruction jmp __b2 +Removing instruction jmp __breturn +Removing instruction jmp __b1 +Removing instruction jmp __b3 +Removing instruction jmp __b2 +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 __b3 +Removing instruction jmp __breturn +Removing instruction jmp __b1 +Removing instruction jmp __breturn +Succesful ASM optimization Pass5NextJumpElimination +Removing instruction ldy #0 +Removing instruction lda #0 +Replacing instruction ldy #0 with TAY +Succesful ASM optimization Pass5UnnecesaryLoadElimination +Replacing label __b4_from___b3 with __b4 +Replacing label __b1_from___b5 with __b2 +Replacing label __b1_from___b4 with __b2 +Replacing label __b2_from___b3 with __b2 +Replacing label __b2_from___b1 with __b2 +Removing instruction __b1: +Removing instruction __b2_from___b1: +Removing instruction main_from___b2: +Removing instruction __bend_from___b2: +Removing instruction __b1_from_main: +Removing instruction printf_str_from___b1: +Removing instruction __b2_from___b1: +Removing instruction printf_uchar_from___b2: +Removing instruction __b3_from___b2: +Removing instruction printf_str_from___b3: +Removing instruction __b1_from_printf_str: +Removing instruction __b1_from___b4: +Removing instruction __b1_from___b5: +Removing instruction __b1: +Removing instruction printf_char_from___b5: +Removing instruction __b4_from___b3: +Removing instruction printf_ln_from___b4: +Removing instruction __b1_from_printf_char: +Removing instruction memcpy_from___b1: +Removing instruction __b2_from___b1: +Removing instruction memset_from___b2: +Removing instruction __b2_from___b1: +Removing instruction __b2_from___b3: +Removing instruction printf_char_from___b3: +Removing instruction __b2_from___b1: +Removing instruction __b2_from___b3: +Removing instruction printf_str_from___b2: +Removing instruction __b4_from___b7: +Removing instruction uctoa_append_from___b5: +Succesful ASM optimization Pass5RedundantLabelElimination +Removing instruction __b2: +Removing instruction __bend: +Removing instruction printf_cls_from_main: +Removing instruction __b1: +Removing instruction __b2: +Removing instruction __b3: +Removing instruction __breturn: +Removing instruction __breturn: +Removing instruction __b5: +Removing instruction __b2: +Removing instruction __breturn: +Removing instruction __b1: +Removing instruction __b2: +Removing instruction __b3: +Removing instruction __b1: +Removing instruction __b1_from_memcpy: +Removing instruction __breturn: +Removing instruction __b1_from___b2: +Removing instruction __b1: +Removing instruction uctoa_from___b1: +Removing instruction __b2: +Removing instruction printf_number_buffer_from___b2: +Removing instruction __breturn: +Removing instruction __b1: +Removing instruction __b3: +Removing instruction __breturn: +Removing instruction __b1_from_uctoa: +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_uctoa_append: +Removing instruction __b3: +Removing instruction __breturn: +Removing instruction __b1_from___b2: +Removing instruction memset_from_printf_cls: +Removing instruction __b1: +Removing instruction __breturn: +Succesful ASM optimization Pass5UnusedLabelElimination +Adding RTS to root block +Succesful ASM optimization Pass5AddMainRts + +FINAL SYMBOL TABLE +(label) @1 +(label) @2 +(label) @begin +(label) @end +(const byte*) DIGITS[] = (byte*) "0123456789abcdef"z +(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS = (byte) 1 +(const byte) RADIX::BINARY = (number) 2 +(const byte) RADIX::DECIMAL = (number) $a +(const byte) RADIX::HEXADECIMAL = (number) $10 +(const byte) RADIX::OCTAL = (number) 8 +(const byte*) RADIX_DECIMAL_VALUES_CHAR[] = { (byte) $64, (byte) $a } +(const byte) SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER = (byte) $c +(void()) main() +(label) main::@1 +(label) main::@2 +(label) main::@3 +(label) main::@return +(const byte) main::c = (byte) 7 +(const byte*) main::str[(byte) 1] = (byte*) "" +(void*()) memcpy((void*) memcpy::destination , (void*) memcpy::source , (word) memcpy::num) +(label) memcpy::@1 +(label) memcpy::@2 +(label) memcpy::@return +(void*) memcpy::destination +(const void*) memcpy::destination#0 destination = (void*)(const byte*) printf_screen +(byte*) memcpy::dst +(byte*) memcpy::dst#1 dst zp[2]:2 1.000000001E9 +(byte*) memcpy::dst#2 dst zp[2]:2 1.000000001E9 +(word) memcpy::num +(const word) memcpy::num#0 num = (word)(number) $28*(number) $19-(number) $28 +(void*) memcpy::return +(void*) memcpy::source +(const void*) memcpy::source#0 source = (void*)(const byte*) printf_screen+(byte) $28 +(byte*) memcpy::src +(byte*) memcpy::src#1 src zp[2]:8 2.000000002E9 +(byte*) memcpy::src#2 src zp[2]:8 1.000000001E9 +(byte*) memcpy::src_end +(const byte*) memcpy::src_end#0 src_end = (byte*)(const void*) memcpy::source#0+(const word) memcpy::num#0 +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +(label) memset::@1 +(label) memset::@2 +(label) memset::@3 +(label) memset::@return +(byte) memset::c +(byte) memset::c#4 reg byte x 1.25000000125E8 +(byte*) memset::dst +(byte*) memset::dst#1 dst zp[2]:2 2.000000002E9 +(byte*) memset::dst#2 dst zp[2]:2 1.3366666683333335E9 +(byte*) memset::dst#4 dst zp[2]:2 2.0000002E7 +(byte*) memset::end +(byte*) memset::end#0 end zp[2]:8 1.683333336666667E8 +(word) memset::num +(word) memset::num#2 num zp[2]:8 1.0000001E7 +(void*) memset::return +(void*) memset::str +(void*) memset::str#3 str zp[2]:2 +(struct printf_buffer_number) printf_buffer loadstore mem[12] = {} +(const byte*) printf_buffer_number::digits[(number) $b] = { fill( $b, 0) } +(byte) printf_buffer_number::sign +(void()) printf_char((byte) printf_char::ch) +(byte*~) printf_char::$8 zp[2]:10 2000002.0 +(label) printf_char::@1 +(label) printf_char::@2 +(label) printf_char::@3 +(label) printf_char::@return +(byte) printf_char::ch +(byte) printf_char::ch#1 reg byte a 200002.0 +(byte) printf_char::ch#2 reg byte a 2002.0 +(byte) printf_char::ch#3 reg byte a 1101003.0 +(byte*) printf_char_cursor loadstore zp[2]:10 2250002.333333332 +(void()) printf_cls() +(label) printf_cls::@1 +(label) printf_cls::@return +(byte) printf_format_number::justify_left +(byte) printf_format_number::min_length +(byte) printf_format_number::radix +(byte) printf_format_number::sign_always +(byte) printf_format_number::zero_padding +(byte) printf_format_string::justify_left +(byte) printf_format_string::min_length +(byte*) printf_line_cursor loadstore zp[2]:8 6863641.113636365 +(void()) printf_ln() +(label) printf_ln::@1 +(label) printf_ln::@2 +(label) printf_ln::@return +(void()) printf_number_buffer((byte) printf_number_buffer::buffer_sign , (byte*) printf_number_buffer::buffer_digits , (byte) printf_number_buffer::format_min_length , (byte) printf_number_buffer::format_justify_left , (byte) printf_number_buffer::format_sign_always , (byte) printf_number_buffer::format_zero_padding , (byte) printf_number_buffer::format_radix) +(label) printf_number_buffer::@1 +(label) printf_number_buffer::@2 +(label) printf_number_buffer::@3 +(label) printf_number_buffer::@return +(struct printf_buffer_number) printf_number_buffer::buffer +(byte*) printf_number_buffer::buffer_digits +(const byte*) printf_number_buffer::buffer_digits#0 buffer_digits = (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS +(byte) printf_number_buffer::buffer_sign +(byte) printf_number_buffer::buffer_sign#0 reg byte a 701.0 +(struct printf_format_number) printf_number_buffer::format +(byte) printf_number_buffer::format_justify_left +(byte) printf_number_buffer::format_min_length +(byte) printf_number_buffer::format_radix +(byte) printf_number_buffer::format_sign_always +(byte) printf_number_buffer::format_zero_padding +(signed byte) printf_number_buffer::len +(signed byte) printf_number_buffer::padding +(const byte*) printf_screen = (byte*) 1024 +(void()) printf_str((byte*) printf_str::str) +(label) printf_str::@1 +(label) printf_str::@2 +(label) printf_str::@3 +(label) printf_str::@4 +(label) printf_str::@5 +(label) printf_str::@return +(byte) printf_str::ch +(byte) printf_str::ch#0 reg byte a 100001.0 +(byte*) printf_str::str +(byte*) printf_str::str#0 str zp[2]:6 42857.57142857143 +(byte*) printf_str::str#4 str zp[2]:6 205002.5 +(byte*) printf_str::str#6 str zp[2]:6 10001.0 +(void()) printf_uchar((byte) printf_uchar::uvalue , (byte) printf_uchar::format_min_length , (byte) printf_uchar::format_justify_left , (byte) printf_uchar::format_sign_always , (byte) printf_uchar::format_zero_padding , (byte) printf_uchar::format_radix) +(label) printf_uchar::@1 +(label) printf_uchar::@2 +(label) printf_uchar::@return +(struct printf_format_number) printf_uchar::format +(byte) printf_uchar::format_justify_left +(byte) printf_uchar::format_min_length +(byte) printf_uchar::format_radix +(byte) printf_uchar::format_sign_always +(byte) printf_uchar::format_zero_padding +(byte) printf_uchar::uvalue +(void()) uctoa((byte) uctoa::value , (byte*) uctoa::buffer , (byte) uctoa::radix) +(label) uctoa::@1 +(label) uctoa::@2 +(label) uctoa::@3 +(label) uctoa::@4 +(label) uctoa::@5 +(label) uctoa::@6 +(label) uctoa::@7 +(label) uctoa::@return +(byte*) uctoa::buffer +(byte*) uctoa::buffer#11 buffer zp[2]:6 3500.4999999999995 +(byte*) uctoa::buffer#14 buffer zp[2]:6 15001.5 +(byte*) uctoa::buffer#3 buffer zp[2]:6 2002.0 +(byte*) uctoa::buffer#4 buffer zp[2]:6 20002.0 +(byte) uctoa::digit +(byte) uctoa::digit#1 digit zp[1]:4 20002.0 +(byte) uctoa::digit#2 digit zp[1]:4 3077.230769230769 +(byte) uctoa::digit_value +(byte) uctoa::digit_value#0 digit_value zp[1]:12 6000.6 +(byte*) uctoa::digit_values +(byte) uctoa::max_digits +(const byte) uctoa::max_digits#1 max_digits = (byte) 3 +(byte) uctoa::radix +(byte) uctoa::started +(byte) uctoa::started#2 started zp[1]:5 6000.6 +(byte) uctoa::started#4 started zp[1]:5 10001.0 +(byte) uctoa::value +(byte) uctoa::value#0 reg byte x 10001.0 +(byte) uctoa::value#2 reg byte x 6834.166666666666 +(byte) uctoa::value#6 reg byte x 15001.5 +(byte()) uctoa_append((byte*) uctoa_append::buffer , (byte) uctoa_append::value , (byte) uctoa_append::sub) +(label) uctoa_append::@1 +(label) uctoa_append::@2 +(label) uctoa_append::@3 +(label) uctoa_append::@return +(byte*) uctoa_append::buffer +(byte*) uctoa_append::buffer#0 buffer zp[2]:6 13750.25 +(byte) uctoa_append::digit +(byte) uctoa_append::digit#1 reg byte y 1.0000001E7 +(byte) uctoa_append::digit#2 reg byte y 1.00500015E7 +(byte) uctoa_append::return +(byte) uctoa_append::return#0 reg byte x 20002.0 +(byte) uctoa_append::sub +(byte) uctoa_append::sub#0 sub zp[1]:12 3335000.5 +(byte) uctoa_append::value +(byte) uctoa_append::value#0 reg byte x 36667.33333333333 +(byte) uctoa_append::value#1 reg byte x 2.0000002E7 +(byte) uctoa_append::value#2 reg byte x 5018334.166666666 + +reg byte a [ printf_char::ch#3 printf_char::ch#2 printf_char::ch#1 ] +reg byte x [ memset::c#4 ] +zp[2]:2 [ memcpy::dst#2 memcpy::dst#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ] +zp[1]:4 [ uctoa::digit#2 uctoa::digit#1 ] +reg byte x [ uctoa::value#2 uctoa::value#6 uctoa::value#0 ] +zp[1]:5 [ uctoa::started#2 uctoa::started#4 ] +zp[2]:6 [ uctoa::buffer#11 uctoa::buffer#14 uctoa::buffer#4 uctoa::buffer#3 uctoa_append::buffer#0 printf_str::str#4 printf_str::str#6 printf_str::str#0 ] +reg byte x [ uctoa_append::value#2 uctoa_append::value#0 uctoa_append::value#1 ] +reg byte y [ uctoa_append::digit#2 uctoa_append::digit#1 ] +zp[2]:8 [ printf_line_cursor memcpy::src#2 memcpy::src#1 memset::num#2 memset::end#0 ] +zp[2]:10 [ printf_char_cursor printf_char::$8 ] +reg byte a [ printf_str::ch#0 ] +reg byte a [ printf_number_buffer::buffer_sign#0 ] +zp[1]:12 [ uctoa::digit_value#0 uctoa_append::sub#0 ] +reg byte x [ uctoa_append::return#0 ] +mem[12] [ printf_buffer ] + + +FINAL ASSEMBLER +Score: 19289 + + // File Comments +// Tests printf function call rewriting +// Print a char using %d + // Upstart +.pc = $801 "Basic" +:BasicUpstart(__bbegin) +.pc = $80d "Program" + // Global Constants & labels + .const OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS = 1 + .label printf_screen = $400 + .const SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER = $c + .label printf_line_cursor = 8 + .label printf_char_cursor = $a + // @begin +__bbegin: + // @1 + // printf_line_cursor = PRINTF_SCREEN_ADDRESS + // [1] (byte*) printf_line_cursor ← (byte*) 1024 -- pbuz1=pbuc1 + lda #<$400 + sta.z printf_line_cursor + lda #>$400 + sta.z printf_line_cursor+1 + // printf_char_cursor = PRINTF_SCREEN_ADDRESS + // [2] (byte*) printf_char_cursor ← (byte*) 1024 -- pbuz1=pbuc1 + lda #<$400 + sta.z printf_char_cursor + lda #>$400 + sta.z printf_char_cursor+1 + // [3] phi from @1 to @2 [phi:@1->@2] + // @2 + // [4] call main + // [6] phi from @2 to main [phi:@2->main] + jsr main + rts + // [5] phi from @2 to @end [phi:@2->@end] + // @end + // main +main: { + .label c = 7 + // printf_cls() + // [7] call printf_cls + // [98] phi from main to printf_cls [phi:main->printf_cls] + jsr printf_cls + // [8] phi from main to main::@1 [phi:main->main::@1] + // main::@1 + // printf("%hhu", c) + // [9] call printf_str + // [15] phi from main::@1 to printf_str [phi:main::@1->printf_str] + // [15] phi (byte*) printf_str::str#6 = (const byte*) main::str [phi:main::@1->printf_str#0] -- pbuz1=pbuc1 + lda #str + sta.z printf_str.str+1 + jsr printf_str + // [10] phi from main::@1 to main::@2 [phi:main::@1->main::@2] + // main::@2 + // printf("%hhu", c) + // [11] call printf_uchar + // [59] phi from main::@2 to printf_uchar [phi:main::@2->printf_uchar] + jsr printf_uchar + // [12] phi from main::@2 to main::@3 [phi:main::@2->main::@3] + // main::@3 + // printf("%hhu", c) + // [13] call printf_str + // [15] phi from main::@3 to printf_str [phi:main::@3->printf_str] + // [15] phi (byte*) printf_str::str#6 = (const byte*) main::str [phi:main::@3->printf_str#0] -- pbuz1=pbuc1 + lda #str + sta.z printf_str.str+1 + jsr printf_str + // main::@return + // } + // [14] return + rts + str: .text "" + .byte 0 +} + // printf_str +// Print a zero-terminated string +// Handles escape codes such as newline +// printf_str(byte* zp(6) str) +printf_str: { + .label str = 6 + // [16] phi from printf_str printf_str::@4 printf_str::@5 to printf_str::@1 [phi:printf_str/printf_str::@4/printf_str::@5->printf_str::@1] + // [16] phi (byte*) printf_str::str#4 = (byte*) printf_str::str#6 [phi:printf_str/printf_str::@4/printf_str::@5->printf_str::@1#0] -- register_copy + // printf_str::@1 + // printf_str::@2 + __b2: + // ch = *str++ + // [17] (byte) printf_str::ch#0 ← *((byte*) printf_str::str#4) -- vbuaa=_deref_pbuz1 + ldy #0 + lda (str),y + // [18] (byte*) printf_str::str#0 ← ++ (byte*) printf_str::str#4 -- pbuz1=_inc_pbuz1 + inc.z str + bne !+ + inc.z str+1 + !: + // if(ch==0) + // [19] if((byte) printf_str::ch#0!=(byte) 0) goto printf_str::@3 -- vbuaa_neq_0_then_la1 + cmp #0 + bne __b3 + // printf_str::@return + // } + // [20] return + rts + // printf_str::@3 + __b3: + // if(ch=='\n') + // [21] if((byte) printf_str::ch#0==(byte) ' ') goto printf_str::@4 -- vbuaa_eq_vbuc1_then_la1 + cmp #'\n' + beq __b4 + // printf_str::@5 + // printf_char(ch) + // [22] (byte) printf_char::ch#1 ← (byte) printf_str::ch#0 + // [23] call printf_char + // [31] phi from printf_str::@5 to printf_char [phi:printf_str::@5->printf_char] + // [31] phi (byte) printf_char::ch#3 = (byte) printf_char::ch#1 [phi:printf_str::@5->printf_char#0] -- register_copy + jsr printf_char + jmp __b2 + // [24] phi from printf_str::@3 to printf_str::@4 [phi:printf_str::@3->printf_str::@4] + // printf_str::@4 + __b4: + // printf_ln() + // [25] call printf_ln + // [26] phi from printf_str::@4 to printf_ln [phi:printf_str::@4->printf_ln] + jsr printf_ln + jmp __b2 +} + // printf_ln +// Print a newline +printf_ln: { + // printf_ln::@1 + __b1: + // printf_line_cursor += PRINTF_SCREEN_WIDTH + // [27] (byte*) printf_line_cursor ← (byte*) printf_line_cursor + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 + lda #$28 + clc + adc.z printf_line_cursor + sta.z printf_line_cursor + bcc !+ + inc.z printf_line_cursor+1 + !: + // while (printf_line_cursor=(printf_screen+PRINTF_SCREEN_BYTES)) + // [34] if((byte*) printf_char_cursor<(const byte*) printf_screen+(word)(number) $28*(number) $19) goto printf_char::@return -- pbuz1_lt_pbuc1_then_la1 + lda.z printf_char_cursor+1 + cmp #>printf_screen+$28*$19 + bcc __breturn + bne !+ + lda.z printf_char_cursor + cmp #printf_char::@1] + // printf_char::@1 + // memcpy(printf_screen, printf_screen+PRINTF_SCREEN_WIDTH, PRINTF_SCREEN_BYTES-PRINTF_SCREEN_WIDTH) + // [36] call memcpy + // [52] phi from printf_char::@1 to memcpy [phi:printf_char::@1->memcpy] + jsr memcpy + // [37] phi from printf_char::@1 to printf_char::@2 [phi:printf_char::@1->printf_char::@2] + // printf_char::@2 + // memset(printf_screen+PRINTF_SCREEN_BYTES-PRINTF_SCREEN_WIDTH, ' ', PRINTF_SCREEN_WIDTH) + // [38] call memset + // [43] phi from printf_char::@2 to memset [phi:printf_char::@2->memset] + // [43] phi (byte) memset::c#4 = (byte) ' ' [phi:printf_char::@2->memset#0] -- vbuxx=vbuc1 + ldx #' ' + // [43] phi (void*) memset::str#3 = (void*)(const byte*) printf_screen+(word)(number) $28*(number) $19-(byte) $28 [phi:printf_char::@2->memset#1] -- pvoz1=pvoc1 + lda #printf_screen+$28*$19-$28 + sta.z memset.str+1 + // [43] phi (word) memset::num#2 = (byte) $28 [phi:printf_char::@2->memset#2] -- vwuz1=vbuc1 + lda #<$28 + sta.z memset.num + lda #>$28 + sta.z memset.num+1 + jsr memset + // printf_char::@3 + // printf_char_cursor-PRINTF_SCREEN_WIDTH + // [39] (byte*~) printf_char::$8 ← (byte*) printf_char_cursor - (byte) $28 -- pbuz1=pbuz1_minus_vwuc1 + lda.z __8 + sec + sbc #<$28 + sta.z __8 + lda.z __8+1 + sbc #>$28 + sta.z __8+1 + // printf_char_cursor = printf_char_cursor-PRINTF_SCREEN_WIDTH + // [40] (byte*) printf_char_cursor ← (byte*~) printf_char::$8 + // printf_line_cursor = printf_char_cursor + // [41] (byte*) printf_line_cursor ← (byte*) printf_char_cursor -- pbuz1=pbuz2 + lda.z printf_char_cursor + sta.z printf_line_cursor + lda.z printf_char_cursor+1 + sta.z printf_line_cursor+1 + // printf_char::@return + __breturn: + // } + // [42] return + rts +} + // memset +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +// memset(void* zp(2) str, byte register(X) c, word zp(8) num) +memset: { + .label end = 8 + .label dst = 2 + .label num = 8 + .label str = 2 + // if(num>0) + // [44] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1 + lda.z num + bne !+ + lda.z num+1 + beq __breturn + !: + // memset::@1 + // end = (char*)str + num + // [45] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz1 + lda.z end + clc + adc.z str + sta.z end + lda.z end+1 + adc.z str+1 + sta.z end+1 + // [46] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3 + // [47] phi from memset::@1 memset::@3 to memset::@2 [phi:memset::@1/memset::@3->memset::@2] + // [47] phi (byte*) memset::dst#2 = (byte*) memset::dst#4 [phi:memset::@1/memset::@3->memset::@2#0] -- register_copy + // memset::@2 + __b2: + // for(char* dst = str; dst!=end; dst++) + // [48] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 -- pbuz1_neq_pbuz2_then_la1 + lda.z dst+1 + cmp.z end+1 + bne __b3 + lda.z dst + cmp.z end + bne __b3 + // memset::@return + __breturn: + // } + // [49] return + rts + // memset::@3 + __b3: + // *dst = c + // [50] *((byte*) memset::dst#2) ← (byte) memset::c#4 -- _deref_pbuz1=vbuxx + txa + ldy #0 + sta (dst),y + // for(char* dst = str; dst!=end; dst++) + // [51] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 + inc.z dst + bne !+ + inc.z dst+1 + !: + jmp __b2 +} + // memcpy +// Copy block of memory (forwards) +// Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination. +memcpy: { + .label destination = printf_screen + .const num = $28*$19-$28 + .label source = printf_screen+$28 + .label src_end = source+num + .label dst = 2 + .label src = 8 + // [53] phi from memcpy to memcpy::@1 [phi:memcpy->memcpy::@1] + // [53] phi (byte*) memcpy::dst#2 = (byte*)(const void*) memcpy::destination#0 [phi:memcpy->memcpy::@1#0] -- pbuz1=pbuc1 + lda #destination + sta.z dst+1 + // [53] phi (byte*) memcpy::src#2 = (byte*)(const void*) memcpy::source#0 [phi:memcpy->memcpy::@1#1] -- pbuz1=pbuc1 + lda #source + sta.z src+1 + // memcpy::@1 + __b1: + // while(src!=src_end) + // [54] if((byte*) memcpy::src#2!=(const byte*) memcpy::src_end#0) goto memcpy::@2 -- pbuz1_neq_pbuc1_then_la1 + lda.z src+1 + cmp #>src_end + bne __b2 + lda.z src + cmp #memcpy::@1] + // [53] phi (byte*) memcpy::dst#2 = (byte*) memcpy::dst#1 [phi:memcpy::@2->memcpy::@1#0] -- register_copy + // [53] phi (byte*) memcpy::src#2 = (byte*) memcpy::src#1 [phi:memcpy::@2->memcpy::@1#1] -- register_copy + jmp __b1 +} + // printf_uchar +// Print an unsigned char using a specific format +printf_uchar: { + // printf_uchar::@1 + // printf_buffer.sign = format.sign_always?'+':0 + // [60] *((byte*)&(struct printf_buffer_number) printf_buffer) ← (byte) 0 -- _deref_pbuc1=vbuc2 + // Handle any sign + lda #0 + sta printf_buffer + // uctoa(uvalue, printf_buffer.digits, format.radix) + // [61] call uctoa + // Format number into buffer + // [72] phi from printf_uchar::@1 to uctoa [phi:printf_uchar::@1->uctoa] + jsr uctoa + // printf_uchar::@2 + // printf_number_buffer(printf_buffer, format) + // [62] (byte) printf_number_buffer::buffer_sign#0 ← *((byte*)&(struct printf_buffer_number) printf_buffer) -- vbuaa=_deref_pbuc1 + lda printf_buffer + // [63] call printf_number_buffer + // Print using format + // [65] phi from printf_uchar::@2 to printf_number_buffer [phi:printf_uchar::@2->printf_number_buffer] + jsr printf_number_buffer + // printf_uchar::@return + // } + // [64] return + rts +} + // printf_number_buffer +// Print the contents of the number buffer using a specific format. +// This handles minimum length, zero-filling, and left/right justification from the format +// printf_number_buffer(byte register(A) buffer_sign) +printf_number_buffer: { + .label buffer_digits = printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + // printf_number_buffer::@1 + // if(buffer.sign) + // [66] if((byte) 0==(byte) printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1 + cmp #0 + beq __b2 + // printf_number_buffer::@3 + // printf_char(buffer.sign) + // [67] (byte) printf_char::ch#2 ← (byte) printf_number_buffer::buffer_sign#0 + // [68] call printf_char + // [31] phi from printf_number_buffer::@3 to printf_char [phi:printf_number_buffer::@3->printf_char] + // [31] phi (byte) printf_char::ch#3 = (byte) printf_char::ch#2 [phi:printf_number_buffer::@3->printf_char#0] -- register_copy + jsr printf_char + // [69] phi from printf_number_buffer::@1 printf_number_buffer::@3 to printf_number_buffer::@2 [phi:printf_number_buffer::@1/printf_number_buffer::@3->printf_number_buffer::@2] + // printf_number_buffer::@2 + __b2: + // printf_str(buffer.digits) + // [70] call printf_str + // [15] phi from printf_number_buffer::@2 to printf_str [phi:printf_number_buffer::@2->printf_str] + // [15] phi (byte*) printf_str::str#6 = (const byte*) printf_number_buffer::buffer_digits#0 [phi:printf_number_buffer::@2->printf_str#0] -- pbuz1=pbuc1 + lda #buffer_digits + sta.z printf_str.str+1 + jsr printf_str + // printf_number_buffer::@return + // } + // [71] return + rts +} + // uctoa +// 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) +// uctoa(byte register(X) value, byte* zp(6) buffer) +uctoa: { + .const max_digits = 3 + .label digit_value = $c + .label buffer = 6 + .label digit = 4 + .label started = 5 + // [73] phi from uctoa to uctoa::@1 [phi:uctoa->uctoa::@1] + // [73] phi (byte*) uctoa::buffer#11 = (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:uctoa->uctoa::@1#0] -- pbuz1=pbuc1 + lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + sta.z buffer+1 + // [73] phi (byte) uctoa::started#2 = (byte) 0 [phi:uctoa->uctoa::@1#1] -- vbuz1=vbuc1 + lda #0 + sta.z started + // [73] phi (byte) uctoa::value#2 = (const byte) main::c [phi:uctoa->uctoa::@1#2] -- vbuxx=vbuc1 + ldx #main.c + // [73] phi (byte) uctoa::digit#2 = (byte) 0 [phi:uctoa->uctoa::@1#3] -- vbuz1=vbuc1 + sta.z digit + // uctoa::@1 + __b1: + // for( char digit=0; digit= digit_value) + // [80] if((byte) 0!=(byte) uctoa::started#2) goto uctoa::@5 -- vbuc1_neq_vbuz1_then_la1 + lda #0 + cmp.z started + bne __b5 + // uctoa::@7 + // [81] if((byte) uctoa::value#2>=(byte) uctoa::digit_value#0) goto uctoa::@5 -- vbuxx_ge_vbuz1_then_la1 + cpx.z digit_value + bcs __b5 + // [82] phi from uctoa::@7 to uctoa::@4 [phi:uctoa::@7->uctoa::@4] + // [82] phi (byte*) uctoa::buffer#14 = (byte*) uctoa::buffer#11 [phi:uctoa::@7->uctoa::@4#0] -- register_copy + // [82] phi (byte) uctoa::started#4 = (byte) uctoa::started#2 [phi:uctoa::@7->uctoa::@4#1] -- register_copy + // [82] phi (byte) uctoa::value#6 = (byte) uctoa::value#2 [phi:uctoa::@7->uctoa::@4#2] -- register_copy + // uctoa::@4 + __b4: + // for( char digit=0; digituctoa::@1] + // [73] phi (byte*) uctoa::buffer#11 = (byte*) uctoa::buffer#14 [phi:uctoa::@4->uctoa::@1#0] -- register_copy + // [73] phi (byte) uctoa::started#2 = (byte) uctoa::started#4 [phi:uctoa::@4->uctoa::@1#1] -- register_copy + // [73] phi (byte) uctoa::value#2 = (byte) uctoa::value#6 [phi:uctoa::@4->uctoa::@1#2] -- register_copy + // [73] phi (byte) uctoa::digit#2 = (byte) uctoa::digit#1 [phi:uctoa::@4->uctoa::@1#3] -- register_copy + jmp __b1 + // uctoa::@5 + __b5: + // uctoa_append(buffer++, value, digit_value) + // [84] (byte*) uctoa_append::buffer#0 ← (byte*) uctoa::buffer#11 + // [85] (byte) uctoa_append::value#0 ← (byte) uctoa::value#2 + // [86] (byte) uctoa_append::sub#0 ← (byte) uctoa::digit_value#0 + // [87] call uctoa_append + // [91] phi from uctoa::@5 to uctoa_append [phi:uctoa::@5->uctoa_append] + jsr uctoa_append + // uctoa_append(buffer++, value, digit_value) + // [88] (byte) uctoa_append::return#0 ← (byte) uctoa_append::value#2 + // uctoa::@6 + // value = uctoa_append(buffer++, value, digit_value) + // [89] (byte) uctoa::value#0 ← (byte) uctoa_append::return#0 + // value = uctoa_append(buffer++, value, digit_value); + // [90] (byte*) uctoa::buffer#4 ← ++ (byte*) uctoa::buffer#11 -- pbuz1=_inc_pbuz1 + inc.z buffer + bne !+ + inc.z buffer+1 + !: + // [82] phi from uctoa::@6 to uctoa::@4 [phi:uctoa::@6->uctoa::@4] + // [82] phi (byte*) uctoa::buffer#14 = (byte*) uctoa::buffer#4 [phi:uctoa::@6->uctoa::@4#0] -- register_copy + // [82] phi (byte) uctoa::started#4 = (byte) 1 [phi:uctoa::@6->uctoa::@4#1] -- vbuz1=vbuc1 + lda #1 + sta.z started + // [82] phi (byte) uctoa::value#6 = (byte) uctoa::value#0 [phi:uctoa::@6->uctoa::@4#2] -- register_copy + jmp __b4 +} + // uctoa_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. +// uctoa_append(byte* zp(6) buffer, byte register(X) value, byte zp($c) sub) +uctoa_append: { + .label buffer = 6 + .label sub = $c + // [92] phi from uctoa_append to uctoa_append::@1 [phi:uctoa_append->uctoa_append::@1] + // [92] phi (byte) uctoa_append::digit#2 = (byte) 0 [phi:uctoa_append->uctoa_append::@1#0] -- vbuyy=vbuc1 + ldy #0 + // [92] phi (byte) uctoa_append::value#2 = (byte) uctoa_append::value#0 [phi:uctoa_append->uctoa_append::@1#1] -- register_copy + // uctoa_append::@1 + __b1: + // while (value >= sub) + // [93] if((byte) uctoa_append::value#2>=(byte) uctoa_append::sub#0) goto uctoa_append::@2 -- vbuxx_ge_vbuz1_then_la1 + cpx.z sub + bcs __b2 + // uctoa_append::@3 + // *buffer = DIGITS[digit] + // [94] *((byte*) uctoa_append::buffer#0) ← *((const byte*) DIGITS + (byte) uctoa_append::digit#2) -- _deref_pbuz1=pbuc1_derefidx_vbuyy + lda DIGITS,y + ldy #0 + sta (buffer),y + // uctoa_append::@return + // } + // [95] return + rts + // uctoa_append::@2 + __b2: + // digit++; + // [96] (byte) uctoa_append::digit#1 ← ++ (byte) uctoa_append::digit#2 -- vbuyy=_inc_vbuyy + iny + // value -= sub + // [97] (byte) uctoa_append::value#1 ← (byte) uctoa_append::value#2 - (byte) uctoa_append::sub#0 -- vbuxx=vbuxx_minus_vbuz1 + txa + sec + sbc.z sub + tax + // [92] phi from uctoa_append::@2 to uctoa_append::@1 [phi:uctoa_append::@2->uctoa_append::@1] + // [92] phi (byte) uctoa_append::digit#2 = (byte) uctoa_append::digit#1 [phi:uctoa_append::@2->uctoa_append::@1#0] -- register_copy + // [92] phi (byte) uctoa_append::value#2 = (byte) uctoa_append::value#1 [phi:uctoa_append::@2->uctoa_append::@1#1] -- register_copy + jmp __b1 +} + // printf_cls +// Clear the screen. Also resets current line/char cursor. +printf_cls: { + // memset(printf_screen, ' ', PRINTF_SCREEN_BYTES) + // [99] call memset + // [43] phi from printf_cls to memset [phi:printf_cls->memset] + // [43] phi (byte) memset::c#4 = (byte) ' ' [phi:printf_cls->memset#0] -- vbuxx=vbuc1 + ldx #' ' + // [43] phi (void*) memset::str#3 = (void*)(const byte*) printf_screen [phi:printf_cls->memset#1] -- pvoz1=pvoc1 + lda #printf_screen + sta.z memset.str+1 + // [43] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:printf_cls->memset#2] -- vwuz1=vwuc1 + lda #<$28*$19 + sta.z memset.num + lda #>$28*$19 + sta.z memset.num+1 + jsr memset + // printf_cls::@1 + // printf_line_cursor = printf_screen + // [100] (byte*) printf_line_cursor ← (const byte*) printf_screen -- pbuz1=pbuc1 + lda #printf_screen + sta.z printf_line_cursor+1 + // printf_char_cursor = printf_line_cursor + // [101] (byte*) printf_char_cursor ← (byte*) printf_line_cursor -- pbuz1=pbuz2 + lda.z printf_line_cursor + sta.z printf_char_cursor + lda.z printf_line_cursor+1 + sta.z printf_char_cursor+1 + // printf_cls::@return + // } + // [102] return + rts +} + // File Data + // The digits used for numbers + DIGITS: .text "0123456789abcdef" + // Values of decimal digits + RADIX_DECIMAL_VALUES_CHAR: .byte $64, $a + // Buffer used for stringified number being printed + printf_buffer: .fill SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER, 0 + diff --git a/src/test/ref/printf-14.sym b/src/test/ref/printf-14.sym new file mode 100644 index 000000000..5b73aa097 --- /dev/null +++ b/src/test/ref/printf-14.sym @@ -0,0 +1,193 @@ +(label) @1 +(label) @2 +(label) @begin +(label) @end +(const byte*) DIGITS[] = (byte*) "0123456789abcdef"z +(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS = (byte) 1 +(const byte) RADIX::BINARY = (number) 2 +(const byte) RADIX::DECIMAL = (number) $a +(const byte) RADIX::HEXADECIMAL = (number) $10 +(const byte) RADIX::OCTAL = (number) 8 +(const byte*) RADIX_DECIMAL_VALUES_CHAR[] = { (byte) $64, (byte) $a } +(const byte) SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER = (byte) $c +(void()) main() +(label) main::@1 +(label) main::@2 +(label) main::@3 +(label) main::@return +(const byte) main::c = (byte) 7 +(const byte*) main::str[(byte) 1] = (byte*) "" +(void*()) memcpy((void*) memcpy::destination , (void*) memcpy::source , (word) memcpy::num) +(label) memcpy::@1 +(label) memcpy::@2 +(label) memcpy::@return +(void*) memcpy::destination +(const void*) memcpy::destination#0 destination = (void*)(const byte*) printf_screen +(byte*) memcpy::dst +(byte*) memcpy::dst#1 dst zp[2]:2 1.000000001E9 +(byte*) memcpy::dst#2 dst zp[2]:2 1.000000001E9 +(word) memcpy::num +(const word) memcpy::num#0 num = (word)(number) $28*(number) $19-(number) $28 +(void*) memcpy::return +(void*) memcpy::source +(const void*) memcpy::source#0 source = (void*)(const byte*) printf_screen+(byte) $28 +(byte*) memcpy::src +(byte*) memcpy::src#1 src zp[2]:8 2.000000002E9 +(byte*) memcpy::src#2 src zp[2]:8 1.000000001E9 +(byte*) memcpy::src_end +(const byte*) memcpy::src_end#0 src_end = (byte*)(const void*) memcpy::source#0+(const word) memcpy::num#0 +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +(label) memset::@1 +(label) memset::@2 +(label) memset::@3 +(label) memset::@return +(byte) memset::c +(byte) memset::c#4 reg byte x 1.25000000125E8 +(byte*) memset::dst +(byte*) memset::dst#1 dst zp[2]:2 2.000000002E9 +(byte*) memset::dst#2 dst zp[2]:2 1.3366666683333335E9 +(byte*) memset::dst#4 dst zp[2]:2 2.0000002E7 +(byte*) memset::end +(byte*) memset::end#0 end zp[2]:8 1.683333336666667E8 +(word) memset::num +(word) memset::num#2 num zp[2]:8 1.0000001E7 +(void*) memset::return +(void*) memset::str +(void*) memset::str#3 str zp[2]:2 +(struct printf_buffer_number) printf_buffer loadstore mem[12] = {} +(const byte*) printf_buffer_number::digits[(number) $b] = { fill( $b, 0) } +(byte) printf_buffer_number::sign +(void()) printf_char((byte) printf_char::ch) +(byte*~) printf_char::$8 zp[2]:10 2000002.0 +(label) printf_char::@1 +(label) printf_char::@2 +(label) printf_char::@3 +(label) printf_char::@return +(byte) printf_char::ch +(byte) printf_char::ch#1 reg byte a 200002.0 +(byte) printf_char::ch#2 reg byte a 2002.0 +(byte) printf_char::ch#3 reg byte a 1101003.0 +(byte*) printf_char_cursor loadstore zp[2]:10 2250002.333333332 +(void()) printf_cls() +(label) printf_cls::@1 +(label) printf_cls::@return +(byte) printf_format_number::justify_left +(byte) printf_format_number::min_length +(byte) printf_format_number::radix +(byte) printf_format_number::sign_always +(byte) printf_format_number::zero_padding +(byte) printf_format_string::justify_left +(byte) printf_format_string::min_length +(byte*) printf_line_cursor loadstore zp[2]:8 6863641.113636365 +(void()) printf_ln() +(label) printf_ln::@1 +(label) printf_ln::@2 +(label) printf_ln::@return +(void()) printf_number_buffer((byte) printf_number_buffer::buffer_sign , (byte*) printf_number_buffer::buffer_digits , (byte) printf_number_buffer::format_min_length , (byte) printf_number_buffer::format_justify_left , (byte) printf_number_buffer::format_sign_always , (byte) printf_number_buffer::format_zero_padding , (byte) printf_number_buffer::format_radix) +(label) printf_number_buffer::@1 +(label) printf_number_buffer::@2 +(label) printf_number_buffer::@3 +(label) printf_number_buffer::@return +(struct printf_buffer_number) printf_number_buffer::buffer +(byte*) printf_number_buffer::buffer_digits +(const byte*) printf_number_buffer::buffer_digits#0 buffer_digits = (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS +(byte) printf_number_buffer::buffer_sign +(byte) printf_number_buffer::buffer_sign#0 reg byte a 701.0 +(struct printf_format_number) printf_number_buffer::format +(byte) printf_number_buffer::format_justify_left +(byte) printf_number_buffer::format_min_length +(byte) printf_number_buffer::format_radix +(byte) printf_number_buffer::format_sign_always +(byte) printf_number_buffer::format_zero_padding +(signed byte) printf_number_buffer::len +(signed byte) printf_number_buffer::padding +(const byte*) printf_screen = (byte*) 1024 +(void()) printf_str((byte*) printf_str::str) +(label) printf_str::@1 +(label) printf_str::@2 +(label) printf_str::@3 +(label) printf_str::@4 +(label) printf_str::@5 +(label) printf_str::@return +(byte) printf_str::ch +(byte) printf_str::ch#0 reg byte a 100001.0 +(byte*) printf_str::str +(byte*) printf_str::str#0 str zp[2]:6 42857.57142857143 +(byte*) printf_str::str#4 str zp[2]:6 205002.5 +(byte*) printf_str::str#6 str zp[2]:6 10001.0 +(void()) printf_uchar((byte) printf_uchar::uvalue , (byte) printf_uchar::format_min_length , (byte) printf_uchar::format_justify_left , (byte) printf_uchar::format_sign_always , (byte) printf_uchar::format_zero_padding , (byte) printf_uchar::format_radix) +(label) printf_uchar::@1 +(label) printf_uchar::@2 +(label) printf_uchar::@return +(struct printf_format_number) printf_uchar::format +(byte) printf_uchar::format_justify_left +(byte) printf_uchar::format_min_length +(byte) printf_uchar::format_radix +(byte) printf_uchar::format_sign_always +(byte) printf_uchar::format_zero_padding +(byte) printf_uchar::uvalue +(void()) uctoa((byte) uctoa::value , (byte*) uctoa::buffer , (byte) uctoa::radix) +(label) uctoa::@1 +(label) uctoa::@2 +(label) uctoa::@3 +(label) uctoa::@4 +(label) uctoa::@5 +(label) uctoa::@6 +(label) uctoa::@7 +(label) uctoa::@return +(byte*) uctoa::buffer +(byte*) uctoa::buffer#11 buffer zp[2]:6 3500.4999999999995 +(byte*) uctoa::buffer#14 buffer zp[2]:6 15001.5 +(byte*) uctoa::buffer#3 buffer zp[2]:6 2002.0 +(byte*) uctoa::buffer#4 buffer zp[2]:6 20002.0 +(byte) uctoa::digit +(byte) uctoa::digit#1 digit zp[1]:4 20002.0 +(byte) uctoa::digit#2 digit zp[1]:4 3077.230769230769 +(byte) uctoa::digit_value +(byte) uctoa::digit_value#0 digit_value zp[1]:12 6000.6 +(byte*) uctoa::digit_values +(byte) uctoa::max_digits +(const byte) uctoa::max_digits#1 max_digits = (byte) 3 +(byte) uctoa::radix +(byte) uctoa::started +(byte) uctoa::started#2 started zp[1]:5 6000.6 +(byte) uctoa::started#4 started zp[1]:5 10001.0 +(byte) uctoa::value +(byte) uctoa::value#0 reg byte x 10001.0 +(byte) uctoa::value#2 reg byte x 6834.166666666666 +(byte) uctoa::value#6 reg byte x 15001.5 +(byte()) uctoa_append((byte*) uctoa_append::buffer , (byte) uctoa_append::value , (byte) uctoa_append::sub) +(label) uctoa_append::@1 +(label) uctoa_append::@2 +(label) uctoa_append::@3 +(label) uctoa_append::@return +(byte*) uctoa_append::buffer +(byte*) uctoa_append::buffer#0 buffer zp[2]:6 13750.25 +(byte) uctoa_append::digit +(byte) uctoa_append::digit#1 reg byte y 1.0000001E7 +(byte) uctoa_append::digit#2 reg byte y 1.00500015E7 +(byte) uctoa_append::return +(byte) uctoa_append::return#0 reg byte x 20002.0 +(byte) uctoa_append::sub +(byte) uctoa_append::sub#0 sub zp[1]:12 3335000.5 +(byte) uctoa_append::value +(byte) uctoa_append::value#0 reg byte x 36667.33333333333 +(byte) uctoa_append::value#1 reg byte x 2.0000002E7 +(byte) uctoa_append::value#2 reg byte x 5018334.166666666 + +reg byte a [ printf_char::ch#3 printf_char::ch#2 printf_char::ch#1 ] +reg byte x [ memset::c#4 ] +zp[2]:2 [ memcpy::dst#2 memcpy::dst#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ] +zp[1]:4 [ uctoa::digit#2 uctoa::digit#1 ] +reg byte x [ uctoa::value#2 uctoa::value#6 uctoa::value#0 ] +zp[1]:5 [ uctoa::started#2 uctoa::started#4 ] +zp[2]:6 [ uctoa::buffer#11 uctoa::buffer#14 uctoa::buffer#4 uctoa::buffer#3 uctoa_append::buffer#0 printf_str::str#4 printf_str::str#6 printf_str::str#0 ] +reg byte x [ uctoa_append::value#2 uctoa_append::value#0 uctoa_append::value#1 ] +reg byte y [ uctoa_append::digit#2 uctoa_append::digit#1 ] +zp[2]:8 [ printf_line_cursor memcpy::src#2 memcpy::src#1 memset::num#2 memset::end#0 ] +zp[2]:10 [ printf_char_cursor printf_char::$8 ] +reg byte a [ printf_str::ch#0 ] +reg byte a [ printf_number_buffer::buffer_sign#0 ] +zp[1]:12 [ uctoa::digit_value#0 uctoa_append::sub#0 ] +reg byte x [ uctoa_append::return#0 ] +mem[12] [ printf_buffer ]