// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: cuckoo_clean
void
cuckoo_clean(struct cuckoo * const map)
{
  mutexlock_lock(&(map->expand_lock));
  for (u64 i = 0; i < KVMAP_HLOCK_NR; i++) {
    spinlock_lock(&(map->hlocks[i]));
  }
  for (u64 x = 0; x < 2; x++) {
    if (map->levels[x].table == NULL) continue;
    const u64 nr_slots = UINT64_C(1) << map->levels[x].power;
    for (u64 j = 0; j < nr_slots; j++) {
      struct __kvmap_slot * const slot = &(map->levels[x].table[j]);
      for (u64 k = 0; k < 8; k++) {
        if (slot->e[k].ptr) {
          kvmap_put_entry(&(map->mm), &(slot->e[k]), NULL);
        }
      }
    }
    pages_unmap(map->levels[x].table, map->levels[x].alloc_size);
    map->levels[x].table = NULL;
  }
  cuckoo_init(map);
  for (u64 i = 0; i < KVMAP_HLOCK_NR; i++) {
    spinlock_unlock(&(map->hlocks[i]));
  }
  mutexlock_unlock(&(map->expand_lock));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x10050, %rdi          # imm = 0x10050
callq 0x6f10
movq $0x0, -0x10(%rbp)
cmpq $0x400, -0x10(%rbp)     # imm = 0x400
jae 0x114e4
movq -0x8(%rbp), %rdi
addq $0x50, %rdi
movq -0x10(%rbp), %rax
shlq $0x6, %rax
addq %rax, %rdi
callq 0x6e50
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x114b4
movq $0x0, -0x18(%rbp)
cmpq $0x2, -0x18(%rbp)
jae 0x1162e
movq -0x8(%rbp), %rax
addq $0x10118, %rax          # imm = 0x10118
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
jne 0x11514
jmp 0x1161d
movq -0x8(%rbp), %rax
addq $0x10118, %rax          # imm = 0x10118
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x115d4
movq -0x8(%rbp), %rax
addq $0x10118, %rax          # imm = 0x10118
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
cmpq $0x8, -0x38(%rbp)
jae 0x115c1
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x10, %rax
cmpq $0x0, %rax
je 0x115b1
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x11390
jmp 0x115b3
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x11578
jmp 0x115c3
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1153e
movq -0x8(%rbp), %rax
addq $0x10118, %rax          # imm = 0x10118
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
addq $0x10118, %rax          # imm = 0x10118
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
callq 0x8c10
movq -0x8(%rbp), %rax
addq $0x10118, %rax          # imm = 0x10118
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movq $0x0, (%rax)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x114ec
movq -0x8(%rbp), %rdi
callq 0x10970
movq $0x0, -0x40(%rbp)
cmpq $0x400, -0x40(%rbp)     # imm = 0x400
jae 0x1166f
movq -0x8(%rbp), %rdi
addq $0x50, %rdi
movq -0x40(%rbp), %rax
shlq $0x6, %rax
addq %rax, %rdi
callq 0x6ed0
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x1163f
movq -0x8(%rbp), %rdi
addq $0x10050, %rdi          # imm = 0x10050
callq 0x6fb0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)