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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
char *getFileExtension(char *);
char *getFilename(char *);
int /*<<< orphan*/ memset(unsigned char *, int, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ removeExtension(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strdup(char *);
int strlen(char *);
int strtoimax(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
char toupper(char);
int main(int argc, char **argv) {
  int ii, jj;
  int len;
  int total;
  int align;
  int formatint;
  int formatintasm;
  int nullfill;
  char *format;
  char *formatasm;
  char *shortname;
  char *ext;
  char *FileName;
  char *FileNameOut;
  FILE *FileInput;
  FILE *FileOutput;
  char path[4096];
  unsigned char temp[4096];
  FileName = "";
  FileNameOut = "";
  format = "u8";
  formatint = 1;
  formatasm = "w";
  formatintasm = 2;
  total = 0;
  align = 2;
  nullfill = 0;
  for (ii = 1; ii < argc; ii++) {
    if (!strcmp(argv[ii], "-u8")) {
      format = "u8";
      formatint = 1;
      formatasm = "w";
      formatintasm = 2;
    } else if (!strcmp(argv[ii], "-s8")) {
      format = "s8";
      formatint = 1;
      formatasm = "w";
      formatintasm = 2;
    } else if (!strcmp(argv[ii], "-u16")) {
      format = "u16";
      formatint = 2;
      formatasm = "w";
      formatintasm = 2;
    } else if (!strcmp(argv[ii], "-s16")) {
      format = "s16";
      formatint = 2;
      formatasm = "w";
      formatintasm = 2;
    } else if (!strcmp(argv[ii], "-u32")) {
      format = "u32";
      formatint = 4;
      formatasm = "l";
      formatintasm = 4;
    } else if (!strcmp(argv[ii], "-s32")) {
      format = "s32";
      formatint = 4;
      formatasm = "l";
      formatintasm = 4;
    } else if (!strcmp(argv[ii], "-align")) {
      ii++;
      align = strtoimax(argv[ii], NULL, 0);
      if (!align)
        align = 2;
    } else if (!strcmp(argv[ii], "-nullfill")) {
      ii++;
      nullfill = strtoimax(argv[ii], NULL, 0);
    } else if (!FileName[0])
      FileName = argv[ii];
    else if (!FileNameOut[0])
      FileNameOut = argv[ii];
  }
  if (!FileNameOut[0])
    FileNameOut = strdup(FileName);
  ext = getFileExtension(FileName);
  FileInput = fopen(FileName, "rb");
  if (!FileInput) {
    printf("Couldn't open input file %s\n", FileName);
    return 1;
  }
  removeExtension(FileNameOut);
  shortname = getFilename(FileNameOut);
  strcpy(path, FileNameOut);
  strcat(path, ".s");
  FileOutput = fopen(path, "w");
  if (!FileOutput) {
    fclose(FileInput);
    printf("Couldn't open output file %s\n", path);
    return 1;
  }
  if (align < 2)
    align = 2;
  fprintf(FileOutput, ".text\n\n");
  fprintf(FileOutput, "    .align  %d\n\n", align);
  fprintf(FileOutput, "    .global %s\n", shortname);
  fprintf(FileOutput, "%s:\n", shortname);
  while (1) {
    memset(temp, nullfill, sizeof(temp));
    len = fread(temp, 1, sizeof(temp), FileInput);
    total += len;
    len = (len + (formatintasm - 1)) & ~(formatintasm - 1);
    if (len) {
      fprintf(FileOutput, "    dc.%s    ", formatasm);
      for (ii = 0; ii < (len / formatintasm); ii++) {
        if (ii)
          fprintf(FileOutput, ",");
        fprintf(FileOutput, "0x");
        for (jj = 0; jj < formatintasm; jj++)
          fprintf(FileOutput, "%02X", temp[(ii * formatintasm) + jj]);
      }
      fprintf(FileOutput, "\n");
    }
    if (len < 16)
      break;
  }
  fprintf(FileOutput, "\n");
  fclose(FileOutput);
  fclose(FileInput);
  strcpy(path, FileNameOut);
  strcat(path, ".h");
  FileOutput = fopen(path, "w");
  if (!FileOutput) {
    printf("Couldn't open output file %s\n", path);
    return 1;
  }
  for (ii = 0; ii < strlen(shortname); ii++)
    path[ii] = toupper(shortname[ii]);
  path[ii] = 0;
  fprintf(FileOutput, "#ifndef _%s_H_\n", path);
  fprintf(FileOutput, "#define _%s_H_\n\n", path);
  fprintf(FileOutput, "extern const %s %s[0x%X];\n\n", format, shortname,
          total / formatint);
  fprintf(FileOutput, "#endif // _%s_H_\n", path);
  fclose(FileOutput);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2080,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed5(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xdcd(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x1,-0x28(%rbp)
lea    0xdb8(%rip),%rax
mov    %rax,-0x40(%rbp)
movl   $0x2,-0x2c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x2,-0x24(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1559 <main+0x359>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd74(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%eax
jne    12c5 <main+0xc5>
lea    0xd60(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x1,-0x28(%rbp)
lea    0xd4b(%rip),%rax
mov    %rax,-0x40(%rbp)
movl   $0x2,-0x2c(%rbp)
jmp    1546 <main+0x346>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd2e(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%eax
jne    130f <main+0x10f>
lea    0xd1a(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x1,-0x28(%rbp)
lea    0xd01(%rip),%rax
mov    %rax,-0x40(%rbp)
movl   $0x2,-0x2c(%rbp)
jmp    1541 <main+0x341>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xce8(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%eax
jne    1359 <main+0x159>
lea    0xcd4(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x2,-0x28(%rbp)
lea    0xcb7(%rip),%rax
mov    %rax,-0x40(%rbp)
movl   $0x2,-0x2c(%rbp)
jmp    153c <main+0x33c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xca3(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%eax
jne    13a3 <main+0x1a3>
lea    0xc8f(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x2,-0x28(%rbp)
lea    0xc6d(%rip),%rax
mov    %rax,-0x40(%rbp)
movl   $0x2,-0x2c(%rbp)
jmp    1537 <main+0x337>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc5e(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%eax
jne    13ed <main+0x1ed>
lea    0xc4a(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x4,-0x28(%rbp)
lea    0xc50(%rip),%rax
mov    %rax,-0x40(%rbp)
movl   $0x4,-0x2c(%rbp)
jmp    1532 <main+0x332>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc19(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%eax
jne    1437 <main+0x237>
lea    0xc05(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x4,-0x28(%rbp)
lea    0xc06(%rip),%rax
mov    %rax,-0x40(%rbp)
movl   $0x4,-0x2c(%rbp)
jmp    152d <main+0x32d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbd4(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%eax
jne    1491 <main+0x291>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtoimax@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    148c <main+0x28c>
movl   $0x2,-0x24(%rbp)
jmp    1528 <main+0x328>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xb81(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%eax
jne    14da <main+0x2da>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtoimax@plt>
mov    %eax,-0x30(%rbp)
jmp    1523 <main+0x323>
mov    -0x58(%rbp),%rax
cmpb   $0x0,(%rax)
jne    14fc <main+0x2fc>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x58(%rbp)
jmp    151e <main+0x31e>
mov    -0x60(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1519 <main+0x319>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x60(%rbp)
jmp    151e <main+0x31e>
jmp    1523 <main+0x323>
jmp    1528 <main+0x328>
jmp    152d <main+0x32d>
jmp    1532 <main+0x332>
jmp    1537 <main+0x337>
jmp    153c <main+0x33c>
jmp    1541 <main+0x341>
jmp    1546 <main+0x346>
jmp    154b <main+0x34b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    126f <main+0x6f>
mov    -0x60(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1573 <main+0x373>
mov    -0x58(%rbp),%rdi
call   1110 <strdup@plt>
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rdi
call   1080 <getFileExtension@plt>
mov    %rax,-0x50(%rbp)
mov    -0x58(%rbp),%rdi
lea    0xaa4(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jne    15bb <main+0x3bb>
mov    -0x58(%rbp),%rsi
lea    0xa88(%rip),%rdi
call   10a0 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1960 <main+0x760>
mov    -0x60(%rbp),%rdi
call   10b0 <removeExtension@plt>
mov    -0x60(%rbp),%rdi
call   1120 <getFilename@plt>
mov    %rax,-0x48(%rbp)
lea    -0x1070(%rbp),%rdi
mov    -0x60(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x1070(%rbp),%rdi
lea    0xa60(%rip),%rsi
call   1100 <strcat@plt>
lea    -0x1070(%rbp),%rdi
lea    0x9fe(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x70(%rbp)
cmpq   $0x0,-0x70(%rbp)
jne    163e <main+0x43e>
mov    -0x68(%rbp),%rdi
call   1070 <fclose@plt>
lea    -0x1070(%rbp),%rsi
lea    0xa25(%rip),%rdi
call   10a0 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1960 <main+0x760>
cmpl   $0x2,-0x24(%rbp)
jge    164f <main+0x44f>
movl   $0x2,-0x24(%rbp)
mov    -0x70(%rbp),%rdi
lea    0xa16(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0x70(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xa09(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0x70(%rbp),%rdi
mov    -0x48(%rbp),%rdx
lea    0xa04(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0x70(%rbp),%rdi
mov    -0x48(%rbp),%rdx
lea    0x9fe(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
lea    -0x2070(%rbp),%rdi
mov    -0x30(%rbp),%esi
mov    $0x1000,%edx
call   10c0 <memset@plt>
lea    -0x2070(%rbp),%rdi
mov    -0x68(%rbp),%rcx
mov    $0x1,%esi
mov    $0x1000,%edx
call   1060 <fread@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     17d6 <main+0x5d6>
mov    -0x70(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0x990(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x2074(%rbp)
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x2c(%rbp)
mov    %eax,%ecx
mov    -0x2074(%rbp),%eax
cmp    %ecx,%eax
jge    17c4 <main+0x5c4>
cmpl   $0x0,-0x14(%rbp)
je     1758 <main+0x558>
mov    -0x70(%rbp),%rdi
lea    0x95b(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0x70(%rbp),%rdi
lea    0x94b(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    17b1 <main+0x5b1>
mov    -0x70(%rbp),%rdi
mov    -0x14(%rbp),%eax
imul   -0x2c(%rbp),%eax
add    -0x18(%rbp),%eax
cltq
movzbl -0x2070(%rbp,%rax,1),%edx
ff
lea    0x915(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1771 <main+0x571>
jmp    17b6 <main+0x5b6>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    171c <main+0x51c>
mov    -0x70(%rbp),%rdi
lea    0x925(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
cmpl   $0x10,-0x1c(%rbp)
jge    17e5 <main+0x5e5>
jmp    17ea <main+0x5ea>
jmp    16a2 <main+0x4a2>
mov    -0x70(%rbp),%rdi
lea    0x8ff(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0x70(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x68(%rbp),%rdi
call   1070 <fclose@plt>
lea    -0x1070(%rbp),%rdi
mov    -0x60(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x1070(%rbp),%rdi
lea    0x88a(%rip),%rsi
call   1100 <strcat@plt>
lea    -0x1070(%rbp),%rdi
lea    0x7c1(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x70(%rbp)
cmpq   $0x0,-0x70(%rbp)
jne    1872 <main+0x672>
lea    -0x1070(%rbp),%rsi
lea    0x7f1(%rip),%rdi
call   10a0 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1960 <main+0x760>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x2078(%rbp)
mov    -0x48(%rbp),%rdi
call   1090 <strlen@plt>
mov    %eax,%ecx
mov    -0x2078(%rbp),%eax
cmp    %ecx,%eax
jge    18c7 <main+0x6c7>
mov    -0x48(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1050 <toupper@plt>
mov    %al,%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0x1070(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1879 <main+0x679>
movslq -0x14(%rbp),%rax
movb   $0x0,-0x1070(%rbp,%rax,1)
mov    -0x70(%rbp),%rdi
lea    -0x1070(%rbp),%rdx
lea    0x7d4(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0x70(%rbp),%rdi
lea    -0x1070(%rbp),%rdx
lea    0x7cb(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0x70(%rbp),%rdi
mov    -0x38(%rbp),%rax
mov    %rax,-0x2080(%rbp)
mov    -0x48(%rbp),%rcx
mov    -0x20(%rbp),%eax
cltd
idivl  -0x28(%rbp)
mov    -0x2080(%rbp),%rdx
mov    %eax,%r8d
lea    0x7aa(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0x70(%rbp),%rdi
lea    -0x1070(%rbp),%rdx
lea    0x7ad(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0x70(%rbp),%rdi
call   1070 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2080,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2068,%rsp
cmp    $0x2,%edi
jl     149f <main+0x27f>
mov    %rsi,%r13
mov    %edi,%r14d
xor    %eax,%eax
mov    %rax,0x38(%rsp)
lea    0xdb5(%rip),%rcx
lea    0xdab(%rip),%rdx
mov    $0x1,%r15d
lea    0xe91(%rip),%rax
lea    0xd99(%rip),%rbp
mov    %rax,0x28(%rsp)
mov    %rax,0x30(%rsp)
mov    %rdx,0x20(%rsp)
mov    %rcx,0x18(%rsp)
mov    $0x2,%eax
mov    %rax,0x10(%rsp)
movl   $0x1,0x8(%rsp)
movl   $0x2,0xc(%rsp)
nopw   0x0(%rax,%rax,1)
movslq %r15d,%r12
mov    0x0(%r13,%r12,8),%rbx
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10e0 <strcmp@plt>
test   %eax,%eax
je     1380 <main+0x160>
mov    %rbx,%rdi
lea    0xd41(%rip),%rsi
call   10e0 <strcmp@plt>
test   %eax,%eax
je     13a0 <main+0x180>
mov    %rbx,%rdi
lea    0xd2e(%rip),%rsi
call   10e0 <strcmp@plt>
test   %eax,%eax
je     13bb <main+0x19b>
mov    %rbx,%rdi
lea    0xd1c(%rip),%rsi
call   10e0 <strcmp@plt>
test   %eax,%eax
je     13d6 <main+0x1b6>
mov    %rbx,%rdi
lea    0xd0a(%rip),%rsi
call   10e0 <strcmp@plt>
test   %eax,%eax
je     1413 <main+0x1f3>
mov    %rbx,%rdi
lea    0xcf8(%rip),%rsi
call   10e0 <strcmp@plt>
test   %eax,%eax
je     142e <main+0x20e>
mov    %rbx,%rdi
lea    0xce6(%rip),%rsi
call   10e0 <strcmp@plt>
test   %eax,%eax
je     1455 <main+0x235>
mov    %rbx,%rdi
lea    0xcd6(%rip),%rsi
call   10e0 <strcmp@plt>
test   %eax,%eax
je     1478 <main+0x258>
mov    0x30(%rsp),%rax
cmpb   $0x0,(%rax)
je     1495 <main+0x275>
mov    0x28(%rsp),%rax
cmpb   $0x0,(%rax)
cmove  %rbx,%rax
mov    %rax,0x28(%rsp)
jmp    1401 <main+0x1e1>
movl   $0x1,0x8(%rsp)
mov    $0x2,%eax
mov    %rax,0x10(%rsp)
lea    0xc6a(%rip),%rax
jmp    13f0 <main+0x1d0>
nopl   0x0(%rax,%rax,1)
movl   $0x1,0x8(%rsp)
mov    $0x2,%eax
mov    %rax,0x10(%rsp)
lea    0xc4e(%rip),%rax
jmp    13f0 <main+0x1d0>
movl   $0x2,0x8(%rsp)
mov    $0x2,%eax
mov    %rax,0x10(%rsp)
lea    0xc37(%rip),%rax
jmp    13f0 <main+0x1d0>
movl   $0x2,0x8(%rsp)
mov    $0x2,%eax
mov    %rax,0x10(%rsp)
lea    0xc21(%rip),%rax
nop
mov    %rax,0x18(%rsp)
lea    0xc04(%rip),%rax
mov    %rax,0x20(%rsp)
add    $0x1,%r15d
cmp    %r14d,%r15d
jl     12a0 <main+0x80>
jmp    14e9 <main+0x2c9>
movl   $0x4,0x8(%rsp)
mov    $0x4,%eax
mov    %rax,0x10(%rsp)
lea    0xbe9(%rip),%rax
jmp    1447 <main+0x227>
movl   $0x4,0x8(%rsp)
mov    $0x4,%eax
mov    %rax,0x10(%rsp)
lea    0xbd3(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xbda(%rip),%rax
jmp    13fc <main+0x1dc>
lea    0x1(%r12),%r15d
mov    0x8(%r13,%r12,8),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtoimax@plt>
test   %eax,%eax
mov    $0x2,%ecx
cmove  %ecx,%eax
mov    %eax,0xc(%rsp)
jmp    1401 <main+0x1e1>
lea    0x1(%r12),%r15d
mov    0x8(%r13,%r12,8),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtoimax@plt>
mov    %rax,0x38(%rsp)
jmp    1401 <main+0x1e1>
mov    %rbx,0x30(%rsp)
jmp    1401 <main+0x1e1>
lea    0xc4d(%rip),%rcx
lea    0xb53(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0xb4a(%rip),%rax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x38(%rsp)
movl   $0x1,0x8(%rsp)
movl   $0x2,0xc(%rsp)
mov    $0x2,%eax
mov    %rax,0x10(%rsp)
mov    %rcx,0x30(%rsp)
mov    %rcx,0x28(%rsp)
mov    0x28(%rsp),%rbp
cmpb   $0x0,0x0(%rbp)
mov    0x30(%rsp),%rbx
jne    1504 <main+0x2e4>
mov    %rbx,%rdi
call   1130 <strdup@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1080 <getFileExtension@plt>
lea    0xb1c(%rip),%rsi
mov    %rbx,%rdi
call   1100 <fopen@plt>
mov    %rax,0x40(%rsp)
test   %rax,%rax
je     1824 <main+0x604>
mov    %rbp,%rdi
call   10b0 <removeExtension@plt>
mov    %rbp,%rdi
call   1140 <getFilename@plt>
mov    %rax,%r14
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <strcpy@plt>
lea    0xafc(%rip),%rsi
mov    %rbx,%rdi
call   1110 <strcat@plt>
lea    0xa9e(%rip),%rsi
mov    %rbx,%rdi
call   1100 <fopen@plt>
test   %rax,%rax
je     1830 <main+0x610>
mov    %rax,%rbx
mov    %rbp,0x28(%rsp)
mov    0xc(%rsp),%eax
cmp    $0x3,%eax
mov    $0x2,%ebp
cmovge %eax,%ebp
lea    0xadf(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1120 <fwrite@plt>
lea    0xace(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   10f0 <fprintf@plt>
lea    0xacc(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   10f0 <fprintf@plt>
lea    0xac8(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,0x58(%rsp)
mov    %r14,%rdx
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    0x10(%rsp),%rax
lea    -0x1(%rax),%ecx
mov    %ecx,0x50(%rsp)
mov    %eax,%ecx
neg    %ecx
mov    %ecx,0x4c(%rsp)
mov    %eax,%r13d
lea    0xaae(%rip),%r15
xor    %r12d,%r12d
jmp    162d <main+0x40d>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
mov    %rbx,%rsi
call   10d0 <fputc@plt>
cmpl   $0xf,0x54(%rsp)
mov    0xc(%rsp),%r12d
jle    171e <main+0x4fe>
lea    0x1060(%rsp),%r14
mov    %r14,%rdi
mov    0x38(%rsp),%rsi
mov    $0x1000,%edx
call   10c0 <memset@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x1000,%edx
mov    0x40(%rsp),%rcx
call   1060 <fread@plt>
mov    %eax,%ebp
add    %eax,%r12d
add    0x50(%rsp),%ebp
and    0x4c(%rsp),%ebp
je     171e <main+0x4fe>
mov    %r12d,0xc(%rsp)
mov    %rbx,%rdi
lea    0xa1e(%rip),%rsi
mov    0x20(%rsp),%rdx
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    %ebp,0x54(%rsp)
mov    %ebp,%eax
cltd
idivl  0x10(%rsp)
test   %eax,%eax
jle    1610 <main+0x3f0>
mov    %eax,%eax
mov    %rax,0x30(%rsp)
lea    0x1060(%rsp),%r14
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   %r12,%r12
je     16d2 <main+0x4b2>
mov    $0x2c,%edi
mov    %rbx,%rsi
call   10d0 <fputc@plt>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0x9c9(%rip),%rdi
mov    %rbx,%rcx
call   1120 <fwrite@plt>
xor    %ebp,%ebp
nopl   (%rax)
movzbl (%r14,%rbp,1),%edx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   10f0 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    16f0 <main+0x4d0>
add    $0x1,%r12
add    %r13,%r14
cmp    0x30(%rsp),%r12
jne    16c0 <main+0x4a0>
jmp    1610 <main+0x3f0>
mov    $0xa,%edi
mov    %rbx,%rsi
call   10d0 <fputc@plt>
mov    %rbx,%rdi
call   1070 <fclose@plt>
mov    0x40(%rsp),%rdi
call   1070 <fclose@plt>
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
mov    0x28(%rsp),%rsi
call   1040 <strcpy@plt>
lea    0x95e(%rip),%rsi
mov    %rbx,%rdi
call   1110 <strcat@plt>
lea    0x89b(%rip),%rsi
mov    %rbx,%rdi
call   1100 <fopen@plt>
test   %rax,%rax
je     183a <main+0x61a>
mov    %rax,%r13
mov    0x58(%rsp),%rbx
mov    %rbx,%rdi
call   1090 <strlen@plt>
xor    %r14d,%r14d
xor    %ebp,%ebp
test   %eax,%eax
jle    17b0 <main+0x590>
nop
movsbl (%rbx,%rbp,1),%edi
call   1050 <toupper@plt>
mov    %al,0x60(%rsp,%rbp,1)
add    $0x1,%rbp
mov    %rbx,%rdi
call   1090 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     1790 <main+0x570>
movb   $0x0,0x60(%rsp,%rbp,1)
lea    0x8fb(%rip),%rsi
lea    0x60(%rsp),%r15
mov    %r13,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   10f0 <fprintf@plt>
lea    0x8f2(%rip),%rsi
mov    %r13,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    %r12d,%eax
cltd
idivl  0x8(%rsp)
lea    0x8e7(%rip),%rsi
mov    %r13,%rdi
mov    0x18(%rsp),%rdx
mov    %rbx,%rcx
mov    %eax,%r8d
xor    %eax,%eax
call   10f0 <fprintf@plt>
lea    0x8e7(%rip),%rsi
mov    %r13,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    %r13,%rdi
call   1070 <fclose@plt>
jmp    1851 <main+0x631>
lea    0x807(%rip),%rdi
mov    %rbx,%rsi
jmp    1846 <main+0x626>
mov    0x40(%rsp),%rdi
call   1070 <fclose@plt>
lea    0x811(%rip),%rdi
lea    0x60(%rsp),%rsi
call   10a0 <printf@plt>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x2068,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"u8\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [4 x i8] c"-u8\00"
@.str.4 = [4 x i8] c"-s8\00"
@.str.5 = [3 x i8] c"s8\00"
@.str.6 = [5 x i8] c"-u16\00"
@.str.7 = [4 x i8] c"u16\00"
@.str.8 = [5 x i8] c"-s16\00"
@.str.9 = [4 x i8] c"s16\00"
@.str.10 = [5 x i8] c"-u32\00"
@.str.11 = [4 x i8] c"u32\00"
@.str.12 = [2 x i8] c"l\00"
@.str.13 = [5 x i8] c"-s32\00"
@.str.14 = [4 x i8] c"s32\00"
@.str.15 = [7 x i8] c"-align\00"
@.str.16 = [10 x i8] c"-nullfill\00"
@.str.17 = [3 x i8] c"rb\00"
@.str.18 = [29 x i8] c"Couldn't open input file %s\0A\00"
@.str.19 = [3 x i8] c".s\00"
@.str.20 = [30 x i8] c"Couldn't open output file %s\0A\00"
@.str.21 = [8 x i8] c".text\0A\0A\00"
@.str.22 = [17 x i8] c" .align %d\0A\0A\00"
@.str.23 = [16 x i8] c" .global %s\0A\00"
@.str.24 = [5 x i8] c"%s:\0A\00"
@.str.25 = [14 x i8] c" dc.%s \00"
@.str.26 = [2 x i8] c",\00"
@.str.27 = [3 x i8] c"0x\00"
@.str.28 = [5 x i8] c"%02X\00"
@.str.29 = [2 x i8] c"\0A\00"
@.str.30 = [3 x i8] c".h\00"
@.str.31 = [16 x i8] c"#ifndef _%s_H_\0A\00"
@.str.32 = [17 x i8] c"#define _%s_H_\0A\0A\00"
@.str.33 = [28 x i8] c"extern const %s %s[0x%X];\0A\0A\00"
@.str.34 = [18 x i8] c"#endif // _%s_H_\0A\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 i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i32*
%21 = alloca i32*
%22 = alloca [4096 x i8]
%23 = alloca [4096 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %18
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %19
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %14
store i32 1, i32* %11
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %15
store i32 2, i32* %12
store i32 0, i32* %9
store i32 2, i32* %10
store i32 0, i32* %13
store i32 1, i32* %6
br label %24
24: ; preds = %152, %2
%25 = load i32, i32* %6
%26 = load i32, i32* %4
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %155
28: ; preds = %24
%29 = load i8**, i8*** %5
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = call i32 @strcmp(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %37, label %36
36: ; preds = %28
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %14
store i32 1, i32* %11
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %15
store i32 2, i32* %12
br label %151
37: ; preds = %28
%38 = load i8**, i8*** %5
%39 = load i32, i32* %6
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8*, i8** %38, i64 %40
%42 = load i8*, i8** %41
%43 = call i32 @strcmp(i8* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%44 = icmp ne i32 %43, 0
br i1 %44, label %46, label %45
45: ; preds = %37
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8** %14
store i32 1, i32* %11
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %15
store i32 2, i32* %12
br label %150
46: ; preds = %37
%47 = load i8**, i8*** %5
%48 = load i32, i32* %6
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8*, i8** %47, i64 %49
%51 = load i8*, i8** %50
%52 = call i32 @strcmp(i8* %51, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%53 = icmp ne i32 %52, 0
br i1 %53, label %55, label %54
54: ; preds = %46
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8** %14
store i32 2, i32* %11
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %15
store i32 2, i32* %12
br label %149
55: ; preds = %46
%56 = load i8**, i8*** %5
%57 = load i32, i32* %6
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8*, i8** %56, i64 %58
%60 = load i8*, i8** %59
%61 = call i32 @strcmp(i8* %60, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%62 = icmp ne i32 %61, 0
br i1 %62, label %64, label %63
63: ; preds = %55
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8** %14
store i32 2, i32* %11
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %15
store i32 2, i32* %12
br label %148
64: ; preds = %55
%65 = load i8**, i8*** %5
%66 = load i32, i32* %6
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8*, i8** %65, i64 %67
%69 = load i8*, i8** %68
%70 = call i32 @strcmp(i8* %69, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%71 = icmp ne i32 %70, 0
br i1 %71, label %73, label %72
72: ; preds = %64
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8** %14
store i32 4, i32* %11
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i8** %15
store i32 4, i32* %12
br label %147
73: ; preds = %64
%74 = load i8**, i8*** %5
%75 = load i32, i32* %6
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i8*, i8** %74, i64 %76
%78 = load i8*, i8** %77
%79 = call i32 @strcmp(i8* %78, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%80 = icmp ne i32 %79, 0
br i1 %80, label %82, label %81
81: ; preds = %73
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i8** %14
store i32 4, i32* %11
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i8** %15
store i32 4, i32* %12
br label %146
82: ; preds = %73
%83 = load i8**, i8*** %5
%84 = load i32, i32* %6
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds i8*, i8** %83, i64 %85
%87 = load i8*, i8** %86
%88 = call i32 @strcmp(i8* %87, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%89 = icmp ne i32 %88, 0
br i1 %89, label %103, label %90
90: ; preds = %82
%91 = load i32, i32* %6
%92 = add nsw i32 %91, 1
store i32 %92, i32* %6
%93 = load i8**, i8*** %5
%94 = load i32, i32* %6
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i8*, i8** %93, i64 %95
%97 = load i8*, i8** %96
%98 = call i32 @strtoimax(i8* %97, i32* null, i32 0)
store i32 %98, i32* %10
%99 = load i32, i32* %10
%100 = icmp ne i32 %99, 0
br i1 %100, label %102, label %101
101: ; preds = %90
store i32 2, i32* %10
br label %102
102: ; preds = %101, %90
br label %145
103: ; preds = %82
%104 = load i8**, i8*** %5
%105 = load i32, i32* %6
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8*, i8** %104, i64 %106
%108 = load i8*, i8** %107
%109 = call i32 @strcmp(i8* %108, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0))
%110 = icmp ne i32 %109, 0
br i1 %110, label %120, label %111
111: ; preds = %103
%112 = load i32, i32* %6
%113 = add nsw i32 %112, 1
store i32 %113, i32* %6
%114 = load i8**, i8*** %5
%115 = load i32, i32* %6
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i8*, i8** %114, i64 %116
%118 = load i8*, i8** %117
%119 = call i32 @strtoimax(i8* %118, i32* null, i32 0)
store i32 %119, i32* %13
br label %144
120: ; preds = %103
%121 = load i8*, i8** %18
%122 = getelementptr inbounds i8, i8* %121, i64 0
%123 = load i8, i8* %122
%124 = icmp ne i8 %123, 0
br i1 %124, label %131, label %125
125: ; preds = %120
%126 = load i8**, i8*** %5
%127 = load i32, i32* %6
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds i8*, i8** %126, i64 %128
%130 = load i8*, i8** %129
store i8* %130, i8** %18
br label %143
131: ; preds = %120
%132 = load i8*, i8** %19
%133 = getelementptr inbounds i8, i8* %132, i64 0
%134 = load i8, i8* %133
%135 = icmp ne i8 %134, 0
br i1 %135, label %142, label %136
136: ; preds = %131
%137 = load i8**, i8*** %5
%138 = load i32, i32* %6
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i8*, i8** %137, i64 %139
%141 = load i8*, i8** %140
store i8* %141, i8** %19
br label %142
142: ; preds = %136, %131
br label %143
143: ; preds = %142, %125
br label %144
144: ; preds = %143, %111
br label %145
145: ; preds = %144, %102
br label %146
146: ; preds = %145, %81
br label %147
147: ; preds = %146, %72
br label %148
148: ; preds = %147, %63
br label %149
149: ; preds = %148, %54
br label %150
150: ; preds = %149, %45
br label %151
151: ; preds = %150, %36
br label %152
152: ; preds = %151
%153 = load i32, i32* %6
%154 = add nsw i32 %153, 1
store i32 %154, i32* %6
br label %24
155: ; preds = %24
%156 = load i8*, i8** %19
%157 = getelementptr inbounds i8, i8* %156, i64 0
%158 = load i8, i8* %157
%159 = icmp ne i8 %158, 0
br i1 %159, label %163, label %160
160: ; preds = %155
%161 = load i8*, i8** %18
%162 = call i8* @strdup(i8* %161)
store i8* %162, i8** %19
br label %163
163: ; preds = %160, %155
%164 = load i8*, i8** %18
%165 = call i8* @getFileExtension(i8* %164)
store i8* %165, i8** %17
%166 = load i8*, i8** %18
%167 = call i32* @fopen(i8* %166, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
store i32* %167, i32** %20
%168 = load i32*, i32** %20
%169 = icmp ne i32* %168, null
br i1 %169, label %173, label %170
170: ; preds = %163
%171 = load i8*, i8** %18
%172 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.18, i64 0, i64 0), i8* %171)
store i32 1, i32* %3
br label %338
173: ; preds = %163
%174 = load i8*, i8** %19
%175 = call i32 @removeExtension(i8* %174)
%176 = load i8*, i8** %19
%177 = call i8* @getFilename(i8* %176)
store i8* %177, i8** %16
%178 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 0
%179 = load i8*, i8** %19
%180 = call i32 @strcpy(i8* %178, i8* %179)
%181 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 0
%182 = call i32 @strcat(i8* %181, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0))
%183 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 0
%184 = call i32* @fopen(i8* %183, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %184, i32** %21
%185 = load i32*, i32** %21
%186 = icmp ne i32* %185, null
br i1 %186, label %192, label %187
187: ; preds = %173
%188 = load i32*, i32** %20
%189 = call i32 @fclose(i32* %188)
%190 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 0
%191 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.20, i64 0, i64 0), i8* %190)
store i32 1, i32* %3
br label %338
192: ; preds = %173
%193 = load i32, i32* %10
%194 = icmp slt i32 %193, 2
br i1 %194, label %195, label %196
195: ; preds = %192
store i32 2, i32* %10
br label %196
196: ; preds = %195, %192
%197 = load i32*, i32** %21
%198 = call i32 (i32*, i8*, ...) @fprintf(i32* %197, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i64 0, i64 0))
%199 = load i32*, i32** %21
%200 = load i32, i32* %10
%201 = call i32 (i32*, i8*, ...) @fprintf(i32* %199, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.22, i64 0, i64 0), i32 %200)
%202 = load i32*, i32** %21
%203 = load i8*, i8** %16
%204 = call i32 (i32*, i8*, ...) @fprintf(i32* %202, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.23, i64 0, i64 0), i8* %203)
%205 = load i32*, i32** %21
%206 = load i8*, i8** %16
%207 = call i32 (i32*, i8*, ...) @fprintf(i32* %205, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i8* %206)
br label %208
208: ; preds = %196, %277
%209 = getelementptr inbounds [4096 x i8], [4096 x i8]* %23, i64 0, i64 0
%210 = load i32, i32* %13
%211 = call i32 @memset(i8* %209, i32 %210, i32 4096)
%212 = getelementptr inbounds [4096 x i8], [4096 x i8]* %23, i64 0, i64 0
%213 = load i32*, i32** %20
%214 = call i32 @fread(i8* %212, i32 1, i32 4096, i32* %213)
store i32 %214, i32* %8
%215 = load i32, i32* %8
%216 = load i32, i32* %9
%217 = add nsw i32 %216, %215
store i32 %217, i32* %9
%218 = load i32, i32* %8
%219 = load i32, i32* %12
%220 = sub nsw i32 %219, 1
%221 = add nsw i32 %218, %220
%222 = load i32, i32* %12
%223 = sub nsw i32 %222, 1
%224 = xor i32 %223, -1
%225 = and i32 %221, %224
store i32 %225, i32* %8
%226 = load i32, i32* %8
%227 = icmp ne i32 %226, 0
br i1 %227, label %228, label %273
228: ; preds = %208
%229 = load i32*, i32** %21
%230 = load i8*, i8** %15
%231 = call i32 (i32*, i8*, ...) @fprintf(i32* %229, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.25, i64 0, i64 0), i8* %230)
store i32 0, i32* %6
br label %232
232: ; preds = %267, %228
%233 = load i32, i32* %6
%234 = load i32, i32* %8
%235 = load i32, i32* %12
%236 = sdiv i32 %234, %235
%237 = icmp slt i32 %233, %236
br i1 %237, label %238, label %270
238: ; preds = %232
%239 = load i32, i32* %6
%240 = icmp ne i32 %239, 0
br i1 %240, label %241, label %244
241: ; preds = %238
%242 = load i32*, i32** %21
%243 = call i32 (i32*, i8*, ...) @fprintf(i32* %242, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.26, i64 0, i64 0))
br label %244
244: ; preds = %241, %238
%245 = load i32*, i32** %21
%246 = call i32 (i32*, i8*, ...) @fprintf(i32* %245, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0))
store i32 0, i32* %7
br label %247
247: ; preds = %263, %244
%248 = load i32, i32* %7
%249 = load i32, i32* %12
%250 = icmp slt i32 %248, %249
br i1 %250, label %251, label %266
251: ; preds = %247
%252 = load i32*, i32** %21
%253 = load i32, i32* %6
%254 = load i32, i32* %12
%255 = mul nsw i32 %253, %254
%256 = load i32, i32* %7
%257 = add nsw i32 %255, %256
%258 = sext i32 %257 to i64
%259 = getelementptr inbounds [4096 x i8], [4096 x i8]* %23, i64 0, i64 %258
%260 = load i8, i8* %259
%261 = zext i8 %260 to i32
%262 = call i32 (i32*, i8*, ...) @fprintf(i32* %252, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.28, i64 0, i64 0), i32 %261)
br label %263
263: ; preds = %251
%264 = load i32, i32* %7
%265 = add nsw i32 %264, 1
store i32 %265, i32* %7
br label %247
266: ; preds = %247
br label %267
267: ; preds = %266
%268 = load i32, i32* %6
%269 = add nsw i32 %268, 1
store i32 %269, i32* %6
br label %232
270: ; preds = %232
%271 = load i32*, i32** %21
%272 = call i32 (i32*, i8*, ...) @fprintf(i32* %271, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.29, i64 0, i64 0))
br label %273
273: ; preds = %270, %208
%274 = load i32, i32* %8
%275 = icmp slt i32 %274, 16
br i1 %275, label %276, label %277
276: ; preds = %273
br label %278
277: ; preds = %273
br label %208
278: ; preds = %276
%279 = load i32*, i32** %21
%280 = call i32 (i32*, i8*, ...) @fprintf(i32* %279, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.29, i64 0, i64 0))
%281 = load i32*, i32** %21
%282 = call i32 @fclose(i32* %281)
%283 = load i32*, i32** %20
%284 = call i32 @fclose(i32* %283)
%285 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 0
%286 = load i8*, i8** %19
%287 = call i32 @strcpy(i8* %285, i8* %286)
%288 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 0
%289 = call i32 @strcat(i8* %288, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0))
%290 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 0
%291 = call i32* @fopen(i8* %290, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %291, i32** %21
%292 = load i32*, i32** %21
%293 = icmp ne i32* %292, null
br i1 %293, label %297, label %294
294: ; preds = %278
%295 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 0
%296 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.20, i64 0, i64 0), i8* %295)
store i32 1, i32* %3
br label %338
297: ; preds = %278
store i32 0, i32* %6
br label %298
298: ; preds = %313, %297
%299 = load i32, i32* %6
%300 = load i8*, i8** %16
%301 = call i32 @strlen(i8* %300)
%302 = icmp slt i32 %299, %301
br i1 %302, label %303, label %316
303: ; preds = %298
%304 = load i8*, i8** %16
%305 = load i32, i32* %6
%306 = sext i32 %305 to i64
%307 = getelementptr inbounds i8, i8* %304, i64 %306
%308 = load i8, i8* %307
%309 = call signext i8 @toupper(i8 signext %308)
%310 = load i32, i32* %6
%311 = sext i32 %310 to i64
%312 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 %311
store i8 %309, i8* %312
br label %313
313: ; preds = %303
%314 = load i32, i32* %6
%315 = add nsw i32 %314, 1
store i32 %315, i32* %6
br label %298
316: ; preds = %298
%317 = load i32, i32* %6
%318 = sext i32 %317 to i64
%319 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 %318
store i8 0, i8* %319
%320 = load i32*, i32** %21
%321 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 0
%322 = call i32 (i32*, i8*, ...) @fprintf(i32* %320, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.31, i64 0, i64 0), i8* %321)
%323 = load i32*, i32** %21
%324 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 0
%325 = call i32 (i32*, i8*, ...) @fprintf(i32* %323, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.32, i64 0, i64 0), i8* %324)
%326 = load i32*, i32** %21
%327 = load i8*, i8** %14
%328 = load i8*, i8** %16
%329 = load i32, i32* %9
%330 = load i32, i32* %11
%331 = sdiv i32 %329, %330
%332 = call i32 (i32*, i8*, ...) @fprintf(i32* %326, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.33, i64 0, i64 0), i8* %327, i8* %328, i32 %331)
%333 = load i32*, i32** %21
%334 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 0
%335 = call i32 (i32*, i8*, ...) @fprintf(i32* %333, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.34, i64 0, i64 0), i8* %334)
%336 = load i32*, i32** %21
%337 = call i32 @fclose(i32* %336)
store i32 0, i32* %3
br label %338
338: ; preds = %316, %294, %187, %170
%339 = load i32, i32* %3
ret i32 %339
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"u8\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [4 x i8] c"-u8\00"
@.str.4 = [4 x i8] c"-s8\00"
@.str.5 = [3 x i8] c"s8\00"
@.str.6 = [5 x i8] c"-u16\00"
@.str.7 = [4 x i8] c"u16\00"
@.str.8 = [5 x i8] c"-s16\00"
@.str.9 = [4 x i8] c"s16\00"
@.str.10 = [5 x i8] c"-u32\00"
@.str.11 = [4 x i8] c"u32\00"
@.str.12 = [2 x i8] c"l\00"
@.str.13 = [5 x i8] c"-s32\00"
@.str.14 = [4 x i8] c"s32\00"
@.str.15 = [7 x i8] c"-align\00"
@.str.16 = [10 x i8] c"-nullfill\00"
@.str.17 = [3 x i8] c"rb\00"
@.str.18 = [29 x i8] c"Couldn't open input file %s\0A\00"
@.str.19 = [3 x i8] c".s\00"
@.str.20 = [30 x i8] c"Couldn't open output file %s\0A\00"
@.str.21 = [8 x i8] c".text\0A\0A\00"
@.str.22 = [17 x i8] c" .align %d\0A\0A\00"
@.str.23 = [16 x i8] c" .global %s\0A\00"
@.str.24 = [5 x i8] c"%s:\0A\00"
@.str.25 = [14 x i8] c" dc.%s \00"
@.str.27 = [3 x i8] c"0x\00"
@.str.28 = [5 x i8] c"%02X\00"
@.str.30 = [3 x i8] c".h\00"
@.str.31 = [16 x i8] c"#ifndef _%s_H_\0A\00"
@.str.32 = [17 x i8] c"#define _%s_H_\0A\0A\00"
@.str.33 = [28 x i8] c"extern const %s %s[0x%X];\0A\0A\00"
@.str.34 = [18 x i8] c"#endif // _%s_H_\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4096 x i8]
%4 = alloca [4096 x i8]
%5 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %77
8: ; preds = %2, %65
%9 = phi i8* [ %74, %65 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %2 ]
%10 = phi i8* [ %73, %65 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %2 ]
%11 = phi i32 [ %75, %65 ], [ 1, %2 ]
%12 = phi i8* [ %71, %65 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %2 ]
%13 = phi i8* [ %70, %65 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %2 ]
%14 = phi i32 [ %69, %65 ], [ 0, %2 ]
%15 = phi i32 [ %68, %65 ], [ 2, %2 ]
%16 = phi i32 [ %67, %65 ], [ 1, %2 ]
%17 = phi i32 [ %66, %65 ], [ 2, %2 ]
%18 = sext i32 %11 to i64
%19 = getelementptr inbounds i8*, i8** %1, i64 %18
%20 = load i8*, i8** %19
%21 = tail call i32 @strcmp(i8* dereferenceable(1) %20, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%22 = icmp eq i32 %21, 0
br i1 %22, label %65, label %23
23: ; preds = %8
%24 = tail call i32 @strcmp(i8* dereferenceable(1) %20, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %65, label %26
26: ; preds = %23
%27 = tail call i32 @strcmp(i8* dereferenceable(1) %20, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
br i1 %28, label %65, label %29
29: ; preds = %26
%30 = tail call i32 @strcmp(i8* dereferenceable(1) %20, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%31 = icmp eq i32 %30, 0
br i1 %31, label %65, label %32
32: ; preds = %29
%33 = tail call i32 @strcmp(i8* dereferenceable(1) %20, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%34 = icmp eq i32 %33, 0
br i1 %34, label %65, label %35
35: ; preds = %32
%36 = tail call i32 @strcmp(i8* dereferenceable(1) %20, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%37 = icmp eq i32 %36, 0
br i1 %37, label %65, label %38
38: ; preds = %35
%39 = tail call i32 @strcmp(i8* dereferenceable(1) %20, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %49
41: ; preds = %38
%42 = add nsw i32 %11, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8*, i8** %1, i64 %43
%45 = load i8*, i8** %44
%46 = tail call i32 @strtoimax(i8* %45, i32* null, i32 0)
%47 = icmp eq i32 %46, 0
%48 = select i1 %47, i32 2, i32 %46
br label %65
49: ; preds = %38
%50 = tail call i32 @strcmp(i8* dereferenceable(1) %20, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0))
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %58
52: ; preds = %49
%53 = add nsw i32 %11, 1
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8*, i8** %1, i64 %54
%56 = load i8*, i8** %55
%57 = tail call i32 @strtoimax(i8* %56, i32* null, i32 0)
br label %65
58: ; preds = %49
%59 = load i8, i8* %10
%60 = icmp eq i8 %59, 0
br i1 %60, label %65, label %61
61: ; preds = %58
%62 = load i8, i8* %9
%63 = icmp eq i8 %62, 0
%64 = select i1 %63, i8* %20, i8* %9
br label %65
65: ; preds = %61, %58, %35, %32, %29, %26, %23, %8, %41, %52
%66 = phi i32 [ %17, %52 ], [ %48, %41 ], [ %17, %8 ], [ %17, %23 ], [ %17, %26 ], [ %17, %29 ], [ %17, %32 ], [ %17, %35 ], [ %17, %58 ], [ %17, %61 ]
%67 = phi i32 [ %16, %52 ], [ %16, %41 ], [ 1, %8 ], [ 1, %23 ], [ 2, %26 ], [ 2, %29 ], [ 4, %32 ], [ 4, %35 ], [ %16, %58 ], [ %16, %61 ]
%68 = phi i32 [ %15, %52 ], [ %15, %41 ], [ 2, %8 ], [ 2, %23 ], [ 2, %26 ], [ 2, %29 ], [ 4, %32 ], [ 4, %35 ], [ %15, %58 ], [ %15, %61 ]
%69 = phi i32 [ %57, %52 ], [ %14, %41 ], [ %14, %8 ], [ %14, %23 ], [ %14, %26 ], [ %14, %29 ], [ %14, %32 ], [ %14, %35 ], [ %14, %58 ], [ %14, %61 ]
%70 = phi i8* [ %13, %52 ], [ %13, %41 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %8 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), %23 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), %26 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), %29 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), %32 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), %35 ], [ %13, %58 ], [ %13, %61 ]
%71 = phi i8* [ %12, %52 ], [ %12, %41 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %8 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %23 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %26 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %29 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), %32 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), %35 ], [ %12, %58 ], [ %12, %61 ]
%72 = phi i32 [ %53, %52 ], [ %42, %41 ], [ %11, %8 ], [ %11, %23 ], [ %11, %26 ], [ %11, %29 ], [ %11, %32 ], [ %11, %35 ], [ %11, %58 ], [ %11, %61 ]
%73 = phi i8* [ %10, %52 ], [ %10, %41 ], [ %10, %8 ], [ %10, %23 ], [ %10, %26 ], [ %10, %29 ], [ %10, %32 ], [ %10, %35 ], [ %20, %58 ], [ %10, %61 ]
%74 = phi i8* [ %9, %52 ], [ %9, %41 ], [ %9, %8 ], [ %9, %23 ], [ %9, %26 ], [ %9, %29 ], [ %9, %32 ], [ %9, %35 ], [ %9, %58 ], [ %64, %61 ]
%75 = add nsw i32 %72, 1
%76 = icmp slt i32 %75, %0
br i1 %76, label %8, label %77
77: ; preds = %65, %2
%78 = phi i32 [ 2, %2 ], [ %66, %65 ]
%79 = phi i32 [ 1, %2 ], [ %67, %65 ]
%80 = phi i32 [ 2, %2 ], [ %68, %65 ]
%81 = phi i32 [ 0, %2 ], [ %69, %65 ]
%82 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %2 ], [ %70, %65 ]
%83 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %2 ], [ %71, %65 ]
%84 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %2 ], [ %73, %65 ]
%85 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %2 ], [ %74, %65 ]
%86 = load i8, i8* %85
%87 = icmp eq i8 %86, 0
br i1 %87, label %88, label %90
88: ; preds = %77
%89 = tail call i8* @strdup(i8* %84)
br label %90
90: ; preds = %88, %77
%91 = phi i8* [ %85, %77 ], [ %89, %88 ]
%92 = tail call i8* @getFileExtension(i8* %84)
%93 = tail call i32* @fopen(i8* %84, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
%94 = icmp eq i32* %93, null
br i1 %94, label %95, label %97
95: ; preds = %90
%96 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.18, i64 0, i64 0), i8* %84)
br label %189
97: ; preds = %90
%98 = tail call i32 @removeExtension(i8* %91)
%99 = tail call i8* @getFilename(i8* %91)
%100 = call i32 @strcpy(i8* %5, i8* %91)
%101 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0))
%102 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%103 = icmp eq i32* %102, null
br i1 %103, label %104, label %107
104: ; preds = %97
%105 = call i32 @fclose(i32* %93)
%106 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.20, i64 0, i64 0), i8* %5)
br label %189
107: ; preds = %97
%108 = icmp sgt i32 %78, 2
%109 = select i1 %108, i32 %78, i32 2
%110 = call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i64 0, i64 0), i64 7, i64 1, i32* %102)
%111 = call i32 (i32*, i8*, ...) @fprintf(i32* %102, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.22, i64 0, i64 0), i32 %109)
%112 = call i32 (i32*, i8*, ...) @fprintf(i32* %102, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.23, i64 0, i64 0), i8* %99)
%113 = call i32 (i32*, i8*, ...) @fprintf(i32* %102, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i8* %99)
%114 = add nsw i32 %80, -1
%115 = sub i32 0, %80
%116 = zext i32 %80 to i64
%117 = zext i32 %80 to i64
br label %118
118: ; preds = %152, %107
%119 = phi i32 [ 0, %107 ], [ %122, %152 ]
%120 = call i32 @memset(i8* %6, i32 %81, i32 4096)
%121 = call i32 @fread(i8* %6, i32 1, i32 4096, i32* %93)
%122 = add nsw i32 %121, %119
%123 = add nsw i32 %114, %121
%124 = and i32 %123, %115
%125 = icmp eq i32 %124, 0
br i1 %125, label %155, label %126
126: ; preds = %118
%127 = call i32 (i32*, i8*, ...) @fprintf(i32* %102, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.25, i64 0, i64 0), i8* %83)
%128 = sdiv i32 %124, %80
%129 = icmp sgt i32 %128, 0
br i1 %129, label %130, label %152
130: ; preds = %126
%131 = zext i32 %128 to i64
br label %132
132: ; preds = %130, %149
%133 = phi i64 [ 0, %130 ], [ %150, %149 ]
%134 = icmp eq i64 %133, 0
br i1 %134, label %137, label %135
135: ; preds = %132
%136 = call i32 @fputc(i32 44, i32* %102)
br label %137
137: ; preds = %132, %135
%138 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0), i64 2, i64 1, i32* %102)
%139 = mul nsw i64 %133, %116
br label %140
140: ; preds = %137, %140
%141 = phi i64 [ 0, %137 ], [ %147, %140 ]
%142 = add nuw nsw i64 %141, %139
%143 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %142
%144 = load i8, i8* %143
%145 = zext i8 %144 to i32
%146 = call i32 (i32*, i8*, ...) @fprintf(i32* %102, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.28, i64 0, i64 0), i32 %145)
%147 = add nuw nsw i64 %141, 1
%148 = icmp eq i64 %147, %117
br i1 %148, label %149, label %140
149: ; preds = %140
%150 = add nuw nsw i64 %133, 1
%151 = icmp eq i64 %150, %131
br i1 %151, label %152, label %132
152: ; preds = %149, %126
%153 = call i32 @fputc(i32 10, i32* %102)
%154 = icmp slt i32 %124, 16
br i1 %154, label %155, label %118
155: ; preds = %118, %152
%156 = call i32 @fputc(i32 10, i32* %102)
%157 = call i32 @fclose(i32* %102)
%158 = call i32 @fclose(i32* %93)
%159 = call i32 @strcpy(i8* %5, i8* %91)
%160 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0))
%161 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%162 = icmp eq i32* %161, null
br i1 %162, label %166, label %163
163: ; preds = %155
%164 = call i32 @strlen(i8* %99)
%165 = icmp sgt i32 %164, 0
br i1 %165, label %168, label %180
166: ; preds = %155
%167 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.20, i64 0, i64 0), i8* %5)
br label %189
168: ; preds = %163, %168
%169 = phi i64 [ %174, %168 ], [ 0, %163 ]
%170 = getelementptr inbounds i8, i8* %99, i64 %169
%171 = load i8, i8* %170
%172 = call signext i8 @toupper(i8 signext %171)
%173 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %169
store i8 %172, i8* %173
%174 = add nuw nsw i64 %169, 1
%175 = call i32 @strlen(i8* %99)
%176 = sext i32 %175 to i64
%177 = icmp slt i64 %174, %176
br i1 %177, label %168, label %178
178: ; preds = %168
%179 = and i64 %174, 4294967295
br label %180
180: ; preds = %178, %163
%181 = phi i64 [ 0, %163 ], [ %179, %178 ]
%182 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %181
store i8 0, i8* %182
%183 = call i32 (i32*, i8*, ...) @fprintf(i32* %161, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.31, i64 0, i64 0), i8* %5)
%184 = call i32 (i32*, i8*, ...) @fprintf(i32* %161, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.32, i64 0, i64 0), i8* %5)
%185 = sdiv i32 %122, %79
%186 = call i32 (i32*, i8*, ...) @fprintf(i32* %161, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.33, i64 0, i64 0), i8* %82, i8* %99, i32 %185)
%187 = call i32 (i32*, i8*, ...) @fprintf(i32* %161, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.34, i64 0, i64 0), i8* %5)
%188 = call i32 @fclose(i32* %161)
br label %189
189: ; preds = %180, %166, %104, %95
%190 = phi i32 [ 0, %180 ], [ 1, %166 ], [ 1, %104 ], [ 1, %95 ]
ret i32 %190
}