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

/* Forward declarations */

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ gclrline();
int /*<<< orphan*/ gerase(int /*<<< orphan*/);
int ggetch();
int /*<<< orphan*/ gmove(int, int);
int /*<<< orphan*/ gputch(char);
int /*<<< orphan*/ gputs(char *);
int /*<<< orphan*/ isprint(int);
int /*<<< orphan*/ isspace(int);
int /*<<< orphan*/ mainscreen();
char *nationcity(int);
char *nationname(int);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ saystat(char *);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ tolower(int);
int turn();
void mailer(int from, int to) {
  char message[17][80], heading[80], fname[16];
  int i, j, l, c, ch, save, menu, last;
  FILE *fp, *log;
  l = c = 0;
  for (i = 0; i < 17; i++)
    for (j = 0; j < 80; j++)
      message[i][j] = ' ';
  if (to > 0) {
    sprintf(heading, "From %s of %s to %s of %s  (Turn %d)", nationname(from),
            nationcity(from), nationname(to), nationcity(to), turn());
  } else {
    sprintf(heading, "From %s of %s  (Turn %d)", nationname(from),
            nationcity(from), turn());
  }
  gerase(0);
  gmove(19, 1);
  gputs("---------------------------------------");
  gputs("---------------------------------------");
  gmove(0, 1);
  gputs(heading);
  menu = 1;
  save = 0;
  do {
    if (menu) {
      gmove(20, 1);
      gputs("Mail Editor:  ");
      gputs("(ctrl-j)down  (ctrl-k)up  (ctrl-h)left  (ctrl-l)right");
      gclrline();
      gmove(21, 1);
      gputs("Press CTRL-A for Menu");
      gclrline();
      menu = 0;
    }
    gmove(l + 2, c + 1);
    ch = ggetch();
    switch (ch) {
    case (256 + 7):
      c = 0;
      break;
    case '\r':
      c = 0;
      l++;
      break;
    case '\b':
    case (char)0xff:
    case (256 + 1):
      c--;
      break;
    case '\f':
    case (256 + 2):
      c++;
      break;
    case '\013':
    case (256 + 3):
      l--;
      break;
    case '\n':
    case (256 + 4):
      l++;
      break;
    case '\033':
    case '\01':
      ch = '\033';
      gmove(20, 1);
      gputs("Mail Editor:  ");
      gputs("(s)end message  (c)ancel message  (r)eturn to message");
      gclrline();
      gmove(21, 1);
      gclrline();
      menu = 1;
      switch (tolower(ggetch())) {
      case 'c':
      case 'q':
      case '\033':
        save = 0;
        break;
      default:
      case 'r':
        ch = '\0';
        break;
      case 's':
        save = 1;
        break;
      }
      break;
    default:
      if (c > 75)
        break;
      if (isspace(ch))
        gputch(message[l][c++] = ' ');
      else if (isprint(ch))
        gputch(message[l][c++] = ch);
      break;
    }
    if (c < 0)
      c = 0;
    if (c > 75)
      c = 75;
    if (l < 0)
      l = 16;
    if (l > 16)
      l = 0;
  } while (ch != '\033');
  gerase(0);
  mainscreen();
  if (!save)
    return;
  if (to > 0)
    sprintf(fname, "mail.%03d", to);
  else
    strcpy(fname, "news");
  fp = fopen(fname, "a");
  if (fp == NULL) {
    saystat("Mail Could Not Be Sent...  Cancelled.");
    return;
  }
  log = fopen("mail.log", "a");
  fputs(" \b", fp);
  fputs(heading, fp);
  fputs("\n\n", fp);
  if (log != NULL) {
    fputs(" \b", log);
    fputs(heading, log);
    fputs("\n\n", log);
  }
  for (i = 0; i < 17; i++) {
    for (j = 78; j >= 0 && message[i][j] == ' '; j--)
      ;
    message[i][j + 1] = '\0';
  }
  last = 16;
  for (i = 16; i >= 0; i--)
    if (message[i][0] == '\0')
      last = i;
    else
      break;
  for (i = 0; i <= last; i++) {
    for (j = 0; message[i][j]; j++) {
      putc(message[i][j], fp);
      if (log != NULL)
        putc(message[i][j], log);
    }
    putc('\n', fp);
    if (log != NULL)
      putc('\n', log);
  }
  fclose(fp);
  fclose(log);
  saystat("Mail Sent.");
}


