#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();
int f1(int);
int f2(int);
int f3(int);
int f4(int);
int main() {
  if (f1(5) != 5 || f1(-5) != 4 || f1(0) != 0)
    abort();
  if (f2(5) != -6 || f2(-5) != -5 || f2(0) != -1)
    abort();
  if (f3(5) != 5 || f3(-5) != 4 || f3(0) != -1)
    abort();
  if (f4(5) != -6 || f4(-5) != -5 || f4(0) != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1060 <f1@plt>
cmp    $0x5,%eax
jne    1195 <main+0x45>
mov    $0xfffffffb,%edi
call   1060 <f1@plt>
cmp    $0x4,%eax
jne    1195 <main+0x45>
xor    %edi,%edi
call   1060 <f1@plt>
cmp    $0x0,%eax
je     119c <main+0x4c>
mov    $0x0,%al
call   1040 <abort@plt>
mov    $0x5,%edi
call   1030 <f2@plt>
cmp    $0xfffffffa,%eax
jne    11d2 <main+0x82>
mov    $0xfffffffb,%edi
call   1030 <f2@plt>
cmp    $0xfffffffb,%eax
jne    11d2 <main+0x82>
xor    %edi,%edi
call   1030 <f2@plt>
cmp    $0xffffffff,%eax
je     11d9 <main+0x89>
mov    $0x0,%al
call   1040 <abort@plt>
mov    $0x5,%edi
call   1050 <f3@plt>
cmp    $0x5,%eax
jne    120f <main+0xbf>
mov    $0xfffffffb,%edi
call   1050 <f3@plt>
cmp    $0x4,%eax
jne    120f <main+0xbf>
xor    %edi,%edi
call   1050 <f3@plt>
cmp    $0xffffffff,%eax
je     1216 <main+0xc6>
mov    $0x0,%al
call   1040 <abort@plt>
mov    $0x5,%edi
call   1070 <f4@plt>
cmp    $0xfffffffa,%eax
jne    124c <main+0xfc>
mov    $0xfffffffb,%edi
call   1070 <f4@plt>
cmp    $0xfffffffb,%eax
jne    124c <main+0xfc>
xor    %edi,%edi
call   1070 <f4@plt>
cmp    $0x0,%eax
je     1253 <main+0x103>
mov    $0x0,%al
call   1040 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1060 <f1@plt>
cmp    $0x5,%eax
jne    1207 <main+0xb7>
mov    $0xfffffffb,%edi
call   1060 <f1@plt>
cmp    $0x4,%eax
jne    1207 <main+0xb7>
xor    %edi,%edi
call   1060 <f1@plt>
test   %eax,%eax
jne    1207 <main+0xb7>
mov    $0x5,%edi
call   1030 <f2@plt>
cmp    $0xfffffffa,%eax
jne    1207 <main+0xb7>
mov    $0xfffffffb,%edi
call   1030 <f2@plt>
cmp    $0xfffffffb,%eax
jne    1207 <main+0xb7>
xor    %edi,%edi
call   1030 <f2@plt>
cmp    $0xffffffff,%eax
jne    1207 <main+0xb7>
mov    $0x5,%edi
call   1050 <f3@plt>
cmp    $0x5,%eax
jne    1207 <main+0xb7>
mov    $0xfffffffb,%edi
call   1050 <f3@plt>
cmp    $0x4,%eax
jne    1207 <main+0xb7>
xor    %edi,%edi
call   1050 <f3@plt>
cmp    $0xffffffff,%eax
jne    1207 <main+0xb7>
mov    $0x5,%edi
call   1070 <f4@plt>
cmp    $0xfffffffa,%eax
jne    1207 <main+0xb7>
mov    $0xfffffffb,%edi
call   1070 <f4@plt>
cmp    $0xfffffffb,%eax
jne    1207 <main+0xb7>
xor    %edi,%edi
call   1070 <f4@plt>
test   %eax,%eax
jne    1207 <main+0xb7>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f1(i32 5)
%3 = icmp ne i32 %2, 5
br i1 %3, label %10, label %4
4: ; preds = %0
%5 = call i32 @f1(i32 -5)
%6 = icmp ne i32 %5, 4
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = call i32 @f1(i32 0)
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7, %4, %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %7
%13 = call i32 @f2(i32 5)
%14 = icmp ne i32 %13, -6
br i1 %14, label %21, label %15
15: ; preds = %12
%16 = call i32 @f2(i32 -5)
%17 = icmp ne i32 %16, -5
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = call i32 @f2(i32 0)
%20 = icmp ne i32 %19, -1
br i1 %20, label %21, label %23
21: ; preds = %18, %15, %12
%22 = call i32 (...) @abort()
unreachable
23: ; preds = %18
%24 = call i32 @f3(i32 5)
%25 = icmp ne i32 %24, 5
br i1 %25, label %32, label %26
26: ; preds = %23
%27 = call i32 @f3(i32 -5)
%28 = icmp ne i32 %27, 4
br i1 %28, label %32, label %29
29: ; preds = %26
%30 = call i32 @f3(i32 0)
%31 = icmp ne i32 %30, -1
br i1 %31, label %32, label %34
32: ; preds = %29, %26, %23
%33 = call i32 (...) @abort()
unreachable
34: ; preds = %29
%35 = call i32 @f4(i32 5)
%36 = icmp ne i32 %35, -6
br i1 %36, label %43, label %37
37: ; preds = %34
%38 = call i32 @f4(i32 -5)
%39 = icmp ne i32 %38, -5
br i1 %39, label %43, label %40
40: ; preds = %37
%41 = call i32 @f4(i32 0)
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %40, %37, %34
%44 = call i32 (...) @abort()
unreachable
45: ; preds = %40
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 5)
%2 = icmp eq i32 %1, 5
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = tail call i32 @f1(i32 -5)
%5 = icmp eq i32 %4, 4
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @f1(i32 0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6, %3, %0
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %6
%12 = tail call i32 @f2(i32 5)
%13 = icmp eq i32 %12, -6
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = tail call i32 @f2(i32 -5)
%16 = icmp eq i32 %15, -5
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = tail call i32 @f2(i32 0)
%19 = icmp eq i32 %18, -1
br i1 %19, label %22, label %20
20: ; preds = %17, %14, %11
%21 = tail call i32 (...) @abort()
unreachable
22: ; preds = %17
%23 = tail call i32 @f3(i32 5)
%24 = icmp eq i32 %23, 5
br i1 %24, label %25, label %31
25: ; preds = %22
%26 = tail call i32 @f3(i32 -5)
%27 = icmp eq i32 %26, 4
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = tail call i32 @f3(i32 0)
%30 = icmp eq i32 %29, -1
br i1 %30, label %33, label %31
31: ; preds = %28, %25, %22
%32 = tail call i32 (...) @abort()
unreachable
33: ; preds = %28
%34 = tail call i32 @f4(i32 5)
%35 = icmp eq i32 %34, -6
br i1 %35, label %36, label %42
36: ; preds = %33
%37 = tail call i32 @f4(i32 -5)
%38 = icmp eq i32 %37, -5
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = tail call i32 @f4(i32 0)
%41 = icmp eq i32 %40, 0
br i1 %41, label %44, label %42
42: ; preds = %39, %36, %33
%43 = tail call i32 (...) @abort()
unreachable
44: ; preds = %39
ret i32 0
}