#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 */
struct sockaddr_storage {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ ss;
typedef int socklen_t;
typedef int /*<<< orphan*/ line;
typedef int /*<<< orphan*/ hostbuf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ LOG_DAEMON;
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ LOG_PID;
int MAXHOSTNAMELEN;
char *__UNCONST(char *);
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ execv(char *, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fdopen(int, char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int fork();
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ getnameinfo(struct sockaddr *, int, char *, int,
                               int /*<<< orphan*/ *, int /*<<< orphan*/,
                               int /*<<< orphan*/);
int getopt(int, char **, char *);
scalar_t__ getpeername(int /*<<< orphan*/, struct sockaddr *, int *);
int /*<<< orphan*/ my_err(char *, ...);
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
char *optarg;
scalar_t__ opterr;
int /*<<< orphan*/ optopt;
scalar_t__ pipe(int *);
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
scalar_t__ strchr(char *, char);
scalar_t__ strcmp(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int strlen(char *);
char *strrchr(char *, char);
char *strtok(char *, char *);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *, ...);
int main(int argc, char *argv[]) {
  FILE *fp;
  int ch, ac = 2;
  char *lp = NULL;
  struct sockaddr_storage ss;
  int p[2], logging, no_forward, user_required, short_list;
  socklen_t sval;
  char **ap, *av[50 + 1], **comp, line[1024], *prog, *s;
  char hostbuf[MAXHOSTNAMELEN];
  prog = __UNCONST("/usr/bin/finger");
  logging = no_forward = user_required = short_list = 0;
  openlog("fingerd", LOG_PID, LOG_DAEMON);
  opterr = 0;
  while ((ch = getopt(argc, argv, "gsluShmpP:8")) != -1) {
    switch (ch) {
    case 'l':
      logging = 1;
      break;
    case 'P':
      prog = optarg;
      break;
    case 's':
      no_forward = 1;
      break;
    case 'u':
      user_required = 1;
      break;
    case 'S':
      short_list = 1;
      av[ac++] = __UNCONST("-s");
      break;
    case 'h':
      av[ac++] = __UNCONST("-h");
      break;
    case 'm':
      av[ac++] = __UNCONST("-m");
      break;
    case 'p':
      av[ac++] = __UNCONST("-p");
      break;
    case 'g':
      av[ac++] = __UNCONST("-g");
      break;
    case '8':
      av[ac++] = __UNCONST("-8");
      break;
    case '?':
    default:
      my_err("illegal option -- %c", optopt);
    }
    if (ac >= 50)
      my_err("Too many options provided");
  }
  if (logging) {
    sval = sizeof(ss);
    if (getpeername(0, (struct sockaddr *)&ss, &sval) < 0)
      my_err("getpeername: %s", strerror(errno));
    (void)getnameinfo((struct sockaddr *)&ss, sval, hostbuf, sizeof(hostbuf),
                      NULL, 0, 0);
    lp = hostbuf;
  }
  if (!fgets(line, sizeof(line), stdin)) {
    if (logging)
      syslog(LOG_NOTICE, "query from %s", lp);
    exit(1);
  }
  while ((s = strrchr(line, '\n')) != NULL || (s = strrchr(line, '\r')) != NULL)
    *s = '\0';
  if (logging) {
    if (*line == '\0')
      syslog(LOG_NOTICE, "query from %s", lp);
    else
      syslog(LOG_NOTICE, "query from %s: %s", lp, line);
  }
  if (ac >= 50)
    my_err("Too many options provided");
  av[ac++] = __UNCONST("--");
  comp = &av[1];
  for (lp = line, ap = &av[ac]; ac < 50;) {
    if ((*ap = strtok(lp, " \t\r\n")) == NULL)
      break;
    lp = NULL;
    if (no_forward && strchr(*ap, '@')) {
      (void)puts("forwarding service denied\r\n");
      exit(1);
    }
    ch = strlen(*ap);
    while ((*ap)[ch - 1] == '@')
      (*ap)[--ch] = '\0';
    if (**ap == '\0')
      continue;
    if ((*ap)[0] == '/' && ((*ap)[1] == 'W' || (*ap)[1] == 'w')) {
      if (!short_list) {
        av[1] = __UNCONST("-l");
        comp = &av[0];
      }
    } else {
      ap++;
      ac++;
    }
  }
  av[50 - 1] = NULL;
  if ((lp = strrchr(prog, '/')))
    *comp = ++lp;
  else
    *comp = prog;
  if (user_required) {
    for (ap = comp + 1; strcmp("--", *(ap++));)
      ;
    if (*ap == NULL) {
      (void)puts("must provide username\r\n");
      exit(1);
    }
  }
  if (pipe(p) < 0)
    my_err("pipe: %s", strerror(errno));
  switch (fork()) {
  case 0:
    (void)close(p[0]);
    if (p[1] != 1) {
      (void)dup2(p[1], 1);
      (void)close(p[1]);
    }
    execv(prog, comp);
    my_err("execv: %s: %s", prog, strerror(errno));
    _exit(1);
  case -1:
    my_err("fork: %s", strerror(errno));
  }
  (void)close(p[1]);
  if (!(fp = fdopen(p[0], "r")))
    my_err("fdopen: %s", strerror(errno));
  while ((ch = getc(fp)) != EOF) {
    if (ch == '\n')
      putchar('\r');
    putchar(ch);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x650,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    0x2d19(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x630(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x618(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x628(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x620(%rbp)
lea    0xdfd(%rip),%rdi
call   1150 <__UNCONST@plt>
mov    %rax,-0x608(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    0x2c86(%rip),%rax
mov    (%rax),%esi
mov    0x2cad(%rip),%rax
mov    (%rax),%edx
lea    0xdcc(%rip),%rdi
call   1140 <openlog@plt>
mov    0x2c58(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdb3(%rip),%rdx
call   1130 <getopt@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
je     150d <main+0x27d>
mov    -0x1c(%rbp),%eax
add    $0xffffffc8,%eax
mov    %eax,%ecx
mov    %rcx,-0x638(%rbp)
sub    $0x3d,%eax
ja     14d9 <main+0x249>
mov    -0x638(%rbp),%rax
lea    0xc6c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x3c(%rbp)
jmp    14f0 <main+0x260>
mov    0x2c48(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x608(%rbp)
jmp    14f0 <main+0x260>
movl   $0x1,-0x40(%rbp)
jmp    14f0 <main+0x260>
movl   $0x1,-0x44(%rbp)
jmp    14f0 <main+0x260>
movl   $0x1,-0x48(%rbp)
lea    0xd37(%rip),%rdi
call   1150 <__UNCONST@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %rcx,-0x1f0(%rbp,%rax,8)
ff
jmp    14f0 <main+0x260>
lea    0xd11(%rip),%rdi
call   1150 <__UNCONST@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %rcx,-0x1f0(%rbp,%rax,8)
ff
jmp    14f0 <main+0x260>
lea    0xceb(%rip),%rdi
call   1150 <__UNCONST@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %rcx,-0x1f0(%rbp,%rax,8)
ff
jmp    14f0 <main+0x260>
lea    0xcc5(%rip),%rdi
call   1150 <__UNCONST@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %rcx,-0x1f0(%rbp,%rax,8)
ff
jmp    14f0 <main+0x260>
lea    0xc9f(%rip),%rdi
call   1150 <__UNCONST@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %rcx,-0x1f0(%rbp,%rax,8)
ff
jmp    14f0 <main+0x260>
lea    0xc79(%rip),%rdi
call   1150 <__UNCONST@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %rcx,-0x1f0(%rbp,%rax,8)
ff
jmp    14f0 <main+0x260>
jmp    14d9 <main+0x249>
mov    0x2ae8(%rip),%rax
mov    (%rax),%esi
lea    0xc45(%rip),%rdi
mov    $0x0,%al
call   1180 <my_err@plt>
cmpl   $0x32,-0x20(%rbp)
jl     1508 <main+0x278>
lea    0xc42(%rip),%rdi
mov    $0x0,%al
call   1180 <my_err@plt>
jmp    134f <main+0xbf>
cmpl   $0x0,-0x3c(%rbp)
je     1593 <main+0x303>
movl   $0x4,-0x4c(%rbp)
lea    -0x30(%rbp),%rsi
xor    %edi,%edi
lea    -0x4c(%rbp),%rdx
call   1060 <getpeername@plt>
cmp    $0x0,%rax
jge    1555 <main+0x2c5>
mov    0x2a6a(%rip),%rax
mov    (%rax),%edi
call   1170 <strerror@plt>
mov    %eax,%esi
lea    0xc0f(%rip),%rdi
mov    $0x0,%al
call   1180 <my_err@plt>
mov    -0x628(%rbp),%rdx
mov    -0x630(%rbp),%rax
lea    -0x30(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    %eax,%ecx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
sub    $0x10,%rsp
movl   $0x0,(%rsp)
call   10d0 <getnameinfo@plt>
add    $0x10,%rsp
mov    -0x628(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x600(%rbp),%rdi
mov    0x2a2f(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   10e0 <fgets@plt>
cmp    $0x0,%eax
jne    15e5 <main+0x355>
cmpl   $0x0,-0x3c(%rbp)
je     15db <main+0x34b>
mov    0x29d1(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
lea    0xb99(%rip),%rsi
mov    $0x0,%al
call   1100 <syslog@plt>
mov    $0x1,%edi
call   1160 <exit@plt>
jmp    15ea <main+0x35a>
lea    -0x600(%rbp),%rdi
mov    $0xa,%esi
call   10a0 <strrchr@plt>
mov    %rax,%rcx
mov    %rcx,-0x610(%rbp)
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x639(%rbp)
jne    163c <main+0x3ac>
lea    -0x600(%rbp),%rdi
mov    $0xd,%esi
call   10a0 <strrchr@plt>
mov    %rax,-0x610(%rbp)
cmp    $0x0,%rax
setne  %al
mov    %al,-0x639(%rbp)
mov    -0x639(%rbp),%al
test   $0x1,%al
jne    164f <main+0x3bf>
jmp    165e <main+0x3ce>
mov    -0x610(%rbp),%rax
movb   $0x0,(%rax)
jmp    15ea <main+0x35a>
cmpl   $0x0,-0x3c(%rbp)
je     16bf <main+0x42f>
movsbl -0x600(%rbp),%eax
cmp    $0x0,%eax
jne    1698 <main+0x408>
mov    0x2919(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
lea    0xae1(%rip),%rsi
mov    $0x0,%al
call   1100 <syslog@plt>
jmp    16ba <main+0x42a>
mov    0x28f9(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
lea    -0x600(%rbp),%rcx
lea    0xac8(%rip),%rsi
mov    $0x0,%al
call   1100 <syslog@plt>
jmp    16bf <main+0x42f>
cmpl   $0x32,-0x20(%rbp)
jl     16d7 <main+0x447>
lea    0xa73(%rip),%rdi
mov    $0x0,%al
call   1180 <my_err@plt>
lea    0xaaf(%rip),%rdi
call   1150 <__UNCONST@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %rcx,-0x1f0(%rbp,%rax,8)
ff
lea    -0x1f0(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x1f8(%rbp)
lea    -0x600(%rbp),%rax
mov    %rax,-0x28(%rbp)
movslq -0x20(%rbp),%rcx
lea    -0x1f0(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
cmpl   $0x32,-0x20(%rbp)
jge    1886 <main+0x5f6>
mov    -0x28(%rbp),%rdi
lea    0xa4d(%rip),%rsi
call   1120 <strtok@plt>
mov    -0x58(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    175e <main+0x4ce>
jmp    1886 <main+0x5f6>
movq   $0x0,-0x28(%rbp)
cmpl   $0x0,-0x40(%rbp)
je     17a1 <main+0x511>
mov    -0x58(%rbp),%rax
mov    (%rax),%rdi
mov    $0x40,%esi
call   1090 <strchr@plt>
cmp    $0x0,%rax
je     17a1 <main+0x511>
lea    0xa03(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   1160 <exit@plt>
mov    -0x58(%rbp),%rax
mov    (%rax),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x58(%rbp),%rax
mov    (%rax),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x40,%eax
jne    17e9 <main+0x559>
mov    -0x58(%rbp),%rax
mov    (%rax),%rax
mov    -0x1c(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    17b0 <main+0x520>
mov    -0x58(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1801 <main+0x571>
jmp    172e <main+0x49e>
mov    -0x58(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    186c <main+0x5dc>
mov    -0x58(%rbp),%rax
mov    (%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x57,%eax
je     183c <main+0x5ac>
mov    -0x58(%rbp),%rax
mov    (%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x77,%eax
jne    186c <main+0x5dc>
cmpl   $0x0,-0x48(%rbp)
jne    1867 <main+0x5d7>
lea    0x964(%rip),%rdi
call   1150 <__UNCONST@plt>
mov    %rax,-0x1e8(%rbp)
lea    -0x1f0(%rbp),%rax
mov    %rax,-0x1f8(%rbp)
jmp    1881 <main+0x5f1>
mov    -0x58(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x58(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    172e <main+0x49e>
movq   $0x0,-0x68(%rbp)
mov    -0x608(%rbp),%rdi
mov    $0x2f,%esi
call   10a0 <strrchr@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     18c8 <main+0x638>
mov    -0x28(%rbp),%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
mov    -0x1f8(%rbp),%rax
mov    %rcx,(%rax)
jmp    18d9 <main+0x649>
mov    -0x608(%rbp),%rcx
mov    -0x1f8(%rbp),%rax
mov    %rcx,(%rax)
cmpl   $0x0,-0x44(%rbp)
je     194a <main+0x6ba>
mov    -0x1f8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x58(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
lea    0x880(%rip),%rdi
call   10f0 <strcmp@plt>
cmp    $0x0,%rax
je     1921 <main+0x691>
jmp    18f2 <main+0x662>
mov    -0x58(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1945 <main+0x6b5>
lea    0x87e(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   1160 <exit@plt>
jmp    194a <main+0x6ba>
lea    -0x38(%rbp),%rdi
call   10c0 <pipe@plt>
cmp    $0x0,%rax
jge    197b <main+0x6eb>
mov    0x2644(%rip),%rax
mov    (%rax),%edi
call   1170 <strerror@plt>
mov    %eax,%esi
lea    0x858(%rip),%rdi
mov    $0x0,%al
call   1180 <my_err@plt>
xor    %eax,%eax
call   11b0 <fork@plt>
mov    %eax,%ecx
mov    %ecx,-0x640(%rbp)
sub    $0xffffffff,%eax
je     1a22 <main+0x792>
jmp    1998 <main+0x708>
mov    -0x640(%rbp),%eax
test   %eax,%eax
jne    1a40 <main+0x7b0>
jmp    19ab <main+0x71b>
mov    -0x38(%rbp),%edi
call   10b0 <close@plt>
cmpl   $0x1,-0x34(%rbp)
je     19d2 <main+0x742>
mov    -0x34(%rbp),%edi
mov    $0x1,%esi
call   1080 <dup2@plt>
mov    -0x34(%rbp),%edi
call   10b0 <close@plt>
mov    -0x608(%rbp),%rdi
mov    -0x1f8(%rbp),%rsi
call   11a0 <execv@plt>
mov    -0x608(%rbp),%rax
mov    %rax,-0x648(%rbp)
mov    0x25ae(%rip),%rax
mov    (%rax),%edi
call   1170 <strerror@plt>
mov    -0x648(%rbp),%rsi
mov    %eax,%edx
lea    0x7c4(%rip),%rdi
mov    $0x0,%al
call   1180 <my_err@plt>
mov    $0x1,%edi
call   1040 <_exit@plt>
mov    0x257f(%rip),%rax
mov    (%rax),%edi
call   1170 <strerror@plt>
mov    %eax,%esi
lea    0x7aa(%rip),%rdi
mov    $0x0,%al
call   1180 <my_err@plt>
mov    -0x34(%rbp),%edi
call   10b0 <close@plt>
mov    -0x38(%rbp),%edi
lea    0x6b4(%rip),%rsi
call   1110 <fdopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1a83 <main+0x7f3>
mov    0x253c(%rip),%rax
mov    (%rax),%edi
call   1170 <strerror@plt>
mov    %eax,%esi
lea    0x770(%rip),%rdi
mov    $0x0,%al
call   1180 <my_err@plt>
jmp    1a88 <main+0x7f8>
mov    -0x18(%rbp),%rdi
call   1190 <getc@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2525(%rip),%rcx
cmp    (%rcx),%eax
je     1ac4 <main+0x834>
cmpl   $0xa,-0x1c(%rbp)
jne    1ab7 <main+0x827>
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    -0x1c(%rbp),%edi
call   1030 <putchar@plt>
jmp    1a88 <main+0x7f8>
xor    %edi,%edi
call   1160 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x5d8,%rsp
mov    %rsi,-0x68(%rbp)
mov    %edi,%ebx
mov    0x2d27(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rax,-0x58(%rbp)
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
lea    0xe25(%rip),%rdi
call   1150 <__UNCONST@plt>
mov    %rax,-0x50(%rbp)
mov    0x2ccd(%rip),%rax
mov    (%rax),%esi
mov    0x2cf4(%rip),%rax
mov    (%rax),%edx
lea    0xe13(%rip),%rdi
call   1140 <openlog@plt>
mov    0x2c9f(%rip),%rax
movq   $0x0,(%rax)
mov    $0x2,%r14d
lea    0xceb(%rip),%r15
xor    %r12d,%r12d
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
nopl   (%rax)
mov    %r12d,%r13d
mov    %ebx,%edi
mov    -0x68(%rbp),%rsi
lea    0xdd0(%rip),%rdx
call   1130 <getopt@plt>
lea    -0x38(%rax),%ecx
cmp    $0x3d,%ecx
ja     1406 <main+0x176>
mov    $0x1,%r12d
movslq (%r15,%rcx,4),%rax
add    %r15,%rax
jmp    *%rax
lea    0xdc4(%rip),%rdi
jmp    13c0 <main+0x130>
lea    0xdb8(%rip),%rdi
jmp    13c0 <main+0x130>
lea    0xda9(%rip),%rdi
jmp    13c0 <main+0x130>
mov    0x2c76(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
jmp    13d4 <main+0x144>
lea    0xd8a(%rip),%rdi
call   1150 <__UNCONST@plt>
movslq %r14d,%rcx
add    $0x1,%r14d
mov    %rax,-0x200(%rbp,%rcx,8)
ff
movl   $0x1,-0x30(%rbp)
jmp    13d4 <main+0x144>
lea    0xd69(%rip),%rdi
jmp    13c0 <main+0x130>
lea    0xd66(%rip),%rdi
nop
call   1150 <__UNCONST@plt>
movslq %r14d,%rcx
add    $0x1,%r14d
mov    %rax,-0x200(%rbp,%rcx,8)
ff
mov    %r13d,%r12d
cmp    $0x32,%r14d
jl     1330 <main+0xa0>
lea    0xd5b(%rip),%rdi
xor    %eax,%eax
call   1180 <my_err@plt>
jmp    1330 <main+0xa0>
movl   $0x1,-0x34(%rbp)
jmp    13d4 <main+0x144>
movl   $0x1,-0x2c(%rbp)
jmp    13d4 <main+0x144>
cmp    $0xffffffff,%eax
je     1424 <main+0x194>
mov    0x2bb6(%rip),%rax
mov    (%rax),%esi
lea    0xd13(%rip),%rdi
xor    %eax,%eax
call   1180 <my_err@plt>
jmp    13d4 <main+0x144>
test   %r13d,%r13d
jne    1453 <main+0x1c3>
mov    0x2ba0(%rip),%rax
mov    (%rax),%edx
lea    -0x600(%rbp),%rdi
mov    $0x400,%esi
call   10e0 <fgets@plt>
test   %eax,%eax
je     14eb <main+0x25b>
xor    %r15d,%r15d
jmp    14f5 <main+0x265>
movl   $0x4,-0x38(%rbp)
lea    -0x48(%rbp),%rsi
lea    -0x38(%rbp),%rdx
xor    %edi,%edi
call   1060 <getpeername@plt>
test   %rax,%rax
jns    148c <main+0x1fc>
mov    0x2b33(%rip),%rax
mov    (%rax),%edi
call   1170 <strerror@plt>
lea    0xcda(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1180 <my_err@plt>
mov    -0x38(%rbp),%esi
sub    $0x8,%rsp
lea    -0x48(%rbp),%rdi
mov    -0x60(%rbp),%r15
mov    %r15,%rdx
mov    -0x58(%rbp),%rcx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
call   10d0 <getnameinfo@plt>
add    $0x10,%rsp
mov    0x2b16(%rip),%rax
mov    (%rax),%edx
lea    -0x600(%rbp),%rdi
mov    $0x400,%esi
call   10e0 <fgets@plt>
test   %eax,%eax
jne    14f5 <main+0x265>
mov    0x2ac0(%rip),%rax
mov    (%rax),%edi
lea    0xc8c(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1100 <syslog@plt>
mov    $0x1,%edi
call   1160 <exit@plt>
lea    -0x600(%rbp),%rbx
jmp    1503 <main+0x273>
xchg   %ax,%ax
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    $0xa,%esi
call   10a0 <strrchr@plt>
test   %rax,%rax
jne    1500 <main+0x270>
mov    %rbx,%rdi
mov    $0xd,%esi
call   10a0 <strrchr@plt>
test   %rax,%rax
jne    1500 <main+0x270>
test   %r13d,%r13d
je     1553 <main+0x2c3>
cmpb   $0x0,-0x600(%rbp)
mov    0x2a5e(%rip),%rax
mov    (%rax),%edi
jne    1781 <main+0x4f1>
lea    0xc24(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1100 <syslog@plt>
cmp    $0x32,%r14d
jl     1567 <main+0x2d7>
lea    0xbe3(%rip),%rdi
xor    %eax,%eax
call   1180 <my_err@plt>
lea    0xc1f(%rip),%rdi
call   1150 <__UNCONST@plt>
movslq %r14d,%rcx
mov    %rax,-0x200(%rbp,%rcx,8)
ff
lea    -0x1f8(%rbp),%r13
cmp    $0x30,%r14d
jg     167f <main+0x3ef>
add    $0x1,%r14d
movslq %r14d,%rax
lea    -0x200(,%rax,8),%r15
ff
add    %rbp,%r15
lea    0xbe8(%rip),%r12
jmp    15bb <main+0x32b>
nopw   0x0(%rax,%rax,1)
mov    (%rcx),%al
mov    $0x0,%ebx
test   %al,%al
jne    1639 <main+0x3a9>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1120 <strtok@plt>
mov    %rax,(%r15)
test   %rax,%rax
je     167f <main+0x3ef>
cmpl   $0x0,-0x34(%rbp)
je     15f1 <main+0x361>
mov    %rax,%rdi
mov    $0x40,%esi
call   1090 <strchr@plt>
test   %rax,%rax
jne    1857 <main+0x5c7>
mov    (%r15),%rax
mov    %rax,%rdi
call   1070 <strlen@plt>
mov    (%r15),%rcx
cltq
cmpb   $0x40,-0x1(%rcx,%rax,1)
jne    15b0 <main+0x320>
lea    (%rcx,%rax,1),%rdx
add    $0xffffffffffffffff,%rdx
add    $0xffffffffffffffff,%rax
add    $0xffffffffffffffff,%rax
cs nopw 0x0(%rax,%rax,1)
nop
movb   $0x0,(%rdx)
mov    (%r15),%rcx
lea    (%rcx,%rax,1),%rdx
cmpb   $0x40,(%rcx,%rax,1)
lea    -0x1(%rax),%rax
je     1620 <main+0x390>
jmp    15b0 <main+0x320>
cmp    $0x2f,%al
jne    1668 <main+0x3d8>
mov    0x1(%rcx),%al
or     $0x20,%al
cmp    $0x77,%al
jne    1668 <main+0x3d8>
cmpl   $0x0,-0x30(%rbp)
jne    1670 <main+0x3e0>
lea    0xb5e(%rip),%rdi
call   1150 <__UNCONST@plt>
mov    %rax,-0x1f8(%rbp)
lea    -0x200(%rbp),%r13
jmp    1670 <main+0x3e0>
add    $0x8,%r15
add    $0x1,%r14d
mov    $0x0,%ebx
cmp    $0x32,%r14d
jl     15bb <main+0x32b>
movq   $0x0,-0x78(%rbp)
mov    -0x50(%rbp),%r15
mov    %r15,%rdi
mov    $0x2f,%esi
call   10a0 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %r15,%rcx
mov    %rcx,0x0(%r13)
cmpl   $0x0,-0x2c(%rbp)
je     16e5 <main+0x455>
lea    0x8(%r13),%rbx
lea    0xad5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%esi
add    $0x8,%rbx
mov    %r14,%rdi
call   10f0 <strcmp@plt>
test   %rax,%rax
jne    16c0 <main+0x430>
cmpq   $0x0,(%rbx)
jne    16e5 <main+0x455>
lea    0xad4(%rip),%rdi
jmp    185e <main+0x5ce>
lea    -0x40(%rbp),%rdi
call   10c0 <pipe@plt>
test   %rax,%rax
jns    1711 <main+0x481>
mov    0x28ae(%rip),%rax
mov    (%rax),%edi
call   1170 <strerror@plt>
lea    0xac4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1180 <my_err@plt>
xor    %eax,%eax
call   11b0 <fork@plt>
cmp    $0xffffffff,%eax
je     17a8 <main+0x518>
test   %eax,%eax
jne    17c6 <main+0x536>
mov    -0x40(%rbp),%edi
call   10b0 <close@plt>
mov    -0x3c(%rbp),%edi
cmp    $0x1,%edi
je     174b <main+0x4bb>
mov    $0x1,%esi
call   1080 <dup2@plt>
mov    -0x3c(%rbp),%edi
call   10b0 <close@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   11a0 <execv@plt>
mov    0x284b(%rip),%rax
mov    (%rax),%edi
call   1170 <strerror@plt>
lea    0xa6a(%rip),%rdi
mov    %r15,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1180 <my_err@plt>
mov    $0x1,%edi
call   1040 <_exit@plt>
lea    0x9f3(%rip),%rsi
lea    -0x600(%rbp),%rcx
mov    %r15,%rdx
xor    %eax,%eax
call   1100 <syslog@plt>
cmp    $0x32,%r14d
jge    1559 <main+0x2c9>
jmp    1567 <main+0x2d7>
mov    0x27f9(%rip),%rax
mov    (%rax),%edi
call   1170 <strerror@plt>
lea    0xa26(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1180 <my_err@plt>
mov    -0x3c(%rbp),%edi
call   10b0 <close@plt>
mov    -0x40(%rbp),%edi
lea    0x92e(%rip),%rsi
call   1110 <fdopen@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1803 <main+0x573>
mov    0x27bc(%rip),%rax
mov    (%rax),%edi
call   1170 <strerror@plt>
lea    0x9f2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1180 <my_err@plt>
mov    %r14,%rdi
call   1190 <getc@plt>
mov    0x27ae(%rip),%r15
cmp    (%r15),%eax
jne    181e <main+0x58e>
xor    %edi,%edi
call   1160 <exit@plt>
mov    %eax,%ebx
jmp    1846 <main+0x5b6>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
call   1190 <getc@plt>
mov    %eax,%ebx
cmp    (%r15),%eax
je     1817 <main+0x587>
cmp    $0xa,%ebx
jne    1830 <main+0x5a0>
mov    $0xd,%edi
call   1030 <putchar@plt>
jmp    1830 <main+0x5a0>
lea    0x937(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   1160 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
@MAXHOSTNAMELEN = global i32 0
@.str = [16 x i8] c"/usr/bin/finger\00"
@.str.1 = [8 x i8] c"fingerd\00"
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
@opterr = global i64 0
@.str.2 = [12 x i8] c"gsluShmpP:8\00"
@optarg = global i8* null
@.str.3 = [3 x i8] c"-s\00"
@.str.4 = [3 x i8] c"-h\00"
@.str.5 = [3 x i8] c"-m\00"
@.str.6 = [3 x i8] c"-p\00"
@.str.7 = [3 x i8] c"-g\00"
@.str.8 = [3 x i8] c"-8\00"
@.str.9 = [21 x i8] c"illegal option -- %c\00"
@optopt = global i32 0
@.str.10 = [26 x i8] c"Too many options provided\00"
@.str.11 = [16 x i8] c"getpeername: %s\00"
@errno = global i32 0
@stdin = global i32 0
@LOG_NOTICE = global i32 0
@.str.12 = [14 x i8] c"query from %s\00"
@.str.13 = [18 x i8] c"query from %s: %s\00"
@.str.14 = [3 x i8] c"--\00"
@.str.15 = [5 x i8] c" \09\0D\0A\00"
@.str.16 = [28 x i8] c"forwarding service denied\0D\0A\00"
@.str.17 = [3 x i8] c"-l\00"
@.str.18 = [24 x i8] c"must provide username\0D\0A\00"
@.str.19 = [9 x i8] c"pipe: %s\00"
@.str.20 = [14 x i8] c"execv: %s: %s\00"
@.str.21 = [9 x i8] c"fork: %s\00"
@.str.22 = [2 x i8] c"r\00"
@.str.23 = [11 x i8] c"fdopen: %s\00"
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca %struct.sockaddr_storage
%11 = alloca [2 x i32]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8**
%18 = alloca [51 x i8*]
%19 = alloca i8**
%20 = alloca [1024 x i8]
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2, i32* %8
store i8* null, i8** %9
%25 = load i32, i32* @MAXHOSTNAMELEN
%26 = zext i32 %25 to i64
%27 = call i8* @llvm.stacksave()
store i8* %27, i8** %23
%28 = alloca i8, i64 %26
store i64 %26, i64* %24
%29 = call i8* @__UNCONST(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i8* %29, i8** %21
store i32 0, i32* %15
store i32 0, i32* %14
store i32 0, i32* %13
store i32 0, i32* %12
%30 = load i32, i32* @LOG_PID
%31 = load i32, i32* @LOG_DAEMON
%32 = call i32 @openlog(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %30, i32 %31)
store i64 0, i64* @opterr
br label %33
33: ; preds = %90, %2
%34 = load i32, i32* %4
%35 = load i8**, i8*** %5
%36 = call i32 @getopt(i32 %34, i8** %35, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
store i32 %36, i32* %7
%37 = icmp ne i32 %36, -1
br i1 %37, label %38, label %91
38: ; preds = %33
%39 = load i32, i32* %7
switch i32 %39, label %82 [
i32 108, label %40
i32 80, label %41
i32 115, label %43
i32 117, label %44
i32 83, label %45
i32 104, label %51
i32 109, label %57
i32 112, label %63
i32 103, label %69
i32 56, label %75
i32 63, label %81
]
40: ; preds = %38
store i32 1, i32* %12
br label %85
41: ; preds = %38
%42 = load i8*, i8** @optarg
store i8* %42, i8** %21
br label %85
43: ; preds = %38
store i32 1, i32* %13
br label %85
44: ; preds = %38
store i32 1, i32* %14
br label %85
45: ; preds = %38
store i32 1, i32* %15
%46 = call i8* @__UNCONST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%47 = load i32, i32* %8
%48 = add nsw i32 %47, 1
store i32 %48, i32* %8
%49 = sext i32 %47 to i64
%50 = getelementptr inbounds [51 x i8*], [51 x i8*]* %18, i64 0, i64 %49
store i8* %46, i8** %50
br label %85
51: ; preds = %38
%52 = call i8* @__UNCONST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%53 = load i32, i32* %8
%54 = add nsw i32 %53, 1
store i32 %54, i32* %8
%55 = sext i32 %53 to i64
%56 = getelementptr inbounds [51 x i8*], [51 x i8*]* %18, i64 0, i64 %55
store i8* %52, i8** %56
br label %85
57: ; preds = %38
%58 = call i8* @__UNCONST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%59 = load i32, i32* %8
%60 = add nsw i32 %59, 1
store i32 %60, i32* %8
%61 = sext i32 %59 to i64
%62 = getelementptr inbounds [51 x i8*], [51 x i8*]* %18, i64 0, i64 %61
store i8* %58, i8** %62
br label %85
63: ; preds = %38
%64 = call i8* @__UNCONST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%65 = load i32, i32* %8
%66 = add nsw i32 %65, 1
store i32 %66, i32* %8
%67 = sext i32 %65 to i64
%68 = getelementptr inbounds [51 x i8*], [51 x i8*]* %18, i64 0, i64 %67
store i8* %64, i8** %68
br label %85
69: ; preds = %38
%70 = call i8* @__UNCONST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%71 = load i32, i32* %8
%72 = add nsw i32 %71, 1
store i32 %72, i32* %8
%73 = sext i32 %71 to i64
%74 = getelementptr inbounds [51 x i8*], [51 x i8*]* %18, i64 0, i64 %73
store i8* %70, i8** %74
br label %85
75: ; preds = %38
%76 = call i8* @__UNCONST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%77 = load i32, i32* %8
%78 = add nsw i32 %77, 1
store i32 %78, i32* %8
%79 = sext i32 %77 to i64
%80 = getelementptr inbounds [51 x i8*], [51 x i8*]* %18, i64 0, i64 %79
store i8* %76, i8** %80
br label %85
81: ; preds = %38
br label %82
82: ; preds = %38, %81
%83 = load i32, i32* @optopt
%84 = call i32 (i8*, ...) @my_err(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %83)
br label %85
85: ; preds = %82, %75, %69, %63, %57, %51, %45, %44, %43, %41, %40
%86 = load i32, i32* %8
%87 = icmp sge i32 %86, 50
br i1 %87, label %88, label %90
88: ; preds = %85
%89 = call i32 (i8*, ...) @my_err(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0))
br label %90
90: ; preds = %88, %85
br label %33
91: ; preds = %33
%92 = load i32, i32* %12
%93 = icmp ne i32 %92, 0
br i1 %93, label %94, label %107
94: ; preds = %91
store i32 4, i32* %16
%95 = bitcast %struct.sockaddr_storage* %10 to %struct.sockaddr*
%96 = call i64 @getpeername(i32 0, %struct.sockaddr* %95, i32* %16)
%97 = icmp slt i64 %96, 0
br i1 %97, label %98, label %102
98: ; preds = %94
%99 = load i32, i32* @errno
%100 = call i32 @strerror(i32 %99)
%101 = call i32 (i8*, ...) @my_err(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i32 %100)
br label %102
102: ; preds = %98, %94
%103 = bitcast %struct.sockaddr_storage* %10 to %struct.sockaddr*
%104 = load i32, i32* %16
%105 = trunc i64 %26 to i32
%106 = call i32 @getnameinfo(%struct.sockaddr* %103, i32 %104, i8* %28, i32 %105, i32* null, i32 0, i32 0)
store i8* %28, i8** %9
br label %107
107: ; preds = %102, %91
%108 = getelementptr inbounds [1024 x i8], [1024 x i8]* %20, i64 0, i64 0
%109 = load i32, i32* @stdin
%110 = call i32 @fgets(i8* %108, i32 1024, i32 %109)
%111 = icmp ne i32 %110, 0
br i1 %111, label %121, label %112
112: ; preds = %107
%113 = load i32, i32* %12
%114 = icmp ne i32 %113, 0
br i1 %114, label %115, label %119
115: ; preds = %112
%116 = load i32, i32* @LOG_NOTICE
%117 = load i8*, i8** %9
%118 = call i32 (i32, i8*, i8*, ...) @syslog(i32 %116, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i8* %117)
br label %119
119: ; preds = %115, %112
%120 = call i32 @exit(i32 1)
unreachable
121: ; preds = %107
br label %122
122: ; preds = %132, %121
%123 = getelementptr inbounds [1024 x i8], [1024 x i8]* %20, i64 0, i64 0
%124 = call i8* @strrchr(i8* %123, i8 signext 10)
store i8* %124, i8** %22
%125 = icmp ne i8* %124, null
br i1 %125, label %130, label %126
126: ; preds = %122
%127 = getelementptr inbounds [1024 x i8], [1024 x i8]* %20, i64 0, i64 0
%128 = call i8* @strrchr(i8* %127, i8 signext 13)
store i8* %128, i8** %22
%129 = icmp ne i8* %128, null
br label %130
130: ; preds = %126, %122
%131 = phi i1 [ true, %122 ], [ %129, %126 ]
br i1 %131, label %132, label %134
132: ; preds = %130
%133 = load i8*, i8** %22
store i8 0, i8* %133
br label %122
134: ; preds = %130
%135 = load i32, i32* %12
%136 = icmp ne i32 %135, 0
br i1 %136, label %137, label %152
137: ; preds = %134
%138 = getelementptr inbounds [1024 x i8], [1024 x i8]* %20, i64 0, i64 0
%139 = load i8, i8* %138
%140 = sext i8 %139 to i32
%141 = icmp eq i32 %140, 0
br i1 %141, label %142, label %146
142: ; preds = %137
%143 = load i32, i32* @LOG_NOTICE
%144 = load i8*, i8** %9
%145 = call i32 (i32, i8*, i8*, ...) @syslog(i32 %143, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i8* %144)
br label %151
146: ; preds = %137
%147 = load i32, i32* @LOG_NOTICE
%148 = load i8*, i8** %9
%149 = getelementptr inbounds [1024 x i8], [1024 x i8]* %20, i64 0, i64 0
%150 = call i32 (i32, i8*, i8*, ...) @syslog(i32 %147, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i8* %148, i8* %149)
br label %151
151: ; preds = %146, %142
br label %152
152: ; preds = %151, %134
%153 = load i32, i32* %8
%154 = icmp sge i32 %153, 50
br i1 %154, label %155, label %157
155: ; preds = %152
%156 = call i32 (i8*, ...) @my_err(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0))
br label %157
157: ; preds = %155, %152
%158 = call i8* @__UNCONST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%159 = load i32, i32* %8
%160 = add nsw i32 %159, 1
store i32 %160, i32* %8
%161 = sext i32 %159 to i64
%162 = getelementptr inbounds [51 x i8*], [51 x i8*]* %18, i64 0, i64 %161
store i8* %158, i8** %162
%163 = getelementptr inbounds [51 x i8*], [51 x i8*]* %18, i64 0, i64 1
store i8** %163, i8*** %19
%164 = getelementptr inbounds [1024 x i8], [1024 x i8]* %20, i64 0, i64 0
store i8* %164, i8** %9
%165 = load i32, i32* %8
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds [51 x i8*], [51 x i8*]* %18, i64 0, i64 %166
store i8** %167, i8*** %17
br label %168
168: ; preds = %250, %215, %157
%169 = load i32, i32* %8
%170 = icmp slt i32 %169, 50
br i1 %170, label %171, label %251
171: ; preds = %168
%172 = load i8*, i8** %9
%173 = call i8* @strtok(i8* %172, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%174 = load i8**, i8*** %17
store i8* %173, i8** %174
%175 = icmp eq i8* %173, null
br i1 %175, label %176, label %177
176: ; preds = %171
br label %251
177: ; preds = %171
store i8* null, i8** %9
%178 = load i32, i32* %13
%179 = icmp ne i32 %178, 0
br i1 %179, label %180, label %188
180: ; preds = %177
%181 = load i8**, i8*** %17
%182 = load i8*, i8** %181
%183 = call i64 @strchr(i8* %182, i8 signext 64)
%184 = icmp ne i64 %183, 0
br i1 %184, label %185, label %188
185: ; preds = %180
%186 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0))
%187 = call i32 @exit(i32 1)
unreachable
188: ; preds = %180, %177
%189 = load i8**, i8*** %17
%190 = load i8*, i8** %189
%191 = call i32 @strlen(i8* %190)
store i32 %191, i32* %7
br label %192
192: ; preds = %202, %188
%193 = load i8**, i8*** %17
%194 = load i8*, i8** %193
%195 = load i32, i32* %7
%196 = sub nsw i32 %195, 1
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds i8, i8* %194, i64 %197
%199 = load i8, i8* %198
%200 = sext i8 %199 to i32
%201 = icmp eq i32 %200, 64
br i1 %201, label %202, label %209
202: ; preds = %192
%203 = load i8**, i8*** %17
%204 = load i8*, i8** %203
%205 = load i32, i32* %7
%206 = add nsw i32 %205, -1
store i32 %206, i32* %7
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds i8, i8* %204, i64 %207
store i8 0, i8* %208
br label %192
209: ; preds = %192
%210 = load i8**, i8*** %17
%211 = load i8*, i8** %210
%212 = load i8, i8* %211
%213 = sext i8 %212 to i32
%214 = icmp eq i32 %213, 0
br i1 %214, label %215, label %216
215: ; preds = %209
br label %168
216: ; preds = %209
%217 = load i8**, i8*** %17
%218 = load i8*, i8** %217
%219 = getelementptr inbounds i8, i8* %218, i64 0
%220 = load i8, i8* %219
%221 = sext i8 %220 to i32
%222 = icmp eq i32 %221, 47
br i1 %222, label %223, label %245
223: ; preds = %216
%224 = load i8**, i8*** %17
%225 = load i8*, i8** %224
%226 = getelementptr inbounds i8, i8* %225, i64 1
%227 = load i8, i8* %226
%228 = sext i8 %227 to i32
%229 = icmp eq i32 %228, 87
br i1 %229, label %237, label %230
230: ; preds = %223
%231 = load i8**, i8*** %17
%232 = load i8*, i8** %231
%233 = getelementptr inbounds i8, i8* %232, i64 1
%234 = load i8, i8* %233
%235 = sext i8 %234 to i32
%236 = icmp eq i32 %235, 119
br i1 %236, label %237, label %245
237: ; preds = %230, %223
%238 = load i32, i32* %15
%239 = icmp ne i32 %238, 0
br i1 %239, label %244, label %240
240: ; preds = %237
%241 = call i8* @__UNCONST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
%242 = getelementptr inbounds [51 x i8*], [51 x i8*]* %18, i64 0, i64 1
store i8* %241, i8** %242
%243 = getelementptr inbounds [51 x i8*], [51 x i8*]* %18, i64 0, i64 0
store i8** %243, i8*** %19
br label %244
244: ; preds = %240, %237
br label %250
245: ; preds = %230, %216
%246 = load i8**, i8*** %17
%247 = getelementptr inbounds i8*, i8** %246, i32 1
store i8** %247, i8*** %17
%248 = load i32, i32* %8
%249 = add nsw i32 %248, 1
store i32 %249, i32* %8
br label %250
250: ; preds = %245, %244
br label %168
251: ; preds = %176, %168
%252 = getelementptr inbounds [51 x i8*], [51 x i8*]* %18, i64 0, i64 49
store i8* null, i8** %252
%253 = load i8*, i8** %21
%254 = call i8* @strrchr(i8* %253, i8 signext 47)
store i8* %254, i8** %9
%255 = icmp ne i8* %254, null
br i1 %255, label %256, label %260
256: ; preds = %251
%257 = load i8*, i8** %9
%258 = getelementptr inbounds i8, i8* %257, i32 1
store i8* %258, i8** %9
%259 = load i8**, i8*** %19
store i8* %258, i8** %259
br label %263
260: ; preds = %251
%261 = load i8*, i8** %21
%262 = load i8**, i8*** %19
store i8* %261, i8** %262
br label %263
263: ; preds = %260, %256
%264 = load i32, i32* %14
%265 = icmp ne i32 %264, 0
br i1 %265, label %266, label %285
266: ; preds = %263
%267 = load i8**, i8*** %19
%268 = getelementptr inbounds i8*, i8** %267, i64 1
store i8** %268, i8*** %17
br label %269
269: ; preds = %276, %266
%270 = load i8**, i8*** %17
%271 = getelementptr inbounds i8*, i8** %270, i32 1
store i8** %271, i8*** %17
%272 = load i8*, i8** %270
%273 = ptrtoint i8* %272 to i32
%274 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32 %273)
%275 = icmp ne i64 %274, 0
br i1 %275, label %276, label %277
276: ; preds = %269
br label %269
277: ; preds = %269
%278 = load i8**, i8*** %17
%279 = load i8*, i8** %278
%280 = icmp eq i8* %279, null
br i1 %280, label %281, label %284
281: ; preds = %277
%282 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.18, i64 0, i64 0))
%283 = call i32 @exit(i32 1)
unreachable
284: ; preds = %277
br label %285
285: ; preds = %284, %263
%286 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%287 = call i64 @pipe(i32* %286)
%288 = icmp slt i64 %287, 0
br i1 %288, label %289, label %293
289: ; preds = %285
%290 = load i32, i32* @errno
%291 = call i32 @strerror(i32 %290)
%292 = call i32 (i8*, ...) @my_err(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0), i32 %291)
br label %293
293: ; preds = %289, %285
%294 = call i32 (...) @fork()
switch i32 %294, label %322 [
i32 0, label %295
i32 -1, label %318
]
295: ; preds = %293
%296 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%297 = load i32, i32* %296
%298 = call i32 @close(i32 %297)
%299 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%300 = load i32, i32* %299
%301 = icmp ne i32 %300, 1
br i1 %301, label %302, label %309
302: ; preds = %295
%303 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%304 = load i32, i32* %303
%305 = call i32 @dup2(i32 %304, i32 1)
%306 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%307 = load i32, i32* %306
%308 = call i32 @close(i32 %307)
br label %309
309: ; preds = %302, %295
%310 = load i8*, i8** %21
%311 = load i8**, i8*** %19
%312 = call i32 @execv(i8* %310, i8** %311)
%313 = load i8*, i8** %21
%314 = load i32, i32* @errno
%315 = call i32 @strerror(i32 %314)
%316 = call i32 (i8*, ...) @my_err(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.20, i64 0, i64 0), i8* %313, i32 %315)
%317 = call i32 @_exit(i32 1)
unreachable
318: ; preds = %293
%319 = load i32, i32* @errno
%320 = call i32 @strerror(i32 %319)
%321 = call i32 (i8*, ...) @my_err(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0), i32 %320)
br label %322
322: ; preds = %318, %293
%323 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%324 = load i32, i32* %323
%325 = call i32 @close(i32 %324)
%326 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%327 = load i32, i32* %326
%328 = call i32* @fdopen(i32 %327, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i64 0, i64 0))
store i32* %328, i32** %6
%329 = icmp ne i32* %328, null
br i1 %329, label %334, label %330
330: ; preds = %322
%331 = load i32, i32* @errno
%332 = call i32 @strerror(i32 %331)
%333 = call i32 (i8*, ...) @my_err(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.23, i64 0, i64 0), i32 %332)
br label %334
334: ; preds = %330, %322
br label %335
335: ; preds = %345, %334
%336 = load i32*, i32** %6
%337 = call i32 @getc(i32* %336)
store i32 %337, i32* %7
%338 = load i32, i32* @EOF
%339 = icmp ne i32 %337, %338
br i1 %339, label %340, label %348
340: ; preds = %335
%341 = load i32, i32* %7
%342 = icmp eq i32 %341, 10
br i1 %342, label %343, label %345
343: ; preds = %340
%344 = call i32 @putchar(i32 13)
br label %345
345: ; preds = %343, %340
%346 = load i32, i32* %7
%347 = call i32 @putchar(i32 %346)
br label %335
348: ; preds = %335
%349 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
@MAXHOSTNAMELEN = global i32 0
@.str = [16 x i8] c"/usr/bin/finger\00"
@.str.1 = [8 x i8] c"fingerd\00"
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
@opterr = global i64 0
@.str.2 = [12 x i8] c"gsluShmpP:8\00"
@optarg = global i8* null
@.str.3 = [3 x i8] c"-s\00"
@.str.4 = [3 x i8] c"-h\00"
@.str.5 = [3 x i8] c"-m\00"
@.str.6 = [3 x i8] c"-p\00"
@.str.7 = [3 x i8] c"-g\00"
@.str.8 = [3 x i8] c"-8\00"
@.str.9 = [21 x i8] c"illegal option -- %c\00"
@optopt = global i32 0
@.str.10 = [26 x i8] c"Too many options provided\00"
@.str.11 = [16 x i8] c"getpeername: %s\00"
@errno = global i32 0
@stdin = global i32 0
@LOG_NOTICE = global i32 0
@.str.12 = [14 x i8] c"query from %s\00"
@.str.13 = [18 x i8] c"query from %s: %s\00"
@.str.14 = [3 x i8] c"--\00"
@.str.15 = [5 x i8] c" \09\0D\0A\00"
@.str.16 = [28 x i8] c"forwarding service denied\0D\0A\00"
@.str.17 = [3 x i8] c"-l\00"
@.str.18 = [24 x i8] c"must provide username\0D\0A\00"
@.str.19 = [9 x i8] c"pipe: %s\00"
@.str.20 = [14 x i8] c"execv: %s: %s\00"
@.str.21 = [9 x i8] c"fork: %s\00"
@.str.22 = [2 x i8] c"r\00"
@.str.23 = [11 x i8] c"fdopen: %s\00"
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.sockaddr_storage
%4 = alloca [2 x i32]
%5 = alloca i32
%6 = alloca [51 x i8*]
%7 = alloca [1024 x i8]
%8 = bitcast %struct.sockaddr_storage* %3 to i8*
%9 = bitcast [2 x i32]* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast [51 x i8*]* %6 to i8*
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%13 = load i32, i32* @MAXHOSTNAMELEN
%14 = zext i32 %13 to i64
%15 = alloca i8, i64 %14
%16 = tail call i8* @__UNCONST(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* @LOG_PID
%18 = load i32, i32* @LOG_DAEMON
%19 = tail call i32 @openlog(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %17, i32 %18)
store i64 0, i64* @opterr
br label %20
20: ; preds = %75, %2
%21 = phi i32 [ 0, %2 ], [ %66, %75 ]
%22 = phi i32 [ 0, %2 ], [ %67, %75 ]
%23 = phi i32 [ 0, %2 ], [ %68, %75 ]
%24 = phi i32 [ 0, %2 ], [ %69, %75 ]
%25 = phi i8* [ %16, %2 ], [ %70, %75 ]
%26 = phi i32 [ 2, %2 ], [ %71, %75 ]
%27 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
switch i32 %27, label %62 [
i32 -1, label %76
i32 108, label %65
i32 80, label %28
i32 115, label %30
i32 117, label %31
i32 83, label %32
i32 104, label %37
i32 109, label %42
i32 112, label %47
i32 103, label %52
i32 56, label %57
]
28: ; preds = %20
%29 = load i8*, i8** @optarg
br label %65
30: ; preds = %20
br label %65
31: ; preds = %20
br label %65
32: ; preds = %20
%33 = tail call i8* @__UNCONST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%34 = add nsw i32 %26, 1
%35 = sext i32 %26 to i64
%36 = getelementptr inbounds [51 x i8*], [51 x i8*]* %6, i64 0, i64 %35
store i8* %33, i8** %36
br label %65
37: ; preds = %20
%38 = tail call i8* @__UNCONST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%39 = add nsw i32 %26, 1
%40 = sext i32 %26 to i64
%41 = getelementptr inbounds [51 x i8*], [51 x i8*]* %6, i64 0, i64 %40
store i8* %38, i8** %41
br label %65
42: ; preds = %20
%43 = tail call i8* @__UNCONST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%44 = add nsw i32 %26, 1
%45 = sext i32 %26 to i64
%46 = getelementptr inbounds [51 x i8*], [51 x i8*]* %6, i64 0, i64 %45
store i8* %43, i8** %46
br label %65
47: ; preds = %20
%48 = tail call i8* @__UNCONST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%49 = add nsw i32 %26, 1
%50 = sext i32 %26 to i64
%51 = getelementptr inbounds [51 x i8*], [51 x i8*]* %6, i64 0, i64 %50
store i8* %48, i8** %51
br label %65
52: ; preds = %20
%53 = tail call i8* @__UNCONST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%54 = add nsw i32 %26, 1
%55 = sext i32 %26 to i64
%56 = getelementptr inbounds [51 x i8*], [51 x i8*]* %6, i64 0, i64 %55
store i8* %53, i8** %56
br label %65
57: ; preds = %20
%58 = tail call i8* @__UNCONST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%59 = add nsw i32 %26, 1
%60 = sext i32 %26 to i64
%61 = getelementptr inbounds [51 x i8*], [51 x i8*]* %6, i64 0, i64 %60
store i8* %58, i8** %61
br label %65
62: ; preds = %20
%63 = load i32, i32* @optopt
%64 = tail call i32 (i8*, ...) @my_err(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %63)
br label %65
65: ; preds = %20, %62, %57, %52, %47, %42, %37, %32, %31, %30, %28
%66 = phi i32 [ %21, %62 ], [ %21, %57 ], [ %21, %52 ], [ %21, %47 ], [ %21, %42 ], [ %21, %37 ], [ %21, %32 ], [ %21, %31 ], [ %21, %30 ], [ %21, %28 ], [ 1, %20 ]
%67 = phi i32 [ %22, %62 ], [ %22, %57 ], [ %22, %52 ], [ %22, %47 ], [ %22, %42 ], [ %22, %37 ], [ %22, %32 ], [ %22, %31 ], [ 1, %30 ], [ %22, %28 ], [ %22, %20 ]
%68 = phi i32 [ %23, %62 ], [ %23, %57 ], [ %23, %52 ], [ %23, %47 ], [ %23, %42 ], [ %23, %37 ], [ %23, %32 ], [ 1, %31 ], [ %23, %30 ], [ %23, %28 ], [ %23, %20 ]
%69 = phi i32 [ %24, %62 ], [ %24, %57 ], [ %24, %52 ], [ %24, %47 ], [ %24, %42 ], [ %24, %37 ], [ 1, %32 ], [ %24, %31 ], [ %24, %30 ], [ %24, %28 ], [ %24, %20 ]
%70 = phi i8* [ %25, %62 ], [ %25, %57 ], [ %25, %52 ], [ %25, %47 ], [ %25, %42 ], [ %25, %37 ], [ %25, %32 ], [ %25, %31 ], [ %25, %30 ], [ %29, %28 ], [ %25, %20 ]
%71 = phi i32 [ %26, %62 ], [ %59, %57 ], [ %54, %52 ], [ %49, %47 ], [ %44, %42 ], [ %39, %37 ], [ %34, %32 ], [ %26, %31 ], [ %26, %30 ], [ %26, %28 ], [ %26, %20 ]
%72 = icmp sgt i32 %71, 49
br i1 %72, label %73, label %75
73: ; preds = %65
%74 = tail call i32 (i8*, ...) @my_err(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0))
br label %75
75: ; preds = %73, %65
br label %20
76: ; preds = %20
%77 = icmp eq i32 %21, 0
br i1 %77, label %86, label %78
78: ; preds = %76
store i32 4, i32* %5
%79 = bitcast %struct.sockaddr_storage* %3 to %struct.sockaddr*
%80 = call i64 @getpeername(i32 0, %struct.sockaddr* %79, i32* %5)
%81 = icmp slt i64 %80, 0
br i1 %81, label %82, label %90
82: ; preds = %78
%83 = load i32, i32* @errno
%84 = call i32 @strerror(i32 %83)
%85 = call i32 (i8*, ...) @my_err(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i32 %84)
br label %90
86: ; preds = %76
%87 = load i32, i32* @stdin
%88 = call i32 @fgets(i8* %12, i32 1024, i32 %87)
%89 = icmp eq i32 %88, 0
br i1 %89, label %101, label %96
90: ; preds = %78, %82
%91 = load i32, i32* %5
%92 = call i32 @getnameinfo(%struct.sockaddr* %79, i32 %91, i8* %15, i32 %13, i32* null, i32 0, i32 0)
%93 = load i32, i32* @stdin
%94 = call i32 @fgets(i8* %12, i32 1024, i32 %93)
%95 = icmp eq i32 %94, 0
br i1 %95, label %98, label %96
96: ; preds = %86, %90
%97 = phi i8* [ null, %86 ], [ %15, %90 ]
br label %103
98: ; preds = %90
%99 = load i32, i32* @LOG_NOTICE
%100 = call i32 (i32, i8*, i8*, ...) @syslog(i32 %99, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i8* %15)
br label %101
101: ; preds = %86, %98
%102 = call i32 @exit(i32 1)
unreachable
103: ; preds = %96, %109
%104 = call i8* @strrchr(i8* %12, i8 signext 10)
%105 = icmp eq i8* %104, null
br i1 %105, label %106, label %109
106: ; preds = %103
%107 = call i8* @strrchr(i8* %12, i8 signext 13)
%108 = icmp eq i8* %107, null
br i1 %108, label %111, label %109
109: ; preds = %103, %106
%110 = phi i8* [ %104, %103 ], [ %107, %106 ]
store i8 0, i8* %110
br label %103
111: ; preds = %106
br i1 %77, label %120, label %112
112: ; preds = %111
%113 = load i8, i8* %12
%114 = icmp eq i8 %113, 0
%115 = load i32, i32* @LOG_NOTICE
br i1 %114, label %116, label %118
116: ; preds = %112
%117 = call i32 (i32, i8*, i8*, ...) @syslog(i32 %115, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i8* %97)
br label %120
118: ; preds = %112
%119 = call i32 (i32, i8*, i8*, ...) @syslog(i32 %115, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i8* %97, i8* %12)
br label %120
120: ; preds = %116, %118, %111
%121 = icmp sgt i32 %26, 49
br i1 %121, label %122, label %124
122: ; preds = %120
%123 = call i32 (i8*, ...) @my_err(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0))
br label %124
124: ; preds = %122, %120
%125 = call i8* @__UNCONST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%126 = add nsw i32 %26, 1
%127 = sext i32 %26 to i64
%128 = getelementptr inbounds [51 x i8*], [51 x i8*]* %6, i64 0, i64 %127
store i8* %125, i8** %128
%129 = getelementptr inbounds [51 x i8*], [51 x i8*]* %6, i64 0, i64 1
%130 = icmp eq i32 %22, 0
%131 = icmp eq i32 %24, 0
%132 = getelementptr inbounds [51 x i8*], [51 x i8*]* %6, i64 0, i64 0
%133 = icmp slt i32 %26, 49
br i1 %133, label %134, label %189
134: ; preds = %124
%135 = sext i32 %126 to i64
%136 = getelementptr inbounds [51 x i8*], [51 x i8*]* %6, i64 0, i64 %135
br label %137
137: ; preds = %134, %184
%138 = phi i32 [ %126, %134 ], [ %187, %184 ]
%139 = phi i8** [ %129, %134 ], [ %186, %184 ]
%140 = phi i8** [ %136, %134 ], [ %185, %184 ]
%141 = phi i8* [ %12, %134 ], [ null, %184 ]
br label %142
142: ; preds = %137, %172
%143 = phi i8* [ null, %172 ], [ %141, %137 ]
%144 = call i8* @strtok(i8* %143, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
store i8* %144, i8** %140
%145 = icmp eq i8* %144, null
br i1 %145, label %189, label %146
146: ; preds = %142
br i1 %130, label %155, label %147
147: ; preds = %146
%148 = call i64 @strchr(i8* %144, i8 signext 64)
%149 = icmp eq i64 %148, 0
br i1 %149, label %150, label %152
150: ; preds = %147
%151 = load i8*, i8** %140
br label %155
152: ; preds = %147
%153 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0))
%154 = call i32 @exit(i32 1)
unreachable
155: ; preds = %150, %146
%156 = phi i8* [ %151, %150 ], [ %144, %146 ]
%157 = call i32 @strlen(i8* %156)
%158 = load i8*, i8** %140
%159 = add nsw i32 %157, -1
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds i8, i8* %158, i64 %160
%162 = load i8, i8* %161
%163 = icmp eq i8 %162, 64
br i1 %163, label %164, label %172
164: ; preds = %155, %164
%165 = phi i64 [ %168, %164 ], [ %160, %155 ]
%166 = phi i8* [ %169, %164 ], [ %161, %155 ]
store i8 0, i8* %166
%167 = load i8*, i8** %140
%168 = add i64 %165, -1
%169 = getelementptr inbounds i8, i8* %167, i64 %168
%170 = load i8, i8* %169
%171 = icmp eq i8 %170, 64
br i1 %171, label %164, label %172
172: ; preds = %164, %155
%173 = phi i8* [ %158, %155 ], [ %167, %164 ]
%174 = load i8, i8* %173
switch i8 %174, label %181 [
i8 0, label %142
i8 47, label %175
]
175: ; preds = %172
%176 = getelementptr inbounds i8, i8* %173, i64 1
%177 = load i8, i8* %176
switch i8 %177, label %181 [
i8 87, label %178
i8 119, label %178
]
178: ; preds = %175, %175
br i1 %131, label %179, label %184
179: ; preds = %178
%180 = call i8* @__UNCONST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
store i8* %180, i8** %129
br label %184
181: ; preds = %172, %175
%182 = getelementptr inbounds i8*, i8** %140, i64 1
%183 = add nsw i32 %138, 1
br label %184
184: ; preds = %178, %179, %181
%185 = phi i8** [ %140, %178 ], [ %140, %179 ], [ %182, %181 ]
%186 = phi i8** [ %139, %178 ], [ %132, %179 ], [ %139, %181 ]
%187 = phi i32 [ %138, %178 ], [ %138, %179 ], [ %183, %181 ]
%188 = icmp slt i32 %187, 50
br i1 %188, label %137, label %189
189: ; preds = %184, %142, %124
%190 = phi i8** [ %129, %124 ], [ %139, %142 ], [ %186, %184 ]
%191 = getelementptr inbounds [51 x i8*], [51 x i8*]* %6, i64 0, i64 49
store i8* null, i8** %191
%192 = call i8* @strrchr(i8* dereferenceable(1) %25, i8 signext 47)
%193 = icmp eq i8* %192, null
%194 = getelementptr inbounds i8, i8* %192, i64 1
%195 = select i1 %193, i8* %25, i8* %194
store i8* %195, i8** %190
%196 = icmp eq i32 %23, 0
br i1 %196, label %213, label %197
197: ; preds = %189
%198 = getelementptr inbounds i8*, i8** %190, i64 1
br label %199
199: ; preds = %199, %197
%200 = phi i8** [ %198, %197 ], [ %201, %199 ]
%201 = getelementptr inbounds i8*, i8** %200, i64 1
%202 = load i8*, i8** %200
%203 = ptrtoint i8* %202 to i64
%204 = trunc i64 %203 to i32
%205 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32 %204)
%206 = icmp eq i64 %205, 0
br i1 %206, label %207, label %199
207: ; preds = %199
%208 = load i8*, i8** %201
%209 = icmp eq i8* %208, null
br i1 %209, label %210, label %213
210: ; preds = %207
%211 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.18, i64 0, i64 0))
%212 = call i32 @exit(i32 1)
unreachable
213: ; preds = %207, %189
%214 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%215 = call i64 @pipe(i32* %214)
%216 = icmp slt i64 %215, 0
br i1 %216, label %217, label %221
217: ; preds = %213
%218 = load i32, i32* @errno
%219 = call i32 @strerror(i32 %218)
%220 = call i32 (i8*, ...) @my_err(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0), i32 %219)
br label %221
221: ; preds = %217, %213
%222 = call i32 (...) @fork()
switch i32 %222, label %243 [
i32 0, label %223
i32 -1, label %239
]
223: ; preds = %221
%224 = load i32, i32* %214
%225 = call i32 @close(i32 %224)
%226 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%227 = load i32, i32* %226
%228 = icmp eq i32 %227, 1
br i1 %228, label %233, label %229
229: ; preds = %223
%230 = call i32 @dup2(i32 %227, i32 1)
%231 = load i32, i32* %226
%232 = call i32 @close(i32 %231)
br label %233
233: ; preds = %229, %223
%234 = call i32 @execv(i8* %25, i8** %190)
%235 = load i32, i32* @errno
%236 = call i32 @strerror(i32 %235)
%237 = call i32 (i8*, ...) @my_err(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.20, i64 0, i64 0), i8* %25, i32 %236)
%238 = call i32 @_exit(i32 1)
unreachable
239: ; preds = %221
%240 = load i32, i32* @errno
%241 = call i32 @strerror(i32 %240)
%242 = call i32 (i8*, ...) @my_err(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0), i32 %241)
br label %243
243: ; preds = %239, %221
%244 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%245 = load i32, i32* %244
%246 = call i32 @close(i32 %245)
%247 = load i32, i32* %214
%248 = call i32* @fdopen(i32 %247, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i64 0, i64 0))
%249 = icmp eq i32* %248, null
br i1 %249, label %250, label %254
250: ; preds = %243
%251 = load i32, i32* @errno
%252 = call i32 @strerror(i32 %251)
%253 = call i32 (i8*, ...) @my_err(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.23, i64 0, i64 0), i32 %252)
br label %254
254: ; preds = %250, %243
%255 = call i32 @getc(i32* %248)
%256 = load i32, i32* @EOF
%257 = icmp eq i32 %255, %256
br i1 %257, label %268, label %258
258: ; preds = %254, %263
%259 = phi i32 [ %265, %263 ], [ %255, %254 ]
%260 = icmp eq i32 %259, 10
br i1 %260, label %261, label %263
261: ; preds = %258
%262 = call i32 @putchar(i32 13)
br label %263
263: ; preds = %261, %258
%264 = call i32 @putchar(i32 %259)
%265 = call i32 @getc(i32* %248)
%266 = load i32, i32* @EOF
%267 = icmp eq i32 %265, %266
br i1 %267, label %268, label %258
268: ; preds = %263, %254
%269 = call i32 @exit(i32 0)
unreachable
}