LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: rcache_update
static inline bool
rcache_update(struct __icache_slot * const slot, const u64 rep, const void * const kv, const u64 hash)
{
  if (slot->used < ICACHE_ENTRY_NR) {
    for (u64 i = 0; i < ICACHE_ENTRY_NR; i++) {
      if (slot->e[i].ptr == 0) {
        rcache_put_entry(&(slot->e[i]), kv, hash);
        slot->used++;
        return false;
      }
    }
    debug_assert(false);
  }

  const u64 victim = random_u64() % ICACHE_ENTRY_NR;
  icache_amap_dec(slot, victim);

  for (u64 i = 0; i < ICACHE_ENTRY_NR; i++) {
    const u64 vi = (i + victim) % ICACHE_ENTRY_NR;
    const u64 rep1 = icache_amap_get(slot, vi);
    if (rep1 < rep) {
      rcache_put_entry(&(slot->e[vi]), kv, hash);
      icache_amap_set(slot, vi, rep);
      return true;
    }
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
shrq $0x3c, %rax
cmpl $0x7, %eax
jge 0x16306
movq $0x0, -0x30(%rbp)
cmpq $0x7, -0x30(%rbp)
jae 0x162ff
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
shrq $0x10, %rax
cmpq $0x0, %rax
jne 0x162ec
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movq -0x30(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x1a020
movq -0x10(%rbp), %rax
movq (%rax), %rdx
shrq $0x3c, %rdx
addq $0x1, %rdx
movq (%rax), %rcx
andq $0xf, %rdx
shlq $0x3c, %rdx
movabsq $0xfffffffffffffff, %rsi # imm = 0xFFFFFFFFFFFFFFF
andq %rsi, %rcx
orq %rdx, %rcx
movq %rcx, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x163b1
jmp 0x162ee
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x16274
xorl %edi, %edi
callq 0x7640
callq 0x8fb0
movl $0x7, %ecx
xorl %edx, %edx
divq %rcx
movq %rdx, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x19e20
movq $0x0, -0x40(%rbp)
cmpq $0x7, -0x40(%rbp)
jae 0x163ad
movq -0x40(%rbp), %rax
addq -0x38(%rbp), %rax
movl $0x7, %ecx
xorl %edx, %edx
divq %rcx
movq %rdx, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x19eb0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x1639d
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movq -0x48(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x1a020
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x19ee0
movb $0x1, -0x1(%rbp)
jmp 0x163b1
jmp 0x1639f
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x1632e
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: rcache_invalidate_hash
void
rcache_invalidate_hash(struct rcache * const cache, const u64 hash)
{
  const u64 idx = (hash >> KVMAP_BASE_LEVEL) % cache->nr_slots;
  struct __icache_slot * const slot = &(cache->table[idx]);
  const u64 pkey = kvmap_pkey(hash);
  rcache_lock_hash(cache, hash);
  for (u64 i = 0; i < ICACHE_ENTRY_NR; i++) {
    if ((slot->e[i].pkey == pkey) && slot->e[i].ptr) {
      icache_put_entry(&(slot->e[i]), NULL);
      slot->used--;
      icache_amap_clear(slot, i);
    }
  }
  rcache_unlock_hash(cache, hash);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x6, %rax
movq -0x8(%rbp), %rcx
xorl %edx, %edx
divq 0x10038(%rcx)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10048(%rax), %rax
movq -0x18(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10c00
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x16080
movq $0x0, -0x30(%rbp)
cmpq $0x7, -0x30(%rbp)
jae 0x16509
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq -0x28(%rbp), %rax
jne 0x164f6
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
shrq $0x10, %rax
cmpq $0x0, %rax
je 0x164f6
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
movq -0x30(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x16520
movq -0x20(%rbp), %rax
movq (%rax), %rdx
shrq $0x3c, %rdx
addq $-0x1, %rdx
movq (%rax), %rcx
andq $0xf, %rdx
shlq $0x3c, %rdx
movabsq $0xfffffffffffffff, %rsi # imm = 0xFFFFFFFFFFFFFFF
andq %rsi, %rcx
orq %rdx, %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x165b0
jmp 0x164f8
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x16465
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x160c0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: rcache_clean
void
rcache_clean(struct rcache * const cache)
{
  for (u64 i = 0; i < KVMAP_HLOCK_NR; i++) {
    spinlock_lock(&(cache->hlocks[i]));
  }
  for (u64 i = 0; i < cache->nr_slots; i++) {
    struct __icache_slot * const slot = &(cache->table[i]);
    memset(slot, 0, sizeof(*slot));
  }
  for (u64 i = 0; i < KVMAP_HLOCK_NR; i++) {
    spinlock_unlock(&(cache->hlocks[i]));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
cmpq $0x400, -0x10(%rbp)     # imm = 0x400
jae 0x166d0
movq -0x8(%rbp), %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 0x166a4
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10038(%rcx), %rax
jae 0x16721
movq -0x8(%rbp), %rax
movq 0x10048(%rax), %rax
movq -0x18(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x6200
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x166d8
movq $0x0, -0x28(%rbp)
cmpq $0x400, -0x28(%rbp)     # imm = 0x400
jae 0x16755
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
shlq $0x6, %rax
addq %rax, %rdi
callq 0x6ed0
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x16729
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: rcache_destroy
void
rcache_destroy(struct rcache * const cache)
{
  rcache_clean(cache);
  pages_unmap(cache->table, cache->slots_alloc_size);
  pages_unmap(cache->hists, cache->hists_alloc_size);
  free(cache);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x16690
movq -0x8(%rbp), %rax
movq 0x10048(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10040(%rax), %rsi
callq 0x8c10
movq -0x8(%rbp), %rax
movq 0x10060(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10058(%rax), %rsi
callq 0x8c10
movq -0x8(%rbp), %rdi
callq 0x6060
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: maptest_passes_message
void
maptest_passes_message(void)
{
  fprintf(stderr, "%s Usage: {rgen ... {pass ...}}\n", __func__);
  rgen_helper_message();
  fprintf(stderr, "%s Usage: pass <nth> <magic-type> <magic> <repeat> <vlen> <S%%> <D%%> <G%%> <rgen-opt>\n", __func__);
  fprintf(stderr, "%s magic-type: 0:time, 1:count\n", __func__);
  fprintf(stderr, "%s repeat: 0:damp\n", __func__);
  fprintf(stderr, "%s rgen-opt: 0:sync, 1:wait, 2:nowait\n", __func__);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0xab2d(%rip), %rax      # 0x21ff8
movq (%rax), %rdi
leaq 0x413a(%rip), %rsi      # 0x1b60f
leaq 0x4154(%rip), %rdx      # 0x1b630
movb $0x0, %al
callq 0x62e0
callq 0xc3a0
movq 0xab09(%rip), %rax      # 0x21ff8
movq (%rax), %rdi
leaq 0x414e(%rip), %rsi      # 0x1b647
leaq 0x4130(%rip), %rdx      # 0x1b630
movb $0x0, %al
callq 0x62e0
movq 0xaaea(%rip), %rax      # 0x21ff8
movq (%rax), %rdi
leaq 0x4187(%rip), %rsi      # 0x1b69f
leaq 0x4111(%rip), %rdx      # 0x1b630
movb $0x0, %al
callq 0x62e0
movq 0xaacb(%rip), %rax      # 0x21ff8
movq (%rax), %rdi
leaq 0x4188(%rip), %rsi      # 0x1b6bf
leaq 0x40f2(%rip), %rdx      # 0x1b630
movb $0x0, %al
callq 0x62e0
movq 0xaaac(%rip), %rax      # 0x21ff8
movq (%rax), %rdi
leaq 0x417c(%rip), %rsi      # 0x1b6d2
leaq 0x40d3(%rip), %rdx      # 0x1b630
movb $0x0, %al
callq 0x62e0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/./xxhash.h
// Function: XXH32_endian_align
XXH_FORCE_INLINE XXH_PUREF xxh_u32
XXH32_endian_align(const xxh_u8* input, size_t len, xxh_u32 seed, XXH_alignment align)
{
    xxh_u32 h32;

    if (input==NULL) XXH_ASSERT(len == 0);

    if (len>=16) {
        xxh_u32 acc[4];
        XXH32_initAccs(acc, seed);

        input = XXH32_consumeLong(acc, input, len, align);

        h32 = XXH32_mergeAccs(acc);
    } else {
        h32  = seed + XXH_PRIME32_5;
    }

    h32 += (xxh_u32)len;

    return XXH32_finalize(h32, input, len&15, align);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x177c1
movq -0x10(%rbp), %rax
cmpq $0x10, -0x10(%rbp)
jb 0x177fa
leaq -0x30(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x17830
leaq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl -0x18(%rbp), %ecx
callq 0x17880
movq %rax, -0x8(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x179a0
movl %eax, -0x1c(%rbp)
jmp 0x17805
movl -0x14(%rbp), %eax
addl $0x165667b1, %eax       # imm = 0x165667B1
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
andq $0xf, %rdx
movl -0x18(%rbp), %ecx
callq 0x179f0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/./xxhash.h
// Function: XXH32_initAccs
XXH_FORCE_INLINE void
XXH32_initAccs(xxh_u32 *acc, xxh_u32 seed)
{
    XXH_ASSERT(acc != NULL);
    acc[0] = seed + XXH_PRIME32_1 + XXH_PRIME32_2;
    acc[1] = seed + XXH_PRIME32_2;
    acc[2] = seed + 0;
    acc[3] = seed - XXH_PRIME32_1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %ecx
addl $0x9e3779b1, %ecx       # imm = 0x9E3779B1
addl $0x85ebca77, %ecx       # imm = 0x85EBCA77
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movl -0xc(%rbp), %ecx
addl $0x85ebca77, %ecx       # imm = 0x85EBCA77
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0xc(%rbp), %ecx
addl $0x0, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0xc(%rbp), %ecx
subl $0x9e3779b1, %ecx       # imm = 0x9E3779B1
movq -0x8(%rbp), %rax
movl %ecx, 0xc(%rax)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/./xxhash.h
// Function: XXH32_consumeLong
XXH_FORCE_INLINE const xxh_u8 *
XXH32_consumeLong(
    xxh_u32 *XXH_RESTRICT acc,
    xxh_u8 const *XXH_RESTRICT input,
    size_t len,
    XXH_alignment align
)
{
    const xxh_u8* const bEnd = input + len;
    const xxh_u8* const limit = bEnd - 15;
    XXH_ASSERT(acc != NULL);
    XXH_ASSERT(input != NULL);
    XXH_ASSERT(len >= 16);
    do {
        acc[0] = XXH32_round(acc[0], XXH_get32bits(input)); input += 4;
        acc[1] = XXH32_round(acc[1], XXH_get32bits(input)); input += 4;
        acc[2] = XXH32_round(acc[2], XXH_get32bits(input)); input += 4;
        acc[3] = XXH32_round(acc[3], XXH_get32bits(input)); input += 4;
    } while (input < limit);

    return input;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $-0xf, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x17b10
movl -0x40(%rbp), %edi
movl %eax, %esi
callq 0x17ad0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x17b10
movl -0x3c(%rbp), %edi
movl %eax, %esi
callq 0x17ad0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x17b10
movl -0x38(%rbp), %edi
movl %eax, %esi
callq 0x17ad0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x17b10
movl -0x34(%rbp), %edi
movl %eax, %esi
callq 0x17ad0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x178af
movq -0x10(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/./xxhash.h
// Function: XXH32_avalanche
static xxh_u32 XXH32_avalanche(xxh_u32 hash)
{
    hash ^= hash >> 15;
    hash *= XXH_PRIME32_2;
    hash ^= hash >> 13;
    hash *= XXH_PRIME32_3;
    hash ^= hash >> 16;
    return hash;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
shrl $0xf, %eax
xorl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
imull $0x85ebca77, -0x4(%rbp), %eax # imm = 0x85EBCA77
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
shrl $0xd, %eax
xorl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
imull $0xc2b2ae3d, -0x4(%rbp), %eax # imm = 0xC2B2AE3D
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
shrl $0x10, %eax
xorl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/./xxhash.h
// Function: XXH64_endian_align
XXH_FORCE_INLINE XXH_PUREF xxh_u64
XXH64_endian_align(const xxh_u8* input, size_t len, xxh_u64 seed, XXH_alignment align)
{
    xxh_u64 h64;
    if (input==NULL) XXH_ASSERT(len == 0);

    if (len>=32) {  /* Process a large block of data */
        xxh_u64 acc[4];
        XXH64_initAccs(acc, seed);

        input = XXH64_consumeLong(acc, input, len, align);

        h64 = XXH64_mergeAccs(acc);
    } else {
        h64  = seed + XXH_PRIME64_5;
    }

    h64 += (xxh_u64) len;

    return XXH64_finalize(h64, input, len, align);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x17bf2
movq -0x10(%rbp), %rax
cmpq $0x20, -0x10(%rbp)
jb 0x17c2d
leaq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x17c70
leaq -0x50(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl -0x1c(%rbp), %ecx
callq 0x17ce0
movq %rax, -0x8(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x17e20
movq %rax, -0x28(%rbp)
jmp 0x17c3f
movabsq $0x27d4eb2f165667c5, %rax # imm = 0x27D4EB2F165667C5
addq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl -0x1c(%rbp), %ecx
callq 0x17ed0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/./xxhash.h
// Function: XXH64_initAccs
XXH_FORCE_INLINE void
XXH64_initAccs(xxh_u64 *acc, xxh_u64 seed)
{
    XXH_ASSERT(acc != NULL);
    acc[0] = seed + XXH_PRIME64_1 + XXH_PRIME64_2;
    acc[1] = seed + XXH_PRIME64_2;
    acc[2] = seed + 0;
    acc[3] = seed - XXH_PRIME64_1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movabsq $-0x61c8864e7a143579, %rcx # imm = 0x9E3779B185EBCA87
addq -0x10(%rbp), %rcx
movabsq $-0x3d4d51c2d82b14b1, %rax # imm = 0xC2B2AE3D27D4EB4F
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movabsq $-0x3d4d51c2d82b14b1, %rcx # imm = 0xC2B2AE3D27D4EB4F
addq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rcx
addq $0x0, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rcx
movabsq $-0x61c8864e7a143579, %rax # imm = 0x9E3779B185EBCA87
subq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/./xxhash.h
// Function: XXH64_consumeLong
XXH_FORCE_INLINE const xxh_u8 *
XXH64_consumeLong(
    xxh_u64 *XXH_RESTRICT acc,
    xxh_u8 const *XXH_RESTRICT input,
    size_t len,
    XXH_alignment align
)
{
    const xxh_u8* const bEnd = input + len;
    const xxh_u8* const limit = bEnd - 31;
    XXH_ASSERT(acc != NULL);
    XXH_ASSERT(input != NULL);
    XXH_ASSERT(len >= 32);
    do {
        /* reroll on 32-bit */
        if (sizeof(void *) < sizeof(xxh_u64)) {
            size_t i;
            for (i = 0; i < 4; i++) {
                acc[i] = XXH64_round(acc[i], XXH_get64bits(input));
                input += 8;
            }
        } else {
            acc[0] = XXH64_round(acc[0], XXH_get64bits(input)); input += 8;
            acc[1] = XXH64_round(acc[1], XXH_get64bits(input)); input += 8;
            acc[2] = XXH64_round(acc[2], XXH_get64bits(input)); input += 8;
            acc[3] = XXH64_round(acc[3], XXH_get64bits(input)); input += 8;
        }
    } while (input < limit);

    return input;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $-0x1f, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x180b0
movq -0x50(%rbp), %rdi
movq %rax, %rsi
callq 0x18050
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x180b0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x18050
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x180b0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x18050
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x180b0
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x18050
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x17d0f
movq -0x10(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/./xxhash.h
// Function: XXH64_mergeAccs
XXH_FORCE_INLINE XXH_PUREF xxh_u64
XXH64_mergeAccs(const xxh_u64 *acc)
{
    XXH_ASSERT(acc != NULL);
    {
        xxh_u64 h64 = XXH_rotl64(acc[0], 1) + XXH_rotl64(acc[1], 7)
                    + XXH_rotl64(acc[2], 12) + XXH_rotl64(acc[3], 18);
        /* reroll on 32-bit */
        if (sizeof(void *) < sizeof(xxh_u64)) {
            size_t i;
            for (i = 0; i < 4; i++) {
                h64 = XXH64_mergeRound(h64, acc[i]);
            }
        } else {
            h64 = XXH64_mergeRound(h64, acc[0]);
            h64 = XXH64_mergeRound(h64, acc[1]);
            h64 = XXH64_mergeRound(h64, acc[2]);
            h64 = XXH64_mergeRound(h64, acc[3]);
        }
        return h64;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
rorxq $0x3f, %rax, %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
rorxq $0x39, %rcx, %rcx
addq %rcx, %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
rorxq $0x34, %rcx, %rcx
addq %rcx, %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
rorxq $0x2e, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
callq 0x18130
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x18130
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x18130
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x18130
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/./xxhash.h
// Function: XXH64_finalize
XXH_STATIC XXH_PUREF xxh_u64
XXH64_finalize(xxh_u64 hash, const xxh_u8* ptr, size_t len, XXH_alignment align)
{
    if (ptr==NULL) XXH_ASSERT(len == 0);
    len &= 31;
    while (len >= 8) {
        xxh_u64 const k1 = XXH64_round(0, XXH_get64bits(ptr));
        ptr += 8;
        hash ^= k1;
        hash  = XXH_rotl64(hash,27) * XXH_PRIME64_1 + XXH_PRIME64_4;
        len -= 8;
    }
    if (len >= 4) {
        hash ^= (xxh_u64)(XXH_get32bits(ptr)) * XXH_PRIME64_1;
        ptr += 4;
        hash = XXH_rotl64(hash, 23) * XXH_PRIME64_2 + XXH_PRIME64_3;
        len -= 4;
    }
    while (len > 0) {
        hash ^= (*ptr++) * XXH_PRIME64_5;
        hash = XXH_rotl64(hash, 11) * XXH_PRIME64_1;
        --len;
    }
    return  XXH64_avalanche(hash);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x17ef2
movq -0x18(%rbp), %rax
movq -0x18(%rbp), %rax
andq $0x1f, %rax
movq %rax, -0x18(%rbp)
cmpq $0x8, -0x18(%rbp)
jb 0x17f70
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x180b0
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x18050
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
rorxq $0x25, %rax, %rax
movabsq $-0x61c8864e7a143579, %rcx # imm = 0x9E3779B185EBCA87
imulq %rcx, %rax
movabsq $-0x7a1435883d4d519d, %rcx # imm = 0x85EBCA77C2B2AE63
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x18(%rbp), %rax
subq $0x8, %rax
movq %rax, -0x18(%rbp)
jmp 0x17efe
cmpq $0x4, -0x18(%rbp)
jb 0x17fdc
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x17b10
movl %eax, %eax
movabsq $-0x61c8864e7a143579, %rcx # imm = 0x9E3779B185EBCA87
imulq %rcx, %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
rorxq $0x29, %rax, %rax
movabsq $-0x3d4d51c2d82b14b1, %rcx # imm = 0xC2B2AE3D27D4EB4F
imulq %rcx, %rax
movabsq $0x165667b19e3779f9, %rcx # imm = 0x165667B19E3779F9
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x18(%rbp), %rax
subq $0x4, %rax
movq %rax, -0x18(%rbp)
jmp 0x17fde
cmpq $0x0, -0x18(%rbp)
jbe 0x18037
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movabsq $0x27d4eb2f165667c5, %rcx # imm = 0x27D4EB2F165667C5
imulq %rcx, %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
rorxq $0x35, %rax, %rax
movabsq $-0x61c8864e7a143579, %rcx # imm = 0x9E3779B185EBCA87
imulq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x17fde
movq -0x8(%rbp), %rdi
callq 0x18190
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/./xxhash.h
// Function: XXH64_mergeRound
static xxh_u64 XXH64_mergeRound(xxh_u64 acc, xxh_u64 val)
{
    val  = XXH64_round(0, val);
    acc ^= val;
    acc  = acc * XXH_PRIME64_1 + XXH_PRIME64_4;
    return acc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x18050
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movabsq $-0x61c8864e7a143579, %rax # imm = 0x9E3779B185EBCA87
imulq -0x8(%rbp), %rax
movabsq $-0x7a1435883d4d519d, %rcx # imm = 0x85EBCA77C2B2AE63
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/./xxhash.h
// Function: XXH64_avalanche
static xxh_u64 XXH64_avalanche(xxh_u64 hash)
{
    hash ^= hash >> 33;
    hash *= XXH_PRIME64_2;
    hash ^= hash >> 29;
    hash *= XXH_PRIME64_3;
    hash ^= hash >> 32;
    return hash;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
shrq $0x21, %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movabsq $-0x3d4d51c2d82b14b1, %rax # imm = 0xC2B2AE3D27D4EB4F
imulq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
shrq $0x1d, %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movabsq $0x165667b19e3779f9, %rax # imm = 0x165667B19E3779F9
imulq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
shrq $0x20, %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: zeta_range
static double
zeta_range(const u64 start, const u64 count, const double theta)
{
  if (count < 0x10000) {
    // sequential
    double sum = 0.0;
    for (u64 i = 0lu; i < count; i++) {
      sum += (1.0 / pow((double)(start + i + 1lu), theta));
    }
    return sum;
  }

  const u64 nth = process_affinity_core_count();
  debug_assert(nth > 0);
  struct zeta_range_info zi;
  atomic_init(&(zi.seq), 0);
  zi.nth = nth;
  zi.start = start;
  zi.count = count;
  zi.theta = theta;
  zi.sum = 0.0;
  spinlock_init(&(zi.lock));
  thread_fork_join(nth, zeta_range_worker, &zi);
  return zi.sum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
vmovsd %xmm0, -0x20(%rbp)
cmpq $0x10000, -0x18(%rbp)   # imm = 0x10000
jae 0x18290
vpxor %xmm0, %xmm0, %xmm0
vmovsd %xmm0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x18281
movq -0x10(%rbp), %rax
addq -0x30(%rbp), %rax
addq $0x1, %rax
vcvtusi2sd %rax, %xmm0, %xmm0
vmovsd -0x20(%rbp), %xmm1
callq 0x6130
vmovaps %xmm0, %xmm1
vmovsd 0x2e5b(%rip), %xmm0     # 0x1b0c0
vdivsd %xmm1, %xmm0, %xmm0
vaddsd -0x28(%rbp), %xmm0, %xmm0
vmovsd %xmm0, -0x28(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x18233
vmovsd -0x28(%rbp), %xmm0
vmovsd %xmm0, -0x8(%rbp)
jmp 0x18325
callq 0x8230
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
seta %al
movzbl %al, %edi
andl $0x1, %edi
callq 0x7640
movq $0x0, -0xe8(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xd0(%rbp)
vmovsd -0x20(%rbp), %xmm0
vmovsd %xmm0, -0xc8(%rbp)
vpxor %xmm0, %xmm0, %xmm0
vmovsd %xmm0, -0xc0(%rbp)
leaq -0xe8(%rbp), %rdi
addq $0x30, %rdi
callq 0x6e30
movq -0x38(%rbp), %rdi
leaq 0x34(%rip), %rsi        # 0x18340
leaq -0xe8(%rbp), %rdx
callq 0x89f0
vmovsd -0xc0(%rbp), %xmm0
vmovsd %xmm0, -0x8(%rbp)
vmovsd -0x8(%rbp), %xmm0
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: zeta_range_worker
static void *
zeta_range_worker(void * const ptr)
{
  struct zeta_range_info * const zi = (typeof(zi))ptr;
  const u64 seq = atomic_fetch_add(&(zi->seq), 1);
  const u64 start = zi->start;
  const double theta = zi->theta;
  const u64 count = zi->count;
  const u64 nth = zi->nth;
  double local_sum = 0.0;
  for (u64 i = seq; i < count; i += nth) {
    local_sum += (1.0 / pow((double)(start + i + 1lu), theta));
  }
  spinlock_lock(&(zi->lock));
  zi->sum += local_sum;
  spinlock_unlock(&(zi->lock));
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rcx
movq $0x1, -0x20(%rbp)
movq -0x20(%rbp), %rax
lock
xaddq %rax, (%rcx)
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
vmovsd 0x20(%rax), %xmm0
vmovsd %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
vpxor %xmm0, %xmm0, %xmm0
vmovsd %xmm0, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x18406
movq -0x30(%rbp), %rax
addq -0x58(%rbp), %rax
addq $0x1, %rax
vcvtusi2sd %rax, %xmm0, %xmm0
vmovsd -0x38(%rbp), %xmm1
callq 0x6130
vmovaps %xmm0, %xmm1
vmovsd 0x2cd6(%rip), %xmm0     # 0x1b0c0
vdivsd %xmm1, %xmm0, %xmm0
vaddsd -0x50(%rbp), %xmm0, %xmm0
vmovsd %xmm0, -0x50(%rbp)
movq -0x48(%rbp), %rax
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x183b8
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x6e50
vmovsd -0x50(%rbp), %xmm0
movq -0x10(%rbp), %rax
vaddsd 0x28(%rax), %xmm0, %xmm0
vmovsd %xmm0, 0x28(%rax)
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x6ed0
xorl %eax, %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: kvmap1_init
static inline void
kvmap1_init(struct kvmap1 * const map)
{
  const u64 lid = KVMAP_MIN_LEVEL;
  map->max_level = lid;
  map->min_level = lid;
  map->first_check = lid;
  struct __kvmap1_level * const l = &(map->levels[lid]);
  l->table = pages_alloc_best(KVMAP_SIZE_OF_LEVEL(lid), true, &(l->alloc_size));
  l->bm = bitmap_create(KVMAP_SLOTS_OF(lid));
  debug_assert(l->table);
  debug_assert(l->bm);
  bitmap_set_all1(l->bm);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x10, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq $0x10, 0x58(%rax)
movq -0x8(%rbp), %rax
movq $0x10, 0x60(%rax)
movq -0x8(%rbp), %rax
movq $0x10, 0x68(%rax)
movq -0x8(%rbp), %rax
addq $0x10128, %rax          # imm = 0x10128
addq $0x200, %rax            # imm = 0x200
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdx
addq $0x10, %rdx
movl $0x400000, %edi         # imm = 0x400000
movl $0x1, %esi
callq 0x8d40
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl $0x10000, %edi          # imm = 0x10000
callq 0x7c70
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
setne %al
movzbl %al, %edi
andl $0x1, %edi
callq 0x7640
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
setne %al
movzbl %al, %edi
andl $0x1, %edi
callq 0x7640
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7ed0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: kvmap1_locate_level
static inline void
kvmap1_locate_level(const struct kvmap1 * const map, const u64 hash, u64 * const out_level, u64 * const out_index)
{
  u64 i = map->first_check;
  const u64 check0 = i;
  while (i >= map->min_level) {
    const struct __kvmap1_level * const level = &(map->levels[i]);
    const u64 j = hash & ((UINT64_C(1) << i) - UINT64_C(1));
    if (bitmap_test(level->bm, j)) {
      *out_level = i;
      *out_index = j;
      return;
    } else if (i >= check0) {
      if (i == map->max_level) i = check0 - 1;
      else i++;
    } else {
      i--;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x60(%rcx), %rax
jb 0x185fb
movq -0x8(%rbp), %rax
addq $0x10128, %rax          # imm = 0x10128
movq -0x28(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
subq $0x1, %rcx
andq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0x7cd0
testb $0x1, %al
jne 0x1859c
jmp 0x185b4
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x185fb
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x185e8
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x58(%rcx), %rax
jne 0x185da
movq -0x30(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x185e6
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x185f4
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x185f6
jmp 0x1853c
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: kvmap1_locate_free_entry
static bool
kvmap1_locate_free_entry(const struct kvmap1 * const map, const struct kv * const key,
    u64 * const out_level, u64 * const out_index, u64 * const out_entry)
{
  const u64 hash = bits_rotl_u64(key->hash, map->hash_rotate);
  kvmap1_locate_level(map, hash, out_level, out_index);
  const struct __kvmap_slot * const slot = &(map->levels[*out_level].table[*out_index]);
  for (u64 k = 0; k < 8; k++) {
    if (slot->e[k].ptr == 0) {
      *out_entry = k;
      return true; // found an empty entry
    }
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rsi
callq 0x7b70
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x18510
movq -0x10(%rbp), %rax
addq $0x10128, %rax          # imm = 0x10128
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
cmpq $0x8, -0x48(%rbp)
jae 0x186dc
movq -0x40(%rbp), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x10, %rax
cmpq $0x0, %rax
jne 0x186cc
movq -0x48(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x186e0
jmp 0x186ce
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x1869e
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: kvmap2_try_cuckoo
static bool
kvmap2_try_cuckoo(struct kvmap1 * const target, struct kvmap1 * const origin, const u64 oi, struct __kvmap_entry * const e)
{
  struct kv * const victim = __u64_to_ptr(e->ptr);
  if (kvmap1_trylock_hash(target, victim)) {
    const bool ret = kvmap1_insert(target, victim, target->max_level);
    if (ret) {
      e->ptr = 0;
      e->pkey = 0;
      //(void)atomic_fetch_sub(&(origin->nr_kv), 1);
      (void)atomic_fetch_sub(&(origin->levels[oi].nr_kv), 1);
    }
    kvmap1_unlock_hash(target, victim);
    return ret;
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
shrq $0x10, %rdi
callq 0xf220
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x18c20
testb $0x1, %al
jne 0x18b8f
jmp 0x18c0a
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdx
callq 0xf9b0
andb $0x1, %al
movb %al, -0x31(%rbp)
testb $0x1, -0x31(%rbp)
je 0x18bf3
movq -0x28(%rbp), %rax
movzwl (%rax), %ecx
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rcx
andq $-0x10000, %rcx         # imm = 0xFFFF0000
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rdx
shlq $0x5, %rdx
movq $0x1, -0x40(%rbp)
movq -0x40(%rbp), %rax
negq %rax
lock
xaddq %rax, 0x10140(%rcx,%rdx)
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xf230
movb -0x31(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x18c0e
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: cuckoo_cuckoo_local
static bool
cuckoo_cuckoo_local(struct cuckoo * const map, const u64 hash, const struct kv * const kv)
{
  struct __kvmap_slot * const slot = cuckoo_hash_slot(map, hash);
  for (u64 k = 0; k < 8; k++) {
    if (slot->e[k].ptr == 0) {
      //cuckoo_put_entry(map, &(slot->e[k]), kv);
      kvmap_put_entry(&(map->mm), &(slot->e[k]), kv);
      return true;
    }
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x10cf0
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
cmpq $0x8, -0x30(%rbp)
jae 0x18ffc
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x10, %rax
cmpq $0x0, %rax
jne 0x18fec
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
callq 0x11390
movb $0x1, -0x1(%rbp)
jmp 0x19000
jmp 0x18fee
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x18fad
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: chainmap_expand_thread
static void *
chainmap_expand_thread(void * const ptr)
{
  struct chainmap * const map = (typeof(map))ptr;
  struct chainmap_expand_worker_info info;
  info.map = map;
  info.new_power = map->power + 1;
  const u64 table_size = sizeof(map->table[0]) * (UINT64_C(1) << info.new_power);
  info.new_table = (typeof(info.new_table))pages_alloc_best(table_size, true, &(info.new_alloc_size));
  debug_assert(info.new_table);
  atomic_store(&(info.uniq), 0);
  const double dt = thread_fork_join(0, chainmap_expand_worker, &info);
  pages_unmap(map->table, map->alloc_size);
  map->table = info.new_table;
  map->alloc_size = info.new_alloc_size;
  map->power = info.new_power;
  map->trigger = UINT64_C(2) << map->power;
  atomic_thread_fence(memory_order_seq_cst);

  for (u64 i = 0; i < KVMAP_HLOCK_NR; i++) {
    spinlock_unlock(&(map->hlocks[i]));
  }
  mutexlock_unlock(&(map->expand_lock));
  fprintf(stderr, "%s workers time %.2lf\n", __func__, dt);
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0xd0(%rax), %rax
incq %rax
movq %rax, -0x30(%rbp)
movb -0x30(%rbp), %al
movb %al, %cl
movl $0x1, %eax
shlxq %rcx, %rax, %rax
shlq $0x3, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x20(%rbp), %rdx
movl $0x1, %esi
callq 0x8d40
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
testq %rax, %rax
setne %al
movzbl %al, %edi
callq 0x7640
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
xchgq %rax, -0x18(%rbp)
leaq 0xfc(%rip), %rsi        # 0x196f0
xorl %eax, %eax
movl %eax, %edi
leaq -0x38(%rbp), %rdx
callq 0x89f0
vmovsd %xmm0, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0xe8(%rax), %rdi
movq 0xf0(%rax), %rsi
callq 0x8c10
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xe8(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xf0(%rax)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xd0(%rax)
movq -0x10(%rbp), %rax
movb 0xd0(%rax), %cl
movb %cl, %dl
movl $0x2, %ecx
shlxq %rdx, %rcx, %rcx
movq %rcx, 0xd8(%rax)
mfence
movq $0x0, -0x58(%rbp)
cmpq $0x400, -0x58(%rbp)     # imm = 0x400
jae 0x196a5
movq -0x10(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
movq -0x58(%rbp), %rax
shlq $0x6, %rax
addq %rax, %rdi
callq 0x6ed0
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x19672
movq -0x10(%rbp), %rdi
addq $0xf8, %rdi
callq 0x6fb0
movq 0x893c(%rip), %rax      # 0x21ff8
movq (%rax), %rdi
vmovsd -0x50(%rbp), %xmm0
leaq 0x2148(%rip), %rsi      # 0x1b813
leaq 0x2158(%rip), %rdx      # 0x1b82a
movb $0x1, %al
callq 0x62e0
xorl %eax, %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: chainmap_expand_worker
static void *
chainmap_expand_worker(void * const ptr)
{
  struct chainmap_expand_worker_info * const info = (typeof(info))ptr;
  struct chainmap * const map = info->map;
  debug_assert(map->power >= KVMAP_HLOCK_POWER);
  const u64 hi_max = UINT64_C(1) << (map->power - KVMAP_HLOCK_POWER);
  do {
    const u64 lidx = atomic_fetch_add(&(info->uniq), 1);
    if (lidx >= KVMAP_HLOCK_NR) break;
    spinlock_lock(&(map->hlocks[lidx]));
    for (u64 h = 0; h < hi_max; h++) {
      const u64 hidx = (h << KVMAP_HLOCK_POWER) | lidx;
      struct chainnode * iter = info->map->table[hidx];
      while (iter) {
        struct chainnode * const next = iter->next;
        struct kv * const curr = __u64_to_ptr(iter->e.ptr);
        const u64 h2 = (curr->hash >> KVMAP_BASE_LEVEL) & ((UINT64_C(1) << info->new_power) - UINT64_C(1));
        iter->next = info->new_table[h2];
        info->new_table[h2] = iter;
        iter = next;
      }
    }
  } while (true);
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0xa, 0xd0(%rax)
setae %al
movzbl %al, %edi
andl $0x1, %edi
callq 0x7640
movq -0x18(%rbp), %rax
movq 0xd0(%rax), %rcx
subq $0xa, %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rcx
movq $0x1, -0x30(%rbp)
movq -0x30(%rbp), %rax
lock
xaddq %rax, 0x20(%rcx)
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x400, -0x28(%rbp)     # imm = 0x400
jb 0x19775
jmp 0x1987e
movq -0x18(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
movq -0x28(%rbp), %rax
shlq $0x6, %rax
addq %rax, %rdi
callq 0x6e50
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x19870
movq -0x40(%rbp), %rax
shlq $0xa, %rax
orq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x1985d
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rdi
shrq $0x10, %rdi
callq 0xf220
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq (%rax), %rax
shrq $0x6, %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
subq $0x1, %rcx
andq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x68(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x68(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x58(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x197d0
jmp 0x1985f
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x19798
jmp 0x19872
movb $0x1, %al
testb $0x1, %al
jne 0x19744
jmp 0x1987e
xorl %eax, %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: bptree_get_leaf
static inline struct kv *
bptree_get_leaf(struct bptree * const tree, struct bpnode * const node, const struct kv * const key, struct kv * const out)
{
  struct kv ** const kv = bsearch(&key, node->karray, node->nr, sizeof(&key), __kv_compare_pp);
  if (kv && (*kv)) {
    if (tree->mm.hf) tree->mm.hf(*kv, tree->mm.hp);
    struct kv * const ret = kv_dup2(*kv, out);
    return ret;
  }
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rsi
addq $0x20, %rsi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
leaq -0x20(%rbp), %rdi
movl $0x8, %ecx
leaq -0xb568(%rip), %r8      # 0xe360
callq 0x6530
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x19924
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
je 0x19924
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x19906
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rcx), %rdi
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rsi
callq *%rax
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0xdfb0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1992c
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: bptree_probe_leaf
static inline bool
bptree_probe_leaf(struct bptree * const tree, struct bpnode * const node, const struct kv * const key)
{
  const struct kv ** const kv = bsearch(&key, node->karray, node->nr, sizeof(&key), __kv_compare_pp);
  if (kv && (*kv)) {
    if (tree->mm.hf) tree->mm.hf(*kv, tree->mm.hp);
    return true;
  } else {
    return false;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rsi
addq $0x20, %rsi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
leaq -0x20(%rbp), %rdi
movl $0x8, %ecx
leaq -0xb614(%rip), %r8      # 0xe360
callq 0x6530
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x199b8
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
je 0x199b8
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x199b2
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rdi
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rsi
callq *%rax
movb $0x1, -0x1(%rbp)
jmp 0x199bc
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)