// File: /workspace/github_cpp_makefile_star2_O1/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, 0xf8(%rsp)
movq %rcx, %rdx
movq %r13, %rcx
callq 0x293b2
movq 0x8(%r13), %rbx
movq 0x10(%r13), %rbp
movq (%r14), %rax
cmpq 0x8(%r14), %rax
movq %r15, 0x8(%rsp)
je 0x2871a
movq %r12, 0x70(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0x78(%rsp), %r8
movq %rbx, %rdx
movq %rbp, %rcx
callq 0x29454
movq 0x70(%rsp), %r15
leaq 0x70(%r15), %rdi
leaq 0x100(%rsp), %rsi
movq %rdi, 0xf0(%rsp)
callq 0x2c1f4
testq %rax, %rax
je 0x28733
movq %rax, %rcx
addq $0x28, %rax
movq 0x28(%rcx), %rdx
cmpq 0x30(%rcx), %rdx
jne 0x28708
movq 0xf8(%rsp), %rcx
movb $0x0, 0x40(%rcx)
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x19a68
jmp 0x29177
movq 0x38(%r12), %rsi
movq (%rsi), %rax
movq %r15, %rdi
movq %rbx, %rdx
movq %rbp, %rcx
callq *0x18(%rax)
jmp 0x29198
leaq 0xe0(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x100(%rsp), %rsi
movq 0x108(%rsp), %rdx
addq %rsi, %rdx
leaq 0xd0(%rsp), %rdi
callq 0xb7d0
movq 0x78(%rsp), %rax
cmpq 0x80(%rsp), %rax
je 0x287b2
leaq 0xd0(%rsp), %r14
movq 0xd0(%rsp), %rax
movq 0xd8(%rsp), %rcx
leaq -0x1(%rcx), %rsi
cmpb $0x2d, -0x1(%rax,%rcx)
je 0x287a0
movl $0x1, %edx
movq %r14, %rdi
callq 0x6420
jmp 0x28776
leaq 0xd0(%rsp), %rdi
movl $0x1, %edx
callq 0x6420
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
movq $0x0, 0xa0(%rsp)
leaq 0xd0(%rsp), %rsi
movq 0xf0(%rsp), %rdi
callq 0x2c1f4
testq %rax, %rax
je 0x287f7
addq $0x28, %rax
leaq 0x90(%rsp), %rdi
movq %rax, %rsi
callq 0x1b2e2
movq 0x78(%rsp), %rax
movq 0x80(%rsp), %rcx
cmpq %rcx, %rax
je 0x28847
xorl %edi, %edi
movl $0x1, %edx
xorl %r8d, %r8d
movq (%rax), %rsi
cmpb $0x1, 0x20(%rsi)
jne 0x28833
cmpq %rbp, 0x10(%rsi)
jne 0x28833
movl 0x8(%rsi), %esi
cmpl %r8d, %esi
cmovgl %esi, %r8d
movzbl %dil, %edi
cmovgl %edx, %edi
addq $0x8, %rax
cmpq %rcx, %rax
jne 0x28813
movl %r8d, 0x48(%rsp)
movl %edi, 0x4c(%rsp)
jmp 0x28857
movl $0x0, 0x48(%rsp)
movl $0x0, 0x4c(%rsp)
xorps %xmm0, %xmm0
movq 0x8(%rsp), %rcx
movups %xmm0, (%rcx)
xorl %eax, %eax
movq %rax, 0x10(%rcx)
movq %rax, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq %rax, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
leaq 0xc0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
leaq 0x138(%rsp), %rax
movaps %xmm0, -0x8(%rax)
movaps %xmm0, -0x18(%rax)
movq %rax, (%rax)
movq %rax, 0x8(%rax)
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 %r15, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x3f248
movl %eax, 0xc(%r14)
movq $0x0, 0x10(%r14)
leaq 0x10(%rsp), %rsi
movq %r14, (%rsi)
leaq 0x120(%rsp), %rdi
callq 0x1b3b8
movq %rax, 0x160(%rsp)
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x3f77a
leaq 0xb0(%rsp), %rdi
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x6460
movq (%rbx), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x28970
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6380
movq %r14, (%rsp)
leaq 0x168(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x160(%rsp), %rdx
callq 0x2c2f0
cmpq $0x0, 0x120(%rsp)
sete %bl
je 0x29018
leaq 0x10(%rsp), %r15
movq %rbp, 0xa8(%rsp)
movq 0x128(%rsp), %rax
movq 0x10(%rax), %r14
cmpq %rbp, (%r14)
movq %r14, (%rsp)
jne 0x289de
testb $0x1, 0x4c(%rsp)
je 0x29018
movl 0x48(%rsp), %eax
cmpl 0x8(%r14), %eax
jl 0x29018
movq 0x70(%rsp), %rax
movq 0x38(%rax), %rsi
movq (%r14), %rdx
movq (%rsi), %rax
movq %r15, %rdi
movq %rbp, %rcx
callq *0x18(%rax)
movq 0x30(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, 0x38(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0x28a32
subq %rdi, %rsi
callq 0x6380
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x28a49
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq %r13, %rsi
movq %r14, %rdx
movq %rbp, %rcx
leaq 0x78(%rsp), %r8
leaq 0x30(%rsp), %r9
callq 0x297ca
testb %al, %al
jne 0x28fca
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x28a7a
movq %rax, 0x38(%rsp)
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rdx
cmpq %rdx, %rax
je 0x28b18
movslq 0x8(%r14), %rcx
subq %rax, %rdx
sarq $0x3, %rdx
decq %rdx
cmpq %rcx, %rdx
jb 0x28b18
movq (%r14), %rdx
cmpq (%rax,%rcx,8), %rdx
jne 0x28b18
leaq 0x30(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x1b2e2
cmpl $0x0, 0x8(%r14)
jle 0x28af3
xorl %ebp, %ebp
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rdx
leaq 0x8(%rdi), %rsi
cmpq %rdx, %rsi
je 0x28ae5
subq %rsi, %rdx
callq 0x65b0
addq $-0x8, 0x38(%rsp)
incl %ebp
cmpl 0x8(%r14), %ebp
jl 0x28aca
movq %r13, %rsi
movq %r14, %rdx
movq 0xa8(%rsp), %rcx
leaq 0x78(%rsp), %r8
leaq 0x30(%rsp), %r9
callq 0x297ca
testb %al, %al
jne 0x291c9
leaq 0x120(%rsp), %rdi
callq 0x1b440
movq %r15, %rdi
movq %r14, %rsi
callq 0x3f77a
leaq 0x1a0(%rsp), %rdi
movq %r15, %rsi
callq 0x2c6e0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x28b5c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6380
movq 0x70(%rsp), %rax
movq 0x38(%rax), %rsi
movq (%r14), %rdx
movq %r15, %rdi
callq 0x1a320
movq 0x50(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x10(%rsp), %rax
movq %rax, 0x50(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, 0x58(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0x28bac
subq %rdi, %rsi
callq 0x6380
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x28bc3
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0x28bdd
movq (%r14), %rax
movq %rax, (%rsi)
addq $0x8, 0x58(%rsp)
jmp 0x28bea
leaq 0x50(%rsp), %rdi
movq %r14, %rdx
callq 0x1c69a
movq 0x50(%rsp), %r15
movq 0x58(%rsp), %rax
movq %rax, 0x150(%rsp)
cmpq %rax, %r15
je 0x28fa9
movq (%r15), %rbx
movq (%rsp), %rax
movslq 0x8(%rax), %r14
leaq 0x1(%r14), %rbp
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x3f57e
leaq 0xb0(%rsp), %rdi
movq %r12, %rsi
callq 0x6460
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x28c52
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6380
leaq 0x1a0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x2caaa
testq %rax, %rax
jne 0x28f7a
movq 0x78(%rsp), %rdx
movq 0x80(%rsp), %rax
movq %rax, %rsi
subq %rdx, %rsi
movq %rsi, %rdi
sarq $0x5, %rdi
testq %rdi, %rdi
jle 0x28da7
andq $-0x20, %rsi
addq %rdx, %rsi
incq %rdi
addq $0x10, %rdx
movq %rdx, %rcx
movq -0x10(%rcx), %rdx
cmpq %r13, (%rdx)
jne 0x28ce0
cmpl %ebp, 0x8(%rdx)
jne 0x28ce0
movq 0x10(%rdx), %r9
cmpq %rbx, %r9
sete %r8b
cmpb $0x0, 0x20(%rdx)
jne 0x28cd7
cmpq %rbx, %r9
jne 0x28ce0
movq 0x18(%rdx), %rdx
movq (%rsp), %r8
cmpq (%r8), %rdx
sete %r8b
testb %r8b, %r8b
jne 0x28f8e
movq -0x8(%rcx), %rdx
cmpq %r13, (%rdx)
jne 0x28d1c
cmpl %ebp, 0x8(%rdx)
jne 0x28d1c
movq 0x10(%rdx), %r9
cmpq %rbx, %r9
sete %r8b
cmpb $0x0, 0x20(%rdx)
jne 0x28d13
cmpq %rbx, %r9
jne 0x28d1c
movq 0x18(%rdx), %rdx
movq (%rsp), %r8
cmpq (%r8), %rdx
sete %r8b
testb %r8b, %r8b
jne 0x28f97
movq (%rcx), %rdx
cmpq %r13, (%rdx)
jne 0x28d57
cmpl %ebp, 0x8(%rdx)
jne 0x28d57
movq 0x10(%rdx), %r9
cmpq %rbx, %r9
sete %r8b
cmpb $0x0, 0x20(%rdx)
jne 0x28d4e
cmpq %rbx, %r9
jne 0x28d57
movq 0x18(%rdx), %rdx
movq (%rsp), %r8
cmpq (%r8), %rdx
sete %r8b
testb %r8b, %r8b
jne 0x28e87
movq 0x8(%rcx), %rdx
cmpq %r13, (%rdx)
jne 0x28d93
cmpl %ebp, 0x8(%rdx)
jne 0x28d93
movq 0x10(%rdx), %r9
cmpq %rbx, %r9
sete %r8b
cmpb $0x0, 0x20(%rdx)
jne 0x28d8a
cmpq %rbx, %r9
jne 0x28d93
movq 0x18(%rdx), %rdx
movq (%rsp), %r8
cmpq (%r8), %rdx
sete %r8b
testb %r8b, %r8b
jne 0x28fa0
decq %rdi
addq $0x20, %rcx
cmpq $0x1, %rdi
jg 0x28ca4
movq %rsi, %rdx
movq %rax, %rsi
subq %rdx, %rsi
sarq $0x3, %rsi
cmpq $0x1, %rsi
je 0x28e44
cmpq $0x2, %rsi
je 0x28e09
movq %rax, %rcx
cmpq $0x3, %rsi
jne 0x28e87
movq (%rdx), %rcx
cmpq %r13, (%rcx)
jne 0x28e05
cmpl %ebp, 0x8(%rcx)
jne 0x28e05
movq 0x10(%rcx), %rdi
cmpq %rbx, %rdi
sete %sil
cmpb $0x0, 0x20(%rcx)
jne 0x28e00
cmpq %rbx, %rdi
jne 0x28e05
movq 0x18(%rcx), %rcx
movq (%rsp), %rsi
cmpq (%rsi), %rcx
sete %sil
testb %sil, %sil
jne 0x28e84
addq $0x8, %rdx
movq (%rdx), %rcx
cmpq %r13, (%rcx)
jne 0x28e40
cmpl %ebp, 0x8(%rcx)
jne 0x28e40
movq 0x10(%rcx), %rdi
cmpq %rbx, %rdi
sete %sil
cmpb $0x0, 0x20(%rcx)
jne 0x28e3b
cmpq %rbx, %rdi
jne 0x28e40
movq 0x18(%rcx), %rcx
movq (%rsp), %rsi
cmpq (%rsi), %rcx
sete %sil
testb %sil, %sil
jne 0x28e84
addq $0x8, %rdx
movq (%rdx), %rsi
cmpq %r13, (%rsi)
jne 0x28e7c
cmpl %ebp, 0x8(%rsi)
jne 0x28e7c
movb 0x20(%rsi), %r8b
movq 0x10(%rsi), %rdi
cmpq %rbx, %rdi
sete %cl
andb %r8b, %cl
testb %r8b, %r8b
jne 0x28e7e
cmpq %rbx, %rdi
jne 0x28e7e
movq 0x18(%rsi), %rcx
movq (%rsp), %rsi
cmpq (%rsi), %rcx
sete %cl
jmp 0x28e7e
xorl %ecx, %ecx
testb %cl, %cl
cmoveq %rax, %rdx
movq %rdx, %rcx
cmpq %rax, %rcx
jne 0x28f7a
movq 0x70(%rsp), %rdi
movq %rbx, %rsi
movq 0xa8(%rsp), %rdx
callq 0x3f248
movl %eax, %r12d
addl %ebp, %r12d
movq 0x90(%rsp), %rcx
movq 0x98(%rsp), %rax
cmpq %rax, %rcx
je 0x28edc
subq %rcx, %rax
sarq $0x3, %rax
leaq -0x1(%rax), %rdx
cmpq %rbp, %rdx
jb 0x28edc
cmpq 0x8(%rcx,%r14,8), %rbx
jne 0x28edc
decl %eax
movl %eax, %r12d
leaq 0x168(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x2cae4
testq %rax, %rax
je 0x28f22
movq 0x28(%rax), %rsi
movq 0x10(%rsi), %rax
cmpl %r12d, 0xc(%rax)
jle 0x28f13
movl %ebp, 0x8(%rax)
movl %r12d, 0xc(%rax)
movq (%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x120(%rsp), %rdi
callq 0x1b4ac
jmp 0x28f7a
movl $0x18, %edi
callq 0x6370
movq %rbx, (%rax)
movl %ebp, 0x8(%rax)
movl %r12d, 0xc(%rax)
movq (%rsp), %rcx
movq %rcx, 0x10(%rax)
movq %rax, 0x158(%rsp)
leaq 0x120(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x1b3b8
movq %rax, 0x10(%rsp)
leaq 0x168(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x2c2f0
addq $0x8, %r15
cmpq 0x150(%rsp), %r15
jne 0x28c05
jmp 0x28fa9
addq $-0x10, %rcx
jmp 0x28e87
addq $-0x8, %rcx
jmp 0x28e87
addq $0x8, %rcx
jmp 0x28e87
cmpq $0x0, 0x120(%rsp)
sete %bl
movq 0xa8(%rsp), %rbp
leaq 0x10(%rsp), %r15
jne 0x289b0
jmp 0x29018
movq 0x30(%rsp), %r14
movq 0x38(%rsp), %r15
subq %r14, %r15
sarq $0x3, %r15
cmpq $0x2, %r15
jb 0x29018
movl $0x1, %r12d
movl $0x18, %edi
callq 0x6370
movq (%r14,%r12,8), %rcx
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq (%rsp), %rcx
movq %rcx, 0x10(%rax)
incq %r12
movq %rax, (%rsp)
cmpq %r12, %r15
jne 0x28fe7
movq %rax, (%rsp)
testb $0x1, %bl
je 0x2902b
movq 0xf8(%rsp), %rax
movb $0x0, 0x40(%rax)
jmp 0x290a1
movq (%rsp), %rbx
testq %rbx, %rbx
movq 0x8(%rsp), %rdi
je 0x2905e
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x29050
movq (%rbx), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x29058
movq %rbx, %rdx
callq 0x1c69a
movq 0x10(%rbx), %rbx
jmp 0x2902f
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
cmpq %rcx, %rax
setne %dl
addq $-0x8, %rcx
cmpq %rax, %rcx
seta %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x290a1
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 0x29083
leaq 0x100(%rsp), %rsi
movq 0xf0(%rsp), %rdi
movq 0x8(%rsp), %rdx
callq 0x2cb1e
leaq 0x1a0(%rsp), %rdi
callq 0x2af52
leaq 0x168(%rsp), %rdi
callq 0x2aff0
leaq 0x120(%rsp), %rdi
callq 0x1b528
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x29107
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x6380
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x2911e
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x29135
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x29152
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x29177
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x6380
leaq 0x110(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x29198
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x6380
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x291b2
movq 0x88(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x8(%rsp), %rax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30(%rsp), %r14
movq 0x38(%rsp), %r15
subq %r14, %r15
sarq $0x3, %r15
cmpq $0x2, %r15
jb 0x29018
movl $0x1, %r12d
movl $0x18, %edi
callq 0x6370
movq (%r14,%r12,8), %rcx
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq (%rsp), %rcx
movq %rcx, 0x10(%rax)
incq %r12
movq %rax, (%rsp)
cmpq %r12, %r15
jne 0x291ea
jmp 0x29014
jmp 0x29296
jmp 0x2928c
jmp 0x29235
jmp 0x29296
jmp 0x29296
movq %rax, %rbx
movl $0x18, %esi
movq %r14, %rdi
jmp 0x29275
jmp 0x29296
movq %rax, %rbx
jmp 0x2932c
jmp 0x2924f
jmp 0x29243
jmp 0x29296
movq %rax, %rbx
jmp 0x2938f
jmp 0x29296
jmp 0x29296
movq %rax, %rbx
jmp 0x2936e
jmp 0x29296
jmp 0x29296
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x29299
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6380
jmp 0x29299
jmp 0x29296
jmp 0x29296
jmp 0x29296
jmp 0x29296
jmp 0x29296
jmp 0x29296
jmp 0x29296
jmp 0x29296
movq %rax, %rbx
jmp 0x29349
jmp 0x29296
movq %rax, %rbx
leaq 0x1a0(%rsp), %rdi
callq 0x2af52
leaq 0x168(%rsp), %rdi
callq 0x2aff0
leaq 0x120(%rsp), %rdi
callq 0x1b528
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x292e5
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x6380
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x292fc
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x29313
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x8(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x2932c
movq 0x10(%rax), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x29349
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x2936e
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x6380
leaq 0x110(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2938f
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x6380
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x293a9
movq 0x88(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq %rbx, %rdi
callq 0x6620
nop