#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 */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
size_t fread(unsigned char *, int, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
size_t ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(unsigned char *, int, size_t, int /*<<< orphan*/ *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ printf(char *, size_t, size_t);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  FILE *wfp = 0;
  signed char *tmp;
  unsigned char *buf = 0;
  size_t bufsize;
  if (argc != 3) {
    fprintf(stderr, "Usage: %s [in file] [out file]\n", argv[0]);
    return 1;
  }
  {
    size_t i;
    FILE *rfp = fopen(argv[1], "rb");
    if (rfp) {
      fseek(rfp, 0, SEEK_END);
      bufsize = ftell(rfp);
      fseek(rfp, 0, SEEK_END);
      buf = (unsigned char *)malloc(bufsize);
      fseek(rfp, 0, SEEK_SET);
      {
        size_t rsize = fread(buf, 1, bufsize, rfp);
        if (rsize != bufsize) {
          printf("read error fs:%d rs:%d\n", bufsize, rsize);
        }
      }
      fclose(rfp);
      tmp = buf;
      for (i = 0; i < bufsize; i++) {
        tmp[i] = -1 * tmp[i];
      }
    }
  }
  if (buf == 0) {
    return -1;
  }
  {
    FILE *wfp = fopen(argv[2], "wb");
    if (wfp) {
      fwrite(buf, 1, bufsize, wfp);
      fclose(wfp);
    }
  }
  free(buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11f8 <main+0x58>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe19(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1372 <main+0x1d2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe19(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1309 <main+0x169>
mov    -0x40(%rbp),%rdi
mov    0x2dc2(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    -0x40(%rbp),%rdi
call   1080 <ftell@plt>
mov    %rax,-0x30(%rbp)
mov    -0x40(%rbp),%rdi
mov    0x2da1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    -0x30(%rbp),%rdi
call   1090 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x40(%rbp),%rdi
mov    0x2d68(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cmp    -0x30(%rbp),%rax
je     12ad <main+0x10d>
mov    -0x30(%rbp),%rsi
mov    -0x48(%rbp),%rdx
lea    0xd7b(%rip),%rdi
call   1060 <printf@plt>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x30(%rbp),%rax
jae    1304 <main+0x164>
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
imul   $0xffffffff,%eax,%eax
mov    %al,%dl
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    12c6 <main+0x126>
jmp    1309 <main+0x169>
cmpq   $0x0,-0x28(%rbp)
jne    1320 <main+0x180>
movl   $0xffffffff,-0x4(%rbp)
jmp    1372 <main+0x1d2>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd0c(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     1362 <main+0x1c2>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x50(%rbp),%rcx
mov    $0x1,%esi
call   10c0 <fwrite@plt>
mov    -0x50(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
cmp    $0x3,%edi
jne    1268 <main+0xc8>
mov    0x8(%r14),%rdi
lea    0xe61(%rip),%rsi
call   10b0 <fopen@plt>
mov    $0xffffffff,%r15d
test   %rax,%rax
je     13d8 <main+0x238>
mov    %rax,%rbx
mov    0x2e0b(%rip),%rbp
mov    0x0(%rbp),%edx
mov    %rax,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    %rbx,%rdi
call   1080 <ftell@plt>
mov    %rax,%r12
mov    0x0(%rbp),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    %r12,%rdi
call   1090 <malloc@plt>
mov    %rax,%rbp
mov    0x2dbc(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1040 <fread@plt>
cmp    %r12,%rax
je     124a <main+0xaa>
lea    0xde4(%rip),%rdi
mov    %r12,%rsi
mov    %rax,%rdx
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
test   %r12,%r12
je     1395 <main+0x1f5>
cmp    $0x8,%r12
jae    128b <main+0xeb>
xor    %eax,%eax
jmp    1388 <main+0x1e8>
mov    0x2d69(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xd85(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%r15d
jmp    13d8 <main+0x238>
cmp    $0x20,%r12
jae    1298 <main+0xf8>
xor    %eax,%eax
jmp    1352 <main+0x1b2>
mov    %r12,%rax
and    $0xffffffffffffffe0,%rax
lea    -0x20(%rax),%rcx
mov    %rcx,%rdx
shr    $0x5,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     137f <main+0x1df>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
movdqu 0x0(%rbp,%rcx,1),%xmm0
movdqu 0x10(%rbp,%rcx,1),%xmm1
movdqu 0x20(%rbp,%rcx,1),%xmm2
movdqu 0x30(%rbp,%rcx,1),%xmm3
pxor   %xmm4,%xmm4
psubb  %xmm0,%xmm4
pxor   %xmm0,%xmm0
psubb  %xmm1,%xmm0
movdqu %xmm4,0x0(%rbp,%rcx,1)
movdqu %xmm0,0x10(%rbp,%rcx,1)
pxor   %xmm0,%xmm0
psubb  %xmm2,%xmm0
pxor   %xmm1,%xmm1
psubb  %xmm3,%xmm1
movdqu %xmm0,0x20(%rbp,%rcx,1)
movdqu %xmm1,0x30(%rbp,%rcx,1)
add    $0x40,%rcx
add    $0xfffffffffffffffe,%rsi
jne    12c0 <main+0x120>
test   $0x1,%dl
je     1347 <main+0x1a7>
movdqu 0x0(%rbp,%rcx,1),%xmm0
movdqu 0x10(%rbp,%rcx,1),%xmm1
pxor   %xmm2,%xmm2
pxor   %xmm3,%xmm3
psubb  %xmm0,%xmm3
psubb  %xmm1,%xmm2
movdqu %xmm3,0x0(%rbp,%rcx,1)
movdqu %xmm2,0x10(%rbp,%rcx,1)
cmp    %rax,%r12
je     1395 <main+0x1f5>
test   $0x18,%r12b
je     1388 <main+0x1e8>
mov    %rax,%rcx
mov    %r12,%rax
and    $0xfffffffffffffff8,%rax
nopl   0x0(%rax)
movq   0x0(%rbp,%rcx,1),%xmm0
pxor   %xmm1,%xmm1
psubb  %xmm0,%xmm1
movq   %xmm1,0x0(%rbp,%rcx,1)
add    $0x8,%rcx
cmp    %rcx,%rax
jne    1360 <main+0x1c0>
jmp    1390 <main+0x1f0>
xor    %ecx,%ecx
test   $0x1,%dl
jne    131f <main+0x17f>
jmp    1347 <main+0x1a7>
negb   0x0(%rbp,%rax,1)
add    $0x1,%rax
cmp    %rax,%r12
jne    1388 <main+0x1e8>
test   %rbp,%rbp
je     13d8 <main+0x238>
mov    0x10(%r14),%rdi
lea    0xc96(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     13cd <main+0x22d>
mov    %rax,%rbx
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %r12,%rdx
mov    %rax,%rcx
call   10c0 <fwrite@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
xor    %r15d,%r15d
mov    %r15d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: %s [in file] [out file]\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.2 = [24 x i8] c"read error fs:%d rs:%d\0A\00"
@.str.3 = [3 x i8] c"wb\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32*
%12 = alloca i64
%13 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i8* null, i8** %8
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 3
br i1 %15, label %16, label %22
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %20)
store i32 1, i32* %3
br label %99
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32* @fopen(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %26, i32** %11
%27 = load i32*, i32** %11
%28 = icmp ne i32* %27, null
br i1 %28, label %29, label %78
29: ; preds = %22
%30 = load i32*, i32** %11
%31 = load i32, i32* @SEEK_END
%32 = call i32 @fseek(i32* %30, i32 0, i32 %31)
%33 = load i32*, i32** %11
%34 = call i64 @ftell(i32* %33)
store i64 %34, i64* %9
%35 = load i32*, i32** %11
%36 = load i32, i32* @SEEK_END
%37 = call i32 @fseek(i32* %35, i32 0, i32 %36)
%38 = load i64, i64* %9
%39 = call i64 @malloc(i64 %38)
%40 = inttoptr i64 %39 to i8*
store i8* %40, i8** %8
%41 = load i32*, i32** %11
%42 = load i32, i32* @SEEK_SET
%43 = call i32 @fseek(i32* %41, i32 0, i32 %42)
%44 = load i8*, i8** %8
%45 = load i64, i64* %9
%46 = load i32*, i32** %11
%47 = call i64 @fread(i8* %44, i32 1, i64 %45, i32* %46)
store i64 %47, i64* %12
%48 = load i64, i64* %12
%49 = load i64, i64* %9
%50 = icmp ne i64 %48, %49
br i1 %50, label %51, label %55
51: ; preds = %29
%52 = load i64, i64* %9
%53 = load i64, i64* %12
%54 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i64 %52, i64 %53)
br label %55
55: ; preds = %51, %29
%56 = load i32*, i32** %11
%57 = call i32 @fclose(i32* %56)
%58 = load i8*, i8** %8
store i8* %58, i8** %7
store i64 0, i64* %10
br label %59
59: ; preds = %74, %55
%60 = load i64, i64* %10
%61 = load i64, i64* %9
%62 = icmp ult i64 %60, %61
br i1 %62, label %63, label %77
63: ; preds = %59
%64 = load i8*, i8** %7
%65 = load i64, i64* %10
%66 = getelementptr inbounds i8, i8* %64, i64 %65
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = mul nsw i32 -1, %68
%70 = trunc i32 %69 to i8
%71 = load i8*, i8** %7
%72 = load i64, i64* %10
%73 = getelementptr inbounds i8, i8* %71, i64 %72
store i8 %70, i8* %73
br label %74
74: ; preds = %63
%75 = load i64, i64* %10
%76 = add i64 %75, 1
store i64 %76, i64* %10
br label %59
77: ; preds = %59
br label %78
78: ; preds = %77, %22
%79 = load i8*, i8** %8
%80 = icmp eq i8* %79, null
br i1 %80, label %81, label %82
81: ; preds = %78
store i32 -1, i32* %3
br label %99
82: ; preds = %78
%83 = load i8**, i8*** %5
%84 = getelementptr inbounds i8*, i8** %83, i64 2
%85 = load i8*, i8** %84
%86 = call i32* @fopen(i8* %85, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %86, i32** %13
%87 = load i32*, i32** %13
%88 = icmp ne i32* %87, null
br i1 %88, label %89, label %96
89: ; preds = %82
%90 = load i8*, i8** %8
%91 = load i64, i64* %9
%92 = load i32*, i32** %13
%93 = call i32 @fwrite(i8* %90, i32 1, i64 %91, i32* %92)
%94 = load i32*, i32** %13
%95 = call i32 @fclose(i32* %94)
br label %96
96: ; preds = %89, %82
%97 = load i8*, i8** %8
%98 = call i32 @free(i8* %97)
store i32 0, i32* %3
br label %99
99: ; preds = %96, %81, %16
%100 = load i32, i32* %3
ret i32 %100
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: %s [in file] [out file]\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.2 = [24 x i8] c"read error fs:%d rs:%d\0A\00"
@.str.3 = [3 x i8] c"wb\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %124
8: ; preds = %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.1, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %124, label %13
13: ; preds = %8
%14 = load i32, i32* @SEEK_END
%15 = tail call i32 @fseek(i32* %11, i32 0, i32 %14)
%16 = tail call i64 @ftell(i32* %11)
%17 = load i32, i32* @SEEK_END
%18 = tail call i32 @fseek(i32* %11, i32 0, i32 %17)
%19 = tail call i64 @malloc(i64 %16)
%20 = inttoptr i64 %19 to i8*
%21 = load i32, i32* @SEEK_SET
%22 = tail call i32 @fseek(i32* %11, i32 0, i32 %21)
%23 = tail call i64 @fread(i8* %20, i32 1, i64 %16, i32* %11)
%24 = icmp eq i64 %23, %16
br i1 %24, label %27, label %25
25: ; preds = %13
%26 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i64 %16, i64 %23)
br label %27
27: ; preds = %25, %13
%28 = tail call i32 @fclose(i32* %11)
%29 = icmp eq i64 %16, 0
br i1 %29, label %112, label %30
30: ; preds = %27
%31 = icmp ult i64 %16, 8
br i1 %31, label %103, label %32
32: ; preds = %30
%33 = icmp ult i64 %16, 32
br i1 %33, label %89, label %34
34: ; preds = %32
%35 = and i64 %16, -32
%36 = add i64 %35, -32
%37 = lshr exact i64 %36, 5
%38 = add nuw nsw i64 %37, 1
%39 = and i64 %38, 1
%40 = icmp eq i64 %36, 0
br i1 %40, label %70, label %41
41: ; preds = %34
%42 = and i64 %38, 1152921504606846974
br label %43
43: ; preds = %43, %41
%44 = phi i64 [ 0, %41 ], [ %67, %43 ]
%45 = phi i64 [ 0, %41 ], [ %68, %43 ]
%46 = getelementptr inbounds i8, i8* %20, i64 %44
%47 = bitcast i8* %46 to <16 x i8>*
%48 = load <16 x i8>, <16 x i8>* %47
%49 = getelementptr inbounds i8, i8* %46, i64 16
%50 = bitcast i8* %49 to <16 x i8>*
%51 = load <16 x i8>, <16 x i8>* %50
%52 = sub <16 x i8> zeroinitializer, %48
%53 = sub <16 x i8> zeroinitializer, %51
%54 = bitcast i8* %46 to <16 x i8>*
store <16 x i8> %52, <16 x i8>* %54
%55 = bitcast i8* %49 to <16 x i8>*
store <16 x i8> %53, <16 x i8>* %55
%56 = or i64 %44, 32
%57 = getelementptr inbounds i8, i8* %20, i64 %56
%58 = bitcast i8* %57 to <16 x i8>*
%59 = load <16 x i8>, <16 x i8>* %58
%60 = getelementptr inbounds i8, i8* %57, i64 16
%61 = bitcast i8* %60 to <16 x i8>*
%62 = load <16 x i8>, <16 x i8>* %61
%63 = sub <16 x i8> zeroinitializer, %59
%64 = sub <16 x i8> zeroinitializer, %62
%65 = bitcast i8* %57 to <16 x i8>*
store <16 x i8> %63, <16 x i8>* %65
%66 = bitcast i8* %60 to <16 x i8>*
store <16 x i8> %64, <16 x i8>* %66
%67 = add nuw i64 %44, 64
%68 = add i64 %45, 2
%69 = icmp eq i64 %68, %42
br i1 %69, label %70, label %43
70: ; preds = %43, %34
%71 = phi i64 [ 0, %34 ], [ %67, %43 ]
%72 = icmp eq i64 %39, 0
br i1 %72, label %84, label %73
73: ; preds = %70
%74 = getelementptr inbounds i8, i8* %20, i64 %71
%75 = bitcast i8* %74 to <16 x i8>*
%76 = load <16 x i8>, <16 x i8>* %75
%77 = getelementptr inbounds i8, i8* %74, i64 16
%78 = bitcast i8* %77 to <16 x i8>*
%79 = load <16 x i8>, <16 x i8>* %78
%80 = sub <16 x i8> zeroinitializer, %76
%81 = sub <16 x i8> zeroinitializer, %79
%82 = bitcast i8* %74 to <16 x i8>*
store <16 x i8> %80, <16 x i8>* %82
%83 = bitcast i8* %77 to <16 x i8>*
store <16 x i8> %81, <16 x i8>* %83
br label %84
84: ; preds = %70, %73
%85 = icmp eq i64 %16, %35
br i1 %85, label %112, label %86
86: ; preds = %84
%87 = and i64 %16, 24
%88 = icmp eq i64 %87, 0
br i1 %88, label %103, label %89
89: ; preds = %32, %86
%90 = phi i64 [ %35, %86 ], [ 0, %32 ]
%91 = and i64 %16, -8
br label %92
92: ; preds = %92, %89
%93 = phi i64 [ %90, %89 ], [ %99, %92 ]
%94 = getelementptr inbounds i8, i8* %20, i64 %93
%95 = bitcast i8* %94 to <8 x i8>*
%96 = load <8 x i8>, <8 x i8>* %95
%97 = sub <8 x i8> zeroinitializer, %96
%98 = bitcast i8* %94 to <8 x i8>*
store <8 x i8> %97, <8 x i8>* %98
%99 = add nuw i64 %93, 8
%100 = icmp eq i64 %99, %91
br i1 %100, label %101, label %92
101: ; preds = %92
%102 = icmp eq i64 %16, %91
br i1 %102, label %112, label %103
103: ; preds = %30, %86, %101
%104 = phi i64 [ 0, %30 ], [ %35, %86 ], [ %91, %101 ]
br label %105
105: ; preds = %103, %105
%106 = phi i64 [ %110, %105 ], [ %104, %103 ]
%107 = getelementptr inbounds i8, i8* %20, i64 %106
%108 = load i8, i8* %107
%109 = sub i8 0, %108
store i8 %109, i8* %107
%110 = add nuw i64 %106, 1
%111 = icmp eq i64 %110, %16
br i1 %111, label %112, label %105
112: ; preds = %105, %84, %101, %27
%113 = icmp eq i64 %19, 0
br i1 %113, label %124, label %114
114: ; preds = %112
%115 = getelementptr inbounds i8*, i8** %1, i64 2
%116 = load i8*, i8** %115
%117 = tail call i32* @fopen(i8* %116, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%118 = icmp eq i32* %117, null
br i1 %118, label %122, label %119
119: ; preds = %114
%120 = tail call i32 @fwrite(i8* %20, i32 1, i64 %16, i32* %117)
%121 = tail call i32 @fclose(i32* %117)
br label %122
122: ; preds = %119, %114
%123 = tail call i32 @free(i8* %20)
br label %124
124: ; preds = %8, %112, %122, %4
%125 = phi i32 [ 1, %4 ], [ 0, %122 ], [ -1, %112 ], [ -1, %8 ]
ret i32 %125
}