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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ sscanf(char *, char *, ...);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strstr(char *, char *);
long strtol(char *, int /*<<< orphan*/ *, int);
main() {
  FILE *fp = NULL;
  char buf[200];
  char *p;
  char desc[200], data[200], value[200];
  int type, other, dq;
  printf("; Mix by the STAB decoder\n");
  while (fgets(buf, sizeof(buf), stdin) != NULL) {
    if ((p = strstr(buf, ".stab")) != NULL) {
      char *p1;
      char last = ' ';
      int i, j;
      p1 = &p[6];
      dq = 0;
      for (i = 6; i < 200 && p[i] != '\r' && p[i] != '\n'; i++) {
        switch (p[i]) {
        case '"':
          dq = dq == 0 ? 1 : 0;
          *p1 = ' ';
          p1 += last != ' ' ? 1 : 0;
          last = ' ';
          break;
        case ' ':
          if (dq != 0) {
            *p1 = '+';
            p1 += 1;
            break;
          }
          *p1 = ' ';
          p1 += last != ' ' ? 1 : 0;
          last = ' ';
          break;
        case ',':
          if (dq != 0) {
            *p1 = '|';
            p1 += 1;
            break;
          }
          *p1 = ' ';
          p1 += last != ' ' ? 1 : 0;
          last = ' ';
          break;
        default:
          *p1++ = p[i];
          last = p[i];
          break;
        }
      }
      *p1 = '\0';
      if (p[5] == 's') {
        char types[200];
        sscanf(&p[6], "%s %d %d %s %s", data, &type, &other, desc, value);
        switch (type) {
        case 0x20:
          strncpy(types, "N_GSYM", sizeof(types));
          printf("; %s Global symbol called %s\n", types, data);
          break;
        case 0x24:
          strncpy(types, "N_FUN", sizeof(types));
          printf("; %s function called %s\n", types, data);
          break;
        case 0x26:
          strncpy(types, "N_STSYM", sizeof(types));
          printf(
              "; %s Data section file-scope static initialized variable %s\n",
              types, data);
          break;
        case 0x28:
          strncpy(types, "N_LCSYM", sizeof(types));
          printf(
              "; %s BSS section file-scope static un-initialized variable %s\n",
              types, data);
          break;
        case 0x3c:
          strncpy(types, "N_OPT", sizeof(types));
          printf("; The STAB information was generated because the source was "
                 "%s\n",
                 data);
          break;
        case 0x40:
          strncpy(types, "N_RSYM", sizeof(types));
          printf("; %s Register variable %s\n", types, data);
          break;
        case 0x64:
          strncpy(types, "N_SO", sizeof(types));
          printf("; %s source file %s\n", types, data);
          fp = fopen(data, "r");
          break;
        case 0xa0:
          strncpy(types, "N_PSYM", sizeof(types));
          printf("; %s stack parameter %s at stack offset %s\n", types, data,
                 value);
          break;
        case 0x80: {
          char name[200], exp[200], *p2;
          strncpy(types, "N_LSYM", sizeof(types));
          p1 = data;
          while (*p1) {
            *p1 = (*p1 == ':' ? ' ' : *p1);
            p1++;
          }
          sscanf(data, "%s %s", name, exp);
          printf("; Local symbol %s: %s\n", name, exp);
        } break;
        default:
          snprintf(types, sizeof(types), "0x%x", type);
          printf("; Unknown S record type |%s| %s %d |%s| |%s|\n", data, types,
                 other, desc, value);
        }
      } else if (p[5] == 'd') {
        char types[200];
        sscanf(&p[6], "%d %d %s", &type, &other, desc);
        switch (type) {
        case 0x44:
          strncpy(types, "N_SLINE", sizeof(types));
          if (fp != NULL) {
            char lbf[200];
            signed long line = strtol(desc, NULL, 10);
            rewind(fp);
            while (line-- > 0) {
              fgets(lbf, sizeof(buf), fp);
            }
            printf("; %s", lbf);
          }
          break;
        default:
          snprintf(types, sizeof(types), "0x%x", type);
          printf("; Unknown D record type %s %d |%s|\n", types, other, desc);
        }
      } else
        printf("; ?: Unknown record type: %s\n", p);
    } else if (buf[0] == ' ' || buf[0] == '\t')
      printf("%s", buf);
  }
  if (fp != NULL)
    fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7a0,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xe0(%rbp),%rdi
mov    0x2e12(%rip),%rax
mov    (%rax),%rdx
mov    $0xc8,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     1a38 <main+0x898>
lea    -0xe0(%rbp),%rdi
lea    0xe20(%rip),%rsi
call   10c0 <strstr@plt>
mov    %rax,-0xe8(%rbp)
cmp    $0x0,%rax
je     19f9 <main+0x859>
movb   $0x20,-0x369(%rbp)
mov    -0xe8(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x368(%rbp)
movl   $0x0,-0x35c(%rbp)
movl   $0x6,-0x370(%rbp)
xor    %eax,%eax
cmpl   $0xc8,-0x370(%rbp)
mov    %al,-0x789(%rbp)
jge    1297 <main+0xf7>
mov    -0xe8(%rbp),%rax
movslq -0x370(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0x789(%rbp)
je     1297 <main+0xf7>
mov    -0xe8(%rbp),%rax
movslq -0x370(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x789(%rbp)
mov    -0x789(%rbp),%al
test   $0x1,%al
jne    12aa <main+0x10a>
jmp    147f <main+0x2df>
mov    -0xe8(%rbp),%rax
movslq -0x370(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x790(%rbp)
sub    $0x20,%eax
je     134f <main+0x1af>
jmp    12d0 <main+0x130>
mov    -0x790(%rbp),%eax
sub    $0x22,%eax
je     12f8 <main+0x158>
jmp    12e4 <main+0x144>
mov    -0x790(%rbp),%eax
sub    $0x2c,%eax
je     13bb <main+0x21b>
jmp    1427 <main+0x287>
mov    -0x35c(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
mov    %eax,-0x35c(%rbp)
mov    -0x368(%rbp),%rax
movb   $0x20,(%rax)
movsbl -0x369(%rbp),%edx
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x20,%edx
cmovne %eax,%ecx
mov    -0x368(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x368(%rbp)
movb   $0x20,-0x369(%rbp)
jmp    1466 <main+0x2c6>
cmpl   $0x0,-0x35c(%rbp)
je     137d <main+0x1dd>
mov    -0x368(%rbp),%rax
movb   $0x2b,(%rax)
mov    -0x368(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x368(%rbp)
jmp    1466 <main+0x2c6>
mov    -0x368(%rbp),%rax
movb   $0x20,(%rax)
movsbl -0x369(%rbp),%edx
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x20,%edx
cmovne %eax,%ecx
mov    -0x368(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x368(%rbp)
movb   $0x20,-0x369(%rbp)
jmp    1466 <main+0x2c6>
cmpl   $0x0,-0x35c(%rbp)
je     13e9 <main+0x249>
mov    -0x368(%rbp),%rax
movb   $0x7c,(%rax)
mov    -0x368(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x368(%rbp)
jmp    1466 <main+0x2c6>
mov    -0x368(%rbp),%rax
movb   $0x20,(%rax)
movsbl -0x369(%rbp),%edx
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x20,%edx
cmovne %eax,%ecx
mov    -0x368(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x368(%rbp)
movb   $0x20,-0x369(%rbp)
jmp    1466 <main+0x2c6>
mov    -0xe8(%rbp),%rax
movslq -0x370(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x368(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x368(%rbp)
mov    %cl,(%rax)
mov    -0xe8(%rbp),%rax
movslq -0x370(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x369(%rbp)
jmp    146b <main+0x2cb>
mov    -0x370(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x370(%rbp)
jmp    123e <main+0x9e>
mov    -0x368(%rbp),%rax
movb   $0x0,(%rax)
mov    -0xe8(%rbp),%rax
movsbl 0x5(%rax),%eax
cmp    $0x73,%eax
jne    18a4 <main+0x704>
mov    -0xe8(%rbp),%rdi
add    $0x6,%rdi
mov    %rsp,%rax
lea    -0x350(%rbp),%rcx
mov    %rcx,(%rax)
lea    0xb65(%rip),%rsi
xor    %eax,%eax
lea    -0x280(%rbp),%rdx
lea    -0x354(%rbp),%rcx
lea    -0x358(%rbp),%r8
lea    -0x1b0(%rbp),%r9
call   10a0 <sscanf@plt>
mov    -0x354(%rbp),%eax
mov    %eax,-0x794(%rbp)
sub    $0x20,%eax
je     159d <main+0x3fd>
jmp    14f9 <main+0x359>
mov    -0x794(%rbp),%eax
sub    $0x24,%eax
je     15d6 <main+0x436>
jmp    150d <main+0x36d>
mov    -0x794(%rbp),%eax
sub    $0x26,%eax
je     160f <main+0x46f>
jmp    1521 <main+0x381>
mov    -0x794(%rbp),%eax
sub    $0x28,%eax
je     1648 <main+0x4a8>
jmp    1535 <main+0x395>
mov    -0x794(%rbp),%eax
sub    $0x3c,%eax
je     1681 <main+0x4e1>
jmp    1549 <main+0x3a9>
mov    -0x794(%rbp),%eax
sub    $0x40,%eax
je     16b3 <main+0x513>
jmp    155d <main+0x3bd>
mov    -0x794(%rbp),%eax
sub    $0x64,%eax
je     16ec <main+0x54c>
jmp    1571 <main+0x3d1>
mov    -0x794(%rbp),%eax
sub    $0x80,%eax
je     177c <main+0x5dc>
jmp    1587 <main+0x3e7>
mov    -0x794(%rbp),%eax
sub    $0xa0,%eax
je     173c <main+0x59c>
jmp    1851 <main+0x6b1>
lea    -0x440(%rbp),%rdi
lea    0xa85(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    -0x440(%rbp),%rsi
lea    -0x280(%rbp),%rdx
lea    0xa6d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    189f <main+0x6ff>
lea    -0x440(%rbp),%rdi
lea    0xa71(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    -0x440(%rbp),%rsi
lea    -0x280(%rbp),%rdx
lea    0xa58(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    189f <main+0x6ff>
lea    -0x440(%rbp),%rdi
lea    0xa57(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    -0x440(%rbp),%rsi
lea    -0x280(%rbp),%rdx
lea    0xa40(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    189f <main+0x6ff>
lea    -0x440(%rbp),%rdi
lea    0xa63(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    -0x440(%rbp),%rsi
lea    -0x280(%rbp),%rdx
lea    0xa4c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    189f <main+0x6ff>
lea    -0x440(%rbp),%rdi
lea    0xa71(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    -0x280(%rbp),%rsi
lea    0xa5f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    189f <main+0x6ff>
lea    -0x440(%rbp),%rdi
lea    0xa85(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    -0x440(%rbp),%rsi
lea    -0x280(%rbp),%rdx
lea    0xa6d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    189f <main+0x6ff>
lea    -0x440(%rbp),%rdi
lea    0xa6e(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    -0x440(%rbp),%rsi
lea    -0x280(%rbp),%rdx
lea    0xa54(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x280(%rbp),%rdi
lea    0xa54(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x10(%rbp)
jmp    189f <main+0x6ff>
lea    -0x440(%rbp),%rdi
lea    0xa3a(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    -0x440(%rbp),%rsi
lea    -0x280(%rbp),%rdx
lea    -0x350(%rbp),%rcx
lea    0xa1b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    189f <main+0x6ff>
lea    -0x440(%rbp),%rdi
lea    0xa2d(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    -0x280(%rbp),%rax
mov    %rax,-0x368(%rbp)
mov    -0x368(%rbp),%rax
cmpb   $0x0,(%rax)
je     180d <main+0x66d>
mov    -0x368(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    17d5 <main+0x635>
mov    $0x20,%eax
mov    %eax,-0x798(%rbp)
jmp    17e5 <main+0x645>
mov    -0x368(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x798(%rbp)
mov    -0x798(%rbp),%eax
mov    %al,%cl
mov    -0x368(%rbp),%rax
mov    %cl,(%rax)
mov    -0x368(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x368(%rbp)
jmp    17a2 <main+0x602>
lea    -0x280(%rbp),%rdi
lea    -0x510(%rbp),%rdx
lea    -0x5e0(%rbp),%rcx
lea    0x801(%rip),%rsi
mov    $0x0,%al
call   10a0 <sscanf@plt>
lea    -0x510(%rbp),%rsi
lea    -0x5e0(%rbp),%rdx
lea    0x979(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    189f <main+0x6ff>
lea    -0x440(%rbp),%rdi
mov    -0x354(%rbp),%ecx
mov    $0xc8,%esi
lea    0x96b(%rip),%rdx
call   1070 <snprintf@plt>
lea    -0x280(%rbp),%rsi
lea    -0x440(%rbp),%rdx
mov    -0x358(%rbp),%ecx
lea    -0x1b0(%rbp),%r8
lea    -0x350(%rbp),%r9
lea    0x942(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    19f4 <main+0x854>
mov    -0xe8(%rbp),%rax
movsbl 0x5(%rax),%eax
cmp    $0x64,%eax
jne    19da <main+0x83a>
mov    -0xe8(%rbp),%rdi
add    $0x6,%rdi
lea    0x93e(%rip),%rsi
xor    %eax,%eax
lea    -0x354(%rbp),%rdx
lea    -0x358(%rbp),%rcx
lea    -0x1b0(%rbp),%r8
call   10a0 <sscanf@plt>
mov    -0x354(%rbp),%eax
sub    $0x44,%eax
jne    1995 <main+0x7f5>
jmp    18fa <main+0x75a>
lea    -0x6b0(%rbp),%rdi
lea    0x909(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
cmpq   $0x0,-0x10(%rbp)
je     1990 <main+0x7f0>
lea    -0x1b0(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1090 <strtol@plt>
mov    %rax,-0x788(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <rewind@plt>
mov    -0x788(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x788(%rbp)
cmp    $0x0,%rax
jle    197b <main+0x7db>
lea    -0x780(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xc8,%esi
call   1080 <fgets@plt>
jmp    1942 <main+0x7a2>
lea    -0x780(%rbp),%rsi
lea    0x890(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    19d5 <main+0x835>
lea    -0x6b0(%rbp),%rdi
mov    -0x354(%rbp),%ecx
mov    $0xc8,%esi
lea    0x827(%rip),%rdx
call   1070 <snprintf@plt>
lea    -0x6b0(%rbp),%rsi
mov    -0x358(%rbp),%edx
lea    -0x1b0(%rbp),%rcx
lea    0x850(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    19ef <main+0x84f>
mov    -0xe8(%rbp),%rsi
lea    0x85a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    19f4 <main+0x854>
jmp    1a33 <main+0x893>
movsbl -0xe0(%rbp),%eax
cmp    $0x20,%eax
je     1a19 <main+0x879>
movsbl -0xe0(%rbp),%eax
cmp    $0x9,%eax
jne    1a2e <main+0x88e>
lea    -0xe0(%rbp),%rsi
lea    0x7f4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1a33 <main+0x893>
jmp    11c8 <main+0x28>
cmpq   $0x0,-0x10(%rbp)
je     1a4c <main+0x8ac>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x7a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x5c8,%rsp
lea    0x118f(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e14(%rip),%rax
mov    (%rax),%rdx
lea    0x20(%rsp),%rdi
mov    $0xc8,%esi
call   1090 <fgets@plt>
test   %rax,%rax
je     1762 <main+0x5b2>
lea    0x20(%rsp),%rbx
lea    0x500(%rsp),%r12
lea    0x430(%rsp),%r15
xor    %ebp,%ebp
jmp    1241 <main+0x91>
nopl   0x0(%rax,%rax,1)
lea    0x10fb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2dc0(%rip),%rax
mov    (%rax),%rdx
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1090 <fgets@plt>
test   %rax,%rax
je     1755 <main+0x5a5>
mov    %rbx,%rdi
lea    0xec9(%rip),%rsi
call   10d0 <strstr@plt>
test   %rax,%rax
je     13c0 <main+0x210>
mov    %rbp,0x10(%rsp)
mov    %r12,%r13
mov    %rax,%rdi
add    $0x6,%rdi
mov    $0x20,%r8b
xor    %ebx,%ebx
mov    $0x6,%edx
mov    %rdi,%rcx
jmp    129d <main+0xed>
nopw   0x0(%rax,%rax,1)
mov    %bpl,(%rcx)
add    $0x1,%rcx
movzbl (%rax,%rdx,1),%r8d
add    $0x1,%rdx
cmp    $0xc8,%rdx
je     1320 <main+0x170>
movsbl (%rax,%rdx,1),%ebp
cmp    $0xa,%ebp
je     1320 <main+0x170>
cmp    $0xd,%bpl
je     1320 <main+0x170>
cmp    $0x20,%ebp
je     12e0 <main+0x130>
cmp    $0x2c,%ebp
je     12f0 <main+0x140>
cmp    $0x22,%ebp
jne    1280 <main+0xd0>
xor    %esi,%esi
test   %ebx,%ebx
sete   %sil
movb   $0x20,(%rcx)
xor    %ebp,%ebp
cmp    $0x20,%r8b
setne  %bpl
add    %rbp,%rcx
mov    $0x20,%r8b
mov    %esi,%ebx
jmp    128c <main+0xdc>
nopw   0x0(%rax,%rax,1)
test   %ebx,%ebx
je     1302 <main+0x152>
movb   $0x2b,(%rcx)
jmp    12f7 <main+0x147>
nopl   0x0(%rax)
test   %ebx,%ebx
je     1302 <main+0x152>
movb   $0x7c,(%rcx)
add    $0x1,%rcx
mov    $0x1,%ebx
jmp    128c <main+0xdc>
movb   $0x20,(%rcx)
xor    %esi,%esi
cmp    $0x20,%r8b
setne  %sil
add    %rsi,%rcx
xor    %ebx,%ebx
mov    $0x20,%r8b
jmp    128c <main+0xdc>
nopl   0x0(%rax)
movb   $0x0,(%rcx)
mov    0x5(%rax),%cl
cmp    $0x64,%cl
je     13e0 <main+0x230>
cmp    $0x73,%cl
jne    14a0 <main+0x2f0>
lea    0x290(%rsp),%rax
mov    %rax,(%rsp)
lea    0xdcf(%rip),%rsi
lea    0x1c0(%rsp),%rdx
lea    0x1c(%rsp),%rcx
lea    0x18(%rsp),%r8
mov    %r13,%r12
mov    %r13,%r9
xor    %eax,%eax
call   10b0 <sscanf@plt>
mov    0x1c(%rsp),%ecx
lea    -0x20(%rcx),%eax
cmp    $0x44,%eax
ja     14f2 <main+0x342>
lea    0xc7f(%rip),%rdx
movslq (%rdx,%rax,4),%rax
add    %rdx,%rax
jmp    *%rax
lea    0xf0(%rsp),%rbp
mov    %rbp,%rdi
lea    0xd8d(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    0xd83(%rip),%rdi
jmp    1657 <main+0x4a7>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x20(%rsp),%al
cmp    $0x20,%al
je     1210 <main+0x60>
cmp    $0x9,%al
je     1210 <main+0x60>
jmp    1221 <main+0x71>
nopl   0x0(%rax)
lea    0xf18(%rip),%rsi
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%rcx
mov    %r13,%r12
mov    %r13,%r8
xor    %eax,%eax
call   10b0 <sscanf@plt>
mov    0x1c(%rsp),%ecx
cmp    $0x44,%ecx
jne    14b9 <main+0x309>
lea    0xf0(%rsp),%rdi
lea    0xeee(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
mov    0x10(%rsp),%rbp
test   %rbp,%rbp
lea    0x20(%rsp),%rbx
je     1221 <main+0x71>
mov    %r12,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   10a0 <strtol@plt>
mov    %rax,%r12
mov    %rbp,%rdi
call   1070 <rewind@plt>
test   %r12,%r12
jle    147a <main+0x2ca>
add    $0x1,%r12
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    $0xc8,%esi
mov    %rbp,%rdx
call   1090 <fgets@plt>
add    $0xffffffffffffffff,%r12
cmp    $0x1,%r12
ja     1460 <main+0x2b0>
lea    0xe8f(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%r12
jmp    1221 <main+0x71>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xe92(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%r12
jmp    1669 <main+0x4b9>
lea    0xf0(%rsp),%rbp
mov    %rbp,%rdi
mov    $0xc8,%esi
lea    0xdfc(%rip),%rdx
call   1080 <snprintf@plt>
mov    0x18(%rsp),%edx
lea    0xe35(%rip),%rdi
mov    %rbp,%rsi
mov    %r12,%rcx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1669 <main+0x4b9>
cmp    $0x80,%ecx
je     16cc <main+0x51c>
cmp    $0xa0,%ecx
jne    1548 <main+0x398>
lea    0xf0(%rsp),%rbp
mov    %rbp,%rdi
lea    0xd63(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    0xd59(%rip),%rdi
mov    %rbp,%rsi
lea    0x1c0(%rsp),%rdx
lea    0x290(%rsp),%rcx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1669 <main+0x4b9>
lea    0xf0(%rsp),%rbp
mov    %rbp,%rdi
mov    $0xc8,%esi
lea    0xd6d(%rip),%rdx
call   1080 <snprintf@plt>
mov    0x18(%rsp),%ecx
lea    0xd62(%rip),%rdi
lea    0x1c0(%rsp),%rsi
mov    %rbp,%rdx
mov    %r12,%r8
lea    0x290(%rsp),%r9
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1669 <main+0x4b9>
lea    0xf0(%rsp),%rbp
mov    %rbp,%rdi
lea    0xbab(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    0xba0(%rip),%rdi
jmp    1657 <main+0x4a7>
lea    0xf0(%rsp),%rbp
mov    %rbp,%rdi
lea    0xba2(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    0xb99(%rip),%rdi
jmp    1657 <main+0x4a7>
lea    0xf0(%rsp),%rbp
mov    %rbp,%rdi
lea    0xbc2(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    0xbb9(%rip),%rdi
jmp    1657 <main+0x4a7>
lea    0xf0(%rsp),%rdi
lea    0xbe7(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    0xbdc(%rip),%rdi
lea    0x1c0(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1669 <main+0x4b9>
lea    0xf0(%rsp),%rbp
mov    %rbp,%rdi
lea    0xbf9(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    0xbef(%rip),%rdi
mov    %rbp,%rsi
lea    0x1c0(%rsp),%rdx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x20(%rsp),%rbx
mov    0x10(%rsp),%rbp
jmp    1221 <main+0x71>
lea    0xf0(%rsp),%rbp
mov    %rbp,%rdi
lea    0xbd7(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    0xbcb(%rip),%rdi
mov    %rbp,%rsi
lea    0x1c0(%rsp),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
lea    0xcb5(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%rbp
lea    0x20(%rsp),%rbx
jmp    1221 <main+0x71>
lea    0xf0(%rsp),%rdi
lea    0xbd3(%rip),%rsi
mov    $0xc8,%edx
call   1030 <strncpy@plt>
lea    0x1c0(%rsp),%rax
lea    0x20(%rsp),%rbx
jmp    1706 <main+0x556>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %dl,(%rax)
add    $0x1,%rax
movzbl (%rax),%ecx
mov    $0x20,%dl
cmp    $0x3a,%cl
je     1700 <main+0x550>
test   %cl,%cl
je     1718 <main+0x568>
mov    %ecx,%edx
jmp    1700 <main+0x550>
lea    0x1c0(%rsp),%rdi
lea    0x9fc(%rip),%rsi
mov    %r15,%rdx
lea    0x360(%rsp),%r14
mov    %r14,%rcx
xor    %eax,%eax
call   10b0 <sscanf@plt>
lea    0xb72(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    166e <main+0x4be>
test   %rbp,%rbp
je     1762 <main+0x5b2>
mov    %rbp,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x5c8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"; Mix by the STAB decoder\0A\00"
@stdin = global i32* null
@.str.1 = [6 x i8] c".stab\00"
@.str.2 = [15 x i8] c"%s %d %d %s %s\00"
@.str.3 = [7 x i8] c"N_GSYM\00"
@.str.4 = [30 x i8] c"; %s Global symbol called %s\0A\00"
@.str.5 = [6 x i8] c"N_FUN\00"
@.str.6 = [25 x i8] c"; %s function called %s\0A\00"
@.str.7 = [8 x i8] c"N_STSYM\00"
@.str.8 = [61 x i8] c"; %s Data section file-scope static initialized variable %s\0A\00"
@.str.9 = [8 x i8] c"N_LCSYM\00"
@.str.10 = [63 x i8] c"; %s BSS section file-scope static un-initialized variable %s\0A\00"
@.str.11 = [6 x i8] c"N_OPT\00"
@.str.12 = [64 x i8] c"; The STAB information was generated because the source was %s\0A\00"
@.str.13 = [7 x i8] c"N_RSYM\00"
@.str.14 = [27 x i8] c"; %s Register variable %s\0A\00"
@.str.15 = [5 x i8] c"N_SO\00"
@.str.16 = [21 x i8] c"; %s source file %s\0A\00"
@.str.17 = [2 x i8] c"r\00"
@.str.18 = [7 x i8] c"N_PSYM\00"
@.str.19 = [44 x i8] c"; %s stack parameter %s at stack offset %s\0A\00"
@.str.20 = [7 x i8] c"N_LSYM\00"
@.str.21 = [6 x i8] c"%s %s\00"
@.str.22 = [23 x i8] c"; Local symbol %s: %s\0A\00"
@.str.23 = [5 x i8] c"0x%x\00"
@.str.24 = [46 x i8] c"; Unknown S record type |%s| %s %d |%s| |%s|\0A\00"
@.str.25 = [9 x i8] c"%d %d %s\00"
@.str.26 = [8 x i8] c"N_SLINE\00"
@.str.27 = [5 x i8] c"; %s\00"
@.str.28 = [36 x i8] c"; Unknown D record type %s %d |%s|\0A\00"
@.str.29 = [30 x i8] c"; ?: Unknown record type: %s\0A\00"
@.str.30 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [200 x i8]
%4 = alloca i8*
%5 = alloca [200 x i8]
%6 = alloca [200 x i8]
%7 = alloca [200 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8
%13 = alloca i32
%14 = alloca i32
%15 = alloca [200 x i8]
%16 = alloca [200 x i8]
%17 = alloca [200 x i8]
%18 = alloca i8*
%19 = alloca [200 x i8]
%20 = alloca [200 x i8]
%21 = alloca i64
store i32 0, i32* %1
store i32* null, i32** %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %298, %0
%24 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%25 = load i32*, i32** @stdin
%26 = call i32* @fgets(i8* %24, i32 200, i32* %25)
%27 = icmp ne i32* %26, null
br i1 %27, label %28, label %299
28: ; preds = %23
%29 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%30 = call i8* @strstr(i8* %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i8* %30, i8** %4
%31 = icmp ne i8* %30, null
br i1 %31, label %32, label %284
32: ; preds = %28
store i8 32, i8* %12
%33 = load i8*, i8** %4
%34 = getelementptr inbounds i8, i8* %33, i64 6
store i8* %34, i8** %11
store i32 0, i32* %10
store i32 6, i32* %13
br label %35
35: ; preds = %125, %32
%36 = load i32, i32* %13
%37 = icmp slt i32 %36, 200
br i1 %37, label %38, label %54
38: ; preds = %35
%39 = load i8*, i8** %4
%40 = load i32, i32* %13
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %39, i64 %41
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp ne i32 %44, 13
br i1 %45, label %46, label %54
46: ; preds = %38
%47 = load i8*, i8** %4
%48 = load i32, i32* %13
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %47, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp ne i32 %52, 10
br label %54
54: ; preds = %46, %38, %35
%55 = phi i1 [ false, %38 ], [ false, %35 ], [ %53, %46 ]
br i1 %55, label %56, label %128
56: ; preds = %54
%57 = load i8*, i8** %4
%58 = load i32, i32* %13
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8, i8* %57, i64 %59
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
switch i32 %62, label %111 [
i32 34, label %63
i32 32, label %77
i32 44, label %94
]
63: ; preds = %56
%64 = load i32, i32* %10
%65 = icmp eq i32 %64, 0
%66 = zext i1 %65 to i64
%67 = select i1 %65, i32 1, i32 0
store i32 %67, i32* %10
%68 = load i8*, i8** %11
store i8 32, i8* %68
%69 = load i8, i8* %12
%70 = sext i8 %69 to i32
%71 = icmp ne i32 %70, 32
%72 = zext i1 %71 to i64
%73 = select i1 %71, i32 1, i32 0
%74 = load i8*, i8** %11
%75 = sext i32 %73 to i64
%76 = getelementptr inbounds i8, i8* %74, i64 %75
store i8* %76, i8** %11
store i8 32, i8* %12
br label %124
77: ; preds = %56
%78 = load i32, i32* %10
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %84
80: ; preds = %77
%81 = load i8*, i8** %11
store i8 43, i8* %81
%82 = load i8*, i8** %11
%83 = getelementptr inbounds i8, i8* %82, i64 1
store i8* %83, i8** %11
br label %124
84: ; preds = %77
%85 = load i8*, i8** %11
store i8 32, i8* %85
%86 = load i8, i8* %12
%87 = sext i8 %86 to i32
%88 = icmp ne i32 %87, 32
%89 = zext i1 %88 to i64
%90 = select i1 %88, i32 1, i32 0
%91 = load i8*, i8** %11
%92 = sext i32 %90 to i64
%93 = getelementptr inbounds i8, i8* %91, i64 %92
store i8* %93, i8** %11
store i8 32, i8* %12
br label %124
94: ; preds = %56
%95 = load i32, i32* %10
%96 = icmp ne i32 %95, 0
br i1 %96, label %97, label %101
97: ; preds = %94
%98 = load i8*, i8** %11
store i8 124, i8* %98
%99 = load i8*, i8** %11
%100 = getelementptr inbounds i8, i8* %99, i64 1
store i8* %100, i8** %11
br label %124
101: ; preds = %94
%102 = load i8*, i8** %11
store i8 32, i8* %102
%103 = load i8, i8* %12
%104 = sext i8 %103 to i32
%105 = icmp ne i32 %104, 32
%106 = zext i1 %105 to i64
%107 = select i1 %105, i32 1, i32 0
%108 = load i8*, i8** %11
%109 = sext i32 %107 to i64
%110 = getelementptr inbounds i8, i8* %108, i64 %109
store i8* %110, i8** %11
store i8 32, i8* %12
br label %124
111: ; preds = %56
%112 = load i8*, i8** %4
%113 = load i32, i32* %13
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i8, i8* %112, i64 %114
%116 = load i8, i8* %115
%117 = load i8*, i8** %11
%118 = getelementptr inbounds i8, i8* %117, i32 1
store i8* %118, i8** %11
store i8 %116, i8* %117
%119 = load i8*, i8** %4
%120 = load i32, i32* %13
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8, i8* %119, i64 %121
%123 = load i8, i8* %122
store i8 %123, i8* %12
br label %124
124: ; preds = %111, %101, %97, %84, %80, %63
br label %125
125: ; preds = %124
%126 = load i32, i32* %13
%127 = add nsw i32 %126, 1
store i32 %127, i32* %13
br label %35
128: ; preds = %54
%129 = load i8*, i8** %11
store i8 0, i8* %129
%130 = load i8*, i8** %4
%131 = getelementptr inbounds i8, i8* %130, i64 5
%132 = load i8, i8* %131
%133 = sext i8 %132 to i32
%134 = icmp eq i32 %133, 115
br i1 %134, label %135, label %236
135: ; preds = %128
%136 = load i8*, i8** %4
%137 = getelementptr inbounds i8, i8* %136, i64 6
%138 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%139 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%140 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%141 = call i32 (i8*, i8*, ...) @sscanf(i8* %137, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %138, i32* %8, i32* %9, i8* %139, i8* %140)
%142 = load i32, i32* %8
switch i32 %142, label %225 [
i32 32, label %143
i32 36, label %149
i32 38, label %155
i32 40, label %161
i32 60, label %167
i32 64, label %172
i32 100, label %178
i32 160, label %186
i32 128, label %193
]
143: ; preds = %135
%144 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%145 = call i32 @strncpy(i8* %144, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 200)
%146 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%147 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %146, i8* %147)
br label %235
149: ; preds = %135
%150 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%151 = call i32 @strncpy(i8* %150, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 200)
%152 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%153 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8* %152, i8* %153)
br label %235
155: ; preds = %135
%156 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%157 = call i32 @strncpy(i8* %156, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 200)
%158 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%159 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%160 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.8, i64 0, i64 0), i8* %158, i8* %159)
br label %235
161: ; preds = %135
%162 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%163 = call i32 @strncpy(i8* %162, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 200)
%164 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%165 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.10, i64 0, i64 0), i8* %164, i8* %165)
br label %235
167: ; preds = %135
%168 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%169 = call i32 @strncpy(i8* %168, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 200)
%170 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.12, i64 0, i64 0), i8* %170)
br label %235
172: ; preds = %135
%173 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%174 = call i32 @strncpy(i8* %173, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i32 200)
%175 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%176 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%177 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i8* %175, i8* %176)
br label %235
178: ; preds = %135
%179 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%180 = call i32 @strncpy(i8* %179, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i32 200)
%181 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%182 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%183 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0), i8* %181, i8* %182)
%184 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%185 = call i32* @fopen(i8* %184, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
store i32* %185, i32** %2
br label %235
186: ; preds = %135
%187 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%188 = call i32 @strncpy(i8* %187, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i32 200)
%189 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%190 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%191 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%192 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.19, i64 0, i64 0), i8* %189, i8* %190, i8* %191)
br label %235
193: ; preds = %135
%194 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%195 = call i32 @strncpy(i8* %194, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32 200)
%196 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
store i8* %196, i8** %11
br label %197
197: ; preds = %211, %193
%198 = load i8*, i8** %11
%199 = load i8, i8* %198
%200 = icmp ne i8 %199, 0
br i1 %200, label %201, label %217
201: ; preds = %197
%202 = load i8*, i8** %11
%203 = load i8, i8* %202
%204 = sext i8 %203 to i32
%205 = icmp eq i32 %204, 58
br i1 %205, label %206, label %207
206: ; preds = %201
br label %211
207: ; preds = %201
%208 = load i8*, i8** %11
%209 = load i8, i8* %208
%210 = sext i8 %209 to i32
br label %211
211: ; preds = %207, %206
%212 = phi i32 [ 32, %206 ], [ %210, %207 ]
%213 = trunc i32 %212 to i8
%214 = load i8*, i8** %11
store i8 %213, i8* %214
%215 = load i8*, i8** %11
%216 = getelementptr inbounds i8, i8* %215, i32 1
store i8* %216, i8** %11
br label %197
217: ; preds = %197
%218 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%219 = getelementptr inbounds [200 x i8], [200 x i8]* %16, i64 0, i64 0
%220 = getelementptr inbounds [200 x i8], [200 x i8]* %17, i64 0, i64 0
%221 = call i32 (i8*, i8*, ...) @sscanf(i8* %218, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0), i8* %219, i8* %220)
%222 = getelementptr inbounds [200 x i8], [200 x i8]* %16, i64 0, i64 0
%223 = getelementptr inbounds [200 x i8], [200 x i8]* %17, i64 0, i64 0
%224 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.22, i64 0, i64 0), i8* %222, i8* %223)
br label %235
225: ; preds = %135
%226 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%227 = load i32, i32* %8
%228 = call i32 @snprintf(i8* %226, i32 200, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0), i32 %227)
%229 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%230 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%231 = load i32, i32* %9
%232 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%233 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%234 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.24, i64 0, i64 0), i8* %229, i8* %230, i32 %231, i8* %232, i8* %233)
br label %235
235: ; preds = %225, %217, %186, %178, %172, %167, %161, %155, %149, %143
br label %283
236: ; preds = %128
%237 = load i8*, i8** %4
%238 = getelementptr inbounds i8, i8* %237, i64 5
%239 = load i8, i8* %238
%240 = sext i8 %239 to i32
%241 = icmp eq i32 %240, 100
br i1 %241, label %242, label %279
242: ; preds = %236
%243 = load i8*, i8** %4
%244 = getelementptr inbounds i8, i8* %243, i64 6
%245 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%246 = call i32 (i8*, i8*, ...) @sscanf(i8* %244, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.25, i64 0, i64 0), i32* %8, i32* %9, i8* %245)
%247 = load i32, i32* %8
switch i32 %247, label %270 [
i32 68, label %248
]
248: ; preds = %242
%249 = getelementptr inbounds [200 x i8], [200 x i8]* %19, i64 0, i64 0
%250 = call i32 @strncpy(i8* %249, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i64 0, i64 0), i32 200)
%251 = load i32*, i32** %2
%252 = icmp ne i32* %251, null
br i1 %252, label %253, label %269
253: ; preds = %248
%254 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%255 = call i64 @strtol(i8* %254, i32* null, i32 10)
store i64 %255, i64* %21
%256 = load i32*, i32** %2
%257 = call i32 @rewind(i32* %256)
br label %258
258: ; preds = %262, %253
%259 = load i64, i64* %21
%260 = add nsw i64 %259, -1
store i64 %260, i64* %21
%261 = icmp sgt i64 %259, 0
br i1 %261, label %262, label %266
262: ; preds = %258
%263 = getelementptr inbounds [200 x i8], [200 x i8]* %20, i64 0, i64 0
%264 = load i32*, i32** %2
%265 = call i32* @fgets(i8* %263, i32 200, i32* %264)
br label %258
266: ; preds = %258
%267 = getelementptr inbounds [200 x i8], [200 x i8]* %20, i64 0, i64 0
%268 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0), i8* %267)
br label %269
269: ; preds = %266, %248
br label %278
270: ; preds = %242
%271 = getelementptr inbounds [200 x i8], [200 x i8]* %19, i64 0, i64 0
%272 = load i32, i32* %8
%273 = call i32 @snprintf(i8* %271, i32 200, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0), i32 %272)
%274 = getelementptr inbounds [200 x i8], [200 x i8]* %19, i64 0, i64 0
%275 = load i32, i32* %9
%276 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%277 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.28, i64 0, i64 0), i8* %274, i32 %275, i8* %276)
br label %278
278: ; preds = %270, %269
br label %282
279: ; preds = %236
%280 = load i8*, i8** %4
%281 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.29, i64 0, i64 0), i8* %280)
br label %282
282: ; preds = %279, %278
br label %283
283: ; preds = %282, %235
br label %298
284: ; preds = %28
%285 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%286 = load i8, i8* %285
%287 = sext i8 %286 to i32
%288 = icmp eq i32 %287, 32
br i1 %288, label %294, label %289
289: ; preds = %284
%290 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%291 = load i8, i8* %290
%292 = sext i8 %291 to i32
%293 = icmp eq i32 %292, 9
br i1 %293, label %294, label %297
294: ; preds = %289, %284
%295 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%296 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0), i8* %295)
br label %297
297: ; preds = %294, %289
br label %298
298: ; preds = %297, %283
br label %23
299: ; preds = %23
%300 = load i32*, i32** %2
%301 = icmp ne i32* %300, null
br i1 %301, label %302, label %305
302: ; preds = %299
%303 = load i32*, i32** %2
%304 = call i32 @fclose(i32* %303)
br label %305
305: ; preds = %302, %299
%306 = load i32, i32* %1
ret i32 %306
}

LLVM IR (-O2):
@stdin = global i32* null
@.str.1 = [6 x i8] c".stab\00"
@.str.2 = [15 x i8] c"%s %d %d %s %s\00"
@.str.3 = [7 x i8] c"N_GSYM\00"
@.str.4 = [30 x i8] c"; %s Global symbol called %s\0A\00"
@.str.5 = [6 x i8] c"N_FUN\00"
@.str.6 = [25 x i8] c"; %s function called %s\0A\00"
@.str.7 = [8 x i8] c"N_STSYM\00"
@.str.8 = [61 x i8] c"; %s Data section file-scope static initialized variable %s\0A\00"
@.str.9 = [8 x i8] c"N_LCSYM\00"
@.str.10 = [63 x i8] c"; %s BSS section file-scope static un-initialized variable %s\0A\00"
@.str.11 = [6 x i8] c"N_OPT\00"
@.str.12 = [64 x i8] c"; The STAB information was generated because the source was %s\0A\00"
@.str.13 = [7 x i8] c"N_RSYM\00"
@.str.14 = [27 x i8] c"; %s Register variable %s\0A\00"
@.str.15 = [5 x i8] c"N_SO\00"
@.str.16 = [21 x i8] c"; %s source file %s\0A\00"
@.str.17 = [2 x i8] c"r\00"
@.str.18 = [7 x i8] c"N_PSYM\00"
@.str.19 = [44 x i8] c"; %s stack parameter %s at stack offset %s\0A\00"
@.str.20 = [7 x i8] c"N_LSYM\00"
@.str.21 = [6 x i8] c"%s %s\00"
@.str.22 = [23 x i8] c"; Local symbol %s: %s\0A\00"
@.str.23 = [5 x i8] c"0x%x\00"
@.str.24 = [46 x i8] c"; Unknown S record type |%s| %s %d |%s| |%s|\0A\00"
@.str.25 = [9 x i8] c"%d %d %s\00"
@.str.26 = [8 x i8] c"N_SLINE\00"
@.str.27 = [5 x i8] c"; %s\00"
@.str.28 = [36 x i8] c"; Unknown D record type %s %d |%s|\0A\00"
@.str.29 = [30 x i8] c"; ?: Unknown record type: %s\0A\00"
@.str.30 = [3 x i8] c"%s\00"
@str = [26 x i8] c"; Mix by the STAB decoder\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = alloca [200 x i8]
%3 = alloca [200 x i8]
%4 = alloca [200 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca [200 x i8]
%8 = alloca [200 x i8]
%9 = alloca [200 x i8]
%10 = alloca [200 x i8]
%11 = alloca [200 x i8]
%12 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%14 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%15 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%16 = bitcast i32* %5 to i8*
%17 = bitcast i32* %6 to i8*
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%19 = load i32*, i32** @stdin
%20 = call i32* @fgets(i8* %12, i32 200, i32* %19)
%21 = icmp eq i32* %20, null
br i1 %21, label %162, label %22
22: ; preds = %0
%23 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 0
%24 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%25 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%26 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 0
%27 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 0
br label %28
28: ; preds = %22, %153
%29 = phi i32* [ null, %22 ], [ %154, %153 ]
%30 = call i8* @strstr(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%31 = icmp eq i8* %30, null
br i1 %31, label %149, label %32
32: ; preds = %28
%33 = getelementptr inbounds i8, i8* %30, i64 6
br label %34
34: ; preds = %32, %68
%35 = phi i64 [ 6, %32 ], [ %72, %68 ]
%36 = phi i32 [ 0, %32 ], [ %71, %68 ]
%37 = phi i8 [ 32, %32 ], [ %70, %68 ]
%38 = phi i8* [ %33, %32 ], [ %69, %68 ]
%39 = getelementptr inbounds i8, i8* %30, i64 %35
%40 = load i8, i8* %39
switch i8 %40, label %41 [
i8 13, label %74
i8 10, label %74
]
41: ; preds = %34
%42 = sext i8 %40 to i32
switch i32 %42, label %65 [
i32 34, label %43
i32 32, label %49
i32 44, label %57
]
43: ; preds = %41
%44 = icmp eq i32 %36, 0
%45 = zext i1 %44 to i32
store i8 32, i8* %38
%46 = icmp ne i8 %37, 32
%47 = zext i1 %46 to i64
%48 = getelementptr inbounds i8, i8* %38, i64 %47
br label %68
49: ; preds = %41
%50 = icmp eq i32 %36, 0
br i1 %50, label %53, label %51
51: ; preds = %49
store i8 43, i8* %38
%52 = getelementptr inbounds i8, i8* %38, i64 1
br label %68
53: ; preds = %49
store i8 32, i8* %38
%54 = icmp ne i8 %37, 32
%55 = zext i1 %54 to i64
%56 = getelementptr inbounds i8, i8* %38, i64 %55
br label %68
57: ; preds = %41
%58 = icmp eq i32 %36, 0
br i1 %58, label %61, label %59
59: ; preds = %57
store i8 124, i8* %38
%60 = getelementptr inbounds i8, i8* %38, i64 1
br label %68
61: ; preds = %57
store i8 32, i8* %38
%62 = icmp ne i8 %37, 32
%63 = zext i1 %62 to i64
%64 = getelementptr inbounds i8, i8* %38, i64 %63
br label %68
65: ; preds = %41
%66 = getelementptr inbounds i8, i8* %38, i64 1
store i8 %40, i8* %38
%67 = load i8, i8* %39
br label %68
68: ; preds = %43, %51, %53, %59, %61, %65
%69 = phi i8* [ %66, %65 ], [ %60, %59 ], [ %64, %61 ], [ %52, %51 ], [ %56, %53 ], [ %48, %43 ]
%70 = phi i8 [ %67, %65 ], [ %37, %59 ], [ 32, %61 ], [ %37, %51 ], [ 32, %53 ], [ 32, %43 ]
%71 = phi i32 [ %36, %65 ], [ 1, %59 ], [ 0, %61 ], [ 1, %51 ], [ 0, %53 ], [ %45, %43 ]
%72 = add nuw nsw i64 %35, 1
%73 = icmp eq i64 %72, 200
br i1 %73, label %74, label %34
74: ; preds = %34, %34, %68
%75 = phi i8* [ %38, %34 ], [ %38, %34 ], [ %69, %68 ]
store i8 0, i8* %75
%76 = getelementptr inbounds i8, i8* %30, i64 5
%77 = load i8, i8* %76
switch i8 %77, label %147 [
i8 115, label %78
i8 100, label %124
]
78: ; preds = %74
%79 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %14, i32* %5, i32* %6, i8* %13, i8* %15)
%80 = load i32, i32* %5
switch i32 %80, label %118 [
i32 32, label %81
i32 36, label %84
i32 38, label %87
i32 40, label %90
i32 60, label %93
i32 64, label %96
i32 100, label %99
i32 160, label %103
i32 128, label %106
]
81: ; preds = %78
%82 = call i32 @strncpy(i8* %25, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 200)
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %25, i8* %14)
br label %122
84: ; preds = %78
%85 = call i32 @strncpy(i8* %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 200)
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8* %25, i8* %14)
br label %122
87: ; preds = %78
%88 = call i32 @strncpy(i8* %25, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 200)
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.8, i64 0, i64 0), i8* %25, i8* %14)
br label %122
90: ; preds = %78
%91 = call i32 @strncpy(i8* %25, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 200)
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.10, i64 0, i64 0), i8* %25, i8* %14)
br label %122
93: ; preds = %78
%94 = call i32 @strncpy(i8* %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 200)
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.12, i64 0, i64 0), i8* %14)
br label %122
96: ; preds = %78
%97 = call i32 @strncpy(i8* %25, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i32 200)
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i8* %25, i8* %14)
br label %122
99: ; preds = %78
%100 = call i32 @strncpy(i8* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i32 200)
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0), i8* %25, i8* %14)
%102 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
br label %122
103: ; preds = %78
%104 = call i32 @strncpy(i8* %25, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i32 200)
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.19, i64 0, i64 0), i8* %25, i8* %14, i8* %15)
br label %122
106: ; preds = %78
%107 = call i32 @strncpy(i8* %25, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32 200)
br label %108
108: ; preds = %112, %106
%109 = phi i8* [ %14, %106 ], [ %114, %112 ]
%110 = load i8, i8* %109
switch i8 %110, label %111 [
i8 0, label %115
i8 58, label %112
]
111: ; preds = %108
br label %112
112: ; preds = %108, %111
%113 = phi i8 [ %110, %111 ], [ 32, %108 ]
store i8 %113, i8* %109
%114 = getelementptr inbounds i8, i8* %109, i64 1
br label %108
115: ; preds = %108
%116 = call i32 (i8*, i8*, ...) @sscanf(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0), i8* %26, i8* %27)
%117 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.22, i64 0, i64 0), i8* %26, i8* %27)
br label %122
118: ; preds = %78
%119 = call i32 @snprintf(i8* %25, i32 200, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0), i32 %80)
%120 = load i32, i32* %6
%121 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.24, i64 0, i64 0), i8* %14, i8* %25, i32 %120, i8* %13, i8* %15)
br label %122
122: ; preds = %118, %115, %103, %99, %96, %93, %90, %87, %84, %81
%123 = phi i32* [ %29, %118 ], [ %29, %115 ], [ %29, %103 ], [ %102, %99 ], [ %29, %96 ], [ %29, %93 ], [ %29, %90 ], [ %29, %87 ], [ %29, %84 ], [ %29, %81 ]
br label %153
124: ; preds = %74
%125 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.25, i64 0, i64 0), i32* %5, i32* %6, i8* %13)
%126 = load i32, i32* %5
%127 = icmp eq i32 %126, 68
br i1 %127, label %128, label %142
128: ; preds = %124
%129 = call i32 @strncpy(i8* %23, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i64 0, i64 0), i32 200)
%130 = icmp eq i32* %29, null
br i1 %130, label %146, label %131
131: ; preds = %128
%132 = call i64 @strtol(i8* nocapture %13, i32* null, i32 10)
%133 = call i32 @rewind(i32* %29)
%134 = icmp sgt i64 %132, 0
br i1 %134, label %135, label %140
135: ; preds = %131, %135
%136 = phi i64 [ %137, %135 ], [ %132, %131 ]
%137 = add nsw i64 %136, -1
%138 = call i32* @fgets(i8* %24, i32 200, i32* %29)
%139 = icmp ugt i64 %136, 1
br i1 %139, label %135, label %140
140: ; preds = %135, %131
%141 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0), i8* %24)
br label %146
142: ; preds = %124
%143 = call i32 @snprintf(i8* %23, i32 200, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0), i32 %126)
%144 = load i32, i32* %6
%145 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.28, i64 0, i64 0), i8* %23, i32 %144, i8* %13)
br label %146
146: ; preds = %128, %140, %142
br label %153
147: ; preds = %74
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.29, i64 0, i64 0), i8* %30)
br label %153
149: ; preds = %28
%150 = load i8, i8* %12
switch i8 %150, label %153 [
i8 32, label %151
i8 9, label %151
]
151: ; preds = %149, %149
%152 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0), i8* %12)
br label %153
153: ; preds = %149, %122, %147, %146, %151
%154 = phi i32* [ %29, %151 ], [ %29, %149 ], [ %123, %122 ], [ %29, %146 ], [ %29, %147 ]
%155 = load i32*, i32** @stdin
%156 = call i32* @fgets(i8* %12, i32 200, i32* %155)
%157 = icmp eq i32* %156, null
br i1 %157, label %158, label %28
158: ; preds = %153
%159 = icmp eq i32* %154, null
br i1 %159, label %162, label %160
160: ; preds = %158
%161 = call i32 @fclose(i32* %154)
br label %162
162: ; preds = %0, %160, %158
ret i32 0
}