#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*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int sscanf(char *, char *, char *, char *, ...);
int /*<<< orphan*/ *stderr;
char *strchr(char *, char);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
int main(int ac, char **av) {
  FILE *pInputFile, *pColumnsFile, *pStreamsFile, *pTablesFile;
  char szColumn[80], szTable[80], szLine[1024], szDuplicate[80],
      szLastTable[80], *cp;
  int nLineNumber = 0, nColumnCount = 1, bError = 0, nTableCount = 0,
      nRNGUsage = 1;
  if (ac != 2)
    bError = 1;
  pInputFile = fopen(av[1], "r");
  if (pInputFile == NULL)
    bError = 1;
  pColumnsFile = fopen("columns.h", "w");
  if (pColumnsFile == NULL)
    bError = 1;
  pStreamsFile = fopen("streams.h", "w");
  if (pStreamsFile == NULL)
    bError = 1;
  pTablesFile = fopen("tables.h", "w");
  if (pTablesFile == NULL)
    bError = 1;
  if (bError) {
    fprintf(stderr, "USAGE:\n\t%s file -- build headers based on file\n",
            av[0]);
    fprintf(stderr, "\tcolumns.h and streams.h produced as a result\n");
    exit(-1);
  }
  szLastTable[0] = '\0';
  fprintf(pColumnsFile,
          "/*\n * THIS IS A GENERATED FILE\n * SEE COLUMNS.LIST\n*/\n");
  fprintf(pStreamsFile,
          "/*\n * THIS IS A GENERATED FILE\n * SEE COLUMNS.LIST\n*/\n");
  fprintf(pTablesFile,
          "/*\n * THIS IS A GENERATED FILE\n * SEE COLUMNS.LIST\n*/\n");
  fprintf(pColumnsFile, "#ifndef COLUMNS_H\n#define COLUMNS_H\n");
  fprintf(pStreamsFile, "#ifndef STREAMS_H\n#define STREAMS_H\n");
  fprintf(pStreamsFile, "rng_t Streams[] = {\n{0, 0, 0, 0, 0, 0, 0},\n");
  fprintf(pTablesFile, "#ifndef TABLES_H\n#define TABLES_H\n");
  while (fgets(szLine, 1024, pInputFile) != NULL) {
    nLineNumber += 1;
    szColumn[0] = szTable[0] = szDuplicate[0] = '\0';
    nRNGUsage = 1;
    if ((cp = strchr(szLine, '#')) != NULL)
      *cp = '\0';
    if (!strlen(szLine))
      continue;
    if (sscanf(szLine, "%s %s %d %s", szColumn, szTable, &nRNGUsage,
               szDuplicate) != 4) {
      strcpy(szDuplicate, szColumn);
      if (sscanf(szLine, "%s %s %d", szColumn, szTable, &nRNGUsage) != 3) {
        if (sscanf(szLine, "%s %s", szColumn, szTable) != 2)
          continue;
      }
    }
    fprintf(pStreamsFile, "{0, %d, 0, 0, %s, %s, %s},\n", nRNGUsage, szColumn,
            szTable, szDuplicate);
    if (strcmp(szLastTable, szTable)) {
      if (strlen(szLastTable))
        fprintf(pColumnsFile, "#define %s_END\t%d\n", szLastTable,
                nColumnCount - 1);
      fprintf(pColumnsFile, "#define %s_START\t%d\n", szTable, nColumnCount);
      fprintf(pTablesFile, "#define %s\t%d\n", szTable, nTableCount++);
      strcpy(szLastTable, szTable);
    }
    fprintf(pColumnsFile, "#define %s\t%d\n", szColumn, nColumnCount++);
  }
  fprintf(pStreamsFile, "{-1, -1, -1, -1, -1, -1, -1}\n};\n");
  fprintf(pStreamsFile, "#endif\n");
  fprintf(pColumnsFile, "#define %s_END\t%d\n", szLastTable, nColumnCount - 1);
  fprintf(pColumnsFile, "#define MAX_COLUMN\t%d\n", nColumnCount - 1);
  fprintf(pColumnsFile, "#endif\n");
  fprintf(pTablesFile, "#define PSEUDO_TABLE_START\t%d\n", nTableCount);
  fprintf(pTablesFile,
          "/* PSEUDO TABLES from here on; used in hierarchies */\n");
  fprintf(pTablesFile, "#define ITEM_BRAND\t%d\n", nTableCount++);
  fprintf(pTablesFile, "#define ITEM_CLASS\t%d\n", nTableCount++);
  fprintf(pTablesFile, "#define ITEM_CATEGORY\t%d\n", nTableCount++);
  fprintf(pTablesFile, "#define DIVISIONS\t%d\n", nTableCount++);
  fprintf(pTablesFile, "#define COMPANY\t%d\n", nTableCount++);
  fprintf(pTablesFile, "#define CONCURRENT_WEB_SITES\t%d\n", nTableCount++);
  fprintf(pTablesFile, "#define ACTIVE_CITIES\t%d\n", nTableCount++);
  fprintf(pTablesFile, "#define ACTIVE_COUNTIES\t%d\n", nTableCount++);
  fprintf(pTablesFile, "#define ACTIVE_STATES\t%d\n", nTableCount);
  fprintf(pTablesFile, "#define MAX_TABLE\t%d\n", nTableCount);
  fprintf(pTablesFile, "#endif\n");
  fclose(pStreamsFile);
  fclose(pColumnsFile);
  fclose(pInputFile);
  fclose(pTablesFile);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x590,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x57c(%rbp)
movl   $0x1,-0x580(%rbp)
movl   $0x0,-0x584(%rbp)
movl   $0x0,-0x588(%rbp)
movl   $0x1,-0x58c(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11ff <main+0x5f>
movl   $0x1,-0x584(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf2(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    122c <main+0x8c>
movl   $0x1,-0x584(%rbp)
lea    0xdcf(%rip),%rdi
lea    0xdd2(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1258 <main+0xb8>
movl   $0x1,-0x584(%rbp)
lea    0xdaf(%rip),%rdi
lea    0xda6(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1284 <main+0xe4>
movl   $0x1,-0x584(%rbp)
lea    0xd8d(%rip),%rdi
lea    0xd7a(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    12b0 <main+0x110>
movl   $0x1,-0x584(%rbp)
cmpl   $0x0,-0x584(%rbp)
je     12fe <main+0x15e>
mov    0x2d1c(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd4c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2cfd(%rip),%rax
mov    (%rax),%rdi
lea    0xd64(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
movb   $0x0,-0x570(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xd70(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xd5e(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xd4c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd71(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xd84(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xd97(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xdb1(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
lea    -0x4d0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x400,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     15ca <main+0x42a>
mov    -0x57c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x57c(%rbp)
movb   $0x0,-0x520(%rbp)
movb   $0x0,-0xd0(%rbp)
movb   $0x0,-0x80(%rbp)
movl   $0x1,-0x58c(%rbp)
lea    -0x4d0(%rbp),%rdi
mov    $0x23,%esi
call   1060 <strchr@plt>
mov    %rax,-0x578(%rbp)
cmp    $0x0,%rax
je     13f9 <main+0x259>
mov    -0x578(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x4d0(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x0,%rax
jne    1414 <main+0x274>
jmp    1383 <main+0x1e3>
lea    -0x4d0(%rbp),%rdi
lea    -0x80(%rbp),%rdx
lea    -0xd0(%rbp),%rcx
lea    -0x520(%rbp),%r9
lea    0xd1c(%rip),%rsi
lea    -0x58c(%rbp),%r8
mov    $0x0,%al
call   10a0 <sscanf@plt>
cmp    $0x4,%eax
je     14c3 <main+0x323>
lea    -0x520(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x4d0(%rbp),%rdi
lea    -0x80(%rbp),%rdx
lea    -0xd0(%rbp),%rcx
lea    0xce8(%rip),%rsi
lea    -0x58c(%rbp),%r8
mov    $0x0,%al
call   10a0 <sscanf@plt>
cmp    $0x3,%eax
je     14be <main+0x31e>
lea    -0x4d0(%rbp),%rdi
lea    -0x80(%rbp),%rdx
lea    -0xd0(%rbp),%rcx
lea    0xcc1(%rip),%rsi
mov    $0x0,%al
call   10a0 <sscanf@plt>
cmp    $0x2,%eax
je     14b9 <main+0x319>
jmp    1383 <main+0x1e3>
jmp    14be <main+0x31e>
jmp    14c3 <main+0x323>
mov    -0x28(%rbp),%rdi
mov    -0x58c(%rbp),%edx
lea    -0x80(%rbp),%rcx
lea    -0xd0(%rbp),%r8
lea    -0x520(%rbp),%r9
lea    0xc85(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
lea    -0x570(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     159e <main+0x3fe>
lea    -0x570(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x0,%rax
je     1542 <main+0x3a2>
mov    -0x20(%rbp),%rdi
lea    -0x570(%rbp),%rdx
mov    -0x580(%rbp),%ecx
sub    $0x1,%ecx
lea    0xc4c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    -0xd0(%rbp),%rdx
mov    -0x580(%rbp),%ecx
lea    0xc40(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    -0xd0(%rbp),%rdx
mov    -0x588(%rbp),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x588(%rbp)
lea    0xc2b(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
lea    -0x570(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
lea    -0x80(%rbp),%rdx
mov    -0x580(%rbp),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x580(%rbp)
lea    0xbf1(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1383 <main+0x1e3>
mov    -0x28(%rbp),%rdi
lea    0xbe9(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xbf8(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    -0x570(%rbp),%rdx
mov    -0x580(%rbp),%ecx
sub    $0x1,%ecx
lea    0xb7e(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x580(%rbp),%edx
sub    $0x1,%edx
lea    0xbc3(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xba9(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x588(%rbp),%edx
lea    0xbb0(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xbbd(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x588(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x588(%rbp)
lea    0xbd1(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x588(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x588(%rbp)
lea    0xbc5(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x588(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x588(%rbp)
lea    0xbb9(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x588(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x588(%rbp)
lea    0xbb0(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x588(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x588(%rbp)
lea    0xba3(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x588(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x588(%rbp)
lea    0xb94(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x588(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x588(%rbp)
lea    0xb92(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x588(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x588(%rbp)
lea    0xb89(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x588(%rbp),%edx
lea    0xb8d(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x588(%rbp),%edx
lea    0xb8f(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xa25(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@plt>
xor    %edi,%edi
call   10c0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x588,%rsp
mov    %rsi,%rbx
mov    %edi,%r14d
movl   $0x1,0xc(%rsp)
mov    0x8(%rsi),%rdi
lea    0xe36(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,0x20(%rsp)
lea    0xe27(%rip),%rdi
lea    0xe2a(%rip),%rbp
mov    %rbp,%rsi
call   10a0 <fopen@plt>
mov    %rax,0x18(%rsp)
lea    0xe18(%rip),%rdi
mov    %rbp,%rsi
call   10a0 <fopen@plt>
mov    %rax,0x28(%rsp)
lea    0xe0e(%rip),%rdi
mov    %rbp,%rsi
call   10a0 <fopen@plt>
mov    %rax,0x38(%rsp)
test   %rax,%rax
je     133c <main+0x19c>
cmpq   $0x0,0x28(%rsp)
je     133c <main+0x19c>
cmpq   $0x0,0x18(%rsp)
je     133c <main+0x19c>
cmp    $0x2,%r14d
jne    133c <main+0x19c>
cmpq   $0x0,0x20(%rsp)
je     133c <main+0x19c>
movb   $0x0,0x40(%rsp)
lea    0xe26(%rip),%r14
mov    $0x36,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    0x18(%rsp),%rbp
mov    %rbp,%rcx
call   10c0 <fwrite@plt>
mov    $0x36,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    0x28(%rsp),%rbx
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
mov    $0x36,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    0x38(%rsp),%r14
mov    %r14,%rcx
call   10c0 <fwrite@plt>
lea    0xe08(%rip),%rdi
mov    $0x24,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   10c0 <fwrite@plt>
lea    0xe14(%rip),%rdi
mov    $0x24,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
lea    0xe20(%rip),%rdi
mov    $0x2b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
lea    0xe33(%rip),%rdi
mov    $0x22,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10c0 <fwrite@plt>
lea    0x180(%rsp),%rdi
mov    $0x400,%esi
mov    0x20(%rsp),%rdx
call   1060 <fgets@plt>
test   %rax,%rax
jne    137c <main+0x1dc>
xor    %eax,%eax
mov    %rax,0x30(%rsp)
movl   $0x1,0x8(%rsp)
jmp    15ae <main+0x40e>
mov    0x2c9d(%rip),%rbp
mov    0x0(%rbp),%rdi
mov    (%rbx),%rdx
lea    0xcd0(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x0(%rbp),%rcx
lea    0xcee(%rip),%rdi
mov    $0x2e,%esi
mov    $0x1,%edx
call   10c0 <fwrite@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
mov    $0x1,%eax
mov    %rax,0x10(%rsp)
lea    0x180(%rsp),%r15
lea    0x130(%rsp),%r12
lea    0xe0(%rsp),%r14
lea    0xc(%rsp),%rbp
lea    0x90(%rsp),%rbx
xor    %eax,%eax
mov    %rax,0x30(%rsp)
jmp    1414 <main+0x274>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x18(%rsp),%rdi
mov    0x10(%rsp),%rcx
lea    0xdde(%rip),%r13
lea    0x1(%rcx),%ebx
mov    %r13,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r15,%rdi
mov    $0x400,%esi
mov    0x20(%rsp),%rdx
call   1060 <fgets@plt>
mov    %ebx,0x8(%rsp)
mov    %ebx,%ecx
mov    %rcx,0x10(%rsp)
test   %rax,%rax
lea    0xc(%rsp),%rbp
lea    0x90(%rsp),%rbx
je     15ae <main+0x40e>
mov    0x20(%rsp),%r13
jmp    1439 <main+0x299>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    $0x400,%esi
mov    %r13,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     15a5 <main+0x405>
movb   $0x0,0x90(%rsp)
movb   $0x0,0xe0(%rsp)
movb   $0x0,0x130(%rsp)
movl   $0x1,0xc(%rsp)
mov    %r15,%rdi
mov    $0x23,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     146e <main+0x2ce>
movb   $0x0,(%rax)
cmpb   $0x0,0x180(%rsp)
je     1420 <main+0x280>
mov    %r15,%rdi
lea    0xcce(%rip),%rsi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %rbp,%r8
mov    %rbx,%r9
xor    %eax,%eax
call   1090 <sscanf@plt>
cmp    $0x4,%eax
je     14e4 <main+0x344>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
lea    0xcad(%rip),%rsi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %rbp,%r8
xor    %eax,%eax
call   1090 <sscanf@plt>
cmp    $0x3,%eax
je     14e4 <main+0x344>
mov    %r15,%rdi
lea    0xc97(%rip),%rsi
mov    %r12,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1090 <sscanf@plt>
cmp    $0x2,%eax
jne    1420 <main+0x280>
mov    0xc(%rsp),%edx
mov    0x28(%rsp),%rdi
lea    0xc77(%rip),%rsi
mov    %r12,%rcx
mov    %r14,%r8
mov    %rbx,%r9
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0x40(%rsp),%rdi
mov    %r14,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     13c0 <main+0x220>
cmpb   $0x0,0x40(%rsp)
mov    0x18(%rsp),%rbp
lea    0x40(%rsp),%rdx
je     1544 <main+0x3a4>
mov    0x10(%rsp),%rax
lea    -0x1(%rax),%ecx
mov    %rbp,%rdi
lea    0xc4a(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbp,%rdi
lea    0xc4c(%rip),%rsi
mov    %r14,%rdx
mov    0x10(%rsp),%rcx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x30(%rsp),%rcx
lea    0x1(%rcx),%eax
mov    %eax,0x8(%rsp)
mov    0x38(%rsp),%rdi
lea    0xc3a(%rip),%r13
mov    %r13,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0x40(%rsp),%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbp,%rdi
mov    0x10(%rsp),%rcx
mov    0x8(%rsp),%eax
mov    %rax,0x30(%rsp)
jmp    13d1 <main+0x231>
mov    0x10(%rsp),%rax
mov    %eax,0x8(%rsp)
lea    0xc09(%rip),%rdi
mov    $0x20,%esi
mov    $0x1,%edx
mov    0x28(%rsp),%r13
mov    %r13,%rcx
call   10c0 <fwrite@plt>
lea    0xc0c(%rip),%r14
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %r13,%rcx
call   10c0 <fwrite@plt>
mov    0x8(%rsp),%ebp
add    $0xffffffff,%ebp
lea    0xb91(%rip),%rsi
lea    0x40(%rsp),%rdx
mov    0x18(%rsp),%r15
mov    %r15,%rdi
mov    %ebp,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xbd4(%rip),%rsi
mov    %r15,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %r15,%rcx
call   10c0 <fwrite@plt>
lea    0xbc3(%rip),%rsi
mov    0x38(%rsp),%rbx
mov    %rbx,%rdi
mov    0x30(%rsp),%r14
mov    %r14d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xbc4(%rip),%rdi
mov    $0x36,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
lea    0x1(%r14),%r12d
lea    0xbde(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0x2(%r14),%ebp
lea    0xbdd(%rip),%rsi
mov    %rbx,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0x3(%r14),%r12d
lea    0xbdc(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0x4(%r14),%ebp
lea    0xbdf(%rip),%rsi
mov    %rbx,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0x5(%r14),%r12d
lea    0xbdd(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0x6(%r14),%ebp
lea    0xbda(%rip),%rsi
mov    %rbx,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0x7(%r14),%r12d
lea    0xbe3(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
add    $0x8,%r14d
lea    0xbe6(%rip),%rsi
mov    %rbx,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xbee(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xbf4(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x7,%esi
mov    $0x1,%edx
lea    0xa7e(%rip),%rdi
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
mov    %r13,%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    0x20(%rsp),%rdi
call   1040 <fclose@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %edi,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [10 x i8] c"columns.h\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [10 x i8] c"streams.h\00"
@.str.4 = [9 x i8] c"tables.h\00"
@stderr = global i32* null
@.str.5 = [48 x i8] c"USAGE:\0A\09%s file -- build headers based on file\0A\00"
@.str.6 = [47 x i8] c"\09columns.h and streams.h produced as a result\0A\00"
@.str.7 = [55 x i8] c"/*\0A * THIS IS A GENERATED FILE\0A * SEE COLUMNS.LIST\0A*/\0A\00"
@.str.8 = [37 x i8] c"#ifndef COLUMNS_H\0A#define COLUMNS_H\0A\00"
@.str.9 = [37 x i8] c"#ifndef STREAMS_H\0A#define STREAMS_H\0A\00"
@.str.10 = [44 x i8] c"rng_t Streams[] = {\0A{0, 0, 0, 0, 0, 0, 0},\0A\00"
@.str.11 = [35 x i8] c"#ifndef TABLES_H\0A#define TABLES_H\0A\00"
@.str.12 = [12 x i8] c"%s %s %d %s\00"
@.str.13 = [9 x i8] c"%s %s %d\00"
@.str.14 = [6 x i8] c"%s %s\00"
@.str.15 = [28 x i8] c"{0, %d, 0, 0, %s, %s, %s},\0A\00"
@.str.16 = [19 x i8] c"#define %s_END\09%d\0A\00"
@.str.17 = [21 x i8] c"#define %s_START\09%d\0A\00"
@.str.18 = [15 x i8] c"#define %s\09%d\0A\00"
@.str.19 = [33 x i8] c"{-1, -1, -1, -1, -1, -1, -1}\0A};\0A\00"
@.str.20 = [8 x i8] c"#endif\0A\00"
@.str.21 = [23 x i8] c"#define MAX_COLUMN\09%d\0A\00"
@.str.22 = [31 x i8] c"#define PSEUDO_TABLE_START\09%d\0A\00"
@.str.23 = [55 x i8] c"/* PSEUDO TABLES from here on; used in hierarchies */\0A\00"
@.str.24 = [23 x i8] c"#define ITEM_BRAND\09%d\0A\00"
@.str.25 = [23 x i8] c"#define ITEM_CLASS\09%d\0A\00"
@.str.26 = [26 x i8] c"#define ITEM_CATEGORY\09%d\0A\00"
@.str.27 = [22 x i8] c"#define DIVISIONS\09%d\0A\00"
@.str.28 = [20 x i8] c"#define COMPANY\09%d\0A\00"
@.str.29 = [33 x i8] c"#define CONCURRENT_WEB_SITES\09%d\0A\00"
@.str.30 = [26 x i8] c"#define ACTIVE_CITIES\09%d\0A\00"
@.str.31 = [28 x i8] c"#define ACTIVE_COUNTIES\09%d\0A\00"
@.str.32 = [26 x i8] c"#define ACTIVE_STATES\09%d\0A\00"
@.str.33 = [22 x i8] c"#define MAX_TABLE\09%d\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 [80 x i8]
%11 = alloca [80 x i8]
%12 = alloca [1024 x i8]
%13 = alloca [80 x i8]
%14 = alloca [80 x i8]
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %16
store i32 1, i32* %17
store i32 0, i32* %18
store i32 0, i32* %19
store i32 1, i32* %20
%21 = load i32, i32* %4
%22 = icmp ne i32 %21, 2
br i1 %22, label %23, label %24
23: ; preds = %2
store i32 1, i32* %18
br label %24
24: ; preds = %23, %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32* @fopen(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %28, i32** %6
%29 = load i32*, i32** %6
%30 = icmp eq i32* %29, null
br i1 %30, label %31, label %32
31: ; preds = %24
store i32 1, i32* %18
br label %32
32: ; preds = %31, %24
%33 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %33, i32** %7
%34 = load i32*, i32** %7
%35 = icmp eq i32* %34, null
br i1 %35, label %36, label %37
36: ; preds = %32
store i32 1, i32* %18
br label %37
37: ; preds = %36, %32
%38 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %38, i32** %8
%39 = load i32*, i32** %8
%40 = icmp eq i32* %39, null
br i1 %40, label %41, label %42
41: ; preds = %37
store i32 1, i32* %18
br label %42
42: ; preds = %41, %37
%43 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %43, i32** %9
%44 = load i32*, i32** %9
%45 = icmp eq i32* %44, null
br i1 %45, label %46, label %47
46: ; preds = %42
store i32 1, i32* %18
br label %47
47: ; preds = %46, %42
%48 = load i32, i32* %18
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %59
50: ; preds = %47
%51 = load i32*, i32** @stderr
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 0
%54 = load i8*, i8** %53
%55 = call i32 (i32*, i8*, ...) @fprintf(i32* %51, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0), i8* %54)
%56 = load i32*, i32** @stderr
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %56, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
%58 = call i32 @exit(i32 -1)
unreachable
59: ; preds = %47
%60 = getelementptr inbounds [80 x i8], [80 x i8]* %14, i64 0, i64 0
store i8 0, i8* %60
%61 = load i32*, i32** %7
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %61, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
%63 = load i32*, i32** %8
%64 = call i32 (i32*, i8*, ...) @fprintf(i32* %63, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
%65 = load i32*, i32** %9
%66 = call i32 (i32*, i8*, ...) @fprintf(i32* %65, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
%67 = load i32*, i32** %7
%68 = call i32 (i32*, i8*, ...) @fprintf(i32* %67, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0))
%69 = load i32*, i32** %8
%70 = call i32 (i32*, i8*, ...) @fprintf(i32* %69, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0))
%71 = load i32*, i32** %8
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %71, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.10, i64 0, i64 0))
%73 = load i32*, i32** %9
%74 = call i32 (i32*, i8*, ...) @fprintf(i32* %73, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0))
br label %75
75: ; preds = %155, %118, %95, %59
%76 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%77 = load i32*, i32** %6
%78 = call i32* @fgets(i8* %76, i32 1024, i32* %77)
%79 = icmp ne i32* %78, null
br i1 %79, label %80, label %161
80: ; preds = %75
%81 = load i32, i32* %16
%82 = add nsw i32 %81, 1
store i32 %82, i32* %16
%83 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
store i8 0, i8* %83
%84 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
store i8 0, i8* %84
%85 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
store i8 0, i8* %85
store i32 1, i32* %20
%86 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%87 = call i8* @strchr(i8* %86, i8 signext 35)
store i8* %87, i8** %15
%88 = icmp ne i8* %87, null
br i1 %88, label %89, label %91
89: ; preds = %80
%90 = load i8*, i8** %15
store i8 0, i8* %90
br label %91
91: ; preds = %89, %80
%92 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%93 = call i64 @strlen(i8* %92)
%94 = icmp ne i64 %93, 0
br i1 %94, label %96, label %95
95: ; preds = %91
br label %75
96: ; preds = %91
%97 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%98 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%99 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%100 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%101 = call i32 (i8*, i8*, i8*, i8*, ...) @sscanf(i8* %97, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), i8* %98, i8* %99, i32* %20, i8* %100)
%102 = icmp ne i32 %101, 4
br i1 %102, label %103, label %121
103: ; preds = %96
%104 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%105 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%106 = call i32 @strcpy(i8* %104, i8* %105)
%107 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%108 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%109 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%110 = call i32 (i8*, i8*, i8*, i8*, ...) @sscanf(i8* %107, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8* %108, i8* %109, i32* %20)
%111 = icmp ne i32 %110, 3
br i1 %111, label %112, label %120
112: ; preds = %103
%113 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%114 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%115 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%116 = call i32 (i8*, i8*, i8*, i8*, ...) @sscanf(i8* %113, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %114, i8* %115)
%117 = icmp ne i32 %116, 2
br i1 %117, label %118, label %119
118: ; preds = %112
br label %75
119: ; preds = %112
br label %120
120: ; preds = %119, %103
br label %121
121: ; preds = %120, %96
%122 = load i32*, i32** %8
%123 = load i32, i32* %20
%124 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%125 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%126 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%127 = call i32 (i32*, i8*, ...) @fprintf(i32* %122, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0), i32 %123, i8* %124, i8* %125, i8* %126)
%128 = getelementptr inbounds [80 x i8], [80 x i8]* %14, i64 0, i64 0
%129 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%130 = call i64 @strcmp(i8* %128, i8* %129)
%131 = icmp ne i64 %130, 0
br i1 %131, label %132, label %155
132: ; preds = %121
%133 = getelementptr inbounds [80 x i8], [80 x i8]* %14, i64 0, i64 0
%134 = call i64 @strlen(i8* %133)
%135 = icmp ne i64 %134, 0
br i1 %135, label %136, label %142
136: ; preds = %132
%137 = load i32*, i32** %7
%138 = getelementptr inbounds [80 x i8], [80 x i8]* %14, i64 0, i64 0
%139 = load i32, i32* %17
%140 = sub nsw i32 %139, 1
%141 = call i32 (i32*, i8*, ...) @fprintf(i32* %137, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i8* %138, i32 %140)
br label %142
142: ; preds = %136, %132
%143 = load i32*, i32** %7
%144 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%145 = load i32, i32* %17
%146 = call i32 (i32*, i8*, ...) @fprintf(i32* %143, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0), i8* %144, i32 %145)
%147 = load i32*, i32** %9
%148 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%149 = load i32, i32* %19
%150 = add nsw i32 %149, 1
store i32 %150, i32* %19
%151 = call i32 (i32*, i8*, ...) @fprintf(i32* %147, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0), i8* %148, i32 %149)
%152 = getelementptr inbounds [80 x i8], [80 x i8]* %14, i64 0, i64 0
%153 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%154 = call i32 @strcpy(i8* %152, i8* %153)
br label %155
155: ; preds = %142, %121
%156 = load i32*, i32** %7
%157 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%158 = load i32, i32* %17
%159 = add nsw i32 %158, 1
store i32 %159, i32* %17
%160 = call i32 (i32*, i8*, ...) @fprintf(i32* %156, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0), i8* %157, i32 %158)
br label %75
161: ; preds = %75
%162 = load i32*, i32** %8
%163 = call i32 (i32*, i8*, ...) @fprintf(i32* %162, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.19, i64 0, i64 0))
%164 = load i32*, i32** %8
%165 = call i32 (i32*, i8*, ...) @fprintf(i32* %164, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.20, i64 0, i64 0))
%166 = load i32*, i32** %7
%167 = getelementptr inbounds [80 x i8], [80 x i8]* %14, i64 0, i64 0
%168 = load i32, i32* %17
%169 = sub nsw i32 %168, 1
%170 = call i32 (i32*, i8*, ...) @fprintf(i32* %166, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i8* %167, i32 %169)
%171 = load i32*, i32** %7
%172 = load i32, i32* %17
%173 = sub nsw i32 %172, 1
%174 = call i32 (i32*, i8*, ...) @fprintf(i32* %171, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.21, i64 0, i64 0), i32 %173)
%175 = load i32*, i32** %7
%176 = call i32 (i32*, i8*, ...) @fprintf(i32* %175, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.20, i64 0, i64 0))
%177 = load i32*, i32** %9
%178 = load i32, i32* %19
%179 = call i32 (i32*, i8*, ...) @fprintf(i32* %177, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.22, i64 0, i64 0), i32 %178)
%180 = load i32*, i32** %9
%181 = call i32 (i32*, i8*, ...) @fprintf(i32* %180, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.23, i64 0, i64 0))
%182 = load i32*, i32** %9
%183 = load i32, i32* %19
%184 = add nsw i32 %183, 1
store i32 %184, i32* %19
%185 = call i32 (i32*, i8*, ...) @fprintf(i32* %182, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.24, i64 0, i64 0), i32 %183)
%186 = load i32*, i32** %9
%187 = load i32, i32* %19
%188 = add nsw i32 %187, 1
store i32 %188, i32* %19
%189 = call i32 (i32*, i8*, ...) @fprintf(i32* %186, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.25, i64 0, i64 0), i32 %187)
%190 = load i32*, i32** %9
%191 = load i32, i32* %19
%192 = add nsw i32 %191, 1
store i32 %192, i32* %19
%193 = call i32 (i32*, i8*, ...) @fprintf(i32* %190, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.26, i64 0, i64 0), i32 %191)
%194 = load i32*, i32** %9
%195 = load i32, i32* %19
%196 = add nsw i32 %195, 1
store i32 %196, i32* %19
%197 = call i32 (i32*, i8*, ...) @fprintf(i32* %194, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.27, i64 0, i64 0), i32 %195)
%198 = load i32*, i32** %9
%199 = load i32, i32* %19
%200 = add nsw i32 %199, 1
store i32 %200, i32* %19
%201 = call i32 (i32*, i8*, ...) @fprintf(i32* %198, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.28, i64 0, i64 0), i32 %199)
%202 = load i32*, i32** %9
%203 = load i32, i32* %19
%204 = add nsw i32 %203, 1
store i32 %204, i32* %19
%205 = call i32 (i32*, i8*, ...) @fprintf(i32* %202, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.29, i64 0, i64 0), i32 %203)
%206 = load i32*, i32** %9
%207 = load i32, i32* %19
%208 = add nsw i32 %207, 1
store i32 %208, i32* %19
%209 = call i32 (i32*, i8*, ...) @fprintf(i32* %206, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.30, i64 0, i64 0), i32 %207)
%210 = load i32*, i32** %9
%211 = load i32, i32* %19
%212 = add nsw i32 %211, 1
store i32 %212, i32* %19
%213 = call i32 (i32*, i8*, ...) @fprintf(i32* %210, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.31, i64 0, i64 0), i32 %211)
%214 = load i32*, i32** %9
%215 = load i32, i32* %19
%216 = call i32 (i32*, i8*, ...) @fprintf(i32* %214, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.32, i64 0, i64 0), i32 %215)
%217 = load i32*, i32** %9
%218 = load i32, i32* %19
%219 = call i32 (i32*, i8*, ...) @fprintf(i32* %217, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.33, i64 0, i64 0), i32 %218)
%220 = load i32*, i32** %9
%221 = call i32 (i32*, i8*, ...) @fprintf(i32* %220, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.20, i64 0, i64 0))
%222 = load i32*, i32** %8
%223 = call i32 @fclose(i32* %222)
%224 = load i32*, i32** %7
%225 = call i32 @fclose(i32* %224)
%226 = load i32*, i32** %6
%227 = call i32 @fclose(i32* %226)
%228 = load i32*, i32** %9
%229 = call i32 @fclose(i32* %228)
%230 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [10 x i8] c"columns.h\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [10 x i8] c"streams.h\00"
@.str.4 = [9 x i8] c"tables.h\00"
@stderr = global i32* null
@.str.5 = [48 x i8] c"USAGE:\0A\09%s file -- build headers based on file\0A\00"
@.str.6 = [47 x i8] c"\09columns.h and streams.h produced as a result\0A\00"
@.str.7 = [55 x i8] c"/*\0A * THIS IS A GENERATED FILE\0A * SEE COLUMNS.LIST\0A*/\0A\00"
@.str.8 = [37 x i8] c"#ifndef COLUMNS_H\0A#define COLUMNS_H\0A\00"
@.str.9 = [37 x i8] c"#ifndef STREAMS_H\0A#define STREAMS_H\0A\00"
@.str.10 = [44 x i8] c"rng_t Streams[] = {\0A{0, 0, 0, 0, 0, 0, 0},\0A\00"
@.str.11 = [35 x i8] c"#ifndef TABLES_H\0A#define TABLES_H\0A\00"
@.str.12 = [12 x i8] c"%s %s %d %s\00"
@.str.13 = [9 x i8] c"%s %s %d\00"
@.str.14 = [6 x i8] c"%s %s\00"
@.str.15 = [28 x i8] c"{0, %d, 0, 0, %s, %s, %s},\0A\00"
@.str.16 = [19 x i8] c"#define %s_END\09%d\0A\00"
@.str.17 = [21 x i8] c"#define %s_START\09%d\0A\00"
@.str.18 = [15 x i8] c"#define %s\09%d\0A\00"
@.str.19 = [33 x i8] c"{-1, -1, -1, -1, -1, -1, -1}\0A};\0A\00"
@.str.20 = [8 x i8] c"#endif\0A\00"
@.str.21 = [23 x i8] c"#define MAX_COLUMN\09%d\0A\00"
@.str.22 = [31 x i8] c"#define PSEUDO_TABLE_START\09%d\0A\00"
@.str.23 = [55 x i8] c"/* PSEUDO TABLES from here on; used in hierarchies */\0A\00"
@.str.24 = [23 x i8] c"#define ITEM_BRAND\09%d\0A\00"
@.str.25 = [23 x i8] c"#define ITEM_CLASS\09%d\0A\00"
@.str.26 = [26 x i8] c"#define ITEM_CATEGORY\09%d\0A\00"
@.str.27 = [22 x i8] c"#define DIVISIONS\09%d\0A\00"
@.str.28 = [20 x i8] c"#define COMPANY\09%d\0A\00"
@.str.29 = [33 x i8] c"#define CONCURRENT_WEB_SITES\09%d\0A\00"
@.str.30 = [26 x i8] c"#define ACTIVE_CITIES\09%d\0A\00"
@.str.31 = [28 x i8] c"#define ACTIVE_COUNTIES\09%d\0A\00"
@.str.32 = [26 x i8] c"#define ACTIVE_STATES\09%d\0A\00"
@.str.33 = [22 x i8] c"#define MAX_TABLE\09%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [80 x i8]
%4 = alloca [80 x i8]
%5 = alloca [1024 x i8]
%6 = alloca [80 x i8]
%7 = alloca [80 x i8]
%8 = alloca i32
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%14 = bitcast i32* %8 to i8*
store i32 1, i32* %8
%15 = icmp ne i32 %0, 2
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32* @fopen(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%19 = icmp eq i32* %18, null
%20 = or i1 %15, %19
%21 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i32* %21, null
%23 = or i1 %22, %20
%24 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%25 = icmp eq i32* %24, null
%26 = or i1 %25, %23
%27 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%28 = icmp eq i32* %27, null
%29 = or i1 %28, %26
br i1 %29, label %30, label %37
30: ; preds = %2
%31 = load i32*, i32** @stderr
%32 = load i8*, i8** %1
%33 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0), i8* %32)
%34 = load i32*, i32** @stderr
%35 = tail call i64 @fwrite(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), i64 46, i64 1, i32* %34)
%36 = tail call i32 @exit(i32 -1)
unreachable
37: ; preds = %2
store i8 0, i8* %13
%38 = tail call i64 @fwrite(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0), i64 54, i64 1, i32* %21)
%39 = tail call i64 @fwrite(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0), i64 54, i64 1, i32* %24)
%40 = tail call i64 @fwrite(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0), i64 54, i64 1, i32* %27)
%41 = tail call i64 @fwrite(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i64 36, i64 1, i32* %21)
%42 = tail call i64 @fwrite(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0), i64 36, i64 1, i32* %24)
%43 = tail call i64 @fwrite(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.10, i64 0, i64 0), i64 43, i64 1, i32* %24)
%44 = tail call i64 @fwrite(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i64 34, i64 1, i32* %27)
%45 = call i32* @fgets(i8* %11, i32 1024, i32* %18)
%46 = icmp eq i32* %45, null
br i1 %46, label %92, label %47
47: ; preds = %37, %86
%48 = phi i32 [ %87, %86 ], [ 0, %37 ]
%49 = phi i32 [ %88, %86 ], [ 1, %37 ]
br label %50
50: ; preds = %47, %57
store i8 0, i8* %12
store i8 0, i8* %10
store i8 0, i8* %9
store i32 1, i32* %8
%51 = call i8* @strchr(i8* %11, i8 signext 35)
%52 = icmp eq i8* %51, null
br i1 %52, label %54, label %53
53: ; preds = %50
store i8 0, i8* %51
br label %54
54: ; preds = %53, %50
%55 = load i8, i8* %11
%56 = icmp eq i8 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %54, %67
%58 = call i32* @fgets(i8* %11, i32 1024, i32* %18)
%59 = icmp eq i32* %58, null
br i1 %59, label %92, label %50
60: ; preds = %54
%61 = call i32 (i8*, i8*, i8*, i8*, ...) @sscanf(i8* %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), i8* %9, i8* %10, i32* %8, i8* %12)
%62 = icmp eq i32 %61, 4
br i1 %62, label %70, label %63
63: ; preds = %60
%64 = call i32 @strcpy(i8* %12, i8* %9)
%65 = call i32 (i8*, i8*, i8*, i8*, ...) @sscanf(i8* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8* %9, i8* %10, i32* %8)
%66 = icmp eq i32 %65, 3
br i1 %66, label %70, label %67
67: ; preds = %63
%68 = call i32 (i8*, i8*, i8*, i8*, ...) @sscanf(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %9, i8* %10)
%69 = icmp eq i32 %68, 2
br i1 %69, label %70, label %57
70: ; preds = %63, %67, %60
%71 = load i32, i32* %8
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0), i32 %71, i8* %9, i8* %10, i8* %12)
%73 = call i64 @strcmp(i8* %13, i8* %10)
%74 = icmp eq i64 %73, 0
br i1 %74, label %86, label %75
75: ; preds = %70
%76 = load i8, i8* %13
%77 = icmp eq i8 %76, 0
br i1 %77, label %81, label %78
78: ; preds = %75
%79 = add nsw i32 %49, -1
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i8* %13, i32 %79)
br label %81
81: ; preds = %78, %75
%82 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0), i8* %10, i32 %49)
%83 = add nsw i32 %48, 1
%84 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0), i8* %10, i32 %48)
%85 = call i32 @strcpy(i8* %13, i8* %10)
br label %86
86: ; preds = %81, %70
%87 = phi i32 [ %83, %81 ], [ %48, %70 ]
%88 = add nuw nsw i32 %49, 1
%89 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0), i8* %9, i32 %49)
%90 = call i32* @fgets(i8* %11, i32 1024, i32* %18)
%91 = icmp eq i32* %90, null
br i1 %91, label %92, label %47
92: ; preds = %86, %57, %37
%93 = phi i32 [ 1, %37 ], [ %49, %57 ], [ %88, %86 ]
%94 = phi i32 [ 0, %37 ], [ %48, %57 ], [ %87, %86 ]
%95 = call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.19, i64 0, i64 0), i64 32, i64 1, i32* %24)
%96 = call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.20, i64 0, i64 0), i64 7, i64 1, i32* %24)
%97 = add nsw i32 %93, -1
%98 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i8* %13, i32 %97)
%99 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.21, i64 0, i64 0), i32 %97)
%100 = call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.20, i64 0, i64 0), i64 7, i64 1, i32* %21)
%101 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.22, i64 0, i64 0), i32 %94)
%102 = call i64 @fwrite(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.23, i64 0, i64 0), i64 54, i64 1, i32* %27)
%103 = add nsw i32 %94, 1
%104 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.24, i64 0, i64 0), i32 %94)
%105 = add nsw i32 %94, 2
%106 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.25, i64 0, i64 0), i32 %103)
%107 = add nsw i32 %94, 3
%108 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.26, i64 0, i64 0), i32 %105)
%109 = add nsw i32 %94, 4
%110 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.27, i64 0, i64 0), i32 %107)
%111 = add nsw i32 %94, 5
%112 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.28, i64 0, i64 0), i32 %109)
%113 = add nsw i32 %94, 6
%114 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.29, i64 0, i64 0), i32 %111)
%115 = add nsw i32 %94, 7
%116 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.30, i64 0, i64 0), i32 %113)
%117 = add nsw i32 %94, 8
%118 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.31, i64 0, i64 0), i32 %115)
%119 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.32, i64 0, i64 0), i32 %117)
%120 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.33, i64 0, i64 0), i32 %117)
%121 = call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.20, i64 0, i64 0), i64 7, i64 1, i32* %27)
%122 = call i32 @fclose(i32* %24)
%123 = call i32 @fclose(i32* %21)
%124 = call i32 @fclose(i32* %18)
%125 = call i32 @fclose(i32* %27)
%126 = call i32 @exit(i32 0)
unreachable
}