#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 /*<<< orphan*/ abort();
scalar_t__ test1(int, int);
scalar_t__ test2(int, int /*<<< orphan*/);
scalar_t__ test3(int, int);
scalar_t__ test4(int, int);
int main() {
  if (test1(1, 1000) != 0)
    abort();
  if (test2(1, 0) != 0)
    abort();
  if (test3(1, 1) != 0)
    abort();
  if (test4(1, 1000) != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1050 <test1@plt>
cmp    $0x0,%rax
je     117f <main+0x2f>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <test2@plt>
cmp    $0x0,%rax
je     119c <main+0x4c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <test3@plt>
cmp    $0x0,%rax
je     11b9 <main+0x69>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1060 <test4@plt>
cmp    $0x0,%rax
je     11d9 <main+0x89>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1050 <test1@plt>
test   %rax,%rax
jne    11a2 <main+0x52>
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <test2@plt>
test   %rax,%rax
jne    11a2 <main+0x52>
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <test3@plt>
test   %rax,%rax
jne    11a2 <main+0x52>
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1060 <test4@plt>
test   %rax,%rax
jne    11a2 <main+0x52>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @test1(i32 1, i32 1000)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i64 @test2(i32 1, i32 0)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
%12 = call i64 @test3(i32 1, i32 1)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %11
%17 = call i64 @test4(i32 1, i32 1000)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @test1(i32 1, i32 1000)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i64 @test2(i32 1, i32 0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i64 @test3(i32 1, i32 1)
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %10
%16 = tail call i64 @test4(i32 1, i32 1000)
%17 = icmp eq i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = tail call i32 (...) @abort()
unreachable
20: ; preds = %15
ret i32 0
}