#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 */
scalar_t__ EOF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, char *, char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  int i, j, k, FlagN;
  FILE *table, *kernel, *util, *make;
  char Table[] = "syscall.tbl";
  char KLib[] = "syskern.asm";
  char buf[160];
  char s1[160];
  char s2[160];
  char s3[160];
  char Module[160];
  char Proc[] = "; Do not edit this file.\n; This file is automatically "
                "generated\n\n\tmodel "
                "tiny\n\t.code\n%s:\tmov\tax,%i\n\tint\t0%"
                "02Xh\n\tret\n\tpublic\t%s\n\tend\n";
  char do_not_edit[] =
      "%s Do not edit this file.\n%s This file is automatically generated\n\n";
  if (argc < 2) {
    puts("usage: gentbl CommandSourcePath [-n]\n-n - no overwrite existing "
         "modules *.asm");
    return 1;
  }
  if (argc == 3)
    if (!strcmp(argv[2], "-n"))
      FlagN = 1;
    else
      FlagN = 0;
  puts("\n\tGenTbl v. 0.0.0.3 24-Mar-96 Generate System Calls\n");
  buf[0] = 0;
  if ((table = fopen(Table, "rt")) == NULL) {
    printf("Can't open %s\n", Table);
    return 2;
  }
  if ((kernel = fopen(KLib, "wt")) == NULL) {
    printf("Can't open %s\n", KLib);
    return 2;
  }
  sprintf(Module, "%s\\syscall.h", argv[1]);
  if ((make = fopen(Module, "wt")) == NULL) {
    printf("Can't open %s\n", Module);
    return 2;
  }
  if (fprintf(make, do_not_edit, ";", ";") == EOF) {
    printf("Can't write %s\n", Module);
    return 2;
  }
  if (fprintf(make, "INT_NO\tequ\t0%02Xh\n", 0x84) == EOF) {
    printf("Can't write %s\n", Module);
    return 2;
  }
  if (fprintf(kernel, do_not_edit, ";", ";") == EOF) {
    printf("Can't write %s\n", KLib);
    return 2;
  }
  for (i = 0;;) {
    if (fgets(buf, 160, table) == NULL)
      break;
    switch (buf[0]) {
    case '\n':
    case ' ':
    case ';':
    case 0:
      continue;
    }
    s3[0] = 0;
    sscanf(buf, "%s %s %s", s1, s2, s3);
    if (!s3[0])
      strcpy(s3, s1);
    if (fprintf(kernel, "extrn\t%s:near\ndw\t%s,_TEXT:%s\n", s3, s2, s3) ==
        EOF) {
      printf("Can't write %s\n", KLib);
      return 2;
    }
    if (fprintf(make, "%s\tequ\t%03i\n", s1 + 1, i) == EOF) {
      printf("Can't write %s\n", Module);
      return 2;
    }
    sprintf(Module, "%s\\%03i.ASM", argv[1], i);
    if (FlagN)
      if ((util = fopen(Module, "rt")) != NULL) {
        fclose(util);
        printf("System Call %03i %013s existing.  Not rewrited.\n", i, s1);
        goto LL;
      }
    if ((util = fopen(Module, "wt")) == NULL) {
      printf("Can't open %s\n", Module);
      return 2;
    }
    if (fprintf(util, Proc, s1, i, 0x84, s1) == EOF) {
      printf("Can't write %s\n", Module);
      return 2;
    }
    if (fclose(util)) {
      printf("Can't close %s\n", Module);
    }
    if (strcmp(s1, s3))
      printf("System Call %03i %s %s\n", i, s1, s3);
    else
      printf("System Call %03i %s\n", i, s1);
  LL:
    i++;
  }
  if (fclose(table)) {
    printf("Can't close %s\n", Table);
  }
  if (fclose(kernel)) {
    printf("Can't close %s\n", KLib);
  }
  if (fclose(make)) {
    printf("Can't close %s\n", Module);
  }
  puts("");
  sprintf(Module, "%s\\tlib.cmd", argv[1]);
  printf("Generate %s\n", Module);
  if ((make = fopen(Module, "wt")) == NULL) {
    printf("Can't open %s\n", Module);
    return 2;
  }
  for (j = 0; j < i;) {
    for (k = 1; k <= 15; k++) {
      if (fprintf(make, "-+%03i", j++) == EOF)
        goto L2;
      if (i == j)
        break;
    }
    if (i == j)
      if (fprintf(make, "\n\n") == EOF)
        goto L2;
      else
        ;
    else if (fprintf(make, " &\n") == EOF) {
    L2:
      printf("Can't write %s\n", Module);
      return 2;
    }
  }
  if (fclose(make)) {
    printf("Can't close %s\n", Module);
  }
  sprintf(Module, "%s\\makefile.1", argv[1]);
  printf("Generate %s\n", Module);
  if ((make = fopen(Module, "wt")) == NULL) {
    printf("Can't open %s\n", Module);
    return 2;
  }
  if (fprintf(make, do_not_edit, "#", "#") == EOF)
    goto L1;
  if (fprintf(make, "Members=\\\n") == EOF)
    goto L1;
  for (j = 0; j < i;) {
    for (k = 1; k <= 9; k++) {
      if (fprintf(make, "%03i.obj ", j++) == EOF)
        goto L1;
      if (i == j)
        break;
    }
    if (i == j)
      if (fprintf(make, "\n\n") == EOF)
        goto L1;
      else
        ;
    else if (fprintf(make, "\\\n") == EOF) {
    L1:
      printf("Can't write %s\n", Module);
      return 2;
    }
  }
  if (fclose(make)) {
    printf("Can't close %s\n", Module);
  }
  printf("\nGenerate finished. Total %03i system calls\n\n", --i);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x470,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe20(%rip),%rax
