// File: /workspace/github_cpp_makefile_star2_O3/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 0x49d5(%rip), %rsi      # 0xecc3
leaq 0x49d4(%rip), %rdx      # 0xecc9
leaq 0x28(%rsp), %rdi
callq 0x4430
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x5940
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xa323
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 0x811c
movl %eax, %ebp
movq 0x10(%rbx), %rdi
callq 0x6c28
cmpl %eax, %ebp
je 0xa53b
movq 0x18(%rbx), %rdi
callq 0x4222
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 0x4222
testq %r14, %r14
je 0xa4a4
movq 0x20(%rbx), %rdi
callq 0x9ff8
movl 0x8(%r14), %ecx
incl %ecx
movl %ecx, 0x8(%rsp)
movq %rax, %rdi
movq %r15, %rsi
callq 0x44c6
leaq 0x8(%r14), %r13
testq %rax, %rax
je 0xa3d7
movl (%r13), %eax
incl %eax
movl %eax, 0x8(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x4522
jmp 0xa497
movq 0x20(%rbx), %rdi
callq 0x9ff8
movl (%r13), %ecx
decl %ecx
movl %ecx, 0x8(%rsp)
movq %rax, %rdi
movq %r15, %rsi
callq 0x44c6
testq %rax, %rax
je 0xa414
movl (%r13), %eax
decl %eax
movl %eax, 0x8(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x4522
jmp 0xa497
movq 0x20(%rbx), %rdi
callq 0x9ff8
movl (%r13), %ecx
addl $0x2, %ecx
movl %ecx, 0x8(%rsp)
movq %rax, %rdi
movq %r15, %rsi
callq 0x44c6
testq %rax, %rax
je 0xa450
movl (%r13), %eax
addl $0x2, %eax
movl %eax, 0x8(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x4522
jmp 0xa497
movq 0x20(%rbx), %rdi
callq 0x9ff8
movl (%r13), %ecx
addl $-0x2, %ecx
movl %ecx, 0x8(%rsp)
movq %rax, %rdi
movq %r15, %rsi
callq 0x44c6
testq %rax, %rax
je 0xa48c
movl (%r13), %eax
addl $-0x2, %eax
movl %eax, 0x8(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x4522
jmp 0xa497
movq %r12, %rdi
movq %r13, %rsi
callq 0x8e1a
movups 0x10(%r14), %xmm0
movups %xmm0, (%rax)
jmp 0xa381
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 0xb608
leaq 0x38(%rsp), %r15
leaq 0x60(%rsp), %rsi
movq %r14, %rdi
callq 0x4228
leaq 0x60(%rsp), %rdi
callq 0x43c0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0xa51f
movq (%rdi), %r14
movl $0x20, %esi
callq 0x3270
movq %r14, %rdi
testq %r14, %r14
jne 0xa50a
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 0xa67c
movq %rbx, %rdi
callq 0xa6fe
xorl %eax, %eax
cmpl $0x0, 0x38(%rbx)
jne 0xa567
cmpl $0x0, 0x3c(%rbx)
jne 0xa567
cmpb $0x0, 0x40(%rbx)
jne 0xa567
incl 0xf8(%rbx)
movb $0x1, %al
movb %al, 0x50(%rbx)
movq %rbx, %rdi
callq 0xa8a8
movq %rbx, %rdi
callq 0xa9d8
movq 0x8(%rbx), %r14
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x4735(%rip), %rsi      # 0xecc3
leaq 0x4734(%rip), %rdx      # 0xecc9
leaq 0x8(%rsp), %rdi
callq 0x4430
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x59dc
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xa5c3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x10(%rbx), %rdi
callq 0x6d14
testb %al, %al
je 0xa5e6
movq 0x10(%rbx), %rdi
callq 0x6c24
cmpl $0x2, %eax
jl 0xa5e6
movq %rbx, %rdi
callq 0xaaf6
leaq 0x28(%rsp), %rdi
callq 0x43c0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x43c0
jmp 0xa669
jmp 0xa666
jmp 0xa666
jmp 0xa666
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xa669
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3270
jmp 0xa669
jmp 0xa666
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xa673
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3270
jmp 0xa673
movq %rax, %rbx
jmp 0xa673
jmp 0xa666
jmp 0xa666
jmp 0xa666
jmp 0xa666
jmp 0xa666
jmp 0xa666
jmp 0xa666
jmp 0xa666
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x43c0
movq %rbx, %rdi
callq 0x3490
nop