void test_string() {
  char s[] = "abc";
  fexpect_string(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/initializer.c",
      41, "abc", s);
  ;
  char t[] = {"def"};
  fexpect_string(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/initializer.c",
      43, "def", t);
  ;
}


x86 assembly (clang, -O0):
<test_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rcx
lea    0xed8(%rip),%rdi
mov    $0x29,%esi
lea    0xec8(%rip),%rdx
mov    $0x0,%al
call   1030 <fexpect_string@plt>
mov    0xf45(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rcx
lea    0xeb1(%rip),%rdi
mov    $0x2b,%esi
lea    0xf2b(%rip),%rdx
mov    $0x0,%al
call   1030 <fexpect_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_string>:
push   %rbx
sub    $0x10,%rsp
movl   $0x636261,0xc(%rsp)
lea    0xedc(%rip),%rbx
lea    0xf5b(%rip),%rdx
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x29,%esi
xor    %eax,%eax
call   1030 <fexpect_string@plt>
movl   $0x666564,0x8(%rsp)
lea    0xf3c(%rip),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x2b,%esi
xor    %eax,%eax
call   1030 <fexpect_string@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_string.s = [4 x i8] c"abc\00"
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/initializer.c\00"
@.str.1 = [4 x i8] c"abc\00"
@__const.test_string.t = [4 x i8] c"def\00"
@.str.2 = [4 x i8] c"def\00"
define void @test_string() {
%1 = alloca [4 x i8]
%2 = alloca [4 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%5 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @fexpect_string to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = bitcast [4 x i8]* %2 to i8*
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @fexpect_string to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/initializer.c\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [4 x i8] c"def\00"
define void @test_string() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 6513249, i32* %1
%4 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @fexpect_string to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = bitcast i32* %2 to i8*
store i32 6710628, i32* %2
%6 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @fexpect_string to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret void
}