// File: tedsharpe[P]ORFCall/ORFCall.cc
// Function: (anonymous namespace)::ORFCaller::processPairedRead(std::vector<unsigned char, std::allocator<unsigned char>> const&, std::vector<unsigned char, std::allocator<unsigned char>> const&, std::vector<unsigned char, std::allocator<unsigned char>> const&, std::vector<unsigned char, std::allocator<unsigned char>> const&, char const*, char const*, unsigned long)
void processPairedRead( Sequence const& seq1, Quals const& quals1,
                            Sequence const& seq2, Quals const& quals2,
                            char const* fileName1, char const* fileName2,
                            size_t readId )
    {
        mNReads += 2;
        Alignment aln1 = mRef.findAlignment(seq1);
        Alignment aln2 = mRef.findAlignment(seq2);
        if ( aln1.empty() )
        {
            dumpNonAligner(fileName1,readId,seq1,quals1);
            if ( aln2.empty() )
                dumpNonAligner(fileName2,readId,seq2,quals2);
            else
                processAlignment(seq2,quals2,aln2);
        }
        else if ( aln2.empty() )
        {
            dumpNonAligner(fileName2,readId,seq2,quals2);
            processAlignment(seq1,quals1,aln1);
        }
        else if ( Alignment::disjoint(aln1,aln2) )
        {
            processAlignment(seq1,quals1,aln1);
            processAlignment(seq2,quals2,aln2);
        }
        else
        {
            mNAlignedReads += 2;
            ReadReport report1 = findAlternateCodons(seq1,quals1,aln1);
            if ( report1.mNMismatches > mMaxSeqErrs ||
                    report1.mVariations.size() > 1 )
                report1 = findIndels(aln1,seq1,quals1);
            ReadReport report2 = findAlternateCodons(seq2,quals2,aln2);
            if ( report2.mNMismatches > mMaxSeqErrs ||
                    report2.mVariations.size() > 1 )
                report2 = findIndels(aln2,seq2,quals2);
            if ( report1.mNMismatches <= mMaxSeqErrs )
            {
                if ( report2.mNMismatches > mMaxSeqErrs )
                    processReport(report1);
                else
                {
                    ReadReport combo{
                        std::min(report1.mBeginCoverage,report2.mBeginCoverage),
                        std::max(report1.mEndCoverage,report2.mEndCoverage),
                        report1.mNMismatches+report2.mNMismatches,
                        report1.mVariations
                    };
                    combo.mVariations.insert(combo.mVariations.end(),
                                                report2.mVariations.begin(),
                                                report2.mVariations.end());
                    auto beg(combo.mVariations.begin());
                    auto end(combo.mVariations.end());
                    std::sort(beg,end);
                    combo.mVariations.erase(std::unique(beg,end),end);
                    processReport(combo);
                }
            }
            else if ( report2.mNMismatches <= mMaxSeqErrs )
                processReport(report2);
        }
    }

