// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5d8, %rsp            # imm = 0x5D8
movq %rcx, %r14
movq %rsi, %rbx
callq 0x7c41
testl %eax, %eax
je 0x7e91
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x5d8, %rsp            # imm = 0x5D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x40(%r14), %rsi
leaq 0x80(%rsp), %r15
movq %r15, %rdi
callq 0x3370
leaq 0x23f6(%rip), %rsi      # 0xa2a2
movq %r15, %rdi
xorl %edx, %edx
callq 0x3540
cmpq $-0x1, %rax
jne 0x7ee4
movq 0x7115(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq 0x80(%rsp), %rdx
leaq 0x29a6(%rip), %rsi      # 0xa87b
xorl %eax, %eax
callq 0x33a0
pushq $0x1
popq %rbp
jmp 0x8a3c
movq %rax, %r15
leaq 0x1(%rax), %rdx
leaq 0x140(%rsp), %rdi
leaq 0x80(%rsp), %rsi
pushq $-0x1
popq %rcx
callq 0x3280
leaq 0x239a(%rip), %rsi      # 0xa2a4
leaq 0x140(%rsp), %rdi
xorl %edx, %edx
callq 0x3540
cmpq $-0x1, %rax
jne 0x7f3d
movq 0x70b2(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq 0x80(%rsp), %rdx
leaq 0x2961(%rip), %rsi      # 0xa899
jmp 0x8020
leaq 0x1d0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
xorl %edx, %edx
movq %r15, %rcx
callq 0x3280
leaq 0x80(%rsp), %rdi
leaq 0x1d0(%rsp), %r15
movq %r15, %rsi
callq 0x32f0
movq %r15, %rdi
callq 0x3110
leaq 0x2326(%rip), %rsi      # 0xa2a4
leaq 0x140(%rsp), %r15
movq %r15, %rdi
xorl %edx, %edx
callq 0x3540
leaq 0x1d0(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x3280
leaq 0x140(%rsp), %rdi
leaq 0x1d0(%rsp), %r15
movq %r15, %rsi
callq 0x32f0
movq %r15, %rdi
callq 0x3110
leaq 0x1d0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
pushq $0x7
popq %rcx
xorl %edx, %edx
callq 0x3280
leaq 0x226c(%rip), %rsi      # 0xa252
leaq 0x1d0(%rsp), %rdi
callq 0x922f
movl %eax, %ebp
leaq 0x1d0(%rsp), %rdi
callq 0x3110
testb %bpl, %bpl
je 0x802f
movq 0x6fca(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq 0x80(%rsp), %rdx
leaq 0x2897(%rip), %rsi      # 0xa8b7
xorl %eax, %eax
callq 0x33a0
pushq $0x1
popq %rbp
jmp 0x8a2f
leaq 0x1d0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
pushq $0x7
popq %rdx
pushq $-0x1
popq %rcx
callq 0x3280
leaq 0x80(%rsp), %rdi
leaq 0x1d0(%rsp), %r15
movq %r15, %rsi
callq 0x32f0
movq %r15, %rdi
callq 0x3110
leaq 0x60(%r14), %rsi
leaq 0x80(%r14), %rdx
leaq 0x120(%rsp), %rdi
callq 0x4d04
leaq 0x284a(%rip), %rsi      # 0xa8d3
leaq 0x120(%rsp), %rdi
pushq $-0x1
popq %rdx
callq 0x34d0
cmpq $-0x1, %rax
jne 0x80c7
movq 0x6f32(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq 0x120(%rsp), %rdx
leaq 0x281f(%rip), %rsi      # 0xa8d7
xorl %eax, %eax
callq 0x33a0
pushq $0x1
popq %rbp
jmp 0x8a22
incq %rax
leaq 0x1d0(%rsp), %rdi
leaq 0x120(%rsp), %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x3280
leaq 0x120(%rsp), %rdi
leaq 0x1d0(%rsp), %r15
movq %r15, %rsi
callq 0x32f0
movq %r15, %rdi
callq 0x3110
leaq 0xa0(%r14), %rsi
leaq 0x60(%rsp), %rdi
callq 0x3370
leaq 0x2186(%rip), %rsi      # 0xa2a2
leaq 0x60(%rsp), %rdi
xorl %edx, %edx
callq 0x3540
cmpq $-0x1, %rax
jne 0x8153
movq 0x6ea3(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq 0x60(%rsp), %rdx
leaq 0x27b3(%rip), %rsi      # 0xa8f7
xorl %eax, %eax
callq 0x33a0
pushq $0x1
popq %rbp
jmp 0x8a18
movq %rax, %r15
leaq 0x1(%rax), %rdx
leaq 0x160(%rsp), %rdi
leaq 0x60(%rsp), %rsi
pushq $-0x1
popq %rcx
callq 0x3280
leaq 0x212e(%rip), %rsi      # 0xa2a4
leaq 0x60(%rsp), %rdi
xorl %edx, %edx
callq 0x3540
cmpq $-0x1, %rax
jne 0x81a3
movq 0x6e49(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq 0x60(%rsp), %rdx
leaq 0x277a(%rip), %rsi      # 0xa918
jmp 0x827a
leaq 0x1d0(%rsp), %rdi
leaq 0x60(%rsp), %rsi
xorl %edx, %edx
movq %r15, %rcx
callq 0x3280
leaq 0x60(%rsp), %rdi
leaq 0x1d0(%rsp), %r15
movq %r15, %rsi
callq 0x32f0
movq %r15, %rdi
callq 0x3110
leaq 0x20c6(%rip), %rsi      # 0xa2a4
leaq 0x160(%rsp), %r15
movq %r15, %rdi
xorl %edx, %edx
callq 0x3540
leaq 0x1d0(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x3280
leaq 0x160(%rsp), %rdi
leaq 0x1d0(%rsp), %r15
movq %r15, %rsi
callq 0x32f0
movq %r15, %rdi
callq 0x3110
leaq 0x1d0(%rsp), %rdi
leaq 0x60(%rsp), %rsi
pushq $0xa
popq %rcx
xorl %edx, %edx
callq 0x3280
leaq 0x2017(%rip), %rsi      # 0xa25a
leaq 0x1d0(%rsp), %rdi
callq 0x922f
movl %eax, %ebp
leaq 0x1d0(%rsp), %rdi
callq 0x3110
testb %bpl, %bpl
je 0x8289
movq 0x6d6d(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq 0x60(%rsp), %rdx
leaq 0x26bf(%rip), %rsi      # 0xa939
xorl %eax, %eax
callq 0x33a0
pushq $0x1
popq %rbp
jmp 0x8a0b
leaq 0x1d0(%rsp), %rdi
leaq 0x60(%rsp), %rsi
pushq $0xa
popq %rdx
pushq $-0x1
popq %rcx
callq 0x3280
leaq 0x60(%rsp), %rdi
leaq 0x1d0(%rsp), %r15
movq %r15, %rsi
callq 0x32f0
movq %r15, %rdi
callq 0x3110
leaq 0xc0(%r14), %rsi
leaq 0xe0(%r14), %rdx
leaq 0x100(%rsp), %rdi
callq 0x4d04
leaq 0x25f3(%rip), %rsi      # 0xa8d3
leaq 0x100(%rsp), %rdi
pushq $-0x1
popq %rdx
callq 0x34d0
cmpq $-0x1, %rax
jne 0x831e
movq 0x6cdb(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq 0x100(%rsp), %rdx
leaq 0x2649(%rip), %rsi      # 0xa958
xorl %eax, %eax
callq 0x33a0
pushq $0x1
popq %rbp
jmp 0x89fe
incq %rax
leaq 0x1d0(%rsp), %rdi
leaq 0x100(%rsp), %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x3280
leaq 0x100(%rsp), %rdi
leaq 0x1d0(%rsp), %r15
movq %r15, %rsi
callq 0x32f0
movq %r15, %rdi
callq 0x3110
leaq 0x20(%r14), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x3370
cmpq $0x0, 0xa8(%rsp)
jne 0x8442
leaq 0xd0(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x8(%r14), %r12
xorl %r15d, %r15d
movq 0x10(%r14), %rax
subq 0x8(%r14), %rax
cmpq %rax, %r15
jae 0x8638
movq %r12, %rdi
movq %r15, %rsi
callq 0x923a
incq %r15
cmpb $0x0, (%rax)
jne 0x8396
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
subq %rsi, %rdx
subq %r15, %rdx
jbe 0x851d
addq %r15, %rsi
leaq 0xc0(%rsp), %rdi
callq 0x3340
leaq 0x1d0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
pushq $0x5
popq %rcx
xorl %edx, %edx
callq 0x3280
leaq 0x1d81(%rip), %rsi      # 0xa180
leaq 0x1d0(%rsp), %rdi
callq 0x922f
movl %eax, %ebp
leaq 0x1d0(%rsp), %rdi
callq 0x3110
testb %bpl, %bpl
je 0x8577
movq 0x6bad(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq 0xc0(%rsp), %rdx
leaq 0x258e(%rip), %rsi      # 0xa9cb
jmp 0x85e6
leaq 0x1d0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
pushq $0x7
popq %rcx
xorl %edx, %edx
callq 0x3280
leaq 0x1de7(%rip), %rsi      # 0xa24a
leaq 0x1d0(%rsp), %rdi
callq 0x922f
movl %eax, %ebp
leaq 0x1d0(%rsp), %rdi
callq 0x3110
testb %bpl, %bpl
je 0x849f
movq 0x6b4d(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq 0xa0(%rsp), %rdx
leaq 0x24d8(%rip), %rsi      # 0xa975
jmp 0x850e
leaq 0x1d0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
pushq $0x7
popq %rdx
pushq $-0x1
popq %rcx
callq 0x3280
leaq 0xa0(%rsp), %r15
leaq 0x1d0(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x32f0
movq %r12, %rdi
callq 0x3110
leaq 0x23ef(%rip), %rsi      # 0xa8d3
pushq $-0x1
popq %rdx
movq %r15, %rdi
callq 0x34d0
cmpq $-0x1, %rax
jne 0x8535
movq 0x6adc(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq 0xa0(%rsp), %rdx
leaq 0x2483(%rip), %rsi      # 0xa991
xorl %eax, %eax
callq 0x33a0
pushq $0x1
popq %rbp
jmp 0x89f1
movq 0x6ab4(%rip), %rax      # 0xefd8
movq (%rax), %rcx
leaq 0x247e(%rip), %rdi      # 0xa9ac
pushq $0x1e
jmp 0x8892
incq %rax
leaq 0x1d0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x3280
leaq 0xa0(%rsp), %rdi
leaq 0x1d0(%rsp), %r15
movq %r15, %rsi
callq 0x32f0
movq %r15, %rdi
callq 0x3110
jmp 0x837b
leaq 0x1d0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
pushq $0x5
popq %rdx
pushq $-0x1
popq %rcx
callq 0x3280
leaq 0xc0(%rsp), %r15
leaq 0x1d0(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x32f0
movq %r12, %rdi
callq 0x3110
leaq 0x2317(%rip), %rsi      # 0xa8d3
pushq $-0x1
popq %rdx
movq %r15, %rdi
callq 0x34d0
cmpq $-0x1, %rax
jne 0x85f2
movq 0x6a04(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq 0xc0(%rsp), %rdx
leaq 0x23ff(%rip), %rsi      # 0xa9e5
xorl %eax, %eax
callq 0x33a0
jmp 0x889b
movq %rax, %r15
leaq 0x1(%rax), %rcx
leaq 0x1d0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
xorl %edx, %edx
callq 0x3280
leaq 0xc0(%rsp), %rdi
leaq 0x1d0(%rsp), %r12
movq %r12, %rsi
callq 0x32f0
movq %r12, %rdi
callq 0x3110
movq 0x10(%r14), %rax
subq 0x8(%r14), %rax
cmpq %rax, %r15
jae 0x887f
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
andq $0x0, 0x50(%rsp)
leaq 0x23c0(%rip), %rsi      # 0xaa16
leaq 0x1d0(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0x9257
leaq 0x80(%rsp), %r15
leaq 0x1d0(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x32f0
movq %r12, %rdi
callq 0x3110
movq (%r15), %rax
movq %rax, (%r12)
leaq 0x40(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x9432
leaq 0x2379(%rip), %rsi      # 0xaa27
leaq 0x1d0(%rsp), %rdi
leaq 0x140(%rsp), %rdx
callq 0x9257
leaq 0x140(%rsp), %r15
leaq 0x1d0(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x32f0
movq %r12, %rdi
callq 0x3110
movq (%r15), %rax
movq %rax, (%r12)
leaq 0x40(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x9432
leaq 0x2333(%rip), %rsi      # 0xaa39
leaq 0x1d0(%rsp), %rdi
leaq 0x120(%rsp), %rdx
callq 0x9257
leaq 0x120(%rsp), %r15
leaq 0x1d0(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x32f0
movq %r12, %rdi
callq 0x3110
movq (%r15), %rax
movq %rax, (%r12)
leaq 0x40(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x9432
leaq 0x22ec(%rip), %rsi      # 0xaa4a
leaq 0x1d0(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x9257
leaq 0x60(%rsp), %r15
leaq 0x1d0(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x32f0
movq %r12, %rdi
callq 0x3110
movq (%r15), %rax
movq %rax, (%r12)
leaq 0x40(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x9432
leaq 0x22ae(%rip), %rsi      # 0xaa5e
leaq 0x1d0(%rsp), %rdi
leaq 0x160(%rsp), %rdx
callq 0x9257
leaq 0x160(%rsp), %r15
leaq 0x1d0(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x32f0
movq %r12, %rdi
callq 0x3110
movq (%r15), %rax
movq %rax, (%r12)
leaq 0x40(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x9432
leaq 0x226b(%rip), %rsi      # 0xaa73
leaq 0x1d0(%rsp), %rdi
leaq 0x100(%rsp), %rdx
callq 0x9257
leaq 0x100(%rsp), %r15
leaq 0x1d0(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x32f0
movq %r12, %rdi
callq 0x3110
movq (%r15), %rax
movq %rax, (%r12)
leaq 0x40(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x9432
movq 0x6780(%rip), %rax      # 0xefe0
movq (%rax), %r15
leaq 0x40(%rsp), %r12
cmpq $0x0, (%r15)
je 0x88a3
movq %r12, %rdi
movq %r15, %rsi
callq 0x92ce
addq $0x8, %r15
jmp 0x8868
movq 0x6752(%rip), %rax      # 0xefd8
movq (%rax), %rcx
leaq 0x216e(%rip), %rdi      # 0xa9fe
pushq $0x17
popq %rsi
pushq $0x1
popq %rdx
callq 0x3510
pushq $0x1
popq %rbp
jmp 0x89e4
leaq 0x1d0(%rsp), %rsi
andq $0x0, (%rsi)
leaq 0x40(%rsp), %rdi
callq 0x9432
leaq 0xc(%rsp), %rdi
callq 0x3350
testl %eax, %eax
jns 0x88eb
movq 0x670a(%rip), %rax      # 0xefd8
movq (%rax), %rbx
callq 0x3030
movl (%rax), %ebp
movl %ebp, %edi
callq 0x30b0
leaq 0x21a1(%rip), %rsi      # 0xaa87
jmp 0x89c8
leaq 0x4(%rsp), %rdi
callq 0x3350
testl %eax, %eax
jns 0x891d
movq 0x66d8(%rip), %rax      # 0xefd8
movq (%rax), %rbx
callq 0x3030
movl (%rax), %ebp
movl %ebp, %edi
callq 0x30b0
leaq 0x2183(%rip), %rsi      # 0xaa9b
jmp 0x89c8
leaq 0x8b3(%rip), %rsi       # 0x91d7
pushq $0xd
popq %rdi
callq 0x32e0
leaq 0x217c(%rip), %rax      # 0xaaaf
movq %rax, 0x1a0(%rsp)
leaq 0x2171(%rip), %rax      # 0xaab3
movq %rax, 0x1a8(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x1b0(%rsp)
andq $0x0, 0x1c8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x1b8(%rsp)
cmpq $0x0, 0xa8(%rsp)
je 0x8998
leaq 0x213f(%rip), %rax      # 0xaabf
movq %rax, 0x1b8(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x1c0(%rsp)
callq 0x3070
movl %eax, 0x14(%rsp)
testl %eax, %eax
jns 0x8a4e
movq 0x6628(%rip), %rax      # 0xefd8
movq (%rax), %rbx
callq 0x3030
movl (%rax), %ebp
movl %ebp, %edi
callq 0x30b0
leaq 0x20fa(%rip), %rsi      # 0xaac2
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x33a0
pushq $0x1
popq %rbp
leaq 0x40(%rsp), %rdi
callq 0x93fe
leaq 0xc0(%rsp), %rdi
callq 0x3110
leaq 0xa0(%rsp), %rdi
callq 0x3110
leaq 0x100(%rsp), %rdi
callq 0x3110
leaq 0x160(%rsp), %rdi
callq 0x3110
leaq 0x60(%rsp), %rdi
callq 0x3110
leaq 0x120(%rsp), %rdi
callq 0x3110
leaq 0x140(%rsp), %rdi
callq 0x3110
leaq 0x80(%rsp), %rdi
callq 0x3110
jmp 0x7e7d
jne 0x8af2
movl 0xc(%rsp), %edi
callq 0x3530
movl 0x10(%rsp), %edi
pushq $0x1
popq %rsi
callq 0x3220
movl 0x10(%rsp), %edi
pushq $0x2
popq %rsi
callq 0x3220
movl 0x10(%rsp), %edi
callq 0x3530
movl 0x8(%rsp), %edi
callq 0x3530
movl 0x4(%rsp), %edi
xorl %esi, %esi
callq 0x3220
movl 0x4(%rsp), %edi
callq 0x3530
movq 0x40(%rsp), %rdx
leaq 0x2008(%rip), %rdi      # 0xaaaf
leaq 0x1a0(%rsp), %rsi
callq 0x3500
movq 0x651d(%rip), %r14      # 0xefd8
movq (%r14), %rbx
callq 0x3030
movl (%rax), %ebp
movl %ebp, %edi
callq 0x30b0
leaq 0x2014(%rip), %rsi      # 0xaae7
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x33a0
movq (%r14), %rdi
callq 0x32c0
pushq $0x1
popq %rdi
callq 0x3450
movl 0x10(%rsp), %edi
callq 0x3530
movl 0x4(%rsp), %edi
callq 0x3530
leaq 0x190(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %edi, %edi
callq 0x3310
movl %eax, 0x18(%rsp)
testl %eax, %eax
jns 0x8b5d
movq 0x64aa(%rip), %rax      # 0xefd8
movq (%rax), %rbx
callq 0x3030
movl (%rax), %ebp
movl %ebp, %edi
callq 0x30b0
leaq 0x1fc9(%rip), %rsi      # 0xab0f
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x33a0
pushq $0x1
popq %rbp
jmp 0x8efa
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
callq 0x92ec
movq 0x28(%rsp), %rax
movl $0x1, -0xc(%rax)
movl 0xc(%rsp), %ecx
movl %ecx, -0x8(%rax)
movl 0xc(%rsp), %edx
movq 0x28(%rsp), %rcx
addq $-0xc, %rcx
pushq $0x1
popq %rbp
movl 0x18(%rsp), %edi
movl %ebp, %esi
callq 0x3380
testl %eax, %eax
jne 0x8dd8
leaq 0x20(%rsp), %rdi
callq 0x92ec
movq 0x28(%rsp), %rax
movl $0x4, -0xc(%rax)
movl 0x8(%rsp), %ecx
movl %ecx, -0x8(%rax)
movl 0x8(%rsp), %edx
movq 0x28(%rsp), %rcx
addq $-0xc, %rcx
pushq $0x1
popq %rbp
movl 0x18(%rsp), %edi
movl %ebp, %esi
callq 0x3380
testl %eax, %eax
jne 0x8dfb
pushq $0x1
popq %rax
movl %eax, 0x1c(%rsp)
xorl %ebp, %ebp
cmpl $0x0, 0x1c(%rsp)
je 0x8f21
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rax
subq %rsi, %rax
cqto
pushq $0xc
popq %rcx
idivq %rcx
movl 0x18(%rsp), %edi
movl %eax, %edx
movl $0x3e8, %ecx            # imm = 0x3E8
callq 0x3150
movl %eax, %ecx
testl %eax, %eax
js 0x8ebf
movl %ecx, %r13d
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
cqto
pushq $0xc
popq %rsi
idivq %rsi
cmpq %r13, %rax
jb 0x8f0c
testl %ecx, %ecx
jne 0x8c6b
movq 0x6384(%rip), %rax      # 0xefd8
movq (%rax), %rdi
leaq 0x1f59(%rip), %rsi      # 0xabb7
movl 0x14(%rsp), %edx
xorl %eax, %eax
callq 0x33a0
jmp 0x8bfc
pushq $0x1
popq %rax
movl %eax, 0x1c(%rsp)
xorl %r12d, %r12d
cmpq %r12, %r13
je 0x8bf1
leaq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x9322
movl 0x4(%rax), %eax
cmpl 0xc(%rsp), %eax
jne 0x8d2a
leaq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x9322
testb $0x10, (%rax)
jne 0x8db5
movl 0xc(%rsp), %edi
movl $0x100, %edx            # imm = 0x100
leaq 0x1d0(%rsp), %rsi
callq 0x33b0
testq %rax, %rax
js 0x8e31
je 0x8dbf
leaq 0xf0(%rsp), %rcx
movq %rcx, 0xe0(%rsp)
leaq (%rsp,%rax), %rdx
addq $0x1d0, %rdx            # imm = 0x1D0
leaq 0xe0(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x9340
leaq 0x180(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x3520
leaq 0xe0(%rsp), %rdi
callq 0x3110
jmp 0x8dd0
leaq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x9322
movl 0x4(%rax), %edi
cmpl 0x8(%rsp), %edi
jne 0x8dd0
movq 0x100(%r14), %rsi
addq %rbp, %rsi
movq 0x108(%r14), %rdx
subq %rbp, %rdx
callq 0x30c0
movq %rax, %r15
movq 0x108(%r14), %rax
movq %rax, %rcx
subq %rbp, %rcx
cmpq %rcx, %r15
jne 0x8e55
addq %r15, %rbp
cmpq %rax, %rbp
jb 0x8dd0
movl 0x8(%rsp), %r15d
leaq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x9322
movl 0x18(%rsp), %edi
pushq $0x2
popq %rsi
movl %r15d, %edx
movq %rax, %rcx
callq 0x3380
testl %eax, %eax
jne 0x8e9e
movl 0x8(%rsp), %edi
callq 0x3530
jmp 0x8dd0
movl $0x0, 0x1c(%rsp)
jmp 0x8dd0
movl $0x0, 0x1c(%rsp)
movl 0xc(%rsp), %edi
callq 0x3530
incq %r12
jmp 0x8c75
movq 0x61f9(%rip), %rax      # 0xefd8
movq (%rax), %rbx
callq 0x3030
movl (%rax), %r14d
movl %r14d, %edi
callq 0x30b0
leaq 0x1d33(%rip), %rsi      # 0xab2c
jmp 0x8e1c
movq 0x61d6(%rip), %rax      # 0xefd8
movq (%rax), %rbx
callq 0x3030
movl (%rax), %r14d
movl %r14d, %edi
callq 0x30b0
leaq 0x1d33(%rip), %rsi      # 0xab4f
movq %rbx, %rdi
movl %r14d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x33a0
jmp 0x8ef0
movq 0x61a0(%rip), %rax      # 0xefd8
movq (%rax), %rbx
callq 0x3030
movl (%rax), %ebp
movl %ebp, %edi
callq 0x30b0
leaq 0x1d8f(%rip), %rsi      # 0xabdf
jmp 0x8ede
movq 0x617c(%rip), %rax      # 0xefd8
movq (%rax), %rbx
callq 0x3030
movl (%rax), %r12d
movl %r12d, %edi
callq 0x30b0
movq 0x108(%r14), %r9
subq %rbp, %r9
leaq 0x1d7d(%rip), %rsi      # 0xabfd
movq %rbx, %rdi
movl %r12d, %edx
movq %rax, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x33a0
movl 0x8(%rsp), %edi
callq 0x3530
jmp 0x8eed
movq 0x6133(%rip), %rax      # 0xefd8
movq (%rax), %rbx
callq 0x3030
movl (%rax), %ebp
movl %ebp, %edi
callq 0x30b0
leaq 0x1d6d(%rip), %rsi      # 0xac2a
jmp 0x8ede
movq 0x6112(%rip), %rax      # 0xefd8
movq (%rax), %rbx
callq 0x3030
movl (%rax), %ebp
movl %ebp, %edi
callq 0x30b0
leaq 0x1c94(%rip), %rsi      # 0xab72
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x33a0
pushq $0x1
popq %rbp
leaq 0x20(%rsp), %rdi
callq 0x9672
leaq 0x180(%rsp), %rdi
callq 0x3110
jmp 0x89da
movq 0x60c5(%rip), %rdx      # 0xefd8
movq (%rdx), %rdi
leaq 0x1c6f(%rip), %rsi      # 0xab8c
movl %ecx, %edx
jmp 0x8ee3
leaq 0xe0(%rsp), %rsi
movl 0x14(%rsp), %edi
xorl %edx, %edx
callq 0x31e0
movl %eax, %ebp
cmpl 0x14(%rsp), %eax
jne 0x8feb
leaq 0x1d0(%rsp), %rsi
movl $0x400, %r14d           # imm = 0x400
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
callq 0x3c08
testl %eax, %eax
jne 0x9027
leaq 0x1d0(%rsp), %rdi
callq 0x3100
leaq (%rsp,%rax), %rdi
addq $0x1d0, %rdi            # imm = 0x1D0
subq %rax, %r14
leaq 0x12a3(%rip), %rdx      # 0xa228
movq %r14, %rsi
xorl %eax, %eax
callq 0x3430
movl 0xe0(%rsp), %edx
testl %edx, %edx
jne 0x8fbe
leaq 0x180(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x922f
testb %al, %al
je 0x9048
movl 0xe0(%rsp), %edx
movq 0x6013(%rip), %rbx      # 0xefd8
movq (%rbx), %rdi
leaq 0x1caa(%rip), %rsi      # 0xac79
xorl %eax, %eax
callq 0x33a0
movq (%rbx), %rsi
movq 0x180(%rsp), %rdi
callq 0x32a0
jmp 0x8eed
movq 0x5fe6(%rip), %rax      # 0xefd8
movq (%rax), %rbx
callq 0x3030
movl (%rax), %r14d
movl %r14d, %edi
callq 0x30b0
leaq 0x1c41(%rip), %rsi      # 0xac4d
movq %rbx, %rdi
movl %ebp, %edx
movl 0x14(%rsp), %ecx
movl %r14d, %r8d
movq %rax, %r9
xorl %eax, %eax
callq 0x33a0
jmp 0x8eed
movq 0x5faa(%rip), %rax      # 0xefd8
movq (%rax), %rcx
leaq 0x143d(%rip), %rdi      # 0xa475
pushq $0x10
popq %rsi
pushq $0x1
popq %rdx
callq 0x3510
jmp 0x8eed
movq 0x5f89(%rip), %rax      # 0xefd8
movq (%rax), %rdi
leaq 0x1c46(%rip), %rsi      # 0xac9f
leaq 0x1c5b(%rip), %rdx      # 0xacbb
xorl %ebp, %ebp
leaq 0x1d0(%rsp), %rcx
xorl %eax, %eax
callq 0x33a0
jmp 0x8ef0
jmp 0x90a2
jmp 0x90a2
jmp 0x90a2
jmp 0x90a2
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x3110
jmp 0x90a5
jmp 0x90a2
jmp 0x90a2
jmp 0x90a2
jmp 0x90a2
jmp 0x9132
jmp 0x9132
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x9672
leaq 0x180(%rsp), %rdi
callq 0x3110
jmp 0x9160
jmp 0x9105
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0x3110
jmp 0x916a
jmp 0x9132
jmp 0x9132
jmp 0x915d
jmp 0x915d
jmp 0x915d
jmp 0x915d
jmp 0x915d
jmp 0x915d
jmp 0x915d
jmp 0x915d
jmp 0x915d
jmp 0x915d
jmp 0x915d
jmp 0x915d
jmp 0x915d
jmp 0x9105
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
jmp 0x9172
movq %rax, %rbx
jmp 0x9177
jmp 0x910c
movq %rax, %rbx
jmp 0x9184
jmp 0x9126
jmp 0x9126
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
jmp 0x918c
jmp 0x9126
jmp 0x9126
movq %rax, %rbx
jmp 0x9191
jmp 0x915d
movq %rax, %rbx
jmp 0x919e
movq %rax, %rbx
jmp 0x916a
jmp 0x9139
movq %rax, %rbx
jmp 0x91a8
jmp 0x9153
jmp 0x9153
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
jmp 0x91b0
jmp 0x9153
jmp 0x9153
movq %rax, %rbx
jmp 0x91b5
movq %rax, %rbx
jmp 0x91c2
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x93fe
leaq 0xc0(%rsp), %rdi
callq 0x3110
leaq 0xa0(%rsp), %rdi
callq 0x3110
leaq 0x100(%rsp), %rdi
callq 0x3110
leaq 0x160(%rsp), %rdi
callq 0x3110
leaq 0x60(%rsp), %rdi
callq 0x3110
leaq 0x120(%rsp), %rdi
callq 0x3110
leaq 0x140(%rsp), %rdi
callq 0x3110
leaq 0x80(%rsp), %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x34b0