// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x4050, %rsp           # imm = 0x4050
movq %rdi, -0x8(%rbp)
leaq -0x2010(%rbp), %rdi
xorl %esi, %esi
movl $0x2000, %edx           # imm = 0x2000
callq 0x10a0
movl $0x0, -0xc(%rbp)
cmpl $0x20, -0xc(%rbp)
jge 0x26d4
leaq -0x4010(%rbp), %rdi
xorl %esi, %esi
movl $0x2000, %edx           # imm = 0x2000
callq 0x10a0
movslq -0xc(%rbp), %rax
shlq $0x1b, %rax
movq %rax, -0x4018(%rbp)
movq -0x4018(%rbp), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x1b, %rcx
cmpq %rcx, %rax
jae 0x2633
movq -0x8(%rbp), %rdi
movq -0x4018(%rbp), %rax
movl %eax, %esi
callq 0x2990
movl %eax, -0x401c(%rbp)
movl $0x0, -0x4020(%rbp)
cmpl $0x20, -0x4020(%rbp)
jge 0x261a
movl -0x4020(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x4024(%rbp)
movq -0x8(%rbp), %rdi
movq -0x4018(%rbp), %rax
movl -0x4024(%rbp), %ecx
xorq %rcx, %rax
movl %eax, %esi
callq 0x2990
movl %eax, -0x4028(%rbp)
movl -0x401c(%rbp), %eax
xorl -0x4028(%rbp), %eax
movl %eax, -0x402c(%rbp)
movl $0x0, -0x4030(%rbp)
cmpl $0x20, -0x4030(%rbp)
jge 0x2604
movl -0x402c(%rbp), %eax
movl -0x4030(%rbp), %ecx
shrl %cl, %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
movslq -0x4020(%rbp), %rcx
leaq -0x4010(%rbp), %rax
shlq $0x8, %rcx
addq %rcx, %rax
movslq -0x4030(%rbp), %rcx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movl -0x4030(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4030(%rbp)
jmp 0x25b1
jmp 0x2606
movl -0x4020(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4020(%rbp)
jmp 0x2554
jmp 0x261c
movq -0x4018(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x4018(%rbp)
jmp 0x2515
movl $0x0, -0x4034(%rbp)
cmpl $0x20, -0x4034(%rbp)
jge 0x26c4
movl $0x0, -0x4038(%rbp)
cmpl $0x20, -0x4038(%rbp)
jge 0x26ae
movslq -0x4034(%rbp), %rcx
leaq -0x4010(%rbp), %rax
shlq $0x8, %rcx
addq %rcx, %rax
movslq -0x4038(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movslq -0x4034(%rbp), %rcx
leaq -0x2010(%rbp), %rax
shlq $0x8, %rcx
addq %rcx, %rax
movslq -0x4038(%rbp), %rcx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movl -0x4038(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4038(%rbp)
jmp 0x2650
jmp 0x26b0
movl -0x4034(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4034(%rbp)
jmp 0x263d
jmp 0x26c6
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x24e9
xorps %xmm0, %xmm0
movsd %xmm0, -0x4040(%rbp)
movl $0x0, -0x4044(%rbp)
cmpl $0x20, -0x4044(%rbp)
jge 0x27a9
movl $0x0, -0x4048(%rbp)
cmpl $0x20, -0x4048(%rbp)
jge 0x2793
movslq -0x4044(%rbp), %rcx
leaq -0x2010(%rbp), %rax
shlq $0x8, %rcx
addq %rcx, %rax
movslq -0x4048(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movabsq $0x80000000, %rcx       # imm = 0x80000000
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x8d9(%rip), %xmm1      # 0x3020
divsd %xmm1, %xmm0
movsd %xmm0, -0x4050(%rbp)
movsd -0x4050(%rbp), %xmm0
mulsd -0x4050(%rbp), %xmm0
movsd 0x8ad(%rip), %xmm1      # 0x3018
divsd %xmm1, %xmm0
addsd -0x4040(%rbp), %xmm0
movsd %xmm0, -0x4040(%rbp)
movl -0x4048(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4048(%rbp)
jmp 0x2700
jmp 0x2795
movl -0x4044(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4044(%rbp)
jmp 0x26e9
movsd -0x4040(%rbp), %xmm0
callq 0x1140
movsd 0x852(%rip), %xmm1      # 0x3010
mulsd %xmm1, %xmm0
addq $0x4050, %rsp           # imm = 0x4050
popq %rbp
retq
nopl (%rax,%rax)