#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 EINVAL;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int read(int, char *, int);
int /*<<< orphan*/ stderr;
scalar_t__ strerror_r(int, char *, int);
int cat_main(int argc, char *argv[]) {
  int i, fd = -1, ret = -EINVAL;
  char error_str[30 + 1] = {0};
  char buffer[1024 + 1] = {0};
  if (argc < 2) {
    fprintf(stderr, "USAGE : %s file1 [file2 ...]\n", argv[0]);
    return -EINVAL;
  }
  for (i = 1; i < argc; ++i) {
    memset(buffer, 0, 1024 + 1);
    fd = open(argv[i], O_RDONLY);
    if (fd < 0) {
      ret = errno;
      strerror_r(ret, error_str, 30)
          ? fprintf(stderr, "Unable to open file : %s\n", argv[i])
          : fprintf(stderr, "Error - %s - when opening : %s\n", error_str,
                    argv[i]);
    } else {
      while (ret = read(fd, buffer, 1024)) {
        buffer[ret] = 0;
        printf("%s", buffer);
        if (ret < 1024)
          break;
      }
      if (!ret) {
        ret = errno;
        strerror_r(ret, error_str, 30)
            ? fprintf(stderr, "Unable to read file : %s\n", argv[i])
            : fprintf(stderr, "Error - %s - when reading : %s\n", error_str,
                      argv[i]);
      } else
        ret = 0;
      close(fd);
    }
    if (ret)
      return ret;
    else
      ret = 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<cat_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x18(%rbp)
xor    %eax,%eax
mov    0x2e36(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x1f,%edx
call   1040 <memset@plt>
lea    -0x450(%rbp),%rdi
xor    %esi,%esi
mov    $0x401,%edx
call   1040 <memset@plt>
cmpl   $0x2,-0x8(%rbp)
jge    11f5 <cat_main+0x85>
mov    0x2e0d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe25(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
xor    %eax,%eax
mov    0x2ddd(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    13e1 <cat_main+0x271>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13db <cat_main+0x26b>
lea    -0x450(%rbp),%rdi
xor    %esi,%esi
mov    $0x401,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    0x2dba(%rip),%rax
mov    (%rax),%esi
call   1090 <open@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    12bd <cat_main+0x14d>
mov    0x2d87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x1e,%edx
call   1080 <strerror_r@plt>
cmp    $0x0,%rax
je     1291 <cat_main+0x121>
mov    0x2d68(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xd99(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    12b8 <cat_main+0x148>
mov    0x2d40(%rip),%rax
mov    (%rax),%edi
lea    -0x40(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xd87(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    13ac <cat_main+0x23c>
jmp    12c2 <cat_main+0x152>
mov    -0x18(%rbp),%edi
lea    -0x450(%rbp),%rsi
mov    $0x400,%edx
call   1060 <read@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1318 <cat_main+0x1a8>
movslq -0x1c(%rbp),%rax
movb   $0x0,-0x450(%rbp,%rax,1)
lea    -0x450(%rbp),%rsi
lea    0xd5c(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x400,-0x1c(%rbp)
jge    1313 <cat_main+0x1a3>
jmp    1318 <cat_main+0x1a8>
jmp    12c2 <cat_main+0x152>
cmpl   $0x0,-0x1c(%rbp)
jne    139d <cat_main+0x22d>
mov    0x2ca7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x1e,%edx
call   1080 <strerror_r@plt>
cmp    $0x0,%rax
je     1371 <cat_main+0x201>
mov    0x2c88(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xcf6(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1398 <cat_main+0x228>
mov    0x2c60(%rip),%rax
mov    (%rax),%edi
lea    -0x40(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xce4(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    13a4 <cat_main+0x234>
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
call   1050 <close@plt>
cmpl   $0x0,-0x1c(%rbp)
je     13c1 <cat_main+0x251>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    13e1 <cat_main+0x271>
movl   $0x0,-0x1c(%rbp)
jmp    13cd <cat_main+0x25d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11fc <cat_main+0x8c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cat_main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x438,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
xorps  %xmm0,%xmm0
movups %xmm0,0x1f(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0x30(%rsp),%rdi
xor    %r14d,%r14d
mov    $0x401,%edx
xor    %esi,%esi
call   1040 <memset@plt>
cmp    $0x1,%ebx
jg     11d6 <cat_main+0x66>
mov    0x2e25(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%rdx
lea    0xe40(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x2dfa(%rip),%rax
sub    (%rax),%r14d
jmp    1353 <cat_main+0x1e3>
mov    %ebx,%eax
mov    %rax,0x8(%rsp)
mov    $0x1,%r15d
lea    0x30(%rsp),%rbx
lea    0xe69(%rip),%r12
mov    %rbp,(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x401,%edx
call   1040 <memset@plt>
mov    0x0(%rbp,%r15,8),%rdi
mov    0x2dcd(%rip),%rax
mov    (%rax),%esi
call   1090 <open@plt>
mov    %eax,%r13d
test   %eax,%eax
js     1270 <cat_main+0x100>
nopl   0x0(%rax)
mov    %r13d,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1060 <read@plt>
test   %eax,%eax
je     12c0 <cat_main+0x150>
mov    %eax,%ebp
cltq
movb   $0x0,0x30(%rsp,%rax,1)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
cmp    $0x400,%ebp
jge    1230 <cat_main+0xc0>
xor    %r14d,%r14d
jmp    1330 <cat_main+0x1c0>
nopl   0x0(%rax,%rax,1)
mov    0x2d59(%rip),%rax
mov    (%rax),%r14d
mov    %r14d,%edi
lea    0x10(%rsp),%r13
mov    %r13,%rsi
mov    $0x1e,%edx
call   1080 <strerror_r@plt>
mov    0x2d42(%rip),%rcx
mov    (%rcx),%edi
mov    (%rsp),%rbp
mov    0x0(%rbp,%r15,8),%rcx
test   %rax,%rax
je     1308 <cat_main+0x198>
lea    0xd71(%rip),%rsi
mov    %rcx,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    133c <cat_main+0x1cc>
nopl   0x0(%rax)
mov    0x2d09(%rip),%rax
mov    (%rax),%r14d
mov    %r14d,%edi
lea    0x10(%rsp),%rbp
mov    %rbp,%rsi
mov    $0x1e,%edx
call   1080 <strerror_r@plt>
mov    0x2cf2(%rip),%rcx
mov    (%rcx),%edi
mov    (%rsp),%rcx
mov    (%rcx,%r15,8),%rcx
test   %rax,%rax
je     131b <cat_main+0x1ab>
lea    0xd5f(%rip),%rsi
mov    %rcx,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1330 <cat_main+0x1c0>
lea    0xd29(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    133c <cat_main+0x1cc>
lea    0xd53(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
nopl   0x0(%rax)
mov    %r13d,%edi
call   1050 <close@plt>
mov    (%rsp),%rbp
test   %r14d,%r14d
jne    1353 <cat_main+0x1e3>
add    $0x1,%r15
cmp    0x8(%rsp),%r15
jne    1200 <cat_main+0x90>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x438,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@stderr = global i32 0
@.str = [30 x i8] c"USAGE : %s file1 [file2 ...]\0A\00"
@O_RDONLY = global i32 0
@errno = global i32 0
@.str.1 = [26 x i8] c"Unable to open file : %s\0A\00"
@.str.2 = [32 x i8] c"Error - %s - when opening : %s\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [26 x i8] c"Unable to read file : %s\0A\00"
@.str.5 = [32 x i8] c"Error - %s - when reading : %s\0A\00"
define i32 @cat_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [31 x i8]
%10 = alloca [1025 x i8]
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %7
%11 = load i32, i32* @EINVAL
%12 = sub nsw i32 0, %11
store i32 %12, i32* %8
%13 = bitcast [31 x i8]* %9 to i8*
%14 = bitcast [1025 x i8]* %10 to i8*
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 2
br i1 %16, label %17, label %25
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = load i32, i32* @EINVAL
%24 = sub nsw i32 0, %23
store i32 %24, i32* %3
br label %127
25: ; preds = %2
store i32 1, i32* %6
br label %26
26: ; preds = %122, %25
%27 = load i32, i32* %6
%28 = load i32, i32* %4
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %125
30: ; preds = %26
%31 = getelementptr inbounds [1025 x i8], [1025 x i8]* %10, i64 0, i64 0
%32 = call i32 @memset(i8* %31, i32 0, i32 1025)
%33 = load i8**, i8*** %5
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8*, i8** %33, i64 %35
%37 = load i8*, i8** %36
%38 = load i32, i32* @O_RDONLY
%39 = call i32 @open(i8* %37, i32 %38)
store i32 %39, i32* %7
%40 = load i32, i32* %7
%41 = icmp slt i32 %40, 0
br i1 %41, label %42, label %67
42: ; preds = %30
%43 = load i32, i32* @errno
store i32 %43, i32* %8
%44 = load i32, i32* %8
%45 = getelementptr inbounds [31 x i8], [31 x i8]* %9, i64 0, i64 0
%46 = call i64 @strerror_r(i32 %44, i8* %45, i32 30)
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %56
48: ; preds = %42
%49 = load i32, i32* @stderr
%50 = load i8**, i8*** %5
%51 = load i32, i32* %6
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8*, i8** %50, i64 %52
%54 = load i8*, i8** %53
%55 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %54)
br label %65
56: ; preds = %42
%57 = load i32, i32* @stderr
%58 = getelementptr inbounds [31 x i8], [31 x i8]* %9, i64 0, i64 0
%59 = load i8**, i8*** %5
%60 = load i32, i32* %6
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8*, i8** %59, i64 %61
%63 = load i8*, i8** %62
%64 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* %58, i8* %63)
br label %65
65: ; preds = %56, %48
%66 = phi i32 [ %55, %48 ], [ %64, %56 ]
br label %115
67: ; preds = %30
br label %68
68: ; preds = %82, %67
%69 = load i32, i32* %7
%70 = getelementptr inbounds [1025 x i8], [1025 x i8]* %10, i64 0, i64 0
%71 = call i32 @read(i32 %69, i8* %70, i32 1024)
store i32 %71, i32* %8
%72 = icmp ne i32 %71, 0
br i1 %72, label %73, label %83
73: ; preds = %68
%74 = load i32, i32* %8
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [1025 x i8], [1025 x i8]* %10, i64 0, i64 %75
store i8 0, i8* %76
%77 = getelementptr inbounds [1025 x i8], [1025 x i8]* %10, i64 0, i64 0
%78 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %77)
%79 = load i32, i32* %8
%80 = icmp slt i32 %79, 1024
br i1 %80, label %81, label %82
81: ; preds = %73
br label %83
82: ; preds = %73
br label %68
83: ; preds = %81, %68
%84 = load i32, i32* %8
%85 = icmp ne i32 %84, 0
br i1 %85, label %111, label %86
86: ; preds = %83
%87 = load i32, i32* @errno
store i32 %87, i32* %8
%88 = load i32, i32* %8
%89 = getelementptr inbounds [31 x i8], [31 x i8]* %9, i64 0, i64 0
%90 = call i64 @strerror_r(i32 %88, i8* %89, i32 30)
%91 = icmp ne i64 %90, 0
br i1 %91, label %92, label %100
92: ; preds = %86
%93 = load i32, i32* @stderr
%94 = load i8**, i8*** %5
%95 = load i32, i32* %6
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i8*, i8** %94, i64 %96
%98 = load i8*, i8** %97
%99 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %93, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %98)
br label %109
100: ; preds = %86
%101 = load i32, i32* @stderr
%102 = getelementptr inbounds [31 x i8], [31 x i8]* %9, i64 0, i64 0
%103 = load i8**, i8*** %5
%104 = load i32, i32* %6
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8*, i8** %103, i64 %105
%107 = load i8*, i8** %106
%108 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %101, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i8* %102, i8* %107)
br label %109
109: ; preds = %100, %92
%110 = phi i32 [ %99, %92 ], [ %108, %100 ]
br label %112
111: ; preds = %83
store i32 0, i32* %8
br label %112
112: ; preds = %111, %109
%113 = load i32, i32* %7
%114 = call i32 @close(i32 %113)
br label %115
115: ; preds = %112, %65
%116 = load i32, i32* %8
%117 = icmp ne i32 %116, 0
br i1 %117, label %118, label %120
118: ; preds = %115
%119 = load i32, i32* %8
store i32 %119, i32* %3
br label %127
120: ; preds = %115
store i32 0, i32* %8
br label %121
121: ; preds = %120
br label %122
122: ; preds = %121
%123 = load i32, i32* %6
%124 = add nsw i32 %123, 1
store i32 %124, i32* %6
br label %26
125: ; preds = %26
%126 = load i32, i32* %8
store i32 %126, i32* %3
br label %127
127: ; preds = %125, %118, %17
%128 = load i32, i32* %3
ret i32 %128
}

LLVM IR (-O2):
@EINVAL = global i32 0
@stderr = global i32 0
@.str = [30 x i8] c"USAGE : %s file1 [file2 ...]\0A\00"
@O_RDONLY = global i32 0
@errno = global i32 0
@.str.1 = [26 x i8] c"Unable to open file : %s\0A\00"
@.str.2 = [32 x i8] c"Error - %s - when opening : %s\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [26 x i8] c"Unable to read file : %s\0A\00"
@.str.5 = [32 x i8] c"Error - %s - when reading : %s\0A\00"
define i32 @cat_main(i32 %0, i8** nocapture %1) {
%3 = alloca [31 x i8]
%4 = alloca [1025 x i8]
%5 = getelementptr inbounds [31 x i8], [31 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [1025 x i8], [1025 x i8]* %4, i64 0, i64 0
%7 = icmp slt i32 %0, 2
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @EINVAL
%13 = sub nsw i32 0, %12
br label %61
14: ; preds = %2
%15 = zext i32 %0 to i64
br label %18
16: ; preds = %57
%17 = icmp eq i64 %60, %15
br i1 %17, label %61, label %18
18: ; preds = %14, %16
%19 = phi i64 [ 1, %14 ], [ %60, %16 ]
%20 = call i32 @memset(i8* %6, i32 0, i32 1025)
%21 = getelementptr inbounds i8*, i8** %1, i64 %19
%22 = load i8*, i8** %21
%23 = load i32, i32* @O_RDONLY
%24 = call i32 @open(i8* %22, i32 %23)
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %36
26: ; preds = %18
%27 = load i32, i32* @errno
%28 = call i64 @strerror_r(i32 %27, i8* %5, i32 30)
%29 = icmp eq i64 %28, 0
%30 = load i32, i32* @stderr
%31 = load i8*, i8** %21
br i1 %29, label %34, label %32
32: ; preds = %26
%33 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %31)
br label %57
34: ; preds = %26
%35 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* %5, i8* %31)
br label %57
36: ; preds = %18, %39
%37 = call i32 @read(i32 %24, i8* %6, i32 1024)
%38 = icmp eq i32 %37, 0
br i1 %38, label %44, label %39
39: ; preds = %36
%40 = sext i32 %37 to i64
%41 = getelementptr inbounds [1025 x i8], [1025 x i8]* %4, i64 0, i64 %40
store i8 0, i8* %41
%42 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%43 = icmp slt i32 %37, 1024
br i1 %43, label %54, label %36
44: ; preds = %36
%45 = load i32, i32* @errno
%46 = call i64 @strerror_r(i32 %45, i8* %5, i32 30)
%47 = icmp eq i64 %46, 0
%48 = load i32, i32* @stderr
%49 = load i8*, i8** %21
br i1 %47, label %52, label %50
50: ; preds = %44
%51 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %49)
br label %54
52: ; preds = %44
%53 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i8* %5, i8* %49)
br label %54
54: ; preds = %39, %50, %52
%55 = phi i32 [ %45, %50 ], [ %45, %52 ], [ 0, %39 ]
%56 = call i32 @close(i32 %24)
br label %57
57: ; preds = %32, %34, %54
%58 = phi i32 [ %27, %32 ], [ %27, %34 ], [ %55, %54 ]
%59 = icmp eq i32 %58, 0
%60 = add nuw nsw i64 %19, 1
br i1 %59, label %16, label %61
61: ; preds = %57, %16, %8
%62 = phi i32 [ %13, %8 ], [ %58, %57 ], [ 0, %16 ]
ret i32 %62
}