int test_something_bad() {
  int x = 3;
  do {
    if (!chk(!!(42 == 6 * 7),
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/adrianratnapala/elm0/refs/heads/master/"
             "0example.c",
             40, __func__, "%s", "42 == 6 * 7"))
      goto fail;
  } while (0);
  do {
    if (!chk(!!(strlen("wrong answer") < strlen("question")),
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/adrianratnapala/elm0/refs/heads/master/"
             "0example.c",
             42, __func__, "%s",
             "strlen(\"wrong answer\") < strlen(\"question\")"))
      goto fail;
  } while (0);
  do {
    if (!chk(!!(5 == ++x),
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/adrianratnapala/elm0/refs/heads/master/"
             "0example.c",
             44, __func__, "%s", "5 == ++x"))
      goto fail;
  } while (0);
  do {
    if (!chk(!!(5 == ++x),
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/adrianratnapala/elm0/refs/heads/master/"
             "0example.c",
             45, __func__, "%s", "5 == ++x"))
      goto fail;
  } while (0);
  return pass(__func__);
  goto fail;
fail:
  return 0;
}


x86 assembly (clang, -O0):
<test_something_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x8(%rbp)
mov    $0x1,%edi
lea    0xec5(%rip),%rsi
mov    $0x28,%edx
lea    0xf45(%rip),%rcx
lea    0xf51(%rip),%r8
lea    0xf4d(%rip),%r9
mov    $0x0,%al
call   1030 <chk@plt>
cmp    $0x0,%eax
jne    116a <test_something_bad+0x4a>
jmp    127f <test_something_bad+0x15f>
jmp    116f <test_something_bad+0x4f>
jmp    1174 <test_something_bad+0x54>
xor    %edi,%edi
lea    0xe83(%rip),%rsi
mov    $0x2a,%edx
lea    0xf03(%rip),%rcx
lea    0xf0f(%rip),%r8
lea    0xf17(%rip),%r9
mov    $0x0,%al
call   1030 <chk@plt>
cmp    $0x0,%eax
jne    11ac <test_something_bad+0x8c>
jmp    127f <test_something_bad+0x15f>
jmp    11b1 <test_something_bad+0x91>
jmp    11b6 <test_something_bad+0x96>
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    $0x5,%eax
cmp    %ecx,%eax
sete   %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
lea    0xe27(%rip),%rsi
mov    $0x2c,%edx
lea    0xea7(%rip),%rcx
lea    0xeb3(%rip),%r8
lea    0xee7(%rip),%r9
mov    $0x0,%al
call   1030 <chk@plt>
cmp    $0x0,%eax
jne    1208 <test_something_bad+0xe8>
jmp    127f <test_something_bad+0x15f>
jmp    120d <test_something_bad+0xed>
jmp    1212 <test_something_bad+0xf2>
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    $0x5,%eax
cmp    %ecx,%eax
sete   %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
lea    0xdcb(%rip),%rsi
mov    $0x2d,%edx
lea    0xe4b(%rip),%rcx
lea    0xe57(%rip),%r8
lea    0xe8b(%rip),%r9
mov    $0x0,%al
call   1030 <chk@plt>
cmp    $0x0,%eax
jne    1264 <test_something_bad+0x144>
jmp    127f <test_something_bad+0x15f>
jmp    1269 <test_something_bad+0x149>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1040 <pass@plt>
mov    %eax,-0x4(%rbp)
jmp    1286 <test_something_bad+0x166>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_something_bad>:
push   %rax
lea    0xed8(%rip),%rsi
lea    0xf5d(%rip),%rcx
lea    0xf69(%rip),%r8
lea    0xf65(%rip),%r9
mov    $0x1,%edi
mov    $0x28,%edx
xor    %eax,%eax
call   1030 <chk@plt>
test   %eax,%eax
je     11f2 <test_something_bad+0xd2>
lea    0xea3(%rip),%rsi
lea    0xf28(%rip),%rcx
lea    0xf34(%rip),%r8
lea    0xf3c(%rip),%r9
xor    %edi,%edi
mov    $0x2a,%edx
xor    %eax,%eax
call   1030 <chk@plt>
test   %eax,%eax
je     11f2 <test_something_bad+0xd2>
lea    0xe75(%rip),%rsi
lea    0xefa(%rip),%rcx
lea    0xf06(%rip),%r8
lea    0xf3a(%rip),%r9
xor    %edi,%edi
mov    $0x2c,%edx
xor    %eax,%eax
call   1030 <chk@plt>
test   %eax,%eax
je     11f2 <test_something_bad+0xd2>
lea    0xe47(%rip),%rsi
lea    0xecc(%rip),%rcx
lea    0xed8(%rip),%r8
lea    0xf0c(%rip),%r9
mov    $0x1,%edi
mov    $0x2d,%edx
xor    %eax,%eax
call   1030 <chk@plt>
test   %eax,%eax
je     11f2 <test_something_bad+0xd2>
lea    0xea2(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1040 <pass@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/adrianratnapala/elm0/refs/heads/master/0example.c\00"
@__func__.test_something_bad = [19 x i8] c"test_something_bad\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [12 x i8] c"42 == 6 * 7\00"
@.str.3 = [44 x i8] c"strlen(\22wrong answer\22) < strlen(\22question\22)\00"
@.str.4 = [9 x i8] c"5 == ++x\00"
define i32 @test_something_bad() {
%1 = alloca i32
%2 = alloca i32
store i32 3, i32* %2
br label %3
3: ; preds = %0
%4 = call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @chk to i32 (i32, i8*, i32, i8*, i8*, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.test_something_bad, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3
br label %40
7: ; preds = %3
br label %8
8: ; preds = %7
br label %9
9: ; preds = %8
%10 = call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @chk to i32 (i32, i8*, i32, i8*, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.test_something_bad, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %9
br label %40
13: ; preds = %9
br label %14
14: ; preds = %13
br label %15
15: ; preds = %14
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
%18 = icmp eq i32 5, %17
%19 = xor i1 %18, true
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
%22 = call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @chk to i32 (i32, i8*, i32, i8*, i8*, i8*, ...)*)(i32 %21, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 44, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.test_something_bad, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%23 = icmp ne i32 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %15
br label %40
25: ; preds = %15
br label %26
26: ; preds = %25
br label %27
27: ; preds = %26
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
%30 = icmp eq i32 5, %29
%31 = xor i1 %30, true
%32 = xor i1 %31, true
%33 = zext i1 %32 to i32
%34 = call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @chk to i32 (i32, i8*, i32, i8*, i8*, i8*, ...)*)(i32 %33, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.test_something_bad, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %37, label %36
36: ; preds = %27
br label %40
37: ; preds = %27
br label %38
38: ; preds = %37
%39 = call i32 (i8*, ...) bitcast (i32 (...)* @pass to i32 (i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.test_something_bad, i64 0, i64 0))
store i32 %39, i32* %1
br label %41
40: ; preds = %36, %24, %12, %6
store i32 0, i32* %1
br label %41
41: ; preds = %40, %38
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
@.str = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/adrianratnapala/elm0/refs/heads/master/0example.c\00"
@__func__.test_something_bad = [19 x i8] c"test_something_bad\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [12 x i8] c"42 == 6 * 7\00"
@.str.3 = [44 x i8] c"strlen(\22wrong answer\22) < strlen(\22question\22)\00"
@.str.4 = [9 x i8] c"5 == ++x\00"
define i32 @test_something_bad() {
%1 = tail call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @chk to i32 (i32, i8*, i32, i8*, i8*, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.test_something_bad, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %14, label %3
3: ; preds = %0
%4 = tail call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @chk to i32 (i32, i8*, i32, i8*, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.test_something_bad, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3
%7 = tail call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @chk to i32 (i32, i8*, i32, i8*, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 44, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.test_something_bad, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %6
%10 = tail call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @chk to i32 (i32, i8*, i32, i8*, i8*, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.test_something_bad, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = tail call i32 (i8*, ...) bitcast (i32 (...)* @pass to i32 (i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.test_something_bad, i64 0, i64 0))
br label %14
14: ; preds = %0, %3, %6, %9, %12
%15 = phi i32 [ %13, %12 ], [ 0, %9 ], [ 0, %6 ], [ 0, %3 ], [ 0, %0 ]
ret i32 %15
}