#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*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fread(void *, int, long, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
unsigned char *malloc(long);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  char *array_name = "array";
  FILE *fp;
  long size;
  unsigned char *buf;
  long i, j;
  if (argc < 3) {
    printf("BIN2C by Cyber Warrior X\n");
    printf("usage: bin2c <source binary file> <destination source file> "
           "<optional array name>");
    exit(1);
  }
  if (argc > 3)
    array_name = argv[3];
  if ((fp = fopen(argv[1], "rb")) == NULL) {
    printf("Error opening %s", argv[1]);
    exit(1);
  }
  fseek(fp, 0, SEEK_END);
  size = ftell(fp);
  fseek(fp, 0, SEEK_SET);
  if ((buf = malloc(size)) == NULL) {
    printf("Error allocating buffer\n");
    fclose(fp);
    exit(1);
  }
  fread((void *)buf, 1, size, fp);
  fclose(fp);
  if ((fp = fopen(argv[2], "wt")) == NULL) {
    printf("Error opening %s for writing", argv[2]);
    exit(1);
  }
  fprintf(fp,
          "// Autogenerated by BIN2C by Cyber Warrior X. Modifications may be "
          "overwritten!\n"
          "#include \"types.h\"\n"
          "\n"
          "u8 %s[%d] = \n"
          "{\n",
          array_name, size);
  for (i = 0; i < size; i += 15) {
    int count;
    if ((i + 15) <= size)
      count = 15;
    else
      count = size - i;
    fprintf(fp, "\t");
    for (j = 0; j < count; j++)
      fprintf(fp, "0x%02X,", buf[i + j]);
    fprintf(fp, "\n");
  }
  fprintf(fp,
          "};\n"
          "\n"
          "u32 %s_size = sizeof(%s);\n",
          array_name, array_name);
  fclose(fp);
}


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)
lea    0xe53(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11e1 <main+0x51>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
cmpl   $0x3,-0x8(%rbp)
jle    11f7 <main+0x67>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6c(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1239 <main+0xa9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    0x2da4(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1090 <fseek@plt>
mov    -0x20(%rbp),%rdi
call   1070 <ftell@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2d73(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1090 <fseek@plt>
mov    -0x28(%rbp),%rdi
call   1080 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    12a6 <main+0x116>
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdcb(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1307 <main+0x177>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xda5(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    13e1 <main+0x251>
mov    -0x38(%rbp),%rax
add    $0xf,%rax
cmp    -0x28(%rbp),%rax
jg     1355 <main+0x1c5>
movl   $0xf,-0x44(%rbp)
jmp    1360 <main+0x1d0>
mov    -0x28(%rbp),%rax
sub    -0x38(%rbp),%rax
mov    %eax,-0x44(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xdc8(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movq   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
cmp    %rcx,%rax
jge    13be <main+0x22e>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
add    -0x40(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
lea    0xd8f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    137a <main+0x1ea>
mov    -0x20(%rbp),%rdi
lea    0xd91(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x38(%rbp),%rax
add    $0xf,%rax
mov    %rax,-0x38(%rbp)
jmp    1329 <main+0x199>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xd49(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x4(%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
sub    $0x18,%rsp
cmp    $0x2,%edi
jle    134f <main+0x19f>
mov    %rsi,%r13
cmp    $0x3,%edi
jne    11d8 <main+0x28>
lea    0xe2a(%rip),%rbp
jmp    11dc <main+0x2c>
mov    0x18(%r13),%rbp
mov    0x8(%r13),%rdi
lea    0xe71(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1373 <main+0x1c3>
mov    %rax,%r12
mov    0x2de9(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    %r12,%rdi
call   1090 <ftell@plt>
mov    %rax,%r15
mov    0x2dbb(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    %r15,%rdi
call   10a0 <malloc@plt>
test   %rax,%rax
je     1380 <main+0x1d0>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
mov    %r15,%rdx
mov    %r12,%rcx
call   1040 <fread@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    0x10(%r13),%rdi
lea    0xe09(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     139e <main+0x1ee>
mov    %rax,%r12
lea    0xe11(%rip),%rsi
mov    %rax,%rdi
mov    %rbp,0x8(%rsp)
mov    %rbp,%rdx
mov    %r15,%rcx
xor    %eax,%eax
call   1080 <fprintf@plt>
test   %r15,%r15
jle    131d <main+0x16d>
lea    0xe60(%rip),%r13
xor    %r14d,%r14d
mov    %r15,0x10(%rsp)
jmp    12cb <main+0x11b>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
add    $0xf,%rbx
mov    0x10(%rsp),%r15
cmp    %r14,%r15
jle    131d <main+0x16d>
mov    %r15d,%ebp
sub    %r14d,%ebp
add    $0xf,%r14
mov    $0x9,%edi
mov    %r12,%rsi
call   1070 <fputc@plt>
cmp    %r15,%r14
movslq %ebp,%rbp
mov    $0xf,%eax
cmovle %rax,%rbp
test   %rbp,%rbp
jle    12b0 <main+0x100>
xor    %r15d,%r15d
nopl   0x0(%rax)
movzbl (%rbx,%r15,1),%edx
mov    %r12,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
add    $0x1,%r15
cmp    %r15,%rbp
jne    1300 <main+0x150>
jmp    12b0 <main+0x100>
lea    0xde4(%rip),%rsi
mov    %r12,%rdi
mov    0x8(%rsp),%rcx
mov    %rcx,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xde9(%rip),%rdi
call   1030 <puts@plt>
lea    0xca4(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    0x8(%r13),%rsi
lea    0xcdd(%rip),%rdi
jmp    13a9 <main+0x1f9>
lea    0xda0(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    0x10(%r13),%rsi
lea    0xcc6(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"array\00"
@.str.1 = [26 x i8] c"BIN2C by Cyber Warrior X\0A\00"
@.str.2 = [82 x i8] c"usage: bin2c <source binary file> <destination source file> <optional array name>\00"
@.str.3 = [3 x i8] c"rb\00"
@.str.4 = [17 x i8] c"Error opening %s\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.5 = [25 x i8] c"Error allocating buffer\0A\00"
@.str.6 = [3 x i8] c"wt\00"
@.str.7 = [29 x i8] c"Error opening %s for writing\00"
@.str.8 = [116 x i8] c"// Autogenerated by BIN2C by Cyber Warrior X. Modifications may be overwritten!\0A#include \22types.h\22\0A\0Au8 %s[%d] = \0A{\0A\00"
@.str.9 = [2 x i8] c"\09\00"
@.str.10 = [8 x i8] c"0x%02X,\00"
@.str.11 = [2 x i8] c"\0A\00"
@.str.12 = [31 x i8] c"};\0A\0Au32 %s_size = sizeof(%s);\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %6
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %19
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %2
%20 = load i32, i32* %4
%21 = icmp sgt i32 %20, 3
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 3
%25 = load i8*, i8** %24
store i8* %25, i8** %6
br label %26
26: ; preds = %22, %19
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32* @fopen(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %30, i32** %7
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %38
32: ; preds = %26
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %35)
%37 = call i32 @exit(i32 1)
unreachable
38: ; preds = %26
%39 = load i32*, i32** %7
%40 = load i32, i32* @SEEK_END
%41 = call i32 @fseek(i32* %39, i32 0, i32 %40)
%42 = load i32*, i32** %7
%43 = call i64 @ftell(i32* %42)
store i64 %43, i64* %8
%44 = load i32*, i32** %7
%45 = load i32, i32* @SEEK_SET
%46 = call i32 @fseek(i32* %44, i32 0, i32 %45)
%47 = load i64, i64* %8
%48 = call i8* @malloc(i64 %47)
store i8* %48, i8** %9
%49 = icmp eq i8* %48, null
br i1 %49, label %50, label %55
50: ; preds = %38
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%52 = load i32*, i32** %7
%53 = call i32 @fclose(i32* %52)
%54 = call i32 @exit(i32 1)
unreachable
55: ; preds = %38
%56 = load i8*, i8** %9
%57 = load i64, i64* %8
%58 = load i32*, i32** %7
%59 = call i32 @fread(i8* %56, i32 1, i64 %57, i32* %58)
%60 = load i32*, i32** %7
%61 = call i32 @fclose(i32* %60)
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 2
%64 = load i8*, i8** %63
%65 = call i32* @fopen(i8* %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32* %65, i32** %7
%66 = icmp eq i32* %65, null
br i1 %66, label %67, label %73
67: ; preds = %55
%68 = load i8**, i8*** %5
%69 = getelementptr inbounds i8*, i8** %68, i64 2
%70 = load i8*, i8** %69
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i8* %70)
%72 = call i32 @exit(i32 1)
unreachable
73: ; preds = %55
%74 = load i32*, i32** %7
%75 = load i8*, i8** %6
%76 = load i64, i64* %8
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %74, i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str.8, i64 0, i64 0), i8* %75, i64 %76)
store i64 0, i64* %10
br label %78
78: ; preds = %117, %73
%79 = load i64, i64* %10
%80 = load i64, i64* %8
%81 = icmp slt i64 %79, %80
br i1 %81, label %82, label %120
82: ; preds = %78
%83 = load i64, i64* %10
%84 = add nsw i64 %83, 15
%85 = load i64, i64* %8
%86 = icmp sle i64 %84, %85
br i1 %86, label %87, label %88
87: ; preds = %82
store i32 15, i32* %12
br label %93
88: ; preds = %82
%89 = load i64, i64* %8
%90 = load i64, i64* %10
%91 = sub nsw i64 %89, %90
%92 = trunc i64 %91 to i32
store i32 %92, i32* %12
br label %93
93: ; preds = %88, %87
%94 = load i32*, i32** %7
%95 = call i32 (i32*, i8*, ...) @fprintf(i32* %94, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i64 0, i64* %11
br label %96
96: ; preds = %111, %93
%97 = load i64, i64* %11
%98 = load i32, i32* %12
%99 = sext i32 %98 to i64
%100 = icmp slt i64 %97, %99
br i1 %100, label %101, label %114
101: ; preds = %96
%102 = load i32*, i32** %7
%103 = load i8*, i8** %9
%104 = load i64, i64* %10
%105 = load i64, i64* %11
%106 = add nsw i64 %104, %105
%107 = getelementptr inbounds i8, i8* %103, i64 %106
%108 = load i8, i8* %107
%109 = zext i8 %108 to i32
%110 = call i32 (i32*, i8*, ...) @fprintf(i32* %102, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 %109)
br label %111
111: ; preds = %101
%112 = load i64, i64* %11
%113 = add nsw i64 %112, 1
store i64 %113, i64* %11
br label %96
114: ; preds = %96
%115 = load i32*, i32** %7
%116 = call i32 (i32*, i8*, ...) @fprintf(i32* %115, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %117
117: ; preds = %114
%118 = load i64, i64* %10
%119 = add nsw i64 %118, 15
store i64 %119, i64* %10
br label %78
120: ; preds = %78
%121 = load i32*, i32** %7
%122 = load i8*, i8** %6
%123 = load i8*, i8** %6
%124 = call i32 (i32*, i8*, ...) @fprintf(i32* %121, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0), i8* %122, i8* %123)
%125 = load i32*, i32** %7
%126 = call i32 @fclose(i32* %125)
%127 = load i32, i32* %3
ret i32 %127
}

LLVM IR (-O2):
@.str = [6 x i8] c"array\00"
@.str.2 = [82 x i8] c"usage: bin2c <source binary file> <destination source file> <optional array name>\00"
@.str.3 = [3 x i8] c"rb\00"
@.str.4 = [17 x i8] c"Error opening %s\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.6 = [3 x i8] c"wt\00"
@.str.7 = [29 x i8] c"Error opening %s for writing\00"
@.str.8 = [116 x i8] c"// Autogenerated by BIN2C by Cyber Warrior X. Modifications may be overwritten!\0A#include \22types.h\22\0A\0Au8 %s[%d] = \0A{\0A\00"
@.str.10 = [8 x i8] c"0x%02X,\00"
@.str.12 = [31 x i8] c"};\0A\0Au32 %s_size = sizeof(%s);\0A\00"
@str = [24 x i8] c"Error allocating buffer\00"
@str.13 = [25 x i8] c"BIN2C by Cyber Warrior X\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.13, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = icmp eq i32 %0, 3
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = getelementptr inbounds i8*, i8** %1, i64 3
%12 = load i8*, i8** %11
br label %13
13: ; preds = %10, %8
%14 = phi i8* [ %12, %10 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %8 ]
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i32* @fopen(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %23
19: ; preds = %13
%20 = load i8*, i8** %15
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %20)
%22 = tail call i32 @exit(i32 1)
unreachable
23: ; preds = %13
%24 = load i32, i32* @SEEK_END
%25 = tail call i32 @fseek(i32* %17, i32 0, i32 %24)
%26 = tail call i64 @ftell(i32* %17)
%27 = load i32, i32* @SEEK_SET
%28 = tail call i32 @fseek(i32* %17, i32 0, i32 %27)
%29 = tail call i8* @malloc(i64 %26)
%30 = icmp eq i8* %29, null
br i1 %30, label %31, label %35
31: ; preds = %23
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%33 = tail call i32 @fclose(i32* %17)
%34 = tail call i32 @exit(i32 1)
unreachable
35: ; preds = %23
%36 = tail call i32 @fread(i8* %29, i32 1, i64 %26, i32* %17)
%37 = tail call i32 @fclose(i32* %17)
%38 = getelementptr inbounds i8*, i8** %1, i64 2
%39 = load i8*, i8** %38
%40 = tail call i32* @fopen(i8* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%41 = icmp eq i32* %40, null
br i1 %41, label %42, label %46
42: ; preds = %35
%43 = load i8*, i8** %38
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i8* %43)
%45 = tail call i32 @exit(i32 1)
unreachable
46: ; preds = %35
%47 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str.8, i64 0, i64 0), i8* %14, i64 %26)
%48 = icmp sgt i64 %26, 0
br i1 %48, label %49, label %71
49: ; preds = %46, %68
%50 = phi i64 [ %51, %68 ], [ 0, %46 ]
%51 = add nuw nsw i64 %50, 15
%52 = icmp sgt i64 %51, %26
%53 = sub nsw i64 %26, %50
%54 = tail call i32 @fputc(i32 9, i32* %40)
%55 = shl i64 %53, 32
%56 = ashr exact i64 %55, 32
%57 = select i1 %52, i64 %56, i64 15
%58 = icmp sgt i64 %57, 0
br i1 %58, label %59, label %68
59: ; preds = %49, %59
%60 = phi i64 [ %66, %59 ], [ 0, %49 ]
%61 = add nuw nsw i64 %60, %50
%62 = getelementptr inbounds i8, i8* %29, i64 %61
%63 = load i8, i8* %62
%64 = zext i8 %63 to i32
%65 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 %64)
%66 = add nuw nsw i64 %60, 1
%67 = icmp eq i64 %66, %57
br i1 %67, label %68, label %59
68: ; preds = %59, %49
%69 = tail call i32 @fputc(i32 10, i32* %40)
%70 = icmp sgt i64 %26, %51
br i1 %70, label %49, label %71
71: ; preds = %68, %46
%72 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0), i8* %14, i8* %14)
%73 = tail call i32 @fclose(i32* %40)
ret i32 0
}