// File: /workspace/github_c_makefile_star2_O1/skeeto[P]hash-prospector/hillclimb.c
// Function: exact_bias32
static double
exact_bias32(const struct hash *f)
{
    int i; // declare here to work around Visual Studio issue
    long long bins[32][32] = {{0}};
    static const uint64_t range = (UINT64_C(1) << 32) / EXACT_SPLIT;
    #pragma omp parallel for
    for (i = 0; i < EXACT_SPLIT; i++) {
        long long b[32][32] = {{0}};
        for (uint64_t x = i * range; x < (i + 1) * range; x++) {
            uint32_t h0 = hash(f, x);
            for (int j = 0; j < 32; j++) {
                uint32_t bit = UINT32_C(1) << j;
                uint32_t h1 = hash(f, x ^ bit);
                uint32_t set = h0 ^ h1;
                for (int k = 0; k < 32; k++)
                    b[j][k] += (set >> k) & 1;
            }
        }
        #pragma omp critical
        for (int j = 0; j < 32; j++)
            for (int k = 0; k < 32; k++)
                bins[j][k] += b[j][k];
    }
    double mean = 0.0;
    for (int j = 0; j < 32; j++) {
        for (int k = 0; k < 32; k++) {
            double diff = (bins[j][k] - 2147483648L) / 2147483648.0;
            mean += (diff * diff) / (32 * 32);
        }
    }
    return sqrt(mean) * 1000.0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4008, %rsp           # imm = 0x4008
movq %rdi, %rbx
movq %rsp, %rdi
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0x1090
xorl %r10d, %r10d
movzbl 0xf(%rbx), %ebp
movl $0x8000000, %r13d       # imm = 0x8000000
leaq 0x2000(%rsp), %r15
movl $0x100, %r14d           # imm = 0x100
movq %r10, %r12
movl $0x2000, %edx           # imm = 0x2000
movq %r15, %rdi
xorl %esi, %esi
callq 0x1090
leaq 0x1(%r12), %r10
shlq $0x1b, %r12
movq $-0x3, %rdx
movl %r12d, %eax
movb 0xf(%rbx,%rdx), %cl
movl %eax, %esi
shrl %cl, %esi
xorl %esi, %eax
imull 0xc(%rbx,%rdx,4), %eax
incq %rdx
jne 0x207b
movq %r15, %rdx
xorl %esi, %esi
movl %r12d, %edi
btcl %esi, %edi
movq $-0x3, %r8
movb 0xf(%rbx,%r8), %cl
movl %edi, %r9d
shrl %cl, %r9d
xorl %r9d, %edi
imull 0xc(%rbx,%r8,4), %edi
incq %r8
jne 0x20a1
xorl %eax, %edi
movl %edi, %r8d
movl %ebp, %ecx
shrl %cl, %r8d
xorl %edi, %r8d
xorl %ecx, %ecx
btl %ecx, %r8d
adcq $0x0, (%rdx,%rcx,8)
incq %rcx
cmpq $0x20, %rcx
jne 0x20c9
incq %rsi
addq $0x100, %rdx            # imm = 0x100
cmpq $0x20, %rsi
jne 0x2094
incq %r12
cmpq %r13, %r12
jne 0x2071
movq %rsp, %rax
movq %r15, %rcx
xorl %edx, %edx
xorl %esi, %esi
movq (%rcx,%rsi,8), %rdi
addq %rdi, (%rax,%rsi,8)
incq %rsi
cmpq $0x20, %rsi
jne 0x2101
incq %rdx
addq %r14, %rcx
addq %r14, %rax
cmpq $0x20, %rdx
jne 0x20ff
addq $0x8000000, %r13        # imm = 0x8000000
cmpq $0x20, %r10
jne 0x2056
xorpd %xmm0, %xmm0
movq %rsp, %rax
xorl %ecx, %ecx
movq $-0x80000000, %rdx      # imm = 0x80000000
movsd 0xece(%rip), %xmm1      # 0x3018
movsd 0xece(%rip), %xmm2      # 0x3020
xorl %esi, %esi
movq (%rax,%rsi,8), %rdi
addq %rdx, %rdi
xorps %xmm3, %xmm3
cvtsi2sd %rdi, %xmm3
mulsd %xmm1, %xmm3
mulsd %xmm3, %xmm3
mulsd %xmm2, %xmm3
addsd %xmm3, %xmm0
incq %rsi
cmpq $0x20, %rsi
jne 0x2154
incq %rcx
addq $0x100, %rax            # imm = 0x100
cmpq $0x20, %rcx
jne 0x2152
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x219b
sqrtsd %xmm0, %xmm0
jmp 0x21a0
callq 0x1150
mulsd 0xe80(%rip), %xmm0      # 0x3028
addq $0x4008, %rsp           # imm = 0x4008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq