// File: /workspace/github_c_makefile_star2_O0/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:
subq $0xb8, %rsp
movb %dl, %al
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
andb $0x1, %al
movb %al, 0xa7(%rsp)
movq $0x8, 0x98(%rsp)
cmpq $0x10, 0x98(%rsp)
ja 0x270a
movq 0x98(%rsp), %rax
movq 0xb0(%rsp), %rcx
imulq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0xb0(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movzbl 0xa7(%rsp), %r8d
andl $0x1, %r8d
leaq 0x80(%rsp), %rcx
callq 0x1fa0
movq %rax, 0x78(%rsp)
movq 0xb0(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movzbl 0xa7(%rsp), %r8d
andl $0x1, %r8d
movl $0x8, %ecx
callq 0x2270
movsd %xmm0, 0x60(%rsp)
movsd %xmm1, 0x68(%rsp)
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x70(%rsp)
movq 0xa8(%rsp), %rax
movq 0x78(%rsp), %rcx
xorl %edx, %edx
divq %rcx
movq %rax, %xmm0
movaps 0x3acb(%rip), %xmm2     # 0x6010
movaps %xmm2, 0x10(%rsp)
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0x3aca(%rip), %xmm1     # 0x6020
movaps %xmm1, 0x20(%rsp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm3
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm3, %xmm0
movq 0x98(%rsp), %xmm3
punpckldq %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
subpd %xmm1, %xmm3
movaps %xmm3, %xmm4
unpckhpd %xmm3, %xmm3            # xmm3 = xmm3[1,1]
addsd %xmm4, %xmm3
divsd %xmm3, %xmm0
movsd %xmm0, 0x58(%rsp)
movq 0x98(%rsp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, (%rsp)
movsd 0x3a9f(%rip), %xmm0     # 0x6058
movsd %xmm0, 0x8(%rsp)
callq 0x1080
movsd (%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x8(%rsp), %xmm0
mulsd %xmm2, %xmm1
movsd %xmm1, 0x50(%rsp)
movaps 0x3a4d(%rip), %xmm2     # 0x6030
movsd 0x50(%rsp), %xmm1
pxor %xmm2, %xmm1
callq 0x1050
movsd %xmm0, 0x48(%rsp)
movsd 0x80(%rsp), %xmm1
movsd 0x3a37(%rip), %xmm0     # 0x6040
divsd %xmm1, %xmm0
callq 0x1080
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
movsd %xmm1, 0x30(%rsp)
callq 0x1080
movaps 0x10(%rsp), %xmm2
movaps 0x20(%rsp), %xmm1
movaps %xmm0, %xmm3
movsd 0x30(%rsp), %xmm0
divsd %xmm3, %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x98(%rsp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
divsd 0x40(%rsp), %xmm0
movsd 0x39d3(%rip), %xmm1     # 0x6040
subsd %xmm1, %xmm0
movsd 0x39d7(%rip), %xmm1     # 0x6050
mulsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rsp)
movq 0x98(%rsp), %rsi
movq 0x78(%rsp), %rdx
movsd 0x39b8(%rip), %xmm0     # 0x6050
mulsd 0x58(%rsp), %xmm0
movsd 0x39aa(%rip), %xmm1     # 0x6050
mulsd 0x88(%rsp), %xmm1
movsd 0x3999(%rip), %xmm2     # 0x6050
mulsd 0x80(%rsp), %xmm2
movsd 0x80(%rsp), %xmm3
divsd 0x48(%rsp), %xmm3
movsd 0x38(%rsp), %xmm4
movsd 0x3973(%rip), %xmm5     # 0x6050
mulsd 0x70(%rsp), %xmm5
leaq 0x3af4(%rip), %rdi      # 0x61de
movb $0x6, %al
callq 0x1060
movq 0x98(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x98(%rsp)
jmp 0x247e
addq $0xb8, %rsp
retq
nopw %cs:(%rax,%rax)