// File: /workspace/github_cpp_makefile_star2_O1/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 0x6dce
movl 0x64(%rbx), %r14d
movq 0x10(%rbx), %rdi
callq 0x6d52
movl $0x0, %r15d
testl %eax, %eax
jle 0x4f39
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r15d, %r15d
xorl %esi, %esi
movl $0x1, %edi
shll %cl, %edi
btl %ecx, %r14d
jae 0x4f33
btl %esi, %ebp
leal 0x1(%rsi), %esi
cmovael %edx, %edi
addl %edi, %r15d
incl %ecx
cmpl %ecx, %eax
jne 0x4f1a
movq 0x10(%rbx), %rdi
callq 0x6d52
movsd 0xa19e(%rip), %xmm0     # 0xf0e8
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 0x6d52
movl %eax, %ebp
movq 0x10(%rbx), %rdi
movl 0x60(%rbx), %esi
callq 0x6dce
subl %eax, %ebp
movsd 0xa162(%rip), %xmm0     # 0xf0e8
movl %ebp, %edi
callq 0x33c0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x5070
movsd 0x8(%rsp), %xmm0
addsd 0xa147(%rip), %xmm0     # 0xf0f0
subsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %r12d
movsd 0xa13c(%rip), %xmm0     # 0xf0f8
xorl %r13d, %r13d
xorl %r14d, %r14d
movl $0x0, 0x4(%rsp)
movsd %xmm0, 0x8(%rsp)
movq 0x10(%rbx), %rdi
callq 0x6d52
movl $0x0, %edx
testl %eax, %eax
jle 0x5008
xorl %ecx, %ecx
xorl %edx, %edx
xorl %esi, %esi
movl $0x1, %edi
shll %cl, %edi
btl %ecx, %r12d
jae 0x5002
btl %esi, %r14d
leal 0x1(%rsi), %esi
cmovael %r13d, %edi
addl %edi, %edx
incl %ecx
cmpl %ecx, %eax
jne 0x4fe8
xorl %r15d, %edx
movl %edx, 0x38(%rbx)
movq %rbx, %rdi
callq 0x51be
movsd 0x70(%rbx), %xmm1
movsd 0x8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x502e
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 0xa097(%rip), %xmm0     # 0xf0e8
movl %ebp, %edi
callq 0x33c0
movsd 0x8(%rsp), %xmm1
ucomisd 0x10(%rsp), %xmm0
movapd %xmm1, %xmm0
ja 0x4fca
jmp 0x5080
movl $0x0, 0x4(%rsp)
movsd 0xa078(%rip), %xmm1     # 0xf0f8
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 0x51be