#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 */
scalar_t__ close(int);
int /*<<< orphan*/ e_f(char *, int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void cloexec_test() {
  if (close(3) == 0)
    e_f("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/ayyucedemirbas/Minix-Source-Code/refs/heads/"
        "master/minix-master/minix/tests/test7.c",
        636, (1001));
  if (close(6) != 0)
    e_f("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/ayyucedemirbas/Minix-Source-Code/refs/heads/"
        "master/minix-master/minix/tests/test7.c",
        637, (1002));
  if (close(10) == 0)
    e_f("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/ayyucedemirbas/Minix-Source-Code/refs/heads/"
        "master/minix-master/minix/tests/test7.c",
        638, (1003));
  fflush(stdout);
  exit(0);
}


x86 assembly (clang, -O0):
<cloexec_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jne    116e <cloexec_test+0x2e>
lea    0xea1(%rip),%rdi
mov    $0x27c,%esi
mov    $0x3e9,%edx
call   1050 <e_f@plt>
mov    $0x6,%edi
call   1030 <close@plt>
cmp    $0x0,%rax
je     1198 <cloexec_test+0x58>
lea    0xe77(%rip),%rdi
mov    $0x27d,%esi
mov    $0x3ea,%edx
call   1050 <e_f@plt>
mov    $0xa,%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jne    11c2 <cloexec_test+0x82>
lea    0xe4d(%rip),%rdi
mov    $0x27e,%esi
mov    $0x3eb,%edx
call   1050 <e_f@plt>
mov    0x2e17(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<cloexec_test>:
push   %rax
mov    $0x3,%edi
call   1030 <close@plt>
test   %rax,%rax
jne    1166 <cloexec_test+0x26>
lea    0xea9(%rip),%rdi
mov    $0x27c,%esi
mov    $0x3e9,%edx
call   1050 <e_f@plt>
mov    $0x6,%edi
call   1030 <close@plt>
test   %rax,%rax
je     118b <cloexec_test+0x4b>
lea    0xe84(%rip),%rdi
mov    $0x27d,%esi
mov    $0x3ea,%edx
call   1050 <e_f@plt>
mov    $0xa,%edi
call   1030 <close@plt>
test   %rax,%rax
jne    11b0 <cloexec_test+0x70>
lea    0xe5f(%rip),%rdi
mov    $0x27e,%esi
mov    $0x3eb,%edx
call   1050 <e_f@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [174 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ayyucedemirbas/Minix-Source-Code/refs/heads/master/minix-master/minix/tests/test7.c\00"
@stdout = global i32 0
define void @cloexec_test() {
%1 = call i64 @close(i32 3)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @e_f(i8* getelementptr inbounds ([174 x i8], [174 x i8]* @.str, i64 0, i64 0), i32 636, i32 1001)
br label %5
5: ; preds = %3, %0
%6 = call i64 @close(i32 6)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @e_f(i8* getelementptr inbounds ([174 x i8], [174 x i8]* @.str, i64 0, i64 0), i32 637, i32 1002)
br label %10
10: ; preds = %8, %5
%11 = call i64 @close(i32 10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @e_f(i8* getelementptr inbounds ([174 x i8], [174 x i8]* @.str, i64 0, i64 0), i32 638, i32 1003)
br label %15
15: ; preds = %13, %10
%16 = load i32, i32* @stdout
%17 = call i32 @fflush(i32 %16)
%18 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [174 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ayyucedemirbas/Minix-Source-Code/refs/heads/master/minix-master/minix/tests/test7.c\00"
@stdout = global i32 0
define void @cloexec_test() {
%1 = tail call i64 @close(i32 3)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @e_f(i8* getelementptr inbounds ([174 x i8], [174 x i8]* @.str, i64 0, i64 0), i32 636, i32 1001)
br label %5
5: ; preds = %3, %0
%6 = tail call i64 @close(i32 6)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @e_f(i8* getelementptr inbounds ([174 x i8], [174 x i8]* @.str, i64 0, i64 0), i32 637, i32 1002)
br label %10
10: ; preds = %8, %5
%11 = tail call i64 @close(i32 10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @e_f(i8* getelementptr inbounds ([174 x i8], [174 x i8]* @.str, i64 0, i64 0), i32 638, i32 1003)
br label %15
15: ; preds = %13, %10
%16 = load i32, i32* @stdout
%17 = tail call i32 @fflush(i32 %16)
%18 = tail call i32 @exit(i32 0)
unreachable
}