// File: /workspace/github_c_makefile_star2_O3/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), %rax
leaq 0x98(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %r14
movq %r14, %rdi
callq 0x4d7a
leaq 0xf8(%rsp), %rdi
movq %r14, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x37fc
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0x9371
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32d0
movq (%rbx), %rax
leaq 0x58(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x4d7a
leaq 0xa8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x37fc
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x93c2
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32d0
xorl %ebp, %ebp
xorl %r12d, %r12d
movl %r12d, %r15d
testb $0x1, %bpl
je 0x93d5
xorl %r13d, %r13d
jmp 0x93e5
leaq 0xf8(%rsp), %rdi
callq 0x3d92
movq %rax, %r13
testb $0x1, %r15b
je 0x93f0
xorl %r14d, %r14d
jmp 0x9400
leaq 0xa8(%rsp), %rdi
callq 0x3d92
movq %rax, %r14
movq %r13, %rax
orq %r14, %rax
je 0x97bc
testq %r13, %r13
je 0x9466
incq 0x10(%rbx)
movq %r13, %rdi
callq 0xb0be
cltq
addq %rax, 0x20(%rbx)
movq 0x28(%r13), %rax
cmpq 0x68(%r13), %rax
jne 0x95ed
movq 0x8(%r13), %rax
testq %rax, %rax
je 0x9476
movq (%r13), %rcx
xorl %r12d, %r12d
cmpb $0x20, (%rcx,%r12)
je 0x9453
incq %r12
cmpq %r12, %rax
jne 0x9441
xorl %r12d, %r12d
testq %r14, %r14
jne 0x947e
movb $0x1, %r15b
testq %r13, %r13
je 0x93ca
jmp 0x94be
movb $0x1, %bpl
movb $0x1, %r12b
testq %r14, %r14
jne 0x947b
jmp 0x93c7
testq %r14, %r14
je 0x94be
xorl %r12d, %r12d
incq 0x18(%rbx)
movq %r14, %rdi
callq 0xb0be
cltq
addq %rax, 0x28(%rbx)
movq 0x28(%r14), %rax
cmpq 0x68(%r14), %rax
jne 0x981a
movq 0x8(%r14), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x94c5
movq (%r14), %rsi
xorl %edx, %edx
cmpb $0x20, (%rsi,%rdx)
je 0x94c3
incq %rdx
cmpq %rdx, %rcx
jne 0x94ae
jmp 0x94c5
movb $0x1, %r12b
jmp 0x9501
movl %edx, %eax
testq %r13, %r13
je 0x9570
cmpl %eax, %r12d
jne 0x963e
testl %r12d, %r12d
je 0x94fe
movq (%r13), %rax
movq (%r14), %rcx
movl %r12d, %edx
xorl %esi, %esi
movb (%rax,%rsi), %dil
cmpb (%rcx,%rsi), %dil
jne 0x963e
incq %rsi
cmpq %rsi, %rdx
jne 0x94e8
movl %r15d, %r12d
movq 0x60(%r13), %rdi
leaq 0x70(%r13), %rax
cmpq %rax, %rdi
je 0x9519
movq (%rax), %rsi
incq %rsi
callq 0x32d0
movq 0x40(%r13), %rdi
leaq 0x50(%r13), %rax
cmpq %rax, %rdi
je 0x9531
movq (%rax), %rsi
incq %rsi
callq 0x32d0
movq 0x20(%r13), %rdi
leaq 0x30(%r13), %rax
cmpq %rax, %rdi
je 0x9549
movq (%rax), %rsi
incq %rsi
callq 0x32d0
movq (%r13), %rdi
leaq 0x10(%r13), %rax
cmpq %rax, %rdi
je 0x9561
movq (%rax), %rsi
incq %rsi
callq 0x32d0
movl $0x88, %esi
movq %r13, %rdi
callq 0x32d0
jmp 0x9573
movl %r15d, %r12d
testq %r14, %r14
je 0x93c7
movq 0x60(%r14), %rdi
leaq 0x70(%r14), %rax
cmpq %rax, %rdi
je 0x9594
movq (%rax), %rsi
incq %rsi
callq 0x32d0
movq 0x40(%r14), %rdi
leaq 0x50(%r14), %rax
cmpq %rax, %rdi
je 0x95ac
movq (%rax), %rsi
incq %rsi
callq 0x32d0
movq 0x20(%r14), %rdi
leaq 0x30(%r14), %rax
cmpq %rax, %rdi
je 0x95c4
movq (%rax), %rsi
incq %rsi
callq 0x32d0
movq (%r14), %rdi
leaq 0x10(%r14), %rax
cmpq %rax, %rdi
je 0x95db
movq (%rax), %rsi
incq %rsi
callq 0x32d0
movl $0x88, %esi
movq %r14, %rdi
callq 0x32d0
jmp 0x93c7
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0xb2ec
leaq 0x3edb(%rip), %rcx      # 0xd4de
leaq 0x8(%rsp), %rdi
movl $0x3e, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3320
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x968a
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x9691
leaq 0x3f17(%rip), %rsi      # 0xd55c
leaq 0x68(%rsp), %rdi
movq %r13, %rdx
callq 0x4c5b
leaq 0x3ba0(%rip), %rsi      # 0xd1f9
leaq 0x68(%rsp), %rdi
callq 0x3550
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x96ea
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x96f1
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %r14
movq %rdx, 0x8(%r14)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x30(%rbx), %rdi
movq %r14, %rsi
callq 0x3380
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x96ce
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x32d0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x97b8
movq 0x18(%rsp), %rsi
jmp 0x97b0
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
callq 0x30e0
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9741
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x9749
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %r14
movq %rdx, 0x8(%r14)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x30(%rbx), %rdi
movq %r14, %rsi
callq 0x3380
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x9786
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x979d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32d0
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x97b8
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32d0
movb $0x0, 0x8(%rbx)
movq 0x10(%rbx), %rax
cmpq 0x18(%rbx), %rax
je 0x97e6
leaq 0x30(%rbx), %rdi
movq 0x38(%rbx), %rdx
leaq 0x3dae(%rip), %rcx      # 0xd583
movl $0x28, %r8d
xorl %esi, %esi
callq 0x3440
movb $0x0, 0x8(%rbx)
movq %rbx, %rdi
callq 0x9916
leaq 0xa8(%rsp), %rdi
callq 0x39f8
leaq 0xf8(%rsp), %rdi
callq 0x39f8
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xb2ec
leaq 0x3ced(%rip), %rcx      # 0xd51d
leaq 0x8(%rsp), %rdi
movl $0x3e, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3320
jmp 0x9617
jmp 0x9886
jmp 0x98f1
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x986f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32d0
jmp 0x986f
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x98f4
movq 0x78(%rsp), %rsi
jmp 0x989c
jmp 0x98f1
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x98f4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32d0
jmp 0x98f4
jmp 0x98f1
jmp 0x98f1
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x9901
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32d0
jmp 0x9901
movq %rax, %rbx
jmp 0x9901
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0x990e
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32d0
jmp 0x990e
jmp 0x98f1
jmp 0x98f1
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x39f8
leaq 0xf8(%rsp), %rdi
callq 0x39f8
movq %rbx, %rdi
callq 0x3500