// File: /workspace/github_cpp_makefile_star2_O3/UCBASiCS[P]SPRIGHT/src/binprocessor.cpp
// Function: BinProcessor::MLprocess()
void BinProcessor::MLprocess()
{
    ffast_real MLnoise = std::numeric_limits<ffast_real>::infinity();
    int MLlocation = 0;

    /*
        Iterate over all balls that could map to this bin, and find the best one.
    */

    int homSolution = mapToInt(binRelativeIndex, config->getBinNumIndices(stage), samplingPattern, config->getSignalBitLength());
    int locGenerator = pow(2,(config->getSignalBitLength())) -1 - samplingPattern;

    int nnz = config->getSignalBitLength() - config->getBinNumIndices(stage);
    for (int i =0; i <pow(2,nnz); i++)
    {
        location = homSolution ^ mapToInt(i,nnz,locGenerator,config->getSignalBitLength());

        estimateBinSignal();
        if (noise < MLnoise)
        {
            MLnoise = noise;
            MLlocation = location;
        }
    }
    location = MLlocation;
    noise = MLnoise;
    estimateBinSignal();
    return ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x5c(%rdi), %ebp
movq 0x10(%rdi), %rdi
movl 0x60(%rbx), %esi
callq 0x6c94
movl 0x64(%rbx), %r14d
movq 0x10(%rbx), %rdi
callq 0x6c18
movl $0x0, %r15d
testl %eax, %eax
jle 0x4e9d
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r15d, %r15d
xorl %esi, %esi
movl $0x1, %edi
shll %cl, %edi
btl %ecx, %r14d
jae 0x4e97
btl %esi, %ebp
leal 0x1(%rsi), %esi
cmovael %edx, %edi
addl %edi, %r15d
incl %ecx
cmpl %ecx, %eax
jne 0x4e7e
movq 0x10(%rbx), %rdi
callq 0x6c18
movsd 0x923a(%rip), %xmm0     # 0xe0e8
movl %eax, %edi
callq 0x33c0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x64(%rbx), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x10(%rbx), %rdi
callq 0x6c18
movl %eax, %ebp
movq 0x10(%rbx), %rdi
movl 0x60(%rbx), %esi
callq 0x6c94
subl %eax, %ebp
movsd 0x91fe(%rip), %xmm0     # 0xe0e8
movl %ebp, %edi
callq 0x33c0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x4fd4
movsd 0x8(%rsp), %xmm0
addsd 0x91e3(%rip), %xmm0     # 0xe0f0
subsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %r12d
movsd 0x91d8(%rip), %xmm0     # 0xe0f8
xorl %r13d, %r13d
xorl %r14d, %r14d
movl $0x0, 0x4(%rsp)
movsd %xmm0, 0x8(%rsp)
movq 0x10(%rbx), %rdi
callq 0x6c18
movl $0x0, %edx
testl %eax, %eax
jle 0x4f6c
xorl %ecx, %ecx
xorl %edx, %edx
xorl %esi, %esi
movl $0x1, %edi
shll %cl, %edi
btl %ecx, %r12d
jae 0x4f66
btl %esi, %r14d
leal 0x1(%rsi), %esi
cmovael %r13d, %edi
addl %edi, %edx
incl %ecx
cmpl %ecx, %eax
jne 0x4f4c
xorl %r15d, %edx
movl %edx, 0x38(%rbx)
movq %rbx, %rdi
callq 0x5122
movsd 0x70(%rbx), %xmm1
movsd 0x8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x4f92
movl 0x38(%rbx), %eax
movl %eax, 0x4(%rsp)
minsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
incl %r14d
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x9133(%rip), %xmm0     # 0xe0e8
movl %ebp, %edi
callq 0x33c0
movsd 0x8(%rsp), %xmm1
ucomisd 0x10(%rsp), %xmm0
movapd %xmm1, %xmm0
ja 0x4f2e
jmp 0x4fe4
movl $0x0, 0x4(%rsp)
movsd 0x9114(%rip), %xmm1     # 0xe0f8
movl 0x4(%rsp), %eax
movl %eax, 0x38(%rbx)
movsd %xmm1, 0x70(%rbx)
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5122