#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 scalar_t__ u_long;
typedef scalar_t__ u_int;
struct timeval {
  long tv_sec;
  long tv_usec;
};
typedef scalar_t__ pid_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
scalar_t__ atoi(char *);
int /*<<< orphan*/ close(int);
int errno;
int execl(char *, char *, char *, char *, char *, ...);
int execv(char *, char **);
void *fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
int get_attach_status(int, scalar_t__);
int getline(char **, size_t *, int /*<<< orphan*/ *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
char *malloc(size_t);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, scalar_t__);
int /*<<< orphan*/ stderr;
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strtok(char *, char *);
int wait_for_replay_group(int, scalar_t__);
int waitpid(scalar_t__, int *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  struct timeval tv_start, tv_attach, tv_tool_done, tv_done;
  char cpids[80], tmpdir[80], lscmd[80];
  char *lscmd_output;
  char *dirname;
  char cache_dir[1024] = "";
  pid_t cpid, mpid, ppid;
  int fd, rc, status, filter_inet = 0;
  u_long filter_output_after = 0;
  char *stop_at = NULL;
  char *filter_output_after_str = NULL;
  char *filter_partfile = NULL;
  int next_child = 0, i;
  size_t n = 1024;
  FILE *fp;
  int post_process_pids[2];
  if (argc < 2) {
    fprintf(
        stderr,
        "format: seqtt <replay dir> [filter syscall] [--cache_dir cache_dir] "
        "[-filter_inet] [-filter_partfile xxx] [-filter_output_after clock]\n");
    return -1;
  }
  dirname = argv[1];
  if (argc > 2) {
    int index = 2;
    while (index < argc) {
      if (!strncmp(argv[index], "--cache_dir", 1024)) {
        strncpy(cache_dir, argv[index + 1], 1024);
        index++;
      } else if (!strncmp(argv[index], "-stop_at", 1024)) {
        stop_at = argv[index + 1];
        index += 2;
      } else if (!strncmp(argv[index], "-filter_inet", 1024)) {
        filter_inet = 1;
        index++;
      } else if (!strncmp(argv[index], "-filter_partfile", 1024)) {
        filter_partfile = argv[index + 1];
        index += 2;
      } else if (!strncmp(argv[index], "-filter_output_after", 1024)) {
        filter_output_after_str = argv[index + 1];
        filter_output_after = atoi(argv[index + 1]);
        index += 2;
      } else {
        fprintf(stderr,
                "format: seqtt <replay dir> [filter syscall] [--cache_dir "
                "cache_dir] [-filter_inet] [-filter_partfile xxx] "
                "[-filter_output_after clock]\n");
        return -1;
      }
    }
  }
  fd = open("/dev/spec0", O_RDWR);
  if (fd < 0) {
    perror("open /dev/spec0");
    return fd;
  }
  gettimeofday(&tv_start, NULL);
  cpid = fork();
  if (cpid == 0) {
    if (strncmp(cache_dir, "", 1024)) {
      rc = execl("./resume", "resume", "-p", dirname, "--pthread",
                 "../eglibc-2.15/prefix/lib", "--cache_dir", cache_dir, NULL);
    } else {
      rc = execl("./resume", "resume", "-p", dirname, "--pthread",
                 "../eglibc-2.15/prefix/lib", NULL);
    }
    fprintf(stderr, "execl of resume failed, rc=%d, errno=%d\n", rc, errno);
    return -1;
  }
  do {
    rc = get_attach_status(fd, cpid);
  } while (rc <= 0);
  gettimeofday(&tv_attach, NULL);
  mpid = fork();
  if (mpid == 0) {
    const char *args[256];
    u_int argcnt = 0;
    args[argcnt++] = "pin";
    args[argcnt++] = "-pid";
    sprintf(cpids, "%d", cpid);
    args[argcnt++] = cpids;
    args[argcnt++] = "-t";
    args[argcnt++] = "../dift/obj-ia32/linkage_data.so";
    if (filter_output_after) {
      args[argcnt++] = "-ofb";
      args[argcnt++] = filter_output_after_str;
    }
    if (filter_inet) {
      args[argcnt++] = "-i";
      args[argcnt++] = "-f";
      args[argcnt++] = "inetsocket";
    } else if (filter_partfile) {
      args[argcnt++] = "-i";
      args[argcnt++] = "-e";
      args[argcnt++] = filter_partfile;
    }
    if (stop_at) {
      args[argcnt++] = "-l";
      args[argcnt++] = stop_at;
    }
    args[argcnt++] = NULL;
    rc = execv("../../../pin/pin", (char **)args);
    fprintf(stderr, "execv of pin tool failed, rc=%d, errno=%d\n", rc, errno);
    return -1;
  }
  rc = wait_for_replay_group(fd, cpid);
  rc = waitpid(cpid, &status, 0);
  if (rc < 0) {
    fprintf(stderr, "waitpid returns %d, errno %d for pid %d\n", rc, errno,
            cpid);
  }
  gettimeofday(&tv_tool_done, NULL);
  printf("DIFT finished\n");
  sprintf(tmpdir, "/tmp/%d", cpid);
  sprintf(lscmd, "/bin/ls %s/dataflow.result*", tmpdir);
  fp = popen(lscmd, "r");
  if (fp == NULL) {
    fprintf(stderr, "popen failed: errno %d", errno);
    return -1;
  }
  lscmd_output = malloc(n);
  while ((rc = getline(&lscmd_output, &n, fp)) > 0) {
    char *pid;
    strtok(lscmd_output, ".");
    strtok(NULL, ".");
    pid = strtok(NULL, ".");
    if (pid == NULL) {
      continue;
    }
    pid = strtok(pid, "\n");
    post_process_pids[next_child] = fork();
    if (post_process_pids[next_child] == 0) {
      sprintf(tmpdir, "/tmp/%d", cpid);
      rc = execl("../dift/obj-ia32/postprocess_linkage", "postprocess_linkage",
                 "-m", tmpdir, "-p", pid, NULL);
      fprintf(stderr, "execl of postprocess_linkage failed, rc=%d, errno=%d\n",
              rc, errno);
      return -1;
    }
    next_child += 1;
  }
  free(lscmd_output);
  ppid = fork();
  if (ppid == 0) {
    sprintf(tmpdir, "/tmp/%d", cpid);
    rc = execl("../dift/obj-ia32/postprocess_linkage", "postprocess_linkage",
               "-m", tmpdir, NULL);
    fprintf(stderr, "execl of postprocess_linkage failed, rc=%d, errno=%d\n",
            rc, errno);
    return -1;
  }
  for (i = 0; i < next_child; i++) {
    rc = waitpid(post_process_pids[i], &status, 0);
    if (rc < 0) {
      fprintf(stderr, "waitpid returns %d, errno %d for pid %d\n", rc, errno,
              cpid);
    }
  }
  rc = waitpid(ppid, &status, 0);
  if (rc < 0) {
    fprintf(stderr, "waitpid returns %d, errno %d for pid %d\n", rc, errno,
            cpid);
  }
  gettimeofday(&tv_done, NULL);
  close(fd);
  printf("Start time: %ld.%06ld\n", tv_start.tv_sec, tv_start.tv_usec);
  printf("Attach time: %ld.%06ld\n", tv_attach.tv_sec, tv_attach.tv_usec);
  printf("Tool done time: %ld.%06ld\n", tv_tool_done.tv_sec,
         tv_tool_done.tv_usec);
  printf("End time: %ld.%06ld\n", tv_done.tv_sec, tv_done.tv_usec);
  long diff_usec = tv_done.tv_usec - tv_tool_done.tv_usec;
  long carryover = 0;
  if (diff_usec < 0) {
    carryover = -1;
    diff_usec = 1 - diff_usec;
  }
  long diff_sec = tv_done.tv_sec - tv_tool_done.tv_sec - carryover;
  printf("Tool -> End: %ld.%06ld\n", diff_sec, diff_usec);
  diff_usec = tv_done.tv_usec - tv_start.tv_usec;
  carryover = 0;
  if (diff_usec < 0) {
    carryover = -1;
    diff_usec = 1 - diff_usec;
  }
  diff_sec = tv_done.tv_sec - tv_start.tv_sec - carryover;
  printf("Start -> End: %ld.%06ld\n", diff_sec, diff_usec);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe00,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x550(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1080 <memset@plt>
movl   $0x0,-0x578(%rbp)
movq   $0x0,-0x580(%rbp)
movq   $0x0,-0x588(%rbp)
movq   $0x0,-0x590(%rbp)
movq   $0x0,-0x598(%rbp)
movl   $0x0,-0x59c(%rbp)
movq   $0x400,-0x5a8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1304 <main+0xa4>
mov    0x2cf0(%rip),%rax
mov    (%rax),%edi
lea    0xd0f(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f5d <main+0xcfd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x150(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    154d <main+0x2ed>
movl   $0x2,-0x5bc(%rbp)
mov    -0x5bc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1548 <main+0x2e8>
mov    -0x10(%rbp),%rax
movslq -0x5bc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd3c(%rip),%rsi
mov    $0x400,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
jne    1399 <main+0x139>
lea    -0x550(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x5bc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
mov    $0x400,%edx
call   1040 <strncpy@plt>
mov    -0x5bc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5bc(%rbp)
jmp    1543 <main+0x2e3>
mov    -0x10(%rbp),%rax
movslq -0x5bc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xce5(%rip),%rsi
mov    $0x400,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
jne    13f2 <main+0x192>
mov    -0x10(%rbp),%rax
mov    -0x5bc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x588(%rbp)
mov    -0x5bc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x5bc(%rbp)
jmp    153e <main+0x2de>
mov    -0x10(%rbp),%rax
movslq -0x5bc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc95(%rip),%rsi
mov    $0x400,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
jne    143a <main+0x1da>
movl   $0x1,-0x578(%rbp)
mov    -0x5bc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5bc(%rbp)
jmp    1539 <main+0x2d9>
mov    -0x10(%rbp),%rax
movslq -0x5bc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc5a(%rip),%rsi
mov    $0x400,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
jne    1493 <main+0x233>
mov    -0x10(%rbp),%rax
mov    -0x5bc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x598(%rbp)
mov    -0x5bc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x5bc(%rbp)
jmp    1534 <main+0x2d4>
mov    -0x10(%rbp),%rax
movslq -0x5bc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc12(%rip),%rsi
mov    $0x400,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
jne    150c <main+0x2ac>
mov    -0x10(%rbp),%rax
mov    -0x5bc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x590(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x5bc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1120 <atoi@plt>
mov    %rax,-0x580(%rbp)
mov    -0x5bc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x5bc(%rbp)
jmp    152f <main+0x2cf>
mov    0x2ac5(%rip),%rax
mov    (%rax),%edi
lea    0xae4(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f5d <main+0xcfd>
jmp    1534 <main+0x2d4>
jmp    1539 <main+0x2d9>
jmp    153e <main+0x2de>
jmp    1543 <main+0x2e3>
jmp    1327 <main+0xc7>
jmp    154d <main+0x2ed>
mov    0x2a94(%rip),%rax
mov    (%rax),%esi
lea    0xb78(%rip),%rdi
call   10e0 <open@plt>
mov    %eax,-0x56c(%rbp)
cmpl   $0x0,-0x56c(%rbp)
jge    158f <main+0x32f>
lea    0xb54(%rip),%rdi
call   1100 <perror@plt>
mov    -0x56c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1f5d <main+0xcfd>
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gettimeofday@plt>
mov    $0x0,%al
call   1180 <fork@plt>
mov    %rax,-0x558(%rbp)
cmpq   $0x0,-0x558(%rbp)
jne    16ac <main+0x44c>
lea    -0x550(%rbp),%rdi
lea    0xac1(%rip),%rsi
mov    $0x400,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
je     1639 <main+0x3d9>
mov    -0x150(%rbp),%rcx
lea    -0x550(%rbp),%rax
lea    0xaf1(%rip),%rdi
lea    0xaec(%rip),%rsi
lea    0xaec(%rip),%rdx
lea    0xae8(%rip),%r8
lea    0xaeb(%rip),%r9
lea    0xa76(%rip),%r10
xor    %r11d,%r11d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    $0x0,%al
call   1160 <execl@plt>
mov    %eax,-0x570(%rbp)
jmp    167a <main+0x41a>
mov    -0x150(%rbp),%rcx
lea    0xa99(%rip),%rdi
lea    0xa94(%rip),%rsi
lea    0xa94(%rip),%rdx
lea    0xa90(%rip),%r8
lea    0xa93(%rip),%r9
xor    %eax,%eax
movq   $0x0,(%rsp)
mov    $0x0,%al
call   1160 <execl@plt>
mov    %eax,-0x570(%rbp)
mov    0x2957(%rip),%rax
mov    (%rax),%edi
mov    -0x570(%rbp),%edx
mov    0x2940(%rip),%rax
mov    (%rax),%ecx
lea    0xa77(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f5d <main+0xcfd>
jmp    16b1 <main+0x451>
mov    -0x56c(%rbp),%edi
mov    -0x558(%rbp),%rsi
call   1150 <get_attach_status@plt>
mov    %eax,-0x570(%rbp)
cmpl   $0x0,-0x570(%rbp)
jle    16b1 <main+0x451>
lea    -0x30(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gettimeofday@plt>
mov    $0x0,%al
call   1180 <fork@plt>
mov    %rax,-0x560(%rbp)
cmpq   $0x0,-0x560(%rbp)
jne    19ed <main+0x78d>
movq   $0x0,-0xdc8(%rbp)
mov    -0xdc8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xdc8(%rbp)
lea    0xa65(%rip),%rcx
mov    %rcx,-0xdc0(%rbp,%rax,8)
ff
mov    -0xdc8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xdc8(%rbp)
lea    0x9ef(%rip),%rcx
mov    %rcx,-0xdc0(%rbp,%rax,8)
ff
lea    -0xa0(%rbp),%rdi
mov    -0x558(%rbp),%rdx
lea    0xac3(%rip),%rsi
call   1140 <sprintf@plt>
lea    -0xa0(%rbp),%rcx
mov    -0xdc8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0xdc8(%rbp)
mov    %rcx,-0xdc0(%rbp,%rax,8)
ff
mov    -0xdc8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xdc8(%rbp)
lea    0x992(%rip),%rcx
mov    %rcx,-0xdc0(%rbp,%rax,8)
ff
mov    -0xdc8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xdc8(%rbp)
lea    0x971(%rip),%rcx
mov    %rcx,-0xdc0(%rbp,%rax,8)
ff
cmpq   $0x0,-0x580(%rbp)
je     182e <main+0x5ce>
mov    -0xdc8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xdc8(%rbp)
lea    0x960(%rip),%rcx
mov    %rcx,-0xdc0(%rbp,%rax,8)
ff
mov    -0x590(%rbp),%rcx
mov    -0xdc8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0xdc8(%rbp)
mov    %rcx,-0xdc0(%rbp,%rax,8)
ff
cmpl   $0x0,-0x578(%rbp)
je     18ac <main+0x64c>
mov    -0xdc8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xdc8(%rbp)
lea    0x910(%rip),%rcx
mov    %rcx,-0xdc0(%rbp,%rax,8)
ff
mov    -0xdc8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xdc8(%rbp)
lea    0x8ef(%rip),%rcx
mov    %rcx,-0xdc0(%rbp,%rax,8)
ff
mov    -0xdc8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xdc8(%rbp)
lea    0x8ce(%rip),%rcx
mov    %rcx,-0xdc0(%rbp,%rax,8)
ff
jmp    192b <main+0x6cb>
cmpq   $0x0,-0x598(%rbp)
je     1926 <main+0x6c6>
mov    -0xdc8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xdc8(%rbp)
lea    0x891(%rip),%rcx
mov    %rcx,-0xdc0(%rbp,%rax,8)
ff
mov    -0xdc8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xdc8(%rbp)
lea    0x87e(%rip),%rcx
mov    %rcx,-0xdc0(%rbp,%rax,8)
ff
mov    -0x598(%rbp),%rcx
mov    -0xdc8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0xdc8(%rbp)
mov    %rcx,-0xdc0(%rbp,%rax,8)
ff
jmp    192b <main+0x6cb>
cmpq   $0x0,-0x588(%rbp)
je     1981 <main+0x721>
mov    -0xdc8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xdc8(%rbp)
lea    0x826(%rip),%rcx
mov    %rcx,-0xdc0(%rbp,%rax,8)
ff
mov    -0x588(%rbp),%rcx
mov    -0xdc8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0xdc8(%rbp)
mov    %rcx,-0xdc0(%rbp,%rax,8)
ff
mov    -0xdc8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xdc8(%rbp)
movq   $0x0,-0xdc0(%rbp,%rax,8)
lea    -0xdc0(%rbp),%rsi
lea    0x7ce(%rip),%rdi
call   1170 <execv@plt>
mov    %eax,-0x570(%rbp)
mov    0x2616(%rip),%rax
mov    (%rax),%edi
mov    -0x570(%rbp),%edx
mov    0x25ff(%rip),%rax
mov    (%rax),%ecx
lea    0x7b5(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f5d <main+0xcfd>
mov    -0x56c(%rbp),%edi
mov    -0x558(%rbp),%rsi
call   10b0 <wait_for_replay_group@plt>
mov    %eax,-0x570(%rbp)
mov    -0x558(%rbp),%rdi
lea    -0x574(%rbp),%rsi
xor    %edx,%edx
call   10d0 <waitpid@plt>
mov    %eax,-0x570(%rbp)
cmpl   $0x0,-0x570(%rbp)
jge    1a5a <main+0x7fa>
mov    0x25a4(%rip),%rax
mov    (%rax),%edi
mov    -0x570(%rbp),%edx
mov    0x258d(%rip),%rax
mov    (%rax),%ecx
mov    -0x558(%rbp),%r8
lea    0x767(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
lea    -0x40(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gettimeofday@plt>
lea    0x775(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xf0(%rbp),%rdi
mov    -0x558(%rbp),%rdx
lea    0x768(%rip),%rsi
call   1140 <sprintf@plt>
lea    -0x140(%rbp),%rdi
lea    -0xf0(%rbp),%rdx
lea    0x756(%rip),%rsi
call   1140 <sprintf@plt>
lea    -0x140(%rbp),%rdi
lea    0x617(%rip),%rsi
call   10f0 <popen@plt>
mov    %rax,-0x5b0(%rbp)
cmpq   $0x0,-0x5b0(%rbp)
jne    1afd <main+0x89d>
mov    0x2500(%rip),%rax
mov    (%rax),%edi
mov    0x24ef(%rip),%rax
mov    (%rax),%edx
lea    0x72c(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f5d <main+0xcfd>
mov    -0x5a8(%rbp),%rdi
call   10c0 <malloc@plt>
mov    %rax,-0x148(%rbp)
mov    -0x5b0(%rbp),%rdx
lea    -0x148(%rbp),%rdi
lea    -0x5a8(%rbp),%rsi
call   1130 <getline@plt>
mov    %eax,-0x570(%rbp)
cmp    $0x0,%eax
jle    1c6d <main+0xa0d>
mov    -0x148(%rbp),%rdi
lea    0x6e6(%rip),%rsi
call   1110 <strtok@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0x6d6(%rip),%rsi
call   1110 <strtok@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0x6c6(%rip),%rsi
call   1110 <strtok@plt>
mov    %rax,-0xdd0(%rbp)
cmpq   $0x0,-0xdd0(%rbp)
jne    1b86 <main+0x926>
jmp    1b10 <main+0x8b0>
mov    -0xdd0(%rbp),%rdi
lea    0x4f2(%rip),%rsi
call   1110 <strtok@plt>
mov    %rax,-0xdd0(%rbp)
mov    $0x0,%al
call   1180 <fork@plt>
mov    %eax,%ecx
movslq -0x59c(%rbp),%rax
mov    %ecx,-0x5b8(%rbp,%rax,4)
movslq -0x59c(%rbp),%rax
cmpl   $0x0,-0x5b8(%rbp,%rax,4)
jne    1c59 <main+0x9f9>
lea    -0xf0(%rbp),%rdi
mov    -0x558(%rbp),%rdx
lea    0x611(%rip),%rsi
call   1140 <sprintf@plt>
lea    -0xf0(%rbp),%rcx
mov    -0xdd0(%rbp),%r9
lea    0x634(%rip),%rdi
lea    0x63e(%rip),%rsi
lea    0x64b(%rip),%rdx
lea    0x4d9(%rip),%r8
xor    %eax,%eax
movq   $0x0,(%rsp)
mov    $0x0,%al
call   1160 <execl@plt>
mov    %eax,-0x570(%rbp)
mov    0x23aa(%rip),%rax
mov    (%rax),%edi
mov    -0x570(%rbp),%edx
mov    0x2393(%rip),%rax
mov    (%rax),%ecx
lea    0x611(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f5d <main+0xcfd>
mov    -0x59c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x59c(%rbp)
jmp    1b10 <main+0x8b0>
mov    -0x148(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1180 <fork@plt>
mov    %rax,-0x568(%rbp)
cmpq   $0x0,-0x568(%rbp)
jne    1d0f <main+0xaaf>
lea    -0xf0(%rbp),%rdi
mov    -0x558(%rbp),%rdx
lea    0x548(%rip),%rsi
call   1140 <sprintf@plt>
lea    -0xf0(%rbp),%rcx
lea    0x572(%rip),%rdi
lea    0x57c(%rip),%rsi
lea    0x589(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1160 <execl@plt>
mov    %eax,-0x570(%rbp)
mov    0x22f4(%rip),%rax
mov    (%rax),%edi
mov    -0x570(%rbp),%edx
mov    0x22dd(%rip),%rax
mov    (%rax),%ecx
lea    0x55b(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1f5d <main+0xcfd>
movl   $0x0,-0x5a0(%rbp)
mov    -0x5a0(%rbp),%eax
cmp    -0x59c(%rbp),%eax
jge    1da1 <main+0xb41>
movslq -0x5a0(%rbp),%rax
movslq -0x5b8(%rbp,%rax,4),%rdi
ff
lea    -0x574(%rbp),%rsi
xor    %edx,%edx
call   10d0 <waitpid@plt>
mov    %eax,-0x570(%rbp)
cmpl   $0x0,-0x570(%rbp)
jge    1d88 <main+0xb28>
mov    0x2276(%rip),%rax
mov    (%rax),%edi
mov    -0x570(%rbp),%edx
mov    0x225f(%rip),%rax
mov    (%rax),%ecx
mov    -0x558(%rbp),%r8
lea    0x439(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1d8d <main+0xb2d>
mov    -0x5a0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5a0(%rbp)
jmp    1d19 <main+0xab9>
mov    -0x568(%rbp),%rdi
lea    -0x574(%rbp),%rsi
xor    %edx,%edx
call   10d0 <waitpid@plt>
mov    %eax,-0x570(%rbp)
cmpl   $0x0,-0x570(%rbp)
jge    1df6 <main+0xb96>
mov    0x2208(%rip),%rax
mov    (%rax),%edi
mov    -0x570(%rbp),%edx
mov    0x21f1(%rip),%rax
mov    (%rax),%ecx
mov    -0x558(%rbp),%r8
lea    0x3cb(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
lea    -0x50(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gettimeofday@plt>
mov    -0x56c(%rbp),%edi
call   1090 <close@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0x470(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0x471(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rdx
lea    0x473(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x50(%rbp),%rsi
mov    -0x48(%rbp),%rdx
lea    0x478(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x48(%rbp),%rax
sub    -0x38(%rbp),%rax
mov    %rax,-0xdd8(%rbp)
movq   $0x0,-0xde0(%rbp)
cmpq   $0x0,-0xdd8(%rbp)
jge    1eac <main+0xc4c>
movq   $0xffffffffffffffff,-0xde0(%rbp)
ff ff ff ff
mov    $0x1,%eax
sub    -0xdd8(%rbp),%rax
mov    %rax,-0xdd8(%rbp)
mov    -0x50(%rbp),%rax
sub    -0x40(%rbp),%rax
sub    -0xde0(%rbp),%rax
mov    %rax,-0xde8(%rbp)
mov    -0xde8(%rbp),%rsi
mov    -0xdd8(%rbp),%rdx
lea    0x415(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x48(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0xdd8(%rbp)
movq   $0x0,-0xde0(%rbp)
cmpq   $0x0,-0xdd8(%rbp)
jge    1f24 <main+0xcc4>
movq   $0xffffffffffffffff,-0xde0(%rbp)
ff ff ff ff
mov    $0x1,%eax
sub    -0xdd8(%rbp),%rax
mov    %rax,-0xdd8(%rbp)
mov    -0x50(%rbp),%rax
sub    -0x20(%rbp),%rax
sub    -0xde0(%rbp),%rax
mov    %rax,-0xde8(%rbp)
mov    -0xde8(%rbp),%rsi
mov    -0xdd8(%rbp),%rdx
lea    0x3b5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xe00,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd08,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x900(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1090 <memset@plt>
movq   $0x400,0x60(%rsp)
cmp    $0x1,%ebp
jg     12c4 <main+0x54>
mov    0x2d29(%rip),%rax
mov    (%rax),%edi
lea    0xd48(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
jmp    1a9a <main+0x82a>
xor    %eax,%eax
mov    %rax,0x50(%rsp)
mov    0x8(%rbx),%rax
mov    %rax,0x58(%rsp)
mov    $0x0,%eax
mov    %rax,0x48(%rsp)
mov    $0x0,%eax
mov    %rax,0x20(%rsp)
mov    $0x0,%eax
mov    %rax,0x40(%rsp)
mov    $0x0,%eax
mov    %rax,0x30(%rsp)
cmp    $0x2,%ebp
jne    14de <main+0x26e>
mov    0x2cdc(%rip),%rax
mov    (%rax),%esi
lea    0xdc0(%rip),%rdi
call   10f0 <open@plt>
mov    %eax,%ebp
test   %eax,%eax
js     1a1c <main+0x7ac>
lea    0xa0(%rsp),%rdi
xor    %esi,%esi
call   1080 <gettimeofday@plt>
xor    %eax,%eax
call   1190 <fork@plt>
test   %rax,%rax
je     161c <main+0x3ac>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
call   1160 <get_attach_status@plt>
test   %eax,%eax
jle    1350 <main+0xe0>
lea    0x90(%rsp),%rdi
xor    %esi,%esi
call   1080 <gettimeofday@plt>
xor    %eax,%eax
call   1190 <fork@plt>
test   %rax,%rax
mov    0x50(%rsp),%r14
je     165f <main+0x3ef>
mov    %ebp,%edi
mov    %rbx,%rsi
call   10c0 <wait_for_replay_group@plt>
lea    0x2c(%rsp),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
call   10e0 <waitpid@plt>
test   %eax,%eax
jns    13c4 <main+0x154>
mov    0x2c32(%rip),%rcx
mov    (%rcx),%edi
mov    0x2c21(%rip),%rcx
mov    (%rcx),%ecx
lea    0xe02(%rip),%rsi
mov    %eax,%edx
mov    %rbx,%r8
xor    %eax,%eax
call   10b0 <fprintf@plt>
xor    %r13d,%r13d
lea    0x80(%rsp),%rdi
xor    %esi,%esi
call   1080 <gettimeofday@plt>
lea    0xf31(%rip),%rdi
call   1060 <puts@plt>
lea    0xdfa(%rip),%rsi
lea    0x100(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rdx
call   1150 <sprintf@plt>
lea    0xde8(%rip),%rsi
lea    0xb0(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rdx
call   1150 <sprintf@plt>
lea    0xcb1(%rip),%rsi
mov    %r15,%rdi
call   1100 <popen@plt>
test   %rax,%rax
je     1773 <main+0x503>
mov    %rax,%r14
mov    $0x400,%edi
call   10d0 <malloc@plt>
mov    %rax,0x38(%rsp)
lea    0x38(%rsp),%rdi
lea    0x60(%rsp),%rsi
mov    %r14,%rdx
call   1140 <getline@plt>
test   %eax,%eax
jle    16ef <main+0x47f>
lea    0xdbd(%rip),%r15
xor    %r13d,%r13d
jmp    148a <main+0x21a>
cs nopw 0x0(%rax,%rax,1)
lea    0x38(%rsp),%rdi
lea    0x60(%rsp),%rsi
mov    %r14,%rdx
call   1140 <getline@plt>
test   %eax,%eax
jle    16ef <main+0x47f>
mov    0x38(%rsp),%rdi
mov    %r15,%rsi
call   1120 <strtok@plt>
xor    %edi,%edi
mov    %r15,%rsi
call   1120 <strtok@plt>
xor    %edi,%edi
mov    %r15,%rsi
call   1120 <strtok@plt>
test   %rax,%rax
je     1470 <main+0x200>
mov    %rax,%rdi
lea    0xbcc(%rip),%rsi
call   1120 <strtok@plt>
mov    %rax,%r12
xor    %eax,%eax
call   1190 <fork@plt>
movslq %r13d,%rcx
mov    %eax,0x68(%rsp,%rcx,4)
test   %eax,%eax
je     1a2d <main+0x7bd>
add    $0x1,%r13d
jmp    1470 <main+0x200>
xor    %eax,%eax
mov    %rax,0x30(%rsp)
mov    $0x2,%r14d
lea    0xb96(%rip),%r13
lea    0xb9b(%rip),%r12
xor    %eax,%eax
mov    %rax,0x40(%rsp)
xor    %eax,%eax
mov    %rax,0x20(%rsp)
xor    %eax,%eax
mov    %rax,0x48(%rsp)
xor    %eax,%eax
mov    %rax,0x50(%rsp)
jmp    1544 <main+0x2d4>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14d
mov    0x8(%rbx,%r15,8),%rsi
lea    0x900(%rsp),%rdi
mov    $0x400,%edx
call   1040 <strncpy@plt>
cmp    %ebp,%r14d
jge    1305 <main+0x95>
movslq %r14d,%r15
mov    (%rbx,%r15,8),%rdi
mov    %r13,%rsi
mov    $0x400,%edx
call   1050 <strncmp@plt>
test   %rax,%rax
je     1520 <main+0x2b0>
mov    (%rbx,%r15,8),%rdi
mov    %r12,%rsi
mov    $0x400,%edx
call   1050 <strncmp@plt>
test   %rax,%rax
je     15e0 <main+0x370>
mov    (%rbx,%r15,8),%rdi
lea    0xb1f(%rip),%rsi
mov    $0x400,%edx
call   1050 <strncmp@plt>
test   %rax,%rax
je     15f3 <main+0x383>
mov    (%rbx,%r15,8),%rdi
lea    0xb12(%rip),%rsi
mov    $0x400,%edx
call   1050 <strncmp@plt>
test   %rax,%rax
je     1606 <main+0x396>
mov    (%rbx,%r15,8),%rdi
lea    0xb09(%rip),%rsi
mov    $0x400,%edx
call   1050 <strncmp@plt>
test   %rax,%rax
jne    12a8 <main+0x38>
mov    0x8(%rbx,%r15,8),%rdi
mov    %rdi,0x40(%rsp)
call   1130 <atoi@plt>
mov    %rax,0x48(%rsp)
jmp    1610 <main+0x3a0>
nopl   0x0(%rax,%rax,1)
mov    0x8(%rbx,%r15,8),%rax
mov    %rax,0x20(%rsp)
add    $0x2,%r14d
jmp    153b <main+0x2cb>
add    $0x1,%r14d
mov    $0x1,%eax
mov    %rax,0x50(%rsp)
jmp    153b <main+0x2cb>
mov    0x8(%rbx,%r15,8),%rax
mov    %rax,0x30(%rsp)
add    $0x2,%r15d
mov    %r15d,%r14d
jmp    153b <main+0x2cb>
lea    0xa64(%rip),%rsi
lea    0x900(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x400,%edx
call   1050 <strncmp@plt>
test   %rax,%rax
je     1798 <main+0x528>
mov    %rbx,0x8(%rsp)
lea    0xa3b(%rip),%rax
mov    %rax,(%rsp)
movq   $0x0,0x10(%rsp)
jmp    17a0 <main+0x530>
lea    0xb25(%rip),%rax
mov    %rax,0x100(%rsp)
lea    0xac4(%rip),%rax
mov    %rax,0x108(%rsp)
lea    0xb97(%rip),%rsi
lea    0xb0(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rdx
call   1150 <sprintf@plt>
mov    %rbp,0x110(%rsp)
lea    0xa98(%rip),%rax
mov    %rax,0x118(%rsp)
lea    0xa8c(%rip),%rax
mov    %rax,0x120(%rsp)
cmpq   $0x0,0x48(%rsp)
je     192d <main+0x6bd>
lea    0xa92(%rip),%rax
mov    %rax,0x128(%rsp)
mov    0x40(%rsp),%rax
mov    %rax,0x130(%rsp)
mov    $0x7,%eax
jmp    1932 <main+0x6c2>
mov    0x38(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1190 <fork@plt>
test   %rax,%rax
je     19de <main+0x76e>
mov    %rax,0x20(%rsp)
test   %r13d,%r13d
jle    17ef <main+0x57f>
mov    %r13d,%r13d
lea    0x2c(%rsp),%r14
lea    0xa94(%rip),%r12
xor    %r15d,%r15d
jmp    173d <main+0x4cd>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15
cmp    %r15,%r13
je     17ef <main+0x57f>
movslq 0x68(%rsp,%r15,4),%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   10e0 <waitpid@plt>
test   %eax,%eax
jns    1730 <main+0x4c0>
mov    0x2881(%rip),%rcx
mov    (%rcx),%edi
mov    0x2870(%rip),%rcx
mov    (%rcx),%ecx
mov    %r12,%rsi
mov    %eax,%edx
mov    %rbx,%r8
xor    %eax,%eax
call   10b0 <fprintf@plt>
jmp    1730 <main+0x4c0>
mov    0x285e(%rip),%rax
mov    (%rax),%edi
mov    0x284d(%rip),%rax
mov    (%rax),%edx
lea    0xa7b(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
jmp    1a9a <main+0x82a>
movq   $0x0,(%rsp)
lea    0x939(%rip),%rdi
lea    0x934(%rip),%rsi
lea    0x934(%rip),%rdx
lea    0x930(%rip),%r8
lea    0x933(%rip),%r9
mov    0x58(%rsp),%rcx
xor    %eax,%eax
call   1170 <execl@plt>
mov    %eax,%edx
mov    0x2800(%rip),%rax
mov    (%rax),%edi
mov    0x27ef(%rip),%rax
mov    (%rax),%ecx
lea    0x926(%rip),%rsi
jmp    1a93 <main+0x823>
lea    0x2c(%rsp),%rsi
xor    %r14d,%r14d
mov    0x20(%rsp),%rdi
xor    %edx,%edx
call   10e0 <waitpid@plt>
test   %eax,%eax
jns    182c <main+0x5bc>
mov    0x27ca(%rip),%rcx
mov    (%rcx),%edi
mov    0x27b9(%rip),%rcx
mov    (%rcx),%ecx
lea    0x99a(%rip),%rsi
mov    %eax,%edx
mov    %rbx,%r8
xor    %eax,%eax
call   10b0 <fprintf@plt>
lea    0x70(%rsp),%rdi
xor    %esi,%esi
call   1080 <gettimeofday@plt>
mov    %ebp,%edi
call   10a0 <close@plt>
mov    0xa0(%rsp),%rsi
mov    %rsi,0x20(%rsp)
mov    0xa8(%rsp),%r12
lea    0xa23(%rip),%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x90(%rsp),%rsi
mov    0x98(%rsp),%rdx
lea    0xa19(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x80(%rsp),%r15
mov    0x88(%rsp),%r13
lea    0xa13(%rip),%rdi
mov    %r15,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x70(%rsp),%rbx
mov    0x78(%rsp),%rbp
lea    0xa10(%rip),%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rax
sub    %r13,%rax
mov    $0x1,%edx
sub    %rax,%rdx
test   %rax,%rax
cmovns %rax,%rdx
mov    $0x1,%r13d
shr    $0x3f,%rax
mov    %rbx,%rsi
sub    %r15,%rsi
add    %rax,%rsi
lea    0x9e9(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
sub    %r12,%rbp
sub    %rbp,%r13
test   %rbp,%rbp
cmovns %rbp,%r13
shr    $0x3f,%rbp
sub    0x20(%rsp),%rbx
add    %rbp,%rbx
lea    0x9da(%rip),%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1aa0 <main+0x830>
mov    $0x5,%eax
mov    0x20(%rsp),%rsi
mov    0x30(%rsp),%rdi
test   %r14d,%r14d
je     1951 <main+0x6e1>
lea    0x825(%rip),%rdi
lea    0x81b(%rip),%rcx
jmp    195d <main+0x6ed>
test   %rdi,%rdi
je     1980 <main+0x710>
lea    0x81b(%rip),%rcx
lea    0x803(%rip),%rdx
mov    %rdx,0x100(%rsp,%rax,8)
mov    %rcx,0x108(%rsp,%rax,8)
mov    %rdi,0x110(%rsp,%rax,8)
add    $0x3,%rax
test   %rsi,%rsi
je     19a0 <main+0x730>
lea    0x7ef(%rip),%rcx
mov    %rcx,0x100(%rsp,%rax,8)
mov    %rsi,0x108(%rsp,%rax,8)
add    $0x2,%rax
movq   $0x0,0x100(%rsp,%rax,8)
lea    0x7cb(%rip),%rdi
lea    0x100(%rsp),%rsi
call   1180 <execv@plt>
mov    0x2611(%rip),%rcx
mov    (%rcx),%edi
mov    0x2600(%rip),%rcx
mov    (%rcx),%ecx
lea    0x7b6(%rip),%rsi
jmp    1a91 <main+0x821>
lea    0x7fe(%rip),%rsi
lea    0x100(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rdx
call   1150 <sprintf@plt>
lea    0x821(%rip),%rdi
lea    0x82b(%rip),%rsi
lea    0x838(%rip),%rdx
mov    %rbp,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1170 <execl@plt>
jmp    1a78 <main+0x808>
lea    0x6ad(%rip),%rdi
call   1110 <perror@plt>
mov    %ebp,%r14d
jmp    1aa0 <main+0x830>
lea    0x7af(%rip),%rsi
lea    0x100(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rdx
call   1150 <sprintf@plt>
movq   $0x0,(%rsp)
lea    0x7ca(%rip),%rdi
lea    0x7d4(%rip),%rsi
lea    0x7e1(%rip),%rdx
lea    0x67e(%rip),%r8
mov    %rbp,%rcx
mov    %r12,%r9
xor    %eax,%eax
call   1170 <execl@plt>
mov    0x2559(%rip),%rcx
mov    (%rcx),%edi
mov    0x2548(%rip),%rcx
mov    (%rcx),%ecx
lea    0x7b7(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
add    $0xd08,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@stderr = global i32 0
@.str = [136 x i8] c"format: seqtt <replay dir> [filter syscall] [--cache_dir cache_dir] [-filter_inet] [-filter_partfile xxx] [-filter_output_after clock]\0A\00"
@.str.1 = [12 x i8] c"--cache_dir\00"
@.str.2 = [9 x i8] c"-stop_at\00"
@.str.3 = [13 x i8] c"-filter_inet\00"
@.str.4 = [17 x i8] c"-filter_partfile\00"
@.str.5 = [21 x i8] c"-filter_output_after\00"
@.str.6 = [11 x i8] c"/dev/spec0\00"
@O_RDWR = global i32 0
@.str.7 = [16 x i8] c"open /dev/spec0\00"
@.str.8 = [1 x i8] zeroinitializer
@.str.9 = [9 x i8] c"./resume\00"
@.str.10 = [7 x i8] c"resume\00"
@.str.11 = [3 x i8] c"-p\00"
@.str.12 = [10 x i8] c"--pthread\00"
@.str.13 = [26 x i8] c"../eglibc-2.15/prefix/lib\00"
@.str.14 = [41 x i8] c"execl of resume failed, rc=%d, errno=%d\0A\00"
@errno = global i32 0
@.str.15 = [4 x i8] c"pin\00"
@.str.16 = [5 x i8] c"-pid\00"
@.str.17 = [3 x i8] c"%d\00"
@.str.18 = [3 x i8] c"-t\00"
@.str.19 = [33 x i8] c"../dift/obj-ia32/linkage_data.so\00"
@.str.20 = [5 x i8] c"-ofb\00"
@.str.21 = [3 x i8] c"-i\00"
@.str.22 = [3 x i8] c"-f\00"
@.str.23 = [11 x i8] c"inetsocket\00"
@.str.24 = [3 x i8] c"-e\00"
@.str.25 = [3 x i8] c"-l\00"
@.str.26 = [17 x i8] c"../../../pin/pin\00"
@.str.27 = [43 x i8] c"execv of pin tool failed, rc=%d, errno=%d\0A\00"
@.str.28 = [41 x i8] c"waitpid returns %d, errno %d for pid %d\0A\00"
@.str.29 = [15 x i8] c"DIFT finished\0A\00"
@.str.30 = [8 x i8] c"/tmp/%d\00"
@.str.31 = [28 x i8] c"/bin/ls %s/dataflow.result*\00"
@.str.32 = [2 x i8] c"r\00"
@.str.33 = [23 x i8] c"popen failed: errno %d\00"
@.str.34 = [2 x i8] c".\00"
@.str.35 = [2 x i8] c"\0A\00"
@.str.36 = [37 x i8] c"../dift/obj-ia32/postprocess_linkage\00"
@.str.37 = [20 x i8] c"postprocess_linkage\00"
@.str.38 = [3 x i8] c"-m\00"
@.str.39 = [54 x i8] c"execl of postprocess_linkage failed, rc=%d, errno=%d\0A\00"
@.str.40 = [23 x i8] c"Start time: %ld.%06ld\0A\00"
@.str.41 = [24 x i8] c"Attach time: %ld.%06ld\0A\00"
@.str.42 = [27 x i8] c"Tool done time: %ld.%06ld\0A\00"
@.str.43 = [21 x i8] c"End time: %ld.%06ld\0A\00"
@.str.44 = [24 x i8] c"Tool -> End: %ld.%06ld\0A\00"
@.str.45 = [25 x i8] c"Start -> End: %ld.%06ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.timeval
%7 = alloca %struct.timeval
%8 = alloca %struct.timeval
%9 = alloca %struct.timeval
%10 = alloca [80 x i8]
%11 = alloca [80 x i8]
%12 = alloca [80 x i8]
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca [1024 x i8]
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i64
%24 = alloca i8*
%25 = alloca i8*
%26 = alloca i8*
%27 = alloca i32
%28 = alloca i32
%29 = alloca i64
%30 = alloca i32*
%31 = alloca [2 x i32]
%32 = alloca i32
%33 = alloca [256 x i8*]
%34 = alloca i64
%35 = alloca i8*
%36 = alloca i64
%37 = alloca i64
%38 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%39 = bitcast [1024 x i8]* %15 to i8*
store i32 0, i32* %22
store i64 0, i64* %23
store i8* null, i8** %24
store i8* null, i8** %25
store i8* null, i8** %26
store i32 0, i32* %27
store i64 1024, i64* %29
%40 = load i32, i32* %4
%41 = icmp slt i32 %40, 2
br i1 %41, label %42, label %45
42: ; preds = %2
%43 = load i32, i32* @stderr
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %468
45: ; preds = %2
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 1
%48 = load i8*, i8** %47
store i8* %48, i8** %14
%49 = load i32, i32* %4
%50 = icmp sgt i32 %49, 2
br i1 %50, label %51, label %153
51: ; preds = %45
store i32 2, i32* %32
br label %52
52: ; preds = %151, %51
%53 = load i32, i32* %32
%54 = load i32, i32* %4
%55 = icmp slt i32 %53, %54
br i1 %55, label %56, label %152
56: ; preds = %52
%57 = load i8**, i8*** %5
%58 = load i32, i32* %32
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8*, i8** %57, i64 %59
%61 = load i8*, i8** %60
%62 = call i64 @strncmp(i8* %61, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1024)
%63 = icmp ne i64 %62, 0
br i1 %63, label %75, label %64
64: ; preds = %56
%65 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%66 = load i8**, i8*** %5
%67 = load i32, i32* %32
%68 = add nsw i32 %67, 1
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8*, i8** %66, i64 %69
%71 = load i8*, i8** %70
%72 = call i32 @strncpy(i8* %65, i8* %71, i32 1024)
%73 = load i32, i32* %32
%74 = add nsw i32 %73, 1
store i32 %74, i32* %32
br label %151
75: ; preds = %56
%76 = load i8**, i8*** %5
%77 = load i32, i32* %32
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8*, i8** %76, i64 %78
%80 = load i8*, i8** %79
%81 = call i64 @strncmp(i8* %80, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 1024)
%82 = icmp ne i64 %81, 0
br i1 %82, label %92, label %83
83: ; preds = %75
%84 = load i8**, i8*** %5
%85 = load i32, i32* %32
%86 = add nsw i32 %85, 1
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8*, i8** %84, i64 %87
%89 = load i8*, i8** %88
store i8* %89, i8** %24
%90 = load i32, i32* %32
%91 = add nsw i32 %90, 2
store i32 %91, i32* %32
br label %150
92: ; preds = %75
%93 = load i8**, i8*** %5
%94 = load i32, i32* %32
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i8*, i8** %93, i64 %95
%97 = load i8*, i8** %96
%98 = call i64 @strncmp(i8* %97, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 1024)
%99 = icmp ne i64 %98, 0
br i1 %99, label %103, label %100
100: ; preds = %92
store i32 1, i32* %22
%101 = load i32, i32* %32
%102 = add nsw i32 %101, 1
store i32 %102, i32* %32
br label %149
103: ; preds = %92
%104 = load i8**, i8*** %5
%105 = load i32, i32* %32
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8*, i8** %104, i64 %106
%108 = load i8*, i8** %107
%109 = call i64 @strncmp(i8* %108, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 1024)
%110 = icmp ne i64 %109, 0
br i1 %110, label %120, label %111
111: ; preds = %103
%112 = load i8**, i8*** %5
%113 = load i32, i32* %32
%114 = add nsw i32 %113, 1
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i8*, i8** %112, i64 %115
%117 = load i8*, i8** %116
store i8* %117, i8** %26
%118 = load i32, i32* %32
%119 = add nsw i32 %118, 2
store i32 %119, i32* %32
br label %148
120: ; preds = %103
%121 = load i8**, i8*** %5
%122 = load i32, i32* %32
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i8*, i8** %121, i64 %123
%125 = load i8*, i8** %124
%126 = call i64 @strncmp(i8* %125, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 1024)
%127 = icmp ne i64 %126, 0
br i1 %127, label %144, label %128
128: ; preds = %120
%129 = load i8**, i8*** %5
%130 = load i32, i32* %32
%131 = add nsw i32 %130, 1
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i8*, i8** %129, i64 %132
%134 = load i8*, i8** %133
store i8* %134, i8** %25
%135 = load i8**, i8*** %5
%136 = load i32, i32* %32
%137 = add nsw i32 %136, 1
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds i8*, i8** %135, i64 %138
%140 = load i8*, i8** %139
%141 = call i64 @atoi(i8* %140)
store i64 %141, i64* %23
%142 = load i32, i32* %32
%143 = add nsw i32 %142, 2
store i32 %143, i32* %32
br label %147
144: ; preds = %120
%145 = load i32, i32* @stderr
%146 = call i32 (i32, i8*, ...) @fprintf(i32 %145, i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %468
147: ; preds = %128
br label %148
148: ; preds = %147, %111
br label %149
149: ; preds = %148, %100
br label %150
150: ; preds = %149, %83
br label %151
151: ; preds = %150, %64
br label %52
152: ; preds = %52
br label %153
153: ; preds = %152, %45
%154 = load i32, i32* @O_RDWR
%155 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %154)
store i32 %155, i32* %19
%156 = load i32, i32* %19
%157 = icmp slt i32 %156, 0
br i1 %157, label %158, label %161
158: ; preds = %153
%159 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%160 = load i32, i32* %19
store i32 %160, i32* %3
br label %468
161: ; preds = %153
%162 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%163 = call i8* (...) @fork()
%164 = ptrtoint i8* %163 to i64
store i64 %164, i64* %16
%165 = load i64, i64* %16
%166 = icmp eq i64 %165, 0
br i1 %166, label %167, label %183
167: ; preds = %161
%168 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%169 = call i64 @strncmp(i8* %168, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0), i32 1024)
%170 = icmp ne i64 %169, 0
br i1 %170, label %171, label %175
171: ; preds = %167
%172 = load i8*, i8** %14
%173 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%174 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %172, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %173, i8* null)
store i32 %174, i32* %20
br label %178
175: ; preds = %167
%176 = load i8*, i8** %14
%177 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %176, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i8* null)
store i32 %177, i32* %20
br label %178
178: ; preds = %175, %171
%179 = load i32, i32* @stderr
%180 = load i32, i32* %20
%181 = load i32, i32* @errno
%182 = call i32 (i32, i8*, ...) @fprintf(i32 %179, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.14, i64 0, i64 0), i32 %180, i32 %181)
store i32 -1, i32* %3
br label %468
183: ; preds = %161
br label %184
184: ; preds = %188, %183
%185 = load i32, i32* %19
%186 = load i64, i64* %16
%187 = call i32 @get_attach_status(i32 %185, i64 %186)
store i32 %187, i32* %20
br label %188
188: ; preds = %184
%189 = load i32, i32* %20
%190 = icmp sle i32 %189, 0
br i1 %190, label %184, label %191
191: ; preds = %188
%192 = call i32 @gettimeofday(%struct.timeval* %7, i32* null)
%193 = call i8* (...) @fork()
%194 = ptrtoint i8* %193 to i64
store i64 %194, i64* %17
%195 = load i64, i64* %17
%196 = icmp eq i64 %195, 0
br i1 %196, label %197, label %276
197: ; preds = %191
store i64 0, i64* %34
%198 = load i64, i64* %34
%199 = add nsw i64 %198, 1
store i64 %199, i64* %34
%200 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 %198
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8** %200
%201 = load i64, i64* %34
%202 = add nsw i64 %201, 1
store i64 %202, i64* %34
%203 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 %201
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0), i8** %203
%204 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%205 = load i64, i64* %16
%206 = call i32 @sprintf(i8* %204, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i64 %205)
%207 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%208 = load i64, i64* %34
%209 = add nsw i64 %208, 1
store i64 %209, i64* %34
%210 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 %208
store i8* %207, i8** %210
%211 = load i64, i64* %34
%212 = add nsw i64 %211, 1
store i64 %212, i64* %34
%213 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 %211
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8** %213
%214 = load i64, i64* %34
%215 = add nsw i64 %214, 1
store i64 %215, i64* %34
%216 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 %214
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.19, i64 0, i64 0), i8** %216
%217 = load i64, i64* %23
%218 = icmp ne i64 %217, 0
br i1 %218, label %219, label %227
219: ; preds = %197
%220 = load i64, i64* %34
%221 = add nsw i64 %220, 1
store i64 %221, i64* %34
%222 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 %220
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i8** %222
%223 = load i8*, i8** %25
%224 = load i64, i64* %34
%225 = add nsw i64 %224, 1
store i64 %225, i64* %34
%226 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 %224
store i8* %223, i8** %226
br label %227
227: ; preds = %219, %197
%228 = load i32, i32* %22
%229 = icmp ne i32 %228, 0
br i1 %229, label %230, label %240
230: ; preds = %227
%231 = load i64, i64* %34
%232 = add nsw i64 %231, 1
store i64 %232, i64* %34
%233 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 %231
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i64 0, i64 0), i8** %233
%234 = load i64, i64* %34
%235 = add nsw i64 %234, 1
store i64 %235, i64* %34
%236 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 %234
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i64 0, i64 0), i8** %236
%237 = load i64, i64* %34
%238 = add nsw i64 %237, 1
store i64 %238, i64* %34
%239 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 %237
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.23, i64 0, i64 0), i8** %239
br label %255
240: ; preds = %227
%241 = load i8*, i8** %26
%242 = icmp ne i8* %241, null
br i1 %242, label %243, label %254
243: ; preds = %240
%244 = load i64, i64* %34
%245 = add nsw i64 %244, 1
store i64 %245, i64* %34
%246 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 %244
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i64 0, i64 0), i8** %246
%247 = load i64, i64* %34
%248 = add nsw i64 %247, 1
store i64 %248, i64* %34
%249 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 %247
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.24, i64 0, i64 0), i8** %249
%250 = load i8*, i8** %26
%251 = load i64, i64* %34
%252 = add nsw i64 %251, 1
store i64 %252, i64* %34
%253 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 %251
store i8* %250, i8** %253
br label %254
254: ; preds = %243, %240
br label %255
255: ; preds = %254, %230
%256 = load i8*, i8** %24
%257 = icmp ne i8* %256, null
br i1 %257, label %258, label %266
258: ; preds = %255
%259 = load i64, i64* %34
%260 = add nsw i64 %259, 1
store i64 %260, i64* %34
%261 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 %259
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i8** %261
%262 = load i8*, i8** %24
%263 = load i64, i64* %34
%264 = add nsw i64 %263, 1
store i64 %264, i64* %34
%265 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 %263
store i8* %262, i8** %265
br label %266
266: ; preds = %258, %255
%267 = load i64, i64* %34
%268 = add nsw i64 %267, 1
store i64 %268, i64* %34
%269 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 %267
store i8* null, i8** %269
%270 = getelementptr inbounds [256 x i8*], [256 x i8*]* %33, i64 0, i64 0
%271 = call i32 @execv(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.26, i64 0, i64 0), i8** %270)
store i32 %271, i32* %20
%272 = load i32, i32* @stderr
%273 = load i32, i32* %20
%274 = load i32, i32* @errno
%275 = call i32 (i32, i8*, ...) @fprintf(i32 %272, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.27, i64 0, i64 0), i32 %273, i32 %274)
store i32 -1, i32* %3
br label %468
276: ; preds = %191
%277 = load i32, i32* %19
%278 = load i64, i64* %16
%279 = call i32 @wait_for_replay_group(i32 %277, i64 %278)
store i32 %279, i32* %20
%280 = load i64, i64* %16
%281 = call i32 @waitpid(i64 %280, i32* %21, i32 0)
store i32 %281, i32* %20
%282 = load i32, i32* %20
%283 = icmp slt i32 %282, 0
br i1 %283, label %284, label %290
284: ; preds = %276
%285 = load i32, i32* @stderr
%286 = load i32, i32* %20
%287 = load i32, i32* @errno
%288 = load i64, i64* %16
%289 = call i32 (i32, i8*, ...) @fprintf(i32 %285, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.28, i64 0, i64 0), i32 %286, i32 %287, i64 %288)
br label %290
290: ; preds = %284, %276
%291 = call i32 @gettimeofday(%struct.timeval* %8, i32* null)
%292 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.29, i64 0, i64 0))
%293 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%294 = load i64, i64* %16
%295 = call i32 @sprintf(i8* %293, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.30, i64 0, i64 0), i64 %294)
%296 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%297 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%298 = ptrtoint i8* %297 to i64
%299 = call i32 @sprintf(i8* %296, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.31, i64 0, i64 0), i64 %298)
%300 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%301 = call i32* @popen(i8* %300, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.32, i64 0, i64 0))
store i32* %301, i32** %30
%302 = load i32*, i32** %30
%303 = icmp eq i32* %302, null
br i1 %303, label %304, label %308
304: ; preds = %290
%305 = load i32, i32* @stderr
%306 = load i32, i32* @errno
%307 = call i32 (i32, i8*, ...) @fprintf(i32 %305, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.33, i64 0, i64 0), i32 %306)
store i32 -1, i32* %3
br label %468
308: ; preds = %290
%309 = load i64, i64* %29
%310 = call i8* @malloc(i64 %309)
store i8* %310, i8** %13
br label %311
311: ; preds = %347, %322, %308
%312 = load i32*, i32** %30
%313 = call i32 @getline(i8** %13, i64* %29, i32* %312)
store i32 %313, i32* %20
%314 = icmp sgt i32 %313, 0
br i1 %314, label %315, label %350
315: ; preds = %311
%316 = load i8*, i8** %13
%317 = call i8* @strtok(i8* %316, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.34, i64 0, i64 0))
%318 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.34, i64 0, i64 0))
%319 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.34, i64 0, i64 0))
store i8* %319, i8** %35
%320 = load i8*, i8** %35
%321 = icmp eq i8* %320, null
br i1 %321, label %322, label %323
322: ; preds = %315
br label %311
323: ; preds = %315
%324 = load i8*, i8** %35
%325 = call i8* @strtok(i8* %324, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.35, i64 0, i64 0))
store i8* %325, i8** %35
%326 = call i8* (...) @fork()
%327 = ptrtoint i8* %326 to i32
%328 = load i32, i32* %27
%329 = sext i32 %328 to i64
%330 = getelementptr inbounds [2 x i32], [2 x i32]* %31, i64 0, i64 %329
store i32 %327, i32* %330
%331 = load i32, i32* %27
%332 = sext i32 %331 to i64
%333 = getelementptr inbounds [2 x i32], [2 x i32]* %31, i64 0, i64 %332
%334 = load i32, i32* %333
%335 = icmp eq i32 %334, 0
br i1 %335, label %336, label %347
336: ; preds = %323
%337 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%338 = load i64, i64* %16
%339 = call i32 @sprintf(i8* %337, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.30, i64 0, i64 0), i64 %338)
%340 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%341 = load i8*, i8** %35
%342 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.36, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.38, i64 0, i64 0), i8* %340, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %341, i8* null)
store i32 %342, i32* %20
%343 = load i32, i32* @stderr
%344 = load i32, i32* %20
%345 = load i32, i32* @errno
%346 = call i32 (i32, i8*, ...) @fprintf(i32 %343, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.39, i64 0, i64 0), i32 %344, i32 %345)
store i32 -1, i32* %3
br label %468
347: ; preds = %323
%348 = load i32, i32* %27
%349 = add nsw i32 %348, 1
store i32 %349, i32* %27
br label %311
350: ; preds = %311
%351 = load i8*, i8** %13
%352 = call i32 @free(i8* %351)
%353 = call i8* (...) @fork()
%354 = ptrtoint i8* %353 to i64
store i64 %354, i64* %18
%355 = load i64, i64* %18
%356 = icmp eq i64 %355, 0
br i1 %356, label %357, label %367
357: ; preds = %350
%358 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%359 = load i64, i64* %16
%360 = call i32 @sprintf(i8* %358, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.30, i64 0, i64 0), i64 %359)
%361 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%362 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.36, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.38, i64 0, i64 0), i8* %361, i8* null)
store i32 %362, i32* %20
%363 = load i32, i32* @stderr
%364 = load i32, i32* %20
%365 = load i32, i32* @errno
%366 = call i32 (i32, i8*, ...) @fprintf(i32 %363, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.39, i64 0, i64 0), i32 %364, i32 %365)
store i32 -1, i32* %3
br label %468
367: ; preds = %350
store i32 0, i32* %28
br label %368
368: ; preds = %388, %367
%369 = load i32, i32* %28
%370 = load i32, i32* %27
%371 = icmp slt i32 %369, %370
br i1 %371, label %372, label %391
372: ; preds = %368
%373 = load i32, i32* %28
%374 = sext i32 %373 to i64
%375 = getelementptr inbounds [2 x i32], [2 x i32]* %31, i64 0, i64 %374
%376 = load i32, i32* %375
%377 = sext i32 %376 to i64
%378 = call i32 @waitpid(i64 %377, i32* %21, i32 0)
store i32 %378, i32* %20
%379 = load i32, i32* %20
%380 = icmp slt i32 %379, 0
br i1 %380, label %381, label %387
381: ; preds = %372
%382 = load i32, i32* @stderr
%383 = load i32, i32* %20
%384 = load i32, i32* @errno
%385 = load i64, i64* %16
%386 = call i32 (i32, i8*, ...) @fprintf(i32 %382, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.28, i64 0, i64 0), i32 %383, i32 %384, i64 %385)
br label %387
387: ; preds = %381, %372
br label %388
388: ; preds = %387
%389 = load i32, i32* %28
%390 = add nsw i32 %389, 1
store i32 %390, i32* %28
br label %368
391: ; preds = %368
%392 = load i64, i64* %18
%393 = call i32 @waitpid(i64 %392, i32* %21, i32 0)
store i32 %393, i32* %20
%394 = load i32, i32* %20
%395 = icmp slt i32 %394, 0
br i1 %395, label %396, label %402
396: ; preds = %391
%397 = load i32, i32* @stderr
%398 = load i32, i32* %20
%399 = load i32, i32* @errno
%400 = load i64, i64* %16
%401 = call i32 (i32, i8*, ...) @fprintf(i32 %397, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.28, i64 0, i64 0), i32 %398, i32 %399, i64 %400)
br label %402
402: ; preds = %396, %391
%403 = call i32 @gettimeofday(%struct.timeval* %9, i32* null)
%404 = load i32, i32* %19
%405 = call i32 @close(i32 %404)
%406 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%407 = load i64, i64* %406
%408 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%409 = load i64, i64* %408
%410 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.40, i64 0, i64 0), i64 %407, i64 %409)
%411 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%412 = load i64, i64* %411
%413 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
%414 = load i64, i64* %413
%415 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.41, i64 0, i64 0), i64 %412, i64 %414)
%416 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%417 = load i64, i64* %416
%418 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%419 = load i64, i64* %418
%420 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.42, i64 0, i64 0), i64 %417, i64 %419)
%421 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
%422 = load i64, i64* %421
%423 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
%424 = load i64, i64* %423
%425 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.43, i64 0, i64 0), i64 %422, i64 %424)
%426 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
%427 = load i64, i64* %426
%428 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%429 = load i64, i64* %428
%430 = sub nsw i64 %427, %429
store i64 %430, i64* %36
store i64 0, i64* %37
%431 = load i64, i64* %36
%432 = icmp slt i64 %431, 0
br i1 %432, label %433, label %436
433: ; preds = %402
store i64 -1, i64* %37
%434 = load i64, i64* %36
%435 = sub nsw i64 1, %434
store i64 %435, i64* %36
br label %436
436: ; preds = %433, %402
%437 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
%438 = load i64, i64* %437
%439 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%440 = load i64, i64* %439
%441 = sub nsw i64 %438, %440
%442 = load i64, i64* %37
%443 = sub nsw i64 %441, %442
store i64 %443, i64* %38
%444 = load i64, i64* %38
%445 = load i64, i64* %36
%446 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.44, i64 0, i64 0), i64 %444, i64 %445)
%447 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
%448 = load i64, i64* %447
%449 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%450 = load i64, i64* %449
%451 = sub nsw i64 %448, %450
store i64 %451, i64* %36
store i64 0, i64* %37
%452 = load i64, i64* %36
%453 = icmp slt i64 %452, 0
br i1 %453, label %454, label %457
454: ; preds = %436
store i64 -1, i64* %37
%455 = load i64, i64* %36
%456 = sub nsw i64 1, %455
store i64 %456, i64* %36
br label %457
457: ; preds = %454, %436
%458 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
%459 = load i64, i64* %458
%460 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%461 = load i64, i64* %460
%462 = sub nsw i64 %459, %461
%463 = load i64, i64* %37
%464 = sub nsw i64 %462, %463
store i64 %464, i64* %38
%465 = load i64, i64* %38
%466 = load i64, i64* %36
%467 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.45, i64 0, i64 0), i64 %465, i64 %466)
store i32 0, i32* %3
br label %468
468: ; preds = %457, %357, %336, %304, %266, %178, %158, %144, %42
%469 = load i32, i32* %3
ret i32 %469
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@stderr = global i32 0
@.str = [136 x i8] c"format: seqtt <replay dir> [filter syscall] [--cache_dir cache_dir] [-filter_inet] [-filter_partfile xxx] [-filter_output_after clock]\0A\00"
@.str.1 = [12 x i8] c"--cache_dir\00"
@.str.2 = [9 x i8] c"-stop_at\00"
@.str.3 = [13 x i8] c"-filter_inet\00"
@.str.4 = [17 x i8] c"-filter_partfile\00"
@.str.5 = [21 x i8] c"-filter_output_after\00"
@.str.6 = [11 x i8] c"/dev/spec0\00"
@O_RDWR = global i32 0
@.str.7 = [16 x i8] c"open /dev/spec0\00"
@.str.8 = [1 x i8] zeroinitializer
@.str.9 = [9 x i8] c"./resume\00"
@.str.10 = [7 x i8] c"resume\00"
@.str.11 = [3 x i8] c"-p\00"
@.str.12 = [10 x i8] c"--pthread\00"
@.str.13 = [26 x i8] c"../eglibc-2.15/prefix/lib\00"
@.str.14 = [41 x i8] c"execl of resume failed, rc=%d, errno=%d\0A\00"
@errno = global i32 0
@.str.15 = [4 x i8] c"pin\00"
@.str.16 = [5 x i8] c"-pid\00"
@.str.17 = [3 x i8] c"%d\00"
@.str.18 = [3 x i8] c"-t\00"
@.str.19 = [33 x i8] c"../dift/obj-ia32/linkage_data.so\00"
@.str.20 = [5 x i8] c"-ofb\00"
@.str.21 = [3 x i8] c"-i\00"
@.str.22 = [3 x i8] c"-f\00"
@.str.23 = [11 x i8] c"inetsocket\00"
@.str.24 = [3 x i8] c"-e\00"
@.str.25 = [3 x i8] c"-l\00"
@.str.26 = [17 x i8] c"../../../pin/pin\00"
@.str.27 = [43 x i8] c"execv of pin tool failed, rc=%d, errno=%d\0A\00"
@.str.28 = [41 x i8] c"waitpid returns %d, errno %d for pid %d\0A\00"
@.str.30 = [8 x i8] c"/tmp/%d\00"
@.str.31 = [28 x i8] c"/bin/ls %s/dataflow.result*\00"
@.str.32 = [2 x i8] c"r\00"
@.str.33 = [23 x i8] c"popen failed: errno %d\00"
@.str.34 = [2 x i8] c".\00"
@.str.35 = [2 x i8] c"\0A\00"
@.str.36 = [37 x i8] c"../dift/obj-ia32/postprocess_linkage\00"
@.str.37 = [20 x i8] c"postprocess_linkage\00"
@.str.38 = [3 x i8] c"-m\00"
@.str.39 = [54 x i8] c"execl of postprocess_linkage failed, rc=%d, errno=%d\0A\00"
@.str.40 = [23 x i8] c"Start time: %ld.%06ld\0A\00"
@.str.41 = [24 x i8] c"Attach time: %ld.%06ld\0A\00"
@.str.42 = [27 x i8] c"Tool done time: %ld.%06ld\0A\00"
@.str.43 = [21 x i8] c"End time: %ld.%06ld\0A\00"
@.str.44 = [24 x i8] c"Tool -> End: %ld.%06ld\0A\00"
@.str.45 = [25 x i8] c"Start -> End: %ld.%06ld\0A\00"
@str = [14 x i8] c"DIFT finished\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = alloca [80 x i8]
%8 = alloca [80 x i8]
%9 = alloca [80 x i8]
%10 = alloca i8*
%11 = alloca [1024 x i8]
%12 = alloca i32
%13 = alloca i64
%14 = alloca [2 x i32]
%15 = alloca [256 x i8*]
%16 = bitcast %struct.timeval* %3 to i8*
%17 = bitcast %struct.timeval* %4 to i8*
%18 = bitcast %struct.timeval* %5 to i8*
%19 = bitcast %struct.timeval* %6 to i8*
%20 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%22 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%23 = bitcast i8** %10 to i8*
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%25 = bitcast i32* %12 to i8*
%26 = bitcast i64* %13 to i8*
store i64 1024, i64* %13
%27 = bitcast [2 x i32]* %14 to i8*
%28 = icmp slt i32 %0, 2
br i1 %28, label %29, label %32
29: ; preds = %2
%30 = load i32, i32* @stderr
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0))
br label %306
32: ; preds = %2
%33 = getelementptr inbounds i8*, i8** %1, i64 1
%34 = load i8*, i8** %33
%35 = icmp eq i32 %0, 2
br i1 %35, label %102, label %36
36: ; preds = %32, %94
%37 = phi i32 [ %100, %94 ], [ 2, %32 ]
%38 = phi i8* [ %99, %94 ], [ null, %32 ]
%39 = phi i8* [ %98, %94 ], [ null, %32 ]
%40 = phi i8* [ %97, %94 ], [ null, %32 ]
%41 = phi i64 [ %96, %94 ], [ 0, %32 ]
%42 = phi i32 [ %95, %94 ], [ 0, %32 ]
%43 = sext i32 %37 to i64
%44 = getelementptr inbounds i8*, i8** %1, i64 %43
%45 = load i8*, i8** %44
%46 = call i64 @strncmp(i8* %45, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1024)
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %54
48: ; preds = %36
%49 = add nsw i32 %37, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8*, i8** %1, i64 %50
%52 = load i8*, i8** %51
%53 = call i32 @strncpy(i8* %24, i8* %52, i32 1024)
br label %94
54: ; preds = %36
%55 = load i8*, i8** %44
%56 = call i64 @strncmp(i8* %55, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 1024)
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %64
58: ; preds = %54
%59 = add nsw i32 %37, 1
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8*, i8** %1, i64 %60
%62 = load i8*, i8** %61
%63 = add nsw i32 %37, 2
br label %94
64: ; preds = %54
%65 = load i8*, i8** %44
%66 = call i64 @strncmp(i8* %65, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 1024)
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %64
%69 = add nsw i32 %37, 1
br label %94
70: ; preds = %64
%71 = load i8*, i8** %44
%72 = call i64 @strncmp(i8* %71, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 1024)
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %80
74: ; preds = %70
%75 = add nsw i32 %37, 1
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i8*, i8** %1, i64 %76
%78 = load i8*, i8** %77
%79 = add nsw i32 %37, 2
br label %94
80: ; preds = %70
%81 = load i8*, i8** %44
%82 = call i64 @strncmp(i8* %81, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 1024)
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %91
84: ; preds = %80
%85 = add nsw i32 %37, 1
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i8*, i8** %1, i64 %86
%88 = load i8*, i8** %87
%89 = call i64 @atoi(i8* %88)
%90 = add nsw i32 %37, 2
br label %94
91: ; preds = %80
%92 = load i32, i32* @stderr
%93 = call i32 (i32, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0))
br label %306
94: ; preds = %58, %74, %84, %68, %48
%95 = phi i32 [ %42, %84 ], [ %42, %74 ], [ 1, %68 ], [ %42, %58 ], [ %42, %48 ]
%96 = phi i64 [ %89, %84 ], [ %41, %74 ], [ %41, %68 ], [ %41, %58 ], [ %41, %48 ]
%97 = phi i8* [ %40, %84 ], [ %40, %74 ], [ %40, %68 ], [ %62, %58 ], [ %40, %48 ]
%98 = phi i8* [ %88, %84 ], [ %39, %74 ], [ %39, %68 ], [ %39, %58 ], [ %39, %48 ]
%99 = phi i8* [ %38, %84 ], [ %78, %74 ], [ %38, %68 ], [ %38, %58 ], [ %38, %48 ]
%100 = phi i32 [ %90, %84 ], [ %79, %74 ], [ %69, %68 ], [ %63, %58 ], [ %49, %48 ]
%101 = icmp slt i32 %100, %0
br i1 %101, label %36, label %102
102: ; preds = %94, %32
%103 = phi i32 [ 0, %32 ], [ %95, %94 ]
%104 = phi i64 [ 0, %32 ], [ %96, %94 ]
%105 = phi i8* [ null, %32 ], [ %97, %94 ]
%106 = phi i8* [ null, %32 ], [ %98, %94 ]
%107 = phi i8* [ null, %32 ], [ %99, %94 ]
%108 = load i32, i32* @O_RDWR
%109 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %108)
%110 = icmp slt i32 %109, 0
br i1 %110, label %111, label %113
111: ; preds = %102
%112 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
br label %306
113: ; preds = %102
%114 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%115 = call i8* (...) @fork()
%116 = ptrtoint i8* %115 to i64
%117 = icmp eq i8* %115, null
br i1 %117, label %118, label %130
118: ; preds = %113
%119 = call i64 @strncmp(i8* %24, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0), i32 1024)
%120 = icmp eq i64 %119, 0
br i1 %120, label %123, label %121
121: ; preds = %118
%122 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %34, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %24, i8* null)
br label %125
123: ; preds = %118
%124 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %34, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i8* null)
br label %125
125: ; preds = %123, %121
%126 = phi i32 [ %122, %121 ], [ %124, %123 ]
%127 = load i32, i32* @stderr
%128 = load i32, i32* @errno
%129 = call i32 (i32, i8*, ...) @fprintf(i32 %127, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.14, i64 0, i64 0), i32 %126, i32 %128)
br label %306
130: ; preds = %113, %130
%131 = call i32 @get_attach_status(i32 %109, i64 %116)
%132 = icmp slt i32 %131, 1
br i1 %132, label %130, label %133
133: ; preds = %130
%134 = call i32 @gettimeofday(%struct.timeval* %4, i32* null)
%135 = call i8* (...) @fork()
%136 = icmp eq i8* %135, null
br i1 %136, label %137, label %178
137: ; preds = %133
%138 = bitcast [256 x i8*]* %15 to i8*
%139 = getelementptr inbounds [256 x i8*], [256 x i8*]* %15, i64 0, i64 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8** %139
%140 = getelementptr inbounds [256 x i8*], [256 x i8*]* %15, i64 0, i64 1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0), i8** %140
%141 = call i32 @sprintf(i8* %20, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i64 %116)
%142 = getelementptr inbounds [256 x i8*], [256 x i8*]* %15, i64 0, i64 2
store i8* %20, i8** %142
%143 = getelementptr inbounds [256 x i8*], [256 x i8*]* %15, i64 0, i64 3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8** %143
%144 = getelementptr inbounds [256 x i8*], [256 x i8*]* %15, i64 0, i64 4
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.19, i64 0, i64 0), i8** %144
%145 = icmp eq i64 %104, 0
br i1 %145, label %149, label %146
146: ; preds = %137
%147 = getelementptr inbounds [256 x i8*], [256 x i8*]* %15, i64 0, i64 5
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i8** %147
%148 = getelementptr inbounds [256 x i8*], [256 x i8*]* %15, i64 0, i64 6
store i8* %106, i8** %148
br label %149
149: ; preds = %146, %137
%150 = phi i64 [ 7, %146 ], [ 5, %137 ]
%151 = icmp eq i32 %103, 0
br i1 %151, label %152, label %154
152: ; preds = %149
%153 = icmp eq i8* %107, null
br i1 %153, label %163, label %154
154: ; preds = %152, %149
%155 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i64 0, i64 0), %149 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.24, i64 0, i64 0), %152 ]
%156 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.23, i64 0, i64 0), %149 ], [ %107, %152 ]
%157 = add nuw nsw i64 %150, 1
%158 = getelementptr inbounds [256 x i8*], [256 x i8*]* %15, i64 0, i64 %150
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i64 0, i64 0), i8** %158
%159 = add nuw nsw i64 %150, 2
%160 = getelementptr inbounds [256 x i8*], [256 x i8*]* %15, i64 0, i64 %157
store i8* %155, i8** %160
%161 = add nuw nsw i64 %150, 3
%162 = getelementptr inbounds [256 x i8*], [256 x i8*]* %15, i64 0, i64 %159
store i8* %156, i8** %162
br label %163
163: ; preds = %154, %152
%164 = phi i64 [ %150, %152 ], [ %161, %154 ]
%165 = icmp eq i8* %105, null
br i1 %165, label %171, label %166
166: ; preds = %163
%167 = add nuw nsw i64 %164, 1
%168 = getelementptr inbounds [256 x i8*], [256 x i8*]* %15, i64 0, i64 %164
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i8** %168
%169 = add nuw nsw i64 %164, 2
%170 = getelementptr inbounds [256 x i8*], [256 x i8*]* %15, i64 0, i64 %167
store i8* %105, i8** %170
br label %171
171: ; preds = %166, %163
%172 = phi i64 [ %169, %166 ], [ %164, %163 ]
%173 = getelementptr inbounds [256 x i8*], [256 x i8*]* %15, i64 0, i64 %172
store i8* null, i8** %173
%174 = call i32 @execv(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.26, i64 0, i64 0), i8** %139)
%175 = load i32, i32* @stderr
%176 = load i32, i32* @errno
%177 = call i32 (i32, i8*, ...) @fprintf(i32 %175, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.27, i64 0, i64 0), i32 %174, i32 %176)
br label %306
178: ; preds = %133
%179 = call i32 @wait_for_replay_group(i32 %109, i64 %116)
%180 = call i32 @waitpid(i64 %116, i32* %12, i32 0)
%181 = icmp slt i32 %180, 0
br i1 %181, label %182, label %186
182: ; preds = %178
%183 = load i32, i32* @stderr
%184 = load i32, i32* @errno
%185 = call i32 (i32, i8*, ...) @fprintf(i32 %183, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.28, i64 0, i64 0), i32 %180, i32 %184, i64 %116)
br label %186
186: ; preds = %182, %178
%187 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%188 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%189 = call i32 @sprintf(i8* %21, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.30, i64 0, i64 0), i64 %116)
%190 = ptrtoint [80 x i8]* %8 to i64
%191 = call i32 @sprintf(i8* %22, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.31, i64 0, i64 0), i64 %190)
%192 = call i32* @popen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.32, i64 0, i64 0))
%193 = icmp eq i32* %192, null
br i1 %193, label %194, label %198
194: ; preds = %186
%195 = load i32, i32* @stderr
%196 = load i32, i32* @errno
%197 = call i32 (i32, i8*, ...) @fprintf(i32 %195, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.33, i64 0, i64 0), i32 %196)
br label %306
198: ; preds = %186
%199 = call dereferenceable_or_null(1024) i8* @malloc(i64 1024)
store i8* %199, i8** %10
%200 = call i32 @getline(i8** %10, i64* %13, i32* %192)
%201 = icmp sgt i32 %200, 0
br i1 %201, label %202, label %229
202: ; preds = %198, %225
%203 = phi i32 [ %226, %225 ], [ 0, %198 ]
%204 = load i8*, i8** %10
%205 = call i8* @strtok(i8* %204, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.34, i64 0, i64 0))
%206 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.34, i64 0, i64 0))
%207 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.34, i64 0, i64 0))
%208 = icmp eq i8* %207, null
br i1 %208, label %225, label %209
209: ; preds = %202
%210 = call i8* @strtok(i8* %207, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.35, i64 0, i64 0))
%211 = call i8* (...) @fork()
%212 = ptrtoint i8* %211 to i64
%213 = trunc i64 %212 to i32
%214 = sext i32 %203 to i64
%215 = getelementptr inbounds [2 x i32], [2 x i32]* %14, i64 0, i64 %214
store i32 %213, i32* %215
%216 = icmp eq i32 %213, 0
br i1 %216, label %217, label %223
217: ; preds = %209
%218 = call i32 @sprintf(i8* %21, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.30, i64 0, i64 0), i64 %116)
%219 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.36, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.38, i64 0, i64 0), i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %210, i8* null)
%220 = load i32, i32* @stderr
%221 = load i32, i32* @errno
%222 = call i32 (i32, i8*, ...) @fprintf(i32 %220, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.39, i64 0, i64 0), i32 %219, i32 %221)
br label %306
223: ; preds = %209
%224 = add nsw i32 %203, 1
br label %225
225: ; preds = %202, %223
%226 = phi i32 [ %224, %223 ], [ %203, %202 ]
%227 = call i32 @getline(i8** %10, i64* %13, i32* %192)
%228 = icmp sgt i32 %227, 0
br i1 %228, label %202, label %229
229: ; preds = %225, %198
%230 = phi i32 [ 0, %198 ], [ %226, %225 ]
%231 = load i8*, i8** %10
%232 = call i32 @free(i8* %231)
%233 = call i8* (...) @fork()
%234 = ptrtoint i8* %233 to i64
%235 = icmp eq i8* %233, null
br i1 %235, label %240, label %236
236: ; preds = %229
%237 = icmp sgt i32 %230, 0
br i1 %237, label %238, label %260
238: ; preds = %236
%239 = zext i32 %230 to i64
br label %246
240: ; preds = %229
%241 = call i32 @sprintf(i8* %21, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.30, i64 0, i64 0), i64 %116)
%242 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.36, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.38, i64 0, i64 0), i8* %21, i8* null)
%243 = load i32, i32* @stderr
%244 = load i32, i32* @errno
%245 = call i32 (i32, i8*, ...) @fprintf(i32 %243, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.39, i64 0, i64 0), i32 %242, i32 %244)
br label %306
246: ; preds = %238, %257
%247 = phi i64 [ 0, %238 ], [ %258, %257 ]
%248 = getelementptr inbounds [2 x i32], [2 x i32]* %14, i64 0, i64 %247
%249 = load i32, i32* %248
%250 = sext i32 %249 to i64
%251 = call i32 @waitpid(i64 %250, i32* %12, i32 0)
%252 = icmp slt i32 %251, 0
br i1 %252, label %253, label %257
253: ; preds = %246
%254 = load i32, i32* @stderr
%255 = load i32, i32* @errno
%256 = call i32 (i32, i8*, ...) @fprintf(i32 %254, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.28, i64 0, i64 0), i32 %251, i32 %255, i64 %116)
br label %257
257: ; preds = %246, %253
%258 = add nuw nsw i64 %247, 1
%259 = icmp eq i64 %258, %239
br i1 %259, label %260, label %246
260: ; preds = %257, %236
%261 = call i32 @waitpid(i64 %234, i32* %12, i32 0)
%262 = icmp slt i32 %261, 0
br i1 %262, label %263, label %267
263: ; preds = %260
%264 = load i32, i32* @stderr
%265 = load i32, i32* @errno
%266 = call i32 (i32, i8*, ...) @fprintf(i32 %264, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.28, i64 0, i64 0), i32 %261, i32 %265, i64 %116)
br label %267
267: ; preds = %263, %260
%268 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%269 = call i32 @close(i32 %109)
%270 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%271 = load i64, i64* %270
%272 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%273 = load i64, i64* %272
%274 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.40, i64 0, i64 0), i64 %271, i64 %273)
%275 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
%276 = load i64, i64* %275
%277 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 1
%278 = load i64, i64* %277
%279 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.41, i64 0, i64 0), i64 %276, i64 %278)
%280 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
%281 = load i64, i64* %280
%282 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 1
%283 = load i64, i64* %282
%284 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.42, i64 0, i64 0), i64 %281, i64 %283)
%285 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 0
%286 = load i64, i64* %285
%287 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 1
%288 = load i64, i64* %287
%289 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.43, i64 0, i64 0), i64 %286, i64 %288)
%290 = sub nsw i64 %288, %283
%291 = icmp slt i64 %290, 0
%292 = sub nsw i64 1, %290
%293 = select i1 %291, i64 %292, i64 %290
%294 = lshr i64 %290, 63
%295 = sub i64 %286, %281
%296 = add i64 %295, %294
%297 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.44, i64 0, i64 0), i64 %296, i64 %293)
%298 = sub nsw i64 %288, %273
%299 = icmp slt i64 %298, 0
%300 = sub nsw i64 1, %298
%301 = select i1 %299, i64 %300, i64 %298
%302 = lshr i64 %298, 63
%303 = sub i64 %286, %271
%304 = add i64 %303, %302
%305 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.45, i64 0, i64 0), i64 %304, i64 %301)
br label %306
306: ; preds = %217, %91, %267, %240, %194, %171, %125, %111, %29
%307 = phi i32 [ -1, %29 ], [ %109, %111 ], [ -1, %125 ], [ -1, %171 ], [ -1, %194 ], [ -1, %240 ], [ 0, %267 ], [ -1, %91 ], [ -1, %217 ]
ret i32 %307
}