#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ copy_header(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdout;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main(int argc, char **argv) {
  char txt_filename[128];
  char c_filename[128];
  FILE *txtfile;
  FILE *cfile;
  int count;
  char input[4096];
  int location;
  int c;
  int instring;
  int lastcomma;
  int i;
  if (argc < 2) {
    fprintf(stderr, "Usage: %s <file> (assumed extension .txt)\n", argv[0]);
    exit(1);
  }
  strcpy(txt_filename, argv[1]);
  txtfile = fopen(txt_filename, "r");
  if (!txtfile) {
    strcat(txt_filename, ".txt");
    txtfile = fopen(txt_filename, "r");
    if (!txtfile)
      exit(1);
  } else {
    for (i = strlen(txt_filename); i > 0 && txt_filename[i] != '.'; i--)
      ;
    if (txt_filename[i] == '.')
      txt_filename[i] = '\0';
  }
  strcpy(c_filename, argv[1]);
  strcat(c_filename, ".c");
  cfile = fopen(c_filename, "w");
  copy_header(cfile);
  fprintf(cfile, "\n");
  fprintf(cfile, "#include <stdio.h>\n");
  fprintf(cfile, "#include \"types.h\"\n");
  fprintf(cfile, "#include \"mdbsupport.h\"\n");
  fprintf(cfile, "\n");
  fprintf(cfile, "const %s %s_array [] = {\n", argv[1], argv[1]);
  c = 0;
  count = 0;
  while (c != -1) {
    location = 0;
    memset(input, 0, 4096);
    while ((c = fgetc(txtfile)) != 13) {
      if (c == -1)
        break;
      input[location++] = c;
    }
    input[location] = '\0';
    if (location > 0) {
      if (count != 0) {
        fprintf(cfile, ",\n");
      }
      fprintf(cfile, "{\t\t\t\t/* %6d */\n\t", count);
      instring = 0;
      lastcomma = 0;
      for (i = 0; i < location; i++) {
        if (instring) {
          if (input[i] == '\\')
            fprintf(cfile, "\\\\");
          else if (input[i] == 10)
            fprintf(cfile, "\\n");
          else if (input[i] != 13)
            fprintf(cfile, "%c", input[i]);
          if (input[i] == '"') {
            instring = 0;
            lastcomma = 0;
          }
        } else {
          switch (input[i]) {
          case ',':
            if (lastcomma)
              fprintf(cfile, "\"\"");
            fprintf(cfile, ",\n\t");
            lastcomma = 1;
            break;
          case '"':
            fprintf(cfile, "%c", input[i]);
            lastcomma = 0;
            instring = 1;
            break;
          default:
            fprintf(cfile, "%c", input[i]);
            lastcomma = 0;
            break;
          }
        }
      }
      if (lastcomma)
        fprintf(cfile, "\"\"\n");
      fprintf(cfile, "\n}");
      count++;
    }
    c = fgetc(txtfile);
  }
  fprintf(cfile, "\n};\n");
  fprintf(cfile, "\nconst int %s_array_length = %d;\n", argv[1], count);
  fclose(txtfile);
  fclose(cfile);
  fprintf(stdout, "count = %d\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1150,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11ec <main+0x4c>
mov    0x2e16(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe25(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x90(%rbp),%rdi
lea    0xe1d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x118(%rbp)
cmpq   $0x0,-0x118(%rbp)
jne    1272 <main+0xd2>
lea    -0x90(%rbp),%rdi
lea    0xdf7(%rip),%rsi
call   10b0 <strcat@plt>
lea    -0x90(%rbp),%rdi
lea    0xde2(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x118(%rbp)
cmpq   $0x0,-0x118(%rbp)
jne    126d <main+0xcd>
mov    $0x1,%edi
call   10c0 <exit@plt>
jmp    130c <main+0x16c>
lea    -0x90(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x1144(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x1144(%rbp)
mov    %al,-0x1145(%rbp)
jle    12b4 <main+0x114>
movslq -0x1144(%rbp),%rax
movsbl -0x90(%rbp,%rax,1),%eax
ff
cmp    $0x2e,%eax
setne  %al
mov    %al,-0x1145(%rbp)
mov    -0x1145(%rbp),%al
test   $0x1,%al
jne    12c7 <main+0x127>
jmp    12e0 <main+0x140>
jmp    12cc <main+0x12c>
mov    -0x1144(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1144(%rbp)
jmp    1284 <main+0xe4>
movslq -0x1144(%rbp),%rax
movsbl -0x90(%rbp,%rax,1),%eax
ff
cmp    $0x2e,%eax
jne    1307 <main+0x167>
movslq -0x1144(%rbp),%rax
movb   $0x0,-0x90(%rbp,%rax,1)
jmp    130c <main+0x16c>
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rdi
lea    0xd04(%rip),%rsi
call   10b0 <strcat@plt>
lea    -0x110(%rbp),%rdi
lea    0xcf4(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x120(%rbp)
mov    -0x120(%rbp),%rdi
call   1090 <copy_header@plt>
mov    -0x120(%rbp),%rdi
lea    0xd51(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x120(%rbp),%rdi
lea    0xcbb(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x120(%rbp),%rdi
lea    0xcba(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x120(%rbp),%rdi
lea    0xcb9(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x120(%rbp),%rdi
lea    0xcfd(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
lea    0xc98(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x1138(%rbp)
movl   $0x0,-0x124(%rbp)
cmpl   $0xffffffff,-0x1138(%rbp)
je     174d <main+0x5ad>
movl   $0x0,-0x1134(%rbp)
lea    -0x1130(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1060 <memset@plt>
mov    -0x118(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %eax,-0x1138(%rbp)
cmp    $0xd,%eax
je     1479 <main+0x2d9>
cmpl   $0xffffffff,-0x1138(%rbp)
jne    1452 <main+0x2b2>
jmp    1479 <main+0x2d9>
mov    -0x1138(%rbp),%eax
mov    %al,%cl
mov    -0x1134(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x1134(%rbp)
cltq
mov    %cl,-0x1130(%rbp,%rax,1)
jmp    1425 <main+0x285>
movslq -0x1134(%rbp),%rax
movb   $0x0,-0x1130(%rbp,%rax,1)
cmpl   $0x0,-0x1134(%rbp)
jle    1736 <main+0x596>
cmpl   $0x0,-0x124(%rbp)
je     14b7 <main+0x317>
mov    -0x120(%rbp),%rdi
lea    0xbe2(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x120(%rbp),%rdi
mov    -0x124(%rbp),%edx
lea    0xbca(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x113c(%rbp)
movl   $0x0,-0x1140(%rbp)
movl   $0x0,-0x1144(%rbp)
mov    -0x1144(%rbp),%eax
cmp    -0x1134(%rbp),%eax
jge    16f0 <main+0x550>
cmpl   $0x0,-0x113c(%rbp)
je     15ea <main+0x44a>
movslq -0x1144(%rbp),%rax
movsbl -0x1130(%rbp,%rax,1),%eax
ff
cmp    $0x5c,%eax
jne    1541 <main+0x3a1>
mov    -0x120(%rbp),%rdi
lea    0xb71(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    15b9 <main+0x419>
movslq -0x1144(%rbp),%rax
movsbl -0x1130(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    1573 <main+0x3d3>
mov    -0x120(%rbp),%rdi
lea    0xb42(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    15b4 <main+0x414>
movslq -0x1144(%rbp),%rax
movsbl -0x1130(%rbp,%rax,1),%eax
ff
cmp    $0xd,%eax
je     15af <main+0x40f>
mov    -0x120(%rbp),%rdi
movslq -0x1144(%rbp),%rax
movsbl -0x1130(%rbp,%rax,1),%edx
ff
lea    0xb04(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    15b4 <main+0x414>
jmp    15b9 <main+0x419>
movslq -0x1144(%rbp),%rax
movsbl -0x1130(%rbp,%rax,1),%eax
ff
cmp    $0x22,%eax
jne    15e5 <main+0x445>
movl   $0x0,-0x113c(%rbp)
movl   $0x0,-0x1140(%rbp)
jmp    16d7 <main+0x537>
movslq -0x1144(%rbp),%rax
movsbl -0x1130(%rbp,%rax,1),%eax
ff
mov    %eax,-0x114c(%rbp)
sub    $0x22,%eax
je     1667 <main+0x4c7>
jmp    160d <main+0x46d>
mov    -0x114c(%rbp),%eax
sub    $0x2c,%eax
jne    16a4 <main+0x504>
jmp    1621 <main+0x481>
cmpl   $0x0,-0x1140(%rbp)
je     1643 <main+0x4a3>
mov    -0x120(%rbp),%rdi
lea    0xa73(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x120(%rbp),%rdi
lea    0xa61(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x1,-0x1140(%rbp)
jmp    16d2 <main+0x532>
mov    -0x120(%rbp),%rdi
movslq -0x1144(%rbp),%rax
movsbl -0x1130(%rbp,%rax,1),%edx
ff
lea    0xa28(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x1140(%rbp)
movl   $0x1,-0x113c(%rbp)
jmp    16d2 <main+0x532>
mov    -0x120(%rbp),%rdi
movslq -0x1144(%rbp),%rax
movsbl -0x1130(%rbp,%rax,1),%edx
ff
lea    0x9eb(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x1140(%rbp)
jmp    16d7 <main+0x537>
jmp    16dc <main+0x53c>
mov    -0x1144(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1144(%rbp)
jmp    14f0 <main+0x350>
cmpl   $0x0,-0x1140(%rbp)
je     1712 <main+0x572>
mov    -0x120(%rbp),%rdi
lea    0x9ab(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x120(%rbp),%rdi
lea    0x99a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
mov    -0x118(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %eax,-0x1138(%rbp)
jmp    13fb <main+0x25b>
mov    -0x120(%rbp),%rdi
lea    0x962(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x124(%rbp),%ecx
lea    0x944(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x118(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x120(%rbp),%rdi
call   1040 <fclose@plt>
mov    0x2834(%rip),%rax
mov    (%rax),%rdi
mov    -0x124(%rbp),%edx
lea    0x930(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
xor    %eax,%eax
add    $0x1150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1118,%rsp
mov    %rsi,%rbp
cmp    $0x1,%edi
jle    1598 <main+0x3d8>
mov    0x8(%rbp),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xe36(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1245 <main+0x85>
mov    %rax,%r15
lea    0x10(%rsp),%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    1235 <main+0x75>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
cmpb   $0x2e,0x10(%rsp,%rcx,1)
je     1235 <main+0x75>
lea    -0x1(%rax),%ecx
cmp    $0x1,%eax
mov    %ecx,%eax
jg     1220 <main+0x60>
xor    %eax,%eax
cltq
cmpb   $0x2e,0x10(%rsp,%rax,1)
jne    1274 <main+0xb4>
movb   $0x0,0x10(%rsp,%rax,1)
jmp    1274 <main+0xb4>
lea    0xde1(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   10c0 <strcat@plt>
lea    0xdcb(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <fopen@plt>
mov    %rax,%r15
test   %rax,%rax
je     15b4 <main+0x3f4>
mov    0x8(%rbp),%rsi
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xda3(%rip),%rsi
mov    %rbx,%rdi
call   10c0 <strcat@plt>
lea    0xd97(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   10a0 <copy_header@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1080 <fputc@plt>
lea    0xd72(%rip),%rdi
mov    $0x13,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
lea    0xd6d(%rip),%rdi
mov    $0x13,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
lea    0xd68(%rip),%rdi
mov    $0x18,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1080 <fputc@plt>
mov    %rbp,0x8(%rsp)
mov    0x8(%rbp),%rcx
lea    0xd52(%rip),%rsi
xor    %r14d,%r14d
mov    %rbx,%rdi
mov    %rcx,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
xor    %r13d,%r13d
jmp    1390 <main+0x1d0>
nopl   0x0(%rax,%rax,1)
test   %ebp,%ebp
je     135d <main+0x19d>
mov    $0x3,%esi
mov    $0x1,%edx
lea    0xd5e(%rip),%rdi
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xd49(%rip),%rdi
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    0x4(%rsp),%r13d
add    $0x1,%r13d
mov    %r15,%rdi
call   1070 <fgetc@plt>
cmp    $0xffffffff,%eax
je     1523 <main+0x363>
lea    0x110(%rsp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1060 <memset@plt>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1070 <fgetc@plt>
cmp    $0xffffffff,%eax
je     13d0 <main+0x210>
cmp    $0xd,%eax
je     13d0 <main+0x210>
mov    %al,0x110(%rsp,%rbp,1)
add    $0x1,%rbp
jmp    13b0 <main+0x1f0>
nop
mov    %ebp,%eax
movb   $0x0,0x110(%rsp,%rax,1)
test   %ebp,%ebp
je     137f <main+0x1bf>
test   %r13d,%r13d
je     13fc <main+0x23c>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xc9e(%rip),%rdi
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
xor    %r12d,%r12d
mov    %rbx,%rdi
lea    0xc8c(%rip),%rsi
mov    %r13d,0x4(%rsp)
mov    %r13d,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %ebp,%r13d
xor    %ebp,%ebp
xor    %eax,%eax
jmp    1459 <main+0x299>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xc77(%rip),%rdi
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
xor    %eax,%eax
cmpb   $0x22,0x110(%rsp,%r12,1)
setne  %al
cmove  %r14d,%ebp
add    $0x1,%r12
cmp    %r13,%r12
je     1340 <main+0x180>
movsbl 0x110(%rsp,%r12,1),%edi
test   %eax,%eax
je     1490 <main+0x2d0>
cmp    $0xa,%dil
je     1421 <main+0x261>
cmp    $0xd,%dil
je     143a <main+0x27a>
cmp    $0x5c,%dil
jne    14ec <main+0x32c>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xc1d(%rip),%rdi
jmp    1432 <main+0x272>
nopl   0x0(%rax,%rax,1)
cmp    $0x22,%edi
je     14f9 <main+0x339>
cmp    $0x2c,%edi
jne    1512 <main+0x352>
test   %ebp,%ebp
je     14b7 <main+0x2f7>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xbfd(%rip),%rdi
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    $0x3,%esi
mov    $0x1,%edx
lea    0xbe7(%rip),%rdi
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
add    $0x1,%r12
mov    $0x1,%ebp
mov    $0x0,%eax
cmp    %r13,%r12
jne    1459 <main+0x299>
jmp    1344 <main+0x184>
mov    %rbx,%rsi
call   1080 <fputc@plt>
jmp    143a <main+0x27a>
mov    $0x22,%edi
mov    %rbx,%rsi
call   1080 <fputc@plt>
xor    %ebp,%ebp
mov    $0x1,%eax
jmp    144c <main+0x28c>
mov    %rbx,%rsi
call   1080 <fputc@plt>
xor    %eax,%eax
xor    %ebp,%ebp
jmp    144c <main+0x28c>
lea    0xb90(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    0x8(%rsp),%rax
mov    0x8(%rax),%rdx
lea    0xb73(%rip),%rsi
mov    %rbx,%rdi
mov    %r13d,%ecx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x2a68(%rip),%rax
mov    (%rax),%rdi
lea    0xb67(%rip),%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
xor    %eax,%eax
add    $0x1118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2a41(%rip),%rax
movslq (%rax),%rdi
mov    0x0(%rbp),%rdx
lea    0xa53(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: %s <file> (assumed extension .txt)\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [5 x i8] c".txt\00"
@.str.3 = [3 x i8] c".c\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [20 x i8] c"#include <stdio.h>\0A\00"
@.str.7 = [20 x i8] c"#include \22types.h\22\0A\00"
@.str.8 = [25 x i8] c"#include \22mdbsupport.h\22\0A\00"
@.str.9 = [26 x i8] c"const %s %s_array [] = {\0A\00"
@.str.10 = [3 x i8] c",\0A\00"
@.str.11 = [17 x i8] c"{\09\09\09\09/* %6d */\0A\09\00"
@.str.12 = [3 x i8] c"\\\\\00"
@.str.13 = [3 x i8] c"\\n\00"
@.str.14 = [3 x i8] c"%c\00"
@.str.15 = [3 x i8] c"\22\22\00"
@.str.16 = [4 x i8] c",\0A\09\00"
@.str.17 = [4 x i8] c"\22\22\0A\00"
@.str.18 = [3 x i8] c"\0A}\00"
@.str.19 = [5 x i8] c"\0A};\0A\00"
@.str.20 = [34 x i8] c"\0Aconst int %s_array_length = %d;\0A\00"
@stdout = global i32* null
@.str.21 = [12 x i8] c"count = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [128 x i8]
%7 = alloca [128 x i8]
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca [4096 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 2
br i1 %18, label %19, label %28
19: ; preds = %2
%20 = load i32, i32* @stderr
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 0
%25 = load i8*, i8** %24
%26 = call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %25)
%27 = call i32 @exit(i32 1)
unreachable
28: ; preds = %2
%29 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32 @strcpy(i8* %29, i8* %32)
%34 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%35 = call i32* @fopen(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %35, i32** %8
%36 = load i32*, i32** %8
%37 = icmp ne i32* %36, null
br i1 %37, label %48, label %38
38: ; preds = %28
%39 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%40 = call i32 @strcat(i8* %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%41 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%42 = call i32* @fopen(i8* %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %42, i32** %8
%43 = load i32*, i32** %8
%44 = icmp ne i32* %43, null
br i1 %44, label %47, label %45
45: ; preds = %38
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %38
br label %79
48: ; preds = %28
%49 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%50 = call i32 @strlen(i8* %49)
store i32 %50, i32* %16
br label %51
51: ; preds = %64, %48
%52 = load i32, i32* %16
%53 = icmp sgt i32 %52, 0
br i1 %53, label %54, label %61
54: ; preds = %51
%55 = load i32, i32* %16
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 %56
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp ne i32 %59, 46
br label %61
61: ; preds = %54, %51
%62 = phi i1 [ false, %51 ], [ %60, %54 ]
br i1 %62, label %63, label %67
63: ; preds = %61
br label %64
64: ; preds = %63
%65 = load i32, i32* %16
%66 = add nsw i32 %65, -1
store i32 %66, i32* %16
br label %51
67: ; preds = %61
%68 = load i32, i32* %16
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 %69
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
%73 = icmp eq i32 %72, 46
br i1 %73, label %74, label %78
74: ; preds = %67
%75 = load i32, i32* %16
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 %76
store i8 0, i8* %77
br label %78
78: ; preds = %74, %67
br label %79
79: ; preds = %78, %47
%80 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%81 = load i8**, i8*** %5
%82 = getelementptr inbounds i8*, i8** %81, i64 1
%83 = load i8*, i8** %82
%84 = call i32 @strcpy(i8* %80, i8* %83)
%85 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%86 = call i32 @strcat(i8* %85, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%87 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%88 = call i32* @fopen(i8* %87, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %88, i32** %9
%89 = load i32*, i32** %9
%90 = call i32 @copy_header(i32* %89)
%91 = load i32*, i32** %9
%92 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%93 = load i32*, i32** %9
%94 = call i32 (i32*, i8*, ...) @fprintf(i32* %93, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%95 = load i32*, i32** %9
%96 = call i32 (i32*, i8*, ...) @fprintf(i32* %95, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
%97 = load i32*, i32** %9
%98 = call i32 (i32*, i8*, ...) @fprintf(i32* %97, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0))
%99 = load i32*, i32** %9
%100 = call i32 (i32*, i8*, ...) @fprintf(i32* %99, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%101 = load i32*, i32** %9
%102 = load i8**, i8*** %5
%103 = getelementptr inbounds i8*, i8** %102, i64 1
%104 = load i8*, i8** %103
%105 = load i8**, i8*** %5
%106 = getelementptr inbounds i8*, i8** %105, i64 1
%107 = load i8*, i8** %106
%108 = call i32 (i32*, i8*, ...) @fprintf(i32* %101, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i8* %104, i8* %107)
store i32 0, i32* %13
store i32 0, i32* %10
br label %109
109: ; preds = %246, %79
%110 = load i32, i32* %13
%111 = icmp ne i32 %110, -1
br i1 %111, label %112, label %249
112: ; preds = %109
store i32 0, i32* %12
%113 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%114 = call i32 @memset(i8* %113, i32 0, i32 4096)
br label %115
115: ; preds = %123, %112
%116 = load i32*, i32** %8
%117 = call i32 @fgetc(i32* %116)
store i32 %117, i32* %13
%118 = icmp ne i32 %117, 13
br i1 %118, label %119, label %130
119: ; preds = %115
%120 = load i32, i32* %13
%121 = icmp eq i32 %120, -1
br i1 %121, label %122, label %123
122: ; preds = %119
br label %130
123: ; preds = %119
%124 = load i32, i32* %13
%125 = trunc i32 %124 to i8
%126 = load i32, i32* %12
%127 = add nsw i32 %126, 1
store i32 %127, i32* %12
%128 = sext i32 %126 to i64
%129 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 %128
store i8 %125, i8* %129
br label %115
130: ; preds = %122, %115
%131 = load i32, i32* %12
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 %132
store i8 0, i8* %133
%134 = load i32, i32* %12
%135 = icmp sgt i32 %134, 0
br i1 %135, label %136, label %246
136: ; preds = %130
%137 = load i32, i32* %10
%138 = icmp ne i32 %137, 0
br i1 %138, label %139, label %142
139: ; preds = %136
%140 = load i32*, i32** %9
%141 = call i32 (i32*, i8*, ...) @fprintf(i32* %140, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %142
142: ; preds = %139, %136
%143 = load i32*, i32** %9
%144 = load i32, i32* %10
%145 = call i32 (i32*, i8*, ...) @fprintf(i32* %143, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i32 %144)
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
br label %146
146: ; preds = %232, %142
%147 = load i32, i32* %16
%148 = load i32, i32* %12
%149 = icmp slt i32 %147, %148
br i1 %149, label %150, label %235
150: ; preds = %146
%151 = load i32, i32* %14
%152 = icmp ne i32 %151, 0
br i1 %152, label %153, label %199
153: ; preds = %150
%154 = load i32, i32* %16
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 %155
%157 = load i8, i8* %156
%158 = sext i8 %157 to i32
%159 = icmp eq i32 %158, 92
br i1 %159, label %160, label %163
160: ; preds = %153
%161 = load i32*, i32** %9
%162 = call i32 (i32*, i8*, ...) @fprintf(i32* %161, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
br label %190
163: ; preds = %153
%164 = load i32, i32* %16
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 %165
%167 = load i8, i8* %166
%168 = sext i8 %167 to i32
%169 = icmp eq i32 %168, 10
br i1 %169, label %170, label %173
170: ; preds = %163
%171 = load i32*, i32** %9
%172 = call i32 (i32*, i8*, ...) @fprintf(i32* %171, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %189
173: ; preds = %163
%174 = load i32, i32* %16
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 %175
%177 = load i8, i8* %176
%178 = sext i8 %177 to i32
%179 = icmp ne i32 %178, 13
br i1 %179, label %180, label %188
180: ; preds = %173
%181 = load i32*, i32** %9
%182 = load i32, i32* %16
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 %183
%185 = load i8, i8* %184
%186 = sext i8 %185 to i32
%187 = call i32 (i32*, i8*, ...) @fprintf(i32* %181, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32 %186)
br label %188
188: ; preds = %180, %173
br label %189
189: ; preds = %188, %170
br label %190
190: ; preds = %189, %160
%191 = load i32, i32* %16
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 %192
%194 = load i8, i8* %193
%195 = sext i8 %194 to i32
%196 = icmp eq i32 %195, 34
br i1 %196, label %197, label %198
197: ; preds = %190
store i32 0, i32* %14
store i32 0, i32* %15
br label %198
198: ; preds = %197, %190
br label %231
199: ; preds = %150
%200 = load i32, i32* %16
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 %201
%203 = load i8, i8* %202
%204 = sext i8 %203 to i32
switch i32 %204, label %222 [
i32 44, label %205
i32 34, label %214
]
205: ; preds = %199
%206 = load i32, i32* %15
%207 = icmp ne i32 %206, 0
br i1 %207, label %208, label %211
208: ; preds = %205
%209 = load i32*, i32** %9
%210 = call i32 (i32*, i8*, ...) @fprintf(i32* %209, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
br label %211
211: ; preds = %208, %205
%212 = load i32*, i32** %9
%213 = call i32 (i32*, i8*, ...) @fprintf(i32* %212, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
store i32 1, i32* %15
br label %230
214: ; preds = %199
%215 = load i32*, i32** %9
%216 = load i32, i32* %16
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 %217
%219 = load i8, i8* %218
%220 = sext i8 %219 to i32
%221 = call i32 (i32*, i8*, ...) @fprintf(i32* %215, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32 %220)
store i32 0, i32* %15
store i32 1, i32* %14
br label %230
222: ; preds = %199
%223 = load i32*, i32** %9
%224 = load i32, i32* %16
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 %225
%227 = load i8, i8* %226
%228 = sext i8 %227 to i32
%229 = call i32 (i32*, i8*, ...) @fprintf(i32* %223, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32 %228)
store i32 0, i32* %15
br label %230
230: ; preds = %222, %214, %211
br label %231
231: ; preds = %230, %198
br label %232
232: ; preds = %231
%233 = load i32, i32* %16
%234 = add nsw i32 %233, 1
store i32 %234, i32* %16
br label %146
235: ; preds = %146
%236 = load i32, i32* %15
%237 = icmp ne i32 %236, 0
br i1 %237, label %238, label %241
238: ; preds = %235
%239 = load i32*, i32** %9
%240 = call i32 (i32*, i8*, ...) @fprintf(i32* %239, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
br label %241
241: ; preds = %238, %235
%242 = load i32*, i32** %9
%243 = call i32 (i32*, i8*, ...) @fprintf(i32* %242, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
%244 = load i32, i32* %10
%245 = add nsw i32 %244, 1
store i32 %245, i32* %10
br label %246
246: ; preds = %241, %130
%247 = load i32*, i32** %8
%248 = call i32 @fgetc(i32* %247)
store i32 %248, i32* %13
br label %109
249: ; preds = %109
%250 = load i32*, i32** %9
%251 = call i32 (i32*, i8*, ...) @fprintf(i32* %250, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%252 = load i32*, i32** %9
%253 = load i8**, i8*** %5
%254 = getelementptr inbounds i8*, i8** %253, i64 1
%255 = load i8*, i8** %254
%256 = load i32, i32* %10
%257 = call i32 (i32*, i8*, ...) @fprintf(i32* %252, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.20, i64 0, i64 0), i8* %255, i32 %256)
%258 = load i32*, i32** %8
%259 = call i32 @fclose(i32* %258)
%260 = load i32*, i32** %9
%261 = call i32 @fclose(i32* %260)
%262 = load i32*, i32** @stdout
%263 = load i32, i32* %10
%264 = call i32 (i32*, i8*, ...) @fprintf(i32* %262, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i64 0, i64 0), i32 %263)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: %s <file> (assumed extension .txt)\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [5 x i8] c".txt\00"
@.str.3 = [3 x i8] c".c\00"
@.str.4 = [2 x i8] c"w\00"
@.str.6 = [20 x i8] c"#include <stdio.h>\0A\00"
@.str.7 = [20 x i8] c"#include \22types.h\22\0A\00"
@.str.8 = [25 x i8] c"#include \22mdbsupport.h\22\0A\00"
@.str.9 = [26 x i8] c"const %s %s_array [] = {\0A\00"
@.str.10 = [3 x i8] c",\0A\00"
@.str.11 = [17 x i8] c"{\09\09\09\09/* %6d */\0A\09\00"
@.str.12 = [3 x i8] c"\\\\\00"
@.str.13 = [3 x i8] c"\\n\00"
@.str.15 = [3 x i8] c"\22\22\00"
@.str.16 = [4 x i8] c",\0A\09\00"
@.str.17 = [4 x i8] c"\22\22\0A\00"
@.str.18 = [3 x i8] c"\0A}\00"
@.str.19 = [5 x i8] c"\0A};\0A\00"
@.str.20 = [34 x i8] c"\0Aconst int %s_array_length = %d;\0A\00"
@stdout = global i32* null
@.str.21 = [12 x i8] c"count = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [128 x i8]
%4 = alloca [128 x i8]
%5 = alloca [4096 x i8]
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%9 = icmp slt i32 %0, 2
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load i8*, i8** %1
%15 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %13, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @strcpy(i8* %6, i8* %19)
%21 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %29
23: ; preds = %17
%24 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%25 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%26 = icmp eq i32* %25, null
br i1 %26, label %27, label %48
27: ; preds = %23
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %17
%30 = call i32 @strlen(i8* %6)
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %41
32: ; preds = %29, %38
%33 = phi i32 [ %39, %38 ], [ %30, %29 ]
%34 = zext i32 %33 to i64
%35 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = icmp eq i8 %36, 46
br i1 %37, label %41, label %38
38: ; preds = %32
%39 = add nsw i32 %33, -1
%40 = icmp sgt i32 %33, 1
br i1 %40, label %32, label %41
41: ; preds = %32, %38, %29
%42 = phi i32 [ %30, %29 ], [ 0, %38 ], [ %33, %32 ]
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = icmp eq i8 %45, 46
br i1 %46, label %47, label %48
47: ; preds = %41
store i8 0, i8* %44
br label %48
48: ; preds = %41, %47, %23
%49 = phi i32* [ %21, %47 ], [ %21, %41 ], [ %25, %23 ]
%50 = load i8*, i8** %18
%51 = call i32 @strcpy(i8* %7, i8* %50)
%52 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%53 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%54 = call i32 @copy_header(i32* %53)
%55 = call i32 @fputc(i32 10, i32* %53)
%56 = call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i64 19, i64 1, i32* %53)
%57 = call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i64 19, i64 1, i32* %53)
%58 = call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i64 24, i64 1, i32* %53)
%59 = call i32 @fputc(i32 10, i32* %53)
%60 = load i8*, i8** %18
%61 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i8* %60, i8* %60)
br label %62
62: ; preds = %48, %135
%63 = phi i32 [ 0, %48 ], [ %136, %135 ]
%64 = call i32 @memset(i8* %8, i32 0, i32 4096)
br label %65
65: ; preds = %68, %62
%66 = phi i64 [ %70, %68 ], [ 0, %62 ]
%67 = call i32 @fgetc(i32* %49)
switch i32 %67, label %68 [
i32 -1, label %72
i32 13, label %72
]
68: ; preds = %65
%69 = trunc i32 %67 to i8
%70 = add nuw i64 %66, 1
%71 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 %66
store i8 %69, i8* %71
br label %65
72: ; preds = %65, %65
%73 = trunc i64 %66 to i32
%74 = and i64 %66, 4294967295
%75 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 %74
store i8 0, i8* %75
%76 = icmp eq i32 %73, 0
br i1 %76, label %135, label %77
77: ; preds = %72
%78 = icmp eq i32 %63, 0
br i1 %78, label %81, label %79
79: ; preds = %77
%80 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i64 2, i64 1, i32* %53)
br label %81
81: ; preds = %79, %77
%82 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i32 %63)
%83 = and i64 %66, 4294967295
br label %84
84: ; preds = %120, %81
%85 = phi i64 [ 0, %81 ], [ %121, %120 ]
%86 = phi i32 [ 0, %81 ], [ %122, %120 ]
%87 = phi i32 [ 0, %81 ], [ %123, %120 ]
%88 = icmp eq i32 %87, 0
%89 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 %85
%90 = load i8, i8* %89
br i1 %88, label %105, label %91
91: ; preds = %84
switch i8 %90, label %96 [
i8 92, label %92
i8 10, label %94
i8 13, label %99
]
92: ; preds = %91
%93 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i64 2, i64 1, i32* %53)
br label %99
94: ; preds = %91
%95 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i64 2, i64 1, i32* %53)
br label %99
96: ; preds = %91
%97 = sext i8 %90 to i32
%98 = call i32 @fputc(i32 %97, i32* %53)
br label %99
99: ; preds = %91, %94, %96, %92
%100 = load i8, i8* %89
%101 = icmp eq i8 %100, 34
%102 = xor i1 %101, true
%103 = zext i1 %102 to i32
%104 = select i1 %101, i32 0, i32 %86
br label %115
105: ; preds = %84
%106 = sext i8 %90 to i32
switch i32 %106, label %113 [
i32 44, label %107
i32 34, label %111
]
107: ; preds = %105
%108 = icmp eq i32 %86, 0
br i1 %108, label %124, label %109
109: ; preds = %107
%110 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i64 2, i64 1, i32* %53)
br label %124
111: ; preds = %105
%112 = call i32 @fputc(i32 34, i32* %53)
br label %115
113: ; preds = %105
%114 = call i32 @fputc(i32 %106, i32* %53)
br label %115
115: ; preds = %99, %113, %111
%116 = phi i32 [ 0, %113 ], [ 1, %111 ], [ %103, %99 ]
%117 = phi i32 [ 0, %113 ], [ 0, %111 ], [ %104, %99 ]
%118 = add nuw nsw i64 %85, 1
%119 = icmp eq i64 %118, %83
br i1 %119, label %128, label %120
120: ; preds = %115, %124
%121 = phi i64 [ %118, %115 ], [ %126, %124 ]
%122 = phi i32 [ %117, %115 ], [ 1, %124 ]
%123 = phi i32 [ %116, %115 ], [ 0, %124 ]
br label %84
124: ; preds = %107, %109
%125 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i64 3, i64 1, i32* %53)
%126 = add nuw nsw i64 %85, 1
%127 = icmp eq i64 %126, %83
br i1 %127, label %130, label %120
128: ; preds = %115
%129 = icmp eq i32 %117, 0
br i1 %129, label %132, label %130
130: ; preds = %124, %128
%131 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i64 3, i64 1, i32* %53)
br label %132
132: ; preds = %130, %128
%133 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i64 2, i64 1, i32* %53)
%134 = add nsw i32 %63, 1
br label %135
135: ; preds = %132, %72
%136 = phi i32 [ %134, %132 ], [ %63, %72 ]
%137 = call i32 @fgetc(i32* %49)
%138 = icmp eq i32 %137, -1
br i1 %138, label %139, label %62
139: ; preds = %135
%140 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i64 4, i64 1, i32* %53)
%141 = load i8*, i8** %18
%142 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.20, i64 0, i64 0), i8* %141, i32 %136)
%143 = call i32 @fclose(i32* %49)
%144 = call i32 @fclose(i32* %53)
%145 = load i32*, i32** @stdout
%146 = call i32 (i32*, i8*, ...) @fprintf(i32* %145, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i64 0, i64 0), i32 %136)
ret i32 0
}