int main(int argc, char *argv[]) {
  unsigned int rc = 0;
  plan_tests(2);
  rc = diag("A diagnostic message");
  diag("Returned: %d", rc);
  ((1) ? _gen_result(
             1, __func__,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/ByteFoundryAU/monitoring-plugins/refs/"
             "heads/fedora/t/libtap-tests/diag/test.c",
             42, "test 1")
       : _gen_result(
             0, __func__,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/ByteFoundryAU/monitoring-plugins/refs/"
             "heads/fedora/t/libtap-tests/diag/test.c",
             42, "test 1")) ||
      diag("ok() failed, and shouldn't");
  ((0) ? _gen_result(
             1, __func__,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/ByteFoundryAU/monitoring-plugins/refs/"
             "heads/fedora/t/libtap-tests/diag/test.c",
             43, "test 2")
       : _gen_result(
             0, __func__,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/ByteFoundryAU/monitoring-plugins/refs/"
             "heads/fedora/t/libtap-tests/diag/test.c",
             43, "test 2")) ||
      diag("ok() passed, and shouldn't");
  return exit_status();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x2,%edi
mov    $0x0,%al
call   1060 <plan_tests@plt>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1040 <diag@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <diag@plt>
mov    $0x1,%al
test   $0x1,%al
jne    119a <main+0x5a>
jmp    11d5 <main+0x95>
mov    $0x1,%edi
lea    0xe7c(%rip),%rsi
lea    0xe7a(%rip),%rdx
mov    $0x2a,%ecx
lea    0xf16(%rip),%r8
mov    $0x0,%al
call   1050 <_gen_result@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
jne    121f <main+0xdf>
jmp    1208 <main+0xc8>
xor    %edi,%edi
lea    0xe44(%rip),%rsi
lea    0xe42(%rip),%rdx
mov    $0x2a,%ecx
lea    0xede(%rip),%r8
mov    $0x0,%al
call   1050 <_gen_result@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
jne    121f <main+0xdf>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1040 <diag@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
xor    %eax,%eax
test   $0x1,%al
jne    1231 <main+0xf1>
jmp    126c <main+0x12c>
mov    $0x1,%edi
lea    0xde5(%rip),%rsi
lea    0xde3(%rip),%rdx
mov    $0x2b,%ecx
lea    0xea1(%rip),%r8
mov    $0x0,%al
call   1050 <_gen_result@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x16(%rbp)
jne    12b6 <main+0x176>
jmp    129f <main+0x15f>
xor    %edi,%edi
lea    0xdad(%rip),%rsi
lea    0xdab(%rip),%rdx
mov    $0x2b,%ecx
lea    0xe69(%rip),%r8
mov    $0x0,%al
call   1050 <_gen_result@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x16(%rbp)
jne    12b6 <main+0x176>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1040 <diag@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
mov    $0x0,%al
call   1030 <exit_status@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
xor    %eax,%eax
call   1060 <plan_tests@plt>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1040 <diag@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <diag@plt>
lea    0xeb0(%rip),%rsi
lea    0xeae(%rip),%rdx
lea    0xf4f(%rip),%r8
mov    $0x1,%edi
mov    $0x2a,%ecx
xor    %eax,%eax
call   1050 <_gen_result@plt>
test   %eax,%eax
jne    11a3 <main+0x63>
lea    0xf3a(%rip),%rdi
xor    %eax,%eax
call   1040 <diag@plt>
lea    0xe78(%rip),%rsi
lea    0xe76(%rip),%rdx
lea    0xf39(%rip),%r8
xor    %edi,%edi
mov    $0x2b,%ecx
xor    %eax,%eax
call   1050 <_gen_result@plt>
test   %eax,%eax
jne    11d8 <main+0x98>
lea    0xf27(%rip),%rdi
xor    %eax,%eax
call   1040 <diag@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <exit_status@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"A diagnostic message\00"
@.str.1 = [13 x i8] c"Returned: %d\00"
@__func__.main = [5 x i8] c"main\00"
@.str.2 = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ByteFoundryAU/monitoring-plugins/refs/heads/fedora/t/libtap-tests/diag/test.c\00"
@.str.3 = [7 x i8] c"test 1\00"
@.str.4 = [27 x i8] c"ok() failed, and shouldn't\00"
@.str.5 = [7 x i8] c"test 2\00"
@.str.6 = [27 x i8] c"ok() passed, and shouldn't\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 (i32, ...) bitcast (i32 (...)* @plan_tests to i32 (i32, ...)*)(i32 2)
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @diag to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @diag to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br i1 true, label %11, label %14
11: ; preds = %2
%12 = call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_gen_result to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str.2, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %20, label %17
14: ; preds = %2
%15 = call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_gen_result to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str.2, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%16 = icmp ne i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %14, %11
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @diag to i32 (i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %17, %14, %11
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
br i1 false, label %23, label %26
23: ; preds = %20
%24 = call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_gen_result to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str.2, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
br i1 %25, label %32, label %29
26: ; preds = %20
%27 = call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_gen_result to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str.2, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%28 = icmp ne i32 %27, 0
br i1 %28, label %32, label %29
29: ; preds = %26, %23
%30 = call i32 (i8*, ...) bitcast (i32 (...)* @diag to i32 (i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%31 = icmp ne i32 %30, 0
br label %32
32: ; preds = %29, %26, %23
%33 = phi i1 [ true, %26 ], [ true, %23 ], [ %31, %29 ]
%34 = zext i1 %33 to i32
%35 = call i32 (...) @exit_status()
ret i32 %35
}

LLVM IR (-O2):
@.str = [21 x i8] c"A diagnostic message\00"
@.str.1 = [13 x i8] c"Returned: %d\00"
@__func__.main = [5 x i8] c"main\00"
@.str.2 = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ByteFoundryAU/monitoring-plugins/refs/heads/fedora/t/libtap-tests/diag/test.c\00"
@.str.3 = [7 x i8] c"test 1\00"
@.str.4 = [27 x i8] c"ok() failed, and shouldn't\00"
@.str.5 = [7 x i8] c"test 2\00"
@.str.6 = [27 x i8] c"ok() passed, and shouldn't\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @plan_tests to i32 (i32, ...)*)(i32 2)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @diag to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @diag to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_gen_result to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str.2, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @diag to i32 (i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = tail call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_gen_result to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str.2, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 (i8*, ...) bitcast (i32 (...)* @diag to i32 (i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = tail call i32 (...) @exit_status()
ret i32 %16
}