Inlined call call __init Eliminating unused variable with no statement memset::$2 Eliminating unused variable with no statement test_bytes::$1 Eliminating unused variable with no statement test_sbytes::$1 Eliminating unused variable with no statement test_sbytes::$3 Eliminating unused variable with no statement test_sbytes::$5 CONTROL FLOW GRAPH SSA void print_str(char *str) print_str: scope:[print_str] from assert_byte assert_byte::@1 assert_byte::@3 assert_byte::@4 assert_sbyte assert_sbyte::@1 assert_sbyte::@3 assert_sbyte::@4 print_char_cursor#87 = phi( assert_byte/print_char_cursor#77, assert_byte::@1/print_char_cursor#78, assert_byte::@3/print_char_cursor#79, assert_byte::@4/print_char_cursor#16, assert_sbyte/print_char_cursor#82, assert_sbyte::@1/print_char_cursor#83, assert_sbyte::@3/print_char_cursor#84, assert_sbyte::@4/print_char_cursor#28 ) print_str::str#12 = phi( assert_byte/print_str::str#1, assert_byte::@1/print_str::str#3, assert_byte::@3/print_str::str#4, assert_byte::@4/print_str::str#2, assert_sbyte/print_str::str#5, assert_sbyte::@1/print_str::str#7, assert_sbyte::@3/print_str::str#8, assert_sbyte::@4/print_str::str#6 ) to:print_str::@1 print_str::@1: scope:[print_str] from print_str print_str::@3 print_char_cursor#73 = phi( print_str/print_char_cursor#87, print_str::@3/print_char_cursor#0 ) print_str::str#9 = phi( print_str/print_str::str#12, print_str::@3/print_str::str#0 ) print_str::$1 = 0 != *print_str::str#9 if(print_str::$1) goto print_str::@2 to:print_str::@return print_str::@2: scope:[print_str] from print_str::@1 print_char_cursor#72 = phi( print_str::@1/print_char_cursor#73 ) print_str::str#10 = phi( print_str::@1/print_str::str#9 ) print_char::ch#0 = *print_str::str#10 call print_char to:print_str::@3 print_str::@3: scope:[print_str] from print_str::@2 print_str::str#11 = phi( print_str::@2/print_str::str#10 ) print_char_cursor#37 = phi( print_str::@2/print_char_cursor#5 ) print_char_cursor#0 = print_char_cursor#37 print_str::str#0 = ++ print_str::str#11 to:print_str::@1 print_str::@return: scope:[print_str] from print_str::@1 print_char_cursor#38 = phi( print_str::@1/print_char_cursor#73 ) print_char_cursor#1 = print_char_cursor#38 return to:@return void print_ln() print_ln: scope:[print_ln] from assert_byte::@2 assert_sbyte::@2 print_char_cursor#74 = phi( assert_byte::@2/print_char_cursor#80, assert_sbyte::@2/print_char_cursor#85 ) print_line_cursor#49 = phi( assert_byte::@2/print_line_cursor#52, assert_sbyte::@2/print_line_cursor#54 ) to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 print_char_cursor#39 = phi( print_ln/print_char_cursor#74, print_ln::@1/print_char_cursor#39 ) print_line_cursor#25 = phi( print_ln/print_line_cursor#49, print_ln::@1/print_line_cursor#0 ) print_ln::$0 = print_line_cursor#25 + $28 print_line_cursor#0 = print_ln::$0 print_ln::$1 = print_line_cursor#0 < print_char_cursor#39 if(print_ln::$1) goto print_ln::@1 to:print_ln::@2 print_ln::@2: scope:[print_ln] from print_ln::@1 print_line_cursor#26 = phi( print_ln::@1/print_line_cursor#0 ) print_char_cursor#2 = print_line_cursor#26 to:print_ln::@return print_ln::@return: scope:[print_ln] from print_ln::@2 print_char_cursor#40 = phi( print_ln::@2/print_char_cursor#2 ) print_line_cursor#27 = phi( print_ln::@2/print_line_cursor#26 ) print_line_cursor#1 = print_line_cursor#27 print_char_cursor#3 = print_char_cursor#40 return to:@return void print_char(char ch) print_char: scope:[print_char] from print_str::@2 print_char_cursor#41 = phi( print_str::@2/print_char_cursor#72 ) print_char::ch#1 = phi( print_str::@2/print_char::ch#0 ) *print_char_cursor#41 = print_char::ch#1 print_char_cursor#4 = ++ print_char_cursor#41 to:print_char::@return print_char::@return: scope:[print_char] from print_char print_char_cursor#42 = phi( print_char/print_char_cursor#4 ) print_char_cursor#5 = print_char_cursor#42 return to:@return void print_cls() print_cls: scope:[print_cls] from main print_screen#2 = phi( main/print_screen#5 ) memset::str#0 = (void *)print_screen#2 memset::c#0 = ' ' memset::num#0 = $3e8 call memset memset::return#0 = memset::return#2 to:print_cls::@1 print_cls::@1: scope:[print_cls] from print_cls print_screen#3 = phi( print_cls/print_screen#2 ) print_line_cursor#2 = print_screen#3 print_char_cursor#6 = print_line_cursor#2 to:print_cls::@return print_cls::@return: scope:[print_cls] from print_cls::@1 print_char_cursor#43 = phi( print_cls::@1/print_char_cursor#6 ) print_line_cursor#28 = phi( print_cls::@1/print_line_cursor#2 ) print_line_cursor#3 = print_line_cursor#28 print_char_cursor#7 = print_char_cursor#43 return to:@return void * memset(void *str , char c , unsigned int num) memset: scope:[memset] from print_cls memset::c#4 = phi( print_cls/memset::c#0 ) memset::str#3 = phi( print_cls/memset::str#0 ) memset::num#1 = phi( print_cls/memset::num#0 ) memset::$0 = memset::num#1 > 0 memset::$1 = ! memset::$0 if(memset::$1) goto memset::@1 to:memset::@2 memset::@1: scope:[memset] from memset memset::@3 memset::str#1 = phi( memset/memset::str#3, memset::@3/memset::str#4 ) memset::return#1 = memset::str#1 to:memset::@return memset::@2: scope:[memset] from memset memset::c#3 = phi( memset/memset::c#4 ) memset::num#2 = phi( memset/memset::num#1 ) memset::str#2 = phi( memset/memset::str#3 ) memset::$4 = (char *)memset::str#2 memset::end#0 = memset::$4 + memset::num#2 memset::dst#0 = ((char *)) memset::str#2 to:memset::@3 memset::@3: scope:[memset] from memset::@2 memset::@4 memset::c#2 = phi( memset::@2/memset::c#3, memset::@4/memset::c#1 ) memset::str#4 = phi( memset::@2/memset::str#2, memset::@4/memset::str#5 ) memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 ) memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 ) memset::$3 = memset::dst#2 != memset::end#1 if(memset::$3) goto memset::@4 to:memset::@1 memset::@4: scope:[memset] from memset::@3 memset::str#5 = phi( memset::@3/memset::str#4 ) memset::end#2 = phi( memset::@3/memset::end#1 ) memset::dst#3 = phi( memset::@3/memset::dst#2 ) memset::c#1 = phi( memset::@3/memset::c#2 ) *memset::dst#3 = memset::c#1 memset::dst#1 = ++ memset::dst#3 to:memset::@3 memset::@return: scope:[memset] from memset::@1 memset::return#3 = phi( memset::@1/memset::return#1 ) memset::return#2 = memset::return#3 return to:@return void main() main: scope:[main] from __start::@1 print_char_cursor#75 = phi( __start::@1/print_char_cursor#86 ) print_line_cursor#50 = phi( __start::@1/print_line_cursor#55 ) print_screen#5 = phi( __start::@1/print_screen#7 ) call print_cls to:main::@1 main::@1: scope:[main] from main print_char_cursor#44 = phi( main/print_char_cursor#7 ) print_line_cursor#29 = phi( main/print_line_cursor#3 ) print_line_cursor#4 = print_line_cursor#29 print_char_cursor#8 = print_char_cursor#44 *BG_COLOR = GREEN call test_bytes to:main::@2 main::@2: scope:[main] from main::@1 print_line_cursor#30 = phi( main::@1/print_line_cursor#11 ) print_char_cursor#45 = phi( main::@1/print_char_cursor#15 ) print_char_cursor#9 = print_char_cursor#45 print_line_cursor#5 = print_line_cursor#30 call test_sbytes to:main::@3 main::@3: scope:[main] from main::@2 print_line_cursor#31 = phi( main::@2/print_line_cursor#19 ) print_char_cursor#46 = phi( main::@2/print_char_cursor#27 ) print_char_cursor#10 = print_char_cursor#46 print_line_cursor#6 = print_line_cursor#31 to:main::@return main::@return: scope:[main] from main::@3 print_char_cursor#47 = phi( main::@3/print_char_cursor#10 ) print_line_cursor#32 = phi( main::@3/print_line_cursor#6 ) print_line_cursor#7 = print_line_cursor#32 print_char_cursor#11 = print_char_cursor#47 return to:@return void test_bytes() test_bytes: scope:[test_bytes] from main::@1 print_line_cursor#51 = phi( main::@1/print_line_cursor#4 ) print_char_cursor#76 = phi( main::@1/print_char_cursor#8 ) assert_byte::msg#0 = test_bytes::msg assert_byte::b#0 = test_bytes::bb assert_byte::c#0 = 0 call assert_byte to:test_bytes::@1 test_bytes::@1: scope:[test_bytes] from test_bytes print_line_cursor#33 = phi( test_bytes/print_line_cursor#13 ) print_char_cursor#48 = phi( test_bytes/print_char_cursor#21 ) print_char_cursor#12 = print_char_cursor#48 print_line_cursor#8 = print_line_cursor#33 test_bytes::bc#0 = test_bytes::bb + 2 assert_byte::msg#1 = test_bytes::msg1 assert_byte::b#1 = test_bytes::bc#0 assert_byte::c#1 = 2 call assert_byte to:test_bytes::@2 test_bytes::@2: scope:[test_bytes] from test_bytes::@1 test_bytes::bc#1 = phi( test_bytes::@1/test_bytes::bc#0 ) print_line_cursor#34 = phi( test_bytes::@1/print_line_cursor#13 ) print_char_cursor#49 = phi( test_bytes::@1/print_char_cursor#21 ) print_char_cursor#13 = print_char_cursor#49 print_line_cursor#9 = print_line_cursor#34 test_bytes::$5 = (signed char)test_bytes::bc#1 test_bytes::$3 = test_bytes::$5 - 4 test_bytes::bd#0 = (char)test_bytes::$3 assert_byte::msg#2 = test_bytes::msg2 assert_byte::b#2 = test_bytes::bd#0 assert_byte::c#2 = $fe call assert_byte to:test_bytes::@3 test_bytes::@3: scope:[test_bytes] from test_bytes::@2 print_line_cursor#35 = phi( test_bytes::@2/print_line_cursor#13 ) print_char_cursor#50 = phi( test_bytes::@2/print_char_cursor#21 ) print_char_cursor#14 = print_char_cursor#50 print_line_cursor#10 = print_line_cursor#35 to:test_bytes::@return test_bytes::@return: scope:[test_bytes] from test_bytes::@3 print_line_cursor#36 = phi( test_bytes::@3/print_line_cursor#10 ) print_char_cursor#51 = phi( test_bytes::@3/print_char_cursor#14 ) print_char_cursor#15 = print_char_cursor#51 print_line_cursor#11 = print_line_cursor#36 return to:@return void assert_byte(char *msg , char b , char c) assert_byte: scope:[assert_byte] from test_bytes test_bytes::@1 test_bytes::@2 print_line_cursor#68 = phi( test_bytes/print_line_cursor#51, test_bytes::@1/print_line_cursor#8, test_bytes::@2/print_line_cursor#9 ) assert_byte::c#5 = phi( test_bytes/assert_byte::c#0, test_bytes::@1/assert_byte::c#1, test_bytes::@2/assert_byte::c#2 ) assert_byte::b#5 = phi( test_bytes/assert_byte::b#0, test_bytes::@1/assert_byte::b#1, test_bytes::@2/assert_byte::b#2 ) print_char_cursor#77 = phi( test_bytes/print_char_cursor#76, test_bytes::@1/print_char_cursor#12, test_bytes::@2/print_char_cursor#13 ) assert_byte::msg#3 = phi( test_bytes/assert_byte::msg#0, test_bytes::@1/assert_byte::msg#1, test_bytes::@2/assert_byte::msg#2 ) print_str::str#1 = assert_byte::msg#3 call print_str to:assert_byte::@4 assert_byte::@4: scope:[assert_byte] from assert_byte print_line_cursor#66 = phi( assert_byte/print_line_cursor#68 ) assert_byte::c#4 = phi( assert_byte/assert_byte::c#5 ) assert_byte::b#4 = phi( assert_byte/assert_byte::b#5 ) print_char_cursor#52 = phi( assert_byte/print_char_cursor#1 ) print_char_cursor#16 = print_char_cursor#52 print_str::str#2 = assert_byte::str call print_str to:assert_byte::@5 assert_byte::@5: scope:[assert_byte] from assert_byte::@4 print_line_cursor#64 = phi( assert_byte::@4/print_line_cursor#66 ) assert_byte::c#3 = phi( assert_byte::@4/assert_byte::c#4 ) assert_byte::b#3 = phi( assert_byte::@4/assert_byte::b#4 ) print_char_cursor#53 = phi( assert_byte::@4/print_char_cursor#1 ) print_char_cursor#17 = print_char_cursor#53 assert_byte::$2 = assert_byte::b#3 != assert_byte::c#3 if(assert_byte::$2) goto assert_byte::@1 to:assert_byte::@3 assert_byte::@1: scope:[assert_byte] from assert_byte::@5 print_line_cursor#60 = phi( assert_byte::@5/print_line_cursor#64 ) print_char_cursor#78 = phi( assert_byte::@5/print_char_cursor#17 ) *BG_COLOR = RED print_str::str#3 = assert_byte::str1 call print_str to:assert_byte::@6 assert_byte::@6: scope:[assert_byte] from assert_byte::@1 print_line_cursor#56 = phi( assert_byte::@1/print_line_cursor#60 ) print_char_cursor#54 = phi( assert_byte::@1/print_char_cursor#1 ) print_char_cursor#18 = print_char_cursor#54 to:assert_byte::@2 assert_byte::@3: scope:[assert_byte] from assert_byte::@5 print_line_cursor#61 = phi( assert_byte::@5/print_line_cursor#64 ) print_char_cursor#79 = phi( assert_byte::@5/print_char_cursor#17 ) print_str::str#4 = assert_byte::str2 call print_str to:assert_byte::@7 assert_byte::@7: scope:[assert_byte] from assert_byte::@3 print_line_cursor#57 = phi( assert_byte::@3/print_line_cursor#61 ) print_char_cursor#55 = phi( assert_byte::@3/print_char_cursor#1 ) print_char_cursor#19 = print_char_cursor#55 to:assert_byte::@2 assert_byte::@2: scope:[assert_byte] from assert_byte::@6 assert_byte::@7 print_char_cursor#80 = phi( assert_byte::@6/print_char_cursor#18, assert_byte::@7/print_char_cursor#19 ) print_line_cursor#52 = phi( assert_byte::@6/print_line_cursor#56, assert_byte::@7/print_line_cursor#57 ) call print_ln to:assert_byte::@8 assert_byte::@8: scope:[assert_byte] from assert_byte::@2 print_char_cursor#56 = phi( assert_byte::@2/print_char_cursor#3 ) print_line_cursor#37 = phi( assert_byte::@2/print_line_cursor#1 ) print_line_cursor#12 = print_line_cursor#37 print_char_cursor#20 = print_char_cursor#56 to:assert_byte::@return assert_byte::@return: scope:[assert_byte] from assert_byte::@8 print_line_cursor#38 = phi( assert_byte::@8/print_line_cursor#12 ) print_char_cursor#57 = phi( assert_byte::@8/print_char_cursor#20 ) print_char_cursor#21 = print_char_cursor#57 print_line_cursor#13 = print_line_cursor#38 return to:@return void test_sbytes() test_sbytes: scope:[test_sbytes] from main::@2 print_line_cursor#53 = phi( main::@2/print_line_cursor#5 ) print_char_cursor#81 = phi( main::@2/print_char_cursor#9 ) assert_sbyte::msg#0 = test_sbytes::msg assert_sbyte::b#0 = test_sbytes::bb assert_sbyte::c#0 = 0 call assert_sbyte to:test_sbytes::@1 test_sbytes::@1: scope:[test_sbytes] from test_sbytes print_line_cursor#39 = phi( test_sbytes/print_line_cursor#21 ) print_char_cursor#58 = phi( test_sbytes/print_char_cursor#33 ) print_char_cursor#22 = print_char_cursor#58 print_line_cursor#14 = print_line_cursor#39 test_sbytes::bc#0 = test_sbytes::bb + 2 assert_sbyte::msg#1 = test_sbytes::msg1 assert_sbyte::b#1 = test_sbytes::bc#0 assert_sbyte::c#1 = 2 call assert_sbyte to:test_sbytes::@2 test_sbytes::@2: scope:[test_sbytes] from test_sbytes::@1 test_sbytes::bc#1 = phi( test_sbytes::@1/test_sbytes::bc#0 ) print_line_cursor#40 = phi( test_sbytes::@1/print_line_cursor#21 ) print_char_cursor#59 = phi( test_sbytes::@1/print_char_cursor#33 ) print_char_cursor#23 = print_char_cursor#59 print_line_cursor#15 = print_line_cursor#40 test_sbytes::bd#0 = test_sbytes::bc#1 - 4 assert_sbyte::msg#2 = test_sbytes::msg2 assert_sbyte::b#2 = test_sbytes::bd#0 assert_sbyte::c#2 = -2 call assert_sbyte to:test_sbytes::@3 test_sbytes::@3: scope:[test_sbytes] from test_sbytes::@2 test_sbytes::bd#1 = phi( test_sbytes::@2/test_sbytes::bd#0 ) print_line_cursor#41 = phi( test_sbytes::@2/print_line_cursor#21 ) print_char_cursor#60 = phi( test_sbytes::@2/print_char_cursor#33 ) print_char_cursor#24 = print_char_cursor#60 print_line_cursor#16 = print_line_cursor#41 test_sbytes::be#0 = - test_sbytes::bd#1 assert_sbyte::msg#3 = test_sbytes::msg3 assert_sbyte::b#3 = test_sbytes::be#0 assert_sbyte::c#3 = 2 call assert_sbyte to:test_sbytes::@4 test_sbytes::@4: scope:[test_sbytes] from test_sbytes::@3 print_line_cursor#42 = phi( test_sbytes::@3/print_line_cursor#21 ) print_char_cursor#61 = phi( test_sbytes::@3/print_char_cursor#33 ) print_char_cursor#25 = print_char_cursor#61 print_line_cursor#17 = print_line_cursor#42 assert_sbyte::msg#4 = test_sbytes::msg4 assert_sbyte::b#4 = test_sbytes::bf assert_sbyte::c#4 = 2 call assert_sbyte to:test_sbytes::@5 test_sbytes::@5: scope:[test_sbytes] from test_sbytes::@4 print_line_cursor#43 = phi( test_sbytes::@4/print_line_cursor#21 ) print_char_cursor#62 = phi( test_sbytes::@4/print_char_cursor#33 ) print_char_cursor#26 = print_char_cursor#62 print_line_cursor#18 = print_line_cursor#43 to:test_sbytes::@return test_sbytes::@return: scope:[test_sbytes] from test_sbytes::@5 print_line_cursor#44 = phi( test_sbytes::@5/print_line_cursor#18 ) print_char_cursor#63 = phi( test_sbytes::@5/print_char_cursor#26 ) print_char_cursor#27 = print_char_cursor#63 print_line_cursor#19 = print_line_cursor#44 return to:@return void assert_sbyte(char *msg , signed char b , signed char c) assert_sbyte: scope:[assert_sbyte] from test_sbytes test_sbytes::@1 test_sbytes::@2 test_sbytes::@3 test_sbytes::@4 print_line_cursor#69 = phi( test_sbytes/print_line_cursor#53, test_sbytes::@1/print_line_cursor#14, test_sbytes::@2/print_line_cursor#15, test_sbytes::@3/print_line_cursor#16, test_sbytes::@4/print_line_cursor#17 ) assert_sbyte::c#7 = phi( test_sbytes/assert_sbyte::c#0, test_sbytes::@1/assert_sbyte::c#1, test_sbytes::@2/assert_sbyte::c#2, test_sbytes::@3/assert_sbyte::c#3, test_sbytes::@4/assert_sbyte::c#4 ) assert_sbyte::b#7 = phi( test_sbytes/assert_sbyte::b#0, test_sbytes::@1/assert_sbyte::b#1, test_sbytes::@2/assert_sbyte::b#2, test_sbytes::@3/assert_sbyte::b#3, test_sbytes::@4/assert_sbyte::b#4 ) print_char_cursor#82 = phi( test_sbytes/print_char_cursor#81, test_sbytes::@1/print_char_cursor#22, test_sbytes::@2/print_char_cursor#23, test_sbytes::@3/print_char_cursor#24, test_sbytes::@4/print_char_cursor#25 ) assert_sbyte::msg#5 = phi( test_sbytes/assert_sbyte::msg#0, test_sbytes::@1/assert_sbyte::msg#1, test_sbytes::@2/assert_sbyte::msg#2, test_sbytes::@3/assert_sbyte::msg#3, test_sbytes::@4/assert_sbyte::msg#4 ) print_str::str#5 = assert_sbyte::msg#5 call print_str to:assert_sbyte::@4 assert_sbyte::@4: scope:[assert_sbyte] from assert_sbyte print_line_cursor#67 = phi( assert_sbyte/print_line_cursor#69 ) assert_sbyte::c#6 = phi( assert_sbyte/assert_sbyte::c#7 ) assert_sbyte::b#6 = phi( assert_sbyte/assert_sbyte::b#7 ) print_char_cursor#64 = phi( assert_sbyte/print_char_cursor#1 ) print_char_cursor#28 = print_char_cursor#64 print_str::str#6 = assert_sbyte::str call print_str to:assert_sbyte::@5 assert_sbyte::@5: scope:[assert_sbyte] from assert_sbyte::@4 print_line_cursor#65 = phi( assert_sbyte::@4/print_line_cursor#67 ) assert_sbyte::c#5 = phi( assert_sbyte::@4/assert_sbyte::c#6 ) assert_sbyte::b#5 = phi( assert_sbyte::@4/assert_sbyte::b#6 ) print_char_cursor#65 = phi( assert_sbyte::@4/print_char_cursor#1 ) print_char_cursor#29 = print_char_cursor#65 assert_sbyte::$2 = assert_sbyte::b#5 != assert_sbyte::c#5 if(assert_sbyte::$2) goto assert_sbyte::@1 to:assert_sbyte::@3 assert_sbyte::@1: scope:[assert_sbyte] from assert_sbyte::@5 print_line_cursor#62 = phi( assert_sbyte::@5/print_line_cursor#65 ) print_char_cursor#83 = phi( assert_sbyte::@5/print_char_cursor#29 ) *BG_COLOR = RED print_str::str#7 = assert_sbyte::str1 call print_str to:assert_sbyte::@6 assert_sbyte::@6: scope:[assert_sbyte] from assert_sbyte::@1 print_line_cursor#58 = phi( assert_sbyte::@1/print_line_cursor#62 ) print_char_cursor#66 = phi( assert_sbyte::@1/print_char_cursor#1 ) print_char_cursor#30 = print_char_cursor#66 to:assert_sbyte::@2 assert_sbyte::@3: scope:[assert_sbyte] from assert_sbyte::@5 print_line_cursor#63 = phi( assert_sbyte::@5/print_line_cursor#65 ) print_char_cursor#84 = phi( assert_sbyte::@5/print_char_cursor#29 ) print_str::str#8 = assert_sbyte::str2 call print_str to:assert_sbyte::@7 assert_sbyte::@7: scope:[assert_sbyte] from assert_sbyte::@3 print_line_cursor#59 = phi( assert_sbyte::@3/print_line_cursor#63 ) print_char_cursor#67 = phi( assert_sbyte::@3/print_char_cursor#1 ) print_char_cursor#31 = print_char_cursor#67 to:assert_sbyte::@2 assert_sbyte::@2: scope:[assert_sbyte] from assert_sbyte::@6 assert_sbyte::@7 print_char_cursor#85 = phi( assert_sbyte::@6/print_char_cursor#30, assert_sbyte::@7/print_char_cursor#31 ) print_line_cursor#54 = phi( assert_sbyte::@6/print_line_cursor#58, assert_sbyte::@7/print_line_cursor#59 ) call print_ln to:assert_sbyte::@8 assert_sbyte::@8: scope:[assert_sbyte] from assert_sbyte::@2 print_char_cursor#68 = phi( assert_sbyte::@2/print_char_cursor#3 ) print_line_cursor#45 = phi( assert_sbyte::@2/print_line_cursor#1 ) print_line_cursor#20 = print_line_cursor#45 print_char_cursor#32 = print_char_cursor#68 to:assert_sbyte::@return assert_sbyte::@return: scope:[assert_sbyte] from assert_sbyte::@8 print_line_cursor#46 = phi( assert_sbyte::@8/print_line_cursor#20 ) print_char_cursor#69 = phi( assert_sbyte::@8/print_char_cursor#32 ) print_char_cursor#33 = print_char_cursor#69 print_line_cursor#21 = print_line_cursor#46 return to:@return void __start() __start: scope:[__start] from to:__start::__init1 __start::__init1: scope:[__start] from __start print_screen#0 = (char *)$400 print_line_cursor#22 = print_screen#0 print_char_cursor#34 = print_line_cursor#22 to:__start::@1 __start::@1: scope:[__start] from __start::__init1 print_screen#7 = phi( __start::__init1/print_screen#0 ) print_char_cursor#86 = phi( __start::__init1/print_char_cursor#34 ) print_line_cursor#55 = phi( __start::__init1/print_line_cursor#22 ) call main to:__start::@2 __start::@2: scope:[__start] from __start::@1 print_screen#6 = phi( __start::@1/print_screen#7 ) print_char_cursor#70 = phi( __start::@1/print_char_cursor#11 ) print_line_cursor#47 = phi( __start::@1/print_line_cursor#7 ) print_line_cursor#23 = print_line_cursor#47 print_char_cursor#35 = print_char_cursor#70 to:__start::@return __start::@return: scope:[__start] from __start::@2 print_char_cursor#71 = phi( __start::@2/print_char_cursor#35 ) print_line_cursor#48 = phi( __start::@2/print_line_cursor#23 ) print_screen#4 = phi( __start::@2/print_screen#6 ) print_screen#1 = print_screen#4 print_line_cursor#24 = print_line_cursor#48 print_char_cursor#36 = print_char_cursor#71 return to:@return SYMBOL TABLE SSA __constant char * const BG_COLOR = (char *)$d021 __constant const char GREEN = 5 __constant char RADIX::BINARY = 2 __constant char RADIX::DECIMAL = $a __constant char RADIX::HEXADECIMAL = $10 __constant char RADIX::OCTAL = 8 __constant const char RED = 2 void __start() void assert_byte(char *msg , char b , char c) bool assert_byte::$2 char assert_byte::b char assert_byte::b#0 char assert_byte::b#1 char assert_byte::b#2 char assert_byte::b#3 char assert_byte::b#4 char assert_byte::b#5 char assert_byte::c char assert_byte::c#0 char assert_byte::c#1 char assert_byte::c#2 char assert_byte::c#3 char assert_byte::c#4 char assert_byte::c#5 char *assert_byte::msg char *assert_byte::msg#0 char *assert_byte::msg#1 char *assert_byte::msg#2 char *assert_byte::msg#3 __constant char assert_byte::str[2] = " " __constant char assert_byte::str1[6] = "fail!" __constant char assert_byte::str2[3] = "ok" void assert_sbyte(char *msg , signed char b , signed char c) bool assert_sbyte::$2 signed char assert_sbyte::b signed char assert_sbyte::b#0 signed char assert_sbyte::b#1 signed char assert_sbyte::b#2 signed char assert_sbyte::b#3 signed char assert_sbyte::b#4 signed char assert_sbyte::b#5 signed char assert_sbyte::b#6 signed char assert_sbyte::b#7 signed char assert_sbyte::c signed char assert_sbyte::c#0 signed char assert_sbyte::c#1 signed char assert_sbyte::c#2 signed char assert_sbyte::c#3 signed char assert_sbyte::c#4 signed char assert_sbyte::c#5 signed char assert_sbyte::c#6 signed char assert_sbyte::c#7 char *assert_sbyte::msg char *assert_sbyte::msg#0 char *assert_sbyte::msg#1 char *assert_sbyte::msg#2 char *assert_sbyte::msg#3 char *assert_sbyte::msg#4 char *assert_sbyte::msg#5 __constant char assert_sbyte::str[2] = " " __constant char assert_sbyte::str1[6] = "fail!" __constant char assert_sbyte::str2[3] = "ok" void main() void * memset(void *str , char c , unsigned int num) bool memset::$0 bool memset::$1 bool memset::$3 char *memset::$4 char memset::c char memset::c#0 char memset::c#1 char memset::c#2 char memset::c#3 char memset::c#4 char *memset::dst char *memset::dst#0 char *memset::dst#1 char *memset::dst#2 char *memset::dst#3 char *memset::end char *memset::end#0 char *memset::end#1 char *memset::end#2 unsigned int memset::num unsigned int memset::num#0 unsigned int memset::num#1 unsigned int memset::num#2 void *memset::return void *memset::return#0 void *memset::return#1 void *memset::return#2 void *memset::return#3 void *memset::str void *memset::str#0 void *memset::str#1 void *memset::str#2 void *memset::str#3 void *memset::str#4 void *memset::str#5 void print_char(char ch) char print_char::ch char print_char::ch#0 char print_char::ch#1 char *print_char_cursor char *print_char_cursor#0 char *print_char_cursor#1 char *print_char_cursor#10 char *print_char_cursor#11 char *print_char_cursor#12 char *print_char_cursor#13 char *print_char_cursor#14 char *print_char_cursor#15 char *print_char_cursor#16 char *print_char_cursor#17 char *print_char_cursor#18 char *print_char_cursor#19 char *print_char_cursor#2 char *print_char_cursor#20 char *print_char_cursor#21 char *print_char_cursor#22 char *print_char_cursor#23 char *print_char_cursor#24 char *print_char_cursor#25 char *print_char_cursor#26 char *print_char_cursor#27 char *print_char_cursor#28 char *print_char_cursor#29 char *print_char_cursor#3 char *print_char_cursor#30 char *print_char_cursor#31 char *print_char_cursor#32 char *print_char_cursor#33 char *print_char_cursor#34 char *print_char_cursor#35 char *print_char_cursor#36 char *print_char_cursor#37 char *print_char_cursor#38 char *print_char_cursor#39 char *print_char_cursor#4 char *print_char_cursor#40 char *print_char_cursor#41 char *print_char_cursor#42 char *print_char_cursor#43 char *print_char_cursor#44 char *print_char_cursor#45 char *print_char_cursor#46 char *print_char_cursor#47 char *print_char_cursor#48 char *print_char_cursor#49 char *print_char_cursor#5 char *print_char_cursor#50 char *print_char_cursor#51 char *print_char_cursor#52 char *print_char_cursor#53 char *print_char_cursor#54 char *print_char_cursor#55 char *print_char_cursor#56 char *print_char_cursor#57 char *print_char_cursor#58 char *print_char_cursor#59 char *print_char_cursor#6 char *print_char_cursor#60 char *print_char_cursor#61 char *print_char_cursor#62 char *print_char_cursor#63 char *print_char_cursor#64 char *print_char_cursor#65 char *print_char_cursor#66 char *print_char_cursor#67 char *print_char_cursor#68 char *print_char_cursor#69 char *print_char_cursor#7 char *print_char_cursor#70 char *print_char_cursor#71 char *print_char_cursor#72 char *print_char_cursor#73 char *print_char_cursor#74 char *print_char_cursor#75 char *print_char_cursor#76 char *print_char_cursor#77 char *print_char_cursor#78 char *print_char_cursor#79 char *print_char_cursor#8 char *print_char_cursor#80 char *print_char_cursor#81 char *print_char_cursor#82 char *print_char_cursor#83 char *print_char_cursor#84 char *print_char_cursor#85 char *print_char_cursor#86 char *print_char_cursor#87 char *print_char_cursor#9 void print_cls() char *print_line_cursor char *print_line_cursor#0 char *print_line_cursor#1 char *print_line_cursor#10 char *print_line_cursor#11 char *print_line_cursor#12 char *print_line_cursor#13 char *print_line_cursor#14 char *print_line_cursor#15 char *print_line_cursor#16 char *print_line_cursor#17 char *print_line_cursor#18 char *print_line_cursor#19 char *print_line_cursor#2 char *print_line_cursor#20 char *print_line_cursor#21 char *print_line_cursor#22 char *print_line_cursor#23 char *print_line_cursor#24 char *print_line_cursor#25 char *print_line_cursor#26 char *print_line_cursor#27 char *print_line_cursor#28 char *print_line_cursor#29 char *print_line_cursor#3 char *print_line_cursor#30 char *print_line_cursor#31 char *print_line_cursor#32 char *print_line_cursor#33 char *print_line_cursor#34 char *print_line_cursor#35 char *print_line_cursor#36 char *print_line_cursor#37 char *print_line_cursor#38 char *print_line_cursor#39 char *print_line_cursor#4 char *print_line_cursor#40 char *print_line_cursor#41 char *print_line_cursor#42 char *print_line_cursor#43 char *print_line_cursor#44 char *print_line_cursor#45 char *print_line_cursor#46 char *print_line_cursor#47 char *print_line_cursor#48 char *print_line_cursor#49 char *print_line_cursor#5 char *print_line_cursor#50 char *print_line_cursor#51 char *print_line_cursor#52 char *print_line_cursor#53 char *print_line_cursor#54 char *print_line_cursor#55 char *print_line_cursor#56 char *print_line_cursor#57 char *print_line_cursor#58 char *print_line_cursor#59 char *print_line_cursor#6 char *print_line_cursor#60 char *print_line_cursor#61 char *print_line_cursor#62 char *print_line_cursor#63 char *print_line_cursor#64 char *print_line_cursor#65 char *print_line_cursor#66 char *print_line_cursor#67 char *print_line_cursor#68 char *print_line_cursor#69 char *print_line_cursor#7 char *print_line_cursor#8 char *print_line_cursor#9 void print_ln() char *print_ln::$0 bool print_ln::$1 char *print_screen char *print_screen#0 char *print_screen#1 char *print_screen#2 char *print_screen#3 char *print_screen#4 char *print_screen#5 char *print_screen#6 char *print_screen#7 void print_str(char *str) bool print_str::$1 char *print_str::str char *print_str::str#0 char *print_str::str#1 char *print_str::str#10 char *print_str::str#11 char *print_str::str#12 char *print_str::str#2 char *print_str::str#3 char *print_str::str#4 char *print_str::str#5 char *print_str::str#6 char *print_str::str#7 char *print_str::str#8 char *print_str::str#9 void test_bytes() number test_bytes::$3 signed char test_bytes::$5 __constant char test_bytes::bb = 0 char test_bytes::bc char test_bytes::bc#0 char test_bytes::bc#1 char test_bytes::bd char test_bytes::bd#0 __constant char test_bytes::msg[4] = "0=0" __constant char test_bytes::msg1[6] = "0+2=2" __constant char test_bytes::msg2[$a] = "0+2-4=254" void test_sbytes() __constant signed char test_sbytes::bb = 0 signed char test_sbytes::bc signed char test_sbytes::bc#0 signed char test_sbytes::bc#1 signed char test_sbytes::bd signed char test_sbytes::bd#0 signed char test_sbytes::bd#1 signed char test_sbytes::be signed char test_sbytes::be#0 __constant signed char test_sbytes::bf = (signed char)-$7f-$7f __constant char test_sbytes::msg[4] = "0=0" __constant char test_sbytes::msg1[6] = "0+2=2" __constant char test_sbytes::msg2[9] = "0+2-4=-2" __constant char test_sbytes::msg3[$b] = "-(0+2-4)=2" __constant char test_sbytes::msg4[$b] = "-127-127=2" Adding number conversion cast (unumber) 0 in print_str::$1 = 0 != *print_str::str#9 Adding number conversion cast (unumber) $28 in print_ln::$0 = print_line_cursor#25 + $28 Adding number conversion cast (unumber) $3e8 in memset::num#0 = $3e8 Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#1 > 0 Adding number conversion cast (unumber) 0 in assert_byte::c#0 = 0 Adding number conversion cast (unumber) 2 in test_bytes::bc#0 = test_bytes::bb + 2 Adding number conversion cast (unumber) 2 in assert_byte::c#1 = 2 Adding number conversion cast (snumber) 4 in test_bytes::$3 = test_bytes::$5 - 4 Adding number conversion cast (snumber) test_bytes::$3 in test_bytes::$3 = test_bytes::$5 - (snumber)4 Adding number conversion cast (unumber) $fe in assert_byte::c#2 = $fe Adding number conversion cast (snumber) 0 in assert_sbyte::c#0 = 0 Adding number conversion cast (snumber) 2 in test_sbytes::bc#0 = test_sbytes::bb + 2 Adding number conversion cast (snumber) 2 in assert_sbyte::c#1 = 2 Adding number conversion cast (snumber) 4 in test_sbytes::bd#0 = test_sbytes::bc#1 - 4 Adding number conversion cast (snumber) -2 in assert_sbyte::c#2 = -2 Adding number conversion cast (snumber) 2 in assert_sbyte::c#3 = 2 Adding number conversion cast (snumber) 2 in assert_sbyte::c#4 = 2 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast memset::num#0 = (unumber)$3e8 Inlining cast memset::dst#0 = (char *)memset::str#2 Inlining cast assert_byte::c#0 = (unumber)0 Inlining cast assert_byte::c#1 = (unumber)2 Inlining cast assert_byte::c#2 = (unumber)$fe Inlining cast assert_sbyte::c#0 = (snumber)0 Inlining cast assert_sbyte::c#1 = (snumber)2 Inlining cast assert_sbyte::c#2 = (snumber)-2 Inlining cast assert_sbyte::c#3 = (snumber)2 Inlining cast assert_sbyte::c#4 = (snumber)2 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (char *) 53281 Simplifying constant integer cast 0 Simplifying constant integer cast $28 Simplifying constant integer cast $3e8 Simplifying constant integer cast 0 Simplifying constant integer cast 0 Simplifying constant integer cast 2 Simplifying constant integer cast 2 Simplifying constant integer cast 4 Simplifying constant integer cast $fe Simplifying constant integer cast 0 Simplifying constant integer cast 2 Simplifying constant integer cast 2 Simplifying constant integer cast 4 Simplifying constant integer cast -2 Simplifying constant integer cast 2 Simplifying constant integer cast 2 Simplifying constant pointer cast (char *) 1024 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (char) 0 Finalized unsigned number type (char) $28 Finalized unsigned number type (unsigned int) $3e8 Finalized unsigned number type (char) 0 Finalized unsigned number type (char) 0 Finalized unsigned number type (char) 2 Finalized unsigned number type (char) 2 Finalized signed number type (signed char) 4 Finalized unsigned number type (char) $fe Finalized signed number type (signed char) 0 Finalized signed number type (signed char) 2 Finalized signed number type (signed char) 2 Finalized signed number type (signed char) 4 Finalized signed number type (signed char) -2 Finalized signed number type (signed char) 2 Finalized signed number type (signed char) 2 Successful SSA optimization PassNFinalizeNumberTypeConversions Inferred type updated to signed char in test_bytes::$3 = test_bytes::$5 - 4 Inversing boolean not [46] memset::$1 = memset::num#1 <= 0 from [45] memset::$0 = memset::num#1 > 0 Successful SSA optimization Pass2UnaryNotSimplification Alias print_str::str#10 = print_str::str#9 print_str::str#11 Alias print_char_cursor#1 = print_char_cursor#72 print_char_cursor#73 print_char_cursor#38 Alias print_char_cursor#0 = print_char_cursor#37 Alias print_line_cursor#0 = print_ln::$0 print_line_cursor#26 print_char_cursor#2 print_line_cursor#27 print_char_cursor#40 print_line_cursor#1 print_char_cursor#3 Alias print_char_cursor#4 = print_char_cursor#42 print_char_cursor#5 Alias print_line_cursor#2 = print_screen#3 print_screen#2 print_char_cursor#6 print_line_cursor#28 print_char_cursor#43 print_line_cursor#3 print_char_cursor#7 Alias memset::return#1 = memset::str#1 memset::return#3 memset::return#2 Alias memset::str#2 = memset::str#3 Alias memset::num#1 = memset::num#2 Alias memset::c#3 = memset::c#4 Alias memset::c#1 = memset::c#2 Alias memset::dst#2 = memset::dst#3 Alias memset::end#1 = memset::end#2 Alias memset::str#4 = memset::str#5 Alias print_line_cursor#29 = print_line_cursor#4 Alias print_char_cursor#44 = print_char_cursor#8 Alias print_char_cursor#45 = print_char_cursor#9 Alias print_line_cursor#30 = print_line_cursor#5 Alias print_char_cursor#10 = print_char_cursor#46 print_char_cursor#47 print_char_cursor#11 Alias print_line_cursor#31 = print_line_cursor#6 print_line_cursor#32 print_line_cursor#7 Alias print_char_cursor#12 = print_char_cursor#48 Alias print_line_cursor#33 = print_line_cursor#8 Alias test_bytes::bc#0 = test_bytes::bc#1 Alias print_char_cursor#13 = print_char_cursor#49 Alias print_line_cursor#34 = print_line_cursor#9 Alias print_char_cursor#14 = print_char_cursor#50 print_char_cursor#51 print_char_cursor#15 Alias print_line_cursor#10 = print_line_cursor#35 print_line_cursor#36 print_line_cursor#11 Alias assert_byte::b#3 = assert_byte::b#4 assert_byte::b#5 Alias assert_byte::c#3 = assert_byte::c#4 assert_byte::c#5 Alias print_line_cursor#56 = print_line_cursor#66 print_line_cursor#68 print_line_cursor#64 print_line_cursor#60 print_line_cursor#61 print_line_cursor#57 Alias print_char_cursor#16 = print_char_cursor#52 Alias print_char_cursor#17 = print_char_cursor#53 print_char_cursor#78 print_char_cursor#79 Alias print_char_cursor#18 = print_char_cursor#54 Alias print_char_cursor#19 = print_char_cursor#55 Alias print_line_cursor#12 = print_line_cursor#37 print_line_cursor#38 print_line_cursor#13 Alias print_char_cursor#20 = print_char_cursor#56 print_char_cursor#57 print_char_cursor#21 Alias print_char_cursor#22 = print_char_cursor#58 Alias print_line_cursor#14 = print_line_cursor#39 Alias test_sbytes::bc#0 = test_sbytes::bc#1 Alias print_char_cursor#23 = print_char_cursor#59 Alias print_line_cursor#15 = print_line_cursor#40 Alias test_sbytes::bd#0 = test_sbytes::bd#1 Alias print_char_cursor#24 = print_char_cursor#60 Alias print_line_cursor#16 = print_line_cursor#41 Alias print_char_cursor#25 = print_char_cursor#61 Alias print_line_cursor#17 = print_line_cursor#42 Alias print_char_cursor#26 = print_char_cursor#62 print_char_cursor#63 print_char_cursor#27 Alias print_line_cursor#18 = print_line_cursor#43 print_line_cursor#44 print_line_cursor#19 Alias assert_sbyte::b#5 = assert_sbyte::b#6 assert_sbyte::b#7 Alias assert_sbyte::c#5 = assert_sbyte::c#6 assert_sbyte::c#7 Alias print_line_cursor#58 = print_line_cursor#67 print_line_cursor#69 print_line_cursor#65 print_line_cursor#62 print_line_cursor#63 print_line_cursor#59 Alias print_char_cursor#28 = print_char_cursor#64 Alias print_char_cursor#29 = print_char_cursor#65 print_char_cursor#83 print_char_cursor#84 Alias print_char_cursor#30 = print_char_cursor#66 Alias print_char_cursor#31 = print_char_cursor#67 Alias print_line_cursor#20 = print_line_cursor#45 print_line_cursor#46 print_line_cursor#21 Alias print_char_cursor#32 = print_char_cursor#68 print_char_cursor#69 print_char_cursor#33 Alias print_screen#0 = print_line_cursor#22 print_char_cursor#34 print_line_cursor#55 print_char_cursor#86 print_screen#7 print_screen#6 print_screen#4 print_screen#1 Alias print_line_cursor#23 = print_line_cursor#47 print_line_cursor#48 print_line_cursor#24 Alias print_char_cursor#35 = print_char_cursor#70 print_char_cursor#71 print_char_cursor#36 Successful SSA optimization Pass2AliasElimination Alias print_line_cursor#52 = print_line_cursor#56 Alias print_line_cursor#54 = print_line_cursor#58 Successful SSA optimization Pass2AliasElimination Identical Phi Values print_char_cursor#0 print_char_cursor#4 Identical Phi Values print_char_cursor#39 print_char_cursor#74 Identical Phi Values print_char::ch#1 print_char::ch#0 Identical Phi Values print_char_cursor#41 print_char_cursor#1 Identical Phi Values print_line_cursor#2 print_screen#5 Identical Phi Values memset::num#1 memset::num#0 Identical Phi Values memset::str#2 memset::str#0 Identical Phi Values memset::c#3 memset::c#0 Identical Phi Values memset::end#1 memset::end#0 Identical Phi Values memset::str#4 memset::str#2 Identical Phi Values memset::c#1 memset::c#3 Identical Phi Values print_screen#5 print_screen#0 Identical Phi Values print_line_cursor#50 print_screen#0 Identical Phi Values print_char_cursor#75 print_screen#0 Identical Phi Values print_line_cursor#29 print_line_cursor#2 Identical Phi Values print_char_cursor#44 print_line_cursor#2 Identical Phi Values print_char_cursor#45 print_char_cursor#14 Identical Phi Values print_line_cursor#30 print_line_cursor#10 Identical Phi Values print_char_cursor#10 print_char_cursor#26 Identical Phi Values print_line_cursor#31 print_line_cursor#18 Identical Phi Values print_char_cursor#76 print_char_cursor#44 Identical Phi Values print_line_cursor#51 print_line_cursor#29 Identical Phi Values print_char_cursor#12 print_char_cursor#20 Identical Phi Values print_line_cursor#33 print_line_cursor#12 Identical Phi Values print_char_cursor#13 print_char_cursor#20 Identical Phi Values print_line_cursor#34 print_line_cursor#12 Identical Phi Values print_char_cursor#14 print_char_cursor#20 Identical Phi Values print_line_cursor#10 print_line_cursor#12 Identical Phi Values print_char_cursor#16 print_char_cursor#1 Identical Phi Values print_char_cursor#17 print_char_cursor#1 Identical Phi Values print_char_cursor#18 print_char_cursor#1 Identical Phi Values print_char_cursor#19 print_char_cursor#1 Identical Phi Values print_line_cursor#12 print_line_cursor#0 Identical Phi Values print_char_cursor#20 print_line_cursor#0 Identical Phi Values print_char_cursor#81 print_char_cursor#45 Identical Phi Values print_line_cursor#53 print_line_cursor#30 Identical Phi Values print_char_cursor#22 print_char_cursor#32 Identical Phi Values print_line_cursor#14 print_line_cursor#20 Identical Phi Values print_char_cursor#23 print_char_cursor#32 Identical Phi Values print_line_cursor#15 print_line_cursor#20 Identical Phi Values print_char_cursor#24 print_char_cursor#32 Identical Phi Values print_line_cursor#16 print_line_cursor#20 Identical Phi Values print_char_cursor#25 print_char_cursor#32 Identical Phi Values print_line_cursor#17 print_line_cursor#20 Identical Phi Values print_char_cursor#26 print_char_cursor#32 Identical Phi Values print_line_cursor#18 print_line_cursor#20 Identical Phi Values print_char_cursor#28 print_char_cursor#1 Identical Phi Values print_char_cursor#29 print_char_cursor#1 Identical Phi Values print_char_cursor#30 print_char_cursor#1 Identical Phi Values print_char_cursor#31 print_char_cursor#1 Identical Phi Values print_line_cursor#20 print_line_cursor#0 Identical Phi Values print_char_cursor#32 print_line_cursor#0 Identical Phi Values print_line_cursor#23 print_line_cursor#31 Identical Phi Values print_char_cursor#35 print_char_cursor#10 Successful SSA optimization Pass2IdenticalPhiElimination Identical Phi Values memset::return#1 memset::str#0 Identical Phi Values print_char_cursor#80 print_char_cursor#1 Identical Phi Values print_char_cursor#82 print_line_cursor#0 Identical Phi Values print_line_cursor#54 print_line_cursor#0 Identical Phi Values print_char_cursor#85 print_char_cursor#1 Successful SSA optimization Pass2IdenticalPhiElimination Identical Phi Values print_char_cursor#74 print_char_cursor#1 Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition print_str::$1 [3] if(0!=*print_str::str#10) goto print_str::@2 Simple Condition print_ln::$1 [13] if(print_line_cursor#0print_cls] print_cls_from_main: jsr print_cls jmp __b1 // main::@1 __b1: // [2] *BG_COLOR = GREEN -- _deref_pbuc1=vbuc2 lda #GREEN sta BG_COLOR // [3] call test_bytes // [10] phi from main::@1 to test_bytes [phi:main::@1->test_bytes] test_bytes_from___b1: jsr test_bytes // [4] phi from main::@1 to main::@2 [phi:main::@1->main::@2] __b2_from___b1: jmp __b2 // main::@2 __b2: // [5] call test_sbytes // [17] phi from main::@2 to test_sbytes [phi:main::@2->test_sbytes] test_sbytes_from___b2: jsr test_sbytes jmp __breturn // main::@return __breturn: // [6] return rts } // print_cls // Clear the screen. Also resets current line/char cursor. print_cls: { // [8] call memset // [28] phi from print_cls to memset [phi:print_cls->memset] memset_from_print_cls: jsr memset jmp __breturn // print_cls::@return __breturn: // [9] return rts } // test_bytes // Test different byte constants test_bytes: { .const bb = 0 .const bc = 2 .const bd = bc-4 // [11] call assert_byte // [34] phi from test_bytes to assert_byte [phi:test_bytes->assert_byte] assert_byte_from_test_bytes: // [34] phi print_line_cursor#52 = print_screen#0 [phi:test_bytes->assert_byte#0] -- pbuz1=pbuc1 lda #print_screen sta.z print_line_cursor+1 // [34] phi assert_byte::c#3 = 0 [phi:test_bytes->assert_byte#1] -- vbuz1=vbuc1 lda #0 sta.z assert_byte.c // [34] phi assert_byte::b#3 = test_bytes::bb [phi:test_bytes->assert_byte#2] -- vbuxx=vbuc1 ldx #bb // [34] phi print_char_cursor#77 = print_screen#0 [phi:test_bytes->assert_byte#3] -- pbuz1=pbuc1 lda #print_screen sta.z print_char_cursor+1 // [34] phi assert_byte::msg#3 = msg [phi:test_bytes->assert_byte#4] -- pbuz1=pbuc1 lda #msg sta.z assert_byte.msg+1 jsr assert_byte jmp __b1 // test_bytes::@1 __b1: // [12] print_char_cursor#98 = print_line_cursor#0 -- pbuz1=pbuz2 lda.z print_line_cursor sta.z print_char_cursor lda.z print_line_cursor+1 sta.z print_char_cursor+1 // [13] call assert_byte // [34] phi from test_bytes::@1 to assert_byte [phi:test_bytes::@1->assert_byte] assert_byte_from___b1: // [34] phi print_line_cursor#52 = print_line_cursor#0 [phi:test_bytes::@1->assert_byte#0] -- register_copy // [34] phi assert_byte::c#3 = 2 [phi:test_bytes::@1->assert_byte#1] -- vbuz1=vbuc1 lda #2 sta.z assert_byte.c // [34] phi assert_byte::b#3 = test_bytes::bc#0 [phi:test_bytes::@1->assert_byte#2] -- vbuxx=vbuc1 ldx #bc // [34] phi print_char_cursor#77 = print_char_cursor#98 [phi:test_bytes::@1->assert_byte#3] -- register_copy // [34] phi assert_byte::msg#3 = msg1 [phi:test_bytes::@1->assert_byte#4] -- pbuz1=pbuc1 lda #msg1 sta.z assert_byte.msg+1 jsr assert_byte jmp __b2 // test_bytes::@2 __b2: // [14] print_char_cursor#99 = print_line_cursor#0 -- pbuz1=pbuz2 lda.z print_line_cursor sta.z print_char_cursor lda.z print_line_cursor+1 sta.z print_char_cursor+1 // [15] call assert_byte // [34] phi from test_bytes::@2 to assert_byte [phi:test_bytes::@2->assert_byte] assert_byte_from___b2: // [34] phi print_line_cursor#52 = print_line_cursor#0 [phi:test_bytes::@2->assert_byte#0] -- register_copy // [34] phi assert_byte::c#3 = $fe [phi:test_bytes::@2->assert_byte#1] -- vbuz1=vbuc1 lda #$fe sta.z assert_byte.c // [34] phi assert_byte::b#3 = test_bytes::bd#0 [phi:test_bytes::@2->assert_byte#2] -- vbuxx=vbuc1 ldx #bd // [34] phi print_char_cursor#77 = print_char_cursor#99 [phi:test_bytes::@2->assert_byte#3] -- register_copy // [34] phi assert_byte::msg#3 = test_bytes::msg2 [phi:test_bytes::@2->assert_byte#4] -- pbuz1=pbuc1 lda #msg2 sta.z assert_byte.msg+1 jsr assert_byte jmp __breturn // test_bytes::@return __breturn: // [16] return rts .segment Data msg2: .text "0+2-4=254" .byte 0 } .segment Code // test_sbytes // Test different signed byte constants test_sbytes: { .const bb = 0 .const bf = -$7f-$7f .const bc = 2 .const bd = bc-4 .const be = -bd // [18] call assert_sbyte // [47] phi from test_sbytes to assert_sbyte [phi:test_sbytes->assert_sbyte] assert_sbyte_from_test_sbytes: // [47] phi assert_sbyte::c#5 = 0 [phi:test_sbytes->assert_sbyte#0] -- vbsz1=vbsc1 lda #0 sta.z assert_sbyte.c // [47] phi assert_sbyte::b#5 = test_sbytes::bb [phi:test_sbytes->assert_sbyte#1] -- vbsxx=vbsc1 ldx #bb // [47] phi assert_sbyte::msg#5 = msg [phi:test_sbytes->assert_sbyte#2] -- pbuz1=pbuc1 lda #msg sta.z assert_sbyte.msg+1 jsr assert_sbyte // [19] phi from test_sbytes to test_sbytes::@1 [phi:test_sbytes->test_sbytes::@1] __b1_from_test_sbytes: jmp __b1 // test_sbytes::@1 __b1: // [20] call assert_sbyte // [47] phi from test_sbytes::@1 to assert_sbyte [phi:test_sbytes::@1->assert_sbyte] assert_sbyte_from___b1: // [47] phi assert_sbyte::c#5 = 2 [phi:test_sbytes::@1->assert_sbyte#0] -- vbsz1=vbsc1 lda #2 sta.z assert_sbyte.c // [47] phi assert_sbyte::b#5 = test_sbytes::bc#0 [phi:test_sbytes::@1->assert_sbyte#1] -- vbsxx=vbsc1 ldx #bc // [47] phi assert_sbyte::msg#5 = msg1 [phi:test_sbytes::@1->assert_sbyte#2] -- pbuz1=pbuc1 lda #msg1 sta.z assert_sbyte.msg+1 jsr assert_sbyte // [21] phi from test_sbytes::@1 to test_sbytes::@2 [phi:test_sbytes::@1->test_sbytes::@2] __b2_from___b1: jmp __b2 // test_sbytes::@2 __b2: // [22] call assert_sbyte // [47] phi from test_sbytes::@2 to assert_sbyte [phi:test_sbytes::@2->assert_sbyte] assert_sbyte_from___b2: // [47] phi assert_sbyte::c#5 = -2 [phi:test_sbytes::@2->assert_sbyte#0] -- vbsz1=vbsc1 lda #-2 sta.z assert_sbyte.c // [47] phi assert_sbyte::b#5 = test_sbytes::bd#0 [phi:test_sbytes::@2->assert_sbyte#1] -- vbsxx=vbsc1 ldx #bd // [47] phi assert_sbyte::msg#5 = test_sbytes::msg2 [phi:test_sbytes::@2->assert_sbyte#2] -- pbuz1=pbuc1 lda #msg2 sta.z assert_sbyte.msg+1 jsr assert_sbyte // [23] phi from test_sbytes::@2 to test_sbytes::@3 [phi:test_sbytes::@2->test_sbytes::@3] __b3_from___b2: jmp __b3 // test_sbytes::@3 __b3: // [24] call assert_sbyte // [47] phi from test_sbytes::@3 to assert_sbyte [phi:test_sbytes::@3->assert_sbyte] assert_sbyte_from___b3: // [47] phi assert_sbyte::c#5 = 2 [phi:test_sbytes::@3->assert_sbyte#0] -- vbsz1=vbsc1 lda #2 sta.z assert_sbyte.c // [47] phi assert_sbyte::b#5 = test_sbytes::be#0 [phi:test_sbytes::@3->assert_sbyte#1] -- vbsxx=vbsc1 ldx #be // [47] phi assert_sbyte::msg#5 = test_sbytes::msg3 [phi:test_sbytes::@3->assert_sbyte#2] -- pbuz1=pbuc1 lda #msg3 sta.z assert_sbyte.msg+1 jsr assert_sbyte // [25] phi from test_sbytes::@3 to test_sbytes::@4 [phi:test_sbytes::@3->test_sbytes::@4] __b4_from___b3: jmp __b4 // test_sbytes::@4 __b4: // [26] call assert_sbyte // [47] phi from test_sbytes::@4 to assert_sbyte [phi:test_sbytes::@4->assert_sbyte] assert_sbyte_from___b4: // [47] phi assert_sbyte::c#5 = 2 [phi:test_sbytes::@4->assert_sbyte#0] -- vbsz1=vbsc1 lda #2 sta.z assert_sbyte.c // [47] phi assert_sbyte::b#5 = test_sbytes::bf [phi:test_sbytes::@4->assert_sbyte#1] -- vbsxx=vbsc1 ldx #bf // [47] phi assert_sbyte::msg#5 = test_sbytes::msg4 [phi:test_sbytes::@4->assert_sbyte#2] -- pbuz1=pbuc1 lda #msg4 sta.z assert_sbyte.msg+1 jsr assert_sbyte jmp __breturn // test_sbytes::@return __breturn: // [27] return rts .segment Data msg2: .text "0+2-4=-2" .byte 0 msg3: .text "-(0+2-4)=2" .byte 0 msg4: .text "-127-127=2" .byte 0 } .segment Code // memset // Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. // void * memset(void *str, char c, unsigned int num) memset: { .const c = ' ' .const num = $3e8 .label str = print_screen .label end = str+num .label dst = 4 // [29] phi from memset to memset::@1 [phi:memset->memset::@1] __b1_from_memset: // [29] phi memset::dst#2 = (char *)memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 lda #str sta.z dst+1 jmp __b1 // memset::@1 __b1: // [30] if(memset::dst#2!=memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1 lda.z dst+1 cmp #>end bne __b2 lda.z dst cmp #memset::@1] __b1_from___b2: // [29] phi memset::dst#2 = memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy jmp __b1 } // assert_byte // void assert_byte(__zp(4) char *msg, __register(X) char b, __zp(8) char c) assert_byte: { .label msg = 4 .label c = 8 // [35] print_str::str#1 = assert_byte::msg#3 // [36] call print_str // [61] phi from assert_byte to print_str [phi:assert_byte->print_str] print_str_from_assert_byte: // [61] phi print_char_cursor#87 = print_char_cursor#77 [phi:assert_byte->print_str#0] -- register_copy // [61] phi print_str::str#12 = print_str::str#1 [phi:assert_byte->print_str#1] -- register_copy jsr print_str // [37] phi from assert_byte to assert_byte::@4 [phi:assert_byte->assert_byte::@4] __b4_from_assert_byte: jmp __b4 // assert_byte::@4 __b4: // [38] call print_str // [61] phi from assert_byte::@4 to print_str [phi:assert_byte::@4->print_str] print_str_from___b4: // [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_byte::@4->print_str#0] -- register_copy // [61] phi print_str::str#12 = str [phi:assert_byte::@4->print_str#1] -- pbuz1=pbuc1 lda #str sta.z print_str.str+1 jsr print_str jmp __b5 // assert_byte::@5 __b5: // [39] if(assert_byte::b#3!=assert_byte::c#3) goto assert_byte::@1 -- vbuxx_neq_vbuz1_then_la1 cpx.z c bne __b1 // [40] phi from assert_byte::@5 to assert_byte::@3 [phi:assert_byte::@5->assert_byte::@3] __b3_from___b5: jmp __b3 // assert_byte::@3 __b3: // [41] call print_str // [61] phi from assert_byte::@3 to print_str [phi:assert_byte::@3->print_str] print_str_from___b3: // [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_byte::@3->print_str#0] -- register_copy // [61] phi print_str::str#12 = str2 [phi:assert_byte::@3->print_str#1] -- pbuz1=pbuc1 lda #str2 sta.z print_str.str+1 jsr print_str // [42] phi from assert_byte::@1 assert_byte::@3 to assert_byte::@2 [phi:assert_byte::@1/assert_byte::@3->assert_byte::@2] __b2_from___b1: __b2_from___b3: jmp __b2 // assert_byte::@2 __b2: // [43] call print_ln // [68] phi from assert_byte::@2 to print_ln [phi:assert_byte::@2->print_ln] print_ln_from___b2: // [68] phi print_line_cursor#49 = print_line_cursor#52 [phi:assert_byte::@2->print_ln#0] -- register_copy jsr print_ln jmp __breturn // assert_byte::@return __breturn: // [44] return rts // assert_byte::@1 __b1: // [45] *BG_COLOR = RED -- _deref_pbuc1=vbuc2 lda #RED sta BG_COLOR // [46] call print_str // [61] phi from assert_byte::@1 to print_str [phi:assert_byte::@1->print_str] print_str_from___b1: // [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_byte::@1->print_str#0] -- register_copy // [61] phi print_str::str#12 = str1 [phi:assert_byte::@1->print_str#1] -- pbuz1=pbuc1 lda #str1 sta.z print_str.str+1 jsr print_str jmp __b2_from___b1 } // assert_sbyte // void assert_sbyte(__zp(4) char *msg, __register(X) signed char b, __zp(8) signed char c) assert_sbyte: { .label msg = 4 .label c = 8 // [48] print_str::str#5 = assert_sbyte::msg#5 // [49] print_char_cursor#92 = print_line_cursor#0 -- pbuz1=pbuz2 lda.z print_line_cursor sta.z print_char_cursor lda.z print_line_cursor+1 sta.z print_char_cursor+1 // [50] call print_str // [61] phi from assert_sbyte to print_str [phi:assert_sbyte->print_str] print_str_from_assert_sbyte: // [61] phi print_char_cursor#87 = print_char_cursor#92 [phi:assert_sbyte->print_str#0] -- register_copy // [61] phi print_str::str#12 = print_str::str#5 [phi:assert_sbyte->print_str#1] -- register_copy jsr print_str // [51] phi from assert_sbyte to assert_sbyte::@4 [phi:assert_sbyte->assert_sbyte::@4] __b4_from_assert_sbyte: jmp __b4 // assert_sbyte::@4 __b4: // [52] call print_str // [61] phi from assert_sbyte::@4 to print_str [phi:assert_sbyte::@4->print_str] print_str_from___b4: // [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_sbyte::@4->print_str#0] -- register_copy // [61] phi print_str::str#12 = str [phi:assert_sbyte::@4->print_str#1] -- pbuz1=pbuc1 lda #str sta.z print_str.str+1 jsr print_str jmp __b5 // assert_sbyte::@5 __b5: // [53] if(assert_sbyte::b#5!=assert_sbyte::c#5) goto assert_sbyte::@1 -- vbsxx_neq_vbsz1_then_la1 cpx.z c bne __b1 // [54] phi from assert_sbyte::@5 to assert_sbyte::@3 [phi:assert_sbyte::@5->assert_sbyte::@3] __b3_from___b5: jmp __b3 // assert_sbyte::@3 __b3: // [55] call print_str // [61] phi from assert_sbyte::@3 to print_str [phi:assert_sbyte::@3->print_str] print_str_from___b3: // [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_sbyte::@3->print_str#0] -- register_copy // [61] phi print_str::str#12 = str2 [phi:assert_sbyte::@3->print_str#1] -- pbuz1=pbuc1 lda #str2 sta.z print_str.str+1 jsr print_str // [56] phi from assert_sbyte::@1 assert_sbyte::@3 to assert_sbyte::@2 [phi:assert_sbyte::@1/assert_sbyte::@3->assert_sbyte::@2] __b2_from___b1: __b2_from___b3: jmp __b2 // assert_sbyte::@2 __b2: // [57] call print_ln // [68] phi from assert_sbyte::@2 to print_ln [phi:assert_sbyte::@2->print_ln] print_ln_from___b2: // [68] phi print_line_cursor#49 = print_line_cursor#0 [phi:assert_sbyte::@2->print_ln#0] -- register_copy jsr print_ln jmp __breturn // assert_sbyte::@return __breturn: // [58] return rts // assert_sbyte::@1 __b1: // [59] *BG_COLOR = RED -- _deref_pbuc1=vbuc2 lda #RED sta BG_COLOR // [60] call print_str // [61] phi from assert_sbyte::@1 to print_str [phi:assert_sbyte::@1->print_str] print_str_from___b1: // [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_sbyte::@1->print_str#0] -- register_copy // [61] phi print_str::str#12 = str1 [phi:assert_sbyte::@1->print_str#1] -- pbuz1=pbuc1 lda #str1 sta.z print_str.str+1 jsr print_str jmp __b2_from___b1 } // print_str // Print a zero-terminated string // void print_str(__zp(4) char *str) print_str: { .label str = 4 // [62] phi from print_str print_str::@3 to print_str::@1 [phi:print_str/print_str::@3->print_str::@1] __b1_from_print_str: __b1_from___b3: // [62] phi print_char_cursor#1 = print_char_cursor#87 [phi:print_str/print_str::@3->print_str::@1#0] -- register_copy // [62] phi print_str::str#10 = print_str::str#12 [phi:print_str/print_str::@3->print_str::@1#1] -- register_copy jmp __b1 // print_str::@1 __b1: // [63] if(0!=*print_str::str#10) goto print_str::@2 -- 0_neq__deref_pbuz1_then_la1 ldy #0 lda (str),y cmp #0 bne __b2 jmp __breturn // print_str::@return __breturn: // [64] return rts // print_str::@2 __b2: // [65] print_char::ch#0 = *print_str::str#10 -- vbuaa=_deref_pbuz1 ldy #0 lda (str),y // [66] call print_char jsr print_char jmp __b3 // print_str::@3 __b3: // [67] print_str::str#0 = ++ print_str::str#10 -- pbuz1=_inc_pbuz1 inc.z str bne !+ inc.z str+1 !: jmp __b1_from___b3 } // print_ln // Print a newline print_ln: { // [69] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] __b1_from_print_ln: __b1_from___b1: // [69] phi print_line_cursor#25 = print_line_cursor#49 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy jmp __b1 // print_ln::@1 __b1: // [70] print_line_cursor#0 = print_line_cursor#25 + $28 -- pbuz1=pbuz1_plus_vbuc1 lda #$28 clc adc.z print_line_cursor sta.z print_line_cursor bcc !+ inc.z print_line_cursor+1 !: // [71] if(print_line_cursor#0print_cls] jsr print_cls // main::@1 // *BG_COLOR = GREEN // [2] *BG_COLOR = GREEN -- _deref_pbuc1=vbuc2 lda #GREEN sta BG_COLOR // test_bytes() // [3] call test_bytes // [10] phi from main::@1 to test_bytes [phi:main::@1->test_bytes] jsr test_bytes // [4] phi from main::@1 to main::@2 [phi:main::@1->main::@2] // main::@2 // test_sbytes() // [5] call test_sbytes // [17] phi from main::@2 to test_sbytes [phi:main::@2->test_sbytes] jsr test_sbytes // main::@return // } // [6] return rts } // print_cls // Clear the screen. Also resets current line/char cursor. print_cls: { // memset(print_screen, ' ', 1000) // [8] call memset // [28] phi from print_cls to memset [phi:print_cls->memset] jsr memset // print_cls::@return // } // [9] return rts } // test_bytes // Test different byte constants test_bytes: { .const bb = 0 .const bc = 2 .const bd = bc-4 // assert_byte("0=0", bb, 0) // [11] call assert_byte // [34] phi from test_bytes to assert_byte [phi:test_bytes->assert_byte] // [34] phi print_line_cursor#52 = print_screen#0 [phi:test_bytes->assert_byte#0] -- pbuz1=pbuc1 lda #print_screen sta.z print_line_cursor+1 // [34] phi assert_byte::c#3 = 0 [phi:test_bytes->assert_byte#1] -- vbuz1=vbuc1 lda #0 sta.z assert_byte.c // [34] phi assert_byte::b#3 = test_bytes::bb [phi:test_bytes->assert_byte#2] -- vbuxx=vbuc1 ldx #bb // [34] phi print_char_cursor#77 = print_screen#0 [phi:test_bytes->assert_byte#3] -- pbuz1=pbuc1 lda #print_screen sta.z print_char_cursor+1 // [34] phi assert_byte::msg#3 = msg [phi:test_bytes->assert_byte#4] -- pbuz1=pbuc1 lda #msg sta.z assert_byte.msg+1 jsr assert_byte // test_bytes::@1 // [12] print_char_cursor#98 = print_line_cursor#0 -- pbuz1=pbuz2 lda.z print_line_cursor sta.z print_char_cursor lda.z print_line_cursor+1 sta.z print_char_cursor+1 // assert_byte("0+2=2", bc, 2) // [13] call assert_byte // [34] phi from test_bytes::@1 to assert_byte [phi:test_bytes::@1->assert_byte] // [34] phi print_line_cursor#52 = print_line_cursor#0 [phi:test_bytes::@1->assert_byte#0] -- register_copy // [34] phi assert_byte::c#3 = 2 [phi:test_bytes::@1->assert_byte#1] -- vbuz1=vbuc1 lda #2 sta.z assert_byte.c // [34] phi assert_byte::b#3 = test_bytes::bc#0 [phi:test_bytes::@1->assert_byte#2] -- vbuxx=vbuc1 ldx #bc // [34] phi print_char_cursor#77 = print_char_cursor#98 [phi:test_bytes::@1->assert_byte#3] -- register_copy // [34] phi assert_byte::msg#3 = msg1 [phi:test_bytes::@1->assert_byte#4] -- pbuz1=pbuc1 lda #msg1 sta.z assert_byte.msg+1 jsr assert_byte // test_bytes::@2 // [14] print_char_cursor#99 = print_line_cursor#0 -- pbuz1=pbuz2 lda.z print_line_cursor sta.z print_char_cursor lda.z print_line_cursor+1 sta.z print_char_cursor+1 // assert_byte("0+2-4=254", bd, 254) // [15] call assert_byte // [34] phi from test_bytes::@2 to assert_byte [phi:test_bytes::@2->assert_byte] // [34] phi print_line_cursor#52 = print_line_cursor#0 [phi:test_bytes::@2->assert_byte#0] -- register_copy // [34] phi assert_byte::c#3 = $fe [phi:test_bytes::@2->assert_byte#1] -- vbuz1=vbuc1 lda #$fe sta.z assert_byte.c // [34] phi assert_byte::b#3 = test_bytes::bd#0 [phi:test_bytes::@2->assert_byte#2] -- vbuxx=vbuc1 ldx #bd // [34] phi print_char_cursor#77 = print_char_cursor#99 [phi:test_bytes::@2->assert_byte#3] -- register_copy // [34] phi assert_byte::msg#3 = test_bytes::msg2 [phi:test_bytes::@2->assert_byte#4] -- pbuz1=pbuc1 lda #msg2 sta.z assert_byte.msg+1 jsr assert_byte // test_bytes::@return // } // [16] return rts .segment Data msg2: .text "0+2-4=254" .byte 0 } .segment Code // test_sbytes // Test different signed byte constants test_sbytes: { .const bb = 0 .const bf = -$7f-$7f .const bc = 2 .const bd = bc-4 .const be = -bd // assert_sbyte("0=0", bb, 0) // [18] call assert_sbyte // [47] phi from test_sbytes to assert_sbyte [phi:test_sbytes->assert_sbyte] // [47] phi assert_sbyte::c#5 = 0 [phi:test_sbytes->assert_sbyte#0] -- vbsz1=vbsc1 lda #0 sta.z assert_sbyte.c // [47] phi assert_sbyte::b#5 = test_sbytes::bb [phi:test_sbytes->assert_sbyte#1] -- vbsxx=vbsc1 ldx #bb // [47] phi assert_sbyte::msg#5 = msg [phi:test_sbytes->assert_sbyte#2] -- pbuz1=pbuc1 lda #msg sta.z assert_sbyte.msg+1 jsr assert_sbyte // [19] phi from test_sbytes to test_sbytes::@1 [phi:test_sbytes->test_sbytes::@1] // test_sbytes::@1 // assert_sbyte("0+2=2", bc, 2) // [20] call assert_sbyte // [47] phi from test_sbytes::@1 to assert_sbyte [phi:test_sbytes::@1->assert_sbyte] // [47] phi assert_sbyte::c#5 = 2 [phi:test_sbytes::@1->assert_sbyte#0] -- vbsz1=vbsc1 lda #2 sta.z assert_sbyte.c // [47] phi assert_sbyte::b#5 = test_sbytes::bc#0 [phi:test_sbytes::@1->assert_sbyte#1] -- vbsxx=vbsc1 ldx #bc // [47] phi assert_sbyte::msg#5 = msg1 [phi:test_sbytes::@1->assert_sbyte#2] -- pbuz1=pbuc1 lda #msg1 sta.z assert_sbyte.msg+1 jsr assert_sbyte // [21] phi from test_sbytes::@1 to test_sbytes::@2 [phi:test_sbytes::@1->test_sbytes::@2] // test_sbytes::@2 // assert_sbyte("0+2-4=-2", bd, -2) // [22] call assert_sbyte // [47] phi from test_sbytes::@2 to assert_sbyte [phi:test_sbytes::@2->assert_sbyte] // [47] phi assert_sbyte::c#5 = -2 [phi:test_sbytes::@2->assert_sbyte#0] -- vbsz1=vbsc1 lda #-2 sta.z assert_sbyte.c // [47] phi assert_sbyte::b#5 = test_sbytes::bd#0 [phi:test_sbytes::@2->assert_sbyte#1] -- vbsxx=vbsc1 ldx #bd // [47] phi assert_sbyte::msg#5 = test_sbytes::msg2 [phi:test_sbytes::@2->assert_sbyte#2] -- pbuz1=pbuc1 lda #msg2 sta.z assert_sbyte.msg+1 jsr assert_sbyte // [23] phi from test_sbytes::@2 to test_sbytes::@3 [phi:test_sbytes::@2->test_sbytes::@3] // test_sbytes::@3 // assert_sbyte("-(0+2-4)=2", be, 2) // [24] call assert_sbyte // [47] phi from test_sbytes::@3 to assert_sbyte [phi:test_sbytes::@3->assert_sbyte] // [47] phi assert_sbyte::c#5 = 2 [phi:test_sbytes::@3->assert_sbyte#0] -- vbsz1=vbsc1 lda #2 sta.z assert_sbyte.c // [47] phi assert_sbyte::b#5 = test_sbytes::be#0 [phi:test_sbytes::@3->assert_sbyte#1] -- vbsxx=vbsc1 ldx #be // [47] phi assert_sbyte::msg#5 = test_sbytes::msg3 [phi:test_sbytes::@3->assert_sbyte#2] -- pbuz1=pbuc1 lda #msg3 sta.z assert_sbyte.msg+1 jsr assert_sbyte // [25] phi from test_sbytes::@3 to test_sbytes::@4 [phi:test_sbytes::@3->test_sbytes::@4] // test_sbytes::@4 // assert_sbyte("-127-127=2", bf, 2) // [26] call assert_sbyte // [47] phi from test_sbytes::@4 to assert_sbyte [phi:test_sbytes::@4->assert_sbyte] // [47] phi assert_sbyte::c#5 = 2 [phi:test_sbytes::@4->assert_sbyte#0] -- vbsz1=vbsc1 lda #2 sta.z assert_sbyte.c // [47] phi assert_sbyte::b#5 = test_sbytes::bf [phi:test_sbytes::@4->assert_sbyte#1] -- vbsxx=vbsc1 ldx #bf // [47] phi assert_sbyte::msg#5 = test_sbytes::msg4 [phi:test_sbytes::@4->assert_sbyte#2] -- pbuz1=pbuc1 lda #msg4 sta.z assert_sbyte.msg+1 jsr assert_sbyte // test_sbytes::@return // } // [27] return rts .segment Data msg2: .text "0+2-4=-2" .byte 0 msg3: .text "-(0+2-4)=2" .byte 0 msg4: .text "-127-127=2" .byte 0 } .segment Code // memset // Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. // void * memset(void *str, char c, unsigned int num) memset: { .const c = ' ' .const num = $3e8 .label str = print_screen .label end = str+num .label dst = 4 // [29] phi from memset to memset::@1 [phi:memset->memset::@1] // [29] phi memset::dst#2 = (char *)memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 lda #str sta.z dst+1 // memset::@1 __b1: // for(char* dst = str; dst!=end; dst++) // [30] if(memset::dst#2!=memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1 lda.z dst+1 cmp #>end bne __b2 lda.z dst cmp #memset::@1] // [29] phi memset::dst#2 = memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy jmp __b1 } // assert_byte // void assert_byte(__zp(4) char *msg, __register(X) char b, __zp(8) char c) assert_byte: { .label msg = 4 .label c = 8 // print_str(msg) // [35] print_str::str#1 = assert_byte::msg#3 // [36] call print_str // [61] phi from assert_byte to print_str [phi:assert_byte->print_str] // [61] phi print_char_cursor#87 = print_char_cursor#77 [phi:assert_byte->print_str#0] -- register_copy // [61] phi print_str::str#12 = print_str::str#1 [phi:assert_byte->print_str#1] -- register_copy jsr print_str // [37] phi from assert_byte to assert_byte::@4 [phi:assert_byte->assert_byte::@4] // assert_byte::@4 // print_str(" ") // [38] call print_str // [61] phi from assert_byte::@4 to print_str [phi:assert_byte::@4->print_str] // [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_byte::@4->print_str#0] -- register_copy // [61] phi print_str::str#12 = str [phi:assert_byte::@4->print_str#1] -- pbuz1=pbuc1 lda #str sta.z print_str.str+1 jsr print_str // assert_byte::@5 // if(b!=c) // [39] if(assert_byte::b#3!=assert_byte::c#3) goto assert_byte::@1 -- vbuxx_neq_vbuz1_then_la1 cpx.z c bne __b1 // [40] phi from assert_byte::@5 to assert_byte::@3 [phi:assert_byte::@5->assert_byte::@3] // assert_byte::@3 // print_str("ok") // [41] call print_str // [61] phi from assert_byte::@3 to print_str [phi:assert_byte::@3->print_str] // [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_byte::@3->print_str#0] -- register_copy // [61] phi print_str::str#12 = str2 [phi:assert_byte::@3->print_str#1] -- pbuz1=pbuc1 lda #str2 sta.z print_str.str+1 jsr print_str // [42] phi from assert_byte::@1 assert_byte::@3 to assert_byte::@2 [phi:assert_byte::@1/assert_byte::@3->assert_byte::@2] // assert_byte::@2 __b2: // print_ln() // [43] call print_ln // [68] phi from assert_byte::@2 to print_ln [phi:assert_byte::@2->print_ln] // [68] phi print_line_cursor#49 = print_line_cursor#52 [phi:assert_byte::@2->print_ln#0] -- register_copy jsr print_ln // assert_byte::@return // } // [44] return rts // assert_byte::@1 __b1: // *BG_COLOR = RED // [45] *BG_COLOR = RED -- _deref_pbuc1=vbuc2 lda #RED sta BG_COLOR // print_str("fail!") // [46] call print_str // [61] phi from assert_byte::@1 to print_str [phi:assert_byte::@1->print_str] // [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_byte::@1->print_str#0] -- register_copy // [61] phi print_str::str#12 = str1 [phi:assert_byte::@1->print_str#1] -- pbuz1=pbuc1 lda #str1 sta.z print_str.str+1 jsr print_str jmp __b2 } // assert_sbyte // void assert_sbyte(__zp(4) char *msg, __register(X) signed char b, __zp(8) signed char c) assert_sbyte: { .label msg = 4 .label c = 8 // print_str(msg) // [48] print_str::str#5 = assert_sbyte::msg#5 // [49] print_char_cursor#92 = print_line_cursor#0 -- pbuz1=pbuz2 lda.z print_line_cursor sta.z print_char_cursor lda.z print_line_cursor+1 sta.z print_char_cursor+1 // print_str(msg) // [50] call print_str // [61] phi from assert_sbyte to print_str [phi:assert_sbyte->print_str] // [61] phi print_char_cursor#87 = print_char_cursor#92 [phi:assert_sbyte->print_str#0] -- register_copy // [61] phi print_str::str#12 = print_str::str#5 [phi:assert_sbyte->print_str#1] -- register_copy jsr print_str // [51] phi from assert_sbyte to assert_sbyte::@4 [phi:assert_sbyte->assert_sbyte::@4] // assert_sbyte::@4 // print_str(" ") // [52] call print_str // [61] phi from assert_sbyte::@4 to print_str [phi:assert_sbyte::@4->print_str] // [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_sbyte::@4->print_str#0] -- register_copy // [61] phi print_str::str#12 = str [phi:assert_sbyte::@4->print_str#1] -- pbuz1=pbuc1 lda #str sta.z print_str.str+1 jsr print_str // assert_sbyte::@5 // if(b!=c) // [53] if(assert_sbyte::b#5!=assert_sbyte::c#5) goto assert_sbyte::@1 -- vbsxx_neq_vbsz1_then_la1 cpx.z c bne __b1 // [54] phi from assert_sbyte::@5 to assert_sbyte::@3 [phi:assert_sbyte::@5->assert_sbyte::@3] // assert_sbyte::@3 // print_str("ok") // [55] call print_str // [61] phi from assert_sbyte::@3 to print_str [phi:assert_sbyte::@3->print_str] // [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_sbyte::@3->print_str#0] -- register_copy // [61] phi print_str::str#12 = str2 [phi:assert_sbyte::@3->print_str#1] -- pbuz1=pbuc1 lda #str2 sta.z print_str.str+1 jsr print_str // [56] phi from assert_sbyte::@1 assert_sbyte::@3 to assert_sbyte::@2 [phi:assert_sbyte::@1/assert_sbyte::@3->assert_sbyte::@2] // assert_sbyte::@2 __b2: // print_ln() // [57] call print_ln // [68] phi from assert_sbyte::@2 to print_ln [phi:assert_sbyte::@2->print_ln] // [68] phi print_line_cursor#49 = print_line_cursor#0 [phi:assert_sbyte::@2->print_ln#0] -- register_copy jsr print_ln // assert_sbyte::@return // } // [58] return rts // assert_sbyte::@1 __b1: // *BG_COLOR = RED // [59] *BG_COLOR = RED -- _deref_pbuc1=vbuc2 lda #RED sta BG_COLOR // print_str("fail!") // [60] call print_str // [61] phi from assert_sbyte::@1 to print_str [phi:assert_sbyte::@1->print_str] // [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_sbyte::@1->print_str#0] -- register_copy // [61] phi print_str::str#12 = str1 [phi:assert_sbyte::@1->print_str#1] -- pbuz1=pbuc1 lda #str1 sta.z print_str.str+1 jsr print_str jmp __b2 } // print_str // Print a zero-terminated string // void print_str(__zp(4) char *str) print_str: { .label str = 4 // [62] phi from print_str print_str::@3 to print_str::@1 [phi:print_str/print_str::@3->print_str::@1] // [62] phi print_char_cursor#1 = print_char_cursor#87 [phi:print_str/print_str::@3->print_str::@1#0] -- register_copy // [62] phi print_str::str#10 = print_str::str#12 [phi:print_str/print_str::@3->print_str::@1#1] -- register_copy // print_str::@1 __b1: // while(*str) // [63] if(0!=*print_str::str#10) goto print_str::@2 -- 0_neq__deref_pbuz1_then_la1 ldy #0 lda (str),y cmp #0 bne __b2 // print_str::@return // } // [64] return rts // print_str::@2 __b2: // print_char(*(str++)) // [65] print_char::ch#0 = *print_str::str#10 -- vbuaa=_deref_pbuz1 ldy #0 lda (str),y // [66] call print_char jsr print_char // print_str::@3 // print_char(*(str++)); // [67] print_str::str#0 = ++ print_str::str#10 -- pbuz1=_inc_pbuz1 inc.z str bne !+ inc.z str+1 !: jmp __b1 } // print_ln // Print a newline print_ln: { // [69] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] // [69] phi print_line_cursor#25 = print_line_cursor#49 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy // print_ln::@1 __b1: // print_line_cursor + 0x28 // [70] print_line_cursor#0 = print_line_cursor#25 + $28 -- pbuz1=pbuz1_plus_vbuc1 lda #$28 clc adc.z print_line_cursor sta.z print_line_cursor bcc !+ inc.z print_line_cursor+1 !: // while (print_line_cursor