// File: /workspace/github_cpp_makefile_star2_O3/Kei18[P]pibt/./src/solver/cbs.cpp
// Function: CBS::AstarSearch(Agent*, CTNode*)
Nodes CBS::AstarSearch(Agent* a, CTNode* node) {
  Constraint constraints = getConstraintsForAgent(node, a);

  Node* _s = a->getNode();
  Node* _g = a->getGoal();

  // ==== fast implementation ====
  // constraint free
  if (constraints.empty()) return G->getPath(_s, _g);

  // know path
  std::string cKey = getCKey(_s, _g, constraints);
  auto itrK = knownPaths.find(cKey);
  if (itrK != knownPaths.end()) {
    if (itrK->second.empty()) node->valid = false;
    return itrK->second;
  }

  // previously computed path
  std::string dKey = cKey;
  if (!constraints.empty()) {
    while (*(dKey.end()-1) != '-') dKey.erase(dKey.end()-1);
    dKey.erase(dKey.end()-1);
  }
  Nodes dPath;
  itrK = knownPaths.find(dKey);
  if (itrK != knownPaths.end()) {
    dPath = itrK->second;
  }

  // goal condition
  bool existGoalConstraint = false;
  int timeGoalConstraint = 0;
  for (auto c: constraints) {
    if (c->onNode && c->v == _g && c->t > timeGoalConstraint) {
      existGoalConstraint = true;
      timeGoalConstraint = c->t;
    }
  }
  // =============================

  Nodes path, tmpPath, C;
  int f, g;
  std::string key;
  bool invalid = true;  // success or not

  boost::heap::fibonacci_heap<Fib_AN> OPEN;
  std::unordered_map<std::string, boost::heap::fibonacci_heap<Fib_AN>::handle_type> SEARCHED;
  std::unordered_set<std::string> CLOSE;  // key
  AN* n = new AN { _s, 0, pathDist(_s, _g), nullptr };
  auto handle = OPEN.push(Fib_AN(n));
  key = getKey(n);
  SEARCHED.emplace(key, handle);

  while (!OPEN.empty()) {
    // argmin
    n = OPEN.top().node;

    // check goal condtion
    if (n->v == _g) {
      if (!existGoalConstraint || timeGoalConstraint < n->g) {
        invalid = false;
        break;
      }
    }

    // ==== fast implementation ====
    tmpPath = G->getPath(n->v, _g);
    if (validShorcut(a, n, _g, constraints, tmpPath)) {
      for (int i = 1; i < tmpPath.size(); ++i) {
        n = new AN { tmpPath[i], 0, 0, n };
      }
      invalid = false;
      break;
    }
    tmpPath.clear();

    // encount previously explored path
    if (!dPath.empty() && n->g <= dPath.size() - 1 && n->v == dPath[n->g]) {
      tmpPath = dPath;
      for (int i = 0; i < n->g; ++i) tmpPath.erase(tmpPath.begin());
      if (validShorcut(a, n, _g, constraints, tmpPath)) {
        for (int i = 1; i < tmpPath.size(); ++i) {
          n = new AN { tmpPath[i], 0, 0, n };
        }
        invalid = false;
        break;
      }
    }
    // =============================

    // update list
    OPEN.pop();
    CLOSE.emplace(getKey(n));

    // search neighbor
    C = G->neighbor(n->v);
    C.push_back(n->v);

    for (auto m : C) {
      g = n->g + 1;
      key = getKey(g, m);
      if (CLOSE.find(key) != CLOSE.end()) continue;

      // check constraints
      auto constraint = std::find_if(constraints.begin(), constraints.end(),
                                     [a, g, m, n] (Conflict* c) {
                                       if (c->a != a) return false;
                                       if (c->t != g) return false;
                                       if (c->onNode) return c->v == m;
                                       return c->v == m && c->u == n->v;
                                     });
      if (constraint != constraints.end()) continue;
      f = g + pathDist(m, _g);

      // ==== fast implementation ====
      if (!dPath.empty() && g <= dPath.size() - 1 && m == dPath[g]) {
        f = dPath.size() - 1;
      }
      // if (existGoalConstraint) {
      //   f = pathDist(m, _g) + timeGoalConstraint;
      // }
      // =============================

      auto itrS = SEARCHED.find(key);
      if (itrS == SEARCHED.end()) {  // new node
        AN* l = new AN { m, g, f, n };
        auto handle = OPEN.push(Fib_AN(l));
        SEARCHED.emplace(key, handle);
      } else {
        auto handle = itrS->second;
        AN* l = (*handle).node;
        if (l->f > f) {
          l->g = g;
          l->f = f;
          l->p = n;
        }
        OPEN.increase(handle);
      }
    }
  }

  // back tracking
  if (!invalid) {  // check failed or not
    while (n != nullptr) {
      path.push_back(n->v);
      n = n->p;
    }
    std::reverse(path.begin(), path.end());
  } else {
    node->valid = false;
  }
  knownPaths.emplace(cKey, path);

  return path;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r15
leaq 0x78(%rsp), %r14
movq %r14, %rdi
movq %rcx, 0xf0(%rsp)
movq %rcx, %rdx
movq %r13, %rcx
callq 0x29326
movq 0x8(%r13), %rbx
movq 0x10(%r13), %rbp
movq (%r14), %rax
cmpq 0x8(%r14), %rax
movq %r15, 0x50(%rsp)
je 0x28658
movq %r12, 0x58(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0x78(%rsp), %r8
movq %rbx, %rdx
movq %rbp, %rcx
callq 0x293c8
movq 0x58(%rsp), %rax
leaq 0x70(%rax), %rdi
leaq 0x100(%rsp), %rsi
movq %rdi, 0xe8(%rsp)
callq 0x2c06c
testq %rax, %rax
je 0x28671
movq %rax, %rcx
addq $0x28, %rax
movq 0x28(%rcx), %rdx
cmpq 0x30(%rcx), %rdx
jne 0x28646
movq 0xf0(%rsp), %rcx
movb $0x0, 0x40(%rcx)
movq 0x50(%rsp), %rdi
movq %rax, %rsi
callq 0x19aae
jmp 0x290e1
movq 0x38(%r12), %rsi
movq (%rsi), %rax
movq %r15, %rdi
movq %rbx, %rdx
movq %rbp, %rcx
callq *0x18(%rax)
jmp 0x29102
leaq 0xd8(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x100(%rsp), %rsi
movq 0x108(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0xb810
movq 0x78(%rsp), %rax
cmpq 0x80(%rsp), %rax
je 0x286f0
leaq 0xc8(%rsp), %r14
movq 0xc8(%rsp), %rax
movq 0xd0(%rsp), %rcx
leaq -0x1(%rcx), %rsi
cmpb $0x2d, -0x1(%rax,%rcx)
je 0x286de
movl $0x1, %edx
movq %r14, %rdi
callq 0x6420
jmp 0x286b4
leaq 0xc8(%rsp), %rdi
movl $0x1, %edx
callq 0x6420
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
movq $0x0, 0xa0(%rsp)
leaq 0xc8(%rsp), %rsi
movq 0xe8(%rsp), %rdi
callq 0x2c06c
testq %rax, %rax
je 0x28735
addq $0x28, %rax
leaq 0x90(%rsp), %rdi
movq %rax, %rsi
callq 0x1b2e0
movq 0x78(%rsp), %rax
movq 0x80(%rsp), %rcx
cmpq %rcx, %rax
je 0x28790
movl $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movq (%rax), %rdx
cmpb $0x1, 0x20(%rdx)
jne 0x28785
cmpq %rbp, 0x10(%rdx)
jne 0x28785
movl 0x8(%rdx), %edx
movl 0x8(%rsp), %edi
cmpl %edi, %edx
setg %sil
cmovgl %edx, %edi
movl %edi, 0x8(%rsp)
movl 0xc(%rsp), %edx
orb %sil, %dl
movl %edx, 0xc(%rsp)
addq $0x8, %rax
cmpq %rcx, %rax
jne 0x28757
jmp 0x287a0
movl $0x0, 0x8(%rsp)
movl $0x0, 0xc(%rsp)
xorps %xmm0, %xmm0
movq 0x50(%rsp), %rcx
movups %xmm0, (%rcx)
xorl %eax, %eax
movq %rax, 0x10(%rcx)
movq %rax, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq %rax, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
leaq 0xb8(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
leaq 0x138(%rsp), %rcx
movq %rax, -0x8(%rcx)
movaps %xmm0, -0x18(%rcx)
movq %rcx, (%rcx)
movq %rcx, 0x8(%rcx)
leaq 0x198(%rsp), %rax
movq %rax, -0x30(%rax)
movl $0x1, %ecx
movq %rcx, -0x28(%rax)
movups %xmm0, -0x20(%rax)
movl $0x3f800000, %edx       # imm = 0x3F800000
movl %edx, -0x10(%rax)
movups %xmm0, -0x8(%rax)
leaq 0x1d0(%rsp), %rax
movq %rax, -0x30(%rax)
movq %rcx, -0x28(%rax)
movups %xmm0, -0x20(%rax)
movl %edx, -0x10(%rax)
movups %xmm0, -0x8(%rax)
movl $0x18, %edi
callq 0x6370
movq %rax, %r14
movq %rbx, (%rax)
movl $0x0, 0x8(%rax)
movq 0x58(%rsp), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x3efbe
movl %eax, 0xc(%r14)
movq $0x0, 0x10(%r14)
leaq 0x10(%rsp), %rsi
movq %r14, (%rsi)
leaq 0x120(%rsp), %rdi
callq 0x1b3c4
movq %rax, 0x160(%rsp)
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x3f4d4
leaq 0xa8(%rsp), %rdi
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x6460
movq (%rbx), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x288bb
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6380
leaq 0x168(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x160(%rsp), %rdx
callq 0x2c168
cmpq $0x0, 0x120(%rsp)
je 0x28f2f
movq %rbp, 0xf8(%rsp)
movq 0x128(%rsp), %rax
movq 0x10(%rax), %r12
movq (%r12), %rdx
cmpq %rbp, %rdx
jne 0x2891e
testb $0x1, 0xc(%rsp)
je 0x28f8a
movl 0x8(%rsp), %eax
cmpl 0x8(%r12), %eax
jl 0x28f8a
movq 0x58(%rsp), %rax
movq 0x38(%rax), %rsi
movq (%rsi), %rax
leaq 0x10(%rsp), %rdi
movq %rbp, %rcx
callq *0x18(%rax)
movq 0x30(%rsp), %rdi
movq 0x40(%rsp), %rsi
movaps 0x10(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0x28988
subq %rdi, %rsi
callq 0x6380
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x28988
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq %r13, %rsi
movq %r12, %rdx
movq %rbp, %rcx
leaq 0x78(%rsp), %r8
leaq 0x30(%rsp), %r9
callq 0x2973c
testb %al, %al
jne 0x28f40
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x289b9
movq %rax, 0x38(%rsp)
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rdx
cmpq %rdx, %rax
je 0x28a61
movslq 0x8(%r12), %rcx
subq %rax, %rdx
sarq $0x3, %rdx
decq %rdx
cmpq %rcx, %rdx
jb 0x28a61
movq (%r12), %rdx
cmpq (%rax,%rcx,8), %rdx
jne 0x28a61
leaq 0x30(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x1b2e0
movl 0x8(%r12), %eax
testl %eax, %eax
jle 0x28a41
xorl %ebx, %ebx
movq 0x38(%rsp), %rdx
movq 0x30(%rsp), %rdi
leaq 0x8(%rdi), %rsi
cmpq %rdx, %rsi
je 0x28a32
subq %rsi, %rdx
callq 0x65b0
movq 0x38(%rsp), %rdx
movl 0x8(%r12), %eax
addq $-0x8, %rdx
movq %rdx, 0x38(%rsp)
incl %ebx
cmpl %eax, %ebx
jl 0x28a12
movq %r13, %rsi
movq %r12, %rdx
movq %rbp, %rcx
leaq 0x78(%rsp), %r8
leaq 0x30(%rsp), %r9
callq 0x2973c
testb %al, %al
jne 0x29133
leaq 0x120(%rsp), %rdi
callq 0x1b446
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3f4d4
leaq 0x1a0(%rsp), %rdi
movq %rbx, %rsi
callq 0x2c554
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x28aaa
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6380
movq 0x58(%rsp), %rax
movq 0x38(%rax), %rsi
movq (%r12), %rdx
leaq 0x10(%rsp), %rdi
callq 0x1a38a
movq 0x60(%rsp), %rdi
movq 0x70(%rsp), %rsi
movaps 0x10(%rsp), %xmm0
movaps %xmm0, 0x60(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x70(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0x28b14
subq %rdi, %rsi
callq 0x6380
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x28b14
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x68(%rsp), %rsi
cmpq 0x70(%rsp), %rsi
movq %r12, (%rsp)
je 0x28b3b
movq (%r12), %rax
movq %rax, (%rsi)
movq 0x68(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x68(%rsp)
jmp 0x28b4d
leaq 0x60(%rsp), %rdi
movq %r12, %rdx
callq 0x1c5cc
movq 0x68(%rsp), %rax
movq 0x60(%rsp), %r12
movq %rax, 0x150(%rsp)
cmpq %rax, %r12
je 0x28f18
movq (%r12), %rbx
movq (%rsp), %rax
movslq 0x8(%rax), %r14
leaq 0x1(%r14), %rbp
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x3f2d8
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
callq 0x6460
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x28bb1
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6380
leaq 0x1a0(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x2c91a
testq %rax, %rax
jne 0x28f06
movq 0x78(%rsp), %rdx
movq 0x80(%rsp), %rax
movq %rax, %rdi
subq %rdx, %rdi
movq %rdi, %rsi
sarq $0x5, %rsi
testq %rsi, %rsi
jle 0x28d1f
andq $-0x20, %rdi
movq %rdi, %rcx
addq %rdx, %rcx
incq %rsi
addq $0x10, %rdx
movq -0x10(%rdx), %rdi
cmpq %r13, (%rdi)
jne 0x28c45
cmpl %ebp, 0x8(%rdi)
jne 0x28c45
movb 0x20(%rdi), %r8b
movq 0x10(%rdi), %r9
testb %r8b, %r8b
jne 0x28c35
cmpq %rbx, %r9
jne 0x28c35
movq 0x18(%rdi), %rdi
movq (%rsp), %r8
cmpq (%r8), %rdi
jne 0x28c45
jmp 0x28d6e
cmpq %rbx, %r9
sete %dil
testb %dil, %r8b
jne 0x28d6e
movq -0x8(%rdx), %rdi
cmpq %r13, (%rdi)
jne 0x28c87
cmpl %ebp, 0x8(%rdi)
jne 0x28c87
movb 0x20(%rdi), %r8b
movq 0x10(%rdi), %r9
testb %r8b, %r8b
jne 0x28c77
cmpq %rbx, %r9
jne 0x28c77
movq 0x18(%rdi), %rdi
movq (%rsp), %r8
cmpq (%r8), %rdi
jne 0x28c87
jmp 0x28d74
cmpq %rbx, %r9
sete %dil
testb %dil, %r8b
jne 0x28d74
movq (%rdx), %rdi
cmpq %r13, (%rdi)
jne 0x28cc8
cmpl %ebp, 0x8(%rdi)
jne 0x28cc8
movb 0x20(%rdi), %r8b
movq 0x10(%rdi), %r9
testb %r8b, %r8b
jne 0x28cb8
cmpq %rbx, %r9
jne 0x28cb8
movq 0x18(%rdi), %rdi
movq (%rsp), %r8
cmpq (%r8), %rdi
jne 0x28cc8
jmp 0x28d7e
cmpq %rbx, %r9
sete %dil
testb %dil, %r8b
jne 0x28d7e
movq 0x8(%rdx), %rdi
cmpq %r13, (%rdi)
jne 0x28d06
cmpl %ebp, 0x8(%rdi)
jne 0x28d06
movb 0x20(%rdi), %r8b
movq 0x10(%rdi), %r9
testb %r8b, %r8b
jne 0x28cfa
cmpq %rbx, %r9
jne 0x28cfa
movq 0x18(%rdi), %rdi
movq (%rsp), %r8
cmpq (%r8), %rdi
jne 0x28d06
jmp 0x28d7a
cmpq %rbx, %r9
sete %dil
testb %dil, %r8b
jne 0x28d7a
decq %rsi
addq $0x20, %rdx
cmpq $0x1, %rsi
jg 0x28c03
movq %rax, %rdi
subq %rcx, %rdi
jmp 0x28d22
movq %rdx, %rcx
sarq $0x3, %rdi
cmpq $0x1, %rdi
je 0x28ddb
cmpq $0x2, %rdi
je 0x28d9e
cmpq $0x3, %rdi
jne 0x28e1c
movq (%rcx), %rdx
cmpq %r13, (%rdx)
jne 0x28d9a
cmpl %ebp, 0x8(%rdx)
jne 0x28d9a
movb 0x20(%rdx), %sil
movq 0x10(%rdx), %rdi
testb %sil, %sil
jne 0x28d8f
cmpq %rbx, %rdi
jne 0x28d8f
movq 0x18(%rdx), %rdx
movq (%rsp), %rsi
cmpq (%rsi), %rdx
jne 0x28d9a
jmp 0x28d81
addq $-0x10, %rdx
jmp 0x28d7e
addq $-0x8, %rdx
jmp 0x28d7e
addq $0x8, %rdx
movq %rdx, %rcx
cmpq %rax, %rcx
jne 0x28f06
jmp 0x28e1c
cmpq %rbx, %rdi
sete %dl
testb %dl, %sil
jne 0x28d81
addq $0x8, %rcx
movq (%rcx), %rdx
cmpq %r13, (%rdx)
jne 0x28dd7
cmpl %ebp, 0x8(%rdx)
jne 0x28dd7
movb 0x20(%rdx), %sil
movq 0x10(%rdx), %rdi
testb %sil, %sil
jne 0x28dcc
cmpq %rbx, %rdi
jne 0x28dcc
movq 0x18(%rdx), %rdx
movq (%rsp), %rsi
cmpq (%rsi), %rdx
jne 0x28dd7
jmp 0x28d81
cmpq %rbx, %rdi
sete %dl
testb %dl, %sil
jne 0x28d81
addq $0x8, %rcx
movq (%rcx), %rdx
cmpq %r13, (%rdx)
jne 0x28e1c
cmpl %ebp, 0x8(%rdx)
jne 0x28e1c
movb 0x20(%rdx), %sil
movq 0x10(%rdx), %rdi
testb %sil, %sil
jne 0x28e0d
cmpq %rbx, %rdi
jne 0x28e0d
movq 0x18(%rdx), %rdx
movq (%rsp), %rsi
cmpq (%rsi), %rdx
je 0x28d81
jmp 0x28e1c
cmpq %rbx, %rdi
sete %dl
testb %dl, %sil
jne 0x28d81
movq 0x58(%rsp), %rdi
movq %rbx, %rsi
movq 0xf8(%rsp), %rdx
callq 0x3efbe
movl %eax, %r15d
addl %ebp, %r15d
movq 0x90(%rsp), %rcx
movq 0x98(%rsp), %rax
cmpq %rax, %rcx
je 0x28e68
subq %rcx, %rax
sarq $0x3, %rax
leaq -0x1(%rax), %rdx
cmpq %rbp, %rdx
jb 0x28e68
cmpq 0x8(%rcx,%r14,8), %rbx
jne 0x28e68
decl %eax
movl %eax, %r15d
leaq 0x168(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x2c954
testq %rax, %rax
je 0x28eae
movq 0x28(%rax), %rsi
movq 0x10(%rsi), %rax
cmpl %r15d, 0xc(%rax)
jle 0x28e9f
movl %ebp, 0x8(%rax)
movl %r15d, 0xc(%rax)
movq (%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x120(%rsp), %rdi
callq 0x1b4b2
jmp 0x28f06
movl $0x18, %edi
callq 0x6370
movq %rbx, (%rax)
movl %ebp, 0x8(%rax)
movl %r15d, 0xc(%rax)
movq (%rsp), %rcx
movq %rcx, 0x10(%rax)
movq %rax, 0x158(%rsp)
leaq 0x120(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x1b3c4
movq %rax, 0x10(%rsp)
leaq 0x168(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x2c168
addq $0x8, %r12
cmpq 0x150(%rsp), %r12
jne 0x28b63
cmpq $0x0, 0x120(%rsp)
movq 0xf8(%rsp), %rbp
jne 0x288ef
movq 0xf0(%rsp), %rax
movb $0x0, 0x40(%rax)
jmp 0x2900b
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r14
subq %rbx, %r14
sarq $0x3, %r14
cmpq $0x2, %r14
jb 0x28f8a
movl $0x1, %r15d
movl $0x18, %edi
callq 0x6370
movq (%rbx,%r15,8), %rcx
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %r12, 0x10(%rax)
incq %r15
movq %rax, %rcx
movq %rax, %r12
cmpq %r15, %r14
jne 0x28f5d
jmp 0x28f8d
movq %r12, %rcx
movq 0x50(%rsp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x28fac
movq %rcx, %rbx
movq (%rcx), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x28fb7
movq %rcx, %rbx
movq %rcx, %rdx
callq 0x1c5cc
movq 0x10(%rbx), %rbx
movq %rbx, %rcx
testq %rbx, %rbx
jne 0x28f8d
movq 0x50(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
cmpq %rcx, %rax
setne %dl
addq $-0x8, %rcx
cmpq %rax, %rcx
seta %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x2900b
addq $0x8, %rax
movq -0x8(%rax), %rdx
movq (%rcx), %rsi
movq %rsi, -0x8(%rax)
movq %rdx, (%rcx)
addq $-0x8, %rcx
leaq 0x8(%rax), %rdx
cmpq %rcx, %rax
movq %rdx, %rax
jb 0x28fed
leaq 0x100(%rsp), %rsi
movq 0xe8(%rsp), %rdi
movq 0x50(%rsp), %rdx
callq 0x2c98e
leaq 0x1a0(%rsp), %rdi
callq 0x2ae7e
leaq 0x168(%rsp), %rdi
callq 0x2af1c
leaq 0x120(%rsp), %rdi
callq 0x1b54e
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x29071
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x6380
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x29088
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x2909f
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x290bc
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x290e1
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x6380
leaq 0x110(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x29102
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x6380
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x2911c
movq 0x88(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x50(%rsp), %rax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r14
subq %rbx, %r14
sarq $0x3, %r14
cmpq $0x2, %r14
jb 0x29180
movl $0x1, %r15d
movl $0x18, %edi
callq 0x6370
movq (%rbx,%r15,8), %rcx
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %r12, 0x10(%rax)
incq %r15
movq %rax, %rcx
movq %rax, %r12
cmpq %r15, %r14
jne 0x29150
jmp 0x28f8d
movq %r12, %rcx
testq %r12, %r12
jne 0x28f8d
jmp 0x28fc3
jmp 0x2920b
jmp 0x291fb
jmp 0x291aa
jmp 0x2920b
jmp 0x2920b
movq %rax, %rbx
movl $0x18, %esi
movq %r14, %rdi
jmp 0x291e8
jmp 0x2920b
movq %rax, %rbx
jmp 0x292a1
jmp 0x291c2
jmp 0x291b8
jmp 0x2920b
movq %rax, %rbx
jmp 0x29304
jmp 0x2920b
movq %rax, %rbx
jmp 0x292e3
jmp 0x2920b
jmp 0x2920b
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x2920e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6380
jmp 0x2920e
jmp 0x2920b
jmp 0x2920b
jmp 0x2920b
jmp 0x2920b
jmp 0x2920b
jmp 0x2920b
movq %rax, %rbx
jmp 0x292be
jmp 0x2920b
jmp 0x2920b
jmp 0x2920b
jmp 0x2920b
movq %rax, %rbx
leaq 0x1a0(%rsp), %rdi
callq 0x2ae7e
leaq 0x168(%rsp), %rdi
callq 0x2af1c
leaq 0x120(%rsp), %rdi
callq 0x1b54e
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x2925a
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x6380
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x29271
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x29288
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x50(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x292a1
movq 0x10(%rax), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x292be
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x292e3
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x6380
leaq 0x110(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x29304
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x6380
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x2931e
movq 0x88(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq %rbx, %rdi
callq 0x6620