mov    %rax,-0x4c(%rbp)
mov    0xe1e(%rip),%eax
mov    %eax,-0x44(%rbp)
mov    0xe18(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe16(%rip),%eax
mov    %eax,-0x50(%rbp)
lea    -0x410(%rbp),%rdi
lea    0x1001(%rip),%rsi
mov    $0x84,%edx
call   10a0 <memcpy@plt>
lea    -0x460(%rbp),%rdi
lea    0x1079(%rip),%rsi
mov    $0x44,%edx
call   10a0 <memcpy@plt>
cmpl   $0x2,-0x8(%rbp)
jge    1253 <main+0x93>
lea    0xdd6(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1bbb <main+0x9fb>
cmpl   $0x3,-0x8(%rbp)
jne    1293 <main+0xd3>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdfa(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1287 <main+0xc7>
movl   $0x1,-0x20(%rbp)
jmp    128e <main+0xce>
movl   $0x0,-0x20(%rbp)
jmp    1293 <main+0xd3>
lea    0xdcf(%rip),%rdi
call   1040 <puts@plt>
movb   $0x0,-0x100(%rbp)
lea    -0x4c(%rbp),%rdi
lea    0xded(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    12e2 <main+0x122>
lea    -0x4c(%rbp),%rsi
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1bbb <main+0x9fb>
lea    -0x58(%rbp),%rdi
lea    0xdc3(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    131e <main+0x15e>
lea    -0x58(%rbp),%rsi
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1bbb <main+0x9fb>
lea    -0x380(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd7f(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0x380(%rbp),%rdi
lea    0xd67(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    137d <main+0x1bd>
lea    -0x380(%rbp),%rsi
lea    0xd37(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1bbb <main+0x9fb>
mov    -0x40(%rbp),%rdi
lea    -0x460(%rbp),%rsi
lea    0xd31(%rip),%rcx
mov    %rcx,%rdx
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2c48(%rip),%rcx
cmp    (%rcx),%rax
jne    13ca <main+0x20a>
lea    -0x380(%rbp),%rsi
lea    0xd0b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1bbb <main+0x9fb>
mov    -0x40(%rbp),%rdi
lea    0xcfd(%rip),%rsi
mov    $0x84,%edx
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2c00(%rip),%rcx
cmp    (%rcx),%rax
jne    1412 <main+0x252>
lea    -0x380(%rbp),%rsi
lea    0xcc3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1bbb <main+0x9fb>
mov    -0x30(%rbp),%rdi
lea    -0x460(%rbp),%rsi
lea    0xc9c(%rip),%rcx
mov    %rcx,%rdx
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2bb3(%rip),%rcx
cmp    (%rcx),%rax
jne    145c <main+0x29c>
lea    -0x58(%rbp),%rsi
lea    0xc79(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1bbb <main+0x9fb>
movl   $0x0,-0x14(%rbp)
lea    -0x100(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0xa0,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
jne    1487 <main+0x2c7>
jmp    177d <main+0x5bd>
movsbl -0x100(%rbp),%eax
mov    %eax,-0x464(%rbp)
test   %eax,%eax
je     14dd <main+0x31d>
jmp    14a1 <main+0x2e1>
mov    -0x464(%rbp),%eax
sub    $0xa,%eax
je     14dd <main+0x31d>
jmp    14b5 <main+0x2f5>
mov    -0x464(%rbp),%eax
sub    $0x20,%eax
je     14dd <main+0x31d>
jmp    14c9 <main+0x309>
mov    -0x464(%rbp),%eax
sub    $0x3b,%eax
jne    14e2 <main+0x322>
jmp    14dd <main+0x31d>
jmp    1463 <main+0x2a3>
movb   $0x0,-0x2e0(%rbp)
lea    -0x100(%rbp),%rdi
lea    -0x1a0(%rbp),%rdx
lea    -0x240(%rbp),%rcx
lea    -0x2e0(%rbp),%r8
lea    0xbd9(%rip),%rsi
call   10b0 <sscanf@plt>
cmpb   $0x0,-0x2e0(%rbp)
jne    1531 <main+0x371>
lea    -0x2e0(%rbp),%rdi
lea    -0x1a0(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x30(%rbp),%rdi
lea    -0x2e0(%rbp),%rdx
lea    -0x240(%rbp),%rcx
lea    -0x2e0(%rbp),%r8
lea    0xb9d(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2a89(%rip),%rcx
cmp    (%rcx),%rax
jne    1586 <main+0x3c6>
lea    -0x58(%rbp),%rsi
lea    0xb4f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1bbb <main+0x9fb>
mov    -0x40(%rbp),%rdi
lea    -0x1a0(%rbp),%rdx
add    $0x1,%rdx
mov    -0x14(%rbp),%ecx
lea    0xb6d(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2a3b(%rip),%rcx
cmp    (%rcx),%rax
jne    15d7 <main+0x417>
lea    -0x380(%rbp),%rsi
lea    0xafe(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1bbb <main+0x9fb>
lea    -0x380(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x14(%rbp),%ecx
lea    0xb29(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
cmpl   $0x0,-0x20(%rbp)
je     164d <main+0x48d>
lea    -0x380(%rbp),%rdi
lea    0xa8f(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
je     1648 <main+0x488>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x14(%rbp),%esi
lea    -0x1a0(%rbp),%rdx
lea    0xae9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    176f <main+0x5af>
jmp    164d <main+0x48d>
lea    -0x380(%rbp),%rdi
lea    0xa55(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    168f <main+0x4cf>
lea    -0x380(%rbp),%rsi
lea    0xa25(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1bbb <main+0x9fb>
mov    -0x38(%rbp),%rdi
lea    -0x410(%rbp),%rsi
lea    -0x1a0(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    -0x1a0(%rbp),%r9
mov    $0x84,%r8d
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2929(%rip),%rcx
cmp    (%rcx),%rax
jne    16e9 <main+0x529>
lea    -0x380(%rbp),%rsi
lea    0x9ec(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1bbb <main+0x9fb>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
cmp    $0x0,%rax
je     1711 <main+0x551>
lea    -0x380(%rbp),%rsi
lea    0xa4c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x1a0(%rbp),%rdi
lea    -0x2e0(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1752 <main+0x592>
mov    -0x14(%rbp),%esi
lea    -0x1a0(%rbp),%rdx
lea    -0x2e0(%rbp),%rcx
lea    0xa20(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    176a <main+0x5aa>
mov    -0x14(%rbp),%esi
lea    -0x1a0(%rbp),%rdx
lea    0xa1b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    176f <main+0x5af>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1463 <main+0x2a3>
mov    -0x28(%rbp),%rdi
call   1050 <fclose@plt>
cmp    $0x0,%rax
je     17a2 <main+0x5e2>
lea    -0x4c(%rbp),%rsi
lea    0x9bb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1050 <fclose@plt>
cmp    $0x0,%rax
je     17c7 <main+0x607>
lea    -0x58(%rbp),%rsi
lea    0x996(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
cmp    $0x0,%rax
je     17ef <main+0x62f>
lea    -0x380(%rbp),%rsi
lea    0x96e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xa13(%rip),%rdi
call   1040 <puts@plt>
lea    -0x380(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0x982(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0x380(%rbp),%rsi
lea    0x979(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x380(%rbp),%rdi
lea    0x875(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    186f <main+0x6af>
lea    -0x380(%rbp),%rsi
lea    0x845(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1bbb <main+0x9fb>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1978 <main+0x7b8>
movl   $0x1,-0x1c(%rbp)
cmpl   $0xf,-0x1c(%rbp)
jg     18e9 <main+0x729>
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
lea    0x903(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2731(%rip),%rcx
cmp    (%rcx),%rax
jne    18c5 <main+0x705>
jmp    194d <main+0x78d>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    18d6 <main+0x716>
jmp    18e9 <main+0x729>
jmp    18db <main+0x71b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1889 <main+0x6c9>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1926 <main+0x766>
mov    -0x40(%rbp),%rdi
lea    0x907(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x26da(%rip),%rcx
cmp    (%rcx),%rax
jne    191c <main+0x75c>
jmp    194d <main+0x78d>
jmp    1921 <main+0x761>
jmp    1973 <main+0x7b3>
mov    -0x40(%rbp),%rdi
lea    0x882(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x26a9(%rip),%rcx
cmp    (%rcx),%rax
jne    196e <main+0x7ae>
jmp    194d <main+0x78d>
lea    -0x380(%rbp),%rsi
lea    0x767(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1bbb <main+0x9fb>
jmp    1973 <main+0x7b3>
jmp    1876 <main+0x6b6>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
cmp    $0x0,%rax
je     19a0 <main+0x7e0>
lea    -0x380(%rbp),%rsi
lea    0x7bd(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x380(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0x801(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0x380(%rbp),%rsi
lea    0x7d4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x380(%rbp),%rdi
lea    0x6d0(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    1a14 <main+0x854>
lea    -0x380(%rbp),%rsi
lea    0x6a0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1bbb <main+0x9fb>
mov    -0x40(%rbp),%rdi
lea    -0x460(%rbp),%rsi
lea    0x79f(%rip),%rcx
mov    %rcx,%rdx
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x25b1(%rip),%rcx
cmp    (%rcx),%rax
jne    1a45 <main+0x885>
jmp    1b4a <main+0x98a>
mov    -0x40(%rbp),%rdi
lea    0x777(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x258a(%rip),%rcx
cmp    (%rcx),%rax
jne    1a6c <main+0x8ac>
jmp    1b4a <main+0x98a>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1b75 <main+0x9b5>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x9,-0x1c(%rbp)
jg     1ae6 <main+0x926>
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
lea    0x72c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2534(%rip),%rcx
cmp    (%rcx),%rax
jne    1ac2 <main+0x902>
jmp    1b4a <main+0x98a>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1ad3 <main+0x913>
jmp    1ae6 <main+0x926>
jmp    1ad8 <main+0x918>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1a86 <main+0x8c6>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1b23 <main+0x963>
mov    -0x40(%rbp),%rdi
lea    0x70a(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x24dd(%rip),%rcx
cmp    (%rcx),%rax
jne    1b19 <main+0x959>
jmp    1b4a <main+0x98a>
jmp    1b1e <main+0x95e>
jmp    1b70 <main+0x9b0>
mov    -0x40(%rbp),%rdi
lea    0x6a1(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x24ac(%rip),%rcx
cmp    (%rcx),%rax
jne    1b6b <main+0x9ab>
jmp    1b4a <main+0x98a>
lea    -0x380(%rbp),%rsi
lea    0x56a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1bbb <main+0x9fb>
jmp    1b70 <main+0x9b0>
jmp    1a73 <main+0x8b3>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
cmp    $0x0,%rax
je     1b9d <main+0x9dd>
lea    -0x380(%rbp),%rsi
lea    0x5c0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%esi
add    $0xffffffff,%esi
mov    %esi,-0x14(%rbp)
lea    0x62f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x470,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x428,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
movabs $0x2e6c6c6163737973,%rax
6c 6c 2e
mov    %rax,0x20(%rsp)
movl   $0x6c6274,0x28(%rsp)
movabs $0x2e6e72656b737973,%rax
72 6e 2e
mov    %rax,0x10(%rsp)
movl   $0x6d7361,0x18(%rsp)
lea    0xff5(%rip),%rsi
lea    0x3a0(%rsp),%rdi
mov    $0x84,%edx
call   10b0 <memcpy@plt>
movaps 0x109c(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0x1080(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0x1064(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0x1048(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movl   $0xa0a64,0x70(%rsp)
cmp    $0x1,%ebp
jg     1280 <main+0xb0>
lea    0xda7(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%eax
jmp    1885 <main+0x6b5>
cmp    $0x3,%ebp
jne    129c <main+0xcc>
mov    0x10(%r14),%rdi
lea    0xdd6(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
setne  %r13b
lea    0xdc6(%rip),%rdi
call   1050 <puts@plt>
movb   $0x0,0x1c0(%rsp)
lea    0xde7(%rip),%rsi
lea    0x20(%rsp),%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     136e <main+0x19e>
mov    %rax,%rbp
lea    0xddc(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     137f <main+0x1af>
mov    %rax,%r12
mov    0x8(%r14),%rdx
lea    0xdbe(%rip),%rsi
lea    0x80(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   10e0 <sprintf@plt>
lea    0xda2(%rip),%rsi
mov    %rbx,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     186a <main+0x69a>
mov    %rax,%r15
lea    0xd97(%rip),%rcx
lea    0x30(%rsp),%rsi
mov    %rax,%rdi
mov    %rcx,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x2ca6(%rip),%rbx
cmp    (%rbx),%rax
je     1362 <main+0x192>
lea    0xd84(%rip),%rsi
mov    %r15,%rdi
mov    $0x84,%edx
xor    %eax,%eax
call   10a0 <fprintf@plt>
cmp    (%rbx),%rax
jne    1390 <main+0x1c0>
lea    0xd59(%rip),%rdi
jmp    1871 <main+0x6a1>
lea    0xd2c(%rip),%rdi
lea    0x20(%rsp),%rsi
jmp    1879 <main+0x6a9>
lea    0xd1b(%rip),%rdi
lea    0x10(%rsp),%rsi
jmp    1879 <main+0x6a9>
lea    0xd29(%rip),%rcx
movl   $0x0,0x8(%rsp)
lea    0x30(%rsp),%rsi
mov    %r12,%rdi
mov    %rcx,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
cmp    (%rbx),%rax
jne    13bf <main+0x1ef>
lea    0xd05(%rip),%rdi
jmp    1386 <main+0x1b6>
mov    %r13b,0xf(%rsp)
lea    0x1c0(%rsp),%rdi
mov    $0xa0,%esi
mov    %rbp,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     1645 <main+0x475>
lea    0x300(%rsp),%rdx
lea    0x260(%rsp),%rcx
lea    0x120(%rsp),%rbx
movl   $0x0,0x8(%rsp)
mov    %rdx,%r13
cs nopw 0x0(%rax,%rax,1)
nop
movsbl 0x1c0(%rsp),%eax
cmp    $0x3b,%eax
ja     145f <main+0x28f>
movabs $0x800000100000401,%rsi
bt     %rax,%rsi
jae    145f <main+0x28f>
lea    0x1c0(%rsp),%rdi
mov    $0xa0,%esi
mov    %rbp,%rdx
call   1080 <fgets@plt>
lea    0x120(%rsp),%rbx
lea    0x260(%rsp),%rcx
mov    %r13,%rdx
test   %rax,%rax
jne    1410 <main+0x240>
jmp    1645 <main+0x475>
movb   $0x0,0x120(%rsp)
lea    0x1c0(%rsp),%rdi
lea    0xc6f(%rip),%rsi
mov    %rbx,%r8
call   10c0 <sscanf@plt>
cmpb   $0x0,0x120(%rsp)
jne    1493 <main+0x2c3>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <strcpy@plt>
mov    %r12,%rdi
lea    0xc51(%rip),%rsi
mov    %rbx,%rdx
lea    0x260(%rsp),%rcx
mov    %rbx,%r8
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x2b2f(%rip),%rcx
cmp    (%rcx),%rax
je     13b6 <main+0x1e6>
mov    %r15,%rdi
lea    0xc40(%rip),%rsi
lea    0x301(%rsp),%rdx
mov    0x8(%rsp),%ecx
mov    %ecx,%ebx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x2b00(%rip),%rcx
cmp    (%rcx),%rax
je     1362 <main+0x192>
mov    0x8(%r14),%rdx
lea    0x80(%rsp),%rdi
lea    0xc15(%rip),%rsi
mov    %ebx,%ecx
mov    %rdi,%rbx
xor    %eax,%eax
call   10e0 <sprintf@plt>
testb  $0x1,0xf(%rsp)
jne    1548 <main+0x378>
mov    %rbx,%rdi
lea    0xb7d(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     1548 <main+0x378>
mov    %rax,%rdi
call   1060 <fclose@plt>
lea    0xbeb(%rip),%rdi
mov    0x8(%rsp),%ebx
mov    %ebx,%esi
mov    %r13,%rdx
jmp    1606 <main+0x436>
mov    %rbx,%rdi
lea    0xb5e(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     186a <main+0x69a>
mov    %rax,%rbx
mov    %rax,%rdi
lea    0x3a0(%rsp),%rsi
mov    %r13,%rdx
mov    0x8(%rsp),%ecx
mov    $0x84,%r8d
mov    %r13,%r9
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x2a5c(%rip),%rcx
cmp    (%rcx),%rax
je     1362 <main+0x192>
mov    %rbx,%rdi
call   1060 <fclose@plt>
test   %rax,%rax
je     15b8 <main+0x3e8>
lea    0xbad(%rip),%rdi
lea    0x80(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r13,%rdi
lea    0x120(%rsp),%rbx
mov    %rbx,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     15f1 <main+0x421>
lea    0xb8f(%rip),%rdi
mov    %rbx,%rcx
mov    0x8(%rsp),%ebx
mov    %ebx,%esi
lea    0x300(%rsp),%rdx
xor    %eax,%eax
call   1070 <printf@plt>
jmp    160d <main+0x43d>
lea    0xb86(%rip),%rdi
mov    0x8(%rsp),%ebx
mov    %ebx,%esi
lea    0x300(%rsp),%rdx
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%ebx
mov    %ebx,0x8(%rsp)
lea    0x1c0(%rsp),%rdi
mov    $0xa0,%esi
mov    %rbp,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
mov    %r13,%rdx
lea    0x260(%rsp),%rcx
lea    0x120(%rsp),%rbx
jne    1410 <main+0x240>
mov    %rbp,%rdi
call   1060 <fclose@plt>
test   %rax,%rax
je     1665 <main+0x495>
lea    0xafd(%rip),%rdi
lea    0x20(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12,%rdi
call   1060 <fclose@plt>
test   %rax,%rax
je     1685 <main+0x4b5>
lea    0xadd(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
call   1060 <fclose@plt>
test   %rax,%rax
je     16a8 <main+0x4d8>
lea    0xabd(%rip),%rdi
lea    0x80(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%r14),%rdx
lea    0xad6(%rip),%rsi
lea    0x80(%rsp),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   10e0 <sprintf@plt>
lea    0xac9(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x9c9(%rip),%rsi
mov    %rbp,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     186a <main+0x69a>
mov    %rax,%rbp
cmpl   $0x0,0x8(%rsp)
jle    178c <main+0x5bc>
mov    $0x1,%ebx
lea    0xa9a(%rip),%r15
lea    0xa9a(%rip),%r13
mov    $0x1,%r12d
jmp    1728 <main+0x558>
add    $0x1,%r12d
add    $0x1,%ebx
lea    -0x1(%rbx),%edx
mov    %rbp,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x28a9(%rip),%rcx
cmp    (%rcx),%rax
je     1362 <main+0x192>
mov    0x8(%rsp),%eax
cmp    %ebx,%eax
je     1756 <main+0x586>
cmp    $0xe,%r12d
jbe    1721 <main+0x551>
mov    %rbp,%rdi
cmp    %ebx,%eax
jne    1766 <main+0x596>
lea    0xaa3(%rip),%rsi
jmp    1769 <main+0x599>
mov    %r13,%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x2871(%rip),%rcx
cmp    (%rcx),%rax
je     1362 <main+0x192>
mov    $0x1,%r12d
cmp    0x8(%rsp),%ebx
jl     1725 <main+0x555>
mov    %rbp,%rdi
call   1060 <fclose@plt>
test   %rax,%rax
je     17af <main+0x5df>
lea    0x9b6(%rip),%rdi
lea    0x80(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%r14),%rdx
lea    0x9fd(%rip),%rsi
lea    0x80(%rsp),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   10e0 <sprintf@plt>
lea    0x9cc(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x8cc(%rip),%rsi
mov    %rbp,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
mov    0x27f2(%rip),%rbx
je     186a <main+0x69a>
mov    %rax,%r13
lea    0x9c3(%rip),%rcx
lea    0x30(%rsp),%rsi
mov    %rax,%rdi
mov    %rcx,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
cmp    (%rbx),%rax
je     1362 <main+0x192>
lea    0x9a3(%rip),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x27b3(%rip),%rcx
cmp    (%rcx),%rax
je     1362 <main+0x192>
cmpl   $0x0,0x8(%rsp)
jle    18fb <main+0x72b>
mov    $0x1,%ebx
lea    0x97d(%rip),%r14
lea    0x9ab(%rip),%r15
lea    0x96c(%rip),%r12
mov    $0x1,%ebp
jmp    189d <main+0x6cd>
lea    0x830(%rip),%rdi
lea    0x80(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x2,%eax
add    $0x428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
add    $0x1,%ebp
add    $0x1,%ebx
lea    -0x1(%rbx),%edx
mov    %r13,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x2734(%rip),%rcx
cmp    (%rcx),%rax
je     1362 <main+0x192>
mov    0x8(%rsp),%eax
cmp    %ebx,%eax
je     18ca <main+0x6fa>
cmp    $0x8,%ebp
jbe    1897 <main+0x6c7>
mov    %r13,%rdi
cmp    %ebx,%eax
jne    18d6 <main+0x706>
mov    %r15,%rsi
jmp    18d9 <main+0x709>
mov    %r12,%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x2701(%rip),%rcx
cmp    (%rcx),%rax
je     1362 <main+0x192>
mov    $0x1,%ebp
cmp    0x8(%rsp),%ebx
jl     189a <main+0x6ca>
mov    %r13,%rdi
call   1060 <fclose@plt>
test   %rax,%rax
je     191e <main+0x74e>
lea    0x847(%rip),%rdi
lea    0x80(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%rsp),%esi
add    $0xffffffff,%esi
lea    0x8b0(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@__const.main.Table = [12 x i8] c"syscall.tbl\00"
@__const.main.KLib = [12 x i8] c"syskern.asm\00"
@__const.main.Proc = [132 x i8] c"; Do not edit this file.\0A; This file is automatically generated\0A\0A\09model tiny\0A\09.code\0A%s:\09mov\09ax,%i\0A\09int\090%02Xh\0A\09ret\0A\09public\09%s\0A\09end\0A\00"
@__const.main.do_not_edit = [68 x i8] c"%s Do not edit this file.\0A%s This file is automatically generated\0A\0A\00"
@.str = [78 x i8] c"usage: gentbl CommandSourcePath [-n]\0A-n - no overwrite existing modules *.asm\00"
@.str.1 = [3 x i8] c"-n\00"
@.str.2 = [53 x i8] c"\0A\09GenTbl v. 0.0.0.3 24-Mar-96 Generate System Calls\0A\00"
@.str.3 = [3 x i8] c"rt\00"
@.str.4 = [15 x i8] c"Can't open %s\0A\00"
@.str.5 = [3 x i8] c"wt\00"
@.str.6 = [13 x i8] c"%s\\syscall.h\00"
@.str.7 = [2 x i8] c";\00"
@EOF = global i64 0
@.str.8 = [16 x i8] c"Can't write %s\0A\00"
@.str.9 = [19 x i8] c"INT_NO\09equ\090%02Xh\0A\00"
@.str.10 = [9 x i8] c"%s %s %s\00"
@.str.11 = [30 x i8] c"extrn\09%s:near\0Adw\09%s,_TEXT:%s\0A\00"
@.str.12 = [13 x i8] c"%s\09equ\09%03i\0A\00"
@.str.13 = [12 x i8] c"%s\\%03i.ASM\00"
@.str.14 = [49 x i8] c"System Call %03i %013s existing. Not rewrited.\0A\00"
@.str.15 = [16 x i8] c"Can't close %s\0A\00"
@.str.16 = [24 x i8] c"System Call %03i %s %s\0A\00"
@.str.17 = [21 x i8] c"System Call %03i %s\0A\00"
@.str.18 = [1 x i8] zeroinitializer
@.str.19 = [12 x i8] c"%s\\tlib.cmd\00"
@.str.20 = [13 x i8] c"Generate %s\0A\00"
@.str.21 = [7 x i8] c"-+%03i\00"
@.str.22 = [3 x i8] c"\0A\0A\00"
@.str.23 = [4 x i8] c" &\0A\00"
@.str.24 = [14 x i8] c"%s\\makefile.1\00"
@.str.25 = [2 x i8] c"#\00"
@.str.26 = [11 x i8] c"Members=\\\0A\00"
@.str.27 = [10 x i8] c"%03i.obj \00"
@.str.28 = [3 x i8] c"\\\0A\00"
@.str.29 = [46 x i8] c"\0AGenerate finished. Total %03i system calls\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca [12 x i8]
%15 = alloca [12 x i8]
%16 = alloca [160 x i8]
%17 = alloca [160 x i8]
%18 = alloca [160 x i8]
%19 = alloca [160 x i8]
%20 = alloca [160 x i8]
%21 = alloca [132 x i8]
%22 = alloca [68 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%23 = bitcast [12 x i8]* %14 to i8*
%24 = bitcast [12 x i8]* %15 to i8*
%25 = bitcast [132 x i8]* %21 to i8*
%26 = bitcast [68 x i8]* %22 to i8*
%27 = load i32, i32* %4
%28 = icmp slt i32 %27, 2
br i1 %28, label %29, label %31
29: ; preds = %2
%30 = call i32 @puts(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %389
31: ; preds = %2
%32 = load i32, i32* %4
%33 = icmp eq i32 %32, 3
br i1 %33, label %34, label %43
34: ; preds = %31
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%39 = icmp ne i64 %38, 0
br i1 %39, label %41, label %40
40: ; preds = %34
store i32 1, i32* %9
br label %42
41: ; preds = %34
store i32 0, i32* %9
br label %42
42: ; preds = %41, %40
br label %43
43: ; preds = %42, %31
%44 = call i32 @puts(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%45 = getelementptr inbounds [160 x i8], [160 x i8]* %16, i64 0, i64 0
store i8 0, i8* %45
%46 = getelementptr inbounds [12 x i8], [12 x i8]* %14, i64 0, i64 0
%47 = call i32* @fopen(i8* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %47, i32** %10
%48 = icmp eq i32* %47, null
br i1 %48, label %49, label %52
49: ; preds = %43
%50 = getelementptr inbounds [12 x i8], [12 x i8]* %14, i64 0, i64 0
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %50)
store i32 2, i32* %3
br label %389
52: ; preds = %43
%53 = getelementptr inbounds [12 x i8], [12 x i8]* %15, i64 0, i64 0
%54 = call i32* @fopen(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %54, i32** %11
%55 = icmp eq i32* %54, null
br i1 %55, label %56, label %59
56: ; preds = %52
%57 = getelementptr inbounds [12 x i8], [12 x i8]* %15, i64 0, i64 0
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %57)
store i32 2, i32* %3
br label %389
59: ; preds = %52
%60 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%61 = load i8**, i8*** %5
%62 = getelementptr inbounds i8*, i8** %61, i64 1
%63 = load i8*, i8** %62
%64 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %60, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %63)
%65 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%66 = call i32* @fopen(i8* %65, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %66, i32** %13
%67 = icmp eq i32* %66, null
br i1 %67, label %68, label %71
68: ; preds = %59
%69 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %69)
store i32 2, i32* %3
br label %389
71: ; preds = %59
%72 = load i32*, i32** %13
%73 = getelementptr inbounds [68 x i8], [68 x i8]* %22, i64 0, i64 0
%74 = call i64 (i32*, i8*, ...) @fprintf(i32* %72, i8* %73, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%75 = load i64, i64* @EOF
%76 = icmp eq i64 %74, %75
br i1 %76, label %77, label %80
77: ; preds = %71
%78 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* %78)
store i32 2, i32* %3
br label %389
80: ; preds = %71
%81 = load i32*, i32** %13
%82 = call i64 (i32*, i8*, ...) @fprintf(i32* %81, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 132)
%83 = load i64, i64* @EOF
%84 = icmp eq i64 %82, %83
br i1 %84, label %85, label %88
85: ; preds = %80
%86 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* %86)
store i32 2, i32* %3
br label %389
88: ; preds = %80
%89 = load i32*, i32** %11
%90 = getelementptr inbounds [68 x i8], [68 x i8]* %22, i64 0, i64 0
%91 = call i64 (i32*, i8*, ...) @fprintf(i32* %89, i8* %90, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%92 = load i64, i64* @EOF
%93 = icmp eq i64 %91, %92
br i1 %93, label %94, label %97
94: ; preds = %88
%95 = getelementptr inbounds [12 x i8], [12 x i8]* %15, i64 0, i64 0
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* %95)
store i32 2, i32* %3
br label %389
97: ; preds = %88
store i32 0, i32* %6
br label %98
98: ; preds = %206, %108, %97
%99 = getelementptr inbounds [160 x i8], [160 x i8]* %16, i64 0, i64 0
%100 = load i32*, i32** %10
%101 = call i32* @fgets(i8* %99, i32 160, i32* %100)
%102 = icmp eq i32* %101, null
br i1 %102, label %103, label %104
103: ; preds = %98
br label %209
104: ; preds = %98
%105 = getelementptr inbounds [160 x i8], [160 x i8]* %16, i64 0, i64 0
%106 = load i8, i8* %105
%107 = sext i8 %106 to i32
switch i32 %107, label %109 [
i32 10, label %108
i32 32, label %108
i32 59, label %108
i32 0, label %108
]
108: ; preds = %104, %104, %104, %104
br label %98
109: ; preds = %104
%110 = getelementptr inbounds [160 x i8], [160 x i8]* %19, i64 0, i64 0
store i8 0, i8* %110
%111 = getelementptr inbounds [160 x i8], [160 x i8]* %16, i64 0, i64 0
%112 = getelementptr inbounds [160 x i8], [160 x i8]* %17, i64 0, i64 0
%113 = getelementptr inbounds [160 x i8], [160 x i8]* %18, i64 0, i64 0
%114 = getelementptr inbounds [160 x i8], [160 x i8]* %19, i64 0, i64 0
%115 = call i32 @sscanf(i8* %111, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8* %112, i8* %113, i8* %114)
%116 = getelementptr inbounds [160 x i8], [160 x i8]* %19, i64 0, i64 0
%117 = load i8, i8* %116
%118 = icmp ne i8 %117, 0
br i1 %118, label %123, label %119
119: ; preds = %109
%120 = getelementptr inbounds [160 x i8], [160 x i8]* %19, i64 0, i64 0
%121 = getelementptr inbounds [160 x i8], [160 x i8]* %17, i64 0, i64 0
%122 = call i32 @strcpy(i8* %120, i8* %121)
br label %123
123: ; preds = %119, %109
%124 = load i32*, i32** %11
%125 = getelementptr inbounds [160 x i8], [160 x i8]* %19, i64 0, i64 0
%126 = getelementptr inbounds [160 x i8], [160 x i8]* %18, i64 0, i64 0
%127 = getelementptr inbounds [160 x i8], [160 x i8]* %19, i64 0, i64 0
%128 = call i64 (i32*, i8*, ...) @fprintf(i32* %124, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), i8* %125, i8* %126, i8* %127)
%129 = load i64, i64* @EOF
%130 = icmp eq i64 %128, %129
br i1 %130, label %131, label %134
131: ; preds = %123
%132 = getelementptr inbounds [12 x i8], [12 x i8]* %15, i64 0, i64 0
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* %132)
store i32 2, i32* %3
br label %389
134: ; preds = %123
%135 = load i32*, i32** %13
%136 = getelementptr inbounds [160 x i8], [160 x i8]* %17, i64 0, i64 0
%137 = getelementptr inbounds i8, i8* %136, i64 1
%138 = load i32, i32* %6
%139 = call i64 (i32*, i8*, ...) @fprintf(i32* %135, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0), i8* %137, i32 %138)
%140 = load i64, i64* @EOF
%141 = icmp eq i64 %139, %140
br i1 %141, label %142, label %145
142: ; preds = %134
%143 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* %143)
store i32 2, i32* %3
br label %389
145: ; preds = %134
%146 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%147 = load i8**, i8*** %5
%148 = getelementptr inbounds i8*, i8** %147, i64 1
%149 = load i8*, i8** %148
%150 = load i32, i32* %6
%151 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %146, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0), i8* %149, i32 %150)
%152 = load i32, i32* %9
%153 = icmp ne i32 %152, 0
br i1 %153, label %154, label %165
154: ; preds = %145
%155 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%156 = call i32* @fopen(i8* %155, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %156, i32** %12
%157 = icmp ne i32* %156, null
br i1 %157, label %158, label %164
158: ; preds = %154
%159 = load i32*, i32** %12
%160 = call i64 @fclose(i32* %159)
%161 = load i32, i32* %6
%162 = getelementptr inbounds [160 x i8], [160 x i8]* %17, i64 0, i64 0
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.14, i64 0, i64 0), i32 %161, i8* %162)
br label %206
164: ; preds = %154
br label %165
165: ; preds = %164, %145
%166 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%167 = call i32* @fopen(i8* %166, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %167, i32** %12
%168 = icmp eq i32* %167, null
br i1 %168, label %169, label %172
169: ; preds = %165
%170 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %170)
store i32 2, i32* %3
br label %389
172: ; preds = %165
%173 = load i32*, i32** %12
%174 = getelementptr inbounds [132 x i8], [132 x i8]* %21, i64 0, i64 0
%175 = getelementptr inbounds [160 x i8], [160 x i8]* %17, i64 0, i64 0
%176 = load i32, i32* %6
%177 = getelementptr inbounds [160 x i8], [160 x i8]* %17, i64 0, i64 0
%178 = call i64 (i32*, i8*, ...) @fprintf(i32* %173, i8* %174, i8* %175, i32 %176, i32 132, i8* %177)
%179 = load i64, i64* @EOF
%180 = icmp eq i64 %178, %179
br i1 %180, label %181, label %184
181: ; preds = %172
%182 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%183 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* %182)
store i32 2, i32* %3
br label %389
184: ; preds = %172
%185 = load i32*, i32** %12
%186 = call i64 @fclose(i32* %185)
%187 = icmp ne i64 %186, 0
br i1 %187, label %188, label %191
188: ; preds = %184
%189 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%190 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0), i8* %189)
br label %191
191: ; preds = %188, %184
%192 = getelementptr inbounds [160 x i8], [160 x i8]* %17, i64 0, i64 0
%193 = getelementptr inbounds [160 x i8], [160 x i8]* %19, i64 0, i64 0
%194 = call i64 @strcmp(i8* %192, i8* %193)
%195 = icmp ne i64 %194, 0
br i1 %195, label %196, label %201
196: ; preds = %191
%197 = load i32, i32* %6
%198 = getelementptr inbounds [160 x i8], [160 x i8]* %17, i64 0, i64 0
%199 = getelementptr inbounds [160 x i8], [160 x i8]* %19, i64 0, i64 0
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.16, i64 0, i64 0), i32 %197, i8* %198, i8* %199)
br label %205
201: ; preds = %191
%202 = load i32, i32* %6
%203 = getelementptr inbounds [160 x i8], [160 x i8]* %17, i64 0, i64 0
%204 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0), i32 %202, i8* %203)
br label %205
205: ; preds = %201, %196
br label %206
206: ; preds = %205, %158
%207 = load i32, i32* %6
%208 = add nsw i32 %207, 1
store i32 %208, i32* %6
br label %98
209: ; preds = %103
%210 = load i32*, i32** %10
%211 = call i64 @fclose(i32* %210)
%212 = icmp ne i64 %211, 0
br i1 %212, label %213, label %216
213: ; preds = %209
%214 = getelementptr inbounds [12 x i8], [12 x i8]* %14, i64 0, i64 0
%215 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0), i8* %214)
br label %216
216: ; preds = %213, %209
%217 = load i32*, i32** %11
%218 = call i64 @fclose(i32* %217)
%219 = icmp ne i64 %218, 0
br i1 %219, label %220, label %223
220: ; preds = %216
%221 = getelementptr inbounds [12 x i8], [12 x i8]* %15, i64 0, i64 0
%222 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0), i8* %221)
br label %223
223: ; preds = %220, %216
%224 = load i32*, i32** %13
%225 = call i64 @fclose(i32* %224)
%226 = icmp ne i64 %225, 0
br i1 %226, label %227, label %230
227: ; preds = %223
%228 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%229 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0), i8* %228)
br label %230
230: ; preds = %227, %223
%231 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i64 0, i64 0))
%232 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%233 = load i8**, i8*** %5
%234 = getelementptr inbounds i8*, i8** %233, i64 1
%235 = load i8*, i8** %234
%236 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %232, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.19, i64 0, i64 0), i8* %235)
%237 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%238 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0), i8* %237)
%239 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%240 = call i32* @fopen(i8* %239, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %240, i32** %13
%241 = icmp eq i32* %240, null
br i1 %241, label %242, label %245
242: ; preds = %230
%243 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%244 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %243)
store i32 2, i32* %3
br label %389
245: ; preds = %230
store i32 0, i32* %7
br label %246
246: ; preds = %293, %245
%247 = load i32, i32* %7
%248 = load i32, i32* %6
%249 = icmp slt i32 %247, %248
br i1 %249, label %250, label %294
250: ; preds = %246
store i32 1, i32* %8
br label %251
251: ; preds = %268, %250
%252 = load i32, i32* %8
%253 = icmp sle i32 %252, 15
br i1 %253, label %254, label %271
254: ; preds = %251
%255 = load i32*, i32** %13
%256 = load i32, i32* %7
%257 = add nsw i32 %256, 1
store i32 %257, i32* %7
%258 = call i64 (i32*, i8*, ...) @fprintf(i32* %255, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0), i32 %256)
%259 = load i64, i64* @EOF
%260 = icmp eq i64 %258, %259
br i1 %260, label %261, label %262
261: ; preds = %254
br label %289
262: ; preds = %254
%263 = load i32, i32* %6
%264 = load i32, i32* %7
%265 = icmp eq i32 %263, %264
br i1 %265, label %266, label %267
266: ; preds = %262
br label %271
267: ; preds = %262
br label %268
268: ; preds = %267
%269 = load i32, i32* %8
%270 = add nsw i32 %269, 1
store i32 %270, i32* %8
br label %251
271: ; preds = %266, %251
%272 = load i32, i32* %6
%273 = load i32, i32* %7
%274 = icmp eq i32 %272, %273
br i1 %274, label %275, label %283
275: ; preds = %271
%276 = load i32*, i32** %13
%277 = call i64 (i32*, i8*, ...) @fprintf(i32* %276, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i64 0, i64 0))
%278 = load i64, i64* @EOF
%279 = icmp eq i64 %277, %278
br i1 %279, label %280, label %281
280: ; preds = %275
br label %289
281: ; preds = %275
br label %282
282: ; preds = %281
br label %293
283: ; preds = %271
%284 = load i32*, i32** %13
%285 = call i64 (i32*, i8*, ...) @fprintf(i32* %284, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.23, i64 0, i64 0))
%286 = load i64, i64* @EOF
%287 = icmp eq i64 %285, %286
br i1 %287, label %288, label %292
288: ; preds = %283
br label %289
289: ; preds = %288, %280, %261
%290 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%291 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* %290)
store i32 2, i32* %3
br label %389
292: ; preds = %283
br label %293
293: ; preds = %292, %282
br label %246
294: ; preds = %246
%295 = load i32*, i32** %13
%296 = call i64 @fclose(i32* %295)
%297 = icmp ne i64 %296, 0
br i1 %297, label %298, label %301
298: ; preds = %294
%299 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%300 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0), i8* %299)
br label %301
301: ; preds = %298, %294
%302 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%303 = load i8**, i8*** %5
%304 = getelementptr inbounds i8*, i8** %303, i64 1
%305 = load i8*, i8** %304
%306 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %302, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.24, i64 0, i64 0), i8* %305)
%307 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%308 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0), i8* %307)
%309 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%310 = call i32* @fopen(i8* %309, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %310, i32** %13
%311 = icmp eq i32* %310, null
br i1 %311, label %312, label %315
312: ; preds = %301
%313 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%314 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %313)
store i32 2, i32* %3
br label %389
315: ; preds = %301
%316 = load i32*, i32** %13
%317 = getelementptr inbounds [68 x i8], [68 x i8]* %22, i64 0, i64 0
%318 = call i64 (i32*, i8*, ...) @fprintf(i32* %316, i8* %317, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.25, i64 0, i64 0))
%319 = load i64, i64* @EOF
%320 = icmp eq i64 %318, %319
br i1 %320, label %321, label %322
321: ; preds = %315
br label %372
322: ; preds = %315
%323 = load i32*, i32** %13
%324 = call i64 (i32*, i8*, ...) @fprintf(i32* %323, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.26, i64 0, i64 0))
%325 = load i64, i64* @EOF
%326 = icmp eq i64 %324, %325
br i1 %326, label %327, label %328
327: ; preds = %322
br label %372
328: ; preds = %322
store i32 0, i32* %7
br label %329
329: ; preds = %376, %328
%330 = load i32, i32* %7
%331 = load i32, i32* %6
%332 = icmp slt i32 %330, %331
br i1 %332, label %333, label %377
333: ; preds = %329
store i32 1, i32* %8
br label %334
334: ; preds = %351, %333
%335 = load i32, i32* %8
%336 = icmp sle i32 %335, 9
br i1 %336, label %337, label %354
337: ; preds = %334
%338 = load i32*, i32** %13
%339 = load i32, i32* %7
%340 = add nsw i32 %339, 1
store i32 %340, i32* %7
%341 = call i64 (i32*, i8*, ...) @fprintf(i32* %338, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.27, i64 0, i64 0), i32 %339)
%342 = load i64, i64* @EOF
%343 = icmp eq i64 %341, %342
br i1 %343, label %344, label %345
344: ; preds = %337
br label %372
345: ; preds = %337
%346 = load i32, i32* %6
%347 = load i32, i32* %7
%348 = icmp eq i32 %346, %347
br i1 %348, label %349, label %350
349: ; preds = %345
br label %354
350: ; preds = %345
br label %351
351: ; preds = %350
%352 = load i32, i32* %8
%353 = add nsw i32 %352, 1
store i32 %353, i32* %8
br label %334
354: ; preds = %349, %334
%355 = load i32, i32* %6
%356 = load i32, i32* %7
%357 = icmp eq i32 %355, %356
br i1 %357, label %358, label %366
358: ; preds = %354
%359 = load i32*, i32** %13
%360 = call i64 (i32*, i8*, ...) @fprintf(i32* %359, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i64 0, i64 0))
%361 = load i64, i64* @EOF
%362 = icmp eq i64 %360, %361
br i1 %362, label %363, label %364
363: ; preds = %358
br label %372
364: ; preds = %358
br label %365
365: ; preds = %364
br label %376
366: ; preds = %354
%367 = load i32*, i32** %13
%368 = call i64 (i32*, i8*, ...) @fprintf(i32* %367, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.28, i64 0, i64 0))
%369 = load i64, i64* @EOF
%370 = icmp eq i64 %368, %369
br i1 %370, label %371, label %375
371: ; preds = %366
br label %372
372: ; preds = %371, %363, %344, %327, %321
%373 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%374 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* %373)
store i32 2, i32* %3
br label %389
375: ; preds = %366
br label %376
376: ; preds = %375, %365
br label %329
377: ; preds = %329
%378 = load i32*, i32** %13
%379 = call i64 @fclose(i32* %378)
%380 = icmp ne i64 %379, 0
br i1 %380, label %381, label %384
381: ; preds = %377
%382 = getelementptr inbounds [160 x i8], [160 x i8]* %20, i64 0, i64 0
%383 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0), i8* %382)
br label %384
384: ; preds = %381, %377
%385 = load i32, i32* %6
%386 = add nsw i32 %385, -1
store i32 %386, i32* %6
%387 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.29, i64 0, i64 0), i32 %386)
%388 = call i32 @exit(i32 0)
unreachable
389: ; preds = %372, %312, %289, %242, %181, %169, %142, %131, %94, %85, %77, %68, %56, %49, %29
%390 = load i32, i32* %3
ret i32 %390
}

LLVM IR (-O2):
@__const.main.Table = [12 x i8] c"syscall.tbl\00"
@__const.main.KLib = [12 x i8] c"syskern.asm\00"
@__const.main.Proc = [132 x i8] c"; Do not edit this file.\0A; This file is automatically generated\0A\0A\09model tiny\0A\09.code\0A%s:\09mov\09ax,%i\0A\09int\090%02Xh\0A\09ret\0A\09public\09%s\0A\09end\0A\00"
@__const.main.do_not_edit = [68 x i8] c"%s Do not edit this file.\0A%s This file is automatically generated\0A\0A\00"
@.str = [78 x i8] c"usage: gentbl CommandSourcePath [-n]\0A-n - no overwrite existing modules *.asm\00"
@.str.1 = [3 x i8] c"-n\00"
@.str.2 = [53 x i8] c"\0A\09GenTbl v. 0.0.0.3 24-Mar-96 Generate System Calls\0A\00"
@.str.3 = [3 x i8] c"rt\00"
@.str.4 = [15 x i8] c"Can't open %s\0A\00"
@.str.5 = [3 x i8] c"wt\00"
@.str.6 = [13 x i8] c"%s\\syscall.h\00"
@.str.7 = [2 x i8] c";\00"
@EOF = global i64 0
@.str.8 = [16 x i8] c"Can't write %s\0A\00"
@.str.9 = [19 x i8] c"INT_NO\09equ\090%02Xh\0A\00"
@.str.10 = [9 x i8] c"%s %s %s\00"
@.str.11 = [30 x i8] c"extrn\09%s:near\0Adw\09%s,_TEXT:%s\0A\00"
@.str.12 = [13 x i8] c"%s\09equ\09%03i\0A\00"
@.str.13 = [12 x i8] c"%s\\%03i.ASM\00"
@.str.14 = [49 x i8] c"System Call %03i %013s existing. Not rewrited.\0A\00"
@.str.15 = [16 x i8] c"Can't close %s\0A\00"
@.str.16 = [24 x i8] c"System Call %03i %s %s\0A\00"
@.str.17 = [21 x i8] c"System Call %03i %s\0A\00"
@.str.19 = [12 x i8] c"%s\\tlib.cmd\00"
@.str.20 = [13 x i8] c"Generate %s\0A\00"
@.str.21 = [7 x i8] c"-+%03i\00"
@.str.22 = [3 x i8] c"\0A\0A\00"
@.str.23 = [4 x i8] c" &\0A\00"
@.str.24 = [14 x i8] c"%s\\makefile.1\00"
@.str.25 = [2 x i8] c"#\00"
@.str.26 = [11 x i8] c"Members=\\\0A\00"
@.str.27 = [10 x i8] c"%03i.obj \00"
@.str.28 = [3 x i8] c"\\\0A\00"
@.str.29 = [46 x i8] c"\0AGenerate finished. Total %03i system calls\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [12 x i8]
%4 = alloca [12 x i8]
%5 = alloca [160 x i8]
%6 = alloca [160 x i8]
%7 = alloca [160 x i8]
%8 = alloca [160 x i8]
%9 = alloca [160 x i8]
%10 = alloca [132 x i8]
%11 = alloca [68 x i8]
%12 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%13 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%14 = getelementptr inbounds [160 x i8], [160 x i8]* %5, i64 0, i64 0
%15 = getelementptr inbounds [160 x i8], [160 x i8]* %6, i64 0, i64 0
%16 = getelementptr inbounds [160 x i8], [160 x i8]* %7, i64 0, i64 0
%17 = getelementptr inbounds [160 x i8], [160 x i8]* %8, i64 0, i64 0
%18 = getelementptr inbounds [160 x i8], [160 x i8]* %9, i64 0, i64 0
%19 = getelementptr inbounds [132 x i8], [132 x i8]* %10, i64 0, i64 0
%20 = getelementptr inbounds [68 x i8], [68 x i8]* %11, i64 0, i64 0
%21 = icmp slt i32 %0, 2
br i1 %21, label %22, label %24
22: ; preds = %2
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
br label %250
24: ; preds = %2
%25 = icmp eq i32 %0, 3
br i1 %25, label %26, label %31
26: ; preds = %24
%27 = getelementptr inbounds i8*, i8** %1, i64 2
%28 = load i8*, i8** %27
%29 = tail call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%30 = icmp ne i64 %29, 0
br label %31
31: ; preds = %26, %24
%32 = phi i1 [ undef, %24 ], [ %30, %26 ]
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
store i8 0, i8* %14
%34 = call i32* @fopen(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%35 = icmp eq i32* %34, null
br i1 %35, label %36, label %38
36: ; preds = %31
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %12)
br label %250
38: ; preds = %31
%39 = call i32* @fopen(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%40 = icmp eq i32* %39, null
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %13)
br label %250
43: ; preds = %38
%44 = getelementptr inbounds i8*, i8** %1, i64 1
%45 = load i8*, i8** %44
%46 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %18, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %45)
%47 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%48 = icmp eq i32* %47, null
br i1 %48, label %49, label %51
49: ; preds = %43
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %18)
br label %250
51: ; preds = %43
%52 = call i64 (i32*, i8*, ...) @fprintf(i32* %47, i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%53 = load i64, i64* @EOF
%54 = icmp eq i64 %52, %53
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* %18)
br label %250
57: ; preds = %51
%58 = tail call i64 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 132)
%59 = load i64, i64* @EOF
%60 = icmp eq i64 %58, %59
br i1 %60, label %61, label %63
61: ; preds = %57
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* %18)
br label %250
63: ; preds = %57
%64 = call i64 (i32*, i8*, ...) @fprintf(i32* %39, i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%65 = load i64, i64* @EOF
%66 = icmp eq i64 %64, %65
br i1 %66, label %72, label %67
67: ; preds = %63
%68 = call i32* @fgets(i8* %14, i32 160, i32* %34)
%69 = icmp eq i32* %68, null
br i1 %69, label %136, label %70
70: ; preds = %67
%71 = getelementptr inbounds [160 x i8], [160 x i8]* %6, i64 0, i64 1
br label %134
72: ; preds = %63
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* %13)
br label %250
74: ; preds = %134, %77
%75 = load i8, i8* %14
%76 = sext i8 %75 to i32
switch i32 %76, label %80 [
i32 10, label %77
i32 32, label %77
i32 59, label %77
i32 0, label %77
]
77: ; preds = %74, %74, %74, %74
%78 = call i32* @fgets(i8* %14, i32 160, i32* %34)
%79 = icmp eq i32* %78, null
br i1 %79, label %136, label %74
80: ; preds = %74
store i8 0, i8* %17
%81 = call i32 @sscanf(i8* %14, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8* %15, i8* %16, i8* %17)
%82 = load i8, i8* %17
%83 = icmp eq i8 %82, 0
br i1 %83, label %84, label %86
84: ; preds = %80
%85 = call i32 @strcpy(i8* %17, i8* %15)
br label %86
86: ; preds = %84, %80
%87 = call i64 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), i8* %17, i8* %16, i8* %17)
%88 = load i64, i64* @EOF
%89 = icmp eq i64 %87, %88
br i1 %89, label %90, label %92
90: ; preds = %86
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* %13)
br label %250
92: ; preds = %86
%93 = call i64 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0), i8* %71, i32 %135)
%94 = load i64, i64* @EOF
%95 = icmp eq i64 %93, %94
br i1 %95, label %96, label %98
96: ; preds = %92
%97 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* %18)
br label %250
98: ; preds = %92
%99 = load i8*, i8** %44
%100 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %18, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0), i8* %99, i32 %135)
br i1 %32, label %107, label %101
101: ; preds = %98
%102 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%103 = icmp eq i32* %102, null
br i1 %103, label %107, label %104
104: ; preds = %101
%105 = call i64 @fclose(i32* %102)
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.14, i64 0, i64 0), i32 %135, i8* %15)
br label %130
107: ; preds = %101, %98
%108 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%109 = icmp eq i32* %108, null
br i1 %109, label %110, label %112
110: ; preds = %107
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %18)
br label %250
112: ; preds = %107
%113 = call i64 (i32*, i8*, ...) @fprintf(i32* %108, i8* %19, i8* %15, i32 %135, i32 132, i8* %15)
%114 = load i64, i64* @EOF
%115 = icmp eq i64 %113, %114
br i1 %115, label %116, label %118
116: ; preds = %112
%117 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* %18)
br label %250
118: ; preds = %112
%119 = call i64 @fclose(i32* %108)
%120 = icmp eq i64 %119, 0
br i1 %120, label %123, label %121
121: ; preds = %118
%122 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0), i8* %18)
br label %123
123: ; preds = %121, %118
%124 = call i64 @strcmp(i8* %15, i8* %17)
%125 = icmp eq i64 %124, 0
br i1 %125, label %128, label %126
126: ; preds = %123
%127 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.16, i64 0, i64 0), i32 %135, i8* %15, i8* %17)
br label %130
128: ; preds = %123
%129 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0), i32 %135, i8* %15)
br label %130
130: ; preds = %126, %128, %104
%131 = add nuw nsw i32 %135, 1
%132 = call i32* @fgets(i8* %14, i32 160, i32* %34)
%133 = icmp eq i32* %132, null
br i1 %133, label %136, label %134
134: ; preds = %70, %130
%135 = phi i32 [ 0, %70 ], [ %131, %130 ]
br label %74
136: ; preds = %130, %77, %67
%137 = phi i32 [ 0, %67 ], [ %135, %77 ], [ %131, %130 ]
%138 = call i64 @fclose(i32* %34)
%139 = icmp eq i64 %138, 0
br i1 %139, label %142, label %140
140: ; preds = %136
%141 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0), i8* %12)
br label %142
142: ; preds = %140, %136
%143 = call i64 @fclose(i32* %39)
%144 = icmp eq i64 %143, 0
br i1 %144, label %147, label %145
145: ; preds = %142
%146 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0), i8* %13)
br label %147
147: ; preds = %145, %142
%148 = call i64 @fclose(i32* %47)
%149 = icmp eq i64 %148, 0
br i1 %149, label %152, label %150
150: ; preds = %147
%151 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0), i8* %18)
br label %152
152: ; preds = %150, %147
%153 = call i32 @putchar(i32 10)
%154 = load i8*, i8** %44
%155 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %18, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.19, i64 0, i64 0), i8* %154)
%156 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0), i8* %18)
%157 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%158 = icmp eq i32* %157, null
br i1 %158, label %161, label %159
159: ; preds = %152
%160 = icmp sgt i32 %137, 0
br i1 %160, label %163, label %191
161: ; preds = %152
%162 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %18)
br label %250
163: ; preds = %159, %175
%164 = phi i32 [ %176, %175 ], [ 1, %159 ]
%165 = phi i32 [ %166, %175 ], [ 0, %159 ]
%166 = add nuw nsw i32 %165, 1
%167 = call i64 (i32*, i8*, ...) @fprintf(i32* %157, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0), i32 %165)
%168 = load i64, i64* @EOF
%169 = icmp eq i64 %167, %168
br i1 %169, label %187, label %170
170: ; preds = %163
%171 = icmp ne i32 %137, %166
%172 = add nuw nsw i32 %164, 1
%173 = icmp ult i32 %164, 15
%174 = select i1 %171, i1 %173, i1 false
br i1 %174, label %175, label %177
175: ; preds = %170, %189
%176 = phi i32 [ %172, %170 ], [ 1, %189 ]
br label %163
177: ; preds = %170
%178 = icmp eq i32 %137, %166
br i1 %178, label %179, label %183
179: ; preds = %177
%180 = call i64 (i32*, i8*, ...) @fprintf(i32* %157, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i64 0, i64 0))
%181 = load i64, i64* @EOF
%182 = icmp eq i64 %180, %181
br i1 %182, label %187, label %189
183: ; preds = %177
%184 = call i64 (i32*, i8*, ...) @fprintf(i32* %157, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.23, i64 0, i64 0))
%185 = load i64, i64* @EOF
%186 = icmp eq i64 %184, %185
br i1 %186, label %187, label %189
187: ; preds = %183, %179, %163
%188 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* %18)
br label %250
189: ; preds = %183, %179
%190 = icmp slt i32 %166, %137
br i1 %190, label %175, label %191
191: ; preds = %189, %159
%192 = call i64 @fclose(i32* %157)
%193 = icmp eq i64 %192, 0
br i1 %193, label %196, label %194
194: ; preds = %191
%195 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0), i8* %18)
br label %196
196: ; preds = %194, %191
%197 = load i8*, i8** %44
%198 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %18, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.24, i64 0, i64 0), i8* %197)
%199 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0), i8* %18)
%200 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%201 = icmp eq i32* %200, null
br i1 %201, label %202, label %204
202: ; preds = %196
%203 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %18)
br label %250
204: ; preds = %196
%205 = call i64 (i32*, i8*, ...) @fprintf(i32* %200, i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.25, i64 0, i64 0))
%206 = load i64, i64* @EOF
%207 = icmp eq i64 %205, %206
br i1 %207, label %237, label %208
208: ; preds = %204
%209 = call i64 (i32*, i8*, ...) @fprintf(i32* %200, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.26, i64 0, i64 0))
%210 = load i64, i64* @EOF
%211 = icmp eq i64 %209, %210
br i1 %211, label %237, label %212
212: ; preds = %208
br i1 %160, label %213, label %241
213: ; preds = %212, %225
%214 = phi i32 [ %226, %225 ], [ 1, %212 ]
%215 = phi i32 [ %216, %225 ], [ 0, %212 ]
%216 = add nuw nsw i32 %215, 1
%217 = call i64 (i32*, i8*, ...) @fprintf(i32* %200, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.27, i64 0, i64 0), i32 %215)
%218 = load i64, i64* @EOF
%219 = icmp eq i64 %217, %218
br i1 %219, label %237, label %220
220: ; preds = %213
%221 = icmp ne i32 %137, %216
%222 = add nuw nsw i32 %214, 1
%223 = icmp ult i32 %214, 9
%224 = select i1 %221, i1 %223, i1 false
br i1 %224, label %225, label %227
225: ; preds = %220, %239
%226 = phi i32 [ %222, %220 ], [ 1, %239 ]
br label %213
227: ; preds = %220
%228 = icmp eq i32 %137, %216
br i1 %228, label %229, label %233
229: ; preds = %227
%230 = call i64 (i32*, i8*, ...) @fprintf(i32* %200, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i64 0, i64 0))
%231 = load i64, i64* @EOF
%232 = icmp eq i64 %230, %231
br i1 %232, label %237, label %239
233: ; preds = %227
%234 = call i64 (i32*, i8*, ...) @fprintf(i32* %200, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.28, i64 0, i64 0))
%235 = load i64, i64* @EOF
%236 = icmp eq i64 %234, %235
br i1 %236, label %237, label %239
237: ; preds = %233, %229, %213, %208, %204
%238 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i8* %18)
br label %250
239: ; preds = %233, %229
%240 = icmp slt i32 %216, %137
br i1 %240, label %225, label %241
241: ; preds = %239, %212
%242 = call i64 @fclose(i32* %200)
%243 = icmp eq i64 %242, 0
br i1 %243, label %246, label %244
244: ; preds = %241
%245 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0), i8* %18)
br label %246
246: ; preds = %244, %241
%247 = add nsw i32 %137, -1
%248 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.29, i64 0, i64 0), i32 %247)
%249 = call i32 @exit(i32 0)
unreachable
250: ; preds = %237, %202, %187, %161, %116, %110, %96, %90, %72, %61, %55, %49, %41, %36, %22
%251 = phi i32 [ 1, %22 ], [ 2, %36 ], [ 2, %41 ], [ 2, %49 ], [ 2, %55 ], [ 2, %61 ], [ 2, %72 ], [ 2, %161 ], [ 2, %187 ], [ 2, %202 ], [ 2, %237 ], [ 2, %90 ], [ 2, %96 ], [ 2, %110 ], [ 2, %116 ]
ret i32 %251
}