// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: icache_hint
inline void
icache_hint(struct icache * const cache, const struct kv * const kv)
{
  const u64 hash = kv->hash;
  const u64 idx = (hash >> KVMAP_BASE_LEVEL) % cache->nr_slots;
  struct __icache_slot * const slot = &(cache->table[idx]);
  if ((slot->used < ICACHE_ENTRY_NR) || ((random_u64() & 0xfff) < 0x80)) {
    struct __icache_hist * const hist = &(cache->hists[(hash >> KVMAP_BASE_LEVEL) % cache->nr_hists]);
    const u64 rep = icache_hist_update(hist, kvmap_pkey(hash));
    if (rep) {
      if (icache_update(slot, rep, kv)) {
        // replaced
      }
    }
  }
  if (cache->map_mm.hf) cache->map_mm.hf(kv, cache->map_mm.hp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq %rsi, -0x30(%rbp)
movq (%rsi), %r13
movq %r13, %r15
shrq $0x6, %r15
movq %r15, %rax
xorl %edx, %edx
divq 0x10120(%rdi)
movq %rdx, %r12
movq 0x10130(%rdi), %rbx
shlq $0x6, %r12
movq (%rbx,%r12), %rax
shrq $0x3c, %rax
cmpl $0x7, %eax
jb 0x11883
movq %fs:-0x8, %rax
testq %rax, %rax
jne 0x11843
leaq -0x40(%rbp), %rsi
movl $0x4, %edi
callq 0x6110
leaq -0x40(%rbp), %rcx
imulq $0x3b9aca00, (%rcx), %rax # imm = 0x3B9ACA00
addq 0x8(%rcx), %rax
movq %rax, %rcx
shrq $0xc, %rcx
xorq %rax, %rcx
movq %rcx, %rax
shlq $0x19, %rax
xorq %rcx, %rax
movq %rax, %rcx
shrq $0x1b, %rcx
xorq %rax, %rcx
movabsq $0x2545f4914f6cdd1d, %rax # imm = 0x2545F4914F6CDD1D
imulq %rcx, %rax
movq %rax, %fs:-0x8
testl $0xf80, %eax            # imm = 0xF80
jne 0x11b6f
movabsq $0x7000000000000000, %rcx # imm = 0x7000000000000000
addq %r12, %rbx
xorl %esi, %esi
movq %r15, %rax
xorl %edx, %edx
divq 0x10138(%r14)
shlq $0x4, %rdx
addq 0x10148(%r14), %rdx
movq %r13, %rdi
shrq $0x20, %rdi
xorl %r13d, %edi
movl %edi, %eax
shrl $0x10, %eax
xorl %edi, %eax
movl $0x7, %edi
xorl %r12d, %r12d
xorl %r8d, %r8d
cmpw %ax, 0x2(%rdx,%rsi,2)
sete %r8b
addq %r8, %r12
incq %rsi
decq %rdi
jne 0x118c2
movzwl (%rdx), %esi
movw %ax, 0x2(%rdx,%rsi,2)
movl %esi, %eax
incl %eax
imulq $0x24924925, %rax, %rax # imm = 0x24924925
shrq $0x20, %rax
leal (,%rax,8), %edi
subl %edi, %eax
addl %esi, %eax
incl %eax
movw %ax, (%rdx)
testq %r12, %r12
je 0x11b6f
movabsq $0xfffffffffffffff, %r13 # imm = 0xFFFFFFFFFFFFFFF
movq (%rbx), %rax
cmpq %rcx, %rax
jae 0x11941
movl $0x7, %esi
xorl %edx, %edx
movq 0x8(%rbx,%rdx,8), %rdi
cmpq $0x10000, %rdi          # imm = 0x10000
jb 0x11a94
incq %rdx
decq %rsi
jne 0x11922
callq 0x66ef
movq %fs:-0x8, %rax
testq %rax, %rax
jne 0x1196b
leaq -0x40(%rbp), %r15
movl $0x4, %edi
movq %r15, %rsi
callq 0x6110
imulq $0x3b9aca00, (%r15), %rax # imm = 0x3B9ACA00
addq 0x8(%r15), %rax
movq %rax, %rcx
shrq $0xc, %rcx
xorq %rax, %rcx
movq %rcx, %rdx
shlq $0x19, %rdx
xorq %rcx, %rdx
movq %rdx, %rax
shrq $0x1b, %rax
xorq %rdx, %rax
movabsq $0x2545f4914f6cdd1d, %rdx # imm = 0x2545F4914F6CDD1D
imulq %rax, %rdx
movq %rdx, %fs:-0x8
movabsq $0x2492492492492493, %rsi # imm = 0x2492492492492493
mulxq %rsi, %rcx, %rcx
movq %rdx, %r8
subq %rcx, %r8
shrq %r8
addq %rcx, %r8
shrq $0x2, %r8
leaq (,%r8,8), %rcx
subq %rcx, %r8
addq %rdx, %r8
movq (%rbx), %rcx
leal (,%r8,4), %edi
shrxq %rdi, %rcx, %r9
testb $0xf, %r9b
je 0x11a0b
movq $-0x1, %r9
shlxq %rdi, %r9, %rdi
addq %rcx, %rdi
andq %r13, %rdi
movabsq $-0x1000000000000000, %r9 # imm = 0xF000000000000000
andq %rcx, %r9
orq %rdi, %r9
movq %r9, (%rbx)
movq %r9, %rcx
andq %rcx, %r13
mulxq %rsi, %rdi, %rdi
subq %rdi, %rdx
shrq %rdx
addq %rdi, %rdx
shrq $0x2, %rdx
imulq $-0x1c, %rdx, %rdi
movabsq $0x6ae82dbac24c8b8c, %rdx # imm = 0x6AE82DBAC24C8B8C
imulq %rdx, %rax
subq %rax, %rdi
movl $0x7, %r9d
xorl %r10d, %r10d
movq %r8, %rax
movq %rax, %rdx
mulxq %rsi, %rdx, %rdx
movq %rax, %r11
subq %rdx, %r11
shrq %r11
addl %edx, %r11d
shrl $0x2, %r11d
leal (%r11,%r11,8), %edx
leal (%rdx,%rdx,2), %edx
addl %r11d, %edx
movl %edi, %r15d
subl %edx, %r15d
leaq (%r10,%r8), %rdx
mulxq %rsi, %r11, %r11
shrxq %r15, %r13, %r15
andl $0xf, %r15d
cmpq %r12, %r15
jb 0x11adc
incq %r10
addq $0x4, %rdi
incq %rax
decq %r9
jne 0x11a41
jmp 0x11b6f
movq -0x30(%rbp), %r8
movq %r8, %rsi
shlq $0x10, %rsi
orq %rsi, %rdi
movq %rdi, 0x8(%rbx,%rdx,8)
movq (%r8), %rdi
movq %rdi, %r8
shrq $0x20, %r8
xorl %edi, %r8d
movl %r8d, %edi
shrl $0x10, %edi
xorl %r8d, %edi
movzwl %di, %edi
orq %rsi, %rdi
movq %rdi, 0x8(%rbx,%rdx,8)
andq %rax, %rcx
addq %r13, %rcx
andq %r13, %rax
addq %rcx, %rax
incq %rax
jmp 0x11b6c
movq %rdx, %r8
subq %r11, %r8
shrq %r8
addq %r11, %r8
shrq $0x2, %r8
leaq (,%r8,8), %r9
subq %r9, %r8
addq %rdx, %r8
movzwl 0x8(%rbx,%r8,8), %edx
movq -0x30(%rbp), %r10
movq %r10, %r9
shlq $0x10, %r9
orq %r9, %rdx
movq %rdx, 0x8(%rbx,%r8,8)
movq (%r10), %rdx
movq %rdx, %r10
shrq $0x20, %r10
xorl %edx, %r10d
movl %r10d, %edx
shrl $0x10, %edx
xorl %r10d, %edx
movzwl %dx, %edx
orq %r9, %rdx
movq %rdx, 0x8(%rbx,%r8,8)
movq %rax, %rdx
mulxq %rsi, %rdx, %rdx
subq %rdx, %rax
shrq %rax
addl %edx, %eax
shrl $0x2, %eax
leal (%rax,%rax,8), %edx
leal (%rdx,%rdx,2), %edx
addl %eax, %edx
subl %edx, %edi
movl $0xf, %eax
shlxq %rdi, %rax, %rax
andl $0xf, %r12d
shlxq %rdi, %r12, %rdx
andnq %rcx, %rax, %rax
orq %rdx, %rax
movq %rax, (%rbx)
movq 0x70(%r14), %rax
testq %rax, %rax
je 0x11b82
movq 0x78(%r14), %rsi
movq -0x30(%rbp), %rdi
callq *%rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq