// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: kvmap1_fprint
static void
kvmap1_fprint(struct kvmap1 * const map, FILE * const out)
{
  u64 sum_kv = 0;
  for (u64 i = 0; i < 64; i++) {
    struct __kvmap1_level * const level = &(map->levels[i]);
    if (level->table && level->bm) {
      sum_kv += atomic_load(&(level->nr_kv));
    }
  }
  fprintf(out, "KVMAP ROTL %"PRIu64" NR %"PRIu64" ||", map->hash_rotate, sum_kv);
  const double sum100 = ((double)sum_kv) * 0.01;

  u64 sumhit = 0;
  u64 sumtry = 0;
  for (u64 i = 0; i < 64; i++) {
    struct __kvmap1_level * const level = &(map->levels[i]);
    if (level->table && level->bm) {
      const u64 nr_kv = atomic_load(&(level->nr_kv));
      const u64 used = bitmap_count(level->bm);
      const double pslots = ((double)used) / ((double)(KVMAP_SLOTS_OF(i))) * 100.0;
      const char tag = (i == map->first_check) ? '*':' ';
      fprintf(out, " %cL %"PRIu64" SL %"PRIu64" %"PRIu64" %.2lf%% ET %"PRIu64" %"PRIu64" %.2lf%% |",
          tag, i, used, KVMAP_SLOTS_OF(i), pslots, nr_kv, KVMAP_ENTRIES_OF(i), ((double)nr_kv) / sum100);
      sumhit += nr_kv;
      const u64 ntry = i >= map->first_check ? (i - map->first_check + 1) : (map->max_level - i + 1);
      sumtry += nr_kv * ntry;
    }
  }
  fprintf(out, " KVMAP AVG TRY %.2lf\n", ((double)sumtry) / ((double)sumhit));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x40, -0x20(%rbp)
jae 0x100b0
movq -0x8(%rbp), %rax
addq $0x10128, %rax          # imm = 0x10128
movq -0x20(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
je 0x100a0
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x100a0
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x100a2
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x10053
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdx
movq -0x18(%rbp), %rcx
leaq 0xb6ce(%rip), %rsi      # 0x1b795
movb $0x0, %al
callq 0x62e0
vcvtusi2sdq -0x18(%rbp), %xmm0, %xmm0
vmovsd 0xb01b(%rip), %xmm1     # 0x1b0f8
vmulsd %xmm1, %xmm0, %xmm0
vmovsd %xmm0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
cmpq $0x40, -0x50(%rbp)
jae 0x10293
movq -0x8(%rbp), %rax
addq $0x10128, %rax          # imm = 0x10128
movq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq $0x0, (%rax)
je 0x10280
movq -0x58(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x10280
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7eb0
movq %rax, -0x70(%rbp)
vcvtusi2sdq -0x70(%rbp), %xmm0, %xmm0
movq -0x50(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
vcvtusi2sd %rax, %xmm1, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0xaf27(%rip), %xmm1     # 0x1b0b0
vmulsd %xmm1, %xmm0, %xmm0
vmovsd %xmm0, -0x78(%rbp)
movq -0x50(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rsi
movl $0x20, %eax
movl $0x2a, %ecx
cmpq %rsi, %rdx
cmovel %ecx, %eax
movb %al, -0x79(%rbp)
movq -0x10(%rbp), %rdi
movsbl -0x79(%rbp), %edx
movq -0x50(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x70(%rbp), %r8
movq -0x50(%rbp), %rcx
movl $0x1, %r9d
shlq %cl, %r9
vmovsd -0x78(%rbp), %xmm0
movq -0x60(%rbp), %r10
movq -0x50(%rbp), %rcx
movl $0x8, %eax
shlq %cl, %rax
movq -0x90(%rbp), %rcx
vcvtusi2sdq -0x60(%rbp), %xmm1, %xmm1
vdivsd -0x38(%rbp), %xmm1, %xmm1
leaq 0xb5aa(%rip), %rsi      # 0x1b7ae
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x2, %al
callq 0x62e0
movq -0x60(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x68(%rcx), %rax
jb 0x10247
movq -0x50(%rbp), %rax
movq -0x8(%rbp), %rcx
subq 0x68(%rcx), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x1025e
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
subq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x60(%rbp), %rax
imulq -0x88(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x10282
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x100fe
movq -0x10(%rbp), %rdi
vcvtusi2sdq -0x48(%rbp), %xmm0, %xmm0
vcvtusi2sdq -0x40(%rbp), %xmm1, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
leaq 0xb52f(%rip), %rsi      # 0x1b7df
movb $0x1, %al
callq 0x62e0
addq $0xb0, %rsp
popq %rbp
retq