// File: /workspace/github_c_makefile_star2_O2/FastFilter[P]BlockBloomSimulator/src/laneblockmodel.h
// Function: assessBlockSizeLanes
void assessBlockSizeLanes(size_t HowManyKeys, size_t BlockSizeInBits,
                          bool verbose) {
  for (size_t bitsperkey = 8; bitsperkey <= 16; bitsperkey += 1) {
    size_t bitbudget = bitsperkey * HowManyKeys;
    sim_stats_t beststats;
    size_t bestlane = findBestLaneSize(HowManyKeys, bitbudget, BlockSizeInBits,
                                       &beststats, verbose);
    double colrate8 = findLaneCollisionRateAndDensity(HowManyKeys, bitbudget,
                                            BlockSizeInBits, 8, verbose).collision_rate;
    // for each key, we set BlockSizeInBits/bestlane bits to one
    double density = ( BlockSizeInBits / bestlane ) * 1.0 / bitsperkey;

    double bloombestbitsperbucket = bitsperkey * log(2);
    double bloombestcollisionrate = pow(2, -bloombestbitsperbucket);

    double theoretical_best_bits = log(1.0/beststats.collision_rate) / log(2.0);
    double inefficiency = (bitsperkey/theoretical_best_bits - 1.0) * 100.0;
    printf("bits per key %3zu best lane size = %zu bits, max density = %0.0f %%, density = %0.0f %%, collision rate = "
           "%0.3f %% (x %.2f worse than Bloom), inefficiency = %0.1f %%  // collision rate at 8 bits is "
           "%0.3f %% \n",
           bitsperkey, bestlane, density * 100, beststats.density * 100, beststats.collision_rate * 100,
           beststats.collision_rate / bloombestcollisionrate,  inefficiency, colrate8 * 100);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq (,%rdi,8), %r15
pushq $0x8
popq %r12
movq %r12, %rbp
cmpq $0x11, %r12
je 0x1db1
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
leaq 0x20(%rsp), %rcx
xorl %r8d, %r8d
callq 0x1a31
movq %rax, %r13
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0x1b99
movsd %xmm0, 0x18(%rsp)
movq %rbx, %rax
xorl %edx, %edx
divq %r13
movq %rax, %xmm0
punpckldq 0x2375(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x237d(%rip), %xmm0     # 0x4060
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
cvtsi2sd %r12, %xmm2
movsd %xmm2, (%rsp)
addsd %xmm0, %xmm1
divsd %xmm2, %xmm1
movapd %xmm1, 0x30(%rsp)
movapd %xmm2, %xmm0
mulsd 0x2399(%rip), %xmm0     # 0x40a8
callq 0x1030
movsd %xmm0, 0x10(%rsp)
movsd 0x20(%rsp), %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x235a(%rip), %xmm0     # 0x4088
divsd %xmm1, %xmm0
callq 0x10a0
divsd 0x2351(%rip), %xmm0     # 0x4090
movsd (%rsp), %xmm4
divsd %xmm0, %xmm4
addsd 0x2348(%rip), %xmm4     # 0x4098
movsd 0x2348(%rip), %xmm6     # 0x40a0
mulsd %xmm6, %xmm4
movapd 0x30(%rsp), %xmm0
mulsd %xmm6, %xmm0
movsd 0x28(%rsp), %xmm1
mulsd %xmm6, %xmm1
movsd 0x8(%rsp), %xmm5
movapd %xmm5, %xmm2
mulsd %xmm6, %xmm2
divsd 0x10(%rsp), %xmm5
movapd %xmm5, %xmm3
movsd 0x18(%rsp), %xmm5
mulsd %xmm6, %xmm5
leaq 0x2495(%rip), %rdi      # 0x422e
movq %r12, %rsi
movq %r13, %rdx
movb $0x6, %al
callq 0x1080
incq %r12
addq %r14, %r15
jmp 0x1c89
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq