// File: tedsharpe[P]ORFCall/ORFCall.cc
// Function: (anonymous namespace)::FastqReader::getChunk(std::vector<std::vector<unsigned char, std::allocator<unsigned char>>, std::allocator<std::vector<unsigned char, std::allocator<unsigned char>>>>&, std::vector<std::vector<unsigned char, std::allocator<unsigned char>>, std::allocator<std::vector<unsigned char, std::allocator<unsigned char>>>>&, unsigned int)
bool FastqReader::getChunk( std::vector<Sequence>& seqs,
                            std::vector<Quals>& quals,
                            unsigned chunkSize )
{
    if ( mIS.eof() )
        return false;

    seqs.clear(); seqs.reserve(chunkSize);
    quals.clear(); quals.reserve(chunkSize);

    std::string seqheader;
    std::string sSeq;
    std::string qualheader;
    std::string sQual;
    Sequence sq;
    Quals qs;
    while ( ++mLineNo && std::getline(mIS,seqheader) )
    {
        if ( seqheader.empty() )
            FatalErr("Read empty header at line " << mLineNo);
        if ( ++mLineNo && !std::getline(mIS,sSeq) )
            FatalErr("Early EOF at line " << mLineNo);
        if ( !sSeq.empty() && sSeq.back() == '\r' )
            sSeq.resize(sSeq.size()-1);
        if ( sSeq.empty() )
            FatalErr("Empty sequence at line " << mLineNo);
        if ( ++mLineNo && !std::getline(mIS,qualheader) )
            FatalErr("Early EOF at line " << mLineNo);
        if ( qualheader.empty() || qualheader[0] != '+' )
            FatalErr("Quals header doesn't begin with '+' at line " << mLineNo);
        if ( ++mLineNo && !std::getline(mIS,sQual) )
            FatalErr("Early EOF at line " << mLineNo);
        if ( !sQual.empty() && sQual.back() == '\r' )
            sQual.resize(sQual.size()-1);
        if ( sSeq.size() != sQual.size() )
            FatalErr("Calls and quals of unequal length at line " << mLineNo);

        sq.clear(); sq.reserve(sSeq.size());
        qs.clear(); qs.reserve(sSeq.size());
        auto qItr(sQual.begin());
        for ( char chr : sSeq )
        {
            switch (chr)
            {
            case 'a': case 'A': sq.push_back(0); break;
            case 'c': case 'C': sq.push_back(1); break;
            case 'g': case 'G': sq.push_back(2); break;
            case 't': case 'T':
            case 'u': case 'U': sq.push_back(3); break;
            default: sq.push_back(4); break;
            }
            qs.push_back(*qItr-FASTQ_QUAL_OFFSET);
            ++qItr;
        }
        seqs.push_back(sq);
        quals.push_back(qs);
        if ( seqs.size() == chunkSize )
            return true;
    }
    if ( !mIS.eof() )
        FatalErr("Failed to read to EOF (read to line " << mLineNo << ").");
    return !seqs.empty();
}

