// File: tedsharpe[P]ORFCall/ORFCall.cc
// Function: (anonymous namespace)::ORFCaller::processPairedFastqs(char**, char**)
void ORFCaller::processPairedFastqs( char** beg, char** end )
{
    if ( (beg-end) & 1 )
        FatalErr("You requested paired mode, but there are an "
                 "odd number of fastq files.");

    std::vector<Sequence> seqs1, seqs2;
    std::vector<Quals> quals1, quals2;
    size_t fileId = 0;
    while ( beg != end )
    {
        char const* fileName1 = *beg++;
        char const* fileName2 = *beg++;
        std::cerr << "Reading " << fileName1 << " and " << fileName2 << "..."
                    << std::endl;
        FastqReader fqr1(fileName1);
        FastqReader fqr2(fileName2);

        size_t readId = 0;
        while ( fqr1.getChunk(seqs1,quals1) )
        {
            size_t nReads = seqs1.size();
            if ( !fqr2.getChunk(seqs2,quals2) || nReads != seqs2.size() )
                FatalErr("Unequal numbers of reads in the paired fastq files.");

            auto sItr1=seqs1.begin(), sEnd=seqs1.end(), sItr2=seqs2.begin();
            auto qItr1=quals1.begin(), qItr2=quals2.begin();
            for ( ; sItr1 != sEnd; ++sItr1,++sItr2,++qItr1,++qItr2 )
                processPairedRead(*sItr1,*qItr1,*sItr2,*qItr2,
                                            fileName1,fileName2,readId++);
        }
        if ( fqr2.getChunk(seqs2,quals2) )
            FatalErr("Unequal numbers of reads in the paired fastq files.");
        std::cerr << readId << " reads in file pair " << fileId << ".\n";
        fileId += 1;
    }
}

