#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 */
#define EOF 128
int atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ *stderr;
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int main(int argc, char *argv[]) {
  char *outputFile;
  int tsize;
  FILE *in, *out;
  int argnum;
  int c, index, written;
  int linestart;
  if (argc == 1) {
    printf("usage:");
    printf("  tpc [-o <c_file>] [-ts <max_token_size>] tcl_file ...\n");
    return 0;
  }
  outputFile = "tpc.out";
  tsize = -1;
  argnum = 1;
  while (argc > argnum && argv[argnum][0] == '-') {
    if (strncmp(argv[argnum], "-o", 2) == 0) {
      if (strlen(argv[argnum]) > 2) {
        outputFile = &argv[argnum][2];
        argnum++;
      } else {
        if (argc > argnum + 1) {
          outputFile = argv[argnum + 1];
          argnum += 2;
        } else {
          fprintf(stderr, "tpc: missing file name for -o\n");
          return -1;
        }
      }
    } else if (strncmp(argv[argnum], "-ts", 3) == 0) {
      if (strlen(argv[argnum]) > 3) {
        tsize = atoi(&argv[argnum][3]);
        argnum++;
      } else {
        if (argc > argnum + 1) {
          tsize = atoi(argv[argnum + 1]);
          argnum += 2;
        } else {
          fprintf(stderr, "tpc: missing token size for -ts\n");
          return -1;
        }
      }
    } else {
      fprintf(stderr, "tpc: unknown option \"%s\".\n", argv[argnum]);
      return -1;
    }
  }
  if (argc == argnum) {
    fprintf(stderr, "tpc: no input files specified.\n");
    return -1;
  }
  if ((out = fopen(outputFile, "w")) == NULL) {
    fprintf(stderr, "tpc: open output file %s", outputFile);
    perror("");
    return -1;
  }
  if (tsize > 0)
    fprintf(out, "\nstatic char _tpc_array[][%d] = {\n\"", tsize);
  else
    fprintf(out, "\nstatic char _tpc_array[] = {\n\"");
  written = 0;
  linestart = 1;
  while (argnum < argc) {
    if ((in = fopen(argv[argnum], "r")) == NULL) {
      fprintf(stderr, "tpc: open file %s", argv[argnum]);
      perror("");
      continue;
    }
    while (1) {
      c = getc(in);
      if (linestart == 1) {
        switch (c) {
        case '#':
          while ((c = getc(in) != '\n') && c != EOF) {
          };
          break;
        case ' ':
        case '\t':
        case '\n':
        case EOF:
          break;
        default:
          linestart = 0;
        }
      }
      if (c == EOF)
        break;
      if (linestart == 0) {
        switch (c) {
        case '\t':
          fprintf(out, "\\t");
          written++;
          break;
        case '\n':
          fprintf(out, "\\n");
          written++;
          linestart = 1;
          break;
        case '\\':
        case '\"':
          fputc('\\', out);
        default:
          fputc(c, out);
          written++;
        }
      }
      if (tsize > 0)
        if (written == tsize) {
          fprintf(out, "\",\n\"");
          written = 0;
        }
    }
    fclose(in);
    argnum++;
  }
  fprintf(out, "\"\n};\n\n");
  fprintf(out, "char *");
  index = strlen(outputFile) - 1;
  while (outputFile[index] != '/' && index-- > 0)
    ;
  index++;
  written = 0;
  while ((c = outputFile[index++]) != '\0') {
    if (c == '.' || c == '-')
      break;
    fputc(c, out);
    written++;
  }
  if (written == 0) {
    fprintf(stderr, "tpc: can't build variable name from \"%s\".\n",
            outputFile);
    fclose(out);
    return -1;
  }
  if (tsize > 0)
    fprintf(out, " = _tpc_array[0];\n");
  else
    fprintf(out, " = _tpc_array;\n");
  fclose(out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11e4 <main+0x44>
lea    0xe39(%rip),%rdi
call   1060 <printf@plt>
lea    0xe34(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1880 <main+0x6e0>
lea    0xe55(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0x34(%rbp),%ecx
mov    %al,-0x45(%rbp)
jle    1226 <main+0x86>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x45(%rbp)
mov    -0x45(%rbp),%al
test   $0x1,%al
jne    1236 <main+0x96>
jmp    1402 <main+0x262>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdff(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    12fb <main+0x15b>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <strlen@plt>
cmp    $0x2,%eax
jle    1299 <main+0xf9>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12f6 <main+0x156>
mov    -0x8(%rbp),%eax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jle    12cd <main+0x12d>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x34(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x34(%rbp)
jmp    12f1 <main+0x151>
mov    0x2d0c(%rip),%rax
mov    (%rax),%rdi
lea    0xd6d(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1880 <main+0x6e0>
jmp    12f6 <main+0x156>
jmp    13fd <main+0x25d>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd5c(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    13c8 <main+0x228>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <strlen@plt>
cmp    $0x3,%eax
jle    1362 <main+0x1c2>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x3,%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    13c3 <main+0x223>
mov    -0x8(%rbp),%eax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jle    139a <main+0x1fa>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x34(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x34(%rbp)
jmp    13be <main+0x21e>
mov    0x2c3f(%rip),%rax
mov    (%rax),%rdi
lea    0xcc3(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1880 <main+0x6e0>
jmp    13c3 <main+0x223>
jmp    13f8 <main+0x258>
mov    0x2c11(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xcaa(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1880 <main+0x6e0>
jmp    13fd <main+0x25d>
jmp    11fd <main+0x5d>
mov    -0x8(%rbp),%eax
cmp    -0x34(%rbp),%eax
jne    1432 <main+0x292>
mov    0x2bcb(%rip),%rax
mov    (%rax),%rdi
lea    0xc8b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1880 <main+0x6e0>
mov    -0x18(%rbp),%rdi
lea    0xc8d(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    1484 <main+0x2e4>
mov    0x2b89(%rip),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rdx
lea    0xc67(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    0xcdb(%rip),%rdi
call   10a0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1880 <main+0x6e0>
cmpl   $0x0,-0x1c(%rbp)
jle    14a8 <main+0x308>
mov    -0x30(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xc49(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    14ba <main+0x31a>
mov    -0x30(%rbp),%rdi
lea    0xc56(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x40(%rbp)
movl   $0x1,-0x44(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1727 <main+0x587>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc42(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    152f <main+0x38f>
mov    0x2adf(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xc14(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    0xc29(%rip),%rdi
call   10a0 <perror@plt>
jmp    14c8 <main+0x328>
jmp    1534 <main+0x394>
mov    -0x28(%rbp),%rdi
call   10c0 <getc@plt>
movsbl %al,%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x1,-0x44(%rbp)
jne    1605 <main+0x465>
mov    -0x38(%rbp),%eax
mov    %eax,-0x4c(%rbp)
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     15f4 <main+0x454>
jmp    1564 <main+0x3c4>
mov    -0x4c(%rbp),%eax
sub    $0x20,%eax
je     15f4 <main+0x454>
jmp    1575 <main+0x3d5>
mov    -0x4c(%rbp),%eax
sub    $0x23,%eax
je     1599 <main+0x3f9>
jmp    1586 <main+0x3e6>
mov    -0x4c(%rbp),%eax
sub    $0x80,%eax
je     15f4 <main+0x454>
jmp    15f9 <main+0x459>
jmp    159e <main+0x3fe>
mov    -0x28(%rbp),%rdi
call   10c0 <getc@plt>
movsbl %al,%eax
cmp    $0xa,%eax
setne  %cl
mov    %cl,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x38(%rbp)
xor    %eax,%eax
test   $0x1,%cl
mov    %al,-0x4d(%rbp)
jne    15cd <main+0x42d>
jmp    15da <main+0x43a>
cmpl   $0x80,-0x38(%rbp)
setne  %al
mov    %al,-0x4d(%rbp)
mov    -0x4d(%rbp),%al
test   $0x1,%al
jne    15ea <main+0x44a>
jmp    15ef <main+0x44f>
jmp    159e <main+0x3fe>
jmp    1600 <main+0x460>
jmp    1600 <main+0x460>
movl   $0x0,-0x44(%rbp)
jmp    1605 <main+0x465>
cmpl   $0x80,-0x38(%rbp)
jne    1617 <main+0x477>
jmp    1710 <main+0x570>
cmpl   $0x0,-0x44(%rbp)
jne    16d7 <main+0x537>
mov    -0x38(%rbp),%eax
mov    %eax,-0x54(%rbp)
sub    $0x9,%eax
je     1668 <main+0x4c8>
jmp    1635 <main+0x495>
mov    -0x54(%rbp),%eax
sub    $0xa,%eax
je     1688 <main+0x4e8>
jmp    1646 <main+0x4a6>
mov    -0x54(%rbp),%eax
sub    $0x22,%eax
je     16af <main+0x50f>
jmp    1657 <main+0x4b7>
mov    -0x54(%rbp),%eax
sub    $0x5c,%eax
je     16af <main+0x50f>
jmp    16bd <main+0x51d>
mov    -0x30(%rbp),%rdi
lea    0xaca(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    16d2 <main+0x532>
mov    -0x30(%rbp),%rdi
lea    0xaad(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
movl   $0x1,-0x44(%rbp)
jmp    16d2 <main+0x532>
mov    -0x30(%rbp),%rsi
mov    $0x5c,%edi
call   1070 <fputc@plt>
mov    -0x38(%rbp),%edi
mov    -0x30(%rbp),%rsi
call   1070 <fputc@plt>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    16d7 <main+0x537>
cmpl   $0x0,-0x1c(%rbp)
jle    170b <main+0x56b>
mov    -0x40(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    1706 <main+0x566>
mov    -0x30(%rbp),%rdi
lea    0xa4b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x40(%rbp)
jmp    170b <main+0x56b>
jmp    1534 <main+0x394>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    14c8 <main+0x328>
mov    -0x30(%rbp),%rdi
lea    0xa16(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xa0b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x2f,%ecx
mov    %al,-0x55(%rbp)
je     1788 <main+0x5e8>
mov    -0x3c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x3c(%rbp)
cmp    $0x0,%eax
setg   %al
mov    %al,-0x55(%rbp)
mov    -0x55(%rbp),%al
test   $0x1,%al
jne    1798 <main+0x5f8>
jmp    179d <main+0x5fd>
jmp    175a <main+0x5ba>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x3c(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x38(%rbp)
cmp    $0x0,%eax
je     1802 <main+0x662>
cmpl   $0x2e,-0x38(%rbp)
je     17e3 <main+0x643>
cmpl   $0x2d,-0x38(%rbp)
jne    17e8 <main+0x648>
jmp    1802 <main+0x662>
mov    -0x38(%rbp),%edi
mov    -0x30(%rbp),%rsi
call   1070 <fputc@plt>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    17ad <main+0x60d>
cmpl   $0x0,-0x40(%rbp)
jne    183d <main+0x69d>
mov    0x27cd(%rip),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rdx
lea    0x935(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1880 <main+0x6e0>
cmpl   $0x0,-0x1c(%rbp)
jle    185e <main+0x6be>
mov    -0x30(%rbp),%rdi
lea    0x92f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1870 <main+0x6d0>
mov    -0x30(%rbp),%rdi
lea    0x92b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x1,%edi
jne    11ef <main+0x2f>
lea    0xe95(%rip),%rdi
call   1070 <printf@plt>
lea    0xff4(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
jmp    133e <main+0x17e>
mov    %rsi,%r15
mov    %edi,%ebx
jle    12fb <main+0x13b>
mov    $0xffffffff,%r12d
lea    0xe6c(%rip),%rax
mov    %rax,(%rsp)
mov    $0x1,%r13d
jmp    1241 <main+0x81>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r15,%r14,8),%rdi
add    $0x3,%rdi
call   10c0 <atoi@plt>
mov    %eax,%r12d
mov    $0x1,%eax
add    %eax,%r13d
cmp    %ebx,%r13d
jge    134d <main+0x18d>
mov    %r13d,%r14d
mov    (%r15,%r14,8),%rdi
movzbl (%rdi),%ebp
cmp    $0x2d,%bpl
jne    134d <main+0x18d>
lea    0xe1f(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
mov    (%r15,%r14,8),%rdi
test   %rax,%rax
je     12c0 <main+0x100>
lea    0xe27(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1607 <main+0x447>
mov    (%r15,%r14,8),%rdi
call   1060 <strlen@plt>
cmp    $0x4,%eax
jge    1220 <main+0x60>
lea    0x1(%r13),%eax
cmp    %ebx,%eax
jge    1650 <main+0x490>
mov    %eax,%eax
mov    (%r15,%rax,8),%rdi
call   10c0 <atoi@plt>
mov    %eax,%r12d
jmp    12f1 <main+0x131>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1060 <strlen@plt>
cmp    $0x3,%eax
jl     12db <main+0x11b>
mov    (%r15,%r14,8),%rax
add    $0x2,%rax
mov    %rax,(%rsp)
jmp    1230 <main+0x70>
lea    0x1(%r13),%eax
cmp    %ebx,%eax
jge    1691 <main+0x4d1>
mov    %eax,%eax
mov    (%r15,%rax,8),%rax
mov    %rax,(%rsp)
mov    $0x2,%eax
jmp    1235 <main+0x75>
mov    $0x1,%r13d
lea    0xd6b(%rip),%rax
mov    %rax,(%rsp)
mov    $0xffffffff,%r12d
xor    %ebp,%ebp
cmp    %ebx,%r13d
jne    135a <main+0x19a>
mov    0x2cc0(%rip),%rax
mov    (%rax),%rcx
lea    0xdb3(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1,%edx
call   10d0 <fwrite@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x2d,%bpl
setne  %bpl
cmp    %ebx,%r13d
je     1319 <main+0x159>
lea    0xd9c(%rip),%rsi
mov    (%rsp),%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     16ac <main+0x4ec>
mov    %rax,%rbx
test   %r12d,%r12d
jle    1521 <main+0x361>
lea    0xd92(%rip),%rsi
mov    %rbx,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
test   %bpl,%bpl
je     1543 <main+0x383>
movslq %r13d,%r13
mov    (%r15,%r13,8),%rdi
lea    0xdb2(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    13fa <main+0x23a>
lea    0xd9e(%rip),%r14
mov    0x2c1b(%rip),%rax
mov    (%rax),%rdi
mov    (%r15,%r13,8),%rdx
lea    0xd8b(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0xda0(%rip),%rdi
call   10b0 <perror@plt>
mov    (%r15,%r13,8),%rdi
mov    %r14,%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     13be <main+0x1fe>
mov    %rax,%rbp
mov    $0x1,%r13d
jmp    1519 <main+0x359>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbp,%rdi
call   10e0 <getc@plt>
movsbl %al,%r15d
cmp    $0x1,%r13d
jne    1460 <main+0x2a0>
lea    -0x9(%r15),%eax
cmp    $0x1a,%eax
ja     14a6 <main+0x2e6>
mov    $0x1,%r13d
lea    0xbc8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   10e0 <getc@plt>
cmp    $0xa,%al
jne    1450 <main+0x290>
jmp    14cb <main+0x30b>
xchg   %ax,%ax
cmp    $0x21,%r15d
jg     14a0 <main+0x2e0>
cmp    $0x9,%r15d
je     14de <main+0x31e>
cmp    $0xa,%r15d
jne    14b9 <main+0x2f9>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xcf0(%rip),%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
add    $0x1,%r14d
mov    $0x1,%r13d
jmp    14cb <main+0x30b>
nopw   0x0(%rax,%rax,1)
cmp    $0x22,%r15d
je     14ac <main+0x2ec>
cmp    $0x5c,%r15d
jne    14b9 <main+0x2f9>
mov    $0x5c,%edi
mov    %rbx,%rsi
call   1080 <fputc@plt>
mov    %r15d,%edi
mov    %rbx,%rsi
call   1080 <fputc@plt>
add    $0x1,%r14d
xor    %r13d,%r13d
test   %r12d,%r12d
jle    1410 <main+0x250>
cmp    %r12d,%r14d
je     1500 <main+0x340>
jmp    1410 <main+0x250>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xc81(%rip),%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
jmp    14c4 <main+0x304>
nopl   0x0(%rax)
mov    $0x4,%esi
mov    $0x1,%edx
lea    0xc65(%rip),%rdi
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
xor    %r14d,%r14d
jmp    1410 <main+0x250>
lea    0xc14(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
test   %bpl,%bpl
jne    139c <main+0x1dc>
lea    0xc31(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
lea    0xc1f(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    (%rsp),%r13
mov    %r13,%rdi
call   1060 <strlen@plt>
add    $0xffffffff,%eax
movslq %eax,%rdx
xor    %ecx,%ecx
test   %edx,%edx
cmovs  %edx,%ecx
add    $0xffffffff,%ecx
add    $0x1,%rdx
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x2f,-0x1(%r13,%rdx,1)
je     15b3 <main+0x3f3>
add    $0xffffffff,%eax
add    $0xffffffffffffffff,%rdx
jg     15a0 <main+0x3e0>
mov    %ecx,%eax
cltq
lea    (%rax,%r13,1),%r14
add    $0x1,%r14
xor    %ebp,%ebp
movabs $0x600000000001,%r15
jmp    15df <main+0x41f>
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
mov    %rbx,%rsi
call   1080 <fputc@plt>
add    $0x1,%rbp
movzbl (%r14,%rbp,1),%eax
cmp    $0x2e,%rax
ja     15d0 <main+0x410>
bt     %rax,%r15
jae    15d0 <main+0x410>
test   %ebp,%ebp
je     1628 <main+0x468>
test   %r12d,%r12d
jle    166b <main+0x4ab>
lea    0xbb4(%rip),%rdi
mov    $0x12,%esi
jmp    1677 <main+0x4b7>
mov    0x29d2(%rip),%rax
mov    (%rax),%rdi
mov    (%r15,%r14,8),%rdx
lea    0xaa6(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    1339 <main+0x179>
mov    0x29b1(%rip),%rax
mov    (%rax),%rdi
lea    0xb50(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
jmp    1339 <main+0x179>
mov    0x2989(%rip),%rax
mov    (%rax),%rcx
lea    0xa40(%rip),%rdi
mov    $0x20,%esi
jmp    132f <main+0x16f>
lea    0xb55(%rip),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
jmp    11e8 <main+0x28>
mov    0x2948(%rip),%rax
mov    (%rax),%rcx
lea    0x9dc(%rip),%rdi
mov    $0x1e,%esi
jmp    132f <main+0x16f>
mov    0x292d(%rip),%rax
mov    (%rax),%rdi
lea    0xa42(%rip),%rsi
mov    (%rsp),%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0xab2(%rip),%rdi
call   10b0 <perror@plt>
jmp    1339 <main+0x179>

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

LLVM IR (-O2):
@.str = [7 x i8] c"usage:\00"
@.str.2 = [8 x i8] c"tpc.out\00"
@.str.3 = [3 x i8] c"-o\00"
@stderr = global i32* null
@.str.4 = [31 x i8] c"tpc: missing file name for -o\0A\00"
@.str.5 = [4 x i8] c"-ts\00"
@.str.6 = [33 x i8] c"tpc: missing token size for -ts\0A\00"
@.str.7 = [27 x i8] c"tpc: unknown option \22%s\22.\0A\00"
@.str.8 = [32 x i8] c"tpc: no input files specified.\0A\00"
@.str.9 = [2 x i8] c"w\00"
@.str.10 = [25 x i8] c"tpc: open output file %s\00"
@.str.11 = [1 x i8] zeroinitializer
@.str.12 = [36 x i8] c"\0Astatic char _tpc_array[][%d] = {\0A\22\00"
@.str.13 = [32 x i8] c"\0Astatic char _tpc_array[] = {\0A\22\00"
@.str.14 = [2 x i8] c"r\00"
@.str.15 = [18 x i8] c"tpc: open file %s\00"
@.str.16 = [3 x i8] c"\\t\00"
@.str.17 = [3 x i8] c"\\n\00"
@.str.18 = [5 x i8] c"\22,\0A\22\00"
@.str.19 = [7 x i8] c"\22\0A};\0A\0A\00"
@.str.20 = [7 x i8] c"char *\00"
@.str.21 = [43 x i8] c"tpc: can't build variable name from \22%s\22.\0A\00"
@.str.22 = [19 x i8] c" = _tpc_array[0];\0A\00"
@.str.23 = [16 x i8] c" = _tpc_array;\0A\00"
@str = [56 x i8] c" tpc [-o <c_file>] [-ts <max_token_size>] tcl_file ...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 1
br i1 %5, label %9, label %75
6: ; preds = %2
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
br label %189
9: ; preds = %4, %64
%10 = phi i32 [ %68, %64 ], [ 1, %4 ]
%11 = phi i8* [ %67, %64 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), %4 ]
%12 = phi i32 [ %66, %64 ], [ -1, %4 ]
%13 = zext i32 %10 to i64
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 45
br i1 %17, label %18, label %70
18: ; preds = %9
%19 = tail call i64 @strncmp(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%20 = icmp eq i64 %19, 0
%21 = load i8*, i8** %14
br i1 %20, label %22, label %38
22: ; preds = %18
%23 = tail call i32 @strlen(i8* %21)
%24 = icmp sgt i32 %23, 2
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i8*, i8** %14
%27 = getelementptr inbounds i8, i8* %26, i64 2
br label %64
28: ; preds = %22
%29 = add nuw nsw i32 %10, 1
%30 = icmp slt i32 %29, %0
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = zext i32 %29 to i64
%33 = getelementptr inbounds i8*, i8** %1, i64 %32
%34 = load i8*, i8** %33
br label %64
35: ; preds = %28
%36 = load i32*, i32** @stderr
%37 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i64 30, i64 1, i32* %36)
br label %189
38: ; preds = %18
%39 = tail call i64 @strncmp(i8* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 3)
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %60
41: ; preds = %38
%42 = load i8*, i8** %14
%43 = tail call i32 @strlen(i8* %42)
%44 = icmp sgt i32 %43, 3
br i1 %44, label %45, label %49
45: ; preds = %41
%46 = load i8*, i8** %14
%47 = getelementptr inbounds i8, i8* %46, i64 3
%48 = tail call i32 @atoi(i8* %47)
br label %64
49: ; preds = %41
%50 = add nuw nsw i32 %10, 1
%51 = icmp slt i32 %50, %0
br i1 %51, label %52, label %57
52: ; preds = %49
%53 = zext i32 %50 to i64
%54 = getelementptr inbounds i8*, i8** %1, i64 %53
%55 = load i8*, i8** %54
%56 = tail call i32 @atoi(i8* %55)
br label %64
57: ; preds = %49
%58 = load i32*, i32** @stderr
%59 = tail call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i64 32, i64 1, i32* %58)
br label %189
60: ; preds = %38
%61 = load i32*, i32** @stderr
%62 = load i8*, i8** %14
%63 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %61, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i8* %62)
br label %189
64: ; preds = %52, %45, %25, %31
%65 = phi i32 [ 2, %52 ], [ 1, %45 ], [ 1, %25 ], [ 2, %31 ]
%66 = phi i32 [ %56, %52 ], [ %48, %45 ], [ %12, %25 ], [ %12, %31 ]
%67 = phi i8* [ %11, %52 ], [ %11, %45 ], [ %27, %25 ], [ %34, %31 ]
%68 = add nuw nsw i32 %10, %65
%69 = icmp slt i32 %68, %0
br i1 %69, label %9, label %70
70: ; preds = %64, %9
%71 = phi i32 [ %12, %9 ], [ %66, %64 ]
%72 = phi i8* [ %11, %9 ], [ %67, %64 ]
%73 = phi i32 [ %10, %9 ], [ %68, %64 ]
%74 = xor i1 %17, true
br label %75
75: ; preds = %70, %4
%76 = phi i32 [ -1, %4 ], [ %71, %70 ]
%77 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), %4 ], [ %72, %70 ]
%78 = phi i32 [ 1, %4 ], [ %73, %70 ]
%79 = phi i1 [ false, %4 ], [ %74, %70 ]
%80 = icmp eq i32 %78, %0
br i1 %80, label %81, label %84
81: ; preds = %75
%82 = load i32*, i32** @stderr
%83 = tail call i64 @fwrite(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i64 31, i64 1, i32* %82)
br label %189
84: ; preds = %75
%85 = tail call i32* @fopen(i8* %77, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%86 = icmp eq i32* %85, null
br i1 %86, label %87, label %91
87: ; preds = %84
%88 = load i32*, i32** @stderr
%89 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %88, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i8* %77)
%90 = tail call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0))
br label %189
91: ; preds = %84
%92 = icmp sgt i32 %76, 0
br i1 %92, label %93, label %95
93: ; preds = %91
%94 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %85, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0), i32 %76)
br label %97
95: ; preds = %91
%96 = tail call i64 @fwrite(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i64 0, i64 0), i64 31, i64 1, i32* %85)
br label %97
97: ; preds = %95, %93
br i1 %79, label %98, label %145
98: ; preds = %97
%99 = sext i32 %78 to i64
%100 = getelementptr inbounds i8*, i8** %1, i64 %99
%101 = load i8*, i8** %100
%102 = tail call i32* @fopen(i8* %101, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%103 = icmp eq i32* %102, null
br i1 %103, label %106, label %104
104: ; preds = %106, %98
%105 = phi i32* [ %102, %98 ], [ %112, %106 ]
br label %114
106: ; preds = %98, %106
%107 = load i32*, i32** @stderr
%108 = load i8*, i8** %100
%109 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %107, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0), i8* %108)
%110 = tail call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0))
%111 = load i8*, i8** %100
%112 = tail call i32* @fopen(i8* %111, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%113 = icmp eq i32* %112, null
br i1 %113, label %106, label %104
114: ; preds = %143, %104
%115 = phi i32 [ 0, %104 ], [ %144, %143 ]
%116 = phi i32 [ 1, %104 ], [ %138, %143 ]
%117 = tail call signext i8 @getc(i32* %105)
%118 = sext i8 %117 to i32
%119 = icmp eq i32 %116, 1
br i1 %119, label %120, label %124
120: ; preds = %114
switch i32 %118, label %133 [
i32 35, label %121
i32 32, label %136
i32 9, label %136
i32 10, label %136
i32 92, label %131
i32 34, label %131
]
121: ; preds = %120, %121
%122 = tail call signext i8 @getc(i32* %105)
%123 = icmp eq i8 %122, 10
br i1 %123, label %136, label %121
124: ; preds = %114
switch i32 %118, label %133 [
i32 9, label %125
i32 10, label %128
i32 92, label %131
i32 34, label %131
]
125: ; preds = %124
%126 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i64 2, i64 1, i32* %85)
%127 = add nsw i32 %115, 1
br label %136
128: ; preds = %124
%129 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i64 2, i64 1, i32* %85)
%130 = add nsw i32 %115, 1
br label %136
131: ; preds = %120, %120, %124, %124
%132 = tail call i32 @fputc(i32 92, i32* %85)
br label %133
133: ; preds = %120, %124, %131
%134 = tail call i32 @fputc(i32 %118, i32* %85)
%135 = add nsw i32 %115, 1
br label %136
136: ; preds = %121, %120, %120, %120, %125, %128, %133
%137 = phi i32 [ %135, %133 ], [ %130, %128 ], [ %127, %125 ], [ %115, %120 ], [ %115, %120 ], [ %115, %120 ], [ %115, %121 ]
%138 = phi i32 [ 0, %133 ], [ 1, %128 ], [ 0, %125 ], [ 1, %120 ], [ 1, %120 ], [ 1, %120 ], [ 1, %121 ]
%139 = icmp eq i32 %137, %76
%140 = select i1 %92, i1 %139, i1 false
br i1 %140, label %141, label %143
141: ; preds = %136
%142 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i64 4, i64 1, i32* %85)
br label %143
143: ; preds = %141, %136
%144 = phi i32 [ 0, %141 ], [ %137, %136 ]
br label %114
145: ; preds = %97
%146 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i64 6, i64 1, i32* %85)
%147 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i64 6, i64 1, i32* %85)
%148 = tail call i32 @strlen(i8* %77)
%149 = add i32 %148, -1
%150 = sext i32 %149 to i64
%151 = call i32 @llvm.smin.i32(i32 %149, i32 0)
%152 = add i32 %151, -1
br label %153
153: ; preds = %158, %145
%154 = phi i64 [ %159, %158 ], [ %150, %145 ]
%155 = getelementptr inbounds i8, i8* %77, i64 %154
%156 = load i8, i8* %155
%157 = icmp eq i8 %156, 47
br i1 %157, label %161, label %158
158: ; preds = %153
%159 = add nsw i64 %154, -1
%160 = icmp sgt i64 %154, 0
br i1 %160, label %153, label %163
161: ; preds = %153
%162 = trunc i64 %154 to i32
br label %163
163: ; preds = %158, %161
%164 = phi i32 [ %162, %161 ], [ %152, %158 ]
%165 = sext i32 %164 to i64
br label %166
166: ; preds = %172, %163
%167 = phi i64 [ %169, %172 ], [ %165, %163 ]
%168 = phi i32 [ %175, %172 ], [ 0, %163 ]
%169 = add nsw i64 %167, 1
%170 = getelementptr inbounds i8, i8* %77, i64 %169
%171 = load i8, i8* %170
switch i8 %171, label %172 [
i8 46, label %176
i8 45, label %176
i8 0, label %176
]
172: ; preds = %166
%173 = sext i8 %171 to i32
%174 = tail call i32 @fputc(i32 %173, i32* %85)
%175 = add nuw nsw i32 %168, 1
br label %166
176: ; preds = %166, %166, %166
%177 = icmp eq i32 %168, 0
br i1 %177, label %178, label %182
178: ; preds = %176
%179 = load i32*, i32** @stderr
%180 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %179, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.21, i64 0, i64 0), i8* %77)
%181 = tail call i32 @fclose(i32* %85)
br label %189
182: ; preds = %176
br i1 %92, label %183, label %185
183: ; preds = %182
%184 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.22, i64 0, i64 0), i64 18, i64 1, i32* %85)
br label %187
185: ; preds = %182
%186 = tail call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.23, i64 0, i64 0), i64 15, i64 1, i32* %85)
br label %187
187: ; preds = %185, %183
%188 = tail call i32 @fclose(i32* %85)
br label %189
189: ; preds = %187, %178, %87, %81, %60, %57, %35, %6
%190 = phi i32 [ 0, %6 ], [ -1, %35 ], [ -1, %57 ], [ -1, %60 ], [ -1, %81 ], [ -1, %87 ], [ -1, %178 ], [ 0, %187 ]
ret i32 %190
}