#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_FAILURE;
int EXIT_SUCCESS;
scalar_t__ test_comparator_fwrite();
scalar_t__ test_range_fwrite();
scalar_t__ test_version_fwrite();
int main(void) {
  if (test_version_fwrite()) {
    return EXIT_FAILURE;
  }
  if (test_comparator_fwrite()) {
    return EXIT_FAILURE;
  }
  if (test_range_fwrite()) {
    return EXIT_FAILURE;
  }
  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 <test_version_fwrite@plt>
cmp    $0x0,%rax
je     1161 <main+0x31>
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11b1 <main+0x81>
mov    $0x0,%al
call   1040 <test_comparator_fwrite@plt>
cmp    $0x0,%rax
je     1183 <main+0x53>
mov    0x2e67(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11b1 <main+0x81>
mov    $0x0,%al
call   1050 <test_range_fwrite@plt>
cmp    $0x0,%rax
je     11a5 <main+0x75>
mov    0x2e45(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11b1 <main+0x81>
mov    0x2e2c(%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 <test_version_fwrite@plt>
mov    0x2ea1(%rip),%rbx
test   %rax,%rax
jne    116c <main+0x3c>
xor    %eax,%eax
call   1040 <test_comparator_fwrite@plt>
test   %rax,%rax
jne    116c <main+0x3c>
xor    %eax,%eax
call   1050 <test_range_fwrite@plt>
test   %rax,%rax
jne    1165 <main+0x35>
mov    0x2e75(%rip),%rbx
jmp    116c <main+0x3c>
mov    0x2e74(%rip),%rbx
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @test_version_fwrite()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load i32, i32* @EXIT_FAILURE
store i32 %5, i32* %1
br label %18
6: ; preds = %0
%7 = call i64 (...) @test_comparator_fwrite()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = load i32, i32* @EXIT_FAILURE
store i32 %10, i32* %1
br label %18
11: ; preds = %6
%12 = call i64 (...) @test_range_fwrite()
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load i32, i32* @EXIT_FAILURE
store i32 %15, i32* %1
br label %18
16: ; preds = %11
%17 = load i32, i32* @EXIT_SUCCESS
store i32 %17, i32* %1
br label %18
18: ; preds = %16, %14, %9, %4
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @test_version_fwrite()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i64 (...) @test_comparator_fwrite()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 (...) @test_range_fwrite()
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i32* @EXIT_SUCCESS, i32* @EXIT_FAILURE
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32* [ @EXIT_FAILURE, %0 ], [ @EXIT_FAILURE, %3 ], [ %9, %6 ]
%12 = load i32, i32* %11
ret i32 %12
}