#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int simple_test();
int /*<<< orphan*/ stderr;
int test2();
int main(void) {
  do {
    int __my_ret__ = simple_test();
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 137, "simple_test()");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = test2();
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 138, "test2()");
      return __my_ret__;
    }
  } while (0);
  ;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <simple_test@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     117f <main+0x4f>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
mov    $0x89,%edx
lea    0xea8(%rip),%rcx
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11da <main+0xaa>
jmp    1184 <main+0x54>
jmp    1189 <main+0x59>
mov    $0x0,%al
call   1050 <test2@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11c9 <main+0x99>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
lea    0xe53(%rip),%rsi
mov    $0x8a,%edx
lea    0xe6c(%rip),%rcx
call   1040 <fprintf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11da <main+0xaa>
jmp    11ce <main+0x9e>
mov    0x2e03(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <simple_test@plt>
test   %eax,%eax
je     1161 <main+0x31>
mov    %eax,%ebx
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
lea    0xec2(%rip),%rcx
mov    $0x89,%edx
call   1040 <fprintf@plt>
jmp    119c <main+0x6c>
xor    %eax,%eax
call   1050 <test2@plt>
mov    %eax,%ebx
test   %eax,%eax
je     118f <main+0x5f>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
lea    0xe82(%rip),%rsi
lea    0xea0(%rip),%rcx
mov    $0x8a,%edx
call   1040 <fprintf@plt>
test   %ebx,%ebx
jne    119c <main+0x6c>
mov    0x2e3e(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"failed on line %d: %s\0A\00"
@.str.1 = [14 x i8] c"simple_test()\00"
@.str.2 = [8 x i8] c"test2()\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %0
%5 = call i32 (...) @simple_test()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 137, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* %2
store i32 %11, i32* %1
br label %25
12: ; preds = %4
br label %13
13: ; preds = %12
br label %14
14: ; preds = %13
%15 = call i32 (...) @test2()
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 138, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%21 = load i32, i32* %3
store i32 %21, i32* %1
br label %25
22: ; preds = %14
br label %23
23: ; preds = %22
%24 = load i32, i32* @EXIT_SUCCESS
store i32 %24, i32* %1
br label %25
25: ; preds = %23, %18, %8
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"failed on line %d: %s\0A\00"
@.str.1 = [14 x i8] c"simple_test()\00"
@.str.2 = [8 x i8] c"test2()\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @simple_test()
%2 = icmp eq i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 137, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %15
6: ; preds = %0
%7 = tail call i32 (...) @test2()
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 138, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %6, %9
%13 = load i32, i32* @EXIT_SUCCESS
%14 = select i1 %8, i32 %13, i32 %7
br label %15
15: ; preds = %3, %12
%16 = phi i32 [ %1, %3 ], [ %14, %12 ]
ret i32 %16
}