void test_draw() {
  window_draw_string(0, 0, "test draw string");
  window_draw_char(5, 5, 'a');
  window_refresh();
  Test_assert((int)(window_has_string(0, 0, "test draw")),
              "window_has_string(0, 0, \"test draw\")", __func__,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jefersonbelmiro/tron/refs/heads/"
              "master/test/window.c",
              14);
  Test_assert((int)(window_has_string(10, 0, "string")),
              "window_has_string(10, 0, \"string\")", __func__,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jefersonbelmiro/tron/refs/heads/"
              "master/test/window.c",
              15);
  Test_assert((int)(window_has_string(5, 5, "a")),
              "window_has_string(5, 5, \"a\")", __func__,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jefersonbelmiro/tron/refs/heads/"
              "master/test/window.c",
              16);
}


x86 assembly (clang, -O0):
<test_draw>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
lea    0xea3(%rip),%rdx
mov    %esi,%edi
mov    $0x0,%al
call   1060 <window_draw_string@plt>
mov    $0x5,%esi
mov    $0x61,%edx
mov    %esi,%edi
mov    $0x0,%al
call   1050 <window_draw_char@plt>
mov    $0x0,%al
call   1040 <window_refresh@plt>
xor    %esi,%esi
lea    0xe88(%rip),%rdx
mov    %esi,%edi
mov    $0x0,%al
call   1030 <window_has_string@plt>
mov    %eax,%edi
lea    0xe80(%rip),%rsi
lea    0xe9e(%rip),%rdx
lea    0xea1(%rip),%rcx
mov    $0xe,%r8d
mov    $0x0,%al
call   1070 <Test_assert@plt>
mov    $0xa,%edi
xor    %esi,%esi
lea    0xe46(%rip),%rdx
mov    $0x0,%al
call   1030 <window_has_string@plt>
mov    %eax,%edi
lea    0xf05(%rip),%rsi
lea    0xe65(%rip),%rdx
lea    0xe68(%rip),%rcx
mov    $0xf,%r8d
mov    $0x0,%al
call   1070 <Test_assert@plt>
mov    $0x5,%esi
lea    0xf01(%rip),%rdx
mov    %esi,%edi
mov    $0x0,%al
call   1030 <window_has_string@plt>
mov    %eax,%edi
lea    0xef1(%rip),%rsi
lea    0xe2c(%rip),%rdx
lea    0xe2f(%rip),%rcx
mov    $0x10,%r8d
mov    $0x0,%al
call   1070 <Test_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_draw>:
push   %r14
push   %rbx
push   %rax
lea    0xea5(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <window_draw_string@plt>
mov    $0x5,%edi
mov    $0x5,%esi
mov    $0x61,%edx
xor    %eax,%eax
call   1050 <window_draw_char@plt>
xor    %eax,%eax
call   1040 <window_refresh@plt>
lea    0xe87(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <window_has_string@plt>
lea    0xe7f(%rip),%rsi
lea    0xe9d(%rip),%rbx
lea    0xea0(%rip),%r14
mov    %eax,%edi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    $0xe,%r8d
xor    %eax,%eax
call   1070 <Test_assert@plt>
lea    0xe44(%rip),%rdx
mov    $0xa,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <window_has_string@plt>
lea    0xefe(%rip),%rsi
mov    %eax,%edi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    $0xf,%r8d
xor    %eax,%eax
call   1070 <Test_assert@plt>
lea    0xf05(%rip),%rdx
mov    $0x5,%edi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <window_has_string@plt>
lea    0xeef(%rip),%rsi
mov    %eax,%edi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    $0x10,%r8d
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <Test_assert@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"test draw string\00"
@.str.1 = [10 x i8] c"test draw\00"
@.str.2 = [37 x i8] c"window_has_string(0, 0, \22test draw\22)\00"
@__func__.test_draw = [10 x i8] c"test_draw\00"
@.str.3 = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jefersonbelmiro/tron/refs/heads/master/test/window.c\00"
@.str.4 = [7 x i8] c"string\00"
@.str.5 = [35 x i8] c"window_has_string(10, 0, \22string\22)\00"
@.str.6 = [2 x i8] c"a\00"
@.str.7 = [29 x i8] c"window_has_string(5, 5, \22a\22)\00"
define void @test_draw() {
%1 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @window_draw_string to i32 (i32, i32, i8*, ...)*)(i32 0, i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @window_draw_char to i32 (i32, i32, i32, ...)*)(i32 5, i32 5, i32 97)
%3 = call i32 (...) @window_refresh()
%4 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @window_has_string to i32 (i32, i32, i8*, ...)*)(i32 0, i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (i32, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @Test_assert to i32 (i32, i8*, i8*, i8*, i32, ...)*)(i32 %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.test_draw, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.3, i64 0, i64 0), i32 14)
%6 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @window_has_string to i32 (i32, i32, i8*, ...)*)(i32 10, i32 0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 (i32, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @Test_assert to i32 (i32, i8*, i8*, i8*, i32, ...)*)(i32 %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.test_draw, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.3, i64 0, i64 0), i32 15)
%8 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @window_has_string to i32 (i32, i32, i8*, ...)*)(i32 5, i32 5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 (i32, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @Test_assert to i32 (i32, i8*, i8*, i8*, i32, ...)*)(i32 %8, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.test_draw, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.3, i64 0, i64 0), i32 16)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"test draw string\00"
@.str.1 = [10 x i8] c"test draw\00"
@.str.2 = [37 x i8] c"window_has_string(0, 0, \22test draw\22)\00"
@__func__.test_draw = [10 x i8] c"test_draw\00"
@.str.3 = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jefersonbelmiro/tron/refs/heads/master/test/window.c\00"
@.str.4 = [7 x i8] c"string\00"
@.str.5 = [35 x i8] c"window_has_string(10, 0, \22string\22)\00"
@.str.6 = [2 x i8] c"a\00"
@.str.7 = [29 x i8] c"window_has_string(5, 5, \22a\22)\00"
define void @test_draw() {
%1 = tail call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @window_draw_string to i32 (i32, i32, i8*, ...)*)(i32 0, i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @window_draw_char to i32 (i32, i32, i32, ...)*)(i32 5, i32 5, i32 97)
%3 = tail call i32 (...) @window_refresh()
%4 = tail call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @window_has_string to i32 (i32, i32, i8*, ...)*)(i32 0, i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i32, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @Test_assert to i32 (i32, i8*, i8*, i8*, i32, ...)*)(i32 %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.test_draw, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.3, i64 0, i64 0), i32 14)
%6 = tail call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @window_has_string to i32 (i32, i32, i8*, ...)*)(i32 10, i32 0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 (i32, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @Test_assert to i32 (i32, i8*, i8*, i8*, i32, ...)*)(i32 %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.test_draw, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.3, i64 0, i64 0), i32 15)
%8 = tail call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @window_has_string to i32 (i32, i32, i8*, ...)*)(i32 5, i32 5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%9 = tail call i32 (i32, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @Test_assert to i32 (i32, i8*, i8*, i8*, i32, ...)*)(i32 %8, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.test_draw, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.3, i64 0, i64 0), i32 16)
ret void
}