// Assembly:
subq $0x228, %rsp            # imm = 0x228
movq 0x238(%rsp), %rax
movq 0x230(%rsp), %rax
movq %rdi, 0x220(%rsp)
movq %rsi, 0x218(%rsp)
movq %rdx, 0x210(%rsp)
movq %rcx, 0x208(%rsp)
movq %r8, 0x200(%rsp)
movq %r9, 0x1f8(%rsp)
movq 0x220(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x30(%rax), %rcx
addq $0x2, %rcx
movq %rcx, 0x30(%rax)
movq (%rax), %rsi
movq 0x218(%rsp), %rdx
leaq 0x1d8(%rsp), %rdi
callq 0xd680
movq 0x38(%rsp), %rax
movq (%rax), %rsi
movq 0x208(%rsp), %rdx
leaq 0x1b8(%rsp), %rdi
callq 0xd680
leaq 0x1d8(%rsp), %rdi
callq 0xd900
testb $0x1, %al
jne 0x147fb
jmp 0x1488b
movq 0x38(%rsp), %rdi
movq 0x1f8(%rsp), %rsi
movq 0x238(%rsp), %rdx
movq 0x218(%rsp), %rcx
movq 0x210(%rsp), %r8
callq 0xd920
leaq 0x1b8(%rsp), %rdi
callq 0xd900
testb $0x1, %al
jne 0x14838
jmp 0x14864
movq 0x38(%rsp), %rdi
movq 0x230(%rsp), %rsi
movq 0x238(%rsp), %rdx
movq 0x208(%rsp), %rcx
movq 0x200(%rsp), %r8
callq 0xd920
jmp 0x14886
movq 0x38(%rsp), %rdi
movq 0x208(%rsp), %rsi
movq 0x200(%rsp), %rdx
leaq 0x1b8(%rsp), %rcx
callq 0xdac0
jmp 0x14db4
leaq 0x1b8(%rsp), %rdi
callq 0xd900
testb $0x1, %al
jne 0x1489e
jmp 0x148ef
movq 0x38(%rsp), %rdi
movq 0x230(%rsp), %rsi
movq 0x238(%rsp), %rdx
movq 0x208(%rsp), %rcx
movq 0x200(%rsp), %r8
callq 0xd920
movq 0x38(%rsp), %rdi
movq 0x218(%rsp), %rsi
movq 0x210(%rsp), %rdx
leaq 0x1d8(%rsp), %rcx
callq 0xdac0
jmp 0x14db2
leaq 0x1d8(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
callq 0x14dd0
testb $0x1, %al
jne 0x1490a
jmp 0x14953
movq 0x38(%rsp), %rdi
movq 0x218(%rsp), %rsi
movq 0x210(%rsp), %rdx
leaq 0x1d8(%rsp), %rcx
callq 0xdac0
movq 0x38(%rsp), %rdi
movq 0x208(%rsp), %rsi
movq 0x200(%rsp), %rdx
leaq 0x1b8(%rsp), %rcx
callq 0xdac0
jmp 0x14db0
movq 0x38(%rsp), %rsi
movq 0x38(%rsi), %rax
addq $0x2, %rax
movq %rax, 0x38(%rsi)
movq 0x218(%rsp), %rdx
movq 0x210(%rsp), %rcx
leaq 0x188(%rsp), %rdi
leaq 0x1d8(%rsp), %r8
callq 0xddf0
movq 0x38(%rsp), %rcx
movq 0x198(%rsp), %rax
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
ja 0x149b5
leaq 0x188(%rsp), %rdi
addq $0x18, %rdi
callq 0xe230
cmpq $0x1, %rax
jbe 0x14a1e
movq 0x38(%rsp), %rsi
movq 0x218(%rsp), %rcx
movq 0x210(%rsp), %r8
leaq 0x158(%rsp), %rdi
leaq 0x1d8(%rsp), %rdx
callq 0xe250
jmp 0x149e1
leaq 0x188(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0xed20
leaq 0x158(%rsp), %rdi
callq 0xed70
jmp 0x14a1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x150(%rsp)
movl %eax, 0x14c(%rsp)
jmp 0x14da1
movq 0x38(%rsp), %rsi
movq 0x208(%rsp), %rdx
movq 0x200(%rsp), %rcx
leaq 0x118(%rsp), %rdi
leaq 0x1b8(%rsp), %r8
callq 0xddf0
jmp 0x14a4a
movq 0x38(%rsp), %rcx
movq 0x128(%rsp), %rax
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
ja 0x14a76
leaq 0x118(%rsp), %rdi
addq $0x18, %rdi
callq 0xe230
cmpq $0x1, %rax
jbe 0x14adf
movq 0x38(%rsp), %rsi
movq 0x208(%rsp), %rcx
movq 0x200(%rsp), %r8
leaq 0xe8(%rsp), %rdi
leaq 0x1b8(%rsp), %rdx
callq 0xe250
jmp 0x14aa2
leaq 0x118(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0xed20
leaq 0xe8(%rsp), %rdi
callq 0xed70
jmp 0x14adf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x150(%rsp)
movl %eax, 0x14c(%rsp)
jmp 0x14d94
movq 0x38(%rsp), %rcx
movq 0x198(%rsp), %rax
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
ja 0x14d4f
movq 0x38(%rsp), %rcx
movq 0x128(%rsp), %rax
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jbe 0x14b24
movq 0x38(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0xed90
jmp 0x14d4d
leaq 0x188(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x17a30
movq (%rax), %rax
movq %rax, 0xb8(%rsp)
leaq 0x190(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0x18050
movq (%rax), %rax
movq %rax, 0xc0(%rsp)
movq 0x198(%rsp), %rax
movq 0x128(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0xc8(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x10070
jmp 0x14b96
leaq 0xd0(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0xfba0
movq %rax, 0xa8(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x10890
leaq 0x130(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xfd40
movq 0x20(%rsp), %rdi
movq %rax, 0xa0(%rsp)
callq 0xfba0
movq 0x28(%rsp), %rdi
movq %rax, 0x98(%rsp)
movq 0xb0(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movq 0x98(%rsp), %rcx
callq 0x107d0
movq %rax, 0x30(%rsp)
jmp 0x14c1a
movq 0x30(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0xd0(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xfd40
movq 0x18(%rsp), %rdi
movq %rax, 0x88(%rsp)
callq 0xfba0
movq %rax, 0x80(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x14e20
jmp 0x14c7e
leaq 0xd0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x14f00
movq %rax, 0x10(%rsp)
jmp 0x14cbb
movq 0x10(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x10890
leaq 0x48(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x10890
movq 0x8(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x14e60
movq %rax, (%rsp)
jmp 0x14d00
movq 0x38(%rsp), %rdi
movq (%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0xb8(%rsp), %rsi
callq 0xed90
leaq 0xb8(%rsp), %rdi
callq 0xed70
jmp 0x14d4d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x150(%rsp)
movl %eax, 0x14c(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0xed70
jmp 0x14d94
jmp 0x14d78
movq 0x38(%rsp), %rcx
movq 0x128(%rsp), %rax
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
ja 0x14d76
movq 0x38(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0xed90
jmp 0x14d78
leaq 0x118(%rsp), %rdi
callq 0xed70
leaq 0x188(%rsp), %rdi
callq 0xed70
jmp 0x14db0
leaq 0x118(%rsp), %rdi
callq 0xed70
leaq 0x188(%rsp), %rdi
callq 0xed70
jmp 0x14dbc
jmp 0x14db2
jmp 0x14db4
addq $0x228, %rsp            # imm = 0x228
retq
movq 0x150(%rsp), %rdi
callq 0x4510
nopl (%rax)