// File: /workspace/github_c_makefile_star2_O0/FastFilter[P]BlockBloomSimulator/src/windowedblockmodel.h
// Function: assessWindowedBlockSize
void assessWindowedBlockSize(size_t HowManyKeys, size_t BlockSizeInBits, size_t WindowSizeInBits, bool verbose) {
  for (size_t bitsperkey = 8; bitsperkey <= 16; bitsperkey += 4) {
    size_t bitbudget = bitsperkey * HowManyKeys;
    sim_stats_t beststats;
    size_t bestbitsperbucket = findBestBitsPerKeyPerBlockWindow(
        HowManyKeys, bitbudget, BlockSizeInBits, WindowSizeInBits, &beststats, verbose);
    double density = bestbitsperbucket * 1.0 / bitsperkey;

    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 WindowSizeInBits %3zu best bits per bucket = %zu, max density = %0.0f %%, density = %0.0f %%, collision rate = "
           "%0.3f %%, inefficiency = %0.1f %% \n",
           bitsperkey, WindowSizeInBits, bestbitsperbucket, density * 100,   beststats.density * 100, beststats.collision_rate * 100, inefficiency);
  }
}

// Assembly:
subq $0x88, %rsp
movb %cl, %al
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
andb $0x1, %al
movb %al, 0x6f(%rsp)
movq $0x8, 0x60(%rsp)
cmpq $0x10, 0x60(%rsp)
ja 0x1a93
movq 0x60(%rsp), %rax
movq 0x80(%rsp), %rcx
imulq %rcx, %rax
movq %rax, 0x58(%rsp)
movq 0x80(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq 0x70(%rsp), %rcx
movzbl 0x6f(%rsp), %r9d
andl $0x1, %r9d
leaq 0x48(%rsp), %r8
callq 0x1650
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %xmm0
movaps 0x36a7(%rip), %xmm3     # 0x5010
movaps %xmm3, (%rsp)
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x36a7(%rip), %xmm2     # 0x5020
movaps %xmm2, 0x10(%rsp)
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq 0x60(%rsp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x48(%rsp), %xmm1
movsd 0x3672(%rip), %xmm0     # 0x5030
divsd %xmm1, %xmm0
callq 0x1070
movsd %xmm0, 0x20(%rsp)
movsd 0x3673(%rip), %xmm0     # 0x5048
callq 0x1070
movaps (%rsp), %xmm2
movaps 0x10(%rsp), %xmm1
movaps %xmm0, %xmm3
movsd 0x20(%rsp), %xmm0
divsd %xmm3, %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0x60(%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 0x30(%rsp), %xmm0
movsd 0x3613(%rip), %xmm1     # 0x5030
subsd %xmm1, %xmm0
movsd 0x3617(%rip), %xmm1     # 0x5040
mulsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x60(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0x40(%rsp), %rcx
movsd 0x35f6(%rip), %xmm0     # 0x5040
mulsd 0x38(%rsp), %xmm0
movsd 0x35e8(%rip), %xmm1     # 0x5040
mulsd 0x50(%rsp), %xmm1
movsd 0x35da(%rip), %xmm2     # 0x5040
mulsd 0x48(%rsp), %xmm2
movsd 0x28(%rsp), %xmm3
leaq 0x35d7(%rip), %rdi      # 0x5050
movb $0x4, %al
callq 0x1050
movq 0x60(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x60(%rsp)
jmp 0x190a
addq $0x88, %rsp
retq
nopl (%rax,%rax)