#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 scalar_t__ ssize_t;
typedef int off_t;
typedef int loff_t;

/* Variables and functions */
int EAGAIN;
int EIO;
int ENOMEM;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ close(int);
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(void *);
int lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
void *malloc(int);
int open(char const *, int /*<<< orphan*/);
scalar_t__ read(int, void *, int);
int /*<<< orphan*/ stderr;
char *strerror(int);
int read_file_2(const char *filename, size_t *size, void **outbuf,
                loff_t max_size) {
  off_t fsize;
  ssize_t rsize;
  int ret, fd;
  void *buf;
  *size = 0;
  *outbuf = NULL;
  fd = open(filename, O_RDONLY);
  if (fd < 0) {
    fprintf(stderr, "Cannot open %s: %s\n", filename, strerror(errno));
    return -errno;
  }
  fsize = lseek(fd, 0, SEEK_END);
  if (fsize == -1) {
    fprintf(stderr, "Cannot get size %s: %s\n", filename, strerror(errno));
    ret = -errno;
    goto close;
  }
  if (fsize < max_size)
    max_size = fsize;
  if (lseek(fd, 0, SEEK_SET) == -1) {
    fprintf(stderr, "Cannot seek to start %s: %s\n", filename, strerror(errno));
    ret = -errno;
    goto close;
  }
  buf = malloc(max_size);
  if (!buf) {
    fprintf(stderr, "Cannot allocate memory\n");
    ret = -ENOMEM;
    goto close;
  }
  *outbuf = buf;
  while (*size < max_size) {
    rsize = read(fd, buf, max_size - *size);
    if (rsize == 0) {
      ret = -EIO;
      goto free;
    } else if (rsize < 0) {
      if (errno == EAGAIN)
        continue;
      else {
        ret = -errno;
        goto free;
      }
    }
    buf += rsize;
    *size += rsize;
  }
  ret = 0;
  goto close;
free:
  *outbuf = NULL;
  free(buf);
close:
  close(fd);
  return ret;
}


x86 assembly (clang, -O0):
<read_file_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    0x2e28(%rip),%rax
mov    (%rax),%esi
call   1090 <open@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jge    1219 <read_file_2+0x99>
mov    0x2ded(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    0x2dd1(%rip),%rax
mov    (%rax),%edi
call   10a0 <strerror@plt>
mov    -0x4c(%rbp),%edi
mov    -0x48(%rbp),%rdx
mov    %rax,%rcx
lea    0xe01(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
xor    %eax,%eax
mov    0x2da9(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1429 <read_file_2+0x2a9>
mov    -0x38(%rbp),%edi
mov    0x2dc5(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <lseek@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0xffffffff,-0x28(%rbp)
jne    1286 <read_file_2+0x106>
mov    0x2d80(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    0x2d64(%rip),%rax
mov    (%rax),%edi
call   10a0 <strerror@plt>
mov    -0x5c(%rbp),%edi
mov    -0x58(%rbp),%rdx
mov    %rax,%rcx
lea    0xda8(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
xor    %eax,%eax
mov    0x2d3c(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x34(%rbp)
jmp    141b <read_file_2+0x29b>
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1298 <read_file_2+0x118>
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x38(%rbp),%edi
mov    0x2d0e(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <lseek@plt>
cmp    $0xffffffff,%eax
jne    1301 <read_file_2+0x181>
mov    0x2d05(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    0x2ce9(%rip),%rax
mov    (%rax),%edi
call   10a0 <strerror@plt>
mov    -0x6c(%rbp),%edi
mov    -0x68(%rbp),%rdx
mov    %rax,%rcx
lea    0xd45(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
xor    %eax,%eax
mov    0x2cc1(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x34(%rbp)
jmp    141b <read_file_2+0x29b>
mov    -0x24(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1342 <read_file_2+0x1c2>
mov    0x2ca1(%rip),%rax
mov    (%rax),%edi
lea    0xd21(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
xor    %eax,%eax
mov    0x2c90(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x34(%rbp)
jmp    141b <read_file_2+0x29b>
mov    -0x40(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x24(%rbp),%rcx
cmp    %rcx,%rax
jae    13fb <read_file_2+0x27b>
mov    -0x38(%rbp),%edi
mov    -0x40(%rbp),%rsi
movslq -0x24(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%rax
mov    %eax,%edx
call   1060 <read@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    139c <read_file_2+0x21c>
xor    %eax,%eax
mov    0x2c3e(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x34(%rbp)
jmp    1407 <read_file_2+0x287>
cmpq   $0x0,-0x30(%rbp)
jge    13d7 <read_file_2+0x257>
mov    0x2c0a(%rip),%rax
mov    (%rax),%eax
mov    0x2be9(%rip),%rcx
cmp    (%rcx),%eax
jne    13c4 <read_file_2+0x244>
jmp    134d <read_file_2+0x1cd>
xor    %eax,%eax
mov    0x2beb(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x34(%rbp)
jmp    1407 <read_file_2+0x287>
jmp    13dc <read_file_2+0x25c>
mov    -0x30(%rbp),%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rcx
mov    -0x18(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
jmp    134d <read_file_2+0x1cd>
movl   $0x0,-0x34(%rbp)
jmp    141b <read_file_2+0x29b>
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%edi
call   1050 <close@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_file_2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r13
movq   $0x0,(%rsi)
movq   $0x0,(%rdx)
mov    0x2e35(%rip),%rax
mov    (%rax),%esi
call   1090 <open@plt>
test   %eax,%eax
js     1269 <read_file_2+0xe9>
mov    %eax,%r15d
mov    0x2e24(%rip),%rax
mov    (%rax),%edx
xor    %ebp,%ebp
mov    %r15d,%edi
xor    %esi,%esi
call   1040 <lseek@plt>
cmp    $0xffffffff,%eax
je     12a1 <read_file_2+0x121>
cmp    %ebx,%eax
cmovl  %eax,%ebx
mov    0x2dc9(%rip),%rax
mov    (%rax),%edx
xor    %ebp,%ebp
mov    %r15d,%edi
xor    %esi,%esi
call   1040 <lseek@plt>
cmp    $0xffffffff,%eax
je     12c2 <read_file_2+0x142>
mov    %ebx,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     12f5 <read_file_2+0x175>
mov    %rax,%r13
mov    %r14,(%rsp)
mov    %rax,(%r14)
movslq %ebx,%r14
nopl   0x0(%rax,%rax,1)
mov    (%r12),%rax
cmp    %r14,%rax
jae    1319 <read_file_2+0x199>
mov    %ebx,%edx
sub    %eax,%edx
mov    %r15d,%edi
mov    %r13,%rsi
call   1060 <read@plt>
test   %rax,%rax
je     131d <read_file_2+0x19d>
jns    1260 <read_file_2+0xe0>
mov    0x2d6a(%rip),%rax
mov    (%rax),%ebp
mov    0x2d49(%rip),%rax
cmp    (%rax),%ebp
je     1220 <read_file_2+0xa0>
jmp    1326 <read_file_2+0x1a6>
add    %rax,%r13
add    %rax,(%r12)
jmp    1220 <read_file_2+0xa0>
mov    0x2d50(%rip),%rax
mov    (%rax),%ebx
mov    0x2d3f(%rip),%r14
mov    (%r14),%edi
call   10a0 <strerror@plt>
lea    0xd78(%rip),%rsi
xor    %ebp,%ebp
mov    %ebx,%edi
mov    %r13,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
sub    (%r14),%ebp
jmp    1343 <read_file_2+0x1c3>
mov    0x2d18(%rip),%rax
mov    (%rax),%ebx
mov    0x2d07(%rip),%r14
mov    (%r14),%edi
call   10a0 <strerror@plt>
lea    0xd54(%rip),%rsi
jmp    12e1 <read_file_2+0x161>
mov    0x2cf7(%rip),%rax
mov    (%rax),%ebx
mov    0x2ce6(%rip),%r14
mov    (%r14),%edi
call   10a0 <strerror@plt>
lea    0xd4b(%rip),%rsi
mov    %ebx,%edi
mov    %r13,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
sub    (%r14),%ebp
jmp    133b <read_file_2+0x1bb>
mov    0x2cc4(%rip),%rax
mov    (%rax),%edi
lea    0xd44(%rip),%rsi
xor    %ebp,%ebp
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x2cb3(%rip),%rax
sub    (%rax),%ebp
jmp    133b <read_file_2+0x1bb>
xor    %ebp,%ebp
jmp    133b <read_file_2+0x1bb>
mov    0x2cac(%rip),%rax
mov    (%rax),%ebp
neg    %ebp
mov    (%rsp),%rax
movq   $0x0,(%rax)
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r15d,%edi
call   1050 <close@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@O_RDONLY = global i32 0
@stderr = global i32 0
@.str = [20 x i8] c"Cannot open %s: %s\0A\00"
@errno = global i32 0
@SEEK_END = global i32 0
@.str.1 = [24 x i8] c"Cannot get size %s: %s\0A\00"
@SEEK_SET = global i32 0
@.str.2 = [29 x i8] c"Cannot seek to start %s: %s\0A\00"
@.str.3 = [24 x i8] c"Cannot allocate memory\0A\00"
@ENOMEM = global i32 0
@EIO = global i32 0
@EAGAIN = global i32 0
define i32 @read_file_2(i8* %0, i64* nocapture %1, i8** nocapture writeonly %2, i32 %3) {
store i64 0, i64* %1
store i8* null, i8** %2
%5 = load i32, i32* @O_RDONLY
%6 = tail call i32 @open(i8* %0, i32 %5)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i32, i32* @stderr
%10 = load i32, i32* @errno
%11 = tail call i8* @strerror(i32 %10)
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %11)
%13 = load i32, i32* @errno
%14 = sub nsw i32 0, %13
br label %78
15: ; preds = %4
%16 = load i32, i32* @SEEK_END
%17 = tail call i32 @lseek(i32 %6, i32 0, i32 %16)
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %26
19: ; preds = %15
%20 = load i32, i32* @stderr
%21 = load i32, i32* @errno
%22 = tail call i8* @strerror(i32 %21)
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %22)
%24 = load i32, i32* @errno
%25 = sub nsw i32 0, %24
br label %75
26: ; preds = %15
%27 = icmp slt i32 %17, %3
%28 = select i1 %27, i32 %17, i32 %3
%29 = load i32, i32* @SEEK_SET
%30 = tail call i32 @lseek(i32 %6, i32 0, i32 %29)
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %39
32: ; preds = %26
%33 = load i32, i32* @stderr
%34 = load i32, i32* @errno
%35 = tail call i8* @strerror(i32 %34)
%36 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* %35)
%37 = load i32, i32* @errno
%38 = sub nsw i32 0, %37
br label %75
39: ; preds = %26
%40 = tail call i8* @malloc(i32 %28)
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %47
42: ; preds = %39
%43 = load i32, i32* @stderr
%44 = tail call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%45 = load i32, i32* @ENOMEM
%46 = sub nsw i32 0, %45
br label %75
47: ; preds = %39
store i8* %40, i8** %2
%48 = sext i32 %28 to i64
br label %49
49: ; preds = %67, %47
%50 = phi i8* [ %68, %67 ], [ %40, %47 ]
br label %51
51: ; preds = %49, %63
%52 = load i64, i64* %1
%53 = icmp ult i64 %52, %48
br i1 %53, label %54, label %75
54: ; preds = %51
%55 = trunc i64 %52 to i32
%56 = sub i32 %28, %55
%57 = tail call i64 @read(i32 %6, i8* %50, i32 %56)
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %54
%60 = load i32, i32* @EIO
br label %71
61: ; preds = %54
%62 = icmp slt i64 %57, 0
br i1 %62, label %63, label %67
63: ; preds = %61
%64 = load i32, i32* @errno
%65 = load i32, i32* @EAGAIN
%66 = icmp eq i32 %64, %65
br i1 %66, label %51, label %71
67: ; preds = %61
%68 = getelementptr i8, i8* %50, i64 %57
%69 = load i64, i64* %1
%70 = add i64 %69, %57
store i64 %70, i64* %1
br label %49
71: ; preds = %63, %59
%72 = phi i32 [ %60, %59 ], [ %64, %63 ]
%73 = sub nsw i32 0, %72
store i8* null, i8** %2
%74 = tail call i32 @free(i8* %50)
br label %75
75: ; preds = %51, %71, %42, %32, %19
%76 = phi i32 [ %25, %19 ], [ %38, %32 ], [ %73, %71 ], [ %46, %42 ], [ 0, %51 ]
%77 = tail call i32 @close(i32 %6)
br label %78
78: ; preds = %75, %8
%79 = phi i32 [ %14, %8 ], [ %76, %75 ]
ret i32 %79
}