// File: 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>::maybe_resize_locks(unsigned long)
void maybe_resize_locks(size_type new_bucket_count) {
    locks_t &current_locks = get_current_locks();
    if (!(current_locks.size() < kMaxNumLocks &&
          current_locks.size() < new_bucket_count)) {
      return;
    }

    locks_t new_locks(std::min(size_type(kMaxNumLocks), new_bucket_count),
                      spinlock(), get_allocator());
    for (spinlock &lock : new_locks) {
      lock.lock();
    }
    assert(new_locks.size() > current_locks.size());
    std::copy(current_locks.begin(), current_locks.end(), new_locks.begin());
    all_locks_.emplace_back(std::move(new_locks));
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
andq $-0x40, %rsp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, 0x168(%rsp)
movq %rsi, 0x160(%rsp)
movq 0x168(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x5170
movq %rax, 0x158(%rsp)
movq 0x158(%rsp), %rdi
callq 0xcab0
cmpq $0x10000, %rax          # imm = 0x10000
jae 0x9075
movq 0x158(%rsp), %rdi
callq 0xcab0
cmpq 0x160(%rsp), %rax
jb 0x907a
jmp 0x92a7
movq $0x10000, 0x138(%rsp) # imm = 0x10000
leaq 0x138(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x3c00
movq (%rax), %rax
movq %rax, 0x48(%rsp)
leaq 0xc0(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x3c60
movq 0x60(%rsp), %rsi
leaq 0xbe(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x3aa0
movq 0x40(%rsp), %rsi
leaq 0xbf(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x43b0
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0x58(%rsp), %rcx
leaq 0x140(%rsp), %rdi
callq 0x43d0
jmp 0x9101
leaq 0xbf(%rsp), %rdi
callq 0x4450
leaq 0xbe(%rsp), %rdi
callq 0x2da0
leaq 0x140(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x9440
movq %rax, 0x98(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x9470
movq %rax, 0x90(%rsp)
leaq 0x98(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x94a0
testb $0x1, %al
jne 0x9170
jmp 0x91d4
leaq 0x98(%rsp), %rdi
callq 0x94e0
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rdi
callq 0x51b0
leaq 0x98(%rsp), %rdi
callq 0x94f0
jmp 0x9155
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
leaq 0xbf(%rsp), %rdi
callq 0x4450
leaq 0xbe(%rsp), %rdi
callq 0x2da0
jmp 0x92cd
leaq 0x140(%rsp), %rdi
callq 0xcab0
movq %rax, 0x38(%rsp)
movq 0x158(%rsp), %rdi
callq 0xcab0
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jbe 0x9202
jmp 0x9221
leaq 0x65ae(%rip), %rdi      # 0xf7b7
leaq 0x509e(%rip), %rsi      # 0xe2ae
movl $0x6a3, %edx            # imm = 0x6A3
leaq 0x65c3(%rip), %rcx      # 0xf7df
callq 0x2110
movq 0x158(%rsp), %rdi
callq 0x9440
movq %rax, 0x80(%rsp)
movq 0x158(%rsp), %rdi
callq 0x9470
movq %rax, 0x78(%rsp)
leaq 0x140(%rsp), %rdi
callq 0x9440
movq %rax, 0x70(%rsp)
movq 0x80(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0x70(%rsp), %rdx
callq 0xcad0
movq %rax, 0x30(%rsp)
jmp 0x9278
movq 0x60(%rsp), %rdi
movq 0x30(%rsp), %rax
movq %rax, 0x68(%rsp)
addq $0x20, %rdi
leaq 0x140(%rsp), %rsi
callq 0xcb40
jmp 0x929a
leaq 0x140(%rsp), %rdi
callq 0x30f0
movq %rbp, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
leaq 0x140(%rsp), %rdi
callq 0x30f0
movq 0xb0(%rsp), %rdi
callq 0x2240
nopw (%rax,%rax)