// File: /workspace/github_c_makefile_star2_O2/OpenGene[P]pecheck/src/pecheck.cpp
// Function: PECheck::run()
void PECheck::run() {
    FastqReader reader1(mOptions->in1);
    FastqReader reader2(mOptions->in2);

    bool r1Finished = false;
    bool r2Finished = false;
    while(true) {
        Read* r1 = NULL;
        Read* r2 = NULL;
        if(!r1Finished)
            r1 = reader1.read();
        if(!r2Finished)
            r2 = reader2.read();
        if(!r1 && !r2)
            break;
        int namePos1=0;
        int namePos2=0;
        if(r1) {
            mRead1Num++;
            mRead1Bases += r1->length();
            if(r1->mSeq.mStr.length() != r1->mQuality.length()) {
                mFailedMessage = "Read1 is broken (sequence and quality have different length): " + r1->toString(false);
                mPassed = false;
                break;
            }
            for(int i=0; i<r1->mName.length(); i++) {
                if(r1->mName[i] == ' ') {
                    namePos1 = i;
                    break;
                }
            }
        } else
            r1Finished = true;

        if(r2) {
            mRead2Num++;
            mRead2Bases += r2->length();
            if(r2->mSeq.mStr.length() != r2->mQuality.length()) {
                mFailedMessage = "Read2 is broken (sequence and quality have different length): " + r2->toString(false);
                mPassed = false;
                break;
            }
            for(int i=0; i<r2->mName.length(); i++) {
                if(r2->mName[i] == ' ') {
                    namePos2 = i;
                    break;
                }
            }
        } else
            r2Finished = true;

        if(r1 && r2) {
            bool nameConsistent = true;
            if(namePos1 == namePos2){
                for(int i=0; i<namePos1; i++) {
                    if(r1->mName[i] != r2->mName[i]) {
                        nameConsistent = false;
                        break;
                    }
                }
            }
            if(!nameConsistent || (namePos1 != namePos2)) {
                mFailedMessage = "Read1 and read2 have different names: " + r1->mName + ", " + r2->mName;
                mPassed = false;
                break;
            }
        }

        if(r1)
            delete r1;
        if(r2)
            delete r2;
    }
    if(mRead1Num != mRead2Num) {
        mFailedMessage = "Numbers of read1 and read2 are different";
        mPassed = false;
    }

    report();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdi, %rbx
movq (%rdi), %rsi
leaq 0x88(%rsp), %r14
movq %r14, %rdi
callq 0x3380
leaq 0xf8(%rsp), %rdi
pushq $0x1
popq %rdx
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x378c
leaq 0x88(%rsp), %rdi
callq 0x3568
movq (%rbx), %rsi
addq $0x20, %rsi
leaq 0x68(%rsp), %rdi
callq 0x3380
leaq 0xa8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
callq 0x378c
leaq 0x68(%rsp), %rdi
callq 0x3568
xorl %ebp, %ebp
xorl %eax, %eax
movl %eax, %r14d
testb $0x1, %bpl
je 0x7869
xorl %r13d, %r13d
jmp 0x7879
leaq 0xf8(%rsp), %rdi
callq 0x3c1c
movq %rax, %r13
testb $0x1, %r14b
je 0x7884
xorl %r12d, %r12d
jmp 0x7894
leaq 0xa8(%rsp), %rdi
callq 0x3c1c
movq %rax, %r12
movq %r13, %rax
orq %r12, %rax
je 0x7a6f
testq %r13, %r13
je 0x791b
incq 0x10(%rbx)
movq %r13, %rdi
callq 0x8844
cltq
addq %rax, 0x20(%rbx)
movq 0x28(%r13), %rax
cmpq 0x68(%r13), %rax
jne 0x79bd
movq 0x8(%r13), %rax
xorl %r15d, %r15d
cmpq %r15, %rax
je 0x78e1
movq (%r13), %rcx
cmpb $0x20, (%rcx,%r15)
je 0x78e4
incq %r15
jmp 0x78cc
xorl %r15d, %r15d
testq %r12, %r12
jne 0x792c
movb $0x1, %r14b
testq %r13, %r13
je 0x785e
movq %r13, %rdi
callq 0x45e6
movl $0x88, %esi
movq %r13, %rdi
callq 0x3290
movl %r14d, %eax
testq %r12, %r12
jne 0x79a0
jmp 0x785b
movb $0x1, %bpl
xorl %r15d, %r15d
movb $0x1, %al
testq %r12, %r12
je 0x785b
incq 0x18(%rbx)
movq %r12, %rdi
callq 0x8844
cltq
addq %rax, 0x28(%rbx)
movq 0x28(%r12), %rax
cmpq 0x68(%r12), %rax
jne 0x7ac1
movq 0x8(%r12), %rcx
xorl %eax, %eax
cmpq %rax, %rcx
je 0x7969
movq (%r12), %rdx
cmpb $0x20, (%rdx,%rax)
je 0x796b
incq %rax
jmp 0x7955
xorl %eax, %eax
testq %r13, %r13
je 0x79a0
cmpl %eax, %r15d
jne 0x7a02
movl %r15d, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x78f5
movq (%r13), %rdx
movb (%rdx,%rcx), %dl
movq (%r12), %rsi
leaq 0x1(%rcx), %rdi
cmpb (%rsi,%rcx), %dl
movq %rdi, %rcx
je 0x797e
jmp 0x7a02
movq %r12, %rdi
callq 0x45e6
movl $0x88, %esi
movq %r12, %rdi
callq 0x3290
movl %r14d, %eax
jmp 0x785b
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x8a5a
leaq 0x2b0b(%rip), %rsi      # 0xa4de
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x6792
leaq 0x30(%rbx), %rdi
leaq 0x28(%rsp), %r14
movq %r14, %rsi
callq 0x3330
movq %r14, %rdi
callq 0x3568
leaq 0x8(%rsp), %rdi
jmp 0x7a66
leaq 0x2b53(%rip), %rsi      # 0xa55c
leaq 0x48(%rsp), %rdi
movq %r13, %rdx
callq 0x4566
leaq 0x27dc(%rip), %rdx      # 0xa1f9
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x657e
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %r12, %rdx
callq 0x6cd7
leaq 0x30(%rbx), %rdi
leaq 0x28(%rsp), %r14
movq %r14, %rsi
callq 0x3330
movq %r14, %rdi
callq 0x3568
leaq 0x8(%rsp), %rdi
callq 0x3568
leaq 0x48(%rsp), %rdi
callq 0x3568
movb $0x0, 0x8(%rbx)
movq 0x10(%rbx), %rax
cmpq 0x18(%rbx), %rax
je 0x7a8d
leaq 0x30(%rbx), %rdi
leaq 0x2aff(%rip), %rsi      # 0xa583
callq 0x3530
movb $0x0, 0x8(%rbx)
movq %rbx, %rdi
callq 0x7b6c
leaq 0xa8(%rsp), %rdi
callq 0x38ea
leaq 0xf8(%rsp), %rdi
callq 0x38ea
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x8a5a
leaq 0x2a46(%rip), %rsi      # 0xa51d
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x6792
jmp 0x79e2
jmp 0x7b0a
jmp 0x7b47
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3568
jmp 0x7b01
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0x7b12
jmp 0x7b47
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3568
jmp 0x7b4a
jmp 0x7b47
jmp 0x7b47
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x3568
jmp 0x7b57
movq %rax, %rbx
jmp 0x7b57
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x3568
jmp 0x7b64
jmp 0x7b47
jmp 0x7b47
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x38ea
leaq 0xf8(%rsp), %rdi
callq 0x38ea
movq %rbx, %rdi
callq 0x34e0