// File: ndsol[P]git-mine/hashapi.cpp
// Function: doGitCommit(unsigned long, Sha1Hash&, Blake2Hash&, CommitMessage&)
int doGitCommit(size_t thId, Sha1Hash& sha, Blake2Hash& b2h,
                CommitMessage& noodle) {
  if (printGitCommit(thId, sha, b2h, noodle)) {
    return 1;
  }

  // Create environment for subprocess.
  std::string author = noodle.author;
  size_t pos = author.find("<");
  if (pos == std::string::npos) {
    fprintf(stderr, "Failed to parse author <: %s\n", author.c_str());
    return 1;
  }
  std::string author_email = author.substr(pos + 1);
  if (author_email.find(">") == std::string::npos) {
    fprintf(stderr, "Failed to parse author >: %s\n", author.c_str());
    return 1;
  }
  author = author.substr(0, pos);
  author_email = author_email.substr(0, author_email.find(">"));
  if (author.substr(0, 7) != "author ") {
    fprintf(stderr, "Failed to parse author: %s\n", author.c_str());
    return 1;
  }
  author = author.substr(7);
  std::string author_date = noodle.author_time + noodle.author_tz;
  pos = author_date.find_last_not_of("\r\n ");
  if (pos == std::string::npos) {
    fprintf(stderr, "Failed to trim author_date: %s\n", author_date.c_str());
    return 1;
  }
  author_date = author_date.substr(0, pos + 1);

  std::string com = noodle.committer;
  pos = com.find("<");
  if (pos == std::string::npos) {
    fprintf(stderr, "Failed to parse committer <: %s\n", com.c_str());
    return 1;
  }
  std::string com_email = com.substr(pos + 1);
  if (com.find(">") == std::string::npos) {
    fprintf(stderr, "Failed to parse committer >: %s\n", com.c_str());
    return 1;
  }
  com = com.substr(0, pos);
  com_email = com_email.substr(0, com_email.find(">"));
  if (com.substr(0, 10) != "committer ") {
    fprintf(stderr, "Failed to parse committer: %s\n", com.c_str());
    return 1;
  }
  com = com.substr(10);
  std::string com_date = noodle.committer_time + noodle.committer_tz;
  pos = com_date.find_last_not_of("\r\n ");
  if (pos == std::string::npos) {
    fprintf(stderr, "Failed to trim com_date: %s\n", com_date.c_str());
    return 1;
  }
  com_date = com_date.substr(0, pos + 1);

  std::string parent = noodle.parent;
  if (!parent.empty()) {
    if (parent.substr(0, 7) != "parent ") {
      fprintf(stderr, "Failed to parse parent: %s\n", parent.c_str());
      return 1;
    }
    parent = parent.substr(7);
    pos = parent.find_last_not_of("\r\n ");
    if (pos == std::string::npos) {
      fprintf(stderr, "Failed to trim parent: %s\n", parent.c_str());
      return 1;
    }
    parent = parent.substr(0, pos + 1);
  }

  std::string tree;
  for (pos = 0; pos < noodle.header.size(); pos++) {
    if (noodle.header.at(pos) == 0) {
      pos++;
      if (pos >= noodle.header.size()) {
        fprintf(stderr, "Failed to find tree in header\n");
        return 1;
      }
      tree.assign(noodle.header.data() + pos,
                  noodle.header.size() - pos);
      if (tree.substr(0, 5) != "tree ") {
        fprintf(stderr, "Failed to parse tree: %s\n", tree.c_str());
        return 1;
      }
      tree = tree.substr(5);
      pos = tree.find_last_not_of("\r\n ");
      if (pos == std::string::npos) {
        fprintf(stderr, "Failed to trim tree: %s\n", tree.c_str());
        return 1;
      }
      tree = tree.substr(0, pos + 1);
      break;
    }
  }
  if (pos >= noodle.header.size()) {
    fprintf(stderr, "Failed to parse header\n");
    return 1;
  }

  std::vector<char *> git_env;
  author = "GIT_AUTHOR_NAME=" + author;
  git_env.push_back((char*)author.c_str());
  author_email = "GIT_AUTHOR_EMAIL=" + author_email;
  git_env.push_back((char*)author_email.c_str());
  author_date = "GIT_AUTHOR_DATE=" + author_date;
  git_env.push_back((char*)author_date.c_str());

  com = "GIT_COMMITTER_NAME=" + com;
  git_env.push_back((char*)com.c_str());
  com_email = "GIT_COMMITTER_EMAIL=" + com_email;
  git_env.push_back((char*)com_email.c_str());
  com_date = "GIT_COMMITTER_DATE=" + com_date;
  git_env.push_back((char*)com_date.c_str());

  if (0) {
    fprintf(stderr, "tree \"%s\"\n", tree.c_str());
    if (!parent.empty()) fprintf(stderr, "parent \"%s\"\n", parent.c_str());
    fprintf(stderr, "\"%s\" \"%s\" \"%s\"\n",
            author.c_str(), author_email.c_str(), author_date.c_str());
    fprintf(stderr, "\"%s\" \"%s\" \"%s\"\n",
            com.c_str(), com_email.c_str(), com_date.c_str());
  }

  char ** p = environ;
  while (*p) {
    git_env.push_back(*p);
    p++;
  }
  git_env.push_back(NULL);  // Terminate the environment linked list.

  int pipe1[2];
  if (pipe(pipe1) < 0) {
    fprintf(stderr, "pipe(pipe1): %d %s\n", errno, strerror(errno));
    return 1;
  }
  int pipe2[2];
  if (pipe(pipe2) < 0) {
    fprintf(stderr, "pipe(pipe2): %d %s\n", errno, strerror(errno));
    return 1;
  }

  signal(SIGPIPE, handle_SIGPIPE);
  char* git_argv[] = {
    (char*)"git", (char*)"commit-tree", (char*)tree.c_str(),
    NULL,  // Terminate git_argv with a NULL.
    NULL,
    NULL,
  };
  if (!parent.empty()) {
    git_argv[3] = (char*)"-p";
    git_argv[4] = (char*)parent.c_str();
  }

  int pid = fork();
  if (pid < 0) {
    fprintf(stderr, "fork(git commit-tree) failed: %d %s\n", errno,
            strerror(errno));
    return 1;
  }
  if (!pid) {
    // In child process: exec(git commit-tree).
    close(pipe1[0]);  // Close "read end"
    dup2(pipe1[1], 1);  // Redirect stdout to pipe1[1] ("write end")
    dup2(pipe1[1], 2);  // Redirect stderr to pipe1[1] ("write end")
    close(pipe1[1]);  // Close "write end" since it is now stdout/stderr.
    close(pipe2[1]);  // Close "write end"
    dup2(pipe2[0], 0);  // Redirect pipe2[0] ("read end") to stdin
    close(pipe2[0]);  // Close "read end"
    execvpe("git", git_argv, git_env.data());
    fprintf(stderr, "execvpe(git commit-tree) failed: %d %s\n", errno,
            strerror(errno));
    fflush(stderr);
    _exit(1);
  }
  close(pipe1[1]);  // Close "write end" that will not be used in parent
  close(pipe2[0]);  // Close "read end" that will not be used in parent

  // Wait for child (and read in what it says).
  std::string output;
  int epollfd = epoll_create1(0 /*flags*/);
  if (epollfd < 0) {
    fprintf(stderr, "epoll_create1 failed: %d %s\n", errno, strerror(errno));
    return 1;
  }

  std::vector<epoll_event> events;
  events.emplace_back();
  events.back().events = EPOLLIN;
  events.back().data.fd = pipe1[0];
  if (epoll_ctl(epollfd, EPOLL_CTL_ADD, pipe1[0], &events.back())) {
    fprintf(stderr, "EPOLL_CTL_ADD pipe1 failed: %d %s\n", errno,
            strerror(errno));
    return 1;
  }
  events.emplace_back();
  events.back().events = EPOLLOUT;
  events.back().data.fd = pipe2[1];
  if (epoll_ctl(epollfd, EPOLL_CTL_ADD, pipe2[1], &events.back())) {
    fprintf(stderr, "EPOLL_CTL_ADD pipe2 failed: %d %s\n", errno,
            strerror(errno));
    return 1;
  }

  int go = 1;
  size_t wrote_count = 0;
  while (go) {
    int r = epoll_wait(epollfd, events.data(), events.size(),
                        1000 /*milliseconds*/);
    if (r < 0) {
      fprintf(stderr, "epoll_wait failed: %d %s\n", errno, strerror(errno));
      return 1;
    } else if ((size_t)r > events.size()) {
      fprintf(stderr, "epoll_wait referred to %d, only %zu exist\n", r,
              events.size());
      return 1;
    } else if (!r) {
      fprintf(stderr, "Waiting for pid %d: git commit-tree...\n", pid);
      continue;
    }
    for (size_t i = 0; i < (size_t)r; i++) {
      if (events.at(i).data.fd == pipe1[0]) {
        if (events.at(i).events & EPOLLHUP) {
          go = 0;
          continue;
        }
        char buf[256];
        ssize_t nr = read(pipe1[0], buf, sizeof(buf));
        if (nr < 0) {
          fprintf(stderr, "read(pipe1[0]) failed: %d %s\n", errno,
                  strerror(errno));
          return 1;
        }
        if (nr == 0) {
          // 0 bytes indicates pipe1[0] was closed.
          close(pipe1[0]);
          go = 0;
          continue;
        }
        std::string s(buf, nr);
        output += s;
      } else if (events.at(i).data.fd == pipe2[1]) {
        // Stream commit message to child process.
        ssize_t wrlen = write(pipe2[1], noodle.log.c_str() + wrote_count,
                              noodle.log.size() - wrote_count);
        if (wrlen != ssize_t(noodle.log.size() - wrote_count)) {
          fprintf(stderr, "Write failed: %d %s (wrote %lld, want %lld)\n",
                  errno, strerror(errno), (long long) wrlen,
                  (long long) noodle.log.size() - wrote_count);
          close(pipe2[1]);
          return 1;
        }
        wrote_count += wrlen;
        if (wrote_count >= noodle.log.size()) {
          // All of noodle.log was sent. Close pipe2[1] so child knows.
          if (epoll_ctl(epollfd, EPOLL_CTL_DEL, pipe2[1], &events.at(i))) {
            fprintf(stderr, "EPOLL_CTL_DEL pipe2 failed: %d %s\n", errno,
                    strerror(errno));
            return 1;
          }
          close(pipe2[1]);
        }
      }
    }
  }
  int code;
  int waitres = waitpid(pid, &code, 0);
  if (waitres != pid) {
    fprintf(stderr, "waitpid failed: got %d, want pid %d. %d %s\n",
            waitres, pid, errno, strerror(errno));
    return 1;
  }
  // wantOutput has the hexdump of sha1 from the top of the function.
  char buf[1024];
  if (sha.dump(buf, sizeof(buf))) {
    fprintf(stderr, "sha.dump failed\n");
    return 1;
  }
  snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "\n");
  if (code || output != buf) {
    fprintf(stderr, "git commit-tree exited with code %d:\n", code);
    fprintf(stderr, "%s", output.c_str());
    return 1;
  }
  fprintf(stderr, "repo updated.\n# hint: %s %s",
          "git checkout master; git reset --hard", buf);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd80, %rsp            # imm = 0xD80
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x12ea0
cmpl $0x0, %eax
je 0x13341
movl $0x1, -0x4(%rbp)
jmp 0x151b4
movq -0x28(%rbp), %rsi
addq $0x40, %rsi
leaq -0x48(%rbp), %rdi
callq 0x4130
leaq -0x48(%rbp), %rdi
leaq 0x4f35(%rip), %rsi      # 0x18292
xorl %eax, %eax
movl %eax, %edx
callq 0x46a0
movq %rax, -0x50(%rbp)
cmpq $-0x1, -0x50(%rbp)
jne 0x133b6
movq 0xcc60(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xa58(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x4110
movq -0xa58(%rbp), %rdi
movq %rax, %rdx
leaq 0x558f(%rip), %rsi      # 0x1892b
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x1519e
movq -0x50(%rbp), %rdx
incq %rdx
leaq -0x78(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movq $-0x1, %rcx
callq 0x4330
jmp 0x133d3
leaq -0x78(%rbp), %rdi
leaq 0x4eb6(%rip), %rsi      # 0x18294
xorl %eax, %eax
movl %eax, %edx
callq 0x46a0
cmpq $-0x1, %rax
jne 0x13446
movq 0xcbe4(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xa60(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x4110
movq -0xa60(%rbp), %rdi
movq %rax, %rdx
leaq 0x5531(%rip), %rsi      # 0x18949
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x15188
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x151a9
movq -0x50(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0xa8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x4330
jmp 0x13460
leaq -0x48(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
movq %rsi, -0xa78(%rbp)
callq 0x43e0
movq -0xa78(%rbp), %rdi
callq 0x4200
leaq 0x4e0a(%rip), %rsi      # 0x18294
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0xa68(%rbp)
leaq -0x78(%rbp), %rdi
movq %rdi, -0xa70(%rbp)
callq 0x46a0
movq -0xa70(%rbp), %rsi
movq -0xa68(%rbp), %rdx
movq %rax, %rcx
leaq -0xc8(%rbp), %rdi
callq 0x4330
jmp 0x134c4
leaq -0x78(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
movq %rsi, -0xa80(%rbp)
callq 0x43e0
movq -0xa80(%rbp), %rdi
callq 0x4200
xorl %eax, %eax
movl %eax, %edx
leaq -0xe8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movl $0x7, %ecx
callq 0x4330
jmp 0x13502
leaq 0x4d39(%rip), %rsi      # 0x18242
leaq -0xe8(%rbp), %rdi
callq 0x152b0
movb %al, -0xa81(%rbp)
jmp 0x1351d
leaq -0xe8(%rbp), %rdi
callq 0x4200
movb -0xa81(%rbp), %al
testb $0x1, %al
jne 0x13535
jmp 0x135ae
movq 0xca9c(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xa90(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x4110
movq -0xa90(%rbp), %rdi
movq %rax, %rdx
leaq 0x5407(%rip), %rsi      # 0x18967
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x15188
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x15193
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x4200
jmp 0x15193
leaq -0x108(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movl $0x7, %edx
movq $-0x1, %rcx
callq 0x4330
jmp 0x135cc
leaq -0x48(%rbp), %rdi
leaq -0x108(%rbp), %rsi
movq %rsi, -0xa98(%rbp)
callq 0x43e0
movq -0xa98(%rbp), %rdi
callq 0x4200
movq -0x28(%rbp), %rdx
movq %rdx, %rsi
addq $0x60, %rsi
subq $-0x80, %rdx
leaq -0x128(%rbp), %rdi
callq 0x8480
jmp 0x1360c
leaq -0x128(%rbp), %rdi
leaq 0x5369(%rip), %rsi      # 0x18983
movq $-0x1, %rdx
callq 0x4630
movq %rax, -0x50(%rbp)
cmpq $-0x1, -0x50(%rbp)
jne 0x13679
movq 0xc9a0(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xaa0(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x4110
movq -0xaa0(%rbp), %rdi
movq %rax, %rdx
leaq 0x5328(%rip), %rsi      # 0x18987
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x1516c
movq -0x50(%rbp), %rcx
incq %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x148(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x4330
jmp 0x13699
leaq -0x128(%rbp), %rdi
leaq -0x148(%rbp), %rsi
movq %rsi, -0xaa8(%rbp)
callq 0x43e0
movq -0xaa8(%rbp), %rdi
callq 0x4200
movq -0x28(%rbp), %rsi
addq $0xa0, %rsi
leaq -0x168(%rbp), %rdi
callq 0x4130
jmp 0x136d8
leaq -0x168(%rbp), %rdi
leaq 0x4bac(%rip), %rsi      # 0x18292
xorl %eax, %eax
movl %eax, %edx
callq 0x46a0
movq %rax, -0x50(%rbp)
cmpq $-0x1, -0x50(%rbp)
jne 0x13756
movq 0xc8d7(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xab0(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x4110
movq -0xab0(%rbp), %rdi
movq %rax, %rdx
leaq 0x527f(%rip), %rsi      # 0x189a7
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x15150
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x1517a
movq -0x50(%rbp), %rdx
incq %rdx
leaq -0x188(%rbp), %rdi
leaq -0x168(%rbp), %rsi
movq $-0x1, %rcx
callq 0x4330
jmp 0x13779
leaq -0x168(%rbp), %rdi
leaq 0x4b0d(%rip), %rsi      # 0x18294
xorl %eax, %eax
movl %eax, %edx
callq 0x46a0
cmpq $-0x1, %rax
jne 0x137f2
movq 0xc83b(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xab8(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x4110
movq -0xab8(%rbp), %rdi
movq %rax, %rdx
leaq 0x5204(%rip), %rsi      # 0x189c8
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x15134
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x1515e
movq -0x50(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x1a8(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x4330
jmp 0x1380f
leaq -0x168(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
movq %rsi, -0xad0(%rbp)
callq 0x43e0
movq -0xad0(%rbp), %rdi
callq 0x4200
leaq 0x4a58(%rip), %rsi      # 0x18294
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0xac0(%rbp)
leaq -0x188(%rbp), %rdi
movq %rdi, -0xac8(%rbp)
callq 0x46a0
movq -0xac8(%rbp), %rsi
movq -0xac0(%rbp), %rdx
movq %rax, %rcx
leaq -0x1c8(%rbp), %rdi
callq 0x4330
jmp 0x13879
leaq -0x188(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movq %rsi, -0xad8(%rbp)
callq 0x43e0
movq -0xad8(%rbp), %rdi
callq 0x4200
xorl %eax, %eax
movl %eax, %edx
leaq -0x1e8(%rbp), %rdi
leaq -0x168(%rbp), %rsi
movl $0xa, %ecx
callq 0x4330
jmp 0x138bd
leaq 0x4986(%rip), %rsi      # 0x1824a
leaq -0x1e8(%rbp), %rdi
callq 0x152b0
movb %al, -0xad9(%rbp)
jmp 0x138d8
leaq -0x1e8(%rbp), %rdi
callq 0x4200
movb -0xad9(%rbp), %al
testb $0x1, %al
jne 0x138f0
jmp 0x1396c
movq 0xc6e1(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xae8(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x4110
movq -0xae8(%rbp), %rdi
movq %rax, %rdx
leaq 0x50cb(%rip), %rsi      # 0x189e9
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x15134
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x15142
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x4200
jmp 0x15142
leaq -0x208(%rbp), %rdi
leaq -0x168(%rbp), %rsi
movl $0xa, %edx
movq $-0x1, %rcx
callq 0x4330
jmp 0x1398d
leaq -0x168(%rbp), %rdi
leaq -0x208(%rbp), %rsi
movq %rsi, -0xaf0(%rbp)
callq 0x43e0
movq -0xaf0(%rbp), %rdi
callq 0x4200
movq -0x28(%rbp), %rdx
movq %rdx, %rsi
addq $0xc0, %rsi
addq $0xe0, %rdx
leaq -0x228(%rbp), %rdi
callq 0x8480
jmp 0x139d6
leaq -0x228(%rbp), %rdi
leaq 0x4f9f(%rip), %rsi      # 0x18983
movq $-0x1, %rdx
callq 0x4630
movq %rax, -0x50(%rbp)
cmpq $-0x1, -0x50(%rbp)
jne 0x13a43
movq 0xc5d6(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xaf8(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x4110
movq -0xaf8(%rbp), %rdi
movq %rax, %rdx
leaq 0x4fdf(%rip), %rsi      # 0x18a08
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x15118
movq -0x50(%rbp), %rcx
incq %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x248(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x4330
jmp 0x13a63
leaq -0x228(%rbp), %rdi
leaq -0x248(%rbp), %rsi
movq %rsi, -0xb00(%rbp)
callq 0x43e0
movq -0xb00(%rbp), %rdi
callq 0x4200
movq -0x28(%rbp), %rsi
addq $0x20, %rsi
leaq -0x268(%rbp), %rdi
callq 0x4130
jmp 0x13a9f
leaq -0x268(%rbp), %rdi
callq 0x45c0
testb $0x1, %al
jne 0x13c83
xorl %eax, %eax
movl %eax, %edx
leaq -0x288(%rbp), %rdi
leaq -0x268(%rbp), %rsi
movl $0x7, %ecx
callq 0x4330
jmp 0x13ad1
leaq 0x4762(%rip), %rsi      # 0x1823a
leaq -0x288(%rbp), %rdi
callq 0x152b0
movb %al, -0xb01(%rbp)
jmp 0x13aec
leaq -0x288(%rbp), %rdi
callq 0x4200
movb -0xb01(%rbp), %al
testb $0x1, %al
jne 0x13b07
jmp 0x13b97
movq 0xc4ca(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xb10(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x4110
movq -0xb10(%rbp), %rdi
movq %rax, %rdx
leaq 0x4ef0(%rip), %rsi      # 0x18a25
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x150fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x15126
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x1510a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x4200
jmp 0x1510a
leaq -0x2a8(%rbp), %rdi
leaq -0x268(%rbp), %rsi
movl $0x7, %edx
movq $-0x1, %rcx
callq 0x4330
jmp 0x13bb8
leaq -0x268(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x43e0
leaq -0x2a8(%rbp), %rdi
callq 0x4200
leaq -0x268(%rbp), %rdi
leaq 0x4d9e(%rip), %rsi      # 0x18983
movq $-0x1, %rdx
callq 0x4630
movq %rax, -0x50(%rbp)
cmpq $-0x1, -0x50(%rbp)
jne 0x13c44
movq 0xc3d5(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xb18(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x4110
movq -0xb18(%rbp), %rdi
movq %rax, %rdx
leaq 0x4e17(%rip), %rsi      # 0x18a41
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x150fc
movq -0x50(%rbp), %rcx
incq %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x2c8(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x4330
jmp 0x13c64
leaq -0x268(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x43e0
leaq -0x2c8(%rbp), %rdi
callq 0x4200
leaq -0x2e8(%rbp), %rdi
callq 0x4490
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xb20(%rbp)
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
callq 0x7d40
movq %rax, %rcx
movq -0xb20(%rbp), %rax
cmpq %rcx, %rax
jae 0x13f62
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
movq -0x50(%rbp), %rsi
callq 0x152e0
movq %rax, -0xb28(%rbp)
jmp 0x13cdc
movq -0xb28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x13f4f
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xb30(%rbp)
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
callq 0x7d40
movq %rax, %rcx
movq -0xb30(%rbp), %rax
cmpq %rcx, %rax
jb 0x13d61
movq 0xc2af(%rip), %rax      # 0x1ffd8
movq (%rax), %rdi
leaq 0x4d29(%rip), %rsi      # 0x18a5c
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x150e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x150ee
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
callq 0x8100
movq -0x50(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xb38(%rbp)
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
callq 0x7d40
movq -0xb38(%rbp), %rsi
movq %rax, %rdx
movq -0x50(%rbp), %rax
subq %rax, %rdx
leaq -0x2e8(%rbp), %rdi
callq 0x4450
jmp 0x13da8
xorl %eax, %eax
movl %eax, %edx
leaq -0x308(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
movl $0x5, %ecx
callq 0x4330
jmp 0x13dc6
leaq 0x43a3(%rip), %rsi      # 0x18170
leaq -0x308(%rbp), %rdi
callq 0x152b0
movb %al, -0xb39(%rbp)
jmp 0x13de1
leaq -0x308(%rbp), %rdi
callq 0x4200
movb -0xb39(%rbp), %al
testb $0x1, %al
jne 0x13df9
jmp 0x13e61
movq 0xc1d8(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xb48(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x4110
movq -0xb48(%rbp), %rdi
movq %rax, %rdx
leaq 0x4c54(%rip), %rsi      # 0x18a7b
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x150e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x308(%rbp), %rdi
callq 0x4200
jmp 0x150ee
leaq -0x328(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
movl $0x5, %edx
movq $-0x1, %rcx
callq 0x4330
jmp 0x13e82
leaq -0x2e8(%rbp), %rdi
leaq -0x328(%rbp), %rsi
callq 0x43e0
leaq -0x328(%rbp), %rdi
callq 0x4200
leaq -0x2e8(%rbp), %rdi
leaq 0x4ad4(%rip), %rsi      # 0x18983
movq $-0x1, %rdx
callq 0x4630
movq %rax, -0x50(%rbp)
cmpq $-0x1, -0x50(%rbp)
jne 0x13f0e
movq 0xc10b(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xb50(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x4110
movq -0xb50(%rbp), %rdi
movq %rax, %rdx
leaq 0x4ba1(%rip), %rsi      # 0x18a95
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x150e0
movq -0x50(%rbp), %rcx
incq %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x348(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x4330
jmp 0x13f2e
leaq -0x2e8(%rbp), %rdi
leaq -0x348(%rbp), %rsi
callq 0x43e0
leaq -0x348(%rbp), %rdi
callq 0x4200
jmp 0x13f62
jmp 0x13f51
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x13c97
movq -0x50(%rbp), %rax
movq %rax, -0xb58(%rbp)
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
callq 0x7d40
movq %rax, %rcx
movq -0xb58(%rbp), %rax
cmpq %rcx, %rax
jb 0x13fb4
movq 0xc048(%rip), %rax      # 0x1ffd8
movq (%rax), %rdi
leaq 0x4b14(%rip), %rsi      # 0x18aae
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x150e0
leaq -0x360(%rbp), %rdi
callq 0x15320
leaq 0x4aff(%rip), %rsi      # 0x18ac6
leaq -0x380(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x15340
jmp 0x13fd9
leaq -0x48(%rbp), %rdi
movq %rdi, -0xb60(%rbp)
leaq -0x380(%rbp), %rsi
movq %rsi, -0xb68(%rbp)
callq 0x43e0
movq -0xb68(%rbp), %rdi
callq 0x4200
movq -0xb60(%rbp), %rdi
callq 0x4110
movq %rax, -0x388(%rbp)
leaq -0x360(%rbp), %rdi
leaq -0x388(%rbp), %rsi
callq 0x15450
jmp 0x1402b
leaq 0x4aa5(%rip), %rsi      # 0x18ad7
leaq -0x3a8(%rbp), %rdi
leaq -0x78(%rbp), %rdx
callq 0x15340
jmp 0x14044
leaq -0x78(%rbp), %rdi
movq %rdi, -0xb70(%rbp)
leaq -0x3a8(%rbp), %rsi
movq %rsi, -0xb78(%rbp)
callq 0x43e0
movq -0xb78(%rbp), %rdi
callq 0x4200
movq -0xb70(%rbp), %rdi
callq 0x4110
movq %rax, -0x3b0(%rbp)
leaq -0x360(%rbp), %rdi
leaq -0x3b0(%rbp), %rsi
callq 0x15450
jmp 0x14096
leaq 0x4a4c(%rip), %rsi      # 0x18ae9
leaq -0x3d0(%rbp), %rdi
leaq -0x128(%rbp), %rdx
callq 0x15340
jmp 0x140b2
leaq -0x128(%rbp), %rdi
movq %rdi, -0xb80(%rbp)
leaq -0x3d0(%rbp), %rsi
movq %rsi, -0xb88(%rbp)
callq 0x43e0
movq -0xb88(%rbp), %rdi
callq 0x4200
movq -0xb80(%rbp), %rdi
callq 0x4110
movq %rax, -0x3d8(%rbp)
leaq -0x360(%rbp), %rdi
leaq -0x3d8(%rbp), %rsi
callq 0x15450
jmp 0x14107
leaq 0x49ec(%rip), %rsi      # 0x18afa
leaq -0x3f8(%rbp), %rdi
leaq -0x168(%rbp), %rdx
callq 0x15340
jmp 0x14123
leaq -0x168(%rbp), %rdi
movq %rdi, -0xb90(%rbp)
leaq -0x3f8(%rbp), %rsi
movq %rsi, -0xb98(%rbp)
callq 0x43e0
movq -0xb98(%rbp), %rdi
callq 0x4200
movq -0xb90(%rbp), %rdi
callq 0x4110
movq %rax, -0x400(%rbp)
leaq -0x360(%rbp), %rdi
leaq -0x400(%rbp), %rsi
callq 0x15450
jmp 0x14178
leaq 0x498f(%rip), %rsi      # 0x18b0e
leaq -0x420(%rbp), %rdi
leaq -0x188(%rbp), %rdx
callq 0x15340
jmp 0x14194
leaq -0x188(%rbp), %rdi
movq %rdi, -0xba0(%rbp)
leaq -0x420(%rbp), %rsi
movq %rsi, -0xba8(%rbp)
callq 0x43e0
movq -0xba8(%rbp), %rdi
callq 0x4200
movq -0xba0(%rbp), %rdi
callq 0x4110
movq %rax, -0x428(%rbp)
leaq -0x360(%rbp), %rdi
leaq -0x428(%rbp), %rsi
callq 0x15450
jmp 0x141e9
leaq 0x4933(%rip), %rsi      # 0x18b23
leaq -0x448(%rbp), %rdi
leaq -0x228(%rbp), %rdx
callq 0x15340
jmp 0x14205
leaq -0x228(%rbp), %rdi
movq %rdi, -0xbb0(%rbp)
leaq -0x448(%rbp), %rsi
movq %rsi, -0xbb8(%rbp)
callq 0x43e0
movq -0xbb8(%rbp), %rdi
callq 0x4200
movq -0xbb0(%rbp), %rdi
callq 0x4110
movq %rax, -0x450(%rbp)
leaq -0x360(%rbp), %rdi
leaq -0x450(%rbp), %rsi
callq 0x15450
jmp 0x1425a
movq 0xbd7f(%rip), %rax      # 0x1ffe0
movq (%rax), %rax
movq %rax, -0x458(%rbp)
movq -0x458(%rbp), %rax
cmpq $0x0, (%rax)
je 0x142b5
movq -0x458(%rbp), %rsi
leaq -0x360(%rbp), %rdi
callq 0x15480
jmp 0x1428d
movq -0x458(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x458(%rbp)
jmp 0x1426b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x150d2
movq $0x0, -0x460(%rbp)
leaq -0x360(%rbp), %rdi
leaq -0x460(%rbp), %rsi
callq 0x15450
jmp 0x142d5
leaq -0x468(%rbp), %rdi
callq 0x4460
cmpl $0x0, %eax
jge 0x14341
movq 0xbceb(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xbc8(%rbp)
callq 0x4030
movl (%rax), %eax
movl %eax, -0xbbc(%rbp)
callq 0x4030
movl (%rax), %edi
callq 0x40c0
movq -0xbc8(%rbp), %rdi
movl -0xbbc(%rbp), %edx
movq %rax, %rcx
leaq 0x4810(%rip), %rsi      # 0x18b37
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x150c4
leaq -0x470(%rbp), %rdi
callq 0x4460
cmpl $0x0, %eax
jge 0x143ad
movq 0xbc7f(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xbd8(%rbp)
callq 0x4030
movl (%rax), %eax
movl %eax, -0xbcc(%rbp)
callq 0x4030
movl (%rax), %edi
callq 0x40c0
movq -0xbd8(%rbp), %rdi
movl -0xbcc(%rbp), %edx
movq %rax, %rcx
leaq 0x47b8(%rip), %rsi      # 0x18b4b
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x150c4
movl $0xd, %edi
leaq 0xe17(%rip), %rsi       # 0x151d0
callq 0x43d0
leaq 0x479a(%rip), %rax      # 0x18b5f
movq %rax, -0x4a0(%rbp)
leaq 0x4790(%rip), %rax      # 0x18b63
movq %rax, -0x498(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x4110
movq %rax, -0x490(%rbp)
movq $0x0, -0x488(%rbp)
movq $0x0, -0x480(%rbp)
movq $0x0, -0x478(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x45c0
testb $0x1, %al
jne 0x1443f
leaq 0x474a(%rip), %rax      # 0x18b6f
movq %rax, -0x488(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x4110
movq %rax, -0x480(%rbp)
callq 0x4080
movl %eax, -0x4a4(%rbp)
cmpl $0x0, -0x4a4(%rbp)
jge 0x144ae
movq 0xbb7e(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xbe8(%rbp)
callq 0x4030
movl (%rax), %eax
movl %eax, -0xbdc(%rbp)
callq 0x4030
movl (%rax), %edi
callq 0x40c0
movq -0xbe8(%rbp), %rdi
movl -0xbdc(%rbp), %edx
movq %rax, %rcx
leaq 0x46de(%rip), %rsi      # 0x18b72
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x150c4
cmpl $0x0, -0x4a4(%rbp)
jne 0x145aa
movl -0x468(%rbp), %edi
callq 0x4680
jmp 0x144c8
movl -0x464(%rbp), %edi
movl $0x1, %esi
callq 0x42e0
movl -0x464(%rbp), %edi
movl $0x2, %esi
callq 0x42e0
movl -0x464(%rbp), %edi
callq 0x4680
jmp 0x144f5
movl -0x46c(%rbp), %edi
callq 0x4680
jmp 0x14502
movl -0x470(%rbp), %edi
xorl %esi, %esi
callq 0x42e0
movl -0x470(%rbp), %edi
callq 0x4680
jmp 0x1451c
leaq -0x360(%rbp), %rdi
callq 0x154f0
movq %rax, %rdx
leaq 0x462d(%rip), %rdi      # 0x18b5f
leaq -0x4a0(%rbp), %rsi
callq 0x4660
movq 0xba93(%rip), %rax      # 0x1ffd8
movq %rax, -0xbf0(%rbp)
movq (%rax), %rax
movq %rax, -0xc00(%rbp)
callq 0x4030
movl (%rax), %eax
movl %eax, -0xbf4(%rbp)
callq 0x4030
movl (%rax), %edi
callq 0x40c0
movq -0xc00(%rbp), %rdi
movl -0xbf4(%rbp), %edx
movq %rax, %rcx
leaq 0x4611(%rip), %rsi      # 0x18b97
xorl %eax, %eax
callq 0x44c0
movq -0xbf0(%rbp), %rax
movq (%rax), %rdi
callq 0x43b0
jmp 0x1459e
movl $0x1, %edi
callq 0x4570
jmp 0x145aa
movl -0x464(%rbp), %edi
callq 0x4680
jmp 0x145b7
movl -0x470(%rbp), %edi
callq 0x4680
jmp 0x145c4
leaq -0x4c8(%rbp), %rdi
callq 0x4490
xorl %edi, %edi
callq 0x4420
movl %eax, -0x4cc(%rbp)
cmpl $0x0, -0x4cc(%rbp)
jge 0x14641
movq 0xb9eb(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xc10(%rbp)
callq 0x4030
movl (%rax), %eax
movl %eax, -0xc04(%rbp)
callq 0x4030
movl (%rax), %edi
callq 0x40c0
movq -0xc10(%rbp), %rdi
movl -0xc04(%rbp), %edx
movq %rax, %rcx
leaq 0x4598(%rip), %rsi      # 0x18bbf
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x150b8
leaq -0x4e8(%rbp), %rdi
movq %rdi, -0xc18(%rbp)
callq 0x15510
movq -0xc18(%rbp), %rdi
callq 0x15530
jmp 0x14662
leaq -0x4e8(%rbp), %rdi
callq 0x155a0
movl $0x1, (%rax)
movl -0x468(%rbp), %eax
movl %eax, -0xc24(%rbp)
leaq -0x4e8(%rbp), %rdi
callq 0x155a0
movl -0xc24(%rbp), %ecx
movl %ecx, 0x4(%rax)
movl -0x4cc(%rbp), %eax
movl %eax, -0xc20(%rbp)
movl -0x468(%rbp), %eax
movl %eax, -0xc1c(%rbp)
leaq -0x4e8(%rbp), %rdi
callq 0x155a0
movl -0xc20(%rbp), %edi
movl -0xc1c(%rbp), %edx
movq %rax, %rcx
movl $0x1, %esi
callq 0x4480
cmpl $0x0, %eax
je 0x14746
movq 0xb8fa(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xc30(%rbp)
callq 0x4030
movl (%rax), %eax
movl %eax, -0xc28(%rbp)
callq 0x4030
movl (%rax), %edi
callq 0x40c0
movq -0xc30(%rbp), %rdi
movl -0xc28(%rbp), %edx
movq %rax, %rcx
leaq 0x44c4(%rip), %rsi      # 0x18bdc
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x15090
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x1509e
leaq -0x4e8(%rbp), %rdi
callq 0x15530
jmp 0x14754
leaq -0x4e8(%rbp), %rdi
callq 0x155a0
movl $0x4, (%rax)
movl -0x46c(%rbp), %eax
movl %eax, -0xc3c(%rbp)
leaq -0x4e8(%rbp), %rdi
callq 0x155a0
movl -0xc3c(%rbp), %ecx
movl %ecx, 0x4(%rax)
movl -0x4cc(%rbp), %eax
movl %eax, -0xc38(%rbp)
movl -0x46c(%rbp), %eax
movl %eax, -0xc34(%rbp)
leaq -0x4e8(%rbp), %rdi
callq 0x155a0
movl -0xc38(%rbp), %edi
movl -0xc34(%rbp), %edx
movq %rax, %rcx
movl $0x1, %esi
callq 0x4480
cmpl $0x0, %eax
je 0x14824
movq 0xb808(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xc48(%rbp)
callq 0x4030
movl (%rax), %eax
movl %eax, -0xc40(%rbp)
callq 0x4030
movl (%rax), %edi
callq 0x40c0
movq -0xc48(%rbp), %rdi
movl -0xc40(%rbp), %edx
movq %rax, %rcx
leaq 0x43f5(%rip), %rsi      # 0x18bff
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x15090
movl $0x1, -0x4ec(%rbp)
movq $0x0, -0x4f8(%rbp)
cmpl $0x0, -0x4ec(%rbp)
je 0x14e65
movl -0x4cc(%rbp), %eax
movl %eax, -0xc5c(%rbp)
leaq -0x4e8(%rbp), %rdi
movq %rdi, -0xc68(%rbp)
callq 0x155e0
movq -0xc68(%rbp), %rdi
movq %rax, -0xc58(%rbp)
callq 0x15600
movl -0xc5c(%rbp), %edi
movq -0xc58(%rbp), %rsi
movl %eax, %edx
movl $0x3e8, %ecx            # imm = 0x3E8
callq 0x4180
movl %eax, -0xc4c(%rbp)
jmp 0x14899
movl -0xc4c(%rbp), %eax
movl %eax, -0x4fc(%rbp)
cmpl $0x0, -0x4fc(%rbp)
jge 0x14909
movq 0xb723(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xc78(%rbp)
callq 0x4030
movl (%rax), %eax
movl %eax, -0xc6c(%rbp)
callq 0x4030
movl (%rax), %edi
callq 0x40c0
movq -0xc78(%rbp), %rdi
movl -0xc6c(%rbp), %edx
movq %rax, %rcx
leaq 0x4333(%rip), %rsi      # 0x18c22
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x15090
movslq -0x4fc(%rbp), %rax
movq %rax, -0xc80(%rbp)
leaq -0x4e8(%rbp), %rdi
callq 0x15600
movq %rax, %rcx
movq -0xc80(%rbp), %rax
cmpq %rcx, %rax
jbe 0x1498c
movq 0xb69f(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xc90(%rbp)
movl -0x4fc(%rbp), %eax
movl %eax, -0xc84(%rbp)
leaq -0x4e8(%rbp), %rdi
callq 0x15600
movq -0xc90(%rbp), %rdi
movl -0xc84(%rbp), %edx
movq %rax, %rcx
leaq 0x42ca(%rip), %rsi      # 0x18c3c
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x15090
cmpl $0x0, -0x4fc(%rbp)
jne 0x149b8
movq 0xb63c(%rip), %rax      # 0x1ffd8
movq (%rax), %rdi
movl -0x4a4(%rbp), %edx
leaq 0x42bb(%rip), %rsi      # 0x18c67
movb $0x0, %al
callq 0x44c0
jmp 0x14839
jmp 0x149ba
jmp 0x149bc
movq $0x0, -0x508(%rbp)
movq -0x508(%rbp), %rax
movslq -0x4fc(%rbp), %rcx
cmpq %rcx, %rax
jae 0x14e60
movq -0x508(%rbp), %rsi
leaq -0x4e8(%rbp), %rdi
callq 0x15630
movq %rax, -0xc98(%rbp)
jmp 0x149fa
movq -0xc98(%rbp), %rax
movl 0x4(%rax), %eax
cmpl -0x468(%rbp), %eax
jne 0x14bbb
movq -0x508(%rbp), %rsi
leaq -0x4e8(%rbp), %rdi
callq 0x15630
movq %rax, -0xca0(%rbp)
jmp 0x14a2c
movq -0xca0(%rbp), %rax
movl (%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x14a4c
movl $0x0, -0x4ec(%rbp)
jmp 0x14e49
movl -0x468(%rbp), %edi
leaq -0x610(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x44d0
movq %rax, -0xca8(%rbp)
jmp 0x14a6c
movq -0xca8(%rbp), %rax
movq %rax, -0x618(%rbp)
cmpq $0x0, -0x618(%rbp)
jge 0x14adf
movq 0xb54d(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xcb8(%rbp)
callq 0x4030
movl (%rax), %eax
movl %eax, -0xcac(%rbp)
callq 0x4030
movl (%rax), %edi
callq 0x40c0
movq -0xcb8(%rbp), %rdi
movl -0xcac(%rbp), %edx
movq %rax, %rcx
leaq 0x41ca(%rip), %rsi      # 0x18c8f
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x15090
cmpq $0x0, -0x618(%rbp)
jne 0x14b05
movl -0x468(%rbp), %edi
callq 0x4680
jmp 0x14af6
movl $0x0, -0x4ec(%rbp)
jmp 0x14e49
movq -0x618(%rbp), %rax
movq %rax, -0xcc8(%rbp)
leaq -0x639(%rbp), %rdi
movq %rdi, -0xcc0(%rbp)
callq 0x4610
movq -0xcc8(%rbp), %rdx
movq -0xcc0(%rbp), %rcx
leaq -0x638(%rbp), %rdi
leaq -0x610(%rbp), %rsi
callq 0x4390
jmp 0x14b49
leaq -0x639(%rbp), %rdi
callq 0x4350
leaq -0x4c8(%rbp), %rdi
leaq -0x638(%rbp), %rsi
callq 0x4400
jmp 0x14b6a
leaq -0x638(%rbp), %rdi
callq 0x4200
jmp 0x14e47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x639(%rbp), %rdi
callq 0x4350
jmp 0x1509e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x638(%rbp), %rdi
callq 0x4200
jmp 0x1509e
movq -0x508(%rbp), %rsi
leaq -0x4e8(%rbp), %rdi
callq 0x15630
movq %rax, -0xcd0(%rbp)
jmp 0x14bd7
movq -0xcd0(%rbp), %rax
movl 0x4(%rax), %eax
cmpl -0x46c(%rbp), %eax
jne 0x14e45
movl -0x46c(%rbp), %eax
movl %eax, -0xce4(%rbp)
movq -0x28(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x4110
movq -0x4f8(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xce0(%rbp)
movq -0x28(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x4230
movl -0xce4(%rbp), %edi
movq -0xce0(%rbp), %rsi
movq %rax, %rdx
movq -0x4f8(%rbp), %rax
subq %rax, %rdx
callq 0x40d0
movq %rax, -0xcd8(%rbp)
jmp 0x14c52
movq -0xcd8(%rbp), %rax
movq %rax, -0x648(%rbp)
movq -0x648(%rbp), %rax
movq %rax, -0xcf0(%rbp)
movq -0x28(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x4230
movq %rax, %rcx
movq -0xcf0(%rbp), %rax
subq -0x4f8(%rbp), %rcx
cmpq %rcx, %rax
je 0x14d3d
movq 0xb339(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xd10(%rbp)
callq 0x4030
movl (%rax), %eax
movl %eax, -0xd04(%rbp)
callq 0x4030
movl (%rax), %edi
callq 0x40c0
movq %rax, -0xd00(%rbp)
movq -0x648(%rbp), %rax
movq %rax, -0xcf8(%rbp)
movq -0x28(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x4230
movq -0xd10(%rbp), %rdi
movl -0xd04(%rbp), %edx
movq -0xd00(%rbp), %rcx
movq -0xcf8(%rbp), %r8
movq %rax, %r9
movq -0x4f8(%rbp), %rax
subq %rax, %r9
leaq 0x3f97(%rip), %rsi      # 0x18cad
xorl %eax, %eax
callq 0x44c0
movl -0x46c(%rbp), %edi
callq 0x4680
jmp 0x14d2a
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x15090
movq -0x648(%rbp), %rax
addq -0x4f8(%rbp), %rax
movq %rax, -0x4f8(%rbp)
movq -0x4f8(%rbp), %rax
movq %rax, -0xd18(%rbp)
movq -0x28(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x4230
movq %rax, %rcx
movq -0xd18(%rbp), %rax
cmpq %rcx, %rax
jb 0x14e43
movl -0x4cc(%rbp), %eax
movl %eax, -0xd28(%rbp)
movl -0x46c(%rbp), %eax
movl %eax, -0xd24(%rbp)
movq -0x508(%rbp), %rsi
leaq -0x4e8(%rbp), %rdi
callq 0x15630
movq %rax, -0xd20(%rbp)
jmp 0x14db7
movq -0xd20(%rbp), %rcx
movl -0xd24(%rbp), %edx
movl -0xd28(%rbp), %edi
movl $0x2, %esi
callq 0x4480
cmpl $0x0, %eax
je 0x14e34
movq 0xb1f8(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xd38(%rbp)
callq 0x4030
movl (%rax), %eax
movl %eax, -0xd2c(%rbp)
callq 0x4030
movl (%rax), %edi
callq 0x40c0
movq -0xd38(%rbp), %rdi
movl -0xd2c(%rbp), %edx
movq %rax, %rcx
leaq 0x3ec0(%rip), %rsi      # 0x18cda
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x15090
movl -0x46c(%rbp), %edi
callq 0x4680
jmp 0x14e41
jmp 0x14e43
jmp 0x14e45
jmp 0x14e47
jmp 0x14e49
movq -0x508(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x508(%rbp)
jmp 0x149c7
jmp 0x14839
movl -0x4a4(%rbp), %edi
leaq -0x64c(%rbp), %rsi
xorl %edx, %edx
callq 0x4270
movl %eax, -0xd3c(%rbp)
jmp 0x14e81
movl -0xd3c(%rbp), %eax
movl %eax, -0x650(%rbp)
movl -0x650(%rbp), %eax
cmpl -0x4a4(%rbp), %eax
je 0x14f1f
movq 0xb132(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xd50(%rbp)
movl -0x650(%rbp), %eax
movl %eax, -0xd48(%rbp)
movl -0x4a4(%rbp), %eax
movl %eax, -0xd44(%rbp)
callq 0x4030
movl (%rax), %eax
movl %eax, -0xd40(%rbp)
callq 0x4030
movl (%rax), %edi
callq 0x40c0
movq -0xd50(%rbp), %rdi
movl -0xd48(%rbp), %edx
movl -0xd44(%rbp), %ecx
movl -0xd40(%rbp), %r8d
movq %rax, %r9
leaq 0x3df8(%rip), %rsi      # 0x18cfd
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x15090
movq -0x18(%rbp), %rdi
leaq -0xa50(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x51f0
movl %eax, -0xd54(%rbp)
jmp 0x14f3c
movl -0xd54(%rbp), %eax
cmpl $0x0, %eax
je 0x14f72
movq 0xb08a(%rip), %rax      # 0x1ffd8
movq (%rax), %rdi
leaq 0x350d(%rip), %rsi      # 0x18465
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x15090
leaq -0xa50(%rbp), %rax
movq %rax, -0xd68(%rbp)
leaq -0xa50(%rbp), %rdi
callq 0x4140
movq %rax, %rcx
movq -0xd68(%rbp), %rax
addq %rcx, %rax
movq %rax, -0xd60(%rbp)
leaq -0xa50(%rbp), %rdi
callq 0x4140
movq -0xd60(%rbp), %rdi
movl $0x400, %esi            # imm = 0x400
subq %rax, %rsi
leaq 0x3256(%rip), %rdx      # 0x18218
movb $0x0, %al
callq 0x4550
cmpl $0x0, -0x64c(%rbp)
jne 0x14ff9
leaq -0x4c8(%rbp), %rdi
leaq -0xa50(%rbp), %rsi
callq 0x152b0
movb %al, -0xd69(%rbp)
jmp 0x14fed
movb -0xd69(%rbp), %al
testb $0x1, %al
jne 0x14ff9
jmp 0x1505c
movq 0xafd8(%rip), %rax      # 0x1ffd8
movq (%rax), %rdi
movl -0x64c(%rbp), %edx
leaq 0x3d19(%rip), %rsi      # 0x18d29
movb $0x0, %al
callq 0x44c0
movq 0xafba(%rip), %rax      # 0x1ffd8
movq (%rax), %rax
movq %rax, -0xd78(%rbp)
leaq -0x4c8(%rbp), %rdi
callq 0x4110
movq -0xd78(%rbp), %rdi
movq %rax, %rdx
leaq 0x31f2(%rip), %rsi      # 0x18237
movb $0x0, %al
callq 0x44c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x15090
movq 0xaf75(%rip), %rax      # 0x1ffd8
movq (%rax), %rdi
leaq -0xa50(%rbp), %rcx
leaq 0x3cdb(%rip), %rsi      # 0x18d4f
leaq 0x3cf0(%rip), %rdx      # 0x18d6b
movb $0x0, %al
callq 0x44c0
movl $0x0, -0x4(%rbp)
movl $0x1, -0x54(%rbp)
leaq -0x4e8(%rbp), %rdi
callq 0x15670
jmp 0x150b8
leaq -0x4e8(%rbp), %rdi
callq 0x15670
leaq -0x4c8(%rbp), %rdi
callq 0x4200
jmp 0x150d2
leaq -0x4c8(%rbp), %rdi
callq 0x4200
leaq -0x360(%rbp), %rdi
callq 0x156d0
jmp 0x150e0
leaq -0x360(%rbp), %rdi
callq 0x156d0
jmp 0x150ee
leaq -0x2e8(%rbp), %rdi
callq 0x4200
jmp 0x150fc
leaq -0x2e8(%rbp), %rdi
callq 0x4200
jmp 0x1510a
leaq -0x268(%rbp), %rdi
callq 0x4200
jmp 0x15118
leaq -0x268(%rbp), %rdi
callq 0x4200
jmp 0x15126
leaq -0x228(%rbp), %rdi
callq 0x4200
jmp 0x15134
leaq -0x228(%rbp), %rdi
callq 0x4200
jmp 0x15142
leaq -0x188(%rbp), %rdi
callq 0x4200
jmp 0x15150
leaq -0x188(%rbp), %rdi
callq 0x4200
jmp 0x1515e
leaq -0x168(%rbp), %rdi
callq 0x4200
jmp 0x1516c
leaq -0x168(%rbp), %rdi
callq 0x4200
jmp 0x1517a
leaq -0x128(%rbp), %rdi
callq 0x4200
jmp 0x15188
leaq -0x128(%rbp), %rdi
callq 0x4200
jmp 0x15193
leaq -0x78(%rbp), %rdi
callq 0x4200
jmp 0x1519e
leaq -0x78(%rbp), %rdi
callq 0x4200
jmp 0x151a9
leaq -0x48(%rbp), %rdi
callq 0x4200
jmp 0x151b4
leaq -0x48(%rbp), %rdi
callq 0x4200
jmp 0x151c0
movl -0x4(%rbp), %eax
addq $0xd80, %rsp            # imm = 0xD80
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x4600
nopl (%rax)