// File: /workspace/github_cpp_makefile_star2_O1/attractivechaos[P]udb2/libcuckoo/./cuckoohash_map.hh
// Function: cuckoohash_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>, 4ul>::cuckoo_status cuckoohash_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>, 4ul>::run_cuckoo<std::integral_constant<bool, false>>(cuckoohash_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>, 4ul>::TwoBuckets&, unsigned long&, unsigned long&)
cuckoo_status run_cuckoo(TwoBuckets &b, size_type &insert_bucket,
                           size_type &insert_slot) {
    // We must unlock the buckets here, so that cuckoopath_search and
    // cuckoopath_move can lock buckets as desired without deadlock.
    // cuckoopath_move has to move something out of one of the original
    // buckets as its last operation, and it will lock both buckets and
    // leave them locked after finishing. This way, we know that if
    // cuckoopath_move succeeds, then the buckets needed for insertion are
    // still locked. If cuckoopath_move fails, the buckets are unlocked and
    // we try again. This unlocking does present two problems. The first is
    // that another insert on the same key runs and, finding that the key
    // isn't in the table, inserts the key into the table. Then we insert
    // the key into the table, causing a duplication. To check for this, we
    // search the buckets for the key we are trying to insert before doing
    // so (this is done in cuckoo_insert, and requires that both buckets are
    // locked). Another problem is that an expansion runs and changes the
    // hashpower, meaning the buckets may not be valid anymore. In this
    // case, the cuckoopath functions will have thrown a hashpower_changed
    // exception, which we catch and handle here.
    size_type hp = hashpower();
    b.unlock();
    CuckooRecords cuckoo_path;
    bool done = false;
    try {
      while (!done) {
        const int depth =
            cuckoopath_search<TABLE_MODE>(hp, cuckoo_path, b.i1, b.i2);
        if (depth < 0) {
          break;
        }

        if (cuckoopath_move<TABLE_MODE>(hp, cuckoo_path, depth, b)) {
          insert_bucket = cuckoo_path[0].bucket;
          insert_slot = cuckoo_path[0].slot;
          assert(insert_bucket == b.i1 || insert_bucket == b.i2);
          assert(TABLE_MODE() == locked_table_mode() ||
                 !get_current_locks()[lock_ind(b.i1)].try_lock());
          assert(TABLE_MODE() == locked_table_mode() ||
                 !get_current_locks()[lock_ind(b.i2)].try_lock());
          assert(!buckets_[insert_bucket].occupied(insert_slot));
          done = true;
          break;
        }
      }
    } catch (hashpower_changed &) {
      // The hashpower changed while we were trying to cuckoo, which means
      // we want to retry. b.i1 and b.i2 should not be locked
      // in this case.
      return failure_under_expansion;
    }
    return done ? ok : failure;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rcx, (%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq 0x10(%rdi), %r13
movq 0x10(%rsi), %rax
movq $0x0, 0x10(%rsi)
testq %rax, %rax
je 0x349e
movb $0x0, (%rax)
movq 0x18(%r15), %rax
movq $0x0, 0x18(%r15)
testq %rax, %rax
je 0x34b2
movb $0x0, (%rax)
xorl %ebx, %ebx
leaq 0x8(%rsp), %rbp
testb $0x1, %bl
jne 0x3585
movq (%r15), %rcx
movq 0x8(%r15), %r8
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x36c2
testl %eax, %eax
js 0x357b
movl %eax, %ecx
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %r15, %r8
callq 0x3910
movb $0x1, %cl
testb %al, %al
je 0x357d
movq 0x8(%rsp), %rax
movq %rax, (%r14)
movq 0x10(%rsp), %rax
movq (%rsp), %rcx
movq %rax, (%rcx)
movq (%r14), %rcx
movq (%r15), %rax
cmpq %rax, %rcx
je 0x3521
cmpq 0x8(%r15), %rcx
jne 0x359f
movq 0x28(%r12), %rcx
movzwl %ax, %eax
movq 0x10(%rcx), %rcx
shll $0x6, %eax
movb $0x1, %dl
xchgb %dl, (%rcx,%rax)
testb %dl, %dl
je 0x35fc
movq 0x28(%r12), %rax
movzwl 0x8(%r15), %ecx
movq 0x10(%rax), %rax
shll $0x6, %ecx
movb $0x1, %dl
xchgb %dl, (%rax,%rcx)
testb %dl, %dl
je 0x35dd
movq (%r14), %rax
movq (%rsp), %rcx
movq (%rcx), %rcx
leaq (%rax,%rax,4), %rax
shlq $0x3, %rax
addq 0x18(%r12), %rax
cmpb $0x1, 0x24(%rcx,%rax)
je 0x35be
movb $0x1, %bl
xorl %ecx, %ecx
testb %cl, %cl
jne 0x34b9
notb %bl
andb $0x1, %bl
movzbl %bl, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x22a3(%rip), %rdi      # 0x5849
leaq 0x1cd1(%rip), %rsi      # 0x527e
leaq 0x22c4(%rip), %rcx      # 0x5878
movl $0x4f7, %edx            # imm = 0x4F7
callq 0x20f0
leaq 0x21bc(%rip), %rdi      # 0x5781
leaq 0x1cb2(%rip), %rsi      # 0x527e
leaq 0x22a5(%rip), %rcx      # 0x5878
movl $0x4fc, %edx            # imm = 0x4FC
callq 0x20f0
leaq 0x2146(%rip), %rdi      # 0x572a
leaq 0x1c93(%rip), %rsi      # 0x527e
leaq 0x2286(%rip), %rcx      # 0x5878
movl $0x4fb, %edx            # imm = 0x4FB
callq 0x20f0
leaq 0x1f5a(%rip), %rdi      # 0x555d
leaq 0x1c74(%rip), %rsi      # 0x527e
leaq 0x2267(%rip), %rcx      # 0x5878
movl $0x4f9, %edx            # imm = 0x4F9
callq 0x20f0
movq %rax, %rdi
cmpl $0x1, %edx
jne 0x3637
callq 0x2090
callq 0x21e0
movl $0x5, %eax
jmp 0x358d
callq 0x2210