// File: /workspace/github_cpp_makefile_star2_O2/UCBASiCS[P]SPRIGHT/src/experimentoutput.cpp
// Function: ExperimentOutput::process()
void ExperimentOutput::process()
{
    chrono->start("Output");

    std::unordered_map<int,ffast_complex> decodedFrequencies;

    // If the signal was off-grid adjust the output to the original signal
    if ( config->getSignalLengthOriginal() != config->getSignalLength() )
    {
        for (auto it = backEnd->getDecodedFrequencies().cbegin(); it != backEnd->getDecodedFrequencies().cend(); ++it)
        {
            if (input->getNonZeroFrequencies().count(it->first+1) > 0)
            {
                decodedFrequencies[it->first+1] = it->second;
            }
            else if (input->getNonZeroFrequencies().count(it->first-1) > 0)
            {
                decodedFrequencies[it->first-1] = it->second;
        }
        else if (input->getNonZeroFrequencies().count(it->first+2) > 0)
        {
            decodedFrequencies[it->first+2] = it->second;
        }
        else if (input->getNonZeroFrequencies().count(it->first-2) > 0)
        {
            decodedFrequencies[it->first-2] = it->second;
        }
        else
        {
            decodedFrequencies[it->first] = it->second;
        }
    }
    backEnd->swapDecodedFrequencies(decodedFrequencies);
    decodedFrequencies.clear();
}

    /*
        we first check if there are false detections. If there are 
        not any false detections we check if the peeling got stuck 
        due to the graph. If so we declare a binning failure and 
        do not count missed locations. If it was not a binning failure,
        then we count the missed locations.
    */
        checkFalseDetections();
        checkMissedLocationsOrBinningFailure();
        checkFullRecovery();
        computeMSEErrorAmplitude();
        computeMSEerror();

        chrono->stop("Output");

        if ( config->isVerbose() && config->getIterations() >= 2 )
        {
            displayIterationResults();
        }

    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %r14
leaq 0x3dac(%rip), %rsi      # 0xccc3
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x3fb6
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x56f4
leaq 0x28(%rsp), %rdi
callq 0x30f0
leaq 0x58(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
movq 0x10(%rbx), %rdi
callq 0x7094
movl %eax, %ebp
movq 0x10(%rbx), %rdi
callq 0x6710
cmpl %eax, %ebp
je 0x90ed
movq 0x18(%rbx), %rdi
callq 0x3edc
movq %rax, %r14
addq $0x10, %r14
leaq 0x8(%rsp), %r15
leaq 0x28(%rsp), %r12
movq (%r14), %r14
movq 0x18(%rbx), %rdi
callq 0x3edc
testq %r14, %r14
je 0x90b9
movq 0x20(%rbx), %rdi
callq 0x8c3c
movl 0x8(%r14), %ecx
incl %ecx
movl %ecx, 0x8(%rsp)
movq %rax, %rdi
movq %r15, %rsi
callq 0x41fa
leaq 0x8(%r14), %r13
testq %rax, %rax
je 0x8fec
movl (%r13), %eax
incl %eax
movl %eax, 0x8(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x428a
jmp 0x90ac
movq 0x20(%rbx), %rdi
callq 0x8c3c
movl (%r13), %ecx
decl %ecx
movl %ecx, 0x8(%rsp)
movq %rax, %rdi
movq %r15, %rsi
callq 0x41fa
testq %rax, %rax
je 0x9029
movl (%r13), %eax
decl %eax
movl %eax, 0x8(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x428a
jmp 0x90ac
movq 0x20(%rbx), %rdi
callq 0x8c3c
movl (%r13), %ecx
addl $0x2, %ecx
movl %ecx, 0x8(%rsp)
movq %rax, %rdi
movq %r15, %rsi
callq 0x41fa
testq %rax, %rax
je 0x9065
movl (%r13), %eax
addl $0x2, %eax
movl %eax, 0x8(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x428a
jmp 0x90ac
movq 0x20(%rbx), %rdi
callq 0x8c3c
movl (%r13), %ecx
addl $-0x2, %ecx
movl %ecx, 0x8(%rsp)
movq %rax, %rdi
movq %r15, %rsi
callq 0x41fa
testq %rax, %rax
je 0x90a1
movl (%r13), %eax
addl $-0x2, %eax
movl %eax, 0x8(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x428a
jmp 0x90ac
movq %r12, %rdi
movq %r13, %rsi
callq 0x7cbe
movups 0x10(%r14), %xmm0
movups %xmm0, (%rax)
jmp 0x8f96
movq 0x18(%rbx), %r14
leaq 0x60(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x9cd2
leaq 0x60(%rsp), %rsi
movq %r14, %rdi
callq 0x3ee2
leaq 0x60(%rsp), %rdi
callq 0x4054
leaq 0x28(%rsp), %rdi
callq 0x4070
movq %rbx, %rdi
callq 0x91e4
movq %rbx, %rdi
callq 0x924e
movq %rbx, %rdi
callq 0x93b8
movq %rbx, %rdi
callq 0x93d8
movq %rbx, %rdi
callq 0x94b8
movq 0x8(%rbx), %r14
leaq 0x3ba3(%rip), %rsi      # 0xccc3
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x3fb6
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x5758
leaq 0x8(%rsp), %rdi
callq 0x30f0
movq 0x10(%rbx), %rdi
callq 0x67fc
testb %al, %al
je 0x9169
movq 0x10(%rbx), %rdi
callq 0x670c
cmpl $0x2, %eax
jl 0x9169
movq %rbx, %rdi
callq 0x95a0
leaq 0x28(%rsp), %rdi
callq 0x4054
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x4054
jmp 0x91d2
jmp 0x91cf
jmp 0x91cf
jmp 0x91cf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x30f0
jmp 0x91d2
jmp 0x91cf
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x30f0
jmp 0x91dc
movq %rax, %rbx
jmp 0x91dc
jmp 0x91cf
jmp 0x91cf
jmp 0x91cf
jmp 0x91cf
jmp 0x91cf
jmp 0x91cf
jmp 0x91cf
jmp 0x91cf
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4054
movq %rbx, %rdi
callq 0x3490