// File: /workspace/github_cpp_makefile_star2_O1/UCBASiCS[P]SPRIGHT/src/experimentoutput.cpp
// Function: ExperimentOutput::checkMissedLocationsOrBinningFailure()
void ExperimentOutput::checkMissedLocationsOrBinningFailure()
{
    // indices of missed locations
    std::set<int> missedLocations;
    binningFailure = false;


    // if there are no false detections in the current iteration
    if (falseDetectionsIterationNb == 0)
    {
        // go over the true frequencies
        for (auto it = input->getNonZeroFrequencies().cbegin(); it != input->getNonZeroFrequencies().cend(); ++it)
        {
            // if the frequency is missing in the decoded frequencies
            if (backEnd->getDecodedFrequencies().count(it->first) == 0)
            {
                // add the missing location to the missed locations
                missedLocations.insert(it->first);
            }
        }

        // if there is a missing location check if it is due to binning failure
        if (!missedLocations.empty())
        {
            binningFailure = isBinningFailure(missedLocations);
        }
    }

    if (binningFailure)
    {
        binningFailuresNb++;
        missedLocationsIterationNb = 0;
        
        // if it is a binning failure, increment the counter for trapping set size
        // that is held with the unordered_map trappingSetSizeCounter
        auto it = trappingSetSizeCounter.find( missedLocations.size() );
        if( it != trappingSetSizeCounter.end() )  
        {
            it->second =  it->second + 1;
        }
        else
        {
            trappingSetSizeCounter[ missedLocations.size() ] = 1;
        }
    }
    else
    {
        missedLocationsIterationNb = missedLocations.size();
    }

    missedLocationsNbs.push_back(missedLocationsIterationNb);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movb $0x0, 0x40(%rdi)
cmpl $0x0, 0x38(%rdi)
jne 0xa94a
movq 0x20(%rbx), %rdi
callq 0xa186
movq %rax, %r14
addq $0x10, %r14
leaq 0x8(%rsp), %r15
movq (%r14), %r14
movq 0x20(%rbx), %rdi
callq 0xa186
testq %r14, %r14
je 0xa919
movq 0x18(%rbx), %rdi
callq 0x42a8
leaq 0x8(%r14), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x4552
testq %rax, %rax
jne 0xa8de
movq %r15, %rdi
movq %r12, %rsi
callq 0x8e48
jmp 0xa8de
cmpq $0x0, 0x30(%rsp)
je 0xa94a
leaq 0x38(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xb8b6
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0xb3ee
movb %al, 0x40(%rbx)
leaq 0x38(%rsp), %rdi
callq 0x4402
cmpb $0x1, 0x40(%rbx)
jne 0xa9bf
incl 0xd8(%rbx)
movl $0x0, 0x3c(%rbx)
movq 0x30(%rsp), %r8
movslq %r8d, %rax
movq 0xa0(%rbx), %rsi
movq 0xa8(%rbx), %rdi
xorl %r10d, %r10d
xorl %edx, %edx
divq %rdi
movq (%rsi,%rdx,8), %rax
testq %rax, %rax
je 0xa9cb
movq (%rax), %r9
movq %rax, %r10
cmpl %r8d, 0x8(%r9)
je 0xa9cb
movq %rdx, %rcx
movq %r9, %r11
movq (%r9), %r9
testq %r9, %r9
je 0xa9c8
movslq 0x8(%r9), %rsi
movq %rsi, %rax
xorl %edx, %edx
divq %rdi
movl $0x0, %r10d
cmpq %rcx, %rdx
jne 0xa9cb
movq %r11, %r10
cmpl %r8d, %esi
jne 0xa993
jmp 0xa9cb
movl 0x30(%rsp), %eax
movl %eax, 0x3c(%rbx)
jmp 0xa9fb
xorl %r10d, %r10d
testq %r10, %r10
je 0xa9d5
movq (%r10), %rax
jmp 0xa9d7
xorl %eax, %eax
testq %rax, %rax
je 0xa9e1
incl 0xc(%rax)
jmp 0xa9fb
leaq 0xa0(%rbx), %rdi
leaq 0x4(%rsp), %rsi
movl %r8d, (%rsi)
callq 0xbc40
movl $0x1, (%rax)
movl 0x3c(%rbx), %eax
movl %eax, 0x4(%rsp)
movq 0x78(%rbx), %rsi
cmpq 0x80(%rbx), %rsi
je 0xaa1b
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x78(%rbx)
jmp 0xaa2c
addq $0x70, %rbx
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xbabe
leaq 0x8(%rsp), %rdi
callq 0x4402
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xaa5b
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x4402
jmp 0xaa5e
jmp 0xaa5b
jmp 0xaa5b
jmp 0xaa5b
jmp 0xaa5b
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4402
movq %rbx, %rdi
callq 0x3490