// Assembly:
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, 0x1a0(%rsp)
movq %rsi, 0x198(%rsp)
movq %rdx, 0x190(%rsp)
movq 0x1a0(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x198(%rsp), %rax
movq 0x190(%rsp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x62bc
movq 0x26d59(%rip), %rdi     # 0x2cff0
leaq 0x1b934(%rip), %rsi     # 0x21bd2
callq 0x4290
movq %rax, %rdi
movq 0x26cfb(%rip), %rsi     # 0x2cfa8
callq 0x42b0
movl $0x1, %edi
callq 0x42f0
leaq 0x178(%rsp), %rdi
callq 0x1c120
leaq 0x160(%rsp), %rdi
callq 0x1c120
leaq 0x148(%rsp), %rdi
callq 0x1c120
leaq 0x130(%rsp), %rdi
callq 0x1c120
movq $0x0, 0x128(%rsp)
movq 0x198(%rsp), %rax
cmpq 0x190(%rsp), %rax
je 0x67cc
movq 0x198(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x198(%rsp)
movq (%rax), %rax
movq %rax, 0x120(%rsp)
movq 0x198(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x198(%rsp)
movq (%rax), %rax
movq %rax, 0x118(%rsp)
movq 0x26c93(%rip), %rdi     # 0x2cff0
leaq 0x1b715(%rip), %rsi     # 0x21a79
callq 0x4290
movq %rax, 0x90(%rsp)
jmp 0x6373
movq 0x90(%rsp), %rdi
movq 0x120(%rsp), %rsi
callq 0x4290
movq %rax, 0x88(%rsp)
jmp 0x6392
movq 0x88(%rsp), %rdi
leaq 0x1b878(%rip), %rsi     # 0x21c19
callq 0x4290
movq %rax, 0x80(%rsp)
jmp 0x63b0
movq 0x80(%rsp), %rdi
movq 0x118(%rsp), %rsi
callq 0x4290
movq %rax, 0x78(%rsp)
jmp 0x63cc
movq 0x78(%rsp), %rdi
leaq 0x1b6aa(%rip), %rsi     # 0x21a82
callq 0x4290
movq %rax, 0x70(%rsp)
jmp 0x63e4
movq 0x70(%rsp), %rdi
movq 0x26bb8(%rip), %rsi     # 0x2cfa8
callq 0x42b0
jmp 0x63f7
movq 0x120(%rsp), %rsi
leaq 0xf0(%rsp), %rdi
callq 0xc9a0
jmp 0x640e
movq 0x118(%rsp), %rsi
leaq 0xd8(%rsp), %rdi
callq 0xc9a0
jmp 0x6425
movq $0x0, 0xd0(%rsp)
leaq 0xf0(%rsp), %rdi
leaq 0x178(%rsp), %rsi
leaq 0x148(%rsp), %rdx
movl $0x186a0, %ecx          # imm = 0x186A0
callq 0xca30
movb %al, 0x6f(%rsp)
jmp 0x6459
movb 0x6f(%rsp), %al
testb $0x1, %al
jne 0x6466
jmp 0x66c2
leaq 0x178(%rsp), %rdi
callq 0x1cf90
movq %rax, 0xc8(%rsp)
leaq 0xd8(%rsp), %rdi
leaq 0x160(%rsp), %rsi
leaq 0x130(%rsp), %rdx
movl $0x186a0, %ecx          # imm = 0x186A0
callq 0xca30
movb %al, 0x6e(%rsp)
jmp 0x64a3
movb 0x6e(%rsp), %al
testb $0x1, %al
jne 0x64ad
jmp 0x64d8
movq 0xc8(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x1cf90
movq %rax, %rcx
movq 0x60(%rsp), %rax
cmpq %rcx, %rax
je 0x6567
movq 0x26b11(%rip), %rdi     # 0x2cff0
leaq 0x1b739(%rip), %rsi     # 0x21c1f
callq 0x4290
movq %rax, 0x58(%rsp)
jmp 0x64f2
movq 0x58(%rsp), %rdi
movq 0x26aaa(%rip), %rsi     # 0x2cfa8
callq 0x42b0
jmp 0x6505
movl $0x1, %edi
callq 0x42f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
jmp 0x6808
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
jmp 0x67bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0xd520
jmp 0x67bd
leaq 0x178(%rsp), %rdi
callq 0x1c130
movq %rax, 0xc0(%rsp)
leaq 0x178(%rsp), %rdi
callq 0x1c160
movq %rax, 0xb8(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x1c130
movq %rax, 0xb0(%rsp)
leaq 0x148(%rsp), %rdi
callq 0x1c130
movq %rax, 0xa8(%rsp)
leaq 0x130(%rsp), %rdi
callq 0x1c130
movq %rax, 0xa0(%rsp)
leaq 0xc0(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x1c190
testb $0x1, %al
jne 0x65ee
jmp 0x66bd
leaq 0xc0(%rsp), %rdi
callq 0x1c1d0
movq %rax, 0x40(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x1c1d0
movq %rax, 0x48(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x1c1d0
movq %rax, 0x50(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x1c1d0
movq 0x98(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq 0x50(%rsp), %rcx
movq %rax, %r8
movq 0x120(%rsp), %r9
movq 0x118(%rsp), %r10
movq 0xd0(%rsp), %r11
movq %r11, %rax
incq %rax
movq %rax, 0xd0(%rsp)
movq %rsp, %rax
movq %r11, 0x8(%rax)
movq %r10, (%rax)
callq 0x14750
jmp 0x6682
jmp 0x6684
leaq 0xc0(%rsp), %rdi
callq 0x1c1e0
leaq 0xb0(%rsp), %rdi
callq 0x1c1e0
leaq 0xa8(%rsp), %rdi
callq 0x1c1e0
leaq 0xa0(%rsp), %rdi
callq 0x1c1e0
jmp 0x65d0
jmp 0x6431
leaq 0xd8(%rsp), %rdi
leaq 0x160(%rsp), %rsi
leaq 0x130(%rsp), %rdx
movl $0x186a0, %ecx          # imm = 0x186A0
callq 0xca30
movb %al, 0x3f(%rsp)
jmp 0x66ea
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0x66f4
jmp 0x672b
movq 0x268f5(%rip), %rdi     # 0x2cff0
leaq 0x1b51d(%rip), %rsi     # 0x21c1f
callq 0x4290
movq %rax, 0x30(%rsp)
jmp 0x670e
movq 0x30(%rsp), %rdi
movq 0x2688e(%rip), %rsi     # 0x2cfa8
callq 0x42b0
jmp 0x6721
movl $0x1, %edi
callq 0x42f0
movq 0xd0(%rsp), %rsi
movq 0x268b6(%rip), %rdi     # 0x2cff0
callq 0x4070
movq %rax, 0x28(%rsp)
jmp 0x6746
movq 0x28(%rsp), %rdi
leaq 0x1b501(%rip), %rsi     # 0x21c53
callq 0x4290
movq %rax, 0x20(%rsp)
jmp 0x675e
movq 0x20(%rsp), %rdi
movq 0x128(%rsp), %rsi
callq 0x4070
movq %rax, 0x18(%rsp)
jmp 0x6777
movq 0x18(%rsp), %rdi
leaq 0x1b271(%rip), %rsi     # 0x219f4
callq 0x4290
jmp 0x678a
movq 0x128(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x128(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0xd520
leaq 0xf0(%rsp), %rdi
callq 0xd520
jmp 0x62fc
leaq 0xf0(%rsp), %rdi
callq 0xd520
jmp 0x6808
leaq 0x130(%rsp), %rdi
callq 0x1c200
leaq 0x148(%rsp), %rdi
callq 0x1c200
leaq 0x160(%rsp), %rdi
callq 0x1c200
leaq 0x178(%rsp), %rdi
callq 0x1c200
addq $0x1a8, %rsp            # imm = 0x1A8
retq
leaq 0x130(%rsp), %rdi
callq 0x1c200
leaq 0x148(%rsp), %rdi
callq 0x1c200
leaq 0x160(%rsp), %rdi
callq 0x1c200
leaq 0x178(%rsp), %rdi
callq 0x1c200
movq 0x110(%rsp), %rdi
callq 0x4510
nopl (%rax)