// File: /workspace/github_c_makefile_star2_O3/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 0x1fe1
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 0x2007
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 0x202f
incq %rsi
addq $0x100, %rdx            # imm = 0x100
cmpq $0x20, %rsi
jne 0x1ffa
incq %r12
cmpq %r13, %r12
jne 0x1fd7
movq %rsp, %rax
movq %r15, %rcx
xorl %edx, %edx
xorl %esi, %esi
movdqa (%rax,%rsi,8), %xmm0
paddq (%rcx,%rsi,8), %xmm0
movdqa %xmm0, (%rax,%rsi,8)
addq $0x2, %rsi
cmpq $0x20, %rsi
jne 0x2067
incq %rdx
addq %r14, %rcx
addq %r14, %rax
cmpq $0x20, %rdx
jne 0x2065
addq $0x8000000, %r13        # imm = 0x8000000
cmpq $0x20, %r10
jne 0x1fbc
pxor %xmm0, %xmm0
movq %rsp, %rax
xorl %ecx, %ecx
movq $-0x80000000, %rdx      # imm = 0x80000000
movsd 0xf60(%rip), %xmm1      # 0x3018
movsd 0xf60(%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 0x20c2
incq %rcx
addq $0x100, %rax            # imm = 0x100
cmpq $0x20, %rcx
jne 0x20c0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x2109
sqrtsd %xmm0, %xmm0
jmp 0x210e
callq 0x1140
mulsd 0xf12(%rip), %xmm0      # 0x3028
addq $0x4008, %rsp           # imm = 0x4008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq