#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 O_CREAT;
int O_RDONLY;
int O_TRUNC;
int O_WRONLY;
int /*<<< orphan*/ close(int);
int filesize(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ insert_link(unsigned char *, int);
int open(char *, int, ...);
int read(int, unsigned char *, int);
int /*<<< orphan*/ stderr;
int write(int, unsigned char *, int);
int main(int argc, char *argv[]) {
  char *infile;
  char *htmname;
  int fdin, fdout;
  unsigned char buf[4096];
  int len;
  int n;
  int i;
  if (argc != 3) {
    fprintf(stderr, "Usage: bin2note file.bin file.htm\n");
    return 1;
  }
  infile = argv[1];
  htmname = argv[2];
  fdin = open(infile, O_RDONLY | 0);
  if (fdin < 0) {
    fprintf(stderr, "Can not open %s\n", infile);
    return 1;
  }
  len = filesize(fdin);
  if (len > (4096 - 0x260 - 4)) {
    fprintf(stderr, "Payload too big!\n");
    close(fdin);
    return 1;
  }
  insert_link(buf, 0x08640568);
  n = read(fdin, buf + 0x260, len);
  if (n < len) {
    fprintf(stderr, "Short read, aborting\n");
    return 1;
  }
  close(fdin);
  for (i = 0x260 + len; i < 4096 - 4; i += 4) {
    buf[i] = 0x01;
    buf[i + 1] = 0x10;
    buf[i + 2] = 0xa0;
    buf[i + 3] = 0xe1;
  }
  buf[4096 - 4] = 0x97;
  buf[4096 - 3] = 0xfc;
  buf[4096 - 2] = 0xff;
  buf[4096 - 1] = 0xea;
  fdout = open(htmname, O_CREAT | O_TRUNC | 0 | O_WRONLY, 0666);
  if (fdout < 0) {
    fprintf(stderr, "Could not open output file\n");
    return 1;
  }
  if (write(fdout, buf, sizeof(buf)) != sizeof(buf)) {
    fprintf(stderr, "Error writing output file\n");
    close(fdout);
    return 1;
  }
  close(fdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1040,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11b6 <main+0x46>
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
lea    0xe5d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1419 <main+0x2a9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2dff(%rip),%rax
mov    (%rax),%esi
or     $0x0,%esi
mov    $0x0,%al
call   1070 <open@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1219 <main+0xa9>
mov    0x2dcf(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe1d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1419 <main+0x2a9>
mov    -0x24(%rbp),%edi
call   1080 <filesize@plt>
mov    %eax,-0x1034(%rbp)
cmpl   $0xd9c,-0x1034(%rbp)
jle    1262 <main+0xf2>
mov    0x2d8a(%rip),%rax
mov    (%rax),%edi
lea    0xded(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x24(%rbp),%edi
call   1040 <close@plt>
movl   $0x1,-0x4(%rbp)
jmp    1419 <main+0x2a9>
lea    -0x1030(%rbp),%rdi
mov    $0x8640568,%esi
call   1090 <insert_link@plt>
mov    -0x24(%rbp),%edi
lea    -0x1030(%rbp),%rsi
add    $0x260,%rsi
mov    -0x1034(%rbp),%edx
call   1050 <read@plt>
mov    %eax,-0x1038(%rbp)
mov    -0x1038(%rbp),%eax
cmp    -0x1034(%rbp),%eax
jge    12ca <main+0x15a>
mov    0x2d1a(%rip),%rax
mov    (%rax),%edi
lea    0xd8f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1419 <main+0x2a9>
mov    -0x24(%rbp),%edi
call   1040 <close@plt>
mov    -0x1034(%rbp),%eax
add    $0x260,%eax
mov    %eax,-0x103c(%rbp)
cmpl   $0xffc,-0x103c(%rbp)
jge    134f <main+0x1df>
movslq -0x103c(%rbp),%rax
movb   $0x1,-0x1030(%rbp,%rax,1)
01
mov    -0x103c(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x10,-0x1030(%rbp,%rax,1)
10
mov    -0x103c(%rbp),%eax
add    $0x2,%eax
cltq
movb   $0xa0,-0x1030(%rbp,%rax,1)
a0
mov    -0x103c(%rbp),%eax
add    $0x3,%eax
cltq
movb   $0xe1,-0x1030(%rbp,%rax,1)
e1
mov    -0x103c(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x103c(%rbp)
jmp    12e3 <main+0x173>
movb   $0x97,-0x34(%rbp)
movb   $0xfc,-0x33(%rbp)
movb   $0xff,-0x32(%rbp)
movb   $0xea,-0x31(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2c8e(%rip),%rax
mov    (%rax),%esi
mov    0x2c7d(%rip),%rax
or     (%rax),%esi
or     $0x0,%esi
mov    0x2c39(%rip),%rax
or     (%rax),%esi
mov    $0x1b6,%edx
mov    $0x0,%al
call   1070 <open@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jge    13bd <main+0x24d>
mov    0x2c27(%rip),%rax
mov    (%rax),%edi
lea    0xcb2(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1419 <main+0x2a9>
mov    -0x28(%rbp),%edi
lea    -0x1030(%rbp),%rsi
mov    $0x1000,%edx
call   1030 <write@plt>
cltq
cmp    $0x1000,%rax
je     140a <main+0x29a>
mov    0x2be2(%rip),%rax
mov    (%rax),%edi
lea    0xc89(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x28(%rbp),%edi
call   1040 <close@plt>
movl   $0x1,-0x4(%rbp)
jmp    1419 <main+0x2a9>
mov    -0x28(%rbp),%edi
call   1040 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x1000,%rsp
cmp    $0x3,%edi
jne    11cf <main+0x5f>
mov    0x8(%rsi),%rbx
mov    0x10(%rsi),%r14
mov    0x2e49(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <open@plt>
test   %eax,%eax
js     11e8 <main+0x78>
mov    %eax,%ebp
mov    %eax,%edi
call   1080 <filesize@plt>
cmp    $0xd9d,%eax
jl     1213 <main+0xa3>
mov    0x2e12(%rip),%rax
mov    (%rax),%edi
lea    0xe75(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %ebp,%edi
call   1040 <close@plt>
jmp    1202 <main+0x92>
mov    0x2df2(%rip),%rax
mov    (%rax),%edi
lea    0xe21(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    1202 <main+0x92>
mov    0x2dd9(%rip),%rax
mov    (%rax),%edi
lea    0xe2b(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%eax
add    $0x1000,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %eax,%ebx
mov    %rsp,%rdi
mov    $0x8640568,%esi
call   1090 <insert_link@plt>
lea    0x260(%rsp),%rsi
mov    %ebp,%edi
mov    %ebx,%edx
call   1050 <read@plt>
cmp    %ebx,%eax
jge    1249 <main+0xd9>
mov    0x2d8a(%rip),%rax
mov    (%rax),%edi
lea    0xdff(%rip),%rsi
jmp    11df <main+0x6f>
mov    %ebp,%edi
call   1040 <close@plt>
cmp    $0xd9b,%ebx
jg     1284 <main+0x114>
movslq %ebx,%rax
add    $0x25c,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movl   $0xe1a01001,0x4(%rsp,%rax,1)
e1
add    $0x4,%rax
cmp    $0xff8,%rax
jl     1270 <main+0x100>
mov    0x2d6d(%rip),%rax
mov    0x2d5e(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
movl   $0xeafffc97,0xffc(%rsp)
97 fc ff ea
mov    0x2d10(%rip),%rax
or     (%rax),%esi
mov    %r14,%rdi
mov    $0x1b6,%edx
xor    %eax,%eax
call   1070 <open@plt>
test   %eax,%eax
js     12e3 <main+0x173>
mov    %eax,%ebx
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x1000,%edx
call   1030 <write@plt>
cmp    $0x1000,%eax
jne    12f8 <main+0x188>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
jmp    1207 <main+0x97>
mov    0x2cde(%rip),%rax
mov    (%rax),%edi
lea    0xd69(%rip),%rsi
jmp    11df <main+0x6f>
mov    0x2cc9(%rip),%rax
mov    (%rax),%edi
lea    0xd70(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %ebx,%edi
jmp    11c8 <main+0x58>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: bin2note file.bin file.htm\0A\00"
@O_RDONLY = global i32 0
@.str.1 = [17 x i8] c"Can not open %s\0A\00"
@.str.2 = [18 x i8] c"Payload too big!\0A\00"
@.str.3 = [22 x i8] c"Short read, aborting\0A\00"
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@O_WRONLY = global i32 0
@.str.4 = [28 x i8] c"Could not open output file\0A\00"
@.str.5 = [27 x i8] c"Error writing output file\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca [4096 x i8]
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 3
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %119
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
store i8* %22, i8** %6
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
store i8* %25, i8** %7
%26 = load i8*, i8** %6
%27 = load i32, i32* @O_RDONLY
%28 = or i32 %27, 0
%29 = call i32 (i8*, i32, ...) @open(i8* %26, i32 %28)
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = icmp slt i32 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %19
%33 = load i32, i32* @stderr
%34 = load i8*, i8** %6
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %34)
store i32 1, i32* %3
br label %119
36: ; preds = %19
%37 = load i32, i32* %8
%38 = call i32 @filesize(i32 %37)
store i32 %38, i32* %11
%39 = load i32, i32* %11
%40 = icmp sgt i32 %39, 3484
br i1 %40, label %41, label %46
41: ; preds = %36
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%44 = load i32, i32* %8
%45 = call i32 @close(i32 %44)
store i32 1, i32* %3
br label %119
46: ; preds = %36
%47 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%48 = call i32 @insert_link(i8* %47, i32 140772712)
%49 = load i32, i32* %8
%50 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%51 = getelementptr inbounds i8, i8* %50, i64 608
%52 = load i32, i32* %11
%53 = call i32 @read(i32 %49, i8* %51, i32 %52)
store i32 %53, i32* %12
%54 = load i32, i32* %12
%55 = load i32, i32* %11
%56 = icmp slt i32 %54, %55
br i1 %56, label %57, label %60
57: ; preds = %46
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %119
60: ; preds = %46
%61 = load i32, i32* %8
%62 = call i32 @close(i32 %61)
%63 = load i32, i32* %11
%64 = add nsw i32 608, %63
store i32 %64, i32* %13
br label %65
65: ; preds = %84, %60
%66 = load i32, i32* %13
%67 = icmp slt i32 %66, 4092
br i1 %67, label %68, label %87
68: ; preds = %65
%69 = load i32, i32* %13
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 %70
store i8 1, i8* %71
%72 = load i32, i32* %13
%73 = add nsw i32 %72, 1
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 %74
store i8 16, i8* %75
%76 = load i32, i32* %13
%77 = add nsw i32 %76, 2
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 %78
store i8 -96, i8* %79
%80 = load i32, i32* %13
%81 = add nsw i32 %80, 3
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 %82
store i8 -31, i8* %83
br label %84
84: ; preds = %68
%85 = load i32, i32* %13
%86 = add nsw i32 %85, 4
store i32 %86, i32* %13
br label %65
87: ; preds = %65
%88 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 4092
store i8 -105, i8* %88
%89 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 4093
store i8 -4, i8* %89
%90 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 4094
store i8 -1, i8* %90
%91 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 4095
store i8 -22, i8* %91
%92 = load i8*, i8** %7
%93 = load i32, i32* @O_CREAT
%94 = load i32, i32* @O_TRUNC
%95 = or i32 %93, %94
%96 = or i32 %95, 0
%97 = load i32, i32* @O_WRONLY
%98 = or i32 %96, %97
%99 = call i32 (i8*, i32, ...) @open(i8* %92, i32 %98, i32 438)
store i32 %99, i32* %9
%100 = load i32, i32* %9
%101 = icmp slt i32 %100, 0
br i1 %101, label %102, label %105
102: ; preds = %87
%103 = load i32, i32* @stderr
%104 = call i32 (i32, i8*, ...) @fprintf(i32 %103, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %119
105: ; preds = %87
%106 = load i32, i32* %9
%107 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%108 = call i32 @write(i32 %106, i8* %107, i32 4096)
%109 = sext i32 %108 to i64
%110 = icmp ne i64 %109, 4096
br i1 %110, label %111, label %116
111: ; preds = %105
%112 = load i32, i32* @stderr
%113 = call i32 (i32, i8*, ...) @fprintf(i32 %112, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
%114 = load i32, i32* %9
%115 = call i32 @close(i32 %114)
store i32 1, i32* %3
br label %119
116: ; preds = %105
%117 = load i32, i32* %9
%118 = call i32 @close(i32 %117)
store i32 0, i32* %3
br label %119
119: ; preds = %116, %111, %102, %57, %41, %32, %16
%120 = load i32, i32* %3
ret i32 %120
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: bin2note file.bin file.htm\0A\00"
@O_RDONLY = global i32 0
@.str.1 = [17 x i8] c"Can not open %s\0A\00"
@.str.2 = [18 x i8] c"Payload too big!\0A\00"
@.str.3 = [22 x i8] c"Short read, aborting\0A\00"
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@O_WRONLY = global i32 0
@.str.4 = [28 x i8] c"Could not open output file\0A\00"
@.str.5 = [27 x i8] c"Error writing output file\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4096 x i8]
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 3
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %76
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = load i32, i32* @O_RDONLY
%15 = tail call i32 (i8*, i32, ...) @open(i8* %11, i32 %14)
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %9
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %76
20: ; preds = %9
%21 = tail call i32 @filesize(i32 %15)
%22 = icmp sgt i32 %21, 3484
br i1 %22, label %23, label %27
23: ; preds = %20
%24 = load i32, i32* @stderr
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%26 = tail call i32 @close(i32 %15)
br label %76
27: ; preds = %20
%28 = call i32 @insert_link(i8* %4, i32 140772712)
%29 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 608
%30 = call i32 @read(i32 %15, i8* %29, i32 %21)
%31 = icmp slt i32 %30, %21
br i1 %31, label %32, label %35
32: ; preds = %27
%33 = load i32, i32* @stderr
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %76
35: ; preds = %27
%36 = call i32 @close(i32 %15)
%37 = icmp slt i32 %21, 3484
br i1 %37, label %38, label %52
38: ; preds = %35
%39 = add nsw i32 %21, 608
%40 = sext i32 %39 to i64
br label %41
41: ; preds = %38, %41
%42 = phi i64 [ %40, %38 ], [ %50, %41 ]
%43 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %42
store i8 1, i8* %43
%44 = add nsw i64 %42, 1
%45 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %44
store i8 16, i8* %45
%46 = add nsw i64 %42, 2
%47 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %46
store i8 -96, i8* %47
%48 = add nsw i64 %42, 3
%49 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %48
store i8 -31, i8* %49
%50 = add nsw i64 %42, 4
%51 = icmp slt i64 %42, 4088
br i1 %51, label %41, label %52
52: ; preds = %41, %35
%53 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 4092
store i8 -105, i8* %53
%54 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 4093
store i8 -4, i8* %54
%55 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 4094
store i8 -1, i8* %55
%56 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 4095
store i8 -22, i8* %56
%57 = load i32, i32* @O_CREAT
%58 = load i32, i32* @O_TRUNC
%59 = or i32 %58, %57
%60 = load i32, i32* @O_WRONLY
%61 = or i32 %59, %60
%62 = call i32 (i8*, i32, ...) @open(i8* %13, i32 %61, i32 438)
%63 = icmp slt i32 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %52
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
br label %76
67: ; preds = %52
%68 = call i32 @write(i32 %62, i8* %4, i32 4096)
%69 = icmp eq i32 %68, 4096
br i1 %69, label %74, label %70
70: ; preds = %67
%71 = load i32, i32* @stderr
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
%73 = call i32 @close(i32 %62)
br label %76
74: ; preds = %67
%75 = call i32 @close(i32 %62)
br label %76
76: ; preds = %74, %70, %64, %32, %23, %17, %6
%77 = phi i32 [ 1, %6 ], [ 1, %17 ], [ 1, %23 ], [ 1, %32 ], [ 1, %64 ], [ 1, %70 ], [ 0, %74 ]
ret i32 %77
}