// File: /workspace/github_cpp_makefile_star2_O1/attractivechaos[P]udb2/libcuckoo/./cuckoohash_map.hh
// Function: int cuckoohash_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>, 4ul>::cuckoopath_search<std::integral_constant<bool, false>>(unsigned long, std::array<cuckoohash_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>, 4ul>::CuckooRecord, 5ul>&, unsigned long, unsigned long)
int cuckoopath_search(const size_type hp, CuckooRecords &cuckoo_path,
                        const size_type i1, const size_type i2) {
    b_slot x = slot_search<TABLE_MODE>(hp, i1, i2);
    if (x.depth == -1) {
      return -1;
    }
    // Fill in the cuckoo path slots from the end to the beginning.
    for (int i = x.depth; i >= 0; i--) {
      cuckoo_path[i].slot = x.pathcode % slot_per_bucket();
      x.pathcode /= slot_per_bucket();
    }
    // Fill in the cuckoo_path buckets and keys from the beginning to the
    // end, using the final pathcode to figure out which bucket the path
    // starts on. Since data could have been modified between slot_search
    // and the computation of the cuckoo path, this could be an invalid
    // cuckoo_path.
    CuckooRecord &first = cuckoo_path[0];
    if (x.pathcode == 0) {
      first.bucket = i1;
    } else {
      assert(x.pathcode == 1);
      first.bucket = i2;
    }
    {
      const auto lock_manager = lock_one(hp, first.bucket, TABLE_MODE());
      const bucket &b = buckets_[first.bucket];
      if (!b.occupied(first.slot)) {
        // We can terminate here
        return 0;
      }
      first.hv = hashed_key(b.key(first.slot));
    }
    for (int i = 1; i <= x.depth; ++i) {
      CuckooRecord &curr = cuckoo_path[i];
      const CuckooRecord &prev = cuckoo_path[i - 1];
      assert(prev.bucket == index_hash(hp, prev.hv.hash) ||
             prev.bucket ==
                 alt_index(hp, prev.hv.partial, index_hash(hp, prev.hv.hash)));
      // We get the bucket that this slot is on by computing the alternate
      // index of the previous bucket
      curr.bucket = alt_index(hp, prev.hv.partial, prev.bucket);
      const auto lock_manager = lock_one(hp, curr.bucket, TABLE_MODE());
      const bucket &b = buckets_[curr.bucket];
      if (!b.occupied(curr.slot)) {
        // We can terminate here
        return i;
      }
      curr.hv = hashed_key(b.key(curr.slot));
    }
    return x.depth;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbp
movq %rcx, %r13
movq %rdx, %rbx
movq %rdi, %r15
movq %rsi, 0x18(%rsp)
movq %rcx, %rdx
movq %r8, %rcx
callq 0x3c14
movq %rdx, %r12
movl %r12d, %eax
shrl $0x10, %eax
cmpb $-0x1, %al
je 0x38a7
movsbl %al, %eax
testl %eax, %eax
js 0x3738
movl %eax, %ecx
leaq 0x1(%rcx), %rax
shlq $0x5, %rcx
addq %rbx, %rcx
addq $0x8, %rcx
movl %r12d, %edx
andl $0x3, %edx
movq %rdx, (%rcx)
movzwl %r12w, %edx
shrl $0x2, %edx
andl $0xffff0000, %r12d      # imm = 0xFFFF0000
orl %edx, %r12d
addq $-0x20, %rcx
decq %rax
jg 0x3715
testw %r12w, %r12w
je 0x374e
movzwl %r12w, %eax
cmpl $0x1, %eax
jne 0x38f1
movq %rbp, %r13
movq %r13, (%rbx)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movq 0x18(%rsp), %rdx
movq %r13, %rcx
callq 0x3e84
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
leaq (%rcx,%rcx,4), %rcx
shlq $0x3, %rcx
addq 0x18(%r15), %rcx
cmpb $0x1, 0x24(%rax,%rcx)
jne 0x38ae
movl (%rcx,%rax,8), %eax
movl %eax, %ecx
shrl $0x10, %ecx
xorl %eax, %ecx
movl %ecx, %edx
shrl $0x8, %edx
xorl %ecx, %edx
movq %rax, 0x10(%rbx)
movb %dl, 0x18(%rbx)
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x37a9
movb $0x0, (%rax)
shrl $0x10, %r12d
movsbl %r12b, %eax
testl %eax, %eax
jle 0x38c3
movq $-0x1, %rbp
movq 0x18(%rsp), %rcx
shlq %cl, %rbp
movabsq $0x46a4a7935bd1e995, %r13 # imm = 0x46A4A7935BD1E995
notq %rbp
movq %rax, 0x20(%rsp)
leal 0x1(%rax), %r12d
addq $0x38, %rbx
movl $0x0, 0xc(%rsp)
movl $0x1, %r14d
movq -0x38(%rbx), %rax
movq -0x28(%rbx), %rcx
movq %rcx, %rdx
andq %rbp, %rdx
cmpq %rdx, %rax
je 0x381d
movzbl -0x20(%rbx), %edx
imulq %r13, %rdx
addq %r13, %rdx
xorq %rcx, %rdx
andq %rbp, %rdx
cmpq %rdx, %rax
jne 0x38d2
movzbl -0x20(%rbx), %ecx
imulq %r13, %rcx
addq %r13, %rcx
xorq %rax, %rcx
andq %rbp, %rcx
movq %rcx, -0x18(%rbx)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movq 0x18(%rsp), %rdx
callq 0x3e84
movq -0x18(%rbx), %rax
movq -0x10(%rbx), %rcx
leaq (%rax,%rax,4), %rdx
shlq $0x3, %rdx
addq 0x18(%r15), %rdx
movb 0x24(%rcx,%rdx), %al
testb %al, %al
je 0x387a
movl (%rdx,%rcx,8), %ecx
movl %ecx, %edx
shrl $0x10, %edx
xorl %ecx, %edx
movl %edx, %esi
shrl $0x8, %esi
xorl %edx, %esi
movq %rcx, -0x8(%rbx)
movb %sil, (%rbx)
jmp 0x387f
movl %r14d, 0xc(%rsp)
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
je 0x388c
movb $0x0, (%rcx)
testb %al, %al
je 0x38bf
incq %r14
addq $0x20, %rbx
cmpq %r14, %r12
jne 0x37f0
movq 0x20(%rsp), %rax
jmp 0x38c3
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x38c3
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x38bb
movb $0x0, (%rax)
xorl %eax, %eax
jmp 0x38c3
movl 0xc(%rsp), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x228e(%rip), %rdi      # 0x5b67
leaq 0x199e(%rip), %rsi      # 0x527e
leaq 0x2104(%rip), %rcx      # 0x59eb
movl $0x538, %edx            # imm = 0x538
callq 0x20f0
leaq 0x20e3(%rip), %rdi      # 0x59db
leaq 0x197f(%rip), %rsi      # 0x527e
leaq 0x20e5(%rip), %rcx      # 0x59eb
movl $0x527, %edx            # imm = 0x527
callq 0x20f0