#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*/ close(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int fwrite(char *, int, int, int /*<<< orphan*/ *);
char *malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  FILE *fp;
  char *buffer;
  int buflen = 64 * 1024 * 1024;
  int len, n;
  if (argc != 4) {
    printf("Usage: pak3399 <output file> <input file> <template file>\n");
    return -1;
  }
  buffer = malloc(buflen);
  memset(buffer, 0, buflen);
  fp = fopen(argv[3], "r+b");
  if (!fp) {
    printf("Open file '%s' error\n", argv[3]);
    free(buffer);
    return -1;
  }
  fseek(fp, 0L, SEEK_END);
  len = ftell(fp);
  fseek(fp, 0L, SEEK_SET);
  n = fread(&buffer[0], 1, len, fp);
  if (n != len) {
    printf("Read template file error\n");
    free(buffer);
    fclose(fp);
    return -1;
  }
  fclose(fp);
  fp = fopen(argv[2], "r+b");
  if (!fp) {
    printf("Open file '%s' error\n", argv[2]);
    free(buffer);
    return -1;
  }
  fseek(fp, 0L, SEEK_END);
  len = ftell(fp);
  fseek(fp, 0L, SEEK_SET);
  n = fread(&buffer[8 * 1024 * 1024], 1, len, fp);
  if (n != len) {
    printf("Read input file error\n");
    free(buffer);
    fclose(fp);
    return -1;
  }
  fclose(fp);
  fp = fopen(argv[1], "w+b");
  if (!fp) {
    printf("Open file '%s' error\n", argv[1]);
    free(buffer);
    return -1;
  }
  if (fwrite(&buffer[512], 16 * 1024 * 1024 - 512, 1, fp) != 1) {
    printf("Write output file error\n");
    free(buffer);
    close(fp);
    return -1;
  }
  free(buffer);
  close(fp);
  printf("Generate pakfile '%s' successed\n", argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4000000,-0x24(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     11f1 <main+0x41>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14a0 <main+0x2f0>
mov    -0x24(%rbp),%edi
call   10a0 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe21(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1259 <main+0xa9>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14a0 <main+0x2f0>
mov    -0x18(%rbp),%rdi
mov    0x2d84(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   10b0 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   1090 <ftell@plt>
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d52(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   10b0 <fseek@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
je     12e1 <main+0x131>
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14a0 <main+0x2f0>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd42(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1338 <main+0x188>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xd23(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14a0 <main+0x2f0>
mov    -0x18(%rbp),%rdi
mov    0x2ca5(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   10b0 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   1090 <ftell@plt>
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2c73(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   10b0 <fseek@plt>
mov    -0x20(%rbp),%rdi
add    $0x800000,%rdi
mov    -0x28(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
je     13c7 <main+0x217>
lea    0xccd(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14a0 <main+0x2f0>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xca7(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    141e <main+0x26e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xc3d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14a0 <main+0x2f0>
mov    -0x20(%rbp),%rdi
add    $0x200,%rdi
mov    -0x18(%rbp),%rcx
mov    $0xfffe00,%esi
mov    $0x1,%edx
call   10d0 <fwrite@plt>
cmp    $0x1,%eax
je     1471 <main+0x2c1>
lea    0xc3e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1080 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14a0 <main+0x2f0>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1080 <close@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xc11(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x4,%edi
jne    1334 <main+0x174>
mov    %rsi,%r15
mov    $0x4000000,%edi
call   10b0 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x4000000,%edx
call   1080 <memset@plt>
mov    0x18(%r15),%rdi
lea    0xe02(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     1342 <main+0x182>
mov    %rax,%rbx
mov    0x2dd2(%rip),%r12
mov    (%r12),%edx
mov    %rax,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    %rbx,%rdi
call   10a0 <ftell@plt>
mov    %eax,%ebp
mov    0x2da3(%rip),%r13
mov    0x0(%r13),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
cmp    %ebp,%eax
jne    1348 <main+0x188>
mov    %rbx,%rdi
call   1060 <fclose@plt>
mov    0x10(%r15),%rdi
lea    0xd90(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     1351 <main+0x191>
mov    %rax,%rbx
mov    (%r12),%edx
mov    %rax,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    %rbx,%rdi
call   10a0 <ftell@plt>
mov    %eax,%ebp
mov    0x0(%r13),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
lea    0x800000(%r14),%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
cmp    %ebp,%eax
jne    1357 <main+0x197>
mov    %rbx,%rdi
call   1060 <fclose@plt>
mov    0x8(%r15),%rdi
lea    0xd42(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     1375 <main+0x1b5>
mov    %rax,%rbx
mov    %r14,%rdi
add    $0x200,%rdi
mov    $0xfffe00,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10e0 <fwrite@plt>
cmp    $0x1,%eax
jne    13a5 <main+0x1e5>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1090 <close@plt>
mov    0x8(%r15),%rsi
lea    0xcf5(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1394 <main+0x1d4>
lea    0xd4b(%rip),%rdi
call   1040 <puts@plt>
jmp    138f <main+0x1cf>
mov    0x18(%r15),%rsi
jmp    1379 <main+0x1b9>
lea    0xd1e(%rip),%rdi
jmp    135e <main+0x19e>
mov    0x10(%r15),%rsi
jmp    1379 <main+0x1b9>
lea    0xcf9(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
jmp    138f <main+0x1cf>
mov    0x8(%r15),%rsi
lea    0xc84(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc93(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1090 <close@plt>
jmp    138f <main+0x1cf>

LLVM IR (-O0):
@.str = [59 x i8] c"Usage: pak3399 <output file> <input file> <template file>\0A\00"
@.str.1 = [4 x i8] c"r+b\00"
@.str.2 = [22 x i8] c"Open file '%s' error\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.3 = [26 x i8] c"Read template file error\0A\00"
@.str.4 = [23 x i8] c"Read input file error\0A\00"
@.str.5 = [4 x i8] c"w+b\00"
@.str.6 = [25 x i8] c"Write output file error\0A\00"
@.str.7 = [33 x i8] c"Generate pakfile '%s' successed\0A\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 i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 67108864, i32* %8
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 4
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %133
15: ; preds = %2
%16 = load i32, i32* %8
%17 = call i8* @malloc(i32 %16)
store i8* %17, i8** %7
%18 = load i8*, i8** %7
%19 = load i32, i32* %8
%20 = call i32 @memset(i8* %18, i32 0, i32 %19)
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 3
%23 = load i8*, i8** %22
%24 = call i32* @fopen(i8* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32* %24, i32** %6
%25 = load i32*, i32** %6
%26 = icmp ne i32* %25, null
br i1 %26, label %34, label %27
27: ; preds = %15
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 3
%30 = load i8*, i8** %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %30)
%32 = load i8*, i8** %7
%33 = call i32 @free(i8* %32)
store i32 -1, i32* %3
br label %133
34: ; preds = %15
%35 = load i32*, i32** %6
%36 = load i32, i32* @SEEK_END
%37 = call i32 @fseek(i32* %35, i64 0, i32 %36)
%38 = load i32*, i32** %6
%39 = call i32 @ftell(i32* %38)
store i32 %39, i32* %9
%40 = load i32*, i32** %6
%41 = load i32, i32* @SEEK_SET
%42 = call i32 @fseek(i32* %40, i64 0, i32 %41)
%43 = load i8*, i8** %7
%44 = getelementptr inbounds i8, i8* %43, i64 0
%45 = load i32, i32* %9
%46 = load i32*, i32** %6
%47 = call i32 @fread(i8* %44, i32 1, i32 %45, i32* %46)
store i32 %47, i32* %10
%48 = load i32, i32* %10
%49 = load i32, i32* %9
%50 = icmp ne i32 %48, %49
br i1 %50, label %51, label %57
51: ; preds = %34
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%53 = load i8*, i8** %7
%54 = call i32 @free(i8* %53)
%55 = load i32*, i32** %6
%56 = call i32 @fclose(i32* %55)
store i32 -1, i32* %3
br label %133
57: ; preds = %34
%58 = load i32*, i32** %6
%59 = call i32 @fclose(i32* %58)
%60 = load i8**, i8*** %5
%61 = getelementptr inbounds i8*, i8** %60, i64 2
%62 = load i8*, i8** %61
%63 = call i32* @fopen(i8* %62, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32* %63, i32** %6
%64 = load i32*, i32** %6
%65 = icmp ne i32* %64, null
br i1 %65, label %73, label %66
66: ; preds = %57
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 2
%69 = load i8*, i8** %68
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %69)
%71 = load i8*, i8** %7
%72 = call i32 @free(i8* %71)
store i32 -1, i32* %3
br label %133
73: ; preds = %57
%74 = load i32*, i32** %6
%75 = load i32, i32* @SEEK_END
%76 = call i32 @fseek(i32* %74, i64 0, i32 %75)
%77 = load i32*, i32** %6
%78 = call i32 @ftell(i32* %77)
store i32 %78, i32* %9
%79 = load i32*, i32** %6
%80 = load i32, i32* @SEEK_SET
%81 = call i32 @fseek(i32* %79, i64 0, i32 %80)
%82 = load i8*, i8** %7
%83 = getelementptr inbounds i8, i8* %82, i64 8388608
%84 = load i32, i32* %9
%85 = load i32*, i32** %6
%86 = call i32 @fread(i8* %83, i32 1, i32 %84, i32* %85)
store i32 %86, i32* %10
%87 = load i32, i32* %10
%88 = load i32, i32* %9
%89 = icmp ne i32 %87, %88
br i1 %89, label %90, label %96
90: ; preds = %73
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%92 = load i8*, i8** %7
%93 = call i32 @free(i8* %92)
%94 = load i32*, i32** %6
%95 = call i32 @fclose(i32* %94)
store i32 -1, i32* %3
br label %133
96: ; preds = %73
%97 = load i32*, i32** %6
%98 = call i32 @fclose(i32* %97)
%99 = load i8**, i8*** %5
%100 = getelementptr inbounds i8*, i8** %99, i64 1
%101 = load i8*, i8** %100
%102 = call i32* @fopen(i8* %101, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
store i32* %102, i32** %6
%103 = load i32*, i32** %6
%104 = icmp ne i32* %103, null
br i1 %104, label %112, label %105
105: ; preds = %96
%106 = load i8**, i8*** %5
%107 = getelementptr inbounds i8*, i8** %106, i64 1
%108 = load i8*, i8** %107
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %108)
%110 = load i8*, i8** %7
%111 = call i32 @free(i8* %110)
store i32 -1, i32* %3
br label %133
112: ; preds = %96
%113 = load i8*, i8** %7
%114 = getelementptr inbounds i8, i8* %113, i64 512
%115 = load i32*, i32** %6
%116 = call i32 @fwrite(i8* %114, i32 16776704, i32 1, i32* %115)
%117 = icmp ne i32 %116, 1
br i1 %117, label %118, label %124
118: ; preds = %112
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
%120 = load i8*, i8** %7
%121 = call i32 @free(i8* %120)
%122 = load i32*, i32** %6
%123 = call i32 @close(i32* %122)
store i32 -1, i32* %3
br label %133
124: ; preds = %112
%125 = load i8*, i8** %7
%126 = call i32 @free(i8* %125)
%127 = load i32*, i32** %6
%128 = call i32 @close(i32* %127)
%129 = load i8**, i8*** %5
%130 = getelementptr inbounds i8*, i8** %129, i64 1
%131 = load i8*, i8** %130
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i8* %131)
store i32 0, i32* %3
br label %133
133: ; preds = %124, %118, %105, %90, %66, %51, %27, %13
%134 = load i32, i32* %3
ret i32 %134
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"r+b\00"
@.str.2 = [22 x i8] c"Open file '%s' error\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.5 = [4 x i8] c"w+b\00"
@.str.7 = [33 x i8] c"Generate pakfile '%s' successed\0A\00"
@str = [24 x i8] c"Write output file error\00"
@str.8 = [22 x i8] c"Read input file error\00"
@str.9 = [25 x i8] c"Read template file error\00"
@str.10 = [58 x i8] c"Usage: pak3399 <output file> <input file> <template file>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.10, i64 0, i64 0))
br label %75
6: ; preds = %2
%7 = tail call dereferenceable_or_null(67108864) i8* @malloc(i32 67108864)
%8 = tail call i32 @memset(i8* %7, i32 0, i32 67108864)
%9 = getelementptr inbounds i8*, i8** %1, i64 3
%10 = load i8*, i8** %9
%11 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %17
13: ; preds = %6
%14 = load i8*, i8** %9
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%16 = tail call i32 @free(i8* %7)
br label %75
17: ; preds = %6
%18 = load i32, i32* @SEEK_END
%19 = tail call i32 @fseek(i32* %11, i64 0, i32 %18)
%20 = tail call i32 @ftell(i32* %11)
%21 = load i32, i32* @SEEK_SET
%22 = tail call i32 @fseek(i32* %11, i64 0, i32 %21)
%23 = tail call i32 @fread(i8* %7, i32 1, i32 %20, i32* %11)
%24 = icmp eq i32 %23, %20
br i1 %24, label %29, label %25
25: ; preds = %17
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.9, i64 0, i64 0))
%27 = tail call i32 @free(i8* %7)
%28 = tail call i32 @fclose(i32* %11)
br label %75
29: ; preds = %17
%30 = tail call i32 @fclose(i32* %11)
%31 = getelementptr inbounds i8*, i8** %1, i64 2
%32 = load i8*, i8** %31
%33 = tail call i32* @fopen(i8* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%34 = icmp eq i32* %33, null
br i1 %34, label %35, label %39
35: ; preds = %29
%36 = load i8*, i8** %31
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %36)
%38 = tail call i32 @free(i8* %7)
br label %75
39: ; preds = %29
%40 = load i32, i32* @SEEK_END
%41 = tail call i32 @fseek(i32* %33, i64 0, i32 %40)
%42 = tail call i32 @ftell(i32* %33)
%43 = load i32, i32* @SEEK_SET
%44 = tail call i32 @fseek(i32* %33, i64 0, i32 %43)
%45 = getelementptr inbounds i8, i8* %7, i64 8388608
%46 = tail call i32 @fread(i8* %45, i32 1, i32 %42, i32* %33)
%47 = icmp eq i32 %46, %42
br i1 %47, label %52, label %48
48: ; preds = %39
%49 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.8, i64 0, i64 0))
%50 = tail call i32 @free(i8* %7)
%51 = tail call i32 @fclose(i32* %33)
br label %75
52: ; preds = %39
%53 = tail call i32 @fclose(i32* %33)
%54 = getelementptr inbounds i8*, i8** %1, i64 1
%55 = load i8*, i8** %54
%56 = tail call i32* @fopen(i8* %55, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%57 = icmp eq i32* %56, null
br i1 %57, label %58, label %62
58: ; preds = %52
%59 = load i8*, i8** %54
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %59)
%61 = tail call i32 @free(i8* %7)
br label %75
62: ; preds = %52
%63 = getelementptr inbounds i8, i8* %7, i64 512
%64 = tail call i32 @fwrite(i8* %63, i32 16776704, i32 1, i32* %56)
%65 = icmp eq i32 %64, 1
br i1 %65, label %70, label %66
66: ; preds = %62
%67 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%68 = tail call i32 @free(i8* %7)
%69 = tail call i32 @close(i32* %56)
br label %75
70: ; preds = %62
%71 = tail call i32 @free(i8* %7)
%72 = tail call i32 @close(i32* %56)
%73 = load i8*, i8** %54
%74 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i8* %73)
br label %75
75: ; preds = %70, %66, %58, %48, %35, %25, %13, %4
%76 = phi i32 [ -1, %4 ], [ -1, %25 ], [ -1, %48 ], [ -1, %66 ], [ 0, %70 ], [ -1, %58 ], [ -1, %35 ], [ -1, %13 ]
ret i32 %76
}