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

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
int getpop(int, char *, int);
void *malloc(int);
int /*<<< orphan*/ putcrlf(int, char *);
int /*<<< orphan*/ putpopbulk(int, char *);
char *readmessage(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int serve(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
int sscanf(char *, char *, int *);
int /*<<< orphan*/ stderr;
scalar_t__ strcasecmp(char *, char *);
scalar_t__ strcmp(char *, char *);
char *strerror(int /*<<< orphan*/);
scalar_t__ strlen(char *);
scalar_t__ strncasecmp(char *, char *, int);
scalar_t__ strrchr(char *, char);
int /*<<< orphan*/ *strstr(char *, char const *);
int main(int argc, char *argv[]) {
  FILE **mfiles;
  char line[1024];
  int rc, s, user = 0, auth = 0, i, j;
  int numfiles;
  size_t *octets;
  const char *xoauth;
  if (argc < 5) {
    fprintf(stderr,
            "Usage: %s port username "
            "password mail-file [mail-file ...]\n",
            argv[0]);
    exit(1);
  }
  if (strcmp(argv[2], "XOAUTH") == 0) {
    xoauth = argv[3];
  } else {
    xoauth = NULL;
  }
  numfiles = argc - 4;
  mfiles = malloc(sizeof(FILE *) * numfiles);
  if (!mfiles) {
    fprintf(stderr,
            "Unable to allocate %d bytes for file "
            "array\n",
            (int)(sizeof(FILE *) * numfiles));
    exit(1);
  }
  octets = malloc(sizeof(*octets) * numfiles);
  if (!octets) {
    fprintf(stderr,
            "Unable to allocate %d bytes for size "
            "array\n",
            (int)(sizeof(FILE *) * numfiles));
    exit(1);
  }
  for (i = 4, j = 0; i < argc; i++, j++) {
    if (!(mfiles[j] = fopen(argv[i], "r"))) {
      fprintf(stderr,
              "Unable to open message file \"%s\""
              ": %s\n",
              argv[i], strerror(errno));
      exit(1);
    }
    octets[j] = 0;
    while (fgets(line, sizeof(line), mfiles[j])) {
      octets[j] += strlen(line);
      if (strrchr(line, '\n'))
        octets[j]++;
    }
    rewind(mfiles[j]);
  }
  s = serve("/tmp/fakepop.pid", argv[1]);
  putcrlf(s, "+OK Not really a POP server, but we play one on TV");
  for (;;) {
    char linebuf[1024];
    rc = getpop(s, linebuf, sizeof(linebuf));
    if (rc <= 0)
      break;
    if (strcasecmp(linebuf, "CAPA") == 0) {
      putpopbulk(s, "+OK We have no capabilities, really\r\n"
                    "FAKE-CAPABILITY\r\n");
      if (xoauth != NULL) {
        putcrlf(s, "SASL XOAUTH2");
      }
      putcrlf(s, ".");
    } else if (strncasecmp(linebuf, "USER ", 5) == 0) {
      if (strcmp(linebuf + 5, argv[2]) == 0) {
        putcrlf(s, "+OK Niiiice!");
        user = 1;
      } else {
        putcrlf(s, "-ERR Don't play me, bro!");
      }
    } else if (strncasecmp(linebuf, "PASS ", 5) == 0) {
      if (!user) {
        putcrlf(s, "-ERR Aren't you forgetting "
                   "something?  Like the USER command?");
        continue;
      };
      if (strcmp(linebuf + 5, argv[3]) == 0) {
        putcrlf(s, "+OK Aren't you a sight "
                   "for sore eyes!");
        auth = 1;
      } else {
        putcrlf(s, "-ERR C'mon!");
      }
    } else if (xoauth != NULL &&
               strncasecmp(linebuf, "AUTH XOAUTH2", 12) == 0) {
      if (strstr(linebuf, xoauth) == NULL) {
        putcrlf(s, "+ base64-json-err");
        rc = getpop(s, linebuf, sizeof(linebuf));
        if (rc != 0)
          break;
        putcrlf(s, "-ERR [AUTH] Invalid credentials.");
        continue;
      }
      putcrlf(s, "+OK Welcome.");
      auth = 1;
    } else if (strcasecmp(linebuf, "STAT") == 0) {
      size_t total = 0;
      if (!auth) {
        putcrlf(s, "-ERR Um, hello?  Forget to "
                   "log in?");
        continue;
      };
      for (i = 0, j = 0; i < numfiles; i++) {
        if (mfiles[i]) {
          total += octets[i];
          j++;
        }
      }
      snprintf(linebuf, sizeof(linebuf), "+OK %d %d", i, (int)total);
      putcrlf(s, linebuf);
    } else if (strncasecmp(linebuf, "RETR ", 5) == 0) {
      if (!auth) {
        putcrlf(s, "-ERR Um, hello?  Forget to "
                   "log in?");
        continue;
      };
      rc = sscanf(linebuf + 5, "%d", &i);
      if (rc != 1) {
        putcrlf(s, "-ERR Whaaaa...?");
        continue;
      }
      if (i < 1 || i > numfiles) {
        putcrlf(s, "-ERR That message number is "
                   "out of range, jerkface!");
        continue;
      }
      if (mfiles[i - 1] == NULL) {
        putcrlf(s, "-ERR Sorry, don't have it anymore");
      } else {
        char *buf = readmessage(mfiles[i - 1]);
        putcrlf(s, "+OK Here you go ...");
        putpopbulk(s, buf);
        free(buf);
      }
    } else if (strncasecmp(linebuf, "DELE ", 5) == 0) {
      if (!auth) {
        putcrlf(s, "-ERR Um, hello?  Forget to "
                   "log in?");
        continue;
      };
      rc = sscanf(linebuf + 5, "%d", &i);
      if (rc != 1) {
        putcrlf(s, "-ERR Whaaaa...?");
        continue;
      }
      if (i < 1 || i > numfiles) {
        putcrlf(s, "-ERR That message number is "
                   "out of range, jerkface!");
        continue;
      }
      if (mfiles[i - 1] == NULL) {
        putcrlf(s, "-ERR Um, didn't you tell me "
                   "to delete it already?");
      } else {
        fclose(mfiles[i - 1]);
        mfiles[i - 1] = NULL;
        putcrlf(s, "+OK Alright man, I got rid of it");
      }
    } else if (strcasecmp(linebuf, "QUIT") == 0) {
      putcrlf(s, "+OK See ya, wouldn't want to be ya!");
      close(s);
      break;
    } else {
      putcrlf(s, "-ERR Um, what?");
    }
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x870,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x42c(%rbp)
movl   $0x0,-0x430(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    12cf <main+0x5f>
mov    0x2d32(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd42(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
mov    $0x1,%edi
call   1170 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd5e(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    1301 <main+0x91>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x450(%rbp)
jmp    130c <main+0x9c>
movq   $0x0,-0x450(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x43c(%rbp)
movslq -0x43c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1110 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1367 <main+0xf7>
mov    0x2ca0(%rip),%rax
mov    (%rax),%edi
movslq -0x43c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
lea    0xced(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
mov    $0x1,%edi
call   1170 <exit@plt>
movslq -0x43c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1110 <malloc@plt>
mov    %rax,-0x448(%rbp)
cmpq   $0x0,-0x448(%rbp)
jne    13bc <main+0x14c>
mov    0x2c4b(%rip),%rax
mov    (%rax),%edi
movslq -0x43c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
lea    0xcc4(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
mov    $0x1,%edi
call   1170 <exit@plt>
movl   $0x4,-0x434(%rbp)
movl   $0x0,-0x438(%rbp)
mov    -0x434(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1544 <main+0x2d4>
mov    -0x10(%rbp),%rax
movslq -0x434(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe18(%rip),%rsi
call   1150 <fopen@plt>
mov    -0x18(%rbp),%rcx
movslq -0x438(%rbp),%rdx
mov    %rax,(%rcx,%rdx,8)
cmp    $0x0,%rax
jne    146e <main+0x1fe>
mov    0x2bc6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x86c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x434(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x868(%rbp)
mov    0x2b99(%rip),%rax
mov    (%rax),%edi
call   1180 <strerror@plt>
mov    -0x86c(%rbp),%edi
mov    -0x868(%rbp),%rdx
mov    %rax,%rcx
lea    0xc3e(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
mov    $0x1,%edi
call   1170 <exit@plt>
mov    -0x448(%rbp),%rax
movslq -0x438(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
lea    -0x420(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x438(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    $0x400,%esi
call   10c0 <fgets@plt>
cmp    $0x0,%rax
je     150d <main+0x29d>
lea    -0x420(%rbp),%rdi
call   1070 <strlen@plt>
mov    %rax,%rdx
mov    -0x448(%rbp),%rax
movslq -0x438(%rbp),%rcx
add    (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
lea    -0x420(%rbp),%rdi
mov    $0xa,%esi
call   10a0 <strrchr@plt>
cmp    $0x0,%rax
je     1508 <main+0x298>
mov    -0x448(%rbp),%rax
movslq -0x438(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
add    $0x1,%rdx
mov    %rdx,(%rax,%rcx,8)
jmp    1484 <main+0x214>
mov    -0x18(%rbp),%rax
movslq -0x438(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1080 <rewind@plt>
mov    -0x434(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x434(%rbp)
mov    -0x438(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x438(%rbp)
jmp    13d0 <main+0x160>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xb6e(%rip),%rdi
call   10e0 <serve@plt>
mov    %eax,-0x428(%rbp)
mov    -0x428(%rbp),%edi
lea    0xb67(%rip),%rsi
call   1100 <putcrlf@plt>
mov    -0x428(%rbp),%edi
lea    -0x850(%rbp),%rsi
mov    $0x400,%edx
call   1050 <getpop@plt>
mov    %eax,-0x424(%rbp)
cmpl   $0x0,-0x424(%rbp)
jg     159f <main+0x32f>
jmp    1bf8 <main+0x988>
lea    -0x850(%rbp),%rdi
lea    0xb58(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1605 <main+0x395>
mov    -0x428(%rbp),%edi
lea    0xb41(%rip),%rsi
call   1140 <putpopbulk@plt>
cmpq   $0x0,-0x450(%rbp)
je     15ee <main+0x37e>
mov    -0x428(%rbp),%edi
lea    0xb58(%rip),%rsi
call   1100 <putcrlf@plt>
mov    -0x428(%rbp),%edi
lea    0xcf2(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    1bf3 <main+0x983>
lea    -0x850(%rbp),%rdi
lea    0xb3b(%rip),%rsi
mov    $0x5,%edx
call   1120 <strncasecmp@plt>
cmp    $0x0,%rax
jne    1681 <main+0x411>
lea    -0x850(%rbp),%rdi
add    $0x5,%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    166a <main+0x3fa>
mov    -0x428(%rbp),%edi
lea    0xafe(%rip),%rsi
call   1100 <putcrlf@plt>
movl   $0x1,-0x42c(%rbp)
jmp    167c <main+0x40c>
mov    -0x428(%rbp),%edi
lea    0xaea(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    1bee <main+0x97e>
lea    -0x850(%rbp),%rdi
lea    0xaeb(%rip),%rsi
mov    $0x5,%edx
call   1120 <strncasecmp@plt>
cmp    $0x0,%rax
jne    1721 <main+0x4b1>
cmpl   $0x0,-0x42c(%rbp)
jne    16c7 <main+0x457>
mov    -0x428(%rbp),%edi
lea    0xac3(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    1570 <main+0x300>
lea    -0x850(%rbp),%rdi
add    $0x5,%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    170a <main+0x49a>
mov    -0x428(%rbp),%edi
lea    0xac8(%rip),%rsi
call   1100 <putcrlf@plt>
movl   $0x1,-0x430(%rbp)
jmp    171c <main+0x4ac>
mov    -0x428(%rbp),%edi
lea    0xacd(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    1be9 <main+0x979>
cmpq   $0x0,-0x450(%rbp)
je     17e7 <main+0x577>
lea    -0x850(%rbp),%rdi
lea    0xab3(%rip),%rsi
mov    $0xc,%edx
call   1120 <strncasecmp@plt>
cmp    $0x0,%rax
jne    17e7 <main+0x577>
lea    -0x850(%rbp),%rdi
mov    -0x450(%rbp),%rsi
call   1190 <strstr@plt>
cmp    $0x0,%rax
jne    17c6 <main+0x556>
mov    -0x428(%rbp),%edi
lea    0xa82(%rip),%rsi
call   1100 <putcrlf@plt>
mov    -0x428(%rbp),%edi
lea    -0x850(%rbp),%rsi
mov    $0x400,%edx
call   1050 <getpop@plt>
mov    %eax,-0x424(%rbp)
cmpl   $0x0,-0x424(%rbp)
je     17af <main+0x53f>
jmp    1bf8 <main+0x988>
mov    -0x428(%rbp),%edi
lea    0xa53(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    1570 <main+0x300>
mov    -0x428(%rbp),%edi
lea    0xa5d(%rip),%rsi
call   1100 <putcrlf@plt>
movl   $0x1,-0x430(%rbp)
jmp    1be4 <main+0x974>
lea    -0x850(%rbp),%rdi
lea    0xa48(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    18f6 <main+0x686>
movq   $0x0,-0x858(%rbp)
cmpl   $0x0,-0x430(%rbp)
jne    1833 <main+0x5c3>
mov    -0x428(%rbp),%edi
lea    0xa19(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    1570 <main+0x300>
movl   $0x0,-0x434(%rbp)
movl   $0x0,-0x438(%rbp)
mov    -0x434(%rbp),%eax
cmp    -0x43c(%rbp),%eax
jge    18b7 <main+0x647>
mov    -0x18(%rbp),%rax
movslq -0x434(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     189e <main+0x62e>
mov    -0x448(%rbp),%rax
movslq -0x434(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
add    -0x858(%rbp),%rax
mov    %rax,-0x858(%rbp)
mov    -0x438(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x438(%rbp)
jmp    18a3 <main+0x633>
mov    -0x434(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x434(%rbp)
jmp    1847 <main+0x5d7>
lea    -0x850(%rbp),%rdi
mov    -0x434(%rbp),%ecx
mov    -0x858(%rbp),%rax
mov    %eax,%r8d
mov    $0x400,%esi
lea    0x98b(%rip),%rdx
call   1090 <snprintf@plt>
mov    -0x428(%rbp),%edi
lea    -0x850(%rbp),%rsi
call   1100 <putcrlf@plt>
jmp    1bdf <main+0x96f>
lea    -0x850(%rbp),%rdi
lea    0x96b(%rip),%rsi
mov    $0x5,%edx
call   1120 <strncasecmp@plt>
cmp    $0x0,%rax
jne    1a41 <main+0x7d1>
cmpl   $0x0,-0x430(%rbp)
jne    193c <main+0x6cc>
mov    -0x428(%rbp),%edi
lea    0x910(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    1570 <main+0x300>
lea    -0x850(%rbp),%rdi
add    $0x5,%rdi
lea    0x91e(%rip),%rsi
lea    -0x434(%rbp),%rdx
call   1130 <sscanf@plt>
mov    %eax,-0x424(%rbp)
cmpl   $0x1,-0x424(%rbp)
je     1984 <main+0x714>
mov    -0x428(%rbp),%edi
lea    0x8fb(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    1570 <main+0x300>
cmpl   $0x1,-0x434(%rbp)
jl     19a3 <main+0x733>
mov    -0x434(%rbp),%eax
cmp    -0x43c(%rbp),%eax
jle    19ba <main+0x74a>
mov    -0x428(%rbp),%edi
lea    0x8d5(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    1570 <main+0x300>
mov    -0x18(%rbp),%rax
mov    -0x434(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
jne    19ec <main+0x77c>
mov    -0x428(%rbp),%edi
lea    0x8d7(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    1a3c <main+0x7cc>
mov    -0x18(%rbp),%rax
mov    -0x434(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1160 <readmessage@plt>
mov    %rax,-0x860(%rbp)
mov    -0x428(%rbp),%edi
lea    0x8c2(%rip),%rsi
call   1100 <putcrlf@plt>
mov    -0x428(%rbp),%edi
mov    -0x860(%rbp),%rsi
call   1140 <putpopbulk@plt>
mov    -0x860(%rbp),%rdi
call   1030 <free@plt>
jmp    1bda <main+0x96a>
lea    -0x850(%rbp),%rdi
lea    0x8a0(%rip),%rsi
mov    $0x5,%edx
call   1120 <strncasecmp@plt>
cmp    $0x0,%rax
jne    1b7f <main+0x90f>
cmpl   $0x0,-0x430(%rbp)
jne    1a87 <main+0x817>
mov    -0x428(%rbp),%edi
lea    0x7c5(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    1570 <main+0x300>
lea    -0x850(%rbp),%rdi
add    $0x5,%rdi
lea    0x7d3(%rip),%rsi
lea    -0x434(%rbp),%rdx
call   1130 <sscanf@plt>
mov    %eax,-0x424(%rbp)
cmpl   $0x1,-0x424(%rbp)
je     1acf <main+0x85f>
mov    -0x428(%rbp),%edi
lea    0x7b0(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    1570 <main+0x300>
cmpl   $0x1,-0x434(%rbp)
jl     1aee <main+0x87e>
mov    -0x434(%rbp),%eax
cmp    -0x43c(%rbp),%eax
jle    1b05 <main+0x895>
mov    -0x428(%rbp),%edi
lea    0x78a(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    1570 <main+0x300>
mov    -0x18(%rbp),%rax
mov    -0x434(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
jne    1b37 <main+0x8c7>
mov    -0x428(%rbp),%edi
lea    0x7c8(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    1b7a <main+0x90a>
mov    -0x18(%rbp),%rax
mov    -0x434(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <fclose@plt>
mov    -0x18(%rbp),%rax
mov    -0x434(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x428(%rbp),%edi
lea    0x7b2(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    1bd5 <main+0x965>
lea    -0x850(%rbp),%rdi
lea    0x7bb(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1bbe <main+0x94e>
mov    -0x428(%rbp),%edi
lea    0x7a4(%rip),%rsi
call   1100 <putcrlf@plt>
mov    -0x428(%rbp),%edi
call   10b0 <close@plt>
jmp    1bf8 <main+0x988>
mov    -0x428(%rbp),%edi
lea    0x7a6(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    1bd5 <main+0x965>
jmp    1bda <main+0x96a>
jmp    1bdf <main+0x96f>
jmp    1be4 <main+0x974>
jmp    1be9 <main+0x979>
jmp    1bee <main+0x97e>
jmp    1bf3 <main+0x983>
jmp    1570 <main+0x300>
xor    %edi,%edi
call   1170 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x838,%rsp
mov    %rsi,%r14
cmp    $0x4,%edi
jg     12ad <main+0x3d>
mov    0x2d50(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xd64(%rip),%rsi
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    $0x1,%edi
call   1170 <exit@plt>
mov    %edi,%ebp
mov    0x10(%r14),%rdi
lea    0xd82(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
jne    12ca <main+0x5a>
mov    0x18(%r14),%r15
jmp    12cd <main+0x5d>
xor    %r15d,%r15d
lea    -0x20(,%rbp,8),%ebx
mov    %ebx,%edi
call   1110 <malloc@plt>
test   %rax,%rax
jne    12f2 <main+0x82>
mov    0x2cf9(%rip),%rax
mov    (%rax),%edi
lea    0xd53(%rip),%rsi
jmp    1318 <main+0xa8>
mov    %rax,0x10(%rsp)
mov    %ebx,%edi
call   1110 <malloc@plt>
mov    %rax,0x18(%rsp)
test   %rax,%rax
jne    132b <main+0xbb>
mov    0x2cd1(%rip),%rax
mov    (%rax),%edi
lea    0xd57(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    $0x1,%edi
call   1170 <exit@plt>
mov    %r15,0x20(%rsp)
lea    -0x4(%rbp),%eax
mov    %eax,0x4(%rsp)
movl   $0x4,(%rsp)
mov    $0x4,%eax
xor    %r12d,%r12d
lea    0x430(%rsp),%rbx
jmp    136d <main+0xfd>
mov    %r15,%rdi
call   1080 <rewind@plt>
mov    (%rsp),%eax
add    $0x1,%eax
mov    %eax,(%rsp)
add    $0x1,%r12
cmp    %ebp,%eax
jge    1406 <main+0x196>
cltq
mov    (%r14,%rax,8),%rdi
lea    0xe93(%rip),%rsi
call   1150 <fopen@plt>
mov    %rax,%r15
mov    0x10(%rsp),%rax
mov    %r15,(%rax,%r12,8)
test   %r15,%r15
je     1447 <main+0x1d7>
mov    0x18(%rsp),%rax
movq   $0x0,(%rax,%r12,8)
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r15,%rdx
call   10c0 <fgets@plt>
test   %rax,%rax
je     1350 <main+0xe0>
mov    %r14,%r13
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1070 <strlen@plt>
add    %rax,%r14
mov    %rbx,%rdi
mov    $0xa,%esi
call   10a0 <strrchr@plt>
cmp    $0x1,%rax
sbb    $0xffffffffffffffff,%r14
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r15,%rdx
call   10c0 <fgets@plt>
test   %rax,%rax
jne    13c0 <main+0x150>
mov    0x18(%rsp),%rax
mov    %r14,(%rax,%r12,8)
mov    %r13,%r14
jmp    1350 <main+0xe0>
mov    0x8(%r14),%rsi
lea    0xcb0(%rip),%rdi
call   10e0 <serve@plt>
mov    %eax,%ebp
lea    0xcb3(%rip),%rsi
mov    %eax,%edi
call   1100 <putcrlf@plt>
lea    0x30(%rsp),%rsi
mov    %ebp,%edi
mov    $0x400,%edx
call   1050 <getpop@plt>
test   %eax,%eax
mov    0x20(%rsp),%rbx
jg     1486 <main+0x216>
xor    %edi,%edi
call   1170 <exit@plt>
mov    0x2b92(%rip),%rax
mov    (%rax),%ebx
movslq (%rsp),%rax
mov    (%r14,%rax,8),%rbp
mov    0x2b79(%rip),%rax
mov    (%rax),%edi
call   1180 <strerror@plt>
lea    0xc2e(%rip),%rsi
mov    %ebx,%edi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    $0x1,%edi
call   1170 <exit@plt>
mov    0x4(%rsp),%r15d
mov    %r15,0x28(%rsp)
and    $0xfffffffe,%r15d
xor    %eax,%eax
mov    %rax,0x8(%rsp)
lea    0x30(%rsp),%r13
xor    %r12d,%r12d
jmp    14d5 <main+0x265>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
lea    0xe34(%rip),%rsi
call   1100 <putcrlf@plt>
mov    %ebp,%edi
mov    %r13,%rsi
mov    $0x400,%edx
call   1050 <getpop@plt>
test   %eax,%eax
jle    1440 <main+0x1d0>
mov    %r13,%rdi
lea    0xc26(%rip),%rsi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     15d0 <main+0x360>
mov    %r13,%rdi
lea    0xc57(%rip),%rsi
mov    $0x5,%edx
call   1120 <strncasecmp@plt>
test   %rax,%rax
je     1600 <main+0x390>
mov    %r13,%rdi
lea    0xc66(%rip),%rsi
mov    $0x5,%edx
call   1120 <strncasecmp@plt>
test   %rax,%rax
je     1621 <main+0x3b1>
test   %rbx,%rbx
je     1549 <main+0x2d9>
mov    %r13,%rdi
lea    0xcba(%rip),%rsi
mov    $0xc,%edx
call   1120 <strncasecmp@plt>
test   %rax,%rax
je     16c3 <main+0x453>
mov    %r13,%rdi
lea    0xcea(%rip),%rsi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     1669 <main+0x3f9>
mov    %r13,%rdi
lea    0xd04(%rip),%rsi
mov    $0x5,%edx
call   1120 <strncasecmp@plt>
test   %rax,%rax
je     16ff <main+0x48f>
mov    %r13,%rdi
lea    0xd67(%rip),%rsi
mov    $0x5,%edx
call   1120 <strncasecmp@plt>
test   %rax,%rax
je     1799 <main+0x529>
mov    %r13,%rdi
lea    0xda3(%rip),%rsi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     18d1 <main+0x661>
mov    %ebp,%edi
lea    0xdb5(%rip),%rsi
jmp    14b9 <main+0x249>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
lea    0xb31(%rip),%rsi
call   1140 <putpopbulk@plt>
test   %rbx,%rbx
je     14b0 <main+0x240>
mov    %ebp,%edi
lea    0xb51(%rip),%rsi
call   1100 <putcrlf@plt>
jmp    14b0 <main+0x240>
nopw   0x0(%rax,%rax,1)
mov    0x10(%r14),%rsi
lea    0x35(%rsp),%rdi
call   10d0 <strcmp@plt>
mov    %ebp,%edi
test   %rax,%rax
je     164e <main+0x3de>
lea    0xb45(%rip),%rsi
jmp    14b9 <main+0x249>
cmpl   $0x0,0x8(%rsp)
je     16e5 <main+0x475>
mov    0x18(%r14),%rsi
lea    0x35(%rsp),%rdi
call   10d0 <strcmp@plt>
mov    %ebp,%edi
test   %rax,%rax
je     1782 <main+0x512>
lea    0xb98(%rip),%rsi
jmp    1655 <main+0x3e5>
lea    0xaff(%rip),%rsi
call   1100 <putcrlf@plt>
mov    $0x1,%eax
mov    %rax,0x8(%rsp)
jmp    14be <main+0x24e>
test   %r12d,%r12d
je     1804 <main+0x594>
cmpl   $0x1,0x4(%rsp)
jne    1828 <main+0x5b8>
xor    %eax,%eax
xor    %r8d,%r8d
mov    0x10(%rsp),%rcx
testb  $0x1,0x28(%rsp)
je     169e <main+0x42e>
cmpq   $0x0,(%rcx,%rax,8)
je     169e <main+0x42e>
mov    0x18(%rsp),%rcx
add    (%rcx,%rax,8),%r8
mov    0x4(%rsp),%ecx
mov    %ecx,(%rsp)
mov    %r13,%rdi
mov    $0x400,%esi
lea    0xbb1(%rip),%rdx
call   1090 <snprintf@plt>
mov    %ebp,%edi
mov    %r13,%rsi
jmp    14b9 <main+0x249>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1190 <strstr@plt>
mov    %ebp,%edi
test   %rax,%rax
je     1871 <main+0x601>
lea    0xb50(%rip),%rsi
jmp    18ab <main+0x63b>
mov    %ebp,%edi
lea    0xa92(%rip),%rsi
call   1100 <putcrlf@plt>
xor    %eax,%eax
mov    %rax,0x8(%rsp)
jmp    14be <main+0x24e>
test   %r12d,%r12d
je     1804 <main+0x594>
lea    0x35(%rsp),%rdi
lea    0xb58(%rip),%rsi
mov    %rsp,%rdx
call   1130 <sscanf@plt>
cmp    $0x1,%eax
jne    181a <main+0x5aa>
mov    (%rsp),%eax
test   %eax,%eax
jle    18a2 <main+0x632>
cmp    0x4(%rsp),%eax
jg     18a2 <main+0x632>
add    $0xffffffff,%eax
mov    0x10(%rsp),%rcx
mov    (%rcx,%rax,8),%rdi
test   %rdi,%rdi
je     18bb <main+0x64b>
call   1160 <readmessage@plt>
mov    %rax,%r12
mov    %ebp,%edi
lea    0xb7b(%rip),%rsi
call   1100 <putcrlf@plt>
mov    %ebp,%edi
mov    %r12,%rsi
call   1140 <putpopbulk@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    $0x1,%r12d
jmp    14be <main+0x24e>
lea    0xa35(%rip),%rsi
call   1100 <putcrlf@plt>
mov    $0x1,%r12d
jmp    165a <main+0x3ea>
test   %r12d,%r12d
je     1804 <main+0x594>
lea    0x35(%rsp),%rdi
lea    0xac2(%rip),%rsi
mov    %rsp,%rdx
call   1130 <sscanf@plt>
cmp    $0x1,%eax
jne    181a <main+0x5aa>
mov    (%rsp),%eax
test   %eax,%eax
jle    18a2 <main+0x632>
cmp    0x4(%rsp),%eax
jg     18a2 <main+0x632>
add    $0xffffffff,%eax
mov    0x10(%rsp),%rcx
mov    (%rcx,%rax,8),%rdi
test   %rdi,%rdi
je     18c6 <main+0x656>
mov    %rcx,%r12
call   1060 <fclose@plt>
movslq (%rsp),%rax
movq   $0x0,-0x8(%r12,%rax,8)
mov    %ebp,%edi
lea    0xb28(%rip),%rsi
jmp    18ab <main+0x63b>
mov    %ebp,%edi
lea    0xa35(%rip),%rsi
call   1100 <putcrlf@plt>
xor    %r12d,%r12d
jmp    14be <main+0x24e>
mov    %ebp,%edi
lea    0xa52(%rip),%rsi
jmp    18ab <main+0x63b>
xor    %eax,%eax
xor    %r8d,%r8d
mov    0x10(%rsp),%rcx
jmp    184d <main+0x5dd>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x2,%rax
cmp    %rax,%r15
je     1687 <main+0x417>
cmpq   $0x0,(%rcx,%rax,8)
je     185d <main+0x5ed>
mov    0x18(%rsp),%rdx
add    (%rdx,%rax,8),%r8
cmpq   $0x0,0x8(%rcx,%rax,8)
je     1840 <main+0x5d0>
mov    0x18(%rsp),%rdx
add    0x8(%rdx,%rax,8),%r8
jmp    1840 <main+0x5d0>
lea    0x985(%rip),%rsi
call   1100 <putcrlf@plt>
mov    %ebp,%edi
mov    %r13,%rsi
mov    $0x400,%edx
call   1050 <getpop@plt>
test   %eax,%eax
jne    1440 <main+0x1d0>
mov    %ebp,%edi
lea    0x972(%rip),%rsi
jmp    14b9 <main+0x249>
mov    %ebp,%edi
lea    0x9da(%rip),%rsi
call   1100 <putcrlf@plt>
mov    $0x1,%r12d
jmp    14be <main+0x24e>
mov    %ebp,%edi
lea    0x9f5(%rip),%rsi
jmp    18ab <main+0x63b>
mov    %ebp,%edi
lea    0xa26(%rip),%rsi
jmp    18ab <main+0x63b>
lea    0xa75(%rip),%rsi
mov    %ebp,%edi
call   1100 <putcrlf@plt>
mov    %ebp,%edi
call   10b0 <close@plt>
xor    %edi,%edi
call   1170 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"Usage: %s port username password mail-file [mail-file ...]\0A\00"
@.str.1 = [7 x i8] c"XOAUTH\00"
@.str.2 = [44 x i8] c"Unable to allocate %d bytes for file array\0A\00"
@.str.3 = [44 x i8] c"Unable to allocate %d bytes for size array\0A\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [38 x i8] c"Unable to open message file \22%s\22: %s\0A\00"
@errno = global i32 0
@.str.6 = [17 x i8] c"/tmp/fakepop.pid\00"
@.str.7 = [51 x i8] c"+OK Not really a POP server, but we play one on TV\00"
@.str.8 = [5 x i8] c"CAPA\00"
@.str.9 = [55 x i8] c"+OK We have no capabilities, really\0D\0AFAKE-CAPABILITY\0D\0A\00"
@.str.10 = [13 x i8] c"SASL XOAUTH2\00"
@.str.11 = [2 x i8] c".\00"
@.str.12 = [6 x i8] c"USER \00"
@.str.13 = [13 x i8] c"+OK Niiiice!\00"
@.str.14 = [25 x i8] c"-ERR Don't play me, bro!\00"
@.str.15 = [6 x i8] c"PASS \00"
@.str.16 = [62 x i8] c"-ERR Aren't you forgetting something? Like the USER command?\00"
@.str.17 = [38 x i8] c"+OK Aren't you a sight for sore eyes!\00"
@.str.18 = [12 x i8] c"-ERR C'mon!\00"
@.str.19 = [13 x i8] c"AUTH XOAUTH2\00"
@.str.20 = [18 x i8] c"+ base64-json-err\00"
@.str.21 = [33 x i8] c"-ERR [AUTH] Invalid credentials.\00"
@.str.22 = [13 x i8] c"+OK Welcome.\00"
@.str.23 = [5 x i8] c"STAT\00"
@.str.24 = [35 x i8] c"-ERR Um, hello? Forget to log in?\00"
@.str.25 = [10 x i8] c"+OK %d %d\00"
@.str.26 = [6 x i8] c"RETR \00"
@.str.27 = [3 x i8] c"%d\00"
@.str.28 = [16 x i8] c"-ERR Whaaaa...?\00"
@.str.29 = [52 x i8] c"-ERR That message number is out of range, jerkface!\00"
@.str.30 = [34 x i8] c"-ERR Sorry, don't have it anymore\00"
@.str.31 = [20 x i8] c"+OK Here you go ...\00"
@.str.32 = [6 x i8] c"DELE \00"
@.str.33 = [50 x i8] c"-ERR Um, didn't you tell me to delete it already?\00"
@.str.34 = [33 x i8] c"+OK Alright man, I got rid of it\00"
@.str.35 = [5 x i8] c"QUIT\00"
@.str.36 = [36 x i8] c"+OK See ya, wouldn't want to be ya!\00"
@.str.37 = [15 x i8] c"-ERR Um, what?\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32**
%7 = alloca [1024 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 i64*
%16 = alloca i8*
%17 = alloca [1024 x i8]
%18 = alloca i64
%19 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %10
store i32 0, i32* %11
%20 = load i32, i32* %4
%21 = icmp slt i32 %20, 5
br i1 %21, label %22, label %29
22: ; preds = %2
%23 = load i32, i32* @stderr
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %26)
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %2
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %29
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 3
%38 = load i8*, i8** %37
store i8* %38, i8** %16
br label %40
39: ; preds = %29
store i8* null, i8** %16
br label %40
40: ; preds = %39, %35
%41 = load i32, i32* %4
%42 = sub nsw i32 %41, 4
store i32 %42, i32* %14
%43 = load i32, i32* %14
%44 = sext i32 %43 to i64
%45 = mul i64 8, %44
%46 = trunc i64 %45 to i32
%47 = call i8* @malloc(i32 %46)
%48 = bitcast i8* %47 to i32**
store i32** %48, i32*** %6
%49 = load i32**, i32*** %6
%50 = icmp ne i32** %49, null
br i1 %50, label %59, label %51
51: ; preds = %40
%52 = load i32, i32* @stderr
%53 = load i32, i32* %14
%54 = sext i32 %53 to i64
%55 = mul i64 8, %54
%56 = trunc i64 %55 to i32
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i32 %56)
%58 = call i32 @exit(i32 1)
unreachable
59: ; preds = %40
%60 = load i32, i32* %14
%61 = sext i32 %60 to i64
%62 = mul i64 8, %61
%63 = trunc i64 %62 to i32
%64 = call i8* @malloc(i32 %63)
%65 = bitcast i8* %64 to i64*
store i64* %65, i64** %15
%66 = load i64*, i64** %15
%67 = icmp ne i64* %66, null
br i1 %67, label %76, label %68
68: ; preds = %59
%69 = load i32, i32* @stderr
%70 = load i32, i32* %14
%71 = sext i32 %70 to i64
%72 = mul i64 8, %71
%73 = trunc i64 %72 to i32
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i32 %73)
%75 = call i32 @exit(i32 1)
unreachable
76: ; preds = %59
store i32 4, i32* %12
store i32 0, i32* %13
br label %77
77: ; preds = %145, %76
%78 = load i32, i32* %12
%79 = load i32, i32* %4
%80 = icmp slt i32 %78, %79
br i1 %80, label %81, label %150
81: ; preds = %77
%82 = load i8**, i8*** %5
%83 = load i32, i32* %12
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8*, i8** %82, i64 %84
%86 = load i8*, i8** %85
%87 = call i32* @fopen(i8* %86, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%88 = load i32**, i32*** %6
%89 = load i32, i32* %13
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i32*, i32** %88, i64 %90
store i32* %87, i32** %91
%92 = icmp ne i32* %87, null
br i1 %92, label %104, label %93
93: ; preds = %81
%94 = load i32, i32* @stderr
%95 = load i8**, i8*** %5
%96 = load i32, i32* %12
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds i8*, i8** %95, i64 %97
%99 = load i8*, i8** %98
%100 = load i32, i32* @errno
%101 = call i8* @strerror(i32 %100)
%102 = call i32 (i32, i8*, ...) @fprintf(i32 %94, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i8* %99, i8* %101)
%103 = call i32 @exit(i32 1)
unreachable
104: ; preds = %81
%105 = load i64*, i64** %15
%106 = load i32, i32* %13
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i64, i64* %105, i64 %107
store i64 0, i64* %108
br label %109
109: ; preds = %137, %104
%110 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%111 = load i32**, i32*** %6
%112 = load i32, i32* %13
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i32*, i32** %111, i64 %113
%115 = load i32*, i32** %114
%116 = call i64 @fgets(i8* %110, i32 1024, i32* %115)
%117 = icmp ne i64 %116, 0
br i1 %117, label %118, label %138
118: ; preds = %109
%119 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%120 = call i64 @strlen(i8* %119)
%121 = load i64*, i64** %15
%122 = load i32, i32* %13
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i64, i64* %121, i64 %123
%125 = load i64, i64* %124
%126 = add i64 %125, %120
store i64 %126, i64* %124
%127 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%128 = call i64 @strrchr(i8* %127, i8 signext 10)
%129 = icmp ne i64 %128, 0
br i1 %129, label %130, label %137
130: ; preds = %118
%131 = load i64*, i64** %15
%132 = load i32, i32* %13
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds i64, i64* %131, i64 %133
%135 = load i64, i64* %134
%136 = add i64 %135, 1
store i64 %136, i64* %134
br label %137
137: ; preds = %130, %118
br label %109
138: ; preds = %109
%139 = load i32**, i32*** %6
%140 = load i32, i32* %13
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds i32*, i32** %139, i64 %141
%143 = load i32*, i32** %142
%144 = call i32 @rewind(i32* %143)
br label %145
145: ; preds = %138
%146 = load i32, i32* %12
%147 = add nsw i32 %146, 1
store i32 %147, i32* %12
%148 = load i32, i32* %13
%149 = add nsw i32 %148, 1
store i32 %149, i32* %13
br label %77
150: ; preds = %77
%151 = load i8**, i8*** %5
%152 = getelementptr inbounds i8*, i8** %151, i64 1
%153 = load i8*, i8** %152
%154 = call i32 @serve(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %153)
store i32 %154, i32* %9
%155 = load i32, i32* %9
%156 = call i32 @putcrlf(i32 %155, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.7, i64 0, i64 0))
br label %157
157: ; preds = %426, %377, %367, %358, %321, %311, %302, %257, %244, %205, %150
%158 = load i32, i32* %9
%159 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%160 = call i32 @getpop(i32 %158, i8* %159, i32 1024)
store i32 %160, i32* %8
%161 = load i32, i32* %8
%162 = icmp sle i32 %161, 0
br i1 %162, label %163, label %164
163: ; preds = %157
br label %427
164: ; preds = %157
%165 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%166 = call i64 @strcasecmp(i8* %165, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%167 = icmp eq i64 %166, 0
br i1 %167, label %168, label %179
168: ; preds = %164
%169 = load i32, i32* %9
%170 = call i32 @putpopbulk(i32 %169, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0))
%171 = load i8*, i8** %16
%172 = icmp ne i8* %171, null
br i1 %172, label %173, label %176
173: ; preds = %168
%174 = load i32, i32* %9
%175 = call i32 @putcrlf(i32 %174, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
br label %176
176: ; preds = %173, %168
%177 = load i32, i32* %9
%178 = call i32 @putcrlf(i32 %177, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %426
179: ; preds = %164
%180 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%181 = call i64 @strncasecmp(i8* %180, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 5)
%182 = icmp eq i64 %181, 0
br i1 %182, label %183, label %198
183: ; preds = %179
%184 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%185 = getelementptr inbounds i8, i8* %184, i64 5
%186 = load i8**, i8*** %5
%187 = getelementptr inbounds i8*, i8** %186, i64 2
%188 = load i8*, i8** %187
%189 = call i64 @strcmp(i8* %185, i8* %188)
%190 = icmp eq i64 %189, 0
br i1 %190, label %191, label %194
191: ; preds = %183
%192 = load i32, i32* %9
%193 = call i32 @putcrlf(i32 %192, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0))
store i32 1, i32* %10
br label %197
194: ; preds = %183
%195 = load i32, i32* %9
%196 = call i32 @putcrlf(i32 %195, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.14, i64 0, i64 0))
br label %197
197: ; preds = %194, %191
br label %425
198: ; preds = %179
%199 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%200 = call i64 @strncasecmp(i8* %199, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i32 5)
%201 = icmp eq i64 %200, 0
br i1 %201, label %202, label %223
202: ; preds = %198
%203 = load i32, i32* %10
%204 = icmp ne i32 %203, 0
br i1 %204, label %208, label %205
205: ; preds = %202
%206 = load i32, i32* %9
%207 = call i32 @putcrlf(i32 %206, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.16, i64 0, i64 0))
br label %157
208: ; preds = %202
%209 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%210 = getelementptr inbounds i8, i8* %209, i64 5
%211 = load i8**, i8*** %5
%212 = getelementptr inbounds i8*, i8** %211, i64 3
%213 = load i8*, i8** %212
%214 = call i64 @strcmp(i8* %210, i8* %213)
%215 = icmp eq i64 %214, 0
br i1 %215, label %216, label %219
216: ; preds = %208
%217 = load i32, i32* %9
%218 = call i32 @putcrlf(i32 %217, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.17, i64 0, i64 0))
store i32 1, i32* %11
br label %222
219: ; preds = %208
%220 = load i32, i32* %9
%221 = call i32 @putcrlf(i32 %220, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.18, i64 0, i64 0))
br label %222
222: ; preds = %219, %216
br label %424
223: ; preds = %198
%224 = load i8*, i8** %16
%225 = icmp ne i8* %224, null
br i1 %225, label %226, label %250
226: ; preds = %223
%227 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%228 = call i64 @strncasecmp(i8* %227, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i32 12)
%229 = icmp eq i64 %228, 0
br i1 %229, label %230, label %250
230: ; preds = %226
%231 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%232 = load i8*, i8** %16
%233 = call i32* @strstr(i8* %231, i8* %232)
%234 = icmp eq i32* %233, null
br i1 %234, label %235, label %247
235: ; preds = %230
%236 = load i32, i32* %9
%237 = call i32 @putcrlf(i32 %236, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0))
%238 = load i32, i32* %9
%239 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%240 = call i32 @getpop(i32 %238, i8* %239, i32 1024)
store i32 %240, i32* %8
%241 = load i32, i32* %8
%242 = icmp ne i32 %241, 0
br i1 %242, label %243, label %244
243: ; preds = %235
br label %427
244: ; preds = %235
%245 = load i32, i32* %9
%246 = call i32 @putcrlf(i32 %245, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0))
br label %157
247: ; preds = %230
%248 = load i32, i32* %9
%249 = call i32 @putcrlf(i32 %248, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0))
store i32 1, i32* %11
br label %423
250: ; preds = %226, %223
%251 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%252 = call i64 @strcasecmp(i8* %251, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0))
%253 = icmp eq i64 %252, 0
br i1 %253, label %254, label %295
254: ; preds = %250
store i64 0, i64* %18
%255 = load i32, i32* %11
%256 = icmp ne i32 %255, 0
br i1 %256, label %260, label %257
257: ; preds = %254
%258 = load i32, i32* %9
%259 = call i32 @putcrlf(i32 %258, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.24, i64 0, i64 0))
br label %157
260: ; preds = %254
store i32 0, i32* %12
store i32 0, i32* %13
br label %261
261: ; preds = %283, %260
%262 = load i32, i32* %12
%263 = load i32, i32* %14
%264 = icmp slt i32 %262, %263
br i1 %264, label %265, label %286
265: ; preds = %261
%266 = load i32**, i32*** %6
%267 = load i32, i32* %12
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds i32*, i32** %266, i64 %268
%270 = load i32*, i32** %269
%271 = icmp ne i32* %270, null
br i1 %271, label %272, label %282
272: ; preds = %265
%273 = load i64*, i64** %15
%274 = load i32, i32* %12
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds i64, i64* %273, i64 %275
%277 = load i64, i64* %276
%278 = load i64, i64* %18
%279 = add i64 %278, %277
store i64 %279, i64* %18
%280 = load i32, i32* %13
%281 = add nsw i32 %280, 1
store i32 %281, i32* %13
br label %282
282: ; preds = %272, %265
br label %283
283: ; preds = %282
%284 = load i32, i32* %12
%285 = add nsw i32 %284, 1
store i32 %285, i32* %12
br label %261
286: ; preds = %261
%287 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%288 = load i32, i32* %12
%289 = load i64, i64* %18
%290 = trunc i64 %289 to i32
%291 = call i32 @snprintf(i8* %287, i32 1024, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.25, i64 0, i64 0), i32 %288, i32 %290)
%292 = load i32, i32* %9
%293 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%294 = call i32 @putcrlf(i32 %292, i8* %293)
br label %422
295: ; preds = %250
%296 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%297 = call i64 @strncasecmp(i8* %296, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i32 5)
%298 = icmp eq i64 %297, 0
br i1 %298, label %299, label %351
299: ; preds = %295
%300 = load i32, i32* %11
%301 = icmp ne i32 %300, 0
br i1 %301, label %305, label %302
302: ; preds = %299
%303 = load i32, i32* %9
%304 = call i32 @putcrlf(i32 %303, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.24, i64 0, i64 0))
br label %157
305: ; preds = %299
%306 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%307 = getelementptr inbounds i8, i8* %306, i64 5
%308 = call i32 @sscanf(i8* %307, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0), i32* %12)
store i32 %308, i32* %8
%309 = load i32, i32* %8
%310 = icmp ne i32 %309, 1
br i1 %310, label %311, label %314
311: ; preds = %305
%312 = load i32, i32* %9
%313 = call i32 @putcrlf(i32 %312, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.28, i64 0, i64 0))
br label %157
314: ; preds = %305
%315 = load i32, i32* %12
%316 = icmp slt i32 %315, 1
br i1 %316, label %321, label %317
317: ; preds = %314
%318 = load i32, i32* %12
%319 = load i32, i32* %14
%320 = icmp sgt i32 %318, %319
br i1 %320, label %321, label %324
321: ; preds = %317, %314
%322 = load i32, i32* %9
%323 = call i32 @putcrlf(i32 %322, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.29, i64 0, i64 0))
br label %157
324: ; preds = %317
%325 = load i32**, i32*** %6
%326 = load i32, i32* %12
%327 = sub nsw i32 %326, 1
%328 = sext i32 %327 to i64
%329 = getelementptr inbounds i32*, i32** %325, i64 %328
%330 = load i32*, i32** %329
%331 = icmp eq i32* %330, null
br i1 %331, label %332, label %335
332: ; preds = %324
%333 = load i32, i32* %9
%334 = call i32 @putcrlf(i32 %333, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.30, i64 0, i64 0))
br label %350
335: ; preds = %324
%336 = load i32**, i32*** %6
%337 = load i32, i32* %12
%338 = sub nsw i32 %337, 1
%339 = sext i32 %338 to i64
%340 = getelementptr inbounds i32*, i32** %336, i64 %339
%341 = load i32*, i32** %340
%342 = call i8* @readmessage(i32* %341)
store i8* %342, i8** %19
%343 = load i32, i32* %9
%344 = call i32 @putcrlf(i32 %343, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.31, i64 0, i64 0))
%345 = load i32, i32* %9
%346 = load i8*, i8** %19
%347 = call i32 @putpopbulk(i32 %345, i8* %346)
%348 = load i8*, i8** %19
%349 = call i32 @free(i8* %348)
br label %350
350: ; preds = %335, %332
br label %421
351: ; preds = %295
%352 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%353 = call i64 @strncasecmp(i8* %352, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.32, i64 0, i64 0), i32 5)
%354 = icmp eq i64 %353, 0
br i1 %354, label %355, label %407
355: ; preds = %351
%356 = load i32, i32* %11
%357 = icmp ne i32 %356, 0
br i1 %357, label %361, label %358
358: ; preds = %355
%359 = load i32, i32* %9
%360 = call i32 @putcrlf(i32 %359, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.24, i64 0, i64 0))
br label %157
361: ; preds = %355
%362 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%363 = getelementptr inbounds i8, i8* %362, i64 5
%364 = call i32 @sscanf(i8* %363, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0), i32* %12)
store i32 %364, i32* %8
%365 = load i32, i32* %8
%366 = icmp ne i32 %365, 1
br i1 %366, label %367, label %370
367: ; preds = %361
%368 = load i32, i32* %9
%369 = call i32 @putcrlf(i32 %368, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.28, i64 0, i64 0))
br label %157
370: ; preds = %361
%371 = load i32, i32* %12
%372 = icmp slt i32 %371, 1
br i1 %372, label %377, label %373
373: ; preds = %370
%374 = load i32, i32* %12
%375 = load i32, i32* %14
%376 = icmp sgt i32 %374, %375
br i1 %376, label %377, label %380
377: ; preds = %373, %370
%378 = load i32, i32* %9
%379 = call i32 @putcrlf(i32 %378, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.29, i64 0, i64 0))
br label %157
380: ; preds = %373
%381 = load i32**, i32*** %6
%382 = load i32, i32* %12
%383 = sub nsw i32 %382, 1
%384 = sext i32 %383 to i64
%385 = getelementptr inbounds i32*, i32** %381, i64 %384
%386 = load i32*, i32** %385
%387 = icmp eq i32* %386, null
br i1 %387, label %388, label %391
388: ; preds = %380
%389 = load i32, i32* %9
%390 = call i32 @putcrlf(i32 %389, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.33, i64 0, i64 0))
br label %406
391: ; preds = %380
%392 = load i32**, i32*** %6
%393 = load i32, i32* %12
%394 = sub nsw i32 %393, 1
%395 = sext i32 %394 to i64
%396 = getelementptr inbounds i32*, i32** %392, i64 %395
%397 = load i32*, i32** %396
%398 = call i32 @fclose(i32* %397)
%399 = load i32**, i32*** %6
%400 = load i32, i32* %12
%401 = sub nsw i32 %400, 1
%402 = sext i32 %401 to i64
%403 = getelementptr inbounds i32*, i32** %399, i64 %402
store i32* null, i32** %403
%404 = load i32, i32* %9
%405 = call i32 @putcrlf(i32 %404, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.34, i64 0, i64 0))
br label %406
406: ; preds = %391, %388
br label %420
407: ; preds = %351
%408 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%409 = call i64 @strcasecmp(i8* %408, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.35, i64 0, i64 0))
%410 = icmp eq i64 %409, 0
br i1 %410, label %411, label %416
411: ; preds = %407
%412 = load i32, i32* %9
%413 = call i32 @putcrlf(i32 %412, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.36, i64 0, i64 0))
%414 = load i32, i32* %9
%415 = call i32 @close(i32 %414)
br label %427
416: ; preds = %407
%417 = load i32, i32* %9
%418 = call i32 @putcrlf(i32 %417, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.37, i64 0, i64 0))
br label %419
419: ; preds = %416
br label %420
420: ; preds = %419, %406
br label %421
421: ; preds = %420, %350
br label %422
422: ; preds = %421, %286
br label %423
423: ; preds = %422, %247
br label %424
424: ; preds = %423, %222
br label %425
425: ; preds = %424, %197
br label %426
426: ; preds = %425, %176
br label %157
427: ; preds = %411, %243, %163
%428 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"Usage: %s port username password mail-file [mail-file ...]\0A\00"
@.str.1 = [7 x i8] c"XOAUTH\00"
@.str.2 = [44 x i8] c"Unable to allocate %d bytes for file array\0A\00"
@.str.3 = [44 x i8] c"Unable to allocate %d bytes for size array\0A\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [38 x i8] c"Unable to open message file \22%s\22: %s\0A\00"
@errno = global i32 0
@.str.6 = [17 x i8] c"/tmp/fakepop.pid\00"
@.str.7 = [51 x i8] c"+OK Not really a POP server, but we play one on TV\00"
@.str.8 = [5 x i8] c"CAPA\00"
@.str.9 = [55 x i8] c"+OK We have no capabilities, really\0D\0AFAKE-CAPABILITY\0D\0A\00"
@.str.10 = [13 x i8] c"SASL XOAUTH2\00"
@.str.11 = [2 x i8] c".\00"
@.str.12 = [6 x i8] c"USER \00"
@.str.13 = [13 x i8] c"+OK Niiiice!\00"
@.str.14 = [25 x i8] c"-ERR Don't play me, bro!\00"
@.str.15 = [6 x i8] c"PASS \00"
@.str.16 = [62 x i8] c"-ERR Aren't you forgetting something? Like the USER command?\00"
@.str.17 = [38 x i8] c"+OK Aren't you a sight for sore eyes!\00"
@.str.18 = [12 x i8] c"-ERR C'mon!\00"
@.str.19 = [13 x i8] c"AUTH XOAUTH2\00"
@.str.20 = [18 x i8] c"+ base64-json-err\00"
@.str.21 = [33 x i8] c"-ERR [AUTH] Invalid credentials.\00"
@.str.22 = [13 x i8] c"+OK Welcome.\00"
@.str.23 = [5 x i8] c"STAT\00"
@.str.24 = [35 x i8] c"-ERR Um, hello? Forget to log in?\00"
@.str.25 = [10 x i8] c"+OK %d %d\00"
@.str.26 = [6 x i8] c"RETR \00"
@.str.27 = [3 x i8] c"%d\00"
@.str.28 = [16 x i8] c"-ERR Whaaaa...?\00"
@.str.29 = [52 x i8] c"-ERR That message number is out of range, jerkface!\00"
@.str.30 = [34 x i8] c"-ERR Sorry, don't have it anymore\00"
@.str.31 = [20 x i8] c"+OK Here you go ...\00"
@.str.32 = [6 x i8] c"DELE \00"
@.str.33 = [50 x i8] c"-ERR Um, didn't you tell me to delete it already?\00"
@.str.34 = [33 x i8] c"+OK Alright man, I got rid of it\00"
@.str.35 = [5 x i8] c"QUIT\00"
@.str.36 = [36 x i8] c"+OK See ya, wouldn't want to be ya!\00"
@.str.37 = [15 x i8] c"-ERR Um, what?\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = alloca i32
%5 = alloca [1024 x i8]
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = bitcast i32* %4 to i8*
%8 = icmp slt i32 %0, 5
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %1
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = getelementptr inbounds i8*, i8** %1, i64 3
%21 = load i8*, i8** %20
br label %22
22: ; preds = %14, %19
%23 = phi i8* [ %21, %19 ], [ null, %14 ]
%24 = add nsw i32 %0, -4
%25 = shl i32 %24, 3
%26 = tail call i8* @malloc(i32 %25)
%27 = bitcast i8* %26 to i32**
%28 = icmp eq i8* %26, null
br i1 %28, label %29, label %33
29: ; preds = %22
%30 = load i32, i32* @stderr
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i32 %25)
%32 = tail call i32 @exit(i32 1)
unreachable
33: ; preds = %22
%34 = tail call i8* @malloc(i32 %25)
%35 = bitcast i8* %34 to i64*
%36 = icmp eq i8* %34, null
br i1 %36, label %37, label %41
37: ; preds = %33
%38 = load i32, i32* @stderr
%39 = tail call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i32 %25)
%40 = tail call i32 @exit(i32 1)
unreachable
41: ; preds = %33
store i32 4, i32* %4
br label %42
42: ; preds = %41, %76
%43 = phi i64 [ 0, %41 ], [ %80, %76 ]
%44 = phi i32 [ 4, %41 ], [ %79, %76 ]
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8*, i8** %1, i64 %45
%47 = load i8*, i8** %46
%48 = call i32* @fopen(i8* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%49 = getelementptr inbounds i32*, i32** %27, i64 %43
store i32* %48, i32** %49
%50 = icmp eq i32* %48, null
br i1 %50, label %51, label %61
51: ; preds = %42
%52 = load i32, i32* @stderr
%53 = load i32, i32* %4
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8*, i8** %1, i64 %54
%56 = load i8*, i8** %55
%57 = load i32, i32* @errno
%58 = call i8* @strerror(i32 %57)
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i8* %56, i8* %58)
%60 = call i32 @exit(i32 1)
unreachable
61: ; preds = %42
%62 = getelementptr inbounds i64, i64* %35, i64 %43
store i64 0, i64* %62
%63 = call i64 @fgets(i8* %6, i32 1024, i32* %48)
%64 = icmp eq i64 %63, 0
br i1 %64, label %76, label %65
65: ; preds = %61, %65
%66 = phi i64 [ %72, %65 ], [ 0, %61 ]
%67 = call i64 @strlen(i8* %6)
%68 = add i64 %66, %67
%69 = call i64 @strrchr(i8* %6, i8 signext 10)
%70 = icmp ne i64 %69, 0
%71 = zext i1 %70 to i64
%72 = add i64 %68, %71
%73 = call i64 @fgets(i8* %6, i32 1024, i32* %48)
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %65
75: ; preds = %65
store i64 %72, i64* %62
br label %76
76: ; preds = %75, %61
%77 = call i32 @rewind(i32* %48)
%78 = load i32, i32* %4
%79 = add nsw i32 %78, 1
store i32 %79, i32* %4
%80 = add nuw i64 %43, 1
%81 = icmp slt i32 %79, %0
br i1 %81, label %42, label %82
82: ; preds = %76
%83 = getelementptr inbounds i8*, i8** %1, i64 1
%84 = load i8*, i8** %83
%85 = call i32 @serve(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %84)
%86 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.7, i64 0, i64 0))
%87 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%88 = call i32 @getpop(i32 %85, i8* %87, i32 1024)
%89 = icmp slt i32 %88, 1
br i1 %89, label %277, label %90
90: ; preds = %82
%91 = icmp eq i8* %23, null
%92 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 5
%93 = getelementptr inbounds i8*, i8** %1, i64 3
%94 = add i32 %0, -4
%95 = zext i32 %24 to i64
%96 = and i64 %95, 1
%97 = icmp eq i32 %24, 1
%98 = and i64 %95, 4294967294
%99 = icmp eq i64 %96, 0
br label %100
100: ; preds = %90, %279
%101 = phi i32 [ 0, %90 ], [ %281, %279 ]
%102 = phi i32 [ 0, %90 ], [ %280, %279 ]
%103 = call i64 @strcasecmp(i8* %87, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%104 = icmp eq i64 %103, 0
br i1 %104, label %105, label %111
105: ; preds = %100
%106 = call i32 @putpopbulk(i32 %85, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0))
br i1 %91, label %109, label %107
107: ; preds = %105
%108 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
br label %109
109: ; preds = %107, %105
%110 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %279
111: ; preds = %100
%112 = call i64 @strncasecmp(i8* %87, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 5)
%113 = icmp eq i64 %112, 0
br i1 %113, label %114, label %122
114: ; preds = %111
%115 = load i8*, i8** %15
%116 = call i64 @strcmp(i8* %92, i8* %115)
%117 = icmp eq i64 %116, 0
br i1 %117, label %118, label %120
118: ; preds = %114
%119 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0))
br label %279
120: ; preds = %114
%121 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.14, i64 0, i64 0))
br label %279
122: ; preds = %111
%123 = call i64 @strncasecmp(i8* %87, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i32 5)
%124 = icmp eq i64 %123, 0
br i1 %124, label %125, label %137
125: ; preds = %122
%126 = icmp eq i32 %101, 0
br i1 %126, label %127, label %129
127: ; preds = %125
%128 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.16, i64 0, i64 0))
br label %279
129: ; preds = %125
%130 = load i8*, i8** %93
%131 = call i64 @strcmp(i8* %92, i8* %130)
%132 = icmp eq i64 %131, 0
br i1 %132, label %133, label %135
133: ; preds = %129
%134 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.17, i64 0, i64 0))
br label %279
135: ; preds = %129
%136 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.18, i64 0, i64 0))
br label %279
137: ; preds = %122
br i1 %91, label %152, label %138
138: ; preds = %137
%139 = call i64 @strncasecmp(i8* %87, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i32 12)
%140 = icmp eq i64 %139, 0
br i1 %140, label %141, label %152
141: ; preds = %138
%142 = call i32* @strstr(i8* %87, i8* %23)
%143 = icmp eq i32* %142, null
br i1 %143, label %144, label %150
144: ; preds = %141
%145 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0))
%146 = call i32 @getpop(i32 %85, i8* %87, i32 1024)
%147 = icmp eq i32 %146, 0
br i1 %147, label %148, label %277
148: ; preds = %144
%149 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0))
br label %279
150: ; preds = %141
%151 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0))
br label %279
152: ; preds = %138, %137
%153 = call i64 @strcasecmp(i8* %87, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0))
%154 = icmp eq i64 %153, 0
br i1 %154, label %155, label %203
155: ; preds = %152
%156 = icmp eq i32 %102, 0
br i1 %156, label %158, label %157
157: ; preds = %155
br i1 %97, label %186, label %160
158: ; preds = %155
%159 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.24, i64 0, i64 0))
br label %279
160: ; preds = %157, %181
%161 = phi i64 [ %183, %181 ], [ 0, %157 ]
%162 = phi i64 [ %182, %181 ], [ 0, %157 ]
%163 = phi i64 [ %184, %181 ], [ 0, %157 ]
%164 = getelementptr inbounds i32*, i32** %27, i64 %161
%165 = load i32*, i32** %164
%166 = icmp eq i32* %165, null
br i1 %166, label %171, label %167
167: ; preds = %160
%168 = getelementptr inbounds i64, i64* %35, i64 %161
%169 = load i64, i64* %168
%170 = add i64 %169, %162
br label %171
171: ; preds = %160, %167
%172 = phi i64 [ %170, %167 ], [ %162, %160 ]
%173 = or i64 %161, 1
%174 = getelementptr inbounds i32*, i32** %27, i64 %173
%175 = load i32*, i32** %174
%176 = icmp eq i32* %175, null
br i1 %176, label %181, label %177
177: ; preds = %171
%178 = getelementptr inbounds i64, i64* %35, i64 %173
%179 = load i64, i64* %178
%180 = add i64 %179, %172
br label %181
181: ; preds = %177, %171
%182 = phi i64 [ %180, %177 ], [ %172, %171 ]
%183 = add nuw nsw i64 %161, 2
%184 = add i64 %163, 2
%185 = icmp eq i64 %184, %98
br i1 %185, label %186, label %160
186: ; preds = %181, %157
%187 = phi i64 [ undef, %157 ], [ %182, %181 ]
%188 = phi i64 [ 0, %157 ], [ %183, %181 ]
%189 = phi i64 [ 0, %157 ], [ %182, %181 ]
br i1 %99, label %198, label %190
190: ; preds = %186
%191 = getelementptr inbounds i32*, i32** %27, i64 %188
%192 = load i32*, i32** %191
%193 = icmp eq i32* %192, null
br i1 %193, label %198, label %194
194: ; preds = %190
%195 = getelementptr inbounds i64, i64* %35, i64 %188
%196 = load i64, i64* %195
%197 = add i64 %196, %189
br label %198
198: ; preds = %190, %194, %186
%199 = phi i64 [ %187, %186 ], [ %197, %194 ], [ %189, %190 ]
store i32 %94, i32* %4
%200 = trunc i64 %199 to i32
%201 = call i32 @snprintf(i8* %87, i32 1024, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.25, i64 0, i64 0), i32 %94, i32 %200)
%202 = call i32 @putcrlf(i32 %85, i8* %87)
br label %279
203: ; preds = %152
%204 = call i64 @strncasecmp(i8* %87, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i32 5)
%205 = icmp eq i64 %204, 0
br i1 %205, label %206, label %235
206: ; preds = %203
%207 = icmp eq i32 %102, 0
br i1 %207, label %208, label %210
208: ; preds = %206
%209 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.24, i64 0, i64 0))
br label %279
210: ; preds = %206
%211 = call i32 @sscanf(i8* %92, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0), i32* %4)
%212 = icmp eq i32 %211, 1
br i1 %212, label %215, label %213
213: ; preds = %210
%214 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.28, i64 0, i64 0))
br label %279
215: ; preds = %210
%216 = load i32, i32* %4
%217 = icmp slt i32 %216, 1
%218 = icmp sgt i32 %216, %24
%219 = select i1 %217, i1 true, i1 %218
br i1 %219, label %220, label %222
220: ; preds = %215
%221 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.29, i64 0, i64 0))
br label %279
222: ; preds = %215
%223 = add nsw i32 %216, -1
%224 = zext i32 %223 to i64
%225 = getelementptr inbounds i32*, i32** %27, i64 %224
%226 = load i32*, i32** %225
%227 = icmp eq i32* %226, null
br i1 %227, label %228, label %230
228: ; preds = %222
%229 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.30, i64 0, i64 0))
br label %279
230: ; preds = %222
%231 = call i8* @readmessage(i32* %226)
%232 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.31, i64 0, i64 0))
%233 = call i32 @putpopbulk(i32 %85, i8* %231)
%234 = call i32 @free(i8* %231)
br label %279
235: ; preds = %203
%236 = call i64 @strncasecmp(i8* %87, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.32, i64 0, i64 0), i32 5)
%237 = icmp eq i64 %236, 0
br i1 %237, label %238, label %269
238: ; preds = %235
%239 = icmp eq i32 %102, 0
br i1 %239, label %240, label %242
240: ; preds = %238
%241 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.24, i64 0, i64 0))
br label %279
242: ; preds = %238
%243 = call i32 @sscanf(i8* %92, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0), i32* %4)
%244 = icmp eq i32 %243, 1
br i1 %244, label %247, label %245
245: ; preds = %242
%246 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.28, i64 0, i64 0))
br label %279
247: ; preds = %242
%248 = load i32, i32* %4
%249 = icmp slt i32 %248, 1
%250 = icmp sgt i32 %248, %24
%251 = select i1 %249, i1 true, i1 %250
br i1 %251, label %252, label %254
252: ; preds = %247
%253 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.29, i64 0, i64 0))
br label %279
254: ; preds = %247
%255 = add nsw i32 %248, -1
%256 = zext i32 %255 to i64
%257 = getelementptr inbounds i32*, i32** %27, i64 %256
%258 = load i32*, i32** %257
%259 = icmp eq i32* %258, null
br i1 %259, label %260, label %262
260: ; preds = %254
%261 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.33, i64 0, i64 0))
br label %279
262: ; preds = %254
%263 = call i32 @fclose(i32* %258)
%264 = load i32, i32* %4
%265 = add nsw i32 %264, -1
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds i32*, i32** %27, i64 %266
store i32* null, i32** %267
%268 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.34, i64 0, i64 0))
br label %279
269: ; preds = %235
%270 = call i64 @strcasecmp(i8* %87, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.35, i64 0, i64 0))
%271 = icmp eq i64 %270, 0
br i1 %271, label %272, label %275
272: ; preds = %269
%273 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.36, i64 0, i64 0))
%274 = call i32 @close(i32 %85)
br label %277
275: ; preds = %269
%276 = call i32 @putcrlf(i32 %85, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.37, i64 0, i64 0))
br label %279
277: ; preds = %144, %279, %82, %272
%278 = call i32 @exit(i32 0)
unreachable
279: ; preds = %198, %109, %135, %133, %275, %262, %260, %228, %230, %150, %118, %120, %158, %252, %245, %240, %220, %213, %208, %148, %127
%280 = phi i32 [ %102, %127 ], [ %102, %148 ], [ 1, %213 ], [ 1, %220 ], [ 0, %208 ], [ 1, %245 ], [ 1, %252 ], [ 0, %240 ], [ 0, %158 ], [ %102, %109 ], [ %102, %118 ], [ %102, %120 ], [ 1, %133 ], [ %102, %135 ], [ 1, %150 ], [ %102, %198 ], [ 1, %228 ], [ 1, %230 ], [ 1, %260 ], [ 1, %262 ], [ %102, %275 ]
%281 = phi i32 [ 0, %127 ], [ %101, %148 ], [ %101, %213 ], [ %101, %220 ], [ %101, %208 ], [ %101, %245 ], [ %101, %252 ], [ %101, %240 ], [ %101, %158 ], [ %101, %109 ], [ 1, %118 ], [ %101, %120 ], [ 1, %133 ], [ 1, %135 ], [ %101, %150 ], [ %101, %198 ], [ %101, %228 ], [ %101, %230 ], [ %101, %260 ], [ %101, %262 ], [ %101, %275 ]
%282 = call i32 @getpop(i32 %85, i8* %87, i32 1024)
%283 = icmp slt i32 %282, 1
br i1 %283, label %277, label %100
}