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

/* Variables and functions */
int EOF;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
scalar_t__ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char const *);
int sprintf(char *, char *, ...);
int strlen(char const *);
int main(int argc, const char *argv[]) {
  const int line_length = 16;
  int size = 0;
  char buf[256];
  FILE *f_in;
  long in_len;
  FILE *f_out;
  int c, n;
  if (argc != 4) {
    printf("Usage: %s <input_file> [+]<output_file> <output_array_name>\n",
           argv[0]);
    return -1;
  }
  if (strlen(argv[3]) > sizeof(buf) - 64) {
    printf("Array name is too long: %s\n", argv[3]);
    return -1;
  }
  f_in = fopen(argv[1], "rb");
  if (!f_in) {
    printf("Could not open file for reading: %s\n", argv[1]);
    return -1;
  }
  if (fseek(f_in, 0, SEEK_END)) {
    printf("Seek error for: %s\n", argv[1]);
    fclose(f_in);
    return -1;
  }
  in_len = ftell(f_in);
  if (fseek(f_in, 0, SEEK_SET)) {
    printf("Seek error for: %s\n", argv[1]);
    fclose(f_in);
    return -1;
  }
  if (argv[2][0] == '+')
    f_out = fopen(argv[2] + 1, "ab");
  else
    f_out = fopen(argv[2], "wb");
  if (!f_out) {
    printf("Could not open file for writing: %s\n", argv[2]);
    fclose(f_in);
    return -1;
  }
  n = sprintf(buf, "const unsigned char %s[%li] = {\n\t", argv[3], in_len);
  fwrite(buf, n, 1, f_out);
  c = fgetc(f_in);
  while (c != EOF) {
    n = sprintf(buf, "0x%.2X", c);
    fwrite(buf, n, 1, f_out);
    c = fgetc(f_in);
    size++;
    if (c != EOF) {
      if (size % line_length)
        fputs(", ", f_out);
      else
        fputs(",\n\t", f_out);
    } else {
      break;
    }
  }
  fputs("\n};\n", f_out);
  if (!feof(f_in)) {
    printf("Could not read entire file: %s", argv[1]);
  }
  fflush(f_out);
  fclose(f_out);
  fclose(f_in);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x10,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1210 <main+0x50>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe01(%rip),%rdi
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1561 <main+0x3a1>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <strlen@plt>
cltq
cmp    $0xc0,%rax
jbe    124b <main+0x8b>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xe03(%rip),%rdi
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1561 <main+0x3a1>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdff(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x128(%rbp)
cmpq   $0x0,-0x128(%rbp)
jne    1294 <main+0xd4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdd9(%rip),%rdi
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1561 <main+0x3a1>
mov    -0x128(%rbp),%rdi
mov    0x2d46(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
cmp    $0x0,%rax
je     12e1 <main+0x121>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdbd(%rip),%rdi
call   1050 <printf@plt>
mov    -0x128(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1561 <main+0x3a1>
mov    -0x128(%rbp),%rdi
call   1080 <ftell@plt>
mov    %rax,-0x130(%rbp)
mov    -0x128(%rbp),%rdi
mov    0x2cce(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
cmp    $0x0,%rax
je     1341 <main+0x181>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd5d(%rip),%rdi
call   1050 <printf@plt>
mov    -0x128(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1561 <main+0x3a1>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    1379 <main+0x1b9>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
add    $0x1,%rdi
lea    0xd2d(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x138(%rbp)
jmp    1394 <main+0x1d4>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd10(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x138(%rbp)
cmpq   $0x0,-0x138(%rbp)
jne    13ce <main+0x20e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xcea(%rip),%rdi
call   1050 <printf@plt>
mov    -0x128(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1561 <main+0x3a1>
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
mov    -0x130(%rbp),%rcx
lea    0xcd5(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
mov    %eax,-0x140(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x140(%rbp),%esi
mov    -0x138(%rbp),%rcx
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x128(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %eax,-0x13c(%rbp)
mov    -0x13c(%rbp),%eax
mov    0x2bab(%rip),%rcx
cmp    (%rcx),%eax
je     14fa <main+0x33a>
lea    -0x120(%rbp),%rdi
mov    -0x13c(%rbp),%edx
lea    0xc91(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
mov    %eax,-0x140(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x140(%rbp),%esi
mov    -0x138(%rbp),%rcx
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x128(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %eax,-0x13c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x13c(%rbp),%eax
mov    0x2b3c(%rip),%rcx
cmp    (%rcx),%eax
je     14f0 <main+0x330>
mov    -0x18(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     14d8 <main+0x318>
mov    -0x138(%rbp),%rsi
lea    0xc1b(%rip),%rdi
call   1060 <fputs@plt>
jmp    14eb <main+0x32b>
mov    -0x138(%rbp),%rsi
lea    0xc06(%rip),%rdi
call   1060 <fputs@plt>
jmp    14f5 <main+0x335>
jmp    14fa <main+0x33a>
jmp    1428 <main+0x268>
mov    -0x138(%rbp),%rsi
lea    0xbe8(%rip),%rdi
call   1060 <fputs@plt>
mov    -0x128(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%eax
jne    1536 <main+0x376>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xbc4(%rip),%rdi
call   1050 <printf@plt>
mov    -0x138(%rbp),%rdi
call   10a0 <fflush@plt>
mov    -0x138(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x128(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %rsi,%rbx
cmp    $0x4,%edi
jne    11e6 <main+0x36>
mov    0x18(%rbx),%rdi
call   1040 <strlen@plt>
cmp    $0xc1,%eax
jb     120c <main+0x5c>
mov    0x18(%rbx),%rsi
lea    0xe59(%rip),%rdi
jmp    11f0 <main+0x40>
mov    (%rbx),%rsi
lea    0xe10(%rip),%rdi
call   1050 <printf@plt>
mov    $0xffffffff,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8(%rbx),%rdi
lea    0xe42(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     127c <main+0xcc>
mov    %rax,%r14
mov    0x2dbd(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
test   %rax,%rax
jne    125f <main+0xaf>
mov    %r14,%rdi
call   1070 <ftell@plt>
mov    %rax,%rbp
mov    0x2d82(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
test   %rax,%rax
je     128c <main+0xdc>
mov    0x8(%rbx),%rsi
lea    0xe17(%rip),%rdi
call   1050 <printf@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
jmp    11f5 <main+0x45>
mov    0x8(%rbx),%rsi
lea    0xdd5(%rip),%rdi
jmp    11f0 <main+0x40>
mov    0x10(%rbx),%rdi
cmpb   $0x2b,(%rdi)
jne    12a2 <main+0xf2>
add    $0x1,%rdi
lea    0xdf5(%rip),%rsi
jmp    12a9 <main+0xf9>
lea    0xdef(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%r15
test   %rax,%rax
je     1358 <main+0x1a8>
mov    0x18(%rbx),%rdx
lea    0xdfb(%rip),%rsi
lea    0x10(%rsp),%r13
mov    %r13,%rdi
mov    %rbp,%rcx
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    $0x1,%r12d
mov    %r13,%rdi
mov    %eax,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10d0 <fwrite@plt>
mov    %r14,%rdi
call   1060 <fgetc@plt>
mov    0x2ce2(%rip),%r13
cmp    0x0(%r13),%eax
jne    1368 <main+0x1b8>
lea    0xde5(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10d0 <fwrite@plt>
mov    %r14,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    1339 <main+0x189>
mov    0x8(%rbx),%rsi
lea    0xdc1(%rip),%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
call   1090 <fflush@plt>
mov    %r15,%rdi
call   1030 <fclose@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    11fa <main+0x4a>
mov    0x10(%rbx),%rsi
lea    0xd38(%rip),%rdi
jmp    126a <main+0xba>
mov    %eax,%ebp
mov    %r14,0x8(%rsp)
jmp    1398 <main+0x1e8>
mov    $0x3,%esi
mov    $0x1,%edx
lea    0xd6a(%rip),%rdi
mov    %r15,%rcx
call   10d0 <fwrite@plt>
add    $0x1,%r12d
cmp    0x0(%r13),%ebp
je     1304 <main+0x154>
mov    %r15,%r14
lea    0x10(%rsp),%r15
mov    %r15,%rdi
lea    0xd38(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    %r15,%rdi
mov    %r14,%r15
mov    0x8(%rsp),%r14
mov    %eax,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10d0 <fwrite@plt>
mov    %r14,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebp
mov    %r13,%rax
cmp    0x0(%r13),%ebp
je     1304 <main+0x154>
test   $0xf,%r12b
je     1371 <main+0x1c1>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xcee(%rip),%rdi
jmp    1382 <main+0x1d2>

LLVM IR (-O0):
@.str = [61 x i8] c"Usage: %s <input_file> [+]<output_file> <output_array_name>\0A\00"
@.str.1 = [28 x i8] c"Array name is too long: %s\0A\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [37 x i8] c"Could not open file for reading: %s\0A\00"
@SEEK_END = global i32 0
@.str.4 = [20 x i8] c"Seek error for: %s\0A\00"
@SEEK_SET = global i32 0
@.str.5 = [3 x i8] c"ab\00"
@.str.6 = [3 x i8] c"wb\00"
@.str.7 = [37 x i8] c"Could not open file for writing: %s\0A\00"
@.str.8 = [34 x i8] c"const unsigned char %s[%li] = {\0A\09\00"
@EOF = global i32 0
@.str.9 = [7 x i8] c"0x%.2X\00"
@.str.10 = [3 x i8] c", \00"
@.str.11 = [4 x i8] c",\0A\09\00"
@.str.12 = [5 x i8] c"\0A};\0A\00"
@.str.13 = [31 x i8] c"Could not read entire file: %s\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 [256 x i8]
%9 = alloca i32*
%10 = alloca i64
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 16, i32* %6
store i32 0, i32* %7
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 4
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 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %19)
store i32 -1, i32* %3
br label %163
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 3
%24 = load i8*, i8** %23
%25 = call i32 @strlen(i8* %24)
%26 = sext i32 %25 to i64
%27 = icmp ugt i64 %26, 192
br i1 %27, label %28, label %33
28: ; preds = %21
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 3
%31 = load i8*, i8** %30
%32 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %31)
store i32 -1, i32* %3
br label %163
33: ; preds = %21
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = call i32* @fopen(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %37, i32** %9
%38 = load i32*, i32** %9
%39 = icmp ne i32* %38, null
br i1 %39, label %45, label %40
40: ; preds = %33
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 1
%43 = load i8*, i8** %42
%44 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i8* %43)
store i32 -1, i32* %3
br label %163
45: ; preds = %33
%46 = load i32*, i32** %9
%47 = load i32, i32* @SEEK_END
%48 = call i64 @fseek(i32* %46, i32 0, i32 %47)
%49 = icmp ne i64 %48, 0
br i1 %49, label %50, label %57
50: ; preds = %45
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 1
%53 = load i8*, i8** %52
%54 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %53)
%55 = load i32*, i32** %9
%56 = call i32 @fclose(i32* %55)
store i32 -1, i32* %3
br label %163
57: ; preds = %45
%58 = load i32*, i32** %9
%59 = call i64 @ftell(i32* %58)
store i64 %59, i64* %10
%60 = load i32*, i32** %9
%61 = load i32, i32* @SEEK_SET
%62 = call i64 @fseek(i32* %60, i32 0, i32 %61)
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %71
64: ; preds = %57
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 1
%67 = load i8*, i8** %66
%68 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %67)
%69 = load i32*, i32** %9
%70 = call i32 @fclose(i32* %69)
store i32 -1, i32* %3
br label %163
71: ; preds = %57
%72 = load i8**, i8*** %5
%73 = getelementptr inbounds i8*, i8** %72, i64 2
%74 = load i8*, i8** %73
%75 = getelementptr inbounds i8, i8* %74, i64 0
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = icmp eq i32 %77, 43
br i1 %78, label %79, label %85
79: ; preds = %71
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 2
%82 = load i8*, i8** %81
%83 = getelementptr inbounds i8, i8* %82, i64 1
%84 = call i32* @fopen(i8* %83, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %84, i32** %11
br label %90
85: ; preds = %71
%86 = load i8**, i8*** %5
%87 = getelementptr inbounds i8*, i8** %86, i64 2
%88 = load i8*, i8** %87
%89 = call i32* @fopen(i8* %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32* %89, i32** %11
br label %90
90: ; preds = %85, %79
%91 = load i32*, i32** %11
%92 = icmp ne i32* %91, null
br i1 %92, label %100, label %93
93: ; preds = %90
%94 = load i8**, i8*** %5
%95 = getelementptr inbounds i8*, i8** %94, i64 2
%96 = load i8*, i8** %95
%97 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i8* %96)
%98 = load i32*, i32** %9
%99 = call i32 @fclose(i32* %98)
store i32 -1, i32* %3
br label %163
100: ; preds = %90
%101 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%102 = load i8**, i8*** %5
%103 = getelementptr inbounds i8*, i8** %102, i64 3
%104 = load i8*, i8** %103
%105 = load i64, i64* %10
%106 = call i32 (i8*, i8*, ...) @sprintf(i8* %101, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), i8* %104, i64 %105)
store i32 %106, i32* %13
%107 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%108 = load i32, i32* %13
%109 = load i32*, i32** %11
%110 = call i32 @fwrite(i8* %107, i32 %108, i32 1, i32* %109)
%111 = load i32*, i32** %9
%112 = call i32 @fgetc(i32* %111)
store i32 %112, i32* %12
br label %113
113: ; preds = %144, %100
%114 = load i32, i32* %12
%115 = load i32, i32* @EOF
%116 = icmp ne i32 %114, %115
br i1 %116, label %117, label %145
117: ; preds = %113
%118 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%119 = load i32, i32* %12
%120 = call i32 (i8*, i8*, ...) @sprintf(i8* %118, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 %119)
store i32 %120, i32* %13
%121 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%122 = load i32, i32* %13
%123 = load i32*, i32** %11
%124 = call i32 @fwrite(i8* %121, i32 %122, i32 1, i32* %123)
%125 = load i32*, i32** %9
%126 = call i32 @fgetc(i32* %125)
store i32 %126, i32* %12
%127 = load i32, i32* %7
%128 = add nsw i32 %127, 1
store i32 %128, i32* %7
%129 = load i32, i32* %12
%130 = load i32, i32* @EOF
%131 = icmp ne i32 %129, %130
br i1 %131, label %132, label %143
132: ; preds = %117
%133 = load i32, i32* %7
%134 = srem i32 %133, 16
%135 = icmp ne i32 %134, 0
br i1 %135, label %136, label %139
136: ; preds = %132
%137 = load i32*, i32** %11
%138 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %137)
br label %142
139: ; preds = %132
%140 = load i32*, i32** %11
%141 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32* %140)
br label %142
142: ; preds = %139, %136
br label %144
143: ; preds = %117
br label %145
144: ; preds = %142
br label %113
145: ; preds = %143, %113
%146 = load i32*, i32** %11
%147 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32* %146)
%148 = load i32*, i32** %9
%149 = call i32 @feof(i32* %148)
%150 = icmp ne i32 %149, 0
br i1 %150, label %156, label %151
151: ; preds = %145
%152 = load i8**, i8*** %5
%153 = getelementptr inbounds i8*, i8** %152, i64 1
%154 = load i8*, i8** %153
%155 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.13, i64 0, i64 0), i8* %154)
br label %156
156: ; preds = %151, %145
%157 = load i32*, i32** %11
%158 = call i32 @fflush(i32* %157)
%159 = load i32*, i32** %11
%160 = call i32 @fclose(i32* %159)
%161 = load i32*, i32** %9
%162 = call i32 @fclose(i32* %161)
store i32 0, i32* %3
br label %163
163: ; preds = %156, %93, %64, %50, %40, %28, %16
%164 = load i32, i32* %3
ret i32 %164
}

LLVM IR (-O2):
@.str = [61 x i8] c"Usage: %s <input_file> [+]<output_file> <output_array_name>\0A\00"
@.str.1 = [28 x i8] c"Array name is too long: %s\0A\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [37 x i8] c"Could not open file for reading: %s\0A\00"
@SEEK_END = global i32 0
@.str.4 = [20 x i8] c"Seek error for: %s\0A\00"
@SEEK_SET = global i32 0
@.str.5 = [3 x i8] c"ab\00"
@.str.6 = [3 x i8] c"wb\00"
@.str.7 = [37 x i8] c"Could not open file for writing: %s\0A\00"
@.str.8 = [34 x i8] c"const unsigned char %s[%li] = {\0A\09\00"
@EOF = global i32 0
@.str.9 = [7 x i8] c"0x%.2X\00"
@.str.10 = [3 x i8] c", \00"
@.str.11 = [4 x i8] c",\0A\09\00"
@.str.12 = [5 x i8] c"\0A};\0A\00"
@.str.13 = [31 x i8] c"Could not read entire file: %s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %96
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 3
%11 = load i8*, i8** %10
%12 = tail call i32 @strlen(i8* %11)
%13 = icmp ugt i32 %12, 192
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i8*, i8** %10
%16 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %15)
br label %96
17: ; preds = %9
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = tail call i32* @fopen(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %25
22: ; preds = %17
%23 = load i8*, i8** %18
%24 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i8* %23)
br label %96
25: ; preds = %17
%26 = load i32, i32* @SEEK_END
%27 = tail call i64 @fseek(i32* %20, i32 0, i32 %26)
%28 = icmp eq i64 %27, 0
br i1 %28, label %33, label %29
29: ; preds = %25
%30 = load i8*, i8** %18
%31 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %30)
%32 = tail call i32 @fclose(i32* %20)
br label %96
33: ; preds = %25
%34 = tail call i64 @ftell(i32* %20)
%35 = load i32, i32* @SEEK_SET
%36 = tail call i64 @fseek(i32* %20, i32 0, i32 %35)
%37 = icmp eq i64 %36, 0
br i1 %37, label %42, label %38
38: ; preds = %33
%39 = load i8*, i8** %18
%40 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %39)
%41 = tail call i32 @fclose(i32* %20)
br label %96
42: ; preds = %33
%43 = getelementptr inbounds i8*, i8** %1, i64 2
%44 = load i8*, i8** %43
%45 = load i8, i8* %44
%46 = icmp eq i8 %45, 43
br i1 %46, label %47, label %50
47: ; preds = %42
%48 = getelementptr inbounds i8, i8* %44, i64 1
%49 = tail call i32* @fopen(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %52
50: ; preds = %42
%51 = tail call i32* @fopen(i8* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %52
52: ; preds = %50, %47
%53 = phi i32* [ %49, %47 ], [ %51, %50 ]
%54 = icmp eq i32* %53, null
br i1 %54, label %55, label %59
55: ; preds = %52
%56 = load i8*, i8** %43
%57 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i8* %56)
%58 = tail call i32 @fclose(i32* %20)
br label %96
59: ; preds = %52
%60 = load i8*, i8** %10
%61 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), i8* %60, i64 %34)
%62 = call i32 @fwrite(i8* %4, i32 %61, i32 1, i32* %53)
%63 = tail call i32 @fgetc(i32* %20)
%64 = load i32, i32* @EOF
%65 = icmp eq i32 %63, %64
br i1 %65, label %85, label %66
66: ; preds = %59, %82
%67 = phi i32 [ %71, %82 ], [ %63, %59 ]
%68 = phi i32 [ %72, %82 ], [ 0, %59 ]
%69 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 %67)
%70 = call i32 @fwrite(i8* %4, i32 %69, i32 1, i32* %53)
%71 = tail call i32 @fgetc(i32* %20)
%72 = add nuw nsw i32 %68, 1
%73 = load i32, i32* @EOF
%74 = icmp eq i32 %71, %73
br i1 %74, label %85, label %75
75: ; preds = %66
%76 = and i32 %72, 15
%77 = icmp eq i32 %76, 0
br i1 %77, label %80, label %78
78: ; preds = %75
%79 = tail call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i64 2, i64 1, i32* %53)
br label %82
80: ; preds = %75
%81 = tail call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i64 3, i64 1, i32* %53)
br label %82
82: ; preds = %78, %80
%83 = load i32, i32* @EOF
%84 = icmp eq i32 %71, %83
br i1 %84, label %85, label %66
85: ; preds = %82, %66, %59
%86 = tail call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i64 4, i64 1, i32* %53)
%87 = tail call i32 @feof(i32* %20)
%88 = icmp eq i32 %87, 0
br i1 %88, label %89, label %92
89: ; preds = %85
%90 = load i8*, i8** %18
%91 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.13, i64 0, i64 0), i8* %90)
br label %92
92: ; preds = %89, %85
%93 = tail call i32 @fflush(i32* %53)
%94 = tail call i32 @fclose(i32* %53)
%95 = tail call i32 @fclose(i32* %20)
br label %96
96: ; preds = %92, %55, %38, %29, %22, %14, %6
%97 = phi i32 [ -1, %6 ], [ -1, %14 ], [ -1, %29 ], [ -1, %38 ], [ 0, %92 ], [ -1, %55 ], [ -1, %22 ]
ret i32 %97
}