// Assembly:
subq $0x238, %rsp            # imm = 0x238
movq %rdi, 0x228(%rsp)
movq %rsi, 0x220(%rsp)
movq %rdx, 0x218(%rsp)
movl %ecx, 0x214(%rsp)
movq 0x228(%rsp), %rax
movq %rax, 0x118(%rsp)
movq 0x8(%rax), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x4550
testb $0x1, %al
jne 0xca7c
jmp 0xca89
movb $0x0, 0x237(%rsp)
jmp 0xd458
movq 0x220(%rsp), %rdi
callq 0x1cdd0
movq 0x220(%rsp), %rdi
movl 0x214(%rsp), %eax
movl %eax, %esi
callq 0x1cdf0
movq 0x218(%rsp), %rdi
callq 0x1cdd0
movq 0x218(%rsp), %rdi
movl 0x214(%rsp), %eax
movl %eax, %esi
callq 0x1cdf0
leaq 0x1f0(%rsp), %rdi
callq 0x43a0
leaq 0x1d0(%rsp), %rdi
callq 0x43a0
leaq 0x1b0(%rsp), %rdi
callq 0x43a0
leaq 0x190(%rsp), %rdi
callq 0x43a0
leaq 0x178(%rsp), %rdi
callq 0x16e80
leaq 0x160(%rsp), %rdi
callq 0x16e80
movq 0x118(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x117(%rsp)
je 0xcb8f
movq 0x118(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0x4050
movq %rax, 0x108(%rsp)
jmp 0xcb5f
movq 0x108(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x4300
movb %al, 0x107(%rsp)
jmp 0xcb7f
movb 0x107(%rsp), %al
movb %al, 0x117(%rsp)
jmp 0xcb8f
movb 0x117(%rsp), %al
testb $0x1, %al
jne 0xcb9f
jmp 0xd351
leaq 0x1f0(%rsp), %rdi
callq 0x44a0
testb $0x1, %al
jne 0xcbb5
jmp 0xcc7b
movq 0x20434(%rip), %rdi     # 0x2cff0
leaq 0x14eec(%rip), %rsi     # 0x21aaf
callq 0x4290
movq %rax, 0xf8(%rsp)
jmp 0xcbd2
movq 0xf8(%rsp), %rdi
movq 0x118(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x4350
movq %rax, 0xf0(%rsp)
jmp 0xcbf4
movq 0xf0(%rsp), %rdi
movq 0x203a5(%rip), %rsi     # 0x2cfa8
callq 0x42b0
jmp 0xcc0a
movl $0x1, %edi
callq 0x42f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x16f70
leaq 0x178(%rsp), %rdi
callq 0x16f70
leaq 0x190(%rsp), %rdi
callq 0x41b0
leaq 0x1b0(%rsp), %rdi
callq 0x41b0
leaq 0x1d0(%rsp), %rdi
callq 0x41b0
leaq 0x1f0(%rsp), %rdi
callq 0x41b0
jmp 0xd469
movq 0x118(%rsp), %rcx
movl 0x10(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
je 0xcd44
movq 0x118(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x4050
movq %rax, 0xe8(%rsp)
jmp 0xccb8
movq 0xe8(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x4150
movb %al, 0xe7(%rsp)
jmp 0xccd8
movb 0xe7(%rsp), %al
testb $0x1, %al
jne 0xcce5
jmp 0xcd44
movq 0x20304(%rip), %rdi     # 0x2cff0
leaq 0x14dd7(%rip), %rsi     # 0x21aca
callq 0x4290
movq %rax, 0xd8(%rsp)
jmp 0xcd02
movq 0xd8(%rsp), %rdi
movq 0x118(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x4350
movq %rax, 0xd0(%rsp)
jmp 0xcd24
movq 0xd0(%rsp), %rdi
movq 0x20275(%rip), %rsi     # 0x2cfa8
callq 0x42b0
jmp 0xcd3a
movl $0x1, %edi
callq 0x42f0
leaq 0x1d0(%rsp), %rdi
callq 0x44a0
testb $0x1, %al
jne 0xcd96
leaq 0x1d0(%rsp), %rdi
callq 0x41e0
movsbl (%rax), %eax
cmpl $0xd, %eax
jne 0xcd96
leaq 0x1d0(%rsp), %rdi
movq %rdi, 0xc8(%rsp)
callq 0x41c0
movq 0xc8(%rsp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x4390
jmp 0xcd94
jmp 0xcd96
leaq 0x1d0(%rsp), %rdi
callq 0x44a0
testb $0x1, %al
jne 0xcda9
jmp 0xce08
movq 0x20240(%rip), %rdi     # 0x2cff0
leaq 0x14d26(%rip), %rsi     # 0x21add
callq 0x4290
movq %rax, 0xc0(%rsp)
jmp 0xcdc6
movq 0xc0(%rsp), %rdi
movq 0x118(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x4350
movq %rax, 0xb8(%rsp)
jmp 0xcde8
movq 0xb8(%rsp), %rdi
movq 0x201b1(%rip), %rsi     # 0x2cfa8
callq 0x42b0
jmp 0xcdfe
movl $0x1, %edi
callq 0x42f0
movq 0x118(%rsp), %rcx
movl 0x10(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
je 0xced1
movq 0x118(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x4050
movq %rax, 0xb0(%rsp)
jmp 0xce45
movq 0xb0(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x4150
movb %al, 0xaf(%rsp)
jmp 0xce65
movb 0xaf(%rsp), %al
testb $0x1, %al
jne 0xce72
jmp 0xced1
movq 0x20177(%rip), %rdi     # 0x2cff0
leaq 0x14c4a(%rip), %rsi     # 0x21aca
callq 0x4290
movq %rax, 0xa0(%rsp)
jmp 0xce8f
movq 0xa0(%rsp), %rdi
movq 0x118(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x4350
movq %rax, 0x98(%rsp)
jmp 0xceb1
movq 0x98(%rsp), %rdi
movq 0x200e8(%rip), %rsi     # 0x2cfa8
callq 0x42b0
jmp 0xcec7
movl $0x1, %edi
callq 0x42f0
leaq 0x1b0(%rsp), %rdi
callq 0x44a0
testb $0x1, %al
jne 0xcf0d
xorl %eax, %eax
movl %eax, %esi
leaq 0x1b0(%rsp), %rdi
callq 0x45b0
movq %rax, 0x90(%rsp)
jmp 0xcefd
movq 0x90(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
je 0xcf6c
movq 0x200dc(%rip), %rdi     # 0x2cff0
leaq 0x14bda(%rip), %rsi     # 0x21af5
callq 0x4290
movq %rax, 0x88(%rsp)
jmp 0xcf2a
movq 0x88(%rsp), %rdi
movq 0x118(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x4350
movq %rax, 0x80(%rsp)
jmp 0xcf4c
movq 0x80(%rsp), %rdi
movq 0x2004d(%rip), %rsi     # 0x2cfa8
callq 0x42b0
jmp 0xcf62
movl $0x1, %edi
callq 0x42f0
movq 0x118(%rsp), %rcx
movl 0x10(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
je 0xd01d
movq 0x118(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x190(%rsp), %rsi
callq 0x4050
movq %rax, 0x78(%rsp)
jmp 0xcfa6
movq 0x78(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x4150
movb %al, 0x77(%rsp)
jmp 0xcfc0
movb 0x77(%rsp), %al
testb $0x1, %al
jne 0xcfca
jmp 0xd01d
movq 0x2001f(%rip), %rdi     # 0x2cff0
leaq 0x14af2(%rip), %rsi     # 0x21aca
callq 0x4290
movq %rax, 0x68(%rsp)
jmp 0xcfe4
movq 0x68(%rsp), %rdi
movq 0x118(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x4350
movq %rax, 0x60(%rsp)
jmp 0xd000
movq 0x60(%rsp), %rdi
movq 0x1ff9c(%rip), %rsi     # 0x2cfa8
callq 0x42b0
jmp 0xd013
movl $0x1, %edi
callq 0x42f0
leaq 0x190(%rsp), %rdi
callq 0x44a0
testb $0x1, %al
jne 0xd069
leaq 0x190(%rsp), %rdi
callq 0x41e0
movsbl (%rax), %eax
cmpl $0xd, %eax
jne 0xd069
leaq 0x190(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x41c0
movq 0x58(%rsp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x4390
jmp 0xd067
jmp 0xd069
leaq 0x1d0(%rsp), %rdi
callq 0x41c0
movq %rax, 0x50(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x41c0
movq %rax, %rcx
movq 0x50(%rsp), %rax
cmpq %rcx, %rax
je 0xd0e8
movq 0x1ff54(%rip), %rdi     # 0x2cff0
leaq 0x14a7f(%rip), %rsi     # 0x21b22
callq 0x4290
movq %rax, 0x48(%rsp)
jmp 0xd0af
movq 0x48(%rsp), %rdi
movq 0x118(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x4350
movq %rax, 0x40(%rsp)
jmp 0xd0cb
movq 0x40(%rsp), %rdi
movq 0x1fed1(%rip), %rsi     # 0x2cfa8
callq 0x42b0
jmp 0xd0de
movl $0x1, %edi
callq 0x42f0
leaq 0x178(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x1cf00
leaq 0x1d0(%rsp), %rdi
callq 0x41c0
movq 0x38(%rsp), %rdi
movq %rax, %rsi
callq 0x17370
jmp 0xd116
leaq 0x160(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x1cf00
leaq 0x1d0(%rsp), %rdi
callq 0x41c0
movq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0x17370
jmp 0xd144
leaq 0x190(%rsp), %rdi
callq 0x4230
movq %rax, 0x148(%rsp)
leaq 0x1d0(%rsp), %rax
movq %rax, 0x140(%rsp)
movq 0x140(%rsp), %rdi
callq 0x4230
movq %rax, 0x138(%rsp)
movq 0x140(%rsp), %rdi
callq 0x41a0
movq %rax, 0x130(%rsp)
leaq 0x138(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x174b0
testb $0x1, %al
jne 0xd1b1
jmp 0xd2ed
leaq 0x138(%rsp), %rdi
callq 0x174f0
movb (%rax), %al
movb %al, 0x12f(%rsp)
movsbl 0x12f(%rsp), %eax
addl $-0x41, %eax
movl %eax, %ecx
movq %rcx, 0x28(%rsp)
subl $0x34, %eax
ja 0xd27e
movq 0x28(%rsp), %rax
leaq 0x13fc6(%rip), %rcx     # 0x211b4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x0, 0x12e(%rsp)
leaq 0x178(%rsp), %rdi
leaq 0x12e(%rsp), %rsi
callq 0x17500
jmp 0xd216
jmp 0xd29f
movb $0x1, 0x12d(%rsp)
leaq 0x178(%rsp), %rdi
leaq 0x12d(%rsp), %rsi
callq 0x17500
jmp 0xd23a
jmp 0xd29f
movb $0x2, 0x12c(%rsp)
leaq 0x178(%rsp), %rdi
leaq 0x12c(%rsp), %rsi
callq 0x17500
jmp 0xd25b
jmp 0xd29f
movb $0x3, 0x12b(%rsp)
leaq 0x178(%rsp), %rdi
leaq 0x12b(%rsp), %rsi
callq 0x17500
jmp 0xd27c
jmp 0xd29f
movb $0x4, 0x12a(%rsp)
leaq 0x178(%rsp), %rdi
leaq 0x12a(%rsp), %rsi
callq 0x17500
jmp 0xd29d
jmp 0xd29f
leaq 0x148(%rsp), %rdi
callq 0x174f0
movb (%rax), %al
addb $-0x21, %al
movb %al, 0x129(%rsp)
leaq 0x160(%rsp), %rdi
leaq 0x129(%rsp), %rsi
callq 0x17500
jmp 0xd2ce
leaq 0x148(%rsp), %rdi
callq 0x17550
leaq 0x138(%rsp), %rdi
callq 0x17550
jmp 0xd193
movq 0x220(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0x1cf20
jmp 0xd304
movq 0x218(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x1cf20
jmp 0xd31b
movq 0x220(%rsp), %rdi
callq 0x1cf90
movl 0x214(%rsp), %ecx
cmpq %rcx, %rax
jne 0xd34c
movb $0x1, 0x237(%rsp)
movl $0x1, 0x124(%rsp)
jmp 0xd40a
jmp 0xcb1d
movq 0x118(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x4550
movb %al, 0x27(%rsp)
jmp 0xd372
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0xd3e7
jmp 0xd37c
movq 0x1fc6d(%rip), %rdi     # 0x2cff0
leaq 0x147c3(%rip), %rsi     # 0x21b4d
callq 0x4290
movq %rax, 0x18(%rsp)
jmp 0xd396
movq 0x18(%rsp), %rdi
movq 0x118(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x4350
movq %rax, 0x10(%rsp)
jmp 0xd3b2
movq 0x10(%rsp), %rdi
leaq 0x147b4(%rip), %rsi     # 0x21b72
callq 0x4290
movq %rax, 0x8(%rsp)
jmp 0xd3ca
movq 0x8(%rsp), %rdi
movq 0x1fbd2(%rip), %rsi     # 0x2cfa8
callq 0x42b0
jmp 0xd3dd
movl $0x1, %edi
callq 0x42f0
movq 0x220(%rsp), %rdi
callq 0x1cfb0
xorb $-0x1, %al
andb $0x1, %al
movb %al, 0x237(%rsp)
movl $0x1, 0x124(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x16f70
leaq 0x178(%rsp), %rdi
callq 0x16f70
leaq 0x190(%rsp), %rdi
callq 0x41b0
leaq 0x1b0(%rsp), %rdi
callq 0x41b0
leaq 0x1d0(%rsp), %rdi
callq 0x41b0
leaq 0x1f0(%rsp), %rdi
callq 0x41b0
movb 0x237(%rsp), %al
andb $0x1, %al
addq $0x238, %rsp            # imm = 0x238
retq
movq 0x158(%rsp), %rdi
callq 0x4510
nopw %cs:(%rax,%rax)