#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 */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int close(int);
int /*<<< orphan*/ closefrom(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fail(char *);
int open(char *, char *);
int read(int, char *, int);
int main(void) {
  int i, max, fds[10];
  char buf[512];
  for (i = 0; i < 10; i++)
    if ((fds[i] = open("/dev/null", "r")) == -1)
      exit(0);
  max = i - 1;
  closefrom(fds[max]);
  if (close(fds[max]) != -1)
    fail("failed to close highest fd");
  for (i = 0; i < max; i++)
    if (read(fds[i], buf, sizeof(buf)) == -1)
      fail("closed descriptors it should not have");
  closefrom(fds[0]);
  for (i = 0; i < 10; i++)
    if (close(fds[i]) != -1)
      fail("failed to close from lowest fd");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11c1 <main+0x61>
lea    0xe76(%rip),%rdi
lea    0xe79(%rip),%rsi
call   1070 <open@plt>
movslq -0x8(%rbp),%rcx
mov    %eax,-0x40(%rbp,%rcx,4)
cmp    $0xffffffff,%eax
jne    11ae <main+0x4e>
xor    %edi,%edi
call   1080 <exit@plt>
jmp    11b3 <main+0x53>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1179 <main+0x19>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edi
call   1040 <closefrom@plt>
movslq -0xc(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edi
call   1050 <close@plt>
cmp    $0xffffffff,%eax
je     11f9 <main+0x99>
lea    0xe18(%rip),%rdi
call   1030 <fail@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    124d <main+0xed>
movslq -0x8(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edi
lea    -0x240(%rbp),%rsi
mov    $0x200,%edx
call   1060 <read@plt>
cmp    $0xffffffff,%eax
jne    123a <main+0xda>
lea    0xdf2(%rip),%rdi
call   1030 <fail@plt>
jmp    123f <main+0xdf>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1200 <main+0xa0>
mov    -0x40(%rbp),%edi
call   1040 <closefrom@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    129b <main+0x13b>
movslq -0x8(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edi
call   1050 <close@plt>
cmp    $0xffffffff,%eax
je     1288 <main+0x128>
lea    0xdca(%rip),%rdi
call   1030 <fail@plt>
jmp    128d <main+0x12d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    125c <main+0xfc>
mov    -0x4(%rbp),%eax
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x218,%rsp
lea    0xe88(%rip),%rdi
lea    0xe8b(%rip),%rsi
call   1070 <open@plt>
cmp    $0xffffffff,%eax
je     151b <main+0x3bb>
mov    %eax,%r13d
lea    0xe69(%rip),%rdi
lea    0xe6c(%rip),%rsi
call   1070 <open@plt>
cmp    $0xffffffff,%eax
je     151b <main+0x3bb>
mov    %eax,%r12d
lea    0xe4a(%rip),%rdi
lea    0xe4d(%rip),%rsi
call   1070 <open@plt>
cmp    $0xffffffff,%eax
je     151b <main+0x3bb>
mov    %eax,%r15d
lea    0xe2b(%rip),%rdi
lea    0xe2e(%rip),%rsi
call   1070 <open@plt>
cmp    $0xffffffff,%eax
je     151b <main+0x3bb>
mov    %eax,%r14d
lea    0xe0c(%rip),%rdi
lea    0xe0f(%rip),%rsi
call   1070 <open@plt>
cmp    $0xffffffff,%eax
je     151b <main+0x3bb>
mov    %eax,%ebp
lea    0xdee(%rip),%rdi
lea    0xdf1(%rip),%rsi
call   1070 <open@plt>
mov    %eax,0xc(%rsp)
cmp    $0xffffffff,%eax
je     151b <main+0x3bb>
lea    0xdce(%rip),%rdi
lea    0xdd1(%rip),%rsi
call   1070 <open@plt>
mov    %eax,0x8(%rsp)
cmp    $0xffffffff,%eax
je     151b <main+0x3bb>
lea    0xdae(%rip),%rdi
lea    0xdb1(%rip),%rsi
call   1070 <open@plt>
mov    %eax,(%rsp)
cmp    $0xffffffff,%eax
je     151b <main+0x3bb>
lea    0xd8f(%rip),%rdi
lea    0xd92(%rip),%rsi
call   1070 <open@plt>
mov    %eax,0x4(%rsp)
cmp    $0xffffffff,%eax
je     151b <main+0x3bb>
lea    0xd6f(%rip),%rdi
lea    0xd72(%rip),%rsi
call   1070 <open@plt>
cmp    $0xffffffff,%eax
je     151b <main+0x3bb>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <closefrom@plt>
mov    %ebx,%edi
call   1050 <close@plt>
cmp    $0xffffffff,%eax
je     12c7 <main+0x167>
lea    0xd4a(%rip),%rdi
call   1030 <fail@plt>
lea    0x10(%rsp),%rsi
mov    %r13d,%edi
mov    $0x200,%edx
call   1060 <read@plt>
cmp    $0xffffffff,%eax
jne    12ea <main+0x18a>
lea    0xd42(%rip),%rdi
call   1030 <fail@plt>
lea    0x10(%rsp),%rsi
mov    %r12d,%edi
mov    $0x200,%edx
call   1060 <read@plt>
cmp    $0xffffffff,%eax
jne    130d <main+0x1ad>
lea    0xd1f(%rip),%rdi
call   1030 <fail@plt>
lea    0x10(%rsp),%rsi
mov    %r15d,%edi
mov    $0x200,%edx
call   1060 <read@plt>
cmp    $0xffffffff,%eax
jne    1330 <main+0x1d0>
lea    0xcfc(%rip),%rdi
call   1030 <fail@plt>
lea    0x10(%rsp),%rsi
mov    %r14d,%edi
mov    $0x200,%edx
call   1060 <read@plt>
cmp    $0xffffffff,%eax
jne    1353 <main+0x1f3>
lea    0xcd9(%rip),%rdi
call   1030 <fail@plt>
lea    0x10(%rsp),%rsi
mov    %ebp,%edi
mov    $0x200,%edx
call   1060 <read@plt>
cmp    $0xffffffff,%eax
jne    1375 <main+0x215>
lea    0xcb7(%rip),%rdi
call   1030 <fail@plt>
lea    0x10(%rsp),%rsi
mov    0xc(%rsp),%edi
mov    $0x200,%edx
call   1060 <read@plt>
cmp    $0xffffffff,%eax
jne    1399 <main+0x239>
lea    0xc93(%rip),%rdi
call   1030 <fail@plt>
lea    0x10(%rsp),%rsi
mov    0x8(%rsp),%edi
mov    $0x200,%edx
call   1060 <read@plt>
cmp    $0xffffffff,%eax
jne    13bd <main+0x25d>
lea    0xc6f(%rip),%rdi
call   1030 <fail@plt>
lea    0x10(%rsp),%rsi
mov    (%rsp),%edi
mov    $0x200,%edx
call   1060 <read@plt>
cmp    $0xffffffff,%eax
jne    13e0 <main+0x280>
lea    0xc4c(%rip),%rdi
call   1030 <fail@plt>
lea    0x10(%rsp),%rsi
mov    0x4(%rsp),%edi
mov    $0x200,%edx
call   1060 <read@plt>
cmp    $0xffffffff,%eax
jne    1404 <main+0x2a4>
lea    0xc28(%rip),%rdi
call   1030 <fail@plt>
mov    %r13d,%edi
call   1040 <closefrom@plt>
mov    %r13d,%edi
call   1050 <close@plt>
cmp    $0xffffffff,%eax
je     1425 <main+0x2c5>
lea    0xc2d(%rip),%rdi
call   1030 <fail@plt>
mov    %r12d,%edi
call   1050 <close@plt>
cmp    $0xffffffff,%eax
je     143e <main+0x2de>
lea    0xc14(%rip),%rdi
call   1030 <fail@plt>
mov    %r15d,%edi
call   1050 <close@plt>
cmp    $0xffffffff,%eax
je     1457 <main+0x2f7>
lea    0xbfb(%rip),%rdi
call   1030 <fail@plt>
mov    %r14d,%edi
call   1050 <close@plt>
cmp    $0xffffffff,%eax
je     1470 <main+0x310>
lea    0xbe2(%rip),%rdi
call   1030 <fail@plt>
mov    %ebp,%edi
call   1050 <close@plt>
cmp    $0xffffffff,%eax
je     1488 <main+0x328>
lea    0xbca(%rip),%rdi
call   1030 <fail@plt>
mov    0xc(%rsp),%edi
call   1050 <close@plt>
cmp    $0xffffffff,%eax
je     14a2 <main+0x342>
lea    0xbb0(%rip),%rdi
call   1030 <fail@plt>
mov    0x8(%rsp),%edi
call   1050 <close@plt>
cmp    $0xffffffff,%eax
je     14bc <main+0x35c>
lea    0xb96(%rip),%rdi
call   1030 <fail@plt>
mov    (%rsp),%edi
call   1050 <close@plt>
cmp    $0xffffffff,%eax
je     14d5 <main+0x375>
lea    0xb7d(%rip),%rdi
call   1030 <fail@plt>
mov    0x4(%rsp),%edi
call   1050 <close@plt>
cmp    $0xffffffff,%eax
je     14ef <main+0x38f>
lea    0xb63(%rip),%rdi
call   1030 <fail@plt>
mov    %ebx,%edi
call   1050 <close@plt>
cmp    $0xffffffff,%eax
je     1507 <main+0x3a7>
lea    0xb4b(%rip),%rdi
call   1030 <fail@plt>
xor    %eax,%eax
add    $0x218,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/null\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [27 x i8] c"failed to close highest fd\00"
@.str.3 = [38 x i8] c"closed descriptors it should not have\00"
@.str.4 = [31 x i8] c"failed to close from lowest fd\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x i32]
%5 = alloca [512 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
br label %6
6: ; preds = %18, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %12
store i32 %10, i32* %13
%14 = icmp eq i32 %10, -1
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = call i32 @exit(i32 0)
unreachable
17: ; preds = %9
br label %18
18: ; preds = %17
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %6
21: ; preds = %6
%22 = load i32, i32* %2
%23 = sub nsw i32 %22, 1
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = call i32 @closefrom(i32 %27)
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = call i32 @close(i32 %32)
%34 = icmp ne i32 %33, -1
br i1 %34, label %35, label %37
35: ; preds = %21
%36 = call i32 @fail(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %37
37: ; preds = %35, %21
store i32 0, i32* %2
br label %38
38: ; preds = %53, %37
%39 = load i32, i32* %2
%40 = load i32, i32* %3
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %56
42: ; preds = %38
%43 = load i32, i32* %2
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%48 = call i32 @read(i32 %46, i8* %47, i32 512)
%49 = icmp eq i32 %48, -1
br i1 %49, label %50, label %52
50: ; preds = %42
%51 = call i32 @fail(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %52
52: ; preds = %50, %42
br label %53
53: ; preds = %52
%54 = load i32, i32* %2
%55 = add nsw i32 %54, 1
store i32 %55, i32* %2
br label %38
56: ; preds = %38
%57 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
%58 = load i32, i32* %57
%59 = call i32 @closefrom(i32 %58)
store i32 0, i32* %2
br label %60
60: ; preds = %73, %56
%61 = load i32, i32* %2
%62 = icmp slt i32 %61, 10
br i1 %62, label %63, label %76
63: ; preds = %60
%64 = load i32, i32* %2
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %65
%67 = load i32, i32* %66
%68 = call i32 @close(i32 %67)
%69 = icmp ne i32 %68, -1
br i1 %69, label %70, label %72
70: ; preds = %63
%71 = call i32 @fail(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %72
72: ; preds = %70, %63
br label %73
73: ; preds = %72
%74 = load i32, i32* %2
%75 = add nsw i32 %74, 1
store i32 %75, i32* %2
br label %60
76: ; preds = %60
%77 = load i32, i32* %1
ret i32 %77
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/null\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [27 x i8] c"failed to close highest fd\00"
@.str.3 = [38 x i8] c"closed descriptors it should not have\00"
@.str.4 = [31 x i8] c"failed to close from lowest fd\00"
define i32 @main() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %31, %28, %25, %22, %19, %16, %13, %10, %7, %0
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %0
%8 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32 %8, -1
br i1 %9, label %5, label %10
10: ; preds = %7
%11 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32 %11, -1
br i1 %12, label %5, label %13
13: ; preds = %10
%14 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32 %14, -1
br i1 %15, label %5, label %16
16: ; preds = %13
%17 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i32 %17, -1
br i1 %18, label %5, label %19
19: ; preds = %16
%20 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i32 %20, -1
br i1 %21, label %5, label %22
22: ; preds = %19
%23 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i32 %23, -1
br i1 %24, label %5, label %25
25: ; preds = %22
%26 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i32 %26, -1
br i1 %27, label %5, label %28
28: ; preds = %25
%29 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%30 = icmp eq i32 %29, -1
br i1 %30, label %5, label %31
31: ; preds = %28
%32 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%33 = icmp eq i32 %32, -1
br i1 %33, label %5, label %34
34: ; preds = %31
%35 = tail call i32 @closefrom(i32 %32)
%36 = tail call i32 @close(i32 %32)
%37 = icmp eq i32 %36, -1
br i1 %37, label %40, label %38
38: ; preds = %34
%39 = tail call i32 @fail(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %40
40: ; preds = %34, %38
%41 = call i32 @read(i32 %3, i8* %2, i32 512)
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = tail call i32 @fail(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %45
45: ; preds = %40, %43
%46 = call i32 @read(i32 %8, i8* %2, i32 512)
%47 = icmp eq i32 %46, -1
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = tail call i32 @fail(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %50
50: ; preds = %48, %45
%51 = call i32 @read(i32 %11, i8* %2, i32 512)
%52 = icmp eq i32 %51, -1
br i1 %52, label %53, label %55
53: ; preds = %50
%54 = tail call i32 @fail(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %55
55: ; preds = %53, %50
%56 = call i32 @read(i32 %14, i8* %2, i32 512)
%57 = icmp eq i32 %56, -1
br i1 %57, label %58, label %60
58: ; preds = %55
%59 = tail call i32 @fail(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %60
60: ; preds = %58, %55
%61 = call i32 @read(i32 %17, i8* %2, i32 512)
%62 = icmp eq i32 %61, -1
br i1 %62, label %63, label %65
63: ; preds = %60
%64 = tail call i32 @fail(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %65
65: ; preds = %63, %60
%66 = call i32 @read(i32 %20, i8* %2, i32 512)
%67 = icmp eq i32 %66, -1
br i1 %67, label %68, label %70
68: ; preds = %65
%69 = tail call i32 @fail(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %70
70: ; preds = %68, %65
%71 = call i32 @read(i32 %23, i8* %2, i32 512)
%72 = icmp eq i32 %71, -1
br i1 %72, label %73, label %75
73: ; preds = %70
%74 = tail call i32 @fail(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %75
75: ; preds = %73, %70
%76 = call i32 @read(i32 %26, i8* %2, i32 512)
%77 = icmp eq i32 %76, -1
br i1 %77, label %78, label %80
78: ; preds = %75
%79 = tail call i32 @fail(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %80
80: ; preds = %78, %75
%81 = call i32 @read(i32 %29, i8* %2, i32 512)
%82 = icmp eq i32 %81, -1
br i1 %82, label %83, label %85
83: ; preds = %80
%84 = tail call i32 @fail(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %85
85: ; preds = %80, %83
%86 = tail call i32 @closefrom(i32 %3)
%87 = tail call i32 @close(i32 %3)
%88 = icmp eq i32 %87, -1
br i1 %88, label %91, label %89
89: ; preds = %85
%90 = tail call i32 @fail(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %91
91: ; preds = %85, %89
%92 = tail call i32 @close(i32 %8)
%93 = icmp eq i32 %92, -1
br i1 %93, label %96, label %94
94: ; preds = %91
%95 = tail call i32 @fail(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %96
96: ; preds = %94, %91
%97 = tail call i32 @close(i32 %11)
%98 = icmp eq i32 %97, -1
br i1 %98, label %101, label %99
99: ; preds = %96
%100 = tail call i32 @fail(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %101
101: ; preds = %99, %96
%102 = tail call i32 @close(i32 %14)
%103 = icmp eq i32 %102, -1
br i1 %103, label %106, label %104
104: ; preds = %101
%105 = tail call i32 @fail(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %106
106: ; preds = %104, %101
%107 = tail call i32 @close(i32 %17)
%108 = icmp eq i32 %107, -1
br i1 %108, label %111, label %109
109: ; preds = %106
%110 = tail call i32 @fail(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %111
111: ; preds = %109, %106
%112 = tail call i32 @close(i32 %20)
%113 = icmp eq i32 %112, -1
br i1 %113, label %116, label %114
114: ; preds = %111
%115 = tail call i32 @fail(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %116
116: ; preds = %114, %111
%117 = tail call i32 @close(i32 %23)
%118 = icmp eq i32 %117, -1
br i1 %118, label %121, label %119
119: ; preds = %116
%120 = tail call i32 @fail(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %121
121: ; preds = %119, %116
%122 = tail call i32 @close(i32 %26)
%123 = icmp eq i32 %122, -1
br i1 %123, label %126, label %124
124: ; preds = %121
%125 = tail call i32 @fail(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %126
126: ; preds = %124, %121
%127 = tail call i32 @close(i32 %29)
%128 = icmp eq i32 %127, -1
br i1 %128, label %131, label %129
129: ; preds = %126
%130 = tail call i32 @fail(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %131
131: ; preds = %129, %126
%132 = tail call i32 @close(i32 %32)
%133 = icmp eq i32 %132, -1
br i1 %133, label %136, label %134
134: ; preds = %131
%135 = tail call i32 @fail(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %136
136: ; preds = %134, %131
ret i32 0
}