#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*/ uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ decode(int /*<<< orphan*/);
int /*<<< orphan*/ encode(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
size_t fread(int /*<<< orphan*/ *, int, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
size_t ftell(int /*<<< orphan*/ *);
size_t fwrite(int /*<<< orphan*/ *, int, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ *malloc(size_t);
int /*<<< orphan*/ perror(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  FILE *ip = NULL, *op = NULL;
  uint8_t *buf;
  size_t i, buf_size;
  int enc = (argc >= 4 && !strcmp(argv[3], "-e"));
  int ret = 0;
  if (argc < 3) {
    printf("Usage: %s <input> <output> [-e] \n", argv[0]);
    ret = -1;
    goto end;
  }
  if (!(ip = fopen(argv[1], "rb"))) {
    printf("Error: Cannot open %s!\n", argv[1]);
    ret = -1;
    goto end;
  }
  fseek(ip, 0, SEEK_END);
  buf_size = ftell(ip);
  if (!(buf = malloc(buf_size))) {
    printf("Error: Cannot allocate input buffer of size %zu!\n", buf_size);
    ret = -1;
    goto end_buf;
  }
  rewind(ip);
  if (fread(buf, sizeof(*buf), buf_size / sizeof(*buf), ip) !=
      buf_size / sizeof(*buf)) {
    perror(NULL);
    printf("Error: Cannot read %zu bytes!\n", buf_size);
    ret = -1;
    goto end_buf;
  }
  for (i = 0; i < buf_size; i++) {
    buf[i] = enc ? encode(buf[i]) : decode(buf[i]);
  }
  if (!(op = fopen(argv[2], "wb"))) {
    printf("Error: Cannot open %s!\n", argv[2]);
    ret = -1;
    goto end_buf;
  }
  if (fwrite(buf, sizeof(*buf), buf_size / sizeof(*buf), op) !=
      buf_size / sizeof(*buf)) {
    printf("Error: Cannot write to output file!\n");
    ret = -1;
  }
  fclose(op);
end_buf:
  free(buf);
  fclose(ip);
end:
  return ret;
}


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,-0x20(%rbp)
xor    %eax,%eax
cmpl   $0x4,-0x8(%rbp)
mov    %al,-0x41(%rbp)
jl     1234 <main+0x54>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xddc(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1271 <main+0x91>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xda5(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xffffffff,-0x40(%rbp)
jmp    146f <main+0x28f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xda5(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    12b5 <main+0xd5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd86(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xffffffff,-0x40(%rbp)
jmp    146f <main+0x28f>
mov    -0x18(%rbp),%rdi
mov    0x2d28(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   10a0 <ftell@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    130b <main+0x12b>
mov    -0x38(%rbp),%rsi
lea    0xd48(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xffffffff,-0x40(%rbp)
jmp    145d <main+0x27d>
mov    -0x18(%rbp),%rdi
call   1080 <rewind@plt>
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%rdx
shr    $0x2,%rdx
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
call   1050 <fread@plt>
mov    -0x38(%rbp),%rcx
shr    $0x2,%rcx
cmp    %rcx,%rax
je     1366 <main+0x186>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <perror@plt>
mov    -0x38(%rbp),%rsi
lea    0xd1f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xffffffff,-0x40(%rbp)
jmp    145d <main+0x27d>
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x38(%rbp),%rax
jae    13d0 <main+0x1f0>
cmpl   $0x0,-0x3c(%rbp)
je     139e <main+0x1be>
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1040 <encode@plt>
mov    %eax,-0x48(%rbp)
jmp    13b1 <main+0x1d1>
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   10d0 <decode@plt>
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%edx
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    136e <main+0x18e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xcb2(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1414 <main+0x234>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xc27(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xffffffff,-0x40(%rbp)
jmp    145d <main+0x27d>
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%rdx
shr    $0x2,%rdx
mov    -0x20(%rbp),%rcx
mov    $0x4,%esi
call   1100 <fwrite@plt>
mov    -0x38(%rbp),%rcx
shr    $0x2,%rcx
cmp    %rcx,%rax
je     1454 <main+0x274>
lea    0xc4e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xffffffff,-0x40(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x40(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
cmp    $0x4,%edi
jl     121b <main+0x2b>
mov    0x18(%r15),%rdi
lea    0xdf2(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
sete   %bpl
jmp    1226 <main+0x36>
cmp    $0x3,%edi
jne    1330 <main+0x140>
xor    %ebp,%ebp
mov    0x8(%r15),%rdi
lea    0xdf4(%rip),%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
je     12d2 <main+0xe2>
mov    %rax,%r14
mov    0x2d9f(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   10d0 <fseek@plt>
mov    %r14,%rdi
call   10b0 <ftell@plt>
mov    %rax,%r12
mov    %rax,%rdi
call   10c0 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1348 <main+0x158>
mov    %r14,%rdi
call   1090 <rewind@plt>
mov    %r12,%r13
shr    $0x2,%r13
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r13,%rdx
mov    %r14,%rcx
call   1060 <fread@plt>
cmp    %r13,%rax
jne    139c <main+0x1ac>
mov    %r14,(%rsp)
test   %r12,%r12
je     12df <main+0xef>
xor    %r14d,%r14d
jmp    12c2 <main+0xd2>
nopl   (%rax)
call   10e0 <decode@plt>
mov    %eax,(%rbx,%r14,4)
add    $0x1,%r14
cmp    %r14,%r12
je     12df <main+0xef>
mov    (%rbx,%r14,4),%edi
test   %bpl,%bpl
je     12b0 <main+0xc0>
call   1040 <encode@plt>
jmp    12b5 <main+0xc5>
mov    0x8(%r15),%rsi
lea    0xd4b(%rip),%rdi
jmp    133a <main+0x14a>
mov    0x10(%r15),%rdi
lea    0xda7(%rip),%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
je     1360 <main+0x170>
mov    %rax,%r12
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r13,%rdx
mov    %rax,%rcx
call   1110 <fwrite@plt>
xor    %ebp,%ebp
cmp    %r13,%rax
mov    (%rsp),%r14
je     1326 <main+0x136>
lea    0xd78(%rip),%rdi
call   1050 <puts@plt>
mov    $0xffffffff,%ebp
mov    %r12,%rdi
call   1070 <fclose@plt>
jmp    137b <main+0x18b>
mov    (%r15),%rsi
lea    0xcc9(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xffffffff,%ebp
jmp    138b <main+0x19b>
lea    0xcf1(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xffffffff,%ebp
jmp    137b <main+0x18b>
mov    0x10(%r15),%rsi
lea    0xcbd(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xffffffff,%ebp
mov    (%rsp),%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1070 <fclose@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edi,%edi
call   1100 <perror@plt>
lea    0xcc8(%rip),%rdi
jmp    134f <main+0x15f>

LLVM IR (-O0):
@.str = [3 x i8] c"-e\00"
@.str.1 = [34 x i8] c"Usage: %s <input> <output> [-e] \0A\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [24 x i8] c"Error: Cannot open %s!\0A\00"
@SEEK_END = global i32 0
@.str.4 = [50 x i8] c"Error: Cannot allocate input buffer of size %zu!\0A\00"
@.str.5 = [31 x i8] c"Error: Cannot read %zu bytes!\0A\00"
@.str.6 = [3 x i8] c"wb\00"
@.str.7 = [37 x i8] c"Error: Cannot write to output file!\0A\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 i32*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i32* null, i32** %7
%13 = load i32, i32* %4
%14 = icmp sge i32 %13, 4
br i1 %14, label %15, label %22
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 3
%18 = load i8*, i8** %17
%19 = call i32 @strcmp(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%20 = icmp ne i32 %19, 0
%21 = xor i1 %20, true
br label %22
22: ; preds = %15, %2
%23 = phi i1 [ false, %2 ], [ %21, %15 ]
%24 = zext i1 %23 to i32
store i32 %24, i32* %11
store i32 0, i32* %12
%25 = load i32, i32* %4
%26 = icmp slt i32 %25, 3
br i1 %26, label %27, label %32
27: ; preds = %22
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 0
%30 = load i8*, i8** %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %30)
store i32 -1, i32* %12
br label %128
32: ; preds = %22
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32* @fopen(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %36, i32** %6
%37 = icmp ne i32* %36, null
br i1 %37, label %43, label %38
38: ; preds = %32
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %41)
store i32 -1, i32* %12
br label %128
43: ; preds = %32
%44 = load i32*, i32** %6
%45 = load i32, i32* @SEEK_END
%46 = call i32 @fseek(i32* %44, i32 0, i32 %45)
%47 = load i32*, i32** %6
%48 = call i64 @ftell(i32* %47)
store i64 %48, i64* %10
%49 = load i64, i64* %10
%50 = call i32* @malloc(i64 %49)
store i32* %50, i32** %8
%51 = icmp ne i32* %50, null
br i1 %51, label %55, label %52
52: ; preds = %43
%53 = load i64, i64* %10
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), i64 %53)
store i32 -1, i32* %12
br label %123
55: ; preds = %43
%56 = load i32*, i32** %6
%57 = call i32 @rewind(i32* %56)
%58 = load i32*, i32** %8
%59 = load i64, i64* %10
%60 = udiv i64 %59, 4
%61 = load i32*, i32** %6
%62 = call i64 @fread(i32* %58, i32 4, i64 %60, i32* %61)
%63 = load i64, i64* %10
%64 = udiv i64 %63, 4
%65 = icmp ne i64 %62, %64
br i1 %65, label %66, label %70
66: ; preds = %55
%67 = call i32 @perror(i32* null)
%68 = load i64, i64* %10
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i64 %68)
store i32 -1, i32* %12
br label %123
70: ; preds = %55
store i64 0, i64* %9
br label %71
71: ; preds = %95, %70
%72 = load i64, i64* %9
%73 = load i64, i64* %10
%74 = icmp ult i64 %72, %73
br i1 %74, label %75, label %98
75: ; preds = %71
%76 = load i32, i32* %11
%77 = icmp ne i32 %76, 0
br i1 %77, label %78, label %84
78: ; preds = %75
%79 = load i32*, i32** %8
%80 = load i64, i64* %9
%81 = getelementptr inbounds i32, i32* %79, i64 %80
%82 = load i32, i32* %81
%83 = call i32 @encode(i32 %82)
br label %90
84: ; preds = %75
%85 = load i32*, i32** %8
%86 = load i64, i64* %9
%87 = getelementptr inbounds i32, i32* %85, i64 %86
%88 = load i32, i32* %87
%89 = call i32 @decode(i32 %88)
br label %90
90: ; preds = %84, %78
%91 = phi i32 [ %83, %78 ], [ %89, %84 ]
%92 = load i32*, i32** %8
%93 = load i64, i64* %9
%94 = getelementptr inbounds i32, i32* %92, i64 %93
store i32 %91, i32* %94
br label %95
95: ; preds = %90
%96 = load i64, i64* %9
%97 = add i64 %96, 1
store i64 %97, i64* %9
br label %71
98: ; preds = %71
%99 = load i8**, i8*** %5
%100 = getelementptr inbounds i8*, i8** %99, i64 2
%101 = load i8*, i8** %100
%102 = call i32* @fopen(i8* %101, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32* %102, i32** %7
%103 = icmp ne i32* %102, null
br i1 %103, label %109, label %104
104: ; preds = %98
%105 = load i8**, i8*** %5
%106 = getelementptr inbounds i8*, i8** %105, i64 2
%107 = load i8*, i8** %106
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %107)
store i32 -1, i32* %12
br label %123
109: ; preds = %98
%110 = load i32*, i32** %8
%111 = load i64, i64* %10
%112 = udiv i64 %111, 4
%113 = load i32*, i32** %7
%114 = call i64 @fwrite(i32* %110, i32 4, i64 %112, i32* %113)
%115 = load i64, i64* %10
%116 = udiv i64 %115, 4
%117 = icmp ne i64 %114, %116
br i1 %117, label %118, label %120
118: ; preds = %109
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0))
store i32 -1, i32* %12
br label %120
120: ; preds = %118, %109
%121 = load i32*, i32** %7
%122 = call i32 @fclose(i32* %121)
br label %123
123: ; preds = %120, %104, %66, %52
%124 = load i32*, i32** %8
%125 = call i32 @free(i32* %124)
%126 = load i32*, i32** %6
%127 = call i32 @fclose(i32* %126)
br label %128
128: ; preds = %123, %38, %27
%129 = load i32, i32* %12
ret i32 %129
}

LLVM IR (-O2):
@.str = [3 x i8] c"-e\00"
@.str.1 = [34 x i8] c"Usage: %s <input> <output> [-e] \0A\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [24 x i8] c"Error: Cannot open %s!\0A\00"
@SEEK_END = global i32 0
@.str.4 = [50 x i8] c"Error: Cannot allocate input buffer of size %zu!\0A\00"
@.str.5 = [31 x i8] c"Error: Cannot read %zu bytes!\0A\00"
@.str.6 = [3 x i8] c"wb\00"
@str = [36 x i8] c"Error: Cannot write to output file!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 3
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 3
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br label %14
9: ; preds = %2
%10 = icmp eq i32 %0, 3
br i1 %10, label %14, label %11
11: ; preds = %9
%12 = load i8*, i8** %1
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %74
14: ; preds = %4, %9
%15 = phi i1 [ %8, %4 ], [ false, %9 ]
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32* @fopen(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %23
20: ; preds = %14
%21 = load i8*, i8** %16
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %21)
br label %74
23: ; preds = %14
%24 = load i32, i32* @SEEK_END
%25 = tail call i32 @fseek(i32* %18, i32 0, i32 %24)
%26 = tail call i64 @ftell(i32* %18)
%27 = tail call i32* @malloc(i64 %26)
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %31
29: ; preds = %23
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), i64 %26)
br label %70
31: ; preds = %23
%32 = tail call i32 @rewind(i32* %18)
%33 = lshr i64 %26, 2
%34 = tail call i64 @fread(i32* %27, i32 4, i64 %33, i32* %18)
%35 = icmp eq i64 %34, %33
br i1 %35, label %36, label %38
36: ; preds = %31
%37 = icmp eq i64 %26, 0
br i1 %37, label %54, label %41
38: ; preds = %31
%39 = tail call i32 @perror(i32* null)
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i64 %26)
br label %70
41: ; preds = %36, %49
%42 = phi i64 [ %52, %49 ], [ 0, %36 ]
%43 = getelementptr inbounds i32, i32* %27, i64 %42
%44 = load i32, i32* %43
br i1 %15, label %45, label %47
45: ; preds = %41
%46 = tail call i32 @encode(i32 %44)
br label %49
47: ; preds = %41
%48 = tail call i32 @decode(i32 %44)
br label %49
49: ; preds = %47, %45
%50 = phi i32 [ %46, %45 ], [ %48, %47 ]
%51 = getelementptr inbounds i32, i32* %27, i64 %42
store i32 %50, i32* %51
%52 = add nuw i64 %42, 1
%53 = icmp eq i64 %52, %26
br i1 %53, label %54, label %41
54: ; preds = %49, %36
%55 = getelementptr inbounds i8*, i8** %1, i64 2
%56 = load i8*, i8** %55
%57 = tail call i32* @fopen(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%58 = icmp eq i32* %57, null
br i1 %58, label %59, label %62
59: ; preds = %54
%60 = load i8*, i8** %55
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %60)
br label %70
62: ; preds = %54
%63 = tail call i64 @fwrite(i32* %27, i32 4, i64 %33, i32* %57)
%64 = icmp eq i64 %63, %33
br i1 %64, label %67, label %65
65: ; preds = %62
%66 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %67
67: ; preds = %65, %62
%68 = phi i32 [ -1, %65 ], [ 0, %62 ]
%69 = tail call i32 @fclose(i32* %57)
br label %70
70: ; preds = %67, %59, %38, %29
%71 = phi i32 [ -1, %38 ], [ %68, %67 ], [ -1, %59 ], [ -1, %29 ]
%72 = tail call i32 @free(i32* %27)
%73 = tail call i32 @fclose(i32* %18)
br label %74
74: ; preds = %70, %20, %11
%75 = phi i32 [ -1, %11 ], [ %71, %70 ], [ -1, %20 ]
ret i32 %75
}