#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 /*<<< orphan*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
size_t fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (argc != 4 || (argc == 2 && strcmp(argv[1], "--help") == 0)) {
    fprintf(stderr, "Usage: %s PREFIX OUTFILE INFILE\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  char const *prefix = argv[1];
  char const *infile_name = argv[3];
  char const *outfile_name = argv[2];
  FILE *infile = fopen(infile_name, "rb");
  if (!infile) {
    fprintf(stderr, "Unable to open input file: %s\n", infile_name);
    exit(EXIT_FAILURE);
  }
  FILE *outfile = fopen(outfile_name, "w");
  if (!outfile) {
    fprintf(stderr, "Uanble to open output file: %s\n", outfile_name);
    fclose(infile);
    exit(EXIT_FAILURE);
  }
  fprintf(outfile, "#ifndef %s_data_pack_h\n", prefix);
  fprintf(outfile, "#define %s_data_pack_h\n\n", prefix);
  fprintf(outfile, "#include <stddef.h>\n\n");
  fprintf(outfile, "static const char %s_data[] =\n", prefix);
  size_t data_size = 0;
  for (;;) {
    unsigned char buf[256];
    unsigned char *ptr = buf;
    size_t nread = fread(buf, sizeof(char), sizeof(buf), infile);
    size_t line_count = nread / 16;
    size_t i;
    data_size += nread;
    for (i = 0; i < line_count; ++i, ptr += 16) {
      fprintf(outfile,
              "\""
              "\\x%02x\\x%02x\\x%02x\\x%02x"
              "\\x%02x\\x%02x\\x%02x\\x%02x"
              "\\x%02x\\x%02x\\x%02x\\x%02x"
              "\\x%02x\\x%02x\\x%02x\\x%02x"
              "\"\n",
              ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7],
              ptr[8], ptr[9], ptr[10], ptr[11], ptr[12], ptr[13], ptr[14],
              ptr[15]);
    }
    if (nread % 16 != 0) {
      fprintf(outfile, "\"");
      for (i = line_count * 16; i < nread; ++i) {
        fprintf(outfile, "\\x%02x", buf[i]);
      }
      fprintf(outfile, "\"\n");
    }
    if (nread != sizeof(buf)) {
      break;
    }
  }
  fprintf(outfile, ";\n\n");
  fprintf(outfile, "static const size_t %s_size = %lu;\n", prefix,
          (unsigned long)data_size);
  fprintf(outfile, "\n#endif\n");
  fclose(infile);
  fclose(outfile);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1d8,%rsp
movl   $0x0,-0x2c(%rbp)
mov    %edi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
cmpl   $0x4,-0x30(%rbp)
jne    11b4 <main+0x54>
cmpl   $0x2,-0x30(%rbp)
jne    11e1 <main+0x81>
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe5b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11e1 <main+0x81>
mov    0x2e25(%rip),%rax
movslq (%rax),%rdi
mov    -0x38(%rbp),%rax
mov    (%rax),%rdx
lea    0xe3b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2dfe(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x48(%rbp)
mov    -0x38(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x50(%rbp)
mov    -0x48(%rbp),%rdi
lea    0xe18(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    124e <main+0xee>
mov    0x2db5(%rip),%rax
movslq (%rax),%rdi
mov    -0x48(%rbp),%rdx
lea    0xdf2(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2d91(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x50(%rbp),%rdi
lea    0xdf1(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
jne    12a0 <main+0x140>
mov    0x2d6c(%rip),%rax
movslq (%rax),%rdi
mov    -0x50(%rbp),%rdx
lea    0xdca(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x58(%rbp),%rdi
call   1040 <fclose@plt>
mov    0x2d3f(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x60(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xdbd(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x60(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xdbf(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x60(%rbp),%rdi
lea    0xdc6(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x60(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xdc6(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movq   $0x0,-0x68(%rbp)
lea    -0x170(%rbp),%rax
mov    %rax,-0x178(%rbp)
lea    -0x170(%rbp),%rdi
mov    -0x58(%rbp),%rcx
mov    $0x1,%esi
mov    $0x100,%edx
call   1030 <fread@plt>
mov    %rax,-0x180(%rbp)
mov    -0x180(%rbp),%rax
shr    $0x4,%rax
mov    %rax,-0x188(%rbp)
mov    -0x180(%rbp),%rax
add    -0x68(%rbp),%rax
mov    %rax,-0x68(%rbp)
movq   $0x0,-0x190(%rbp)
mov    -0x190(%rbp),%rax
cmp    -0x188(%rbp),%rax
jae    14c2 <main+0x362>
mov    -0x60(%rbp),%rdi
mov    -0x178(%rbp),%rax
movzbl (%rax),%edx
mov    -0x178(%rbp),%rax
movzbl 0x1(%rax),%ecx
mov    -0x178(%rbp),%rax
movzbl 0x2(%rax),%r8d
mov    -0x178(%rbp),%rax
movzbl 0x3(%rax),%r9d
mov    -0x178(%rbp),%rax
movzbl 0x4(%rax),%eax
mov    -0x178(%rbp),%rsi
movzbl 0x5(%rsi),%esi
mov    %esi,-0x1a0(%rbp)
mov    -0x178(%rbp),%rsi
movzbl 0x6(%rsi),%esi
mov    %esi,-0x19c(%rbp)
mov    -0x178(%rbp),%rsi
movzbl 0x7(%rsi),%esi
mov    %esi,-0x198(%rbp)
mov    -0x178(%rbp),%rsi
movzbl 0x8(%rsi),%r13d
mov    -0x178(%rbp),%rsi
movzbl 0x9(%rsi),%r12d
mov    -0x178(%rbp),%rsi
movzbl 0xa(%rsi),%r15d
mov    -0x178(%rbp),%rsi
movzbl 0xb(%rsi),%r14d
mov    -0x178(%rbp),%rsi
movzbl 0xc(%rsi),%ebx
mov    -0x178(%rbp),%rsi
movzbl 0xd(%rsi),%r11d
mov    -0x178(%rbp),%rsi
movzbl 0xe(%rsi),%r10d
mov    -0x178(%rbp),%rsi
movzbl 0xf(%rsi),%esi
mov    %esi,-0x194(%rbp)
lea    0xc8d(%rip),%rsi
mov    %eax,(%rsp)
mov    -0x1a0(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    -0x19c(%rbp),%eax
mov    %eax,0x10(%rsp)
mov    -0x198(%rbp),%eax
mov    %eax,0x18(%rsp)
mov    -0x194(%rbp),%eax
mov    %r13d,0x20(%rsp)
mov    %r12d,0x28(%rsp)
mov    %r15d,0x30(%rsp)
mov    %r14d,0x38(%rsp)
mov    %ebx,0x40(%rsp)
mov    %r11d,0x48(%rsp)
mov    %r10d,0x50(%rsp)
mov    %eax,0x58(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x190(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x190(%rbp)
mov    -0x178(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x178(%rbp)
jmp    1357 <main+0x1f7>
mov    -0x180(%rbp),%rax
and    $0xf,%rax
cmp    $0x0,%rax
je     1559 <main+0x3f9>
mov    -0x60(%rbp),%rdi
lea    0xc54(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x188(%rbp),%rax
shl    $0x4,%rax
mov    %rax,-0x190(%rbp)
mov    -0x190(%rbp),%rax
cmp    -0x180(%rbp),%rax
jae    1547 <main+0x3e7>
mov    -0x60(%rbp),%rdi
mov    -0x190(%rbp),%rax
movzbl -0x170(%rbp,%rax,1),%edx
ff
lea    0xc0f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x190(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x190(%rbp)
jmp    14fb <main+0x39b>
mov    -0x60(%rbp),%rdi
lea    0xbe1(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
cmpq   $0x100,-0x180(%rbp)
je     156f <main+0x40f>
jmp    1574 <main+0x414>
jmp    12fc <main+0x19c>
mov    -0x60(%rbp),%rdi
lea    0xbc0(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x60(%rbp),%rdi
mov    -0x40(%rbp),%rdx
mov    -0x68(%rbp),%rcx
lea    0xbaa(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x60(%rbp),%rdi
lea    0xbbc(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x58(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x60(%rbp),%rdi
call   1040 <fclose@plt>
mov    0x2a05(%rip),%rax
mov    (%rax),%eax
add    $0x1d8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x168,%rsp
cmp    $0x4,%edi
jne    1447 <main+0x2d7>
mov    0x8(%rsi),%rax
mov    %rax,0x8(%rsp)
mov    0x10(%rsi),%r14
mov    0x18(%rsi),%rbx
lea    0xe7f(%rip),%rsi
mov    %rbx,%rdi
call   1070 <fopen@plt>
mov    %rax,(%rsp)
test   %rax,%rax
je     145d <main+0x2ed>
lea    0xe85(%rip),%rsi
mov    %r14,%rdi
call   1070 <fopen@plt>
test   %rax,%rax
je     147a <main+0x30a>
mov    %rax,%r15
lea    0xe8c(%rip),%rsi
mov    %rax,%rdi
mov    0x8(%rsp),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xe8b(%rip),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xe90(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1090 <fwrite@plt>
lea    0xe8d(%rip),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xe98(%rip),%r14
xor    %ebx,%ebx
mov    %r15,0x18(%rsp)
jmp    126e <main+0xfe>
nopl   0x0(%rax)
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xedb(%rip),%rdi
mov    %r15,%rcx
call   1090 <fwrite@plt>
mov    0x20(%rsp),%rbx
add    %r12,%rbx
cmp    $0x100,%r12
jne    13d0 <main+0x260>
mov    %rbx,0x20(%rsp)
lea    0x60(%rsp),%rdi
mov    $0x1,%esi
mov    $0x100,%edx
mov    (%rsp),%rcx
call   1030 <fread@plt>
mov    %rax,0x10(%rsp)
cmp    $0x10,%rax
mov    %r15,%rax
mov    %r14,%rbx
jb     1372 <main+0x202>
mov    0x10(%rsp),%r15
shr    $0x4,%r15
lea    0x60(%rsp),%rbp
xchg   %ax,%ax
movzbl 0x0(%rbp),%edx
movzbl 0x1(%rbp),%ecx
movzbl 0x2(%rbp),%r8d
movzbl 0x3(%rbp),%r9d
movzbl 0x4(%rbp),%eax
mov    %rax,0x58(%rsp)
movzbl 0x5(%rbp),%eax
mov    %rax,0x50(%rsp)
movzbl 0x6(%rbp),%eax
mov    %rax,0x48(%rsp)
movzbl 0x7(%rbp),%eax
mov    %rax,0x40(%rsp)
movzbl 0x8(%rbp),%eax
mov    %rax,0x38(%rsp)
movzbl 0x9(%rbp),%eax
mov    %rax,0x30(%rsp)
movzbl 0xa(%rbp),%eax
mov    %rax,0x28(%rsp)
movzbl 0xb(%rbp),%r11d
movzbl 0xc(%rbp),%r10d
movzbl 0xd(%rbp),%r14d
movzbl 0xe(%rbp),%r12d
movzbl 0xf(%rbp),%r13d
mov    0x18(%rsp),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
push   %r13
push   %r12
push   %r14
push   %r10
push   %r11
push   0x50(%rsp)
push   0x60(%rsp)
push   0x70(%rsp)
push   0x80(%rsp)
push   0x90(%rsp)
push   0xa0(%rsp)
push   0xb0(%rsp)
call   1060 <fprintf@plt>
mov    0x78(%rsp),%rax
add    $0x60,%rsp
add    $0x10,%rbp
add    $0xffffffffffffffff,%r15
jne    12b0 <main+0x140>
mov    0x10(%rsp),%r12
test   $0xf,%r12b
mov    %rax,%r15
lea    0xdaa(%rip),%rbp
mov    %rbx,%r14
je     1259 <main+0xe9>
mov    $0x22,%edi
mov    %r15,%rsi
call   1050 <fputc@plt>
mov    %r12,%rbx
and    $0xfffffffffffffff0,%rbx
cmp    %r12,%rbx
jae    1240 <main+0xd0>
nopl   0x0(%rax,%rax,1)
movzbl 0x60(%rsp,%rbx,1),%edx
mov    %r15,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    13b0 <main+0x240>
jmp    1240 <main+0xd0>
lea    0xd5f(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1090 <fwrite@plt>
lea    0xd4a(%rip),%rsi
mov    %r15,%rdi
mov    0x8(%rsp),%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xd55(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1090 <fwrite@plt>
mov    (%rsp),%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    0x2b9d(%rip),%rax
mov    (%rax),%eax
add    $0x168,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b92(%rip),%rax
movslq (%rax),%rdi
mov    (%rsi),%rdx
lea    0xba5(%rip),%rsi
jmp    1471 <main+0x301>
mov    0x2b7c(%rip),%rax
movslq (%rax),%rdi
lea    0xbb6(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    149e <main+0x32e>
mov    0x2b5f(%rip),%rax
movslq (%rax),%rdi
lea    0xbba(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rsp),%rdi
call   1040 <fclose@plt>
mov    0x2b33(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"--help\00"
@stderr = global i32 0
@.str.1 = [33 x i8] c"Usage: %s PREFIX OUTFILE INFILE\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [31 x i8] c"Unable to open input file: %s\0A\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [32 x i8] c"Uanble to open output file: %s\0A\00"
@.str.6 = [24 x i8] c"#ifndef %s_data_pack_h\0A\00"
@.str.7 = [25 x i8] c"#define %s_data_pack_h\0A\0A\00"
@.str.8 = [22 x i8] c"#include <stddef.h>\0A\0A\00"
@.str.9 = [31 x i8] c"static const char %s_data[] =\0A\00"
@.str.10 = [100 x i8] c"\22\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\22\0A\00"
@.str.11 = [2 x i8] c"\22\00"
@.str.12 = [7 x i8] c"\\x%02x\00"
@.str.13 = [3 x i8] c"\22\0A\00"
@.str.14 = [4 x i8] c";\0A\0A\00"
@.str.15 = [36 x i8] c"static const size_t %s_size = %lu;\0A\00"
@.str.16 = [9 x i8] c"\0A#endif\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i64
%12 = alloca [256 x i8]
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 4
br i1 %18, label %28, label %19
19: ; preds = %2
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, 2
br i1 %21, label %22, label %38
22: ; preds = %19
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %38
28: ; preds = %22, %2
%29 = load i32, i32* @stderr
%30 = sext i32 %29 to i64
%31 = inttoptr i64 %30 to i32*
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 0
%34 = load i8*, i8** %33
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %34)
%36 = load i32, i32* @EXIT_FAILURE
%37 = call i32 @exit(i32 %36)
unreachable
38: ; preds = %22, %19
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
store i8* %41, i8** %6
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 3
%44 = load i8*, i8** %43
store i8* %44, i8** %7
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 2
%47 = load i8*, i8** %46
store i8* %47, i8** %8
%48 = load i8*, i8** %7
%49 = call i32* @fopen(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %49, i32** %9
%50 = load i32*, i32** %9
%51 = icmp ne i32* %50, null
br i1 %51, label %60, label %52
52: ; preds = %38
%53 = load i32, i32* @stderr
%54 = sext i32 %53 to i64
%55 = inttoptr i64 %54 to i32*
%56 = load i8*, i8** %7
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %55, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* %56)
%58 = load i32, i32* @EXIT_FAILURE
%59 = call i32 @exit(i32 %58)
unreachable
60: ; preds = %38
%61 = load i8*, i8** %8
%62 = call i32* @fopen(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %62, i32** %10
%63 = load i32*, i32** %10
%64 = icmp ne i32* %63, null
br i1 %64, label %75, label %65
65: ; preds = %60
%66 = load i32, i32* @stderr
%67 = sext i32 %66 to i64
%68 = inttoptr i64 %67 to i32*
%69 = load i8*, i8** %8
%70 = call i32 (i32*, i8*, ...) @fprintf(i32* %68, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i8* %69)
%71 = load i32*, i32** %9
%72 = call i32 @fclose(i32* %71)
%73 = load i32, i32* @EXIT_FAILURE
%74 = call i32 @exit(i32 %73)
unreachable
75: ; preds = %60
%76 = load i32*, i32** %10
%77 = load i8*, i8** %6
%78 = call i32 (i32*, i8*, ...) @fprintf(i32* %76, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %77)
%79 = load i32*, i32** %10
%80 = load i8*, i8** %6
%81 = call i32 (i32*, i8*, ...) @fprintf(i32* %79, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* %80)
%82 = load i32*, i32** %10
%83 = call i32 (i32*, i8*, ...) @fprintf(i32* %82, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%84 = load i32*, i32** %10
%85 = load i8*, i8** %6
%86 = call i32 (i32*, i8*, ...) @fprintf(i32* %84, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), i8* %85)
store i64 0, i64* %11
br label %87
87: ; preds = %203, %75
%88 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
store i8* %88, i8** %13
%89 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%90 = load i32*, i32** %9
%91 = call i64 @fread(i8* %89, i32 1, i32 256, i32* %90)
store i64 %91, i64* %14
%92 = load i64, i64* %14
%93 = udiv i64 %92, 16
store i64 %93, i64* %15
%94 = load i64, i64* %14
%95 = load i64, i64* %11
%96 = add i64 %95, %94
store i64 %96, i64* %11
store i64 0, i64* %16
br label %97
97: ; preds = %168, %87
%98 = load i64, i64* %16
%99 = load i64, i64* %15
%100 = icmp ult i64 %98, %99
br i1 %100, label %101, label %173
101: ; preds = %97
%102 = load i32*, i32** %10
%103 = load i8*, i8** %13
%104 = getelementptr inbounds i8, i8* %103, i64 0
%105 = load i8, i8* %104
%106 = zext i8 %105 to i32
%107 = load i8*, i8** %13
%108 = getelementptr inbounds i8, i8* %107, i64 1
%109 = load i8, i8* %108
%110 = zext i8 %109 to i32
%111 = load i8*, i8** %13
%112 = getelementptr inbounds i8, i8* %111, i64 2
%113 = load i8, i8* %112
%114 = zext i8 %113 to i32
%115 = load i8*, i8** %13
%116 = getelementptr inbounds i8, i8* %115, i64 3
%117 = load i8, i8* %116
%118 = zext i8 %117 to i32
%119 = load i8*, i8** %13
%120 = getelementptr inbounds i8, i8* %119, i64 4
%121 = load i8, i8* %120
%122 = zext i8 %121 to i32
%123 = load i8*, i8** %13
%124 = getelementptr inbounds i8, i8* %123, i64 5
%125 = load i8, i8* %124
%126 = zext i8 %125 to i32
%127 = load i8*, i8** %13
%128 = getelementptr inbounds i8, i8* %127, i64 6
%129 = load i8, i8* %128
%130 = zext i8 %129 to i32
%131 = load i8*, i8** %13
%132 = getelementptr inbounds i8, i8* %131, i64 7
%133 = load i8, i8* %132
%134 = zext i8 %133 to i32
%135 = load i8*, i8** %13
%136 = getelementptr inbounds i8, i8* %135, i64 8
%137 = load i8, i8* %136
%138 = zext i8 %137 to i32
%139 = load i8*, i8** %13
%140 = getelementptr inbounds i8, i8* %139, i64 9
%141 = load i8, i8* %140
%142 = zext i8 %141 to i32
%143 = load i8*, i8** %13
%144 = getelementptr inbounds i8, i8* %143, i64 10
%145 = load i8, i8* %144
%146 = zext i8 %145 to i32
%147 = load i8*, i8** %13
%148 = getelementptr inbounds i8, i8* %147, i64 11
%149 = load i8, i8* %148
%150 = zext i8 %149 to i32
%151 = load i8*, i8** %13
%152 = getelementptr inbounds i8, i8* %151, i64 12
%153 = load i8, i8* %152
%154 = zext i8 %153 to i32
%155 = load i8*, i8** %13
%156 = getelementptr inbounds i8, i8* %155, i64 13
%157 = load i8, i8* %156
%158 = zext i8 %157 to i32
%159 = load i8*, i8** %13
%160 = getelementptr inbounds i8, i8* %159, i64 14
%161 = load i8, i8* %160
%162 = zext i8 %161 to i32
%163 = load i8*, i8** %13
%164 = getelementptr inbounds i8, i8* %163, i64 15
%165 = load i8, i8* %164
%166 = zext i8 %165 to i32
%167 = call i32 (i32*, i8*, ...) @fprintf(i32* %102, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.10, i64 0, i64 0), i32 %106, i32 %110, i32 %114, i32 %118, i32 %122, i32 %126, i32 %130, i32 %134, i32 %138, i32 %142, i32 %146, i32 %150, i32 %154, i32 %158, i32 %162, i32 %166)
br label %168
168: ; preds = %101
%169 = load i64, i64* %16
%170 = add i64 %169, 1
store i64 %170, i64* %16
%171 = load i8*, i8** %13
%172 = getelementptr inbounds i8, i8* %171, i64 16
store i8* %172, i8** %13
br label %97
173: ; preds = %97
%174 = load i64, i64* %14
%175 = urem i64 %174, 16
%176 = icmp ne i64 %175, 0
br i1 %176, label %177, label %199
177: ; preds = %173
%178 = load i32*, i32** %10
%179 = call i32 (i32*, i8*, ...) @fprintf(i32* %178, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%180 = load i64, i64* %15
%181 = mul i64 %180, 16
store i64 %181, i64* %16
br label %182
182: ; preds = %193, %177
%183 = load i64, i64* %16
%184 = load i64, i64* %14
%185 = icmp ult i64 %183, %184
br i1 %185, label %186, label %196
186: ; preds = %182
%187 = load i32*, i32** %10
%188 = load i64, i64* %16
%189 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 %188
%190 = load i8, i8* %189
%191 = zext i8 %190 to i32
%192 = call i32 (i32*, i8*, ...) @fprintf(i32* %187, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i32 %191)
br label %193
193: ; preds = %186
%194 = load i64, i64* %16
%195 = add i64 %194, 1
store i64 %195, i64* %16
br label %182
196: ; preds = %182
%197 = load i32*, i32** %10
%198 = call i32 (i32*, i8*, ...) @fprintf(i32* %197, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %199
199: ; preds = %196, %173
%200 = load i64, i64* %14
%201 = icmp ne i64 %200, 256
br i1 %201, label %202, label %203
202: ; preds = %199
br label %204
203: ; preds = %199
br label %87
204: ; preds = %202
%205 = load i32*, i32** %10
%206 = call i32 (i32*, i8*, ...) @fprintf(i32* %205, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%207 = load i32*, i32** %10
%208 = load i8*, i8** %6
%209 = load i64, i64* %11
%210 = call i32 (i32*, i8*, ...) @fprintf(i32* %207, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i64 0, i64 0), i8* %208, i64 %209)
%211 = load i32*, i32** %10
%212 = call i32 (i32*, i8*, ...) @fprintf(i32* %211, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0))
%213 = load i32*, i32** %9
%214 = call i32 @fclose(i32* %213)
%215 = load i32*, i32** %10
%216 = call i32 @fclose(i32* %215)
%217 = load i32, i32* @EXIT_SUCCESS
ret i32 %217
}

LLVM IR (-O2):
@stderr = global i32 0
@.str.1 = [33 x i8] c"Usage: %s PREFIX OUTFILE INFILE\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [31 x i8] c"Unable to open input file: %s\0A\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [32 x i8] c"Uanble to open output file: %s\0A\00"
@.str.6 = [24 x i8] c"#ifndef %s_data_pack_h\0A\00"
@.str.7 = [25 x i8] c"#define %s_data_pack_h\0A\0A\00"
@.str.8 = [22 x i8] c"#include <stddef.h>\0A\0A\00"
@.str.9 = [31 x i8] c"static const char %s_data[] =\0A\00"
@.str.10 = [100 x i8] c"\22\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\\x%02x\22\0A\00"
@.str.12 = [7 x i8] c"\\x%02x\00"
@.str.13 = [3 x i8] c"\22\0A\00"
@.str.14 = [4 x i8] c";\0A\0A\00"
@.str.15 = [36 x i8] c"static const size_t %s_size = %lu;\0A\00"
@.str.16 = [9 x i8] c"\0A#endif\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = icmp eq i32 %0, 4
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load i8*, i8** %1
%10 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = tail call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8*, i8** %1, i64 3
%17 = load i8*, i8** %16
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = tail call i32* @fopen(i8* %17, 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 %29
22: ; preds = %13
%23 = load i32, i32* @stderr
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
%26 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* %17)
%27 = load i32, i32* @EXIT_FAILURE
%28 = tail call i32 @exit(i32 %27)
unreachable
29: ; preds = %13
%30 = tail call i32* @fopen(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %40
32: ; preds = %29
%33 = load i32, i32* @stderr
%34 = sext i32 %33 to i64
%35 = inttoptr i64 %34 to i32*
%36 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %35, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i8* %19)
%37 = tail call i32 @fclose(i32* %20)
%38 = load i32, i32* @EXIT_FAILURE
%39 = tail call i32 @exit(i32 %38)
unreachable
40: ; preds = %29
%41 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %15)
%42 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* %15)
%43 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i64 21, i64 1, i32* %30)
%44 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), i8* %15)
%45 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
br label %46
46: ; preds = %124, %40
%47 = phi i64 [ 0, %40 ], [ %49, %124 ]
%48 = call i64 @fread(i8* %45, i32 1, i32 256, i32* %20)
%49 = add i64 %48, %47
%50 = icmp ult i64 %48, 16
br i1 %50, label %107, label %51
51: ; preds = %46
%52 = lshr i64 %48, 4
br label %53
53: ; preds = %51, %53
%54 = phi i64 [ %104, %53 ], [ 0, %51 ]
%55 = phi i8* [ %105, %53 ], [ %45, %51 ]
%56 = load i8, i8* %55
%57 = zext i8 %56 to i32
%58 = getelementptr inbounds i8, i8* %55, i64 1
%59 = load i8, i8* %58
%60 = zext i8 %59 to i32
%61 = getelementptr inbounds i8, i8* %55, i64 2
%62 = load i8, i8* %61
%63 = zext i8 %62 to i32
%64 = getelementptr inbounds i8, i8* %55, i64 3
%65 = load i8, i8* %64
%66 = zext i8 %65 to i32
%67 = getelementptr inbounds i8, i8* %55, i64 4
%68 = load i8, i8* %67
%69 = zext i8 %68 to i32
%70 = getelementptr inbounds i8, i8* %55, i64 5
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = getelementptr inbounds i8, i8* %55, i64 6
%74 = load i8, i8* %73
%75 = zext i8 %74 to i32
%76 = getelementptr inbounds i8, i8* %55, i64 7
%77 = load i8, i8* %76
%78 = zext i8 %77 to i32
%79 = getelementptr inbounds i8, i8* %55, i64 8
%80 = load i8, i8* %79
%81 = zext i8 %80 to i32
%82 = getelementptr inbounds i8, i8* %55, i64 9
%83 = load i8, i8* %82
%84 = zext i8 %83 to i32
%85 = getelementptr inbounds i8, i8* %55, i64 10
%86 = load i8, i8* %85
%87 = zext i8 %86 to i32
%88 = getelementptr inbounds i8, i8* %55, i64 11
%89 = load i8, i8* %88
%90 = zext i8 %89 to i32
%91 = getelementptr inbounds i8, i8* %55, i64 12
%92 = load i8, i8* %91
%93 = zext i8 %92 to i32
%94 = getelementptr inbounds i8, i8* %55, i64 13
%95 = load i8, i8* %94
%96 = zext i8 %95 to i32
%97 = getelementptr inbounds i8, i8* %55, i64 14
%98 = load i8, i8* %97
%99 = zext i8 %98 to i32
%100 = getelementptr inbounds i8, i8* %55, i64 15
%101 = load i8, i8* %100
%102 = zext i8 %101 to i32
%103 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.10, i64 0, i64 0), i32 %57, i32 %60, i32 %63, i32 %66, i32 %69, i32 %72, i32 %75, i32 %78, i32 %81, i32 %84, i32 %87, i32 %90, i32 %93, i32 %96, i32 %99, i32 %102)
%104 = add nuw nsw i64 %54, 1
%105 = getelementptr inbounds i8, i8* %55, i64 16
%106 = icmp eq i64 %104, %52
br i1 %106, label %107, label %53
107: ; preds = %53, %46
%108 = and i64 %48, 15
%109 = icmp eq i64 %108, 0
br i1 %109, label %124, label %110
110: ; preds = %107
%111 = tail call i32 @fputc(i32 34, i32* %30)
%112 = and i64 %48, -16
%113 = icmp ult i64 %112, %48
br i1 %113, label %114, label %122
114: ; preds = %110, %114
%115 = phi i64 [ %120, %114 ], [ %112, %110 ]
%116 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %115
%117 = load i8, i8* %116
%118 = zext i8 %117 to i32
%119 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i32 %118)
%120 = add i64 %115, 1
%121 = icmp eq i64 %120, %48
br i1 %121, label %122, label %114
122: ; preds = %114, %110
%123 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i64 2, i64 1, i32* %30)
br label %124
124: ; preds = %122, %107
%125 = icmp eq i64 %48, 256
br i1 %125, label %46, label %126
126: ; preds = %124
%127 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i64 3, i64 1, i32* %30)
%128 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i64 0, i64 0), i8* %15, i64 %49)
%129 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i64 8, i64 1, i32* %30)
%130 = tail call i32 @fclose(i32* %20)
%131 = tail call i32 @fclose(i32* %30)
%132 = load i32, i32* @EXIT_SUCCESS
ret i32 %132
}