// File: /workspace/github_cpp_makefile_star2_O1/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 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5845(%rip), %rsi      # 0xfcc3
leaq 0x5844(%rip), %rdx      # 0xfcc9
leaq 0x28(%rsp), %rdi
callq 0x44c2
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x5a48
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xa4b3
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3270
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 0x8248
movl %eax, %ebp
movq 0x10(%rbx), %rdi
callq 0x6d62
cmpl %eax, %ebp
je 0xa6cb
movq 0x18(%rbx), %rdi
callq 0x42a8
movq %rax, %r14
leaq 0x48(%rsp), %rbp
addq $0x10, %r14
leaq 0x8(%rsp), %r15
leaq 0x28(%rsp), %r12
movq (%r14), %r14
movq 0x18(%rbx), %rdi
callq 0x42a8
testq %r14, %r14
je 0xa634
movq 0x20(%rbx), %rdi
callq 0xa186
movl 0x8(%r14), %ecx
incl %ecx
movl %ecx, 0x8(%rsp)
movq %rax, %rdi
movq %r15, %rsi
callq 0x4552
leaq 0x8(%r14), %r13
testq %rax, %rax
je 0xa567
movl (%r13), %eax
incl %eax
movl %eax, 0x8(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x45cc
jmp 0xa627
movq 0x20(%rbx), %rdi
callq 0xa186
movl (%r13), %ecx
decl %ecx
movl %ecx, 0x8(%rsp)
movq %rax, %rdi
movq %r15, %rsi
callq 0x4552
testq %rax, %rax
je 0xa5a4
movl (%r13), %eax
decl %eax
movl %eax, 0x8(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x45cc
jmp 0xa627
movq 0x20(%rbx), %rdi
callq 0xa186
movl (%r13), %ecx
addl $0x2, %ecx
movl %ecx, 0x8(%rsp)
movq %rax, %rdi
movq %r15, %rsi
callq 0x4552
testq %rax, %rax
je 0xa5e0
movl (%r13), %eax
addl $0x2, %eax
movl %eax, 0x8(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x45cc
jmp 0xa627
movq 0x20(%rbx), %rdi
callq 0xa186
movl (%r13), %ecx
addl $-0x2, %ecx
movl %ecx, 0x8(%rsp)
movq %rax, %rdi
movq %r15, %rsi
callq 0x4552
testq %rax, %rax
je 0xa61c
movl (%r13), %eax
addl $-0x2, %eax
movl %eax, 0x8(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x45cc
jmp 0xa627
movq %r12, %rdi
movq %r13, %rsi
callq 0x8f9a
movups 0x10(%r14), %xmm0
movups %xmm0, (%rax)
jmp 0xa511
movq 0x18(%rbx), %r14
xorl %eax, %eax
leaq 0x60(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x28(%rsp), %rsi
movq 0x8(%rsi), %rcx
movq 0x18(%rsi), %rdx
movq %rcx, 0x8(%rdi)
movq %rax, 0x10(%rdi)
movq %rdx, 0x18(%rdi)
movups (%rbp), %xmm0
movups %xmm0, 0x20(%rdi)
movq %rax, 0x30(%rdi)
leaq 0x8(%rsp), %rdx
movq %rdi, (%rdx)
callq 0xb758
leaq 0x38(%rsp), %r15
leaq 0x60(%rsp), %rsi
movq %r14, %rdi
callq 0x42ae
leaq 0x60(%rsp), %rdi
callq 0x4452
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0xa6af
movq (%rdi), %r14
movl $0x20, %esi
callq 0x3270
movq %r14, %rdi
testq %r14, %r14
jne 0xa69a
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x3130
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq %rbx, %rdi
callq 0xa80e
movq %rbx, %rdi
callq 0xa890
cmpl $0x0, 0x38(%rbx)
jne 0xa6f9
cmpl $0x0, 0x3c(%rbx)
jne 0xa6f9
cmpb $0x0, 0x40(%rbx)
jne 0xa6f9
movb $0x1, 0x50(%rbx)
incl 0xf8(%rbx)
jmp 0xa6fd
movb $0x0, 0x50(%rbx)
movq %rbx, %rdi
callq 0xaa92
movq %rbx, %rdi
callq 0xabc4
movq 0x8(%rbx), %r14
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x55a2(%rip), %rsi      # 0xfcc3
leaq 0x55a1(%rip), %rdx      # 0xfcc9
leaq 0x8(%rsp), %rdi
callq 0x44c2
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x5ae4
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xa756
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x10(%rbx), %rdi
callq 0x6e4e
testb %al, %al
je 0xa779
movq 0x10(%rbx), %rdi
callq 0x6d5e
cmpl $0x2, %eax
jl 0xa779
movq %rbx, %rdi
callq 0xad02
leaq 0x28(%rsp), %rdi
callq 0x4452
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x4452
jmp 0xa7fc
jmp 0xa7f9
jmp 0xa7f9
jmp 0xa7f9
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xa7fc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3270
jmp 0xa7fc
jmp 0xa7f9
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xa806
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3270
jmp 0xa806
movq %rax, %rbx
jmp 0xa806
jmp 0xa7f9
jmp 0xa7f9
jmp 0xa7f9
jmp 0xa7f9
jmp 0xa7f9
jmp 0xa7f9
jmp 0xa7f9
jmp 0xa7f9
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4452
movq %rbx, %rdi
callq 0x3490