#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*/ FILE;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ feof(int /*<<< orphan*/ *);
scalar_t__ ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
int ftell(int /*<<< orphan*/ *);
int fwrite(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
char *strerror(scalar_t__);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  FILE *fp_from, *fp_to;
  if (argc != 3)
    usage(argv[0]);
  if ((fp_from = fopen(argv[1], "rt")) == NULL) {
    fprintf(stderr, "fopen %s fail: %s\n", argv[1], strerror(errno));
    exit(-1);
  }
  if ((fp_to = fopen(argv[2], "wb")) == NULL) {
    fprintf(stderr, "fopen %s fail: %s\n", argv[2], strerror(errno));
    exit(-1);
  }
  char buf[32 * 3];
  char *bp;
  int objs_fread, objs_written;
  int cur, end;
  while (1) {
    cur = ftell(fp_from);
    while (((objs_fread = fread(buf, 32, 3, fp_from)) == 0) && (errno == EINTR))
      ;
    if (objs_fread < 3) {
      if (ferror(fp_from))
        perror("fread error");
      else if (feof(fp_from)) {
        end = ftell(fp_from);
        while (((objs_written = fwrite(buf, end - cur, 1, fp_to)) == 0) &&
               (errno == EINTR))
          ;
      }
      break;
    } else {
      bp = buf;
      while (objs_fread > 0) {
        while (((objs_written = fwrite(bp, 32, objs_fread, fp_to)) == 0) &&
               (errno == EINTR))
          ;
        if (objs_written <= 0) {
          perror("fwrite failed");
          break;
        }
        objs_fread -= objs_written;
        bp += objs_written * 32;
      }
    }
  }
  fclose(fp_from);
  fclose(fp_to);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11ef <main+0x2f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe02(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1264 <main+0xa4>
mov    0x2dc8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xa4(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0xa0(%rbp)
mov    0x2da2(%rip),%rax
mov    (%rax),%rdi
call   10e0 <strerror@plt>
mov    -0xa4(%rbp),%edi
mov    -0xa0(%rbp),%rdx
mov    %rax,%rcx
lea    0xdae(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xda3(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    12d9 <main+0x119>
mov    0x2d53(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xb4(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0xb0(%rbp)
mov    0x2d2d(%rip),%rax
mov    (%rax),%rdi
call   10e0 <strerror@plt>
mov    -0xb4(%rbp),%edi
mov    -0xb0(%rbp),%rdx
mov    %rax,%rcx
lea    0xd39(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
jmp    12de <main+0x11e>
mov    -0x18(%rbp),%rdi
call   1070 <ftell@plt>
mov    %eax,-0x94(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x20,%esi
mov    $0x3,%edx
call   1040 <fread@plt>
mov    %eax,%ecx
mov    %ecx,-0x8c(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xb5(%rbp)
jne    133a <main+0x17a>
mov    0x2cb4(%rip),%rax
mov    (%rax),%rax
mov    0x2ca2(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0xb5(%rbp)
mov    -0xb5(%rbp),%al
test   $0x1,%al
jne    134d <main+0x18d>
jmp    1352 <main+0x192>
jmp    12ed <main+0x12d>
cmpl   $0x3,-0x8c(%rbp)
jge    1420 <main+0x260>
mov    -0x18(%rbp),%rdi
call   1030 <ferror@plt>
cmp    $0x0,%rax
je     1383 <main+0x1c3>
lea    0xca0(%rip),%rdi
call   10b0 <perror@plt>
jmp    141b <main+0x25b>
mov    -0x18(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%rax
je     1416 <main+0x256>
mov    -0x18(%rbp),%rdi
call   1070 <ftell@plt>
mov    %eax,-0x98(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x98(%rbp),%esi
sub    -0x94(%rbp),%esi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   10d0 <fwrite@plt>
mov    %eax,%ecx
mov    %ecx,-0x90(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xb6(%rbp)
jne    13f9 <main+0x239>
mov    0x2bf5(%rip),%rax
mov    (%rax),%rax
mov    0x2be3(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0xb6(%rbp)
mov    -0xb6(%rbp),%al
test   $0x1,%al
jne    140c <main+0x24c>
jmp    1411 <main+0x251>
jmp    13a5 <main+0x1e5>
jmp    1416 <main+0x256>
jmp    141b <main+0x25b>
jmp    1504 <main+0x344>
lea    -0x80(%rbp),%rax
mov    %rax,-0x88(%rbp)
cmpl   $0x0,-0x8c(%rbp)
jle    14fa <main+0x33a>
jmp    143d <main+0x27d>
mov    -0x88(%rbp),%rdi
mov    -0x8c(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x20,%esi
call   10d0 <fwrite@plt>
mov    %eax,%ecx
mov    %ecx,-0x90(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xb7(%rbp)
jne    148e <main+0x2ce>
mov    0x2b60(%rip),%rax
mov    (%rax),%rax
mov    0x2b4e(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0xb7(%rbp)
mov    -0xb7(%rbp),%al
test   $0x1,%al
jne    14a1 <main+0x2e1>
jmp    14a6 <main+0x2e6>
jmp    143d <main+0x27d>
cmpl   $0x0,-0x90(%rbp)
jg     14c4 <main+0x304>
lea    0xb6b(%rip),%rdi
call   10b0 <perror@plt>
jmp    14fa <main+0x33a>
mov    -0x90(%rbp),%ecx
mov    -0x8c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8c(%rbp)
mov    -0x90(%rbp),%ecx
shl    $0x5,%ecx
mov    -0x88(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x88(%rbp)
jmp    142b <main+0x26b>
jmp    14ff <main+0x33f>
jmp    12de <main+0x11e>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rsi,%rbp
cmp    $0x3,%edi
je     11df <main+0x1f>
mov    0x0(%rbp),%rdi
call   1090 <usage@plt>
mov    0x8(%rbp),%rdi
lea    0xe16(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     132e <main+0x16e>
mov    %rax,%r14
mov    0x10(%rbp),%rdi
lea    0xe10(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     133d <main+0x17d>
mov    %rax,%r12
mov    0x2dba(%rip),%r13
mov    0x2dab(%rip),%r15
jmp    1240 <main+0x80>
lea    0xdf7(%rip),%rdi
call   10b0 <perror@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1070 <ftell@plt>
mov    %eax,%ebx
nopw   0x0(%rax,%rax,1)
mov    %rsp,%rdi
mov    $0x20,%esi
mov    $0x3,%edx
mov    %r14,%rcx
call   1040 <fread@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1274 <main+0xb4>
mov    (%r15),%rax
cmp    %rax,0x0(%r13)
je     1250 <main+0x90>
cmp    $0x3,%ebp
jl     12b4 <main+0xf4>
mov    %rsp,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %ebp,%edx
mov    %r12,%rcx
call   10d0 <fwrite@plt>
test   %eax,%eax
jne    129f <main+0xdf>
mov    (%r15),%rcx
cmp    %rcx,0x0(%r13)
je     1280 <main+0xc0>
test   %eax,%eax
jle    1227 <main+0x67>
mov    %eax,%ecx
shl    $0x5,%ecx
movslq %ecx,%rcx
add    %rcx,%rbx
sub    %eax,%ebp
jg     1280 <main+0xc0>
jmp    1240 <main+0x80>
mov    %r14,%rdi
call   1030 <ferror@plt>
test   %rax,%rax
jne    1320 <main+0x160>
mov    %r14,%rdi
call   1080 <feof@plt>
test   %rax,%rax
je     12ff <main+0x13f>
mov    %r14,%rdi
call   1070 <ftell@plt>
mov    %eax,%ebp
sub    %ebx,%ebp
mov    %rsp,%rbx
nopl   (%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   10d0 <fwrite@plt>
test   %eax,%eax
jne    12ff <main+0x13f>
mov    (%r15),%rax
cmp    %rax,0x0(%r13)
je     12e0 <main+0x120>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcf2(%rip),%rdi
call   10b0 <perror@plt>
jmp    12ff <main+0x13f>
mov    0x2cab(%rip),%rax
mov    (%rax),%ebx
mov    0x8(%rbp),%rbp
jmp    134a <main+0x18a>
mov    0x2c9c(%rip),%rax
mov    (%rax),%ebx
mov    0x10(%rbp),%rbp
mov    0x2c87(%rip),%rax
mov    (%rax),%rdi
call   10e0 <strerror@plt>
lea    0xca3(%rip),%rsi
mov    %ebx,%edi
mov    %rbp,%rdx
mov    %rax,%rcx
call   1060 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"rt\00"
@stderr = global i32 0
@.str.1 = [19 x i8] c"fopen %s fail: %s\0A\00"
@errno = global i64 0
@.str.2 = [3 x i8] c"wb\00"
@EINTR = global i64 0
@.str.3 = [12 x i8] c"fread error\00"
@.str.4 = [14 x i8] c"fwrite failed\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [96 x i8]
%9 = alloca i8*
%10 = alloca i32
%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 %21
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 @usage(i8* %19)
br label %21
21: ; preds = %16, %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32* @fopen(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %25, i32** %6
%26 = icmp eq i32* %25, null
br i1 %26, label %27, label %36
27: ; preds = %21
%28 = load i32, i32* @stderr
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = load i64, i64* @errno
%33 = call i8* @strerror(i64 %32)
%34 = call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %31, i8* %33)
%35 = call i32 @exit(i32 -1)
unreachable
36: ; preds = %21
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 2
%39 = load i8*, i8** %38
%40 = call i32* @fopen(i8* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %40, i32** %7
%41 = icmp eq i32* %40, null
br i1 %41, label %42, label %51
42: ; preds = %36
%43 = load i32, i32* @stderr
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 2
%46 = load i8*, i8** %45
%47 = load i64, i64* @errno
%48 = call i8* @strerror(i64 %47)
%49 = call i32 @fprintf(i32 %43, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %46, i8* %48)
%50 = call i32 @exit(i32 -1)
unreachable
51: ; preds = %36
br label %52
52: ; preds = %51, %135
%53 = load i32*, i32** %6
%54 = call i32 @ftell(i32* %53)
store i32 %54, i32* %12
br label %55
55: ; preds = %66, %52
%56 = getelementptr inbounds [96 x i8], [96 x i8]* %8, i64 0, i64 0
%57 = load i32*, i32** %6
%58 = call i32 @fread(i8* %56, i32 32, i32 3, i32* %57)
store i32 %58, i32* %10
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %64
60: ; preds = %55
%61 = load i64, i64* @errno
%62 = load i64, i64* @EINTR
%63 = icmp eq i64 %61, %62
br label %64
64: ; preds = %60, %55
%65 = phi i1 [ false, %55 ], [ %63, %60 ]
br i1 %65, label %66, label %67
66: ; preds = %64
br label %55
67: ; preds = %64
%68 = load i32, i32* %10
%69 = icmp slt i32 %68, 3
br i1 %69, label %70, label %101
70: ; preds = %67
%71 = load i32*, i32** %6
%72 = call i64 @ferror(i32* %71)
%73 = icmp ne i64 %72, 0
br i1 %73, label %74, label %76
74: ; preds = %70
%75 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %100
76: ; preds = %70
%77 = load i32*, i32** %6
%78 = call i64 @feof(i32* %77)
%79 = icmp ne i64 %78, 0
br i1 %79, label %80, label %99
80: ; preds = %76
%81 = load i32*, i32** %6
%82 = call i32 @ftell(i32* %81)
store i32 %82, i32* %13
br label %83
83: ; preds = %97, %80
%84 = getelementptr inbounds [96 x i8], [96 x i8]* %8, i64 0, i64 0
%85 = load i32, i32* %13
%86 = load i32, i32* %12
%87 = sub nsw i32 %85, %86
%88 = load i32*, i32** %7
%89 = call i32 @fwrite(i8* %84, i32 %87, i32 1, i32* %88)
store i32 %89, i32* %11
%90 = icmp eq i32 %89, 0
br i1 %90, label %91, label %95
91: ; preds = %83
%92 = load i64, i64* @errno
%93 = load i64, i64* @EINTR
%94 = icmp eq i64 %92, %93
br label %95
95: ; preds = %91, %83
%96 = phi i1 [ false, %83 ], [ %94, %91 ]
br i1 %96, label %97, label %98
97: ; preds = %95
br label %83
98: ; preds = %95
br label %99
99: ; preds = %98, %76
br label %100
100: ; preds = %99, %74
br label %136
101: ; preds = %67
%102 = getelementptr inbounds [96 x i8], [96 x i8]* %8, i64 0, i64 0
store i8* %102, i8** %9
br label %103
103: ; preds = %125, %101
%104 = load i32, i32* %10
%105 = icmp sgt i32 %104, 0
br i1 %105, label %106, label %134
106: ; preds = %103
br label %107
107: ; preds = %119, %106
%108 = load i8*, i8** %9
%109 = load i32, i32* %10
%110 = load i32*, i32** %7
%111 = call i32 @fwrite(i8* %108, i32 32, i32 %109, i32* %110)
store i32 %111, i32* %11
%112 = icmp eq i32 %111, 0
br i1 %112, label %113, label %117
113: ; preds = %107
%114 = load i64, i64* @errno
%115 = load i64, i64* @EINTR
%116 = icmp eq i64 %114, %115
br label %117
117: ; preds = %113, %107
%118 = phi i1 [ false, %107 ], [ %116, %113 ]
br i1 %118, label %119, label %120
119: ; preds = %117
br label %107
120: ; preds = %117
%121 = load i32, i32* %11
%122 = icmp sle i32 %121, 0
br i1 %122, label %123, label %125
123: ; preds = %120
%124 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %134
125: ; preds = %120
%126 = load i32, i32* %11
%127 = load i32, i32* %10
%128 = sub nsw i32 %127, %126
store i32 %128, i32* %10
%129 = load i32, i32* %11
%130 = mul nsw i32 %129, 32
%131 = load i8*, i8** %9
%132 = sext i32 %130 to i64
%133 = getelementptr inbounds i8, i8* %131, i64 %132
store i8* %133, i8** %9
br label %103
134: ; preds = %123, %103
br label %135
135: ; preds = %134
br label %52
136: ; preds = %100
%137 = load i32*, i32** %6
%138 = call i32 @fclose(i32* %137)
%139 = load i32*, i32** %7
%140 = call i32 @fclose(i32* %139)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"rt\00"
@stderr = global i32 0
@.str.1 = [19 x i8] c"fopen %s fail: %s\0A\00"
@errno = global i64 0
@.str.2 = [3 x i8] c"wb\00"
@EINTR = global i64 0
@.str.3 = [12 x i8] c"fread error\00"
@.str.4 = [14 x i8] c"fwrite failed\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [96 x i8]
%4 = icmp eq i32 %0, 3
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = tail call i32 @usage(i8* %6)
br label %8
8: ; preds = %5, %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %20
13: ; preds = %8
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %9
%16 = load i64, i64* @errno
%17 = tail call i8* @strerror(i64 %16)
%18 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %15, i8* %17)
%19 = tail call i32 @exit(i32 -1)
unreachable
20: ; preds = %8
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i32* @fopen(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %32
25: ; preds = %20
%26 = load i32, i32* @stderr
%27 = load i8*, i8** %21
%28 = load i64, i64* @errno
%29 = tail call i8* @strerror(i64 %28)
%30 = tail call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %27, i8* %29)
%31 = tail call i32 @exit(i32 -1)
unreachable
32: ; preds = %20
%33 = getelementptr inbounds [96 x i8], [96 x i8]* %3, i64 0, i64 0
br label %34
34: ; preds = %77, %32
%35 = tail call i32 @ftell(i32* %11)
br label %36
36: ; preds = %36, %34
%37 = call i32 @fread(i8* %33, i32 32, i32 3, i32* %11)
%38 = icmp eq i32 %37, 0
%39 = load i64, i64* @errno
%40 = load i64, i64* @EINTR
%41 = icmp eq i64 %39, %40
%42 = select i1 %38, i1 %41, i1 false
br i1 %42, label %36, label %43
43: ; preds = %36
%44 = icmp slt i32 %37, 3
br i1 %44, label %45, label %63
45: ; preds = %43
%46 = tail call i64 @ferror(i32* %11)
%47 = icmp eq i64 %46, 0
br i1 %47, label %50, label %48
48: ; preds = %45
%49 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %84
50: ; preds = %45
%51 = tail call i64 @feof(i32* %11)
%52 = icmp eq i64 %51, 0
br i1 %52, label %84, label %53
53: ; preds = %50
%54 = tail call i32 @ftell(i32* %11)
%55 = sub nsw i32 %54, %35
br label %56
56: ; preds = %56, %53
%57 = call i32 @fwrite(i8* %33, i32 %55, i32 1, i32* %23)
%58 = icmp eq i32 %57, 0
%59 = load i64, i64* @errno
%60 = load i64, i64* @EINTR
%61 = icmp eq i64 %59, %60
%62 = select i1 %58, i1 %61, i1 false
br i1 %62, label %56, label %84
63: ; preds = %43, %78
%64 = phi i8* [ %82, %78 ], [ %33, %43 ]
%65 = phi i32 [ %79, %78 ], [ %37, %43 ]
br label %66
66: ; preds = %63, %66
%67 = call i32 @fwrite(i8* %64, i32 32, i32 %65, i32* %23)
%68 = icmp eq i32 %67, 0
%69 = load i64, i64* @errno
%70 = load i64, i64* @EINTR
%71 = icmp eq i64 %69, %70
%72 = select i1 %68, i1 %71, i1 false
br i1 %72, label %66, label %73
73: ; preds = %66
%74 = icmp slt i32 %67, 1
br i1 %74, label %75, label %78
75: ; preds = %73
%76 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %77
77: ; preds = %78, %75
br label %34
78: ; preds = %73
%79 = sub nsw i32 %65, %67
%80 = shl nsw i32 %67, 5
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8, i8* %64, i64 %81
%83 = icmp sgt i32 %79, 0
br i1 %83, label %63, label %77
84: ; preds = %56, %48, %50
%85 = tail call i32 @fclose(i32* %11)
%86 = tail call i32 @fclose(i32* %23)
ret i32 0
}