x86 assembly (clang, -O0):
<mailer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x650,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x5d0(%rbp)
movl   $0x0,-0x5cc(%rbp)
movl   $0x0,-0x5c4(%rbp)
cmpl   $0x11,-0x5c4(%rbp)
jge    12e0 <mailer+0xa0>
movl   $0x0,-0x5c8(%rbp)
cmpl   $0x50,-0x5c8(%rbp)
jge    12c7 <mailer+0x87>
movslq -0x5c4(%rbp),%rcx
lea    -0x560(%rbp),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x5c8(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x5c8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c8(%rbp)
jmp    1286 <mailer+0x46>
jmp    12cc <mailer+0x8c>
mov    -0x5c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c4(%rbp)
jmp    126f <mailer+0x2f>
cmpl   $0x0,-0x8(%rbp)
jle    1374 <mailer+0x134>
lea    -0x5b0(%rbp),%rax
mov    %rax,-0x618(%rbp)
mov    -0x4(%rbp),%edi
call   10d0 <nationname@plt>
mov    %rax,-0x610(%rbp)
mov    -0x4(%rbp),%edi
call   1120 <nationcity@plt>
mov    %rax,-0x608(%rbp)
mov    -0x8(%rbp),%edi
call   10d0 <nationname@plt>
mov    %rax,-0x600(%rbp)
mov    -0x8(%rbp),%edi
call   1120 <nationcity@plt>
mov    %rax,-0x5f8(%rbp)
mov    $0x0,%al
call   1050 <turn@plt>
mov    -0x618(%rbp),%rdi
mov    -0x610(%rbp),%rdx
mov    -0x608(%rbp),%rcx
mov    -0x600(%rbp),%r8
mov    -0x5f8(%rbp),%r9
lea    0xc9b(%rip),%rsi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1150 <sprintf@plt>
jmp    13cd <mailer+0x18d>
lea    -0x5b0(%rbp),%rax
mov    %rax,-0x630(%rbp)
mov    -0x4(%rbp),%edi
call   10d0 <nationname@plt>
mov    %rax,-0x628(%rbp)
mov    -0x4(%rbp),%edi
call   1120 <nationcity@plt>
mov    %rax,-0x620(%rbp)
mov    $0x0,%al
call   1050 <turn@plt>
mov    -0x630(%rbp),%rdi
mov    -0x628(%rbp),%rdx
mov    -0x620(%rbp),%rcx
mov    %eax,%r8d
lea    0xc5f(%rip),%rsi
mov    $0x0,%al
call   1150 <sprintf@plt>
xor    %edi,%edi
call   10a0 <gerase@plt>
mov    $0x13,%edi
mov    $0x1,%esi
call   1160 <gmove@plt>
lea    0xc54(%rip),%rdi
call   10e0 <gputs@plt>
lea    0xc48(%rip),%rdi
call   10e0 <gputs@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1160 <gmove@plt>
lea    -0x5b0(%rbp),%rdi
call   10e0 <gputs@plt>
movl   $0x1,-0x5dc(%rbp)
movl   $0x0,-0x5d8(%rbp)
cmpl   $0x0,-0x5dc(%rbp)
je     148e <mailer+0x24e>
mov    $0x14,%edi
mov    $0x1,%esi
call   1160 <gmove@plt>
lea    0xc1c(%rip),%rdi
call   10e0 <gputs@plt>
lea    0xc1f(%rip),%rdi
call   10e0 <gputs@plt>
mov    $0x0,%al
call   10f0 <gclrline@plt>
mov    $0x15,%edi
mov    $0x1,%esi
call   1160 <gmove@plt>
lea    0xc33(%rip),%rdi
call   10e0 <gputs@plt>
mov    $0x0,%al
call   10f0 <gclrline@plt>
movl   $0x0,-0x5dc(%rbp)
mov    -0x5cc(%rbp),%edi
add    $0x2,%edi
mov    -0x5d0(%rbp),%esi
add    $0x1,%esi
call   1160 <gmove@plt>
xor    %eax,%eax
call   1060 <ggetch@plt>
mov    %eax,-0x5d4(%rbp)
mov    -0x5d4(%rbp),%eax
mov    %eax,-0x634(%rbp)
sub    $0xffffffff,%eax
je     15f3 <mailer+0x3b3>
jmp    14cc <mailer+0x28c>
mov    -0x634(%rbp),%eax
sub    $0x1,%eax
je     1643 <mailer+0x403>
jmp    14e0 <mailer+0x2a0>
mov    -0x634(%rbp),%eax
sub    $0x8,%eax
je     15f3 <mailer+0x3b3>
jmp    14f4 <mailer+0x2b4>
mov    -0x634(%rbp),%eax
sub    $0xa,%eax
je     162f <mailer+0x3ef>
jmp    1508 <mailer+0x2c8>
mov    -0x634(%rbp),%eax
sub    $0xb,%eax
je     161b <mailer+0x3db>
jmp    151c <mailer+0x2dc>
mov    -0x634(%rbp),%eax
sub    $0xc,%eax
je     1607 <mailer+0x3c7>
jmp    1530 <mailer+0x2f0>
mov    -0x634(%rbp),%eax
sub    $0xd,%eax
je     15d5 <mailer+0x395>
jmp    1544 <mailer+0x304>
mov    -0x634(%rbp),%eax
sub    $0x1b,%eax
je     1643 <mailer+0x403>
jmp    1558 <mailer+0x318>
mov    -0x634(%rbp),%eax
sub    $0x101,%eax
je     15f3 <mailer+0x3b3>
jmp    156e <mailer+0x32e>
mov    -0x634(%rbp),%eax
sub    $0x102,%eax
je     1607 <mailer+0x3c7>
jmp    1584 <mailer+0x344>
mov    -0x634(%rbp),%eax
sub    $0x103,%eax
je     161b <mailer+0x3db>
jmp    159a <mailer+0x35a>
mov    -0x634(%rbp),%eax
sub    $0x104,%eax
je     162f <mailer+0x3ef>
jmp    15b0 <mailer+0x370>
mov    -0x634(%rbp),%eax
sub    $0x107,%eax
jne    1756 <mailer+0x516>
jmp    15c6 <mailer+0x386>
movl   $0x0,-0x5d0(%rbp)
jmp    1810 <mailer+0x5d0>
movl   $0x0,-0x5d0(%rbp)
mov    -0x5cc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5cc(%rbp)
jmp    1810 <mailer+0x5d0>
mov    -0x5d0(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x5d0(%rbp)
jmp    1810 <mailer+0x5d0>
mov    -0x5d0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5d0(%rbp)
jmp    1810 <mailer+0x5d0>
mov    -0x5cc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x5cc(%rbp)
jmp    1810 <mailer+0x5d0>
mov    -0x5cc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5cc(%rbp)
jmp    1810 <mailer+0x5d0>
movl   $0x1b,-0x5d4(%rbp)
mov    $0x14,%edi
mov    $0x1,%esi
mov    %esi,-0x640(%rbp)
call   1160 <gmove@plt>
lea    0x9fd(%rip),%rdi
call   10e0 <gputs@plt>
lea    0xa4c(%rip),%rdi
call   10e0 <gputs@plt>
xor    %eax,%eax
mov    %al,-0x639(%rbp)
call   10f0 <gclrline@plt>
mov    -0x640(%rbp),%esi
mov    $0x15,%edi
call   1160 <gmove@plt>
mov    -0x639(%rbp),%al
call   10f0 <gclrline@plt>
mov    -0x639(%rbp),%al
movl   $0x1,-0x5dc(%rbp)
call   1060 <ggetch@plt>
mov    %eax,%edi
call   1100 <tolower@plt>
mov    %eax,%ecx
mov    %ecx,-0x638(%rbp)
sub    $0x1b,%eax
je     1724 <mailer+0x4e4>
jmp    16d4 <mailer+0x494>
mov    -0x638(%rbp),%eax
sub    $0x63,%eax
je     1724 <mailer+0x4e4>
jmp    16e8 <mailer+0x4a8>
mov    -0x638(%rbp),%eax
sub    $0x71,%eax
je     1724 <mailer+0x4e4>
jmp    16fc <mailer+0x4bc>
mov    -0x638(%rbp),%eax
sub    $0x72,%eax
je     1738 <mailer+0x4f8>
jmp    1710 <mailer+0x4d0>
mov    -0x638(%rbp),%eax
sub    $0x73,%eax
je     1747 <mailer+0x507>
jmp    1733 <mailer+0x4f3>
movl   $0x0,-0x5d8(%rbp)
jmp    1751 <mailer+0x511>
jmp    1738 <mailer+0x4f8>
movl   $0x0,-0x5d4(%rbp)
jmp    1751 <mailer+0x511>
movl   $0x1,-0x5d8(%rbp)
jmp    1810 <mailer+0x5d0>
cmpl   $0x4b,-0x5d0(%rbp)
jle    1768 <mailer+0x528>
jmp    1810 <mailer+0x5d0>
mov    -0x5d4(%rbp),%edi
call   1090 <isspace@plt>
cmp    $0x0,%eax
je     17b8 <mailer+0x578>
movslq -0x5cc(%rbp),%rcx
lea    -0x560(%rbp),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
mov    -0x5d0(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x5d0(%rbp)
movslq %ecx,%rcx
movb   $0x20,(%rax,%rcx,1)
mov    $0x20,%edi
call   10b0 <gputch@plt>
jmp    180b <mailer+0x5cb>
mov    -0x5d4(%rbp),%edi
call   1110 <isprint@plt>
cmp    $0x0,%eax
je     1806 <mailer+0x5c6>
mov    -0x5d4(%rbp),%eax
movslq -0x5cc(%rbp),%rdx
lea    -0x560(%rbp),%rcx
imul   $0x50,%rdx,%rdx
add    %rdx,%rcx
mov    -0x5d0(%rbp),%edx
mov    %edx,%esi
add    $0x1,%esi
mov    %esi,-0x5d0(%rbp)
movslq %edx,%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%edi
call   10b0 <gputch@plt>
jmp    180b <mailer+0x5cb>
jmp    1810 <mailer+0x5d0>
cmpl   $0x0,-0x5d0(%rbp)
jge    1827 <mailer+0x5e7>
movl   $0x0,-0x5d0(%rbp)
cmpl   $0x4b,-0x5d0(%rbp)
jle    183e <mailer+0x5fe>
movl   $0x4b,-0x5d0(%rbp)
cmpl   $0x0,-0x5cc(%rbp)
jge    1855 <mailer+0x615>
movl   $0x10,-0x5cc(%rbp)
cmpl   $0x10,-0x5cc(%rbp)
jle    186c <mailer+0x62c>
movl   $0x0,-0x5cc(%rbp)
jmp    1871 <mailer+0x631>
cmpl   $0x1b,-0x5d4(%rbp)
jne    1427 <mailer+0x1e7>
xor    %edi,%edi
call   10a0 <gerase@plt>
mov    $0x0,%al
call   1080 <mainscreen@plt>
cmpl   $0x0,-0x5d8(%rbp)
jne    189e <mailer+0x65e>
jmp    1c1f <mailer+0x9df>
cmpl   $0x0,-0x8(%rbp)
jle    18c5 <mailer+0x685>
lea    -0x5c0(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0x83e(%rip),%rsi
mov    $0x0,%al
call   1150 <sprintf@plt>
jmp    18d8 <mailer+0x698>
lea    -0x5c0(%rbp),%rdi
lea    0x82e(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x5c0(%rbp),%rdi
lea    0x820(%rip),%rsi
call   1130 <fopen@plt>
mov    %rax,-0x5e8(%rbp)
cmpq   $0x0,-0x5e8(%rbp)
jne    1911 <mailer+0x6d1>
lea    0x801(%rip),%rdi
call   1140 <saystat@plt>
jmp    1c1f <mailer+0x9df>
lea    0x816(%rip),%rdi
lea    0x7e7(%rip),%rsi
call   1130 <fopen@plt>
mov    %rax,-0x5f0(%rbp)
mov    -0x5e8(%rbp),%rsi
lea    0x7fe(%rip),%rdi
call   1070 <fputs@plt>
lea    -0x5b0(%rbp),%rdi
mov    -0x5e8(%rbp),%rsi
call   1070 <fputs@plt>
mov    -0x5e8(%rbp),%rsi
lea    0x7db(%rip),%rdi
call   1070 <fputs@plt>
cmpq   $0x0,-0x5f0(%rbp)
je     19ab <mailer+0x76b>
mov    -0x5f0(%rbp),%rsi
lea    0x7b7(%rip),%rdi
call   1070 <fputs@plt>
lea    -0x5b0(%rbp),%rdi
mov    -0x5f0(%rbp),%rsi
call   1070 <fputs@plt>
mov    -0x5f0(%rbp),%rsi
lea    0x794(%rip),%rdi
call   1070 <fputs@plt>
movl   $0x0,-0x5c4(%rbp)
cmpl   $0x11,-0x5c4(%rbp)
jge    1a72 <mailer+0x832>
movl   $0x4e,-0x5c8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x5c8(%rbp)
mov    %al,-0x641(%rbp)
jl     1a0d <mailer+0x7cd>
movslq -0x5c4(%rbp),%rcx
lea    -0x560(%rbp),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x5c8(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x641(%rbp)
mov    -0x641(%rbp),%al
test   $0x1,%al
jne    1a20 <mailer+0x7e0>
jmp    1a39 <mailer+0x7f9>
jmp    1a25 <mailer+0x7e5>
mov    -0x5c8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x5c8(%rbp)
jmp    19cc <mailer+0x78c>
movslq -0x5c4(%rbp),%rcx
lea    -0x560(%rbp),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
mov    -0x5c8(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x5c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c4(%rbp)
jmp    19b5 <mailer+0x775>
movl   $0x10,-0x5e0(%rbp)
movl   $0x10,-0x5c4(%rbp)
cmpl   $0x0,-0x5c4(%rbp)
jl     1ae3 <mailer+0x8a3>
movslq -0x5c4(%rbp),%rcx
lea    -0x560(%rbp),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1ac5 <mailer+0x885>
mov    -0x5c4(%rbp),%eax
mov    %eax,-0x5e0(%rbp)
jmp    1aca <mailer+0x88a>
jmp    1ae3 <mailer+0x8a3>
jmp    1acf <mailer+0x88f>
mov    -0x5c4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x5c4(%rbp)
jmp    1a86 <mailer+0x846>
movl   $0x0,-0x5c4(%rbp)
mov    -0x5c4(%rbp),%eax
cmp    -0x5e0(%rbp),%eax
jg     1bfb <mailer+0x9bb>
movl   $0x0,-0x5c8(%rbp)
movslq -0x5c4(%rbp),%rcx
lea    -0x560(%rbp),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x5c8(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1bb2 <mailer+0x972>
movslq -0x5c4(%rbp),%rcx
lea    -0x560(%rbp),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x5c8(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x5e8(%rbp),%rsi
movsbl %al,%edi
call   10c0 <putc@plt>
cmpq   $0x0,-0x5f0(%rbp)
je     1b99 <mailer+0x959>
movslq -0x5c4(%rbp),%rcx
lea    -0x560(%rbp),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x5c8(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x5f0(%rbp),%rsi
movsbl %al,%edi
call   10c0 <putc@plt>
jmp    1b9e <mailer+0x95e>
mov    -0x5c8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c8(%rbp)
jmp    1b09 <mailer+0x8c9>
mov    -0x5e8(%rbp),%rsi
mov    $0xa,%edi
call   10c0 <putc@plt>
cmpq   $0x0,-0x5f0(%rbp)
je     1be2 <mailer+0x9a2>
mov    -0x5f0(%rbp),%rsi
mov    $0xa,%edi
call   10c0 <putc@plt>
jmp    1be7 <mailer+0x9a7>
mov    -0x5c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c4(%rbp)
jmp    1aed <mailer+0x8ad>
mov    -0x5e8(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x5f0(%rbp),%rdi
call   1040 <fclose@plt>
lea    0x523(%rip),%rdi
call   1140 <saystat@plt>
add    $0x650,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mailer>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x5d8,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x80(%rsp),%r15
mov    $0x550,%edx
mov    %r15,%rdi
mov    $0x20,%esi
call   1090 <memset@plt>
mov    %ebp,%edi
call   10e0 <nationname@plt>
mov    %rax,%r12
mov    %ebp,%edi
call   1130 <nationcity@plt>
mov    %rax,%rbp
test   %ebx,%ebx
mov    %ebx,0x1c(%rsp)
jle    12ea <mailer+0x8a>
mov    %ebx,%edi
call   10e0 <nationname@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1130 <nationcity@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <turn@plt>
mov    %eax,(%rsp)
lea    0xdc0(%rip),%rsi
lea    0x30(%rsp),%rdi
mov    %r12,%rdx
mov    %rbp,%rcx
mov    %r14,%r8
mov    %rbx,%r9
xor    %eax,%eax
call   1160 <sprintf@plt>
jmp    130d <mailer+0xad>
xor    %eax,%eax
call   1050 <turn@plt>
lea    0xdbd(%rip),%rsi
lea    0x30(%rsp),%rdi
mov    %r12,%rdx
mov    %rbp,%rcx
mov    %eax,%r8d
xor    %eax,%eax
call   1160 <sprintf@plt>
xor    %edi,%edi
call   10b0 <gerase@plt>
mov    $0x1,%ebp
mov    $0x13,%edi
mov    $0x1,%esi
call   1170 <gmove@plt>
lea    0xd9f(%rip),%rbx
mov    %rbx,%rdi
call   10f0 <gputs@plt>
mov    %rbx,%rdi
call   10f0 <gputs@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1170 <gmove@plt>
lea    0x30(%rsp),%rdi
call   10f0 <gputs@plt>
xor    %r12d,%r12d
xor    %r13d,%r13d
movl   $0x0,0x18(%rsp)
jmp    139b <mailer+0x13b>
add    $0x1,%r12d
mov    $0xd,%ebx
xor    %eax,%eax
mov    %eax,%ebp
mov    0x10(%rsp),%eax
mov    %eax,%r13d
test   %r12d,%r12d
mov    $0x10,%eax
cmovs  %eax,%r12d
cmp    $0x11,%r12d
mov    $0x0,%eax
cmovae %eax,%r12d
cmp    $0x1b,%ebx
je     1576 <mailer+0x316>
test   %ebp,%ebp
je     13ef <mailer+0x18f>
mov    $0x14,%edi
mov    $0x1,%esi
call   1170 <gmove@plt>
lea    0xd41(%rip),%rdi
call   10f0 <gputs@plt>
lea    0xd44(%rip),%rdi
call   10f0 <gputs@plt>
xor    %eax,%eax
call   1100 <gclrline@plt>
mov    $0x15,%edi
mov    $0x1,%esi
call   1170 <gmove@plt>
lea    0xd58(%rip),%rdi
call   10f0 <gputs@plt>
xor    %eax,%eax
call   1100 <gclrline@plt>
lea    0x2(%r12),%edi
lea    0x1(%r13),%r14d
mov    %r14d,%esi
call   1170 <gmove@plt>
movl   $0x0,0x10(%rsp)
xor    %eax,%eax
call   1060 <ggetch@plt>
mov    %eax,%ebx
lea    0x1(%rbx),%eax
cmp    $0x1c,%eax
ja     14b0 <mailer+0x250>
lea    0xbdc(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
xor    %ebp,%ebp
jmp    *%rax
mov    $0x1,%ebp
mov    $0x14,%edi
mov    $0x1,%esi
call   1170 <gmove@plt>
lea    0xcac(%rip),%rdi
call   10f0 <gputs@plt>
lea    0xcfb(%rip),%rdi
call   10f0 <gputs@plt>
xor    %eax,%eax
call   1100 <gclrline@plt>
mov    $0x15,%edi
mov    $0x1,%esi
call   1170 <gmove@plt>
xor    %eax,%eax
call   1100 <gclrline@plt>
xor    %eax,%eax
call   1060 <ggetch@plt>
mov    %eax,%edi
call   1110 <tolower@plt>
mov    $0x1b,%ebx
cmp    $0x70,%eax
jg     150c <mailer+0x2ac>
cmp    $0x1b,%eax
je     1525 <mailer+0x2c5>
cmp    $0x63,%eax
je     1525 <mailer+0x2c5>
jmp    156f <mailer+0x30f>
nopw   0x0(%rax,%rax,1)
mov    %ebx,%eax
add    $0xfffffeff,%eax
cmp    $0x6,%eax
ja     152f <mailer+0x2cf>
lea    0xbb1(%rip),%rdx
movslq (%rdx,%rax,4),%rcx
add    %rdx,%rcx
xor    %ebp,%ebp
xor    %eax,%eax
jmp    *%rcx
add    $0xffffffff,%r13d
jmp    14e0 <mailer+0x280>
add    $0xffffffff,%r12d
jmp    14e0 <mailer+0x280>
add    $0x1,%r12d
xor    %ebp,%ebp
mov    %r13d,%r14d
mov    %ebp,%eax
test   %r13d,%r13d
jle    1370 <mailer+0x110>
mov    $0x4b,%r13d
mov    %r14d,0x10(%rsp)
mov    %ebp,%eax
cmp    $0x4a,%r14d
jbe    1370 <mailer+0x110>
jmp    1379 <mailer+0x119>
cmp    $0x71,%eax
je     1525 <mailer+0x2c5>
cmp    $0x73,%eax
jne    156f <mailer+0x30f>
movl   $0x1,0x18(%rsp)
mov    $0x1,%ebp
jmp    14e2 <mailer+0x282>
movl   $0x0,0x18(%rsp)
jmp    14e2 <mailer+0x282>
mov    %ebx,%edi
call   10a0 <isspace@plt>
mov    $0x20,%cl
test   %eax,%eax
jne    1549 <mailer+0x2e9>
mov    %ebx,%edi
call   1120 <isprint@plt>
test   %eax,%eax
je     14e0 <mailer+0x280>
mov    %ebx,%ecx
movslq %r12d,%rax
mov    %r13d,%edx
lea    (%rax,%rax,4),%rax
shl    $0x4,%rax
add    %rsp,%rax
add    $0x80,%rax
mov    %cl,(%rdx,%rax,1)
movsbl %cl,%edi
call   10c0 <gputch@plt>
xor    %ebp,%ebp
jmp    14f0 <mailer+0x290>
xor    %ebx,%ebx
jmp    14e2 <mailer+0x282>
xor    %edi,%edi
call   10b0 <gerase@plt>
xor    %eax,%eax
call   1080 <mainscreen@plt>
cmpl   $0x0,0x18(%rsp)
je     1949 <mailer+0x6e9>
mov    0x1c(%rsp),%edx
test   %edx,%edx
jle    15ac <mailer+0x34c>
lea    0xbe9(%rip),%rsi
lea    0x20(%rsp),%rdi
xor    %eax,%eax
call   1160 <sprintf@plt>
jmp    15bd <mailer+0x35d>
lea    0xbde(%rip),%rsi
lea    0x20(%rsp),%rdi
call   1030 <strcpy@plt>
lea    0xbd2(%rip),%rsi
lea    0x20(%rsp),%rdi
call   1140 <fopen@plt>
test   %rax,%rax
je     193d <mailer+0x6dd>
mov    %rax,%r14
lea    0xbdd(%rip),%rdi
lea    0xbae(%rip),%rsi
call   1140 <fopen@plt>
mov    %rax,%rbx
lea    0xbd0(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1180 <fwrite@plt>
lea    0x30(%rsp),%rdi
mov    %r14,%rsi
call   1070 <fputs@plt>
lea    0xbad(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1180 <fwrite@plt>
test   %rbx,%rbx
je     1673 <mailer+0x413>
lea    0xb8c(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1180 <fwrite@plt>
lea    0x30(%rsp),%rdi
mov    %rbx,%rsi
call   1070 <fputs@plt>
lea    0xb69(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1180 <fwrite@plt>
xor    %eax,%eax
jmp    16a8 <mailer+0x448>
add    $0xffffffff,%ecx
nopw   0x0(%rax,%rax,1)
movslq %ecx,%rcx
lea    (%rax,%rax,4),%rdx
shl    $0x4,%rdx
add    %rsp,%rdx
add    $0x80,%rdx
movb   $0x0,0x1(%rcx,%rdx,1)
add    $0x1,%rax
add    $0x50,%r15
cmp    $0x11,%rax
je     1719 <mailer+0x4b9>
mov    $0x4d,%ecx
cmpb   $0x20,0x1(%r15,%rcx,1)
jne    16ff <mailer+0x49f>
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x20,(%r15,%rcx,1)
jne    1680 <mailer+0x420>
lea    -0x1(%rcx),%esi
lea    (%rax,%rax,4),%rdx
shl    $0x4,%rdx
add    %rsp,%rdx
add    $0x80,%rdx
cmpb   $0x20,(%rsi,%rdx,1)
jne    1677 <mailer+0x417>
cmp    $0x1,%ecx
je     1707 <mailer+0x4a7>
lea    -0x2(%rcx),%rsi
mov    %esi,%esi
cmpb   $0x20,(%rsi,%rdx,1)
jne    1711 <mailer+0x4b1>
add    $0xfffffffffffffffc,%rcx
cmpb   $0x20,0x1(%r15,%rcx,1)
je     16c0 <mailer+0x460>
add    $0x1,%ecx
jmp    1680 <mailer+0x420>
mov    $0xffffffff,%ecx
jmp    1680 <mailer+0x420>
add    $0xfffffffe,%ecx
jmp    1680 <mailer+0x420>
mov    0x580(%rsp),%al
mov    $0x11,%ecx
mov    %rcx,0x10(%rsp)
or     0x530(%rsp),%al
jne    1885 <mailer+0x625>
mov    $0x10,%eax
mov    %rax,0x10(%rsp)
cmpb   $0x0,0x4e0(%rsp)
jne    1885 <mailer+0x625>
mov    $0xf,%eax
mov    %rax,0x10(%rsp)
cmpb   $0x0,0x490(%rsp)
jne    1885 <mailer+0x625>
mov    $0xe,%eax
mov    %rax,0x10(%rsp)
cmpb   $0x0,0x440(%rsp)
jne    1885 <mailer+0x625>
mov    $0xd,%eax
mov    %rax,0x10(%rsp)
cmpb   $0x0,0x3f0(%rsp)
jne    1885 <mailer+0x625>
mov    $0xc,%eax
mov    %rax,0x10(%rsp)
cmpb   $0x0,0x3a0(%rsp)
jne    1885 <mailer+0x625>
mov    $0xb,%eax
mov    %rax,0x10(%rsp)
cmpb   $0x0,0x350(%rsp)
jne    1885 <mailer+0x625>
mov    $0xa,%eax
mov    %rax,0x10(%rsp)
cmpb   $0x0,0x300(%rsp)
jne    1885 <mailer+0x625>
mov    $0x9,%eax
mov    %rax,0x10(%rsp)
cmpb   $0x0,0x2b0(%rsp)
jne    1885 <mailer+0x625>
mov    $0x8,%eax
mov    %rax,0x10(%rsp)
cmpb   $0x0,0x260(%rsp)
jne    1885 <mailer+0x625>
mov    $0x7,%eax
mov    %rax,0x10(%rsp)
cmpb   $0x0,0x210(%rsp)
jne    1885 <mailer+0x625>
mov    $0x6,%eax
mov    %rax,0x10(%rsp)
cmpb   $0x0,0x1c0(%rsp)
jne    1885 <mailer+0x625>
mov    $0x5,%eax
mov    %rax,0x10(%rsp)
cmpb   $0x0,0x170(%rsp)
jne    1885 <mailer+0x625>
mov    $0x4,%eax
mov    %rax,0x10(%rsp)
cmpb   $0x0,0x120(%rsp)
jne    1885 <mailer+0x625>
mov    $0x3,%eax
mov    %rax,0x10(%rsp)
cmpb   $0x0,0xd0(%rsp)
jne    1885 <mailer+0x625>
cmpb   $0x1,0x80(%rsp)
01
mov    $0x2,%eax
sbb    $0x0,%rax
mov    %rax,0x10(%rsp)
lea    0x81(%rsp),%r15
xor    %r13d,%r13d
jmp    18af <mailer+0x64f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%r13
add    $0x50,%r15
cmp    0x10(%rsp),%r13
je     1924 <mailer+0x6c4>
lea    0x0(,%r13,4),%rax
add    %r13,%rax
shl    $0x4,%rax
mov    0x80(%rsp,%rax,1),%al
test   %al,%al
je     1900 <mailer+0x6a0>
mov    %r15,%r12
jmp    18dd <mailer+0x67d>
xchg   %ax,%ax
movzbl (%r12),%eax
add    $0x1,%r12
test   %al,%al
je     1900 <mailer+0x6a0>
movsbl %al,%ebp
mov    %ebp,%edi
mov    %r14,%rsi
call   10d0 <putc@plt>
test   %rbx,%rbx
je     18d0 <mailer+0x670>
mov    %ebp,%edi
mov    %rbx,%rsi
call   10d0 <putc@plt>
jmp    18d0 <mailer+0x670>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
mov    %r14,%rsi
call   10d0 <putc@plt>
test   %rbx,%rbx
je     18a0 <mailer+0x640>
mov    $0xa,%edi
mov    %rbx,%rsi
call   10d0 <putc@plt>
jmp    18a0 <mailer+0x640>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0x892(%rip),%rdi
jmp    1944 <mailer+0x6e4>
lea    0x854(%rip),%rdi
call   1150 <saystat@plt>
add    $0x5d8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"From %s of %s to %s of %s (Turn %d)\00"
@.str.1 = [25 x i8] c"From %s of %s (Turn %d)\00"
@.str.2 = [40 x i8] c"---------------------------------------\00"
@.str.3 = [15 x i8] c"Mail Editor: \00"
@.str.4 = [54 x i8] c"(ctrl-j)down (ctrl-k)up (ctrl-h)left (ctrl-l)right\00"
@.str.5 = [22 x i8] c"Press CTRL-A for Menu\00"
@.str.6 = [54 x i8] c"(s)end message (c)ancel message (r)eturn to message\00"
@.str.7 = [10 x i8] c"mail.%03d\00"
@.str.8 = [5 x i8] c"news\00"
@.str.9 = [2 x i8] c"a\00"
@.str.10 = [38 x i8] c"Mail Could Not Be Sent... Cancelled.\00"
@.str.11 = [9 x i8] c"mail.log\00"
@.str.12 = [3 x i8] c" \08\00"
@.str.13 = [3 x i8] c"\0A\0A\00"
@.str.14 = [11 x i8] c"Mail Sent.\00"
define void @mailer(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [17 x [80 x i8]]
%6 = alloca [80 x i8]
%7 = alloca [16 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32*
%17 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %11
store i32 0, i32* %10
store i32 0, i32* %8
br label %18
18: ; preds = %36, %2
%19 = load i32, i32* %8
%20 = icmp slt i32 %19, 17
br i1 %20, label %21, label %39
21: ; preds = %18
store i32 0, i32* %9
br label %22
22: ; preds = %32, %21
%23 = load i32, i32* %9
%24 = icmp slt i32 %23, 80
br i1 %24, label %25, label %35
25: ; preds = %22
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %5, i64 0, i64 %27
%29 = load i32, i32* %9
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [80 x i8], [80 x i8]* %28, i64 0, i64 %30
store i8 32, i8* %31
br label %32
32: ; preds = %25
%33 = load i32, i32* %9
%34 = add nsw i32 %33, 1
store i32 %34, i32* %9
br label %22
35: ; preds = %22
br label %36
36: ; preds = %35
%37 = load i32, i32* %8
%38 = add nsw i32 %37, 1
store i32 %38, i32* %8
br label %18
39: ; preds = %18
%40 = load i32, i32* %4
%41 = icmp sgt i32 %40, 0
br i1 %41, label %42, label %54
42: ; preds = %39
%43 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%44 = load i32, i32* %3
%45 = call i8* @nationname(i32 %44)
%46 = load i32, i32* %3
%47 = call i8* @nationcity(i32 %46)
%48 = load i32, i32* %4
%49 = call i8* @nationname(i32 %48)
%50 = load i32, i32* %4
%51 = call i8* @nationcity(i32 %50)
%52 = call i32 (...) @turn()
%53 = call i32 (i8*, i8*, ...) @sprintf(i8* %43, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %45, i8* %47, i8* %49, i8* %51, i32 %52)
br label %62
54: ; preds = %39
%55 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%56 = load i32, i32* %3
%57 = call i8* @nationname(i32 %56)
%58 = load i32, i32* %3
%59 = call i8* @nationcity(i32 %58)
%60 = call i32 (...) @turn()
%61 = call i32 (i8*, i8*, ...) @sprintf(i8* %55, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %57, i8* %59, i32 %60)
br label %62
62: ; preds = %54, %42
%63 = call i32 @gerase(i32 0)
%64 = call i32 @gmove(i32 19, i32 1)
%65 = call i32 @gputs(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%66 = call i32 @gputs(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%67 = call i32 @gmove(i32 0, i32 1)
%68 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%69 = call i32 @gputs(i8* %68)
store i32 1, i32* %14
store i32 0, i32* %13
br label %70
70: ; preds = %170, %62
%71 = load i32, i32* %14
%72 = icmp ne i32 %71, 0
br i1 %72, label %73, label %81
73: ; preds = %70
%74 = call i32 @gmove(i32 20, i32 1)
%75 = call i32 @gputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%76 = call i32 @gputs(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0))
%77 = call i32 (...) @gclrline()
%78 = call i32 @gmove(i32 21, i32 1)
%79 = call i32 @gputs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%80 = call i32 (...) @gclrline()
store i32 0, i32* %14
br label %81
81: ; preds = %73, %70
%82 = load i32, i32* %10
%83 = add nsw i32 %82, 2
%84 = load i32, i32* %11
%85 = add nsw i32 %84, 1
%86 = call i32 @gmove(i32 %83, i32 %85)
%87 = call i32 (...) @ggetch()
store i32 %87, i32* %12
%88 = load i32, i32* %12
switch i32 %88, label %119 [
i32 263, label %89
i32 13, label %90
i32 8, label %93
i32 -1, label %93
i32 257, label %93
i32 12, label %96
i32 258, label %96
i32 11, label %99
i32 259, label %99
i32 10, label %102
i32 260, label %102
i32 27, label %105
i32 1, label %105
]
89: ; preds = %81
store i32 0, i32* %11
br label %153
90: ; preds = %81
store i32 0, i32* %11
%91 = load i32, i32* %10
%92 = add nsw i32 %91, 1
store i32 %92, i32* %10
br label %153
93: ; preds = %81, %81, %81
%94 = load i32, i32* %11
%95 = add nsw i32 %94, -1
store i32 %95, i32* %11
br label %153
96: ; preds = %81, %81
%97 = load i32, i32* %11
%98 = add nsw i32 %97, 1
store i32 %98, i32* %11
br label %153
99: ; preds = %81, %81
%100 = load i32, i32* %10
%101 = add nsw i32 %100, -1
store i32 %101, i32* %10
br label %153
102: ; preds = %81, %81
%103 = load i32, i32* %10
%104 = add nsw i32 %103, 1
store i32 %104, i32* %10
br label %153
105: ; preds = %81, %81
store i32 27, i32* %12
%106 = call i32 @gmove(i32 20, i32 1)
%107 = call i32 @gputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%108 = call i32 @gputs(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0))
%109 = call i32 (...) @gclrline()
%110 = call i32 @gmove(i32 21, i32 1)
%111 = call i32 (...) @gclrline()
store i32 1, i32* %14
%112 = call i32 (...) @ggetch()
%113 = call i32 @tolower(i32 %112)
switch i32 %113, label %115 [
i32 99, label %114
i32 113, label %114
i32 27, label %114
i32 114, label %116
i32 115, label %117
]
114: ; preds = %105, %105, %105
store i32 0, i32* %13
br label %118
115: ; preds = %105
br label %116
116: ; preds = %105, %115
store i32 0, i32* %12
br label %118
117: ; preds = %105
store i32 1, i32* %13
br label %118
118: ; preds = %117, %116, %114
br label %153
119: ; preds = %81
%120 = load i32, i32* %11
%121 = icmp sgt i32 %120, 75
br i1 %121, label %122, label %123
122: ; preds = %119
br label %153
123: ; preds = %119
%124 = load i32, i32* %12
%125 = call i32 @isspace(i32 %124)
%126 = icmp ne i32 %125, 0
br i1 %126, label %127, label %136
127: ; preds = %123
%128 = load i32, i32* %10
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %5, i64 0, i64 %129
%131 = load i32, i32* %11
%132 = add nsw i32 %131, 1
store i32 %132, i32* %11
%133 = sext i32 %131 to i64
%134 = getelementptr inbounds [80 x i8], [80 x i8]* %130, i64 0, i64 %133
store i8 32, i8* %134
%135 = call i32 @gputch(i8 signext 32)
br label %152
136: ; preds = %123
%137 = load i32, i32* %12
%138 = call i32 @isprint(i32 %137)
%139 = icmp ne i32 %138, 0
br i1 %139, label %140, label %151
140: ; preds = %136
%141 = load i32, i32* %12
%142 = trunc i32 %141 to i8
%143 = load i32, i32* %10
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %5, i64 0, i64 %144
%146 = load i32, i32* %11
%147 = add nsw i32 %146, 1
store i32 %147, i32* %11
%148 = sext i32 %146 to i64
%149 = getelementptr inbounds [80 x i8], [80 x i8]* %145, i64 0, i64 %148
store i8 %142, i8* %149
%150 = call i32 @gputch(i8 signext %142)
br label %151
151: ; preds = %140, %136
br label %152
152: ; preds = %151, %127
br label %153
153: ; preds = %152, %122, %118, %102, %99, %96, %93, %90, %89
%154 = load i32, i32* %11
%155 = icmp slt i32 %154, 0
br i1 %155, label %156, label %157
156: ; preds = %153
store i32 0, i32* %11
br label %157
157: ; preds = %156, %153
%158 = load i32, i32* %11
%159 = icmp sgt i32 %158, 75
br i1 %159, label %160, label %161
160: ; preds = %157
store i32 75, i32* %11
br label %161
161: ; preds = %160, %157
%162 = load i32, i32* %10
%163 = icmp slt i32 %162, 0
br i1 %163, label %164, label %165
164: ; preds = %161
store i32 16, i32* %10
br label %165
165: ; preds = %164, %161
%166 = load i32, i32* %10
%167 = icmp sgt i32 %166, 16
br i1 %167, label %168, label %169
168: ; preds = %165
store i32 0, i32* %10
br label %169
169: ; preds = %168, %165
br label %170
170: ; preds = %169
%171 = load i32, i32* %12
%172 = icmp ne i32 %171, 27
br i1 %172, label %70, label %173
173: ; preds = %170
%174 = call i32 @gerase(i32 0)
%175 = call i32 (...) @mainscreen()
%176 = load i32, i32* %13
%177 = icmp ne i32 %176, 0
br i1 %177, label %179, label %178
178: ; preds = %173
br label %328
179: ; preds = %173
%180 = load i32, i32* %4
%181 = icmp sgt i32 %180, 0
br i1 %181, label %182, label %186
182: ; preds = %179
%183 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%184 = load i32, i32* %4
%185 = call i32 (i8*, i8*, ...) @sprintf(i8* %183, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 %184)
br label %189
186: ; preds = %179
%187 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%188 = call i32 @strcpy(i8* %187, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %189
189: ; preds = %186, %182
%190 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%191 = call i32* @fopen(i8* %190, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %191, i32** %16
%192 = load i32*, i32** %16
%193 = icmp eq i32* %192, null
br i1 %193, label %194, label %196
194: ; preds = %189
%195 = call i32 @saystat(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
br label %328
196: ; preds = %189
%197 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %197, i32** %17
%198 = load i32*, i32** %16
%199 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32* %198)
%200 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%201 = load i32*, i32** %16
%202 = call i32 @fputs(i8* %200, i32* %201)
%203 = load i32*, i32** %16
%204 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i32* %203)
%205 = load i32*, i32** %17
%206 = icmp ne i32* %205, null
br i1 %206, label %207, label %215
207: ; preds = %196
%208 = load i32*, i32** %17
%209 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32* %208)
%210 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%211 = load i32*, i32** %17
%212 = call i32 @fputs(i8* %210, i32* %211)
%213 = load i32*, i32** %17
%214 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i32* %213)
br label %215
215: ; preds = %207, %196
store i32 0, i32* %8
br label %216
216: ; preds = %247, %215
%217 = load i32, i32* %8
%218 = icmp slt i32 %217, 17
br i1 %218, label %219, label %250
219: ; preds = %216
store i32 78, i32* %9
br label %220
220: ; preds = %236, %219
%221 = load i32, i32* %9
%222 = icmp sge i32 %221, 0
br i1 %222, label %223, label %233
223: ; preds = %220
%224 = load i32, i32* %8
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %5, i64 0, i64 %225
%227 = load i32, i32* %9
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds [80 x i8], [80 x i8]* %226, i64 0, i64 %228
%230 = load i8, i8* %229
%231 = sext i8 %230 to i32
%232 = icmp eq i32 %231, 32
br label %233
233: ; preds = %223, %220
%234 = phi i1 [ false, %220 ], [ %232, %223 ]
br i1 %234, label %235, label %239
235: ; preds = %233
br label %236
236: ; preds = %235
%237 = load i32, i32* %9
%238 = add nsw i32 %237, -1
store i32 %238, i32* %9
br label %220
239: ; preds = %233
%240 = load i32, i32* %8
%241 = sext i32 %240 to i64
%242 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %5, i64 0, i64 %241
%243 = load i32, i32* %9
%244 = add nsw i32 %243, 1
%245 = sext i32 %244 to i64
%246 = getelementptr inbounds [80 x i8], [80 x i8]* %242, i64 0, i64 %245
store i8 0, i8* %246
br label %247
247: ; preds = %239
%248 = load i32, i32* %8
%249 = add nsw i32 %248, 1
store i32 %249, i32* %8
br label %216
250: ; preds = %216
store i32 16, i32* %15
store i32 16, i32* %8
br label %251
251: ; preds = %266, %250
%252 = load i32, i32* %8
%253 = icmp sge i32 %252, 0
br i1 %253, label %254, label %269
254: ; preds = %251
%255 = load i32, i32* %8
%256 = sext i32 %255 to i64
%257 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %5, i64 0, i64 %256
%258 = getelementptr inbounds [80 x i8], [80 x i8]* %257, i64 0, i64 0
%259 = load i8, i8* %258
%260 = sext i8 %259 to i32
%261 = icmp eq i32 %260, 0
br i1 %261, label %262, label %264
262: ; preds = %254
%263 = load i32, i32* %8
store i32 %263, i32* %15
br label %265
264: ; preds = %254
br label %269
265: ; preds = %262
br label %266
266: ; preds = %265
%267 = load i32, i32* %8
%268 = add nsw i32 %267, -1
store i32 %268, i32* %8
br label %251
269: ; preds = %264, %251
store i32 0, i32* %8
br label %270
270: ; preds = %319, %269
%271 = load i32, i32* %8
%272 = load i32, i32* %15
%273 = icmp sle i32 %271, %272
br i1 %273, label %274, label %322
274: ; preds = %270
store i32 0, i32* %9
br label %275
275: ; preds = %307, %274
%276 = load i32, i32* %8
%277 = sext i32 %276 to i64
%278 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %5, i64 0, i64 %277
%279 = load i32, i32* %9
%280 = sext i32 %279 to i64
%281 = getelementptr inbounds [80 x i8], [80 x i8]* %278, i64 0, i64 %280
%282 = load i8, i8* %281
%283 = icmp ne i8 %282, 0
br i1 %283, label %284, label %310
284: ; preds = %275
%285 = load i32, i32* %8
%286 = sext i32 %285 to i64
%287 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %5, i64 0, i64 %286
%288 = load i32, i32* %9
%289 = sext i32 %288 to i64
%290 = getelementptr inbounds [80 x i8], [80 x i8]* %287, i64 0, i64 %289
%291 = load i8, i8* %290
%292 = load i32*, i32** %16
%293 = call i32 @putc(i8 signext %291, i32* %292)
%294 = load i32*, i32** %17
%295 = icmp ne i32* %294, null
br i1 %295, label %296, label %306
296: ; preds = %284
%297 = load i32, i32* %8
%298 = sext i32 %297 to i64
%299 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %5, i64 0, i64 %298
%300 = load i32, i32* %9
%301 = sext i32 %300 to i64
%302 = getelementptr inbounds [80 x i8], [80 x i8]* %299, i64 0, i64 %301
%303 = load i8, i8* %302
%304 = load i32*, i32** %17
%305 = call i32 @putc(i8 signext %303, i32* %304)
br label %306
306: ; preds = %296, %284
br label %307
307: ; preds = %306
%308 = load i32, i32* %9
%309 = add nsw i32 %308, 1
store i32 %309, i32* %9
br label %275
310: ; preds = %275
%311 = load i32*, i32** %16
%312 = call i32 @putc(i8 signext 10, i32* %311)
%313 = load i32*, i32** %17
%314 = icmp ne i32* %313, null
br i1 %314, label %315, label %318
315: ; preds = %310
%316 = load i32*, i32** %17
%317 = call i32 @putc(i8 signext 10, i32* %316)
br label %318
318: ; preds = %315, %310
br label %319
319: ; preds = %318
%320 = load i32, i32* %8
%321 = add nsw i32 %320, 1
store i32 %321, i32* %8
br label %270
322: ; preds = %270
%323 = load i32*, i32** %16
%324 = call i32 @fclose(i32* %323)
%325 = load i32*, i32** %17
%326 = call i32 @fclose(i32* %325)
%327 = call i32 @saystat(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0))
br label %328
328: ; preds = %322, %194, %178
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"From %s of %s to %s of %s (Turn %d)\00"
@.str.1 = [25 x i8] c"From %s of %s (Turn %d)\00"
@.str.2 = [40 x i8] c"---------------------------------------\00"
@.str.3 = [15 x i8] c"Mail Editor: \00"
@.str.4 = [54 x i8] c"(ctrl-j)down (ctrl-k)up (ctrl-h)left (ctrl-l)right\00"
@.str.5 = [22 x i8] c"Press CTRL-A for Menu\00"
@.str.6 = [54 x i8] c"(s)end message (c)ancel message (r)eturn to message\00"
@.str.7 = [10 x i8] c"mail.%03d\00"
@.str.8 = [5 x i8] c"news\00"
@.str.9 = [2 x i8] c"a\00"
@.str.10 = [38 x i8] c"Mail Could Not Be Sent... Cancelled.\00"
@.str.11 = [9 x i8] c"mail.log\00"
@.str.12 = [3 x i8] c" \08\00"
@.str.13 = [3 x i8] c"\0A\0A\00"
@.str.14 = [11 x i8] c"Mail Sent.\00"
define void @mailer(i32 %0, i32 %1) {
%3 = alloca [17 x [80 x i8]]
%4 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 0, i64 0
%5 = alloca [80 x i8]
%6 = alloca [16 x i8]
%7 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 0, i64 0
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%10 = icmp sgt i32 %1, 0
%11 = tail call i8* @nationname(i32 %0)
%12 = tail call i8* @nationcity(i32 %0)
br i1 %10, label %13, label %18
13: ; preds = %2
%14 = tail call i8* @nationname(i32 %1)
%15 = tail call i8* @nationcity(i32 %1)
%16 = tail call i32 (...) @turn()
%17 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12, i8* %14, i8* %15, i32 %16)
br label %21
18: ; preds = %2
%19 = tail call i32 (...) @turn()
%20 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %12, i32 %19)
br label %21
21: ; preds = %18, %13
%22 = tail call i32 @gerase(i32 0)
%23 = tail call i32 @gmove(i32 19, i32 1)
%24 = tail call i32 @gputs(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%25 = tail call i32 @gputs(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%26 = tail call i32 @gmove(i32 0, i32 1)
%27 = call i32 @gputs(i8* %8)
br label %28
28: ; preds = %100, %21
%29 = phi i32 [ 0, %21 ], [ %109, %100 ]
%30 = phi i32 [ 0, %21 ], [ %105, %100 ]
%31 = phi i32 [ 0, %21 ], [ %103, %100 ]
%32 = phi i32 [ 1, %21 ], [ %104, %100 ]
%33 = icmp eq i32 %32, 0
br i1 %33, label %42, label %34
34: ; preds = %28
%35 = call i32 @gmove(i32 20, i32 1)
%36 = call i32 @gputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%37 = call i32 @gputs(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0))
%38 = call i32 (...) @gclrline()
%39 = call i32 @gmove(i32 21, i32 1)
%40 = call i32 @gputs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%41 = call i32 (...) @gclrline()
br label %42
42: ; preds = %34, %28
%43 = add nsw i32 %29, 2
%44 = add nuw nsw i32 %30, 1
%45 = call i32 @gmove(i32 %43, i32 %44)
%46 = call i32 (...) @ggetch()
switch i32 %46, label %66 [
i32 263, label %94
i32 13, label %47
i32 8, label %49
i32 -1, label %49
i32 257, label %49
i32 12, label %87
i32 258, label %87
i32 11, label %51
i32 259, label %51
i32 10, label %53
i32 260, label %53
i32 27, label %55
i32 1, label %55
]
47: ; preds = %42
%48 = add nsw i32 %29, 1
br label %94
49: ; preds = %42, %42, %42
%50 = add nsw i32 %30, -1
br label %74
51: ; preds = %42, %42
%52 = add nsw i32 %29, -1
br label %74
53: ; preds = %42, %42
%54 = add nsw i32 %29, 1
br label %74
55: ; preds = %42, %42
%56 = call i32 @gmove(i32 20, i32 1)
%57 = call i32 @gputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%58 = call i32 @gputs(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0))
%59 = call i32 (...) @gclrline()
%60 = call i32 @gmove(i32 21, i32 1)
%61 = call i32 (...) @gclrline()
%62 = call i32 (...) @ggetch()
%63 = call i32 @tolower(i32 %62)
switch i32 %63, label %64 [
i32 99, label %74
i32 113, label %74
i32 27, label %74
i32 115, label %65
]
64: ; preds = %55
br label %74
65: ; preds = %55
br label %74
66: ; preds = %42
%67 = call i32 @isspace(i32 %46)
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %81
69: ; preds = %66
%70 = call i32 @isprint(i32 %46)
%71 = icmp eq i32 %70, 0
br i1 %71, label %74, label %72
72: ; preds = %69
%73 = trunc i32 %46 to i8
br label %81
74: ; preds = %55, %55, %55, %69, %64, %65, %53, %51, %49
%75 = phi i32 [ %29, %69 ], [ %29, %64 ], [ %29, %65 ], [ %54, %53 ], [ %52, %51 ], [ %29, %49 ], [ %29, %55 ], [ %29, %55 ], [ %29, %55 ]
%76 = phi i32 [ %30, %69 ], [ %30, %64 ], [ %30, %65 ], [ %30, %53 ], [ %30, %51 ], [ %50, %49 ], [ %30, %55 ], [ %30, %55 ], [ %30, %55 ]
%77 = phi i32 [ %46, %69 ], [ 0, %64 ], [ 27, %65 ], [ %46, %53 ], [ %46, %51 ], [ %46, %49 ], [ 27, %55 ], [ 27, %55 ], [ 27, %55 ]
%78 = phi i32 [ %31, %69 ], [ %31, %64 ], [ 1, %65 ], [ %31, %53 ], [ %31, %51 ], [ %31, %49 ], [ 0, %55 ], [ 0, %55 ], [ 0, %55 ]
%79 = phi i32 [ 0, %69 ], [ 1, %64 ], [ 1, %65 ], [ 0, %53 ], [ 0, %51 ], [ 0, %49 ], [ 1, %55 ], [ 1, %55 ], [ 1, %55 ]
%80 = icmp sgt i32 %76, 0
br i1 %80, label %87, label %94
81: ; preds = %66, %72
%82 = phi i8 [ %73, %72 ], [ 32, %66 ]
%83 = sext i32 %29 to i64
%84 = zext i32 %30 to i64
%85 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 %83, i64 %84
store i8 %82, i8* %85
%86 = call i32 @gputch(i8 signext %82)
br label %87
87: ; preds = %81, %42, %42, %74
%88 = phi i32 [ %79, %74 ], [ 0, %42 ], [ 0, %42 ], [ 0, %81 ]
%89 = phi i32 [ %78, %74 ], [ %31, %42 ], [ %31, %42 ], [ %31, %81 ]
%90 = phi i32 [ %77, %74 ], [ %46, %42 ], [ %46, %42 ], [ %46, %81 ]
%91 = phi i32 [ %76, %74 ], [ %44, %42 ], [ %44, %42 ], [ %44, %81 ]
%92 = phi i32 [ %75, %74 ], [ %29, %42 ], [ %29, %42 ], [ %29, %81 ]
%93 = icmp ult i32 %91, 75
br i1 %93, label %94, label %100
94: ; preds = %42, %47, %74, %87
%95 = phi i32 [ %91, %87 ], [ 0, %74 ], [ 0, %47 ], [ 0, %42 ]
%96 = phi i32 [ %92, %87 ], [ %75, %74 ], [ %48, %47 ], [ %29, %42 ]
%97 = phi i32 [ %90, %87 ], [ %77, %74 ], [ 13, %47 ], [ %46, %42 ]
%98 = phi i32 [ %89, %87 ], [ %78, %74 ], [ %31, %47 ], [ %31, %42 ]
%99 = phi i32 [ %88, %87 ], [ %79, %74 ], [ 0, %47 ], [ 0, %42 ]
br label %100
100: ; preds = %87, %94
%101 = phi i32 [ %96, %94 ], [ %92, %87 ]
%102 = phi i32 [ %97, %94 ], [ %90, %87 ]
%103 = phi i32 [ %98, %94 ], [ %89, %87 ]
%104 = phi i32 [ %99, %94 ], [ %88, %87 ]
%105 = phi i32 [ %95, %94 ], [ 75, %87 ]
%106 = icmp slt i32 %101, 0
%107 = select i1 %106, i32 16, i32 %101
%108 = icmp ugt i32 %107, 16
%109 = select i1 %108, i32 0, i32 %107
%110 = icmp eq i32 %102, 27
br i1 %110, label %111, label %28
111: ; preds = %100
%112 = call i32 @gerase(i32 0)
%113 = call i32 (...) @mainscreen()
%114 = icmp eq i32 %103, 0
br i1 %114, label %270, label %115
115: ; preds = %111
br i1 %10, label %116, label %118
116: ; preds = %115
%117 = call i32 (i8*, i8*, ...) @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 %1)
br label %120
118: ; preds = %115
%119 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %120
120: ; preds = %118, %116
%121 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%122 = icmp eq i32* %121, null
br i1 %122, label %267, label %123
123: ; preds = %120
%124 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%125 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i64 2, i64 1, i32* %121)
%126 = call i32 @fputs(i8* %8, i32* %121)
%127 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i64 2, i64 1, i32* %121)
%128 = icmp eq i32* %124, null
br i1 %128, label %133, label %129
129: ; preds = %123
%130 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i64 2, i64 1, i32* %124)
%131 = call i32 @fputs(i8* %8, i32* %124)
%132 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i64 2, i64 1, i32* %124)
br label %133
133: ; preds = %129, %123
br label %134
134: ; preds = %133, %164
%135 = phi i64 [ %169, %164 ], [ 0, %133 ]
br label %136
136: ; preds = %162, %134
%137 = phi i32 [ 78, %134 ], [ %163, %162 ]
%138 = zext i32 %137 to i64
%139 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 %135, i64 %138
%140 = load i8, i8* %139
%141 = icmp eq i8 %140, 32
br i1 %141, label %142, label %164
142: ; preds = %136
%143 = add nsw i32 %137, -1
%144 = zext i32 %143 to i64
%145 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 %135, i64 %144
%146 = load i8, i8* %145
%147 = icmp eq i8 %146, 32
br i1 %147, label %148, label %164
148: ; preds = %142
%149 = add nsw i32 %137, -2
%150 = zext i32 %149 to i64
%151 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 %135, i64 %150
%152 = load i8, i8* %151
%153 = icmp eq i8 %152, 32
br i1 %153, label %154, label %164
154: ; preds = %148
%155 = add nsw i32 %137, -3
%156 = icmp eq i32 %149, 0
br i1 %156, label %164, label %157
157: ; preds = %154
%158 = zext i32 %155 to i64
%159 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 %135, i64 %158
%160 = load i8, i8* %159
%161 = icmp eq i8 %160, 32
br i1 %161, label %162, label %164
162: ; preds = %157
%163 = add nsw i32 %137, -4
br label %136
164: ; preds = %157, %154, %148, %142, %136
%165 = phi i32 [ %137, %136 ], [ %143, %142 ], [ %149, %148 ], [ -1, %154 ], [ %155, %157 ]
%166 = add nsw i32 %165, 1
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 %135, i64 %167
store i8 0, i8* %168
%169 = add nuw nsw i64 %135, 1
%170 = icmp eq i64 %169, 17
br i1 %170, label %171, label %134
171: ; preds = %164
%172 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 16, i64 0
%173 = load i8, i8* %172
%174 = icmp eq i8 %173, 0
%175 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 15, i64 0
%176 = load i8, i8* %175
%177 = icmp eq i8 %176, 0
%178 = select i1 %174, i1 %177, i1 false
br i1 %178, label %179, label %239
179: ; preds = %171
%180 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 14, i64 0
%181 = load i8, i8* %180
%182 = icmp eq i8 %181, 0
br i1 %182, label %183, label %239
183: ; preds = %179
%184 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 13, i64 0
%185 = load i8, i8* %184
%186 = icmp eq i8 %185, 0
br i1 %186, label %187, label %239
187: ; preds = %183
%188 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 12, i64 0
%189 = load i8, i8* %188
%190 = icmp eq i8 %189, 0
br i1 %190, label %191, label %239
191: ; preds = %187
%192 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 11, i64 0
%193 = load i8, i8* %192
%194 = icmp eq i8 %193, 0
br i1 %194, label %195, label %239
195: ; preds = %191
%196 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 10, i64 0
%197 = load i8, i8* %196
%198 = icmp eq i8 %197, 0
br i1 %198, label %199, label %239
199: ; preds = %195
%200 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 9, i64 0
%201 = load i8, i8* %200
%202 = icmp eq i8 %201, 0
br i1 %202, label %203, label %239
203: ; preds = %199
%204 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 8, i64 0
%205 = load i8, i8* %204
%206 = icmp eq i8 %205, 0
br i1 %206, label %207, label %239
207: ; preds = %203
%208 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 7, i64 0
%209 = load i8, i8* %208
%210 = icmp eq i8 %209, 0
br i1 %210, label %211, label %239
211: ; preds = %207
%212 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 6, i64 0
%213 = load i8, i8* %212
%214 = icmp eq i8 %213, 0
br i1 %214, label %215, label %239
215: ; preds = %211
%216 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 5, i64 0
%217 = load i8, i8* %216
%218 = icmp eq i8 %217, 0
br i1 %218, label %219, label %239
219: ; preds = %215
%220 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 4, i64 0
%221 = load i8, i8* %220
%222 = icmp eq i8 %221, 0
br i1 %222, label %223, label %239
223: ; preds = %219
%224 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 3, i64 0
%225 = load i8, i8* %224
%226 = icmp eq i8 %225, 0
br i1 %226, label %227, label %239
227: ; preds = %223
%228 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 2, i64 0
%229 = load i8, i8* %228
%230 = icmp eq i8 %229, 0
br i1 %230, label %231, label %239
231: ; preds = %227
%232 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 1, i64 0
%233 = load i8, i8* %232
%234 = icmp eq i8 %233, 0
br i1 %234, label %235, label %239
235: ; preds = %231
%236 = load i8, i8* %7
%237 = icmp eq i8 %236, 0
%238 = select i1 %237, i64 1, i64 2
br label %239
239: ; preds = %235, %171, %179, %183, %187, %191, %195, %199, %203, %207, %211, %215, %219, %223, %227, %231
%240 = phi i64 [ 17, %171 ], [ 16, %179 ], [ 15, %183 ], [ 14, %187 ], [ 13, %191 ], [ 12, %195 ], [ 11, %199 ], [ 10, %203 ], [ 9, %207 ], [ 8, %211 ], [ 7, %215 ], [ 6, %219 ], [ 5, %223 ], [ 4, %227 ], [ 3, %231 ], [ %238, %235 ]
br label %241
241: ; preds = %239, %261
%242 = phi i64 [ 0, %239 ], [ %262, %261 ]
%243 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 %242, i64 0
%244 = load i8, i8* %243
%245 = icmp eq i8 %244, 0
br i1 %245, label %257, label %246
246: ; preds = %241, %252
%247 = phi i64 [ %253, %252 ], [ 0, %241 ]
%248 = phi i8 [ %255, %252 ], [ %244, %241 ]
%249 = call i32 @putc(i8 signext %248, i32* %121)
br i1 %128, label %252, label %250
250: ; preds = %246
%251 = call i32 @putc(i8 signext %248, i32* %124)
br label %252
252: ; preds = %246, %250
%253 = add nuw i64 %247, 1
%254 = getelementptr inbounds [17 x [80 x i8]], [17 x [80 x i8]]* %3, i64 0, i64 %242, i64 %253
%255 = load i8, i8* %254
%256 = icmp eq i8 %255, 0
br i1 %256, label %257, label %246
257: ; preds = %252, %241
%258 = call i32 @putc(i8 signext 10, i32* %121)
br i1 %128, label %261, label %259
259: ; preds = %257
%260 = call i32 @putc(i8 signext 10, i32* %124)
br label %261
261: ; preds = %257, %259
%262 = add nuw nsw i64 %242, 1
%263 = icmp eq i64 %262, %240
br i1 %263, label %264, label %241
264: ; preds = %261
%265 = call i32 @fclose(i32* %121)
%266 = call i32 @fclose(i32* %124)
br label %267
267: ; preds = %120, %264
%268 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), %264 ], [ getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0), %120 ]
%269 = call i32 @saystat(i8* %268)
br label %270
270: ; preds = %267, %111
ret void
}