#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*/ out_filename_h;
typedef int /*<<< orphan*/ in_filename_symbol;
typedef int /*<<< orphan*/ in_filename;
typedef int /*<<< orphan*/ data;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int errno;
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*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ isalnum(char);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ show_usage(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
char *strerror(int);
int /*<<< orphan*/ strncpy(char *, char const *, int);
void *strrchr(char *, char);
int main(int argc, char *argv[]) {
  if (argc < 3) {
    show_usage(argv[0]);
    return EXIT_FAILURE;
  }
  FILE *f_in = fopen(argv[1], "rb");
  if (!f_in) {
    fprintf(stderr, "Error: Could not open input file '%s'. Error %d: %s.\n",
            argv[1], errno, strerror(errno));
    return EXIT_FAILURE;
  }
  char in_filename[1024];
  const char *slash = strrchr(argv[1], '/');
  if (!slash) {
    do {
      strncpy(in_filename, argv[1], sizeof(in_filename));
      in_filename[sizeof(in_filename) - 1] = 0x00;
    } while (0);
  } else {
    do {
      strncpy(in_filename, slash + 1, sizeof(in_filename));
      in_filename[sizeof(in_filename) - 1] = 0x00;
    } while (0);
  }
  char in_filename_symbol[1024];
  do {
    strncpy(in_filename_symbol, in_filename, sizeof(in_filename_symbol));
    in_filename_symbol[sizeof(in_filename_symbol) - 1] = 0x00;
  } while (0);
  char *n;
  for (n = &in_filename_symbol[0]; *n != 0x00; n++) {
    if (!isalnum(*n))
      *n = '_';
  }
  const char *out_filename_c = argv[2];
  char out_filename_h[1024 + 16];
  do {
    strncpy(out_filename_h, out_filename_c, sizeof(out_filename_h));
    out_filename_h[sizeof(out_filename_h) - 1] = 0x00;
  } while (0);
  char *h_extpos = strrchr(out_filename_h, '.');
  const char *h_slashpos = strrchr(out_filename_h, '/');
  if (h_extpos && (!h_slashpos || (h_slashpos < h_extpos))) {
    *h_extpos = 0x00;
  }
  strcat(out_filename_h, ".h");
  printf("Filename: %s\n", out_filename_h);
  FILE *f_out_c = fopen(out_filename_c, "wb");
  if (!f_out_c) {
    fprintf(stderr, "Error: Could not open C output file '%s'. Error %d: %s.\n",
            out_filename_c, errno, strerror(errno));
    fclose(f_in);
    return EXIT_FAILURE;
  }
  FILE *f_out_h = fopen(out_filename_h, "wb");
  if (!f_out_h) {
    fprintf(stderr, "Error: Could not open H output file '%s'. Error %d: %s.\n",
            out_filename_h, errno, strerror(errno));
    fclose(f_in);
    fclose(f_out_c);
    return EXIT_FAILURE;
  }
  fseek(f_in, 0, SEEK_END);
  long in_fsize = ftell(f_in);
  fseek(f_in, 0, SEEK_SET);
  fprintf(f_out_c,
          "/**\n"
          " * This file was generated using the C Binary Object Builder v"
          "0"
          "."
          "1"
          "."
          "0"
          ".\n"
          " * CBOB Source Code File.\n"
          " *\n"
          " * Source file: %s\n"
          " */\n\n",
          in_filename);
  fprintf(f_out_c, "const unsigned char cbob_%s[%ld] =\n{\n",
          in_filename_symbol, in_fsize);
  unsigned char data[16];
  int write_fsize;
  for (write_fsize = in_fsize; write_fsize > 0; write_fsize -= 16) {
    size_t sz = fread(data, sizeof(data[0]), sizeof(data), f_in);
    if (sz == 0)
      break;
    fprintf(f_out_c, "\t");
    unsigned char *dataptr = &data[0];
    for (; sz != 0; sz--) {
      fprintf(f_out_c, "0x%02X", *dataptr++);
      if (sz == 1) {
        if (write_fsize > 16)
          fprintf(f_out_c, ",");
        fprintf(f_out_c, "\n");
      } else {
        fprintf(f_out_c, ", ");
      }
    }
  }
  fprintf(f_out_c, "};\n");
  fclose(f_out_c);
  fclose(f_in);
  fprintf(f_out_h,
          "/**\n"
          " * This file was generated using the C Binary Object Builder v"
          "0"
          "."
          "1"
          "."
          "0"
          ".\n"
          " * CBOB Header File.\n"
          " *\n"
          " * Source file: %s\n"
          " */\n\n",
          in_filename);
  fprintf(f_out_h,
          "#ifdef __cplusplus\n"
          "extern \"C\" {\n"
          "#endif\n\n"
          "extern const unsigned char cbob_%s[%ld];\n\n"
          "#ifdef __cplusplus\n"
          "}\n"
          "#endif\n",
          in_filename_symbol, in_fsize);
  fclose(f_out_h);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xcf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1210 <main+0x40>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10c0 <show_usage@plt>
mov    0x2dba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    17e9 <main+0x619>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde1(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12a6 <main+0xd6>
mov    0x2d9e(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0xcc0(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0xcb8(%rbp)
mov    0x2d76(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xcac(%rbp)
mov    0x2d67(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    -0xcc0(%rbp),%rdi
mov    -0xcb8(%rbp),%rdx
mov    -0xcac(%rbp),%ecx
mov    %rax,%r8
lea    0xd75(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2d24(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    17e9 <main+0x619>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
mov    %rax,-0x428(%rbp)
cmpq   $0x0,-0x428(%rbp)
jne    12f4 <main+0x124>
jmp    12d2 <main+0x102>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0x400,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x21(%rbp)
jmp    131e <main+0x14e>
jmp    12f9 <main+0x129>
lea    -0x420(%rbp),%rdi
mov    -0x428(%rbp),%rsi
add    $0x1,%rsi
mov    $0x400,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x21(%rbp)
jmp    131e <main+0x14e>
jmp    1323 <main+0x153>
lea    -0x830(%rbp),%rdi
lea    -0x420(%rbp),%rsi
mov    $0x400,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x431(%rbp)
lea    -0x830(%rbp),%rax
mov    %rax,-0x838(%rbp)
mov    -0x838(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     13a1 <main+0x1d1>
mov    -0x838(%rbp),%rax
movsbl (%rax),%edi
call   1070 <isalnum@plt>
cmp    $0x0,%eax
jne    1385 <main+0x1b5>
mov    -0x838(%rbp),%rax
movb   $0x5f,(%rax)
jmp    138a <main+0x1ba>
mov    -0x838(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x838(%rbp)
jmp    1350 <main+0x180>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x840(%rbp)
lea    -0xc50(%rbp),%rdi
mov    -0x840(%rbp),%rsi
mov    $0x410,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x841(%rbp)
lea    -0xc50(%rbp),%rdi
mov    $0x2e,%esi
call   1080 <strrchr@plt>
mov    %rax,-0xc58(%rbp)
lea    -0xc50(%rbp),%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
mov    %rax,-0xc60(%rbp)
cmpq   $0x0,-0xc58(%rbp)
je     1439 <main+0x269>
cmpq   $0x0,-0xc60(%rbp)
je     142f <main+0x25f>
mov    -0xc60(%rbp),%rax
cmp    -0xc58(%rbp),%rax
jae    1439 <main+0x269>
mov    -0xc58(%rbp),%rax
movb   $0x0,(%rax)
lea    -0xc50(%rbp),%rdi
lea    0xbf2(%rip),%rsi
call   10e0 <strcat@plt>
lea    -0xc50(%rbp),%rsi
lea    0xbe2(%rip),%rdi
call   1060 <printf@plt>
mov    -0x840(%rbp),%rdi
lea    0xbdd(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0xc68(%rbp)
cmpq   $0x0,-0xc68(%rbp)
jne    1502 <main+0x332>
mov    0x2b4a(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0xcd8(%rbp)
mov    -0x840(%rbp),%rax
mov    %rax,-0xcd0(%rbp)
mov    0x2b23(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xcc4(%rbp)
mov    0x2b14(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    -0xcd8(%rbp),%rdi
mov    -0xcd0(%rbp),%rdx
mov    -0xcc4(%rbp),%ecx
mov    %rax,%r8
lea    0xb6c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    0x2ac8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    17e9 <main+0x619>
lea    -0xc50(%rbp),%rdi
lea    0xb3a(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0xc70(%rbp)
cmpq   $0x0,-0xc70(%rbp)
jne    15b1 <main+0x3e1>
mov    0x2aa7(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0xcf0(%rbp)
lea    -0xc50(%rbp),%rax
mov    %rax,-0xce8(%rbp)
mov    0x2a80(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xcdc(%rbp)
mov    0x2a71(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    -0xcf0(%rbp),%rdi
mov    -0xce8(%rbp),%rdx
mov    -0xcdc(%rbp),%ecx
mov    %rax,%r8
lea    0xb02(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0xc68(%rbp),%rdi
call   1050 <fclose@plt>
mov    0x2a19(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    17e9 <main+0x619>
mov    -0x18(%rbp),%rdi
mov    0x2a2c(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   10a0 <ftell@plt>
mov    %rax,-0xc78(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x29e8(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0xc68(%rbp),%rdi
lea    -0x420(%rbp),%rdx
lea    0xac1(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xc68(%rbp),%rdi
lea    -0x830(%rbp),%rdx
mov    -0xc78(%rbp),%rcx
lea    0xb1d(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xc78(%rbp),%rax
mov    %eax,-0xc94(%rbp)
cmpl   $0x0,-0xc94(%rbp)
jle    1768 <main+0x598>
lea    -0xc90(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x10,%edx
call   1040 <fread@plt>
mov    %rax,-0xca0(%rbp)
cmpq   $0x0,-0xca0(%rbp)
jne    1676 <main+0x4a6>
jmp    1768 <main+0x598>
mov    -0xc68(%rbp),%rdi
lea    0xae0(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
lea    -0xc90(%rbp),%rax
mov    %rax,-0xca8(%rbp)
cmpq   $0x0,-0xca0(%rbp)
je     174f <main+0x57f>
mov    -0xc68(%rbp),%rdi
mov    -0xca8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xca8(%rbp)
movzbl (%rax),%edx
lea    0xa99(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
cmpq   $0x1,-0xca0(%rbp)
01
jne    171e <main+0x54e>
cmpl   $0x10,-0xc94(%rbp)
jle    1704 <main+0x534>
mov    -0xc68(%rbp),%rdi
lea    0xa70(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xc68(%rbp),%rdi
lea    0xa2a(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1733 <main+0x563>
mov    -0xc68(%rbp),%rdi
lea    0xa43(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1738 <main+0x568>
mov    -0xca0(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0xca0(%rbp)
jmp    1699 <main+0x4c9>
jmp    1754 <main+0x584>
mov    -0xc94(%rbp),%eax
sub    $0x10,%eax
mov    %eax,-0xc94(%rbp)
jmp    1635 <main+0x465>
mov    -0xc68(%rbp),%rdi
lea    0x9fc(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xc68(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0xc70(%rbp),%rdi
lea    -0x420(%rbp),%rdx
lea    0x9cf(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xc70(%rbp),%rdi
lea    -0x830(%rbp),%rdx
mov    -0xc78(%rbp),%rcx
lea    0xa26(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xc70(%rbp),%rdi
call   1050 <fclose@plt>
mov    0x27d4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xcf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc48,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jg     121d <main+0x2d>
mov    (%rbx),%rdi
call   10d0 <show_usage@plt>
mov    0x2da8(%rip),%rax
jmp    1633 <main+0x443>
mov    0x8(%rbx),%rdi
lea    0xdd8(%rip),%rsi
call   10e0 <fopen@plt>
test   %rax,%rax
je     125c <main+0x6c>
mov    %rax,%r14
mov    0x8(%rbx),%rbp
mov    %rbp,%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
test   %rax,%rax
je     129f <main+0xaf>
add    $0x1,%rax
lea    0x430(%rsp),%rdi
mov    %rax,%rsi
jmp    12aa <main+0xba>
mov    0x2d75(%rip),%rax
movslq (%rax),%rbp
mov    0x8(%rbx),%r14
mov    0x2d5f(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1110 <strerror@plt>
lea    0xd82(%rip),%rsi
mov    %rbp,%rdi
mov    %r14,%rdx
mov    %ebx,%ecx
mov    %rax,%r8
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x2d26(%rip),%rax
jmp    1633 <main+0x443>
lea    0x430(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x400,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x82f(%rsp)
lea    0x30(%rsp),%rdi
lea    0x430(%rsp),%rsi
mov    $0x400,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x42f(%rsp)
mov    0x30(%rsp),%al
test   %al,%al
je     130e <main+0x11e>
lea    0x31(%rsp),%rbp
jmp    12fc <main+0x10c>
nopw   0x0(%rax,%rax,1)
movzbl 0x0(%rbp),%eax
add    $0x1,%rbp
test   %al,%al
je     130e <main+0x11e>
movsbl %al,%edi
call   1070 <isalnum@plt>
test   %eax,%eax
jne    12f0 <main+0x100>
movb   $0x5f,-0x1(%rbp)
jmp    12f0 <main+0x100>
mov    0x10(%rbx),%r15
lea    0x830(%rsp),%rbp
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x410,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xc3f(%rsp)
mov    %rbp,%rdi
mov    $0x2e,%esi
call   1080 <strrchr@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
test   %rbx,%rbx
je     1361 <main+0x171>
test   %rax,%rax
je     135e <main+0x16e>
cmp    %rbx,%rax
jae    1361 <main+0x171>
movb   $0x0,(%rbx)
lea    0xcd1(%rip),%rsi
lea    0x830(%rsp),%rbx
mov    %rbx,%rdi
call   10f0 <strcat@plt>
lea    0xcbd(%rip),%rdi
mov    %rbx,%rsi
call   1060 <printf@plt>
lea    0xcbc(%rip),%rsi
mov    %r15,%rdi
call   10e0 <fopen@plt>
test   %rax,%rax
je     1524 <main+0x334>
mov    %rax,%rbx
lea    0xca1(%rip),%rsi
lea    0x830(%rsp),%rdi
call   10e0 <fopen@plt>
test   %rax,%rax
je     155c <main+0x36c>
mov    %rax,0x28(%rsp)
mov    0x2c1d(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    %r14,%rdi
call   10b0 <ftell@plt>
mov    %rax,%rbp
mov    0x2bdf(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
lea    0xcc3(%rip),%rsi
lea    0x430(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <fprintf@plt>
lea    0xd29(%rip),%rsi
lea    0x30(%rsp),%rdx
mov    %rbx,%rdi
mov    %rbp,%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %rbp,0x20(%rsp)
test   %ebp,%ebp
jle    15c2 <main+0x3d2>
lea    0x10(%rsp),%rdi
mov    $0x1,%esi
mov    $0x10,%edx
mov    %r14,%rcx
call   1040 <fread@plt>
test   %rax,%rax
je     15c2 <main+0x3d2>
mov    %rax,%r15
lea    0xd06(%rip),%r13
lea    0xd06(%rip),%r12
mov    %r14,0x8(%rsp)
nopw   0x0(%rax,%rax,1)
mov    $0x9,%edi
mov    %rbx,%rsi
call   1090 <fputc@plt>
movzbl 0x10(%rsp),%edx
mov    %rbx,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
cmp    $0x1,%r15
je     14d1 <main+0x2e1>
mov    $0x1,%r14d
nopl   0x0(%rax,%rax,1)
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rdi
mov    %rbx,%rcx
call   1100 <fwrite@plt>
movzbl 0x10(%rsp,%r14,1),%edx
mov    %rbx,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
add    $0x1,%r14
cmp    %r14,%r15
jne    14a0 <main+0x2b0>
cmp    $0x10,%ebp
jbe    15b0 <main+0x3c0>
mov    $0x2c,%edi
mov    %rbx,%rsi
call   1090 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1090 <fputc@plt>
add    $0xfffffff0,%ebp
lea    0x10(%rsp),%rdi
mov    $0x1,%esi
mov    $0x10,%edx
mov    0x8(%rsp),%r14
mov    %r14,%rcx
call   1040 <fread@plt>
mov    %rax,%r15
test   %rax,%rax
jne    1470 <main+0x280>
jmp    15c2 <main+0x3d2>
mov    0x2aad(%rip),%rax
movslq (%rax),%rbx
mov    0x2a9b(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1110 <strerror@plt>
lea    0xb08(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %ebp,%ecx
mov    %rax,%r8
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %r14,%rdi
jmp    159f <main+0x3af>
mov    0x2a75(%rip),%rax
movslq (%rax),%r15
mov    0x2a63(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1110 <strerror@plt>
lea    0xb09(%rip),%rsi
lea    0x830(%rsp),%rdx
mov    %r15,%rdi
mov    %ebp,%ecx
mov    %rax,%r8
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    0x2a15(%rip),%rax
jmp    1633 <main+0x443>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1090 <fputc@plt>
mov    0x8(%rsp),%r14
lea    0xba5(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1100 <fwrite@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
lea    0xb80(%rip),%rsi
lea    0x430(%rsp),%rdx
mov    0x28(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <fprintf@plt>
lea    0xbdc(%rip),%rsi
lea    0x30(%rsp),%rdx
mov    %rbx,%rdi
mov    0x20(%rsp),%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    0x2985(%rip),%rax
mov    (%rax),%eax
add    $0xc48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [3 x i8] c"rb\00"
@stderr = global i32 0
@.str.1 = [54 x i8] c"Error: Could not open input file '%s'. Error %d: %s.\0A\00"
@errno = global i32 0
@.str.2 = [3 x i8] c".h\00"
@.str.3 = [14 x i8] c"Filename: %s\0A\00"
@.str.4 = [3 x i8] c"wb\00"
@.str.5 = [57 x i8] c"Error: Could not open C output file '%s'. Error %d: %s.\0A\00"
@.str.6 = [57 x i8] c"Error: Could not open H output file '%s'. Error %d: %s.\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.7 = [127 x i8] c"/**\0A * This file was generated using the C Binary Object Builder v0.1.0.\0A * CBOB Source Code File.\0A *\0A * Source file: %s\0A */\0A\0A\00"
@.str.8 = [38 x i8] c"const unsigned char cbob_%s[%ld] =\0A{\0A\00"
@.str.9 = [2 x i8] c"\09\00"
@.str.10 = [7 x i8] c"0x%02X\00"
@.str.11 = [2 x i8] c",\00"
@.str.12 = [2 x i8] c"\0A\00"
@.str.13 = [3 x i8] c", \00"
@.str.14 = [4 x i8] c"};\0A\00"
@.str.15 = [122 x i8] c"/**\0A * This file was generated using the C Binary Object Builder v0.1.0.\0A * CBOB Header File.\0A *\0A * Source file: %s\0A */\0A\0A\00"
@.str.16 = [111 x i8] c"#ifdef __cplusplus\0Aextern \22C\22 {\0A#endif\0A\0Aextern const unsigned char cbob_%s[%ld];\0A\0A#ifdef __cplusplus\0A}\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 i32*
%7 = alloca [1024 x i8]
%8 = alloca i8*
%9 = alloca [1024 x i8]
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca [1040 x i8]
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i64
%18 = alloca [16 x i8]
%19 = alloca i32
%20 = alloca i64
%21 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%22 = load i32, i32* %4
%23 = icmp slt i32 %22, 3
br i1 %23, label %24, label %30
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 0
%27 = load i8*, i8** %26
%28 = call i32 @show_usage(i8* %27)
%29 = load i32, i32* @EXIT_FAILURE
store i32 %29, i32* %3
br label %243
30: ; preds = %2
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call i32* @fopen(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %34, i32** %6
%35 = load i32*, i32** %6
%36 = icmp ne i32* %35, null
br i1 %36, label %49, label %37
37: ; preds = %30
%38 = load i32, i32* @stderr
%39 = sext i32 %38 to i64
%40 = inttoptr i64 %39 to i32*
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 1
%43 = load i8*, i8** %42
%44 = load i32, i32* @errno
%45 = load i32, i32* @errno
%46 = call i8* @strerror(i32 %45)
%47 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i8* %43, i32 %44, i8* %46)
%48 = load i32, i32* @EXIT_FAILURE
store i32 %48, i32* %3
br label %243
49: ; preds = %30
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 1
%52 = load i8*, i8** %51
%53 = call i8* @strrchr(i8* %52, i8 signext 47)
store i8* %53, i8** %8
%54 = load i8*, i8** %8
%55 = icmp ne i8* %54, null
br i1 %55, label %65, label %56
56: ; preds = %49
br label %57
57: ; preds = %56
%58 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 1
%61 = load i8*, i8** %60
%62 = call i32 @strncpy(i8* %58, i8* %61, i32 1024)
%63 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 1023
store i8 0, i8* %63
br label %64
64: ; preds = %57
br label %73
65: ; preds = %49
br label %66
66: ; preds = %65
%67 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%68 = load i8*, i8** %8
%69 = getelementptr inbounds i8, i8* %68, i64 1
%70 = call i32 @strncpy(i8* %67, i8* %69, i32 1024)
%71 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 1023
store i8 0, i8* %71
br label %72
72: ; preds = %66
br label %73
73: ; preds = %72, %64
br label %74
74: ; preds = %73
%75 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%76 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%77 = call i32 @strncpy(i8* %75, i8* %76, i32 1024)
%78 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 1023
store i8 0, i8* %78
br label %79
79: ; preds = %74
%80 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
store i8* %80, i8** %10
br label %81
81: ; preds = %94, %79
%82 = load i8*, i8** %10
%83 = load i8, i8* %82
%84 = sext i8 %83 to i32
%85 = icmp ne i32 %84, 0
br i1 %85, label %86, label %97
86: ; preds = %81
%87 = load i8*, i8** %10
%88 = load i8, i8* %87
%89 = call i32 @isalnum(i8 signext %88)
%90 = icmp ne i32 %89, 0
br i1 %90, label %93, label %91
91: ; preds = %86
%92 = load i8*, i8** %10
store i8 95, i8* %92
br label %93
93: ; preds = %91, %86
br label %94
94: ; preds = %93
%95 = load i8*, i8** %10
%96 = getelementptr inbounds i8, i8* %95, i32 1
store i8* %96, i8** %10
br label %81
97: ; preds = %81
%98 = load i8**, i8*** %5
%99 = getelementptr inbounds i8*, i8** %98, i64 2
%100 = load i8*, i8** %99
store i8* %100, i8** %11
br label %101
101: ; preds = %97
%102 = getelementptr inbounds [1040 x i8], [1040 x i8]* %12, i64 0, i64 0
%103 = load i8*, i8** %11
%104 = call i32 @strncpy(i8* %102, i8* %103, i32 1040)
%105 = getelementptr inbounds [1040 x i8], [1040 x i8]* %12, i64 0, i64 1039
store i8 0, i8* %105
br label %106
106: ; preds = %101
%107 = getelementptr inbounds [1040 x i8], [1040 x i8]* %12, i64 0, i64 0
%108 = call i8* @strrchr(i8* %107, i8 signext 46)
store i8* %108, i8** %13
%109 = getelementptr inbounds [1040 x i8], [1040 x i8]* %12, i64 0, i64 0
%110 = call i8* @strrchr(i8* %109, i8 signext 47)
store i8* %110, i8** %14
%111 = load i8*, i8** %13
%112 = icmp ne i8* %111, null
br i1 %112, label %113, label %122
113: ; preds = %106
%114 = load i8*, i8** %14
%115 = icmp ne i8* %114, null
br i1 %115, label %116, label %120
116: ; preds = %113
%117 = load i8*, i8** %14
%118 = load i8*, i8** %13
%119 = icmp ult i8* %117, %118
br i1 %119, label %120, label %122
120: ; preds = %116, %113
%121 = load i8*, i8** %13
store i8 0, i8* %121
br label %122
122: ; preds = %120, %116, %106
%123 = getelementptr inbounds [1040 x i8], [1040 x i8]* %12, i64 0, i64 0
%124 = call i32 @strcat(i8* %123, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%125 = getelementptr inbounds [1040 x i8], [1040 x i8]* %12, i64 0, i64 0
%126 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %125)
%127 = load i8*, i8** %11
%128 = call i32* @fopen(i8* %127, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %128, i32** %15
%129 = load i32*, i32** %15
%130 = icmp ne i32* %129, null
br i1 %130, label %143, label %131
131: ; preds = %122
%132 = load i32, i32* @stderr
%133 = sext i32 %132 to i64
%134 = inttoptr i64 %133 to i32*
%135 = load i8*, i8** %11
%136 = load i32, i32* @errno
%137 = load i32, i32* @errno
%138 = call i8* @strerror(i32 %137)
%139 = call i32 (i32*, i8*, ...) @fprintf(i32* %134, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0), i8* %135, i32 %136, i8* %138)
%140 = load i32*, i32** %6
%141 = call i32 @fclose(i32* %140)
%142 = load i32, i32* @EXIT_FAILURE
store i32 %142, i32* %3
br label %243
143: ; preds = %122
%144 = getelementptr inbounds [1040 x i8], [1040 x i8]* %12, i64 0, i64 0
%145 = call i32* @fopen(i8* %144, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %145, i32** %16
%146 = load i32*, i32** %16
%147 = icmp ne i32* %146, null
br i1 %147, label %162, label %148
148: ; preds = %143
%149 = load i32, i32* @stderr
%150 = sext i32 %149 to i64
%151 = inttoptr i64 %150 to i32*
%152 = getelementptr inbounds [1040 x i8], [1040 x i8]* %12, i64 0, i64 0
%153 = load i32, i32* @errno
%154 = load i32, i32* @errno
%155 = call i8* @strerror(i32 %154)
%156 = call i32 (i32*, i8*, ...) @fprintf(i32* %151, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0), i8* %152, i32 %153, i8* %155)
%157 = load i32*, i32** %6
%158 = call i32 @fclose(i32* %157)
%159 = load i32*, i32** %15
%160 = call i32 @fclose(i32* %159)
%161 = load i32, i32* @EXIT_FAILURE
store i32 %161, i32* %3
br label %243
162: ; preds = %143
%163 = load i32*, i32** %6
%164 = load i32, i32* @SEEK_END
%165 = call i32 @fseek(i32* %163, i32 0, i32 %164)
%166 = load i32*, i32** %6
%167 = call i64 @ftell(i32* %166)
store i64 %167, i64* %17
%168 = load i32*, i32** %6
%169 = load i32, i32* @SEEK_SET
%170 = call i32 @fseek(i32* %168, i32 0, i32 %169)
%171 = load i32*, i32** %15
%172 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%173 = call i32 (i32*, i8*, ...) @fprintf(i32* %171, i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.7, i64 0, i64 0), i8* %172)
%174 = load i32*, i32** %15
%175 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%176 = load i64, i64* %17
%177 = call i32 (i32*, i8*, ...) @fprintf(i32* %174, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0), i8* %175, i64 %176)
%178 = load i64, i64* %17
%179 = trunc i64 %178 to i32
store i32 %179, i32* %19
br label %180
180: ; preds = %223, %162
%181 = load i32, i32* %19
%182 = icmp sgt i32 %181, 0
br i1 %182, label %183, label %226
183: ; preds = %180
%184 = getelementptr inbounds [16 x i8], [16 x i8]* %18, i64 0, i64 0
%185 = load i32*, i32** %6
%186 = call i64 @fread(i8* %184, i32 1, i32 16, i32* %185)
store i64 %186, i64* %20
%187 = load i64, i64* %20
%188 = icmp eq i64 %187, 0
br i1 %188, label %189, label %190
189: ; preds = %183
br label %226
190: ; preds = %183
%191 = load i32*, i32** %15
%192 = call i32 (i32*, i8*, ...) @fprintf(i32* %191, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%193 = getelementptr inbounds [16 x i8], [16 x i8]* %18, i64 0, i64 0
store i8* %193, i8** %21
br label %194
194: ; preds = %219, %190
%195 = load i64, i64* %20
%196 = icmp ne i64 %195, 0
br i1 %196, label %197, label %222
197: ; preds = %194
%198 = load i32*, i32** %15
%199 = load i8*, i8** %21
%200 = getelementptr inbounds i8, i8* %199, i32 1
store i8* %200, i8** %21
%201 = load i8, i8* %199
%202 = zext i8 %201 to i32
%203 = call i32 (i32*, i8*, ...) @fprintf(i32* %198, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i32 %202)
%204 = load i64, i64* %20
%205 = icmp eq i64 %204, 1
br i1 %205, label %206, label %215
206: ; preds = %197
%207 = load i32, i32* %19
%208 = icmp sgt i32 %207, 16
br i1 %208, label %209, label %212
209: ; preds = %206
%210 = load i32*, i32** %15
%211 = call i32 (i32*, i8*, ...) @fprintf(i32* %210, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %212
212: ; preds = %209, %206
%213 = load i32*, i32** %15
%214 = call i32 (i32*, i8*, ...) @fprintf(i32* %213, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %218
215: ; preds = %197
%216 = load i32*, i32** %15
%217 = call i32 (i32*, i8*, ...) @fprintf(i32* %216, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %218
218: ; preds = %215, %212
br label %219
219: ; preds = %218
%220 = load i64, i64* %20
%221 = add i64 %220, -1
store i64 %221, i64* %20
br label %194
222: ; preds = %194
br label %223
223: ; preds = %222
%224 = load i32, i32* %19
%225 = sub nsw i32 %224, 16
store i32 %225, i32* %19
br label %180
226: ; preds = %189, %180
%227 = load i32*, i32** %15
%228 = call i32 (i32*, i8*, ...) @fprintf(i32* %227, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%229 = load i32*, i32** %15
%230 = call i32 @fclose(i32* %229)
%231 = load i32*, i32** %6
%232 = call i32 @fclose(i32* %231)
%233 = load i32*, i32** %16
%234 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%235 = call i32 (i32*, i8*, ...) @fprintf(i32* %233, i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str.15, i64 0, i64 0), i8* %234)
%236 = load i32*, i32** %16
%237 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%238 = load i64, i64* %17
%239 = call i32 (i32*, i8*, ...) @fprintf(i32* %236, i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str.16, i64 0, i64 0), i8* %237, i64 %238)
%240 = load i32*, i32** %16
%241 = call i32 @fclose(i32* %240)
%242 = load i32, i32* @EXIT_SUCCESS
store i32 %242, i32* %3
br label %243
243: ; preds = %226, %148, %131, %37, %24
%244 = load i32, i32* %3
ret i32 %244
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [3 x i8] c"rb\00"
@stderr = global i32 0
@.str.1 = [54 x i8] c"Error: Could not open input file '%s'. Error %d: %s.\0A\00"
@errno = global i32 0
@.str.2 = [3 x i8] c".h\00"
@.str.3 = [14 x i8] c"Filename: %s\0A\00"
@.str.4 = [3 x i8] c"wb\00"
@.str.5 = [57 x i8] c"Error: Could not open C output file '%s'. Error %d: %s.\0A\00"
@.str.6 = [57 x i8] c"Error: Could not open H output file '%s'. Error %d: %s.\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.7 = [127 x i8] c"/**\0A * This file was generated using the C Binary Object Builder v0.1.0.\0A * CBOB Source Code File.\0A *\0A * Source file: %s\0A */\0A\0A\00"
@.str.8 = [38 x i8] c"const unsigned char cbob_%s[%ld] =\0A{\0A\00"
@.str.10 = [7 x i8] c"0x%02X\00"
@.str.13 = [3 x i8] c", \00"
@.str.14 = [4 x i8] c"};\0A\00"
@.str.15 = [122 x i8] c"/**\0A * This file was generated using the C Binary Object Builder v0.1.0.\0A * CBOB Header File.\0A *\0A * Source file: %s\0A */\0A\0A\00"
@.str.16 = [111 x i8] c"#ifdef __cplusplus\0Aextern \22C\22 {\0A#endif\0A\0Aextern const unsigned char cbob_%s[%ld];\0A\0A#ifdef __cplusplus\0A}\0A#endif\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = alloca [1040 x i8]
%6 = alloca [16 x i8]
%7 = icmp slt i32 %0, 3
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 @show_usage(i8* %9)
%11 = load i32, i32* @EXIT_FAILURE
br label %146
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call i32* @fopen(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %26
17: ; preds = %12
%18 = load i32, i32* @stderr
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
%21 = load i8*, i8** %13
%22 = load i32, i32* @errno
%23 = tail call i8* @strerror(i32 %22)
%24 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i8* %21, i32 %22, i8* %23)
%25 = load i32, i32* @EXIT_FAILURE
br label %146
26: ; preds = %12
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%28 = load i8*, i8** %13
%29 = tail call i8* @strrchr(i8* dereferenceable(1) %28, i8 signext 47)
%30 = icmp eq i8* %29, null
br i1 %30, label %31, label %33
31: ; preds = %26
%32 = call i32 @strncpy(i8* %27, i8* %28, i32 1024)
br label %36
33: ; preds = %26
%34 = getelementptr inbounds i8, i8* %29, i64 1
%35 = call i32 @strncpy(i8* %27, i8* %34, i32 1024)
br label %36
36: ; preds = %33, %31
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 1023
store i8 0, i8* %37
%38 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%39 = call i32 @strncpy(i8* %38, i8* %27, i32 1024)
%40 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 1023
store i8 0, i8* %40
%41 = load i8, i8* %38
%42 = icmp eq i8 %41, 0
br i1 %42, label %53, label %43
43: ; preds = %36, %49
%44 = phi i8 [ %51, %49 ], [ %41, %36 ]
%45 = phi i8* [ %50, %49 ], [ %38, %36 ]
%46 = call i32 @isalnum(i8 signext %44)
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %49
48: ; preds = %43
store i8 95, i8* %45
br label %49
49: ; preds = %43, %48
%50 = getelementptr inbounds i8, i8* %45, i64 1
%51 = load i8, i8* %50
%52 = icmp eq i8 %51, 0
br i1 %52, label %53, label %43
53: ; preds = %49, %36
%54 = getelementptr inbounds i8*, i8** %1, i64 2
%55 = load i8*, i8** %54
%56 = getelementptr inbounds [1040 x i8], [1040 x i8]* %5, i64 0, i64 0
%57 = call i32 @strncpy(i8* %56, i8* %55, i32 1040)
%58 = getelementptr inbounds [1040 x i8], [1040 x i8]* %5, i64 0, i64 1039
store i8 0, i8* %58
%59 = call i8* @strrchr(i8* %56, i8 signext 46)
%60 = call i8* @strrchr(i8* %56, i8 signext 47)
%61 = icmp eq i8* %59, null
br i1 %61, label %67, label %62
62: ; preds = %53
%63 = icmp eq i8* %60, null
%64 = icmp ult i8* %60, %59
%65 = select i1 %63, i1 true, i1 %64
br i1 %65, label %66, label %67
66: ; preds = %62
store i8 0, i8* %59
br label %67
67: ; preds = %62, %66, %53
%68 = call i32 @strcat(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%69 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %56)
%70 = call i32* @fopen(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%71 = icmp eq i32* %70, null
br i1 %71, label %72, label %81
72: ; preds = %67
%73 = load i32, i32* @stderr
%74 = sext i32 %73 to i64
%75 = inttoptr i64 %74 to i32*
%76 = load i32, i32* @errno
%77 = call i8* @strerror(i32 %76)
%78 = call i32 (i32*, i8*, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0), i8* %55, i32 %76, i8* %77)
%79 = call i32 @fclose(i32* %15)
%80 = load i32, i32* @EXIT_FAILURE
br label %144
81: ; preds = %67
%82 = call i32* @fopen(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%83 = icmp eq i32* %82, null
br i1 %83, label %84, label %94
84: ; preds = %81
%85 = load i32, i32* @stderr
%86 = sext i32 %85 to i64
%87 = inttoptr i64 %86 to i32*
%88 = load i32, i32* @errno
%89 = call i8* @strerror(i32 %88)
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %87, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0), i8* %56, i32 %88, i8* %89)
%91 = call i32 @fclose(i32* %15)
%92 = call i32 @fclose(i32* %70)
%93 = load i32, i32* @EXIT_FAILURE
br label %144
94: ; preds = %81
%95 = load i32, i32* @SEEK_END
%96 = call i32 @fseek(i32* %15, i32 0, i32 %95)
%97 = call i64 @ftell(i32* %15)
%98 = load i32, i32* @SEEK_SET
%99 = call i32 @fseek(i32* %15, i32 0, i32 %98)
%100 = call i32 (i32*, i8*, ...) @fprintf(i32* %70, i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.7, i64 0, i64 0), i8* %27)
%101 = call i32 (i32*, i8*, ...) @fprintf(i32* %70, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0), i8* %38, i64 %97)
%102 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%103 = trunc i64 %97 to i32
%104 = icmp sgt i32 %103, 0
br i1 %104, label %105, label %136
105: ; preds = %94
%106 = call i64 @fread(i8* %102, i32 1, i32 16, i32* %15)
%107 = icmp eq i64 %106, 0
br i1 %107, label %136, label %108
108: ; preds = %105, %130
%109 = phi i64 [ %134, %130 ], [ %106, %105 ]
%110 = phi i32 [ %133, %130 ], [ %103, %105 ]
%111 = call i32 @fputc(i32 9, i32* %70)
%112 = icmp ugt i32 %110, 16
%113 = load i8, i8* %102
%114 = zext i8 %113 to i32
%115 = call i32 (i32*, i8*, ...) @fprintf(i32* %70, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i32 %114)
%116 = icmp eq i64 %109, 1
br i1 %116, label %117, label %120
117: ; preds = %120, %108
br i1 %112, label %130, label %118
118: ; preds = %117
%119 = call i32 @fputc(i32 10, i32* %70)
br label %136
120: ; preds = %108, %120
%121 = phi i64 [ %125, %120 ], [ %109, %108 ]
%122 = phi i8* [ %123, %120 ], [ %102, %108 ]
%123 = getelementptr inbounds i8, i8* %122, i64 1
%124 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i64 2, i64 1, i32* %70)
%125 = add i64 %121, -1
%126 = load i8, i8* %123
%127 = zext i8 %126 to i32
%128 = call i32 (i32*, i8*, ...) @fprintf(i32* %70, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i32 %127)
%129 = icmp eq i64 %125, 1
br i1 %129, label %117, label %120
130: ; preds = %117
%131 = call i32 @fputc(i32 44, i32* %70)
%132 = call i32 @fputc(i32 10, i32* %70)
%133 = add nsw i32 %110, -16
%134 = call i64 @fread(i8* %102, i32 1, i32 16, i32* %15)
%135 = icmp eq i64 %134, 0
br i1 %135, label %136, label %108
136: ; preds = %130, %105, %118, %94
%137 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i64 3, i64 1, i32* %70)
%138 = call i32 @fclose(i32* %70)
%139 = call i32 @fclose(i32* %15)
%140 = call i32 (i32*, i8*, ...) @fprintf(i32* %82, i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str.15, i64 0, i64 0), i8* %27)
%141 = call i32 (i32*, i8*, ...) @fprintf(i32* %82, i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str.16, i64 0, i64 0), i8* %38, i64 %97)
%142 = call i32 @fclose(i32* %82)
%143 = load i32, i32* @EXIT_SUCCESS
br label %144
144: ; preds = %84, %136, %72
%145 = phi i32 [ %80, %72 ], [ %143, %136 ], [ %93, %84 ]
br label %146
146: ; preds = %17, %144, %8
%147 = phi i32 [ %11, %8 ], [ %145, %144 ], [ %25, %17 ]
ret i32 %147
}