// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: kvmap1_insert
static bool
kvmap1_insert(struct kvmap1 * const map, const struct kv * const kv, const u64 max_level)
{
  u64 i = UINT64_MAX;
  u64 j = UINT64_MAX;
  u64 k = UINT64_MAX;
  if (kvmap1_locate_free_entry(map, kv, &i, &j, &k)) {
    // has free entry, just insert
    struct __kvmap_entry * const e = &(map->levels[i].table[j].e[k]);
    kvmap1_put_entry(map, e, kv);
    //(void)atomic_fetch_add(&(map->nr_kv), 1);
    (void)atomic_fetch_add(&(map->levels[i].nr_kv), 1);
    return true;
  } else if (i < max_level) {
    kvmap1_split(map, i, j);
    return kvmap1_insert(map, kv, max_level);
  } else {
    return false;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, -0x78(%rbp)
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x10128(%rdi), %r10
leaq 0x100e8(%rdi), %rax
movq %rax, -0x40(%rbp)
movq %r10, -0x38(%rbp)
movq (%r12), %rax
movb 0x50(%rbx), %cl
rolq %cl, %rax
movq 0x68(%rbx), %rcx
movq 0x60(%rbx), %rdx
movq $-0x1, %r11
cmpq %rdx, %rcx
jb 0xce06
leaq -0x1(%rcx), %rsi
movq %rcx, %rdi
bzhiq %rdi, %rax, %r14
movq %rdi, %r8
shlq $0x5, %r8
movq 0x8(%r10,%r8), %r8
cmpq %r14, (%r8)
jbe 0xcde5
movq %r14, %r9
shrq $0x6, %r9
movq 0x10(%r8,%r9,8), %r8
btq %r14, %r8
jb 0xcf62
cmpq %rcx, %rdi
jae 0xcdef
decq %rdi
jmp 0xce01
movq %rsi, %r8
cmpq 0x58(%rbx), %rdi
je 0xcdfe
incq %rdi
movq %rdi, %r8
movq %r8, %rdi
cmpq %rdx, %rdi
jae 0xcdb9
movq $-0x1, %r14
movq %r11, %rax
shlq $0x5, %rax
movq (%r10,%rax), %rdx
movq %r14, %r13
shlq $0x6, %r13
movq (%rdx,%r13), %rcx
cmpq $0x10000, %rcx          # imm = 0x10000
jb 0xd1f7
leaq (%r10,%rax), %r15
leaq (%rdx,%r13), %rdi
addq $0x8, %rdi
xorl %esi, %esi
cmpq $0x7, %rsi
je 0xce59
movq (%rdi,%rsi,8), %rcx
incq %rsi
cmpq $0x10000, %rcx          # imm = 0x10000
jae 0xce3e
jmp 0xd1f9
cmpq -0x78(%rbp), %r11
jae 0xd24a
cmpq $0x40, %r11
movq %r11, -0x30(%rbp)
jae 0xd170
movl $0x1, %eax
shlxq %r11, %rax, %rdi
cmpq %r14, %rdi
jbe 0xd182
cmpq $0x0, (%r15)
je 0xd19c
movq %r12, -0x70(%rbp)
cmpq $0x0, 0x8(%r15)
je 0xd1b6
leaq 0x1(%r11), %r12
movq %r12, -0x68(%rbp)
shlq $0x5, %r12
addq %r10, %r12
cmpq $0x0, (%r12)
jne 0xcfb3
movq %rdi, -0x48(%rbp)
movl $0x2, %eax
shlxq %r11, %rax, %rax
movq %rax, -0x50(%rbp)
addq $0x3f, %rax
shrq $0x6, %rax
leaq 0x10(,%rax,8), %rsi
movl $0x1, %edi
callq 0x62d0
movq -0x50(%rbp), %rcx
movq %rcx, (%rax)
xorl %ecx, %ecx
movq %rax, -0x50(%rbp)
xchgq %rcx, 0x8(%rax)
movq $0x0, -0x58(%rbp)
movq -0x30(%rbp), %rax
addl $-0x5, %eax
movl $0x1000, %ecx           # imm = 0x1000
shlxq %rax, %rcx, %rdi
movl $0x1, %esi
leaq -0x58(%rbp), %rdx
callq 0x82a0
movq %rax, -0x60(%rbp)
testq %rax, %rax
je 0xd1dc
movq -0x40(%rbp), %rdi
callq 0x6050
cmpl $0x23, %eax
je 0xd24e
cmpq $0x0, (%r12)
je 0xcf6a
movq -0x40(%rbp), %rdi
callq 0x6320
movq -0x50(%rbp), %rdi
callq 0x6060
movq -0x58(%rbp), %rsi
movq -0x60(%rbp), %rdi
callq 0x6410
jmp 0xcfab
movq %rdi, %r11
jmp 0xce0d
movq -0x50(%rbp), %rax
movq %rax, 0x8(%r12)
movq -0x60(%rbp), %rax
movq %rax, (%r12)
movq -0x58(%rbp), %rax
movq %rax, 0x10(%r12)
mfence
movq -0x30(%rbp), %rax
cmpq %rax, 0x58(%rbx)
ja 0xcf9f
movq -0x68(%rbp), %rax
jne 0xd1e6
movq %rax, 0x58(%rbx)
mfence
movq -0x40(%rbp), %rdi
callq 0x6320
movq -0x30(%rbp), %r11
movq -0x48(%rbp), %rdi
movq 0x8(%r12), %rax
movq (%rax), %rcx
cmpq %r14, %rcx
jbe 0xcff1
movq %r14, %rdx
shrq $0x6, %rdx
movq 0x10(%rax,%rdx,8), %rsi
btq %r14, %rsi
jb 0xcff1
movl $0x1, %ecx
shlxq %r14, %rcx, %rcx
orq %rcx, %rsi
movq %rsi, 0x10(%rax,%rdx,8)
lock
incq 0x8(%rax)
movq 0x8(%r12), %rax
movq (%rax), %rcx
orq %r14, %rdi
cmpq %rdi, %rcx
jbe 0xd022
movq %rdi, %rcx
shrq $0x6, %rcx
movq 0x10(%rax,%rcx,8), %rdx
btq %rdi, %rdx
jb 0xd022
movl $0x1, %esi
shlxq %rdi, %rsi, %rsi
orq %rsi, %rdx
movq %rdx, 0x10(%rax,%rcx,8)
lock
incq 0x8(%rax)
cmpq %r11, 0x58(%rbx)
jbe 0xd1ce
movq $-0x2, %rax
shlxq %r11, %rax, %rax
notq %rax
xorl %edx, %edx
movq (%r15), %rcx
addq %r13, %rcx
movq (%rcx,%rdx,8), %rsi
cmpq $0x10000, %rsi          # imm = 0x10000
jb 0xd096
movq %rsi, %rcx
shrq $0x10, %rcx
movq (%rcx), %rdi
movb 0x50(%rbx), %cl
rolq %cl, %rdi
andq %rax, %rdi
shlq $0x6, %rdi
addq (%r12), %rdi
movq %rsi, (%rdi,%rdx,8)
movq (%r15), %rcx
addq %r13, %rcx
movzwl (%rcx,%rdx,8), %esi
movq %rsi, (%rcx,%rdx,8)
movq (%r15), %rcx
addq %r13, %rcx
andq $-0x10000, (%rcx,%rdx,8) # imm = 0xFFFF0000
lock
incq 0x18(%r12)
lock
decq 0x18(%r15)
incq %rdx
cmpq $0x8, %rdx
jne 0xd03d
movq -0x40(%rbp), %rdi
callq 0x6050
cmpl $0x23, %eax
je 0xd24e
movq -0x30(%rbp), %rdi
cmpq %rdi, 0x68(%rbx)
jne 0xd0d0
movq 0x18(%r12), %rax
movq 0x18(%r15), %rcx
addq %rcx, %rcx
cmpq %rcx, %rax
jb 0xd0d0
incq 0x68(%rbx)
movq 0x8(%r15), %rax
cmpq %r14, (%rax)
jbe 0xd10e
movq %r14, %rcx
shrq $0x6, %rcx
movq 0x10(%rax,%rcx,8), %rdx
btq %r14, %rdx
movq -0x70(%rbp), %r12
jae 0xd112
movl $0x1, %esi
shlxq %r14, %rsi, %rsi
andnq %rdx, %rsi, %rdx
movq %rdx, 0x10(%rax,%rcx,8)
lock
decq 0x8(%rax)
movq 0x8(%r15), %rax
jmp 0xd112
movq -0x70(%rbp), %r12
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0xd15e
cmpq %rdi, 0x60(%rbx)
jne 0xd15e
movq (%r15), %r14
movq $0x0, (%r15)
movq -0x68(%rbp), %rax
movq %rax, 0x60(%rbx)
movq -0x40(%rbp), %rdi
callq 0x6320
testq %r14, %r14
movq -0x38(%rbp), %r10
je 0xcd94
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x6410
movq -0x38(%rbp), %r10
jmp 0xcd94
movq -0x40(%rbp), %rdi
callq 0x6320
movq -0x38(%rbp), %r10
jmp 0xcd94
callq 0x66ef
movq -0x30(%rbp), %r11
movq -0x38(%rbp), %r10
jmp 0xce71
movq %rdi, -0x48(%rbp)
callq 0x66ef
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %r11
movq -0x38(%rbp), %r10
jmp 0xce84
movq %rdi, -0x48(%rbp)
callq 0x66ef
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %r11
movq -0x38(%rbp), %r10
jmp 0xce8e
movq %rdi, %r12
callq 0x66ef
movq %r12, %rdi
movq -0x30(%rbp), %r11
movq -0x38(%rbp), %r10
jmp 0xce9d
callq 0x66ef
movq -0x30(%rbp), %r11
jmp 0xd02c
callq 0x66ef
jmp 0xcf28
callq 0x66ef
movq 0x58(%rbx), %rax
incq %rax
jmp 0xcf9b
xorl %esi, %esi
addq %r13, %rdx
movq %r12, %rdi
shlq $0x10, %rdi
orq %rdi, %rcx
movq %rcx, (%rdx,%rsi,8)
movq (%r12), %r8
movb 0x50(%rbx), %cl
rolq %cl, %r8
movq %r8, %rcx
shrq $0x20, %rcx
xorl %r8d, %ecx
movl %ecx, %r8d
shrl $0x10, %r8d
xorl %ecx, %r8d
movzwl %r8w, %ecx
orq %rdi, %rcx
movq %rcx, (%rdx,%rsi,8)
lock
incq 0x18(%r10,%rax)
movb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0xd23b
xorl %edi, %edi
callq 0x6530