// File: /workspace/github_c_makefile_star2_O1/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 $0x168, %rsp            # imm = 0x168
movq %rdi, 0x10(%rsp)
movq (%rdi), %rax
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %r14
movq %r14, %rdi
callq 0x4ea0
leaq 0x118(%rsp), %rdi
movq %r14, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x380c
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x954f
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x10(%rsp), %rbx
movq (%rbx), %rax
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x4ea0
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x380c
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x95b4
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32e0
leaq 0x30(%rbx), %rax
movq %rax, 0x60(%rsp)
xorl %r15d, %r15d
xorl %ebx, %ebx
testb $0x1, %r15b
je 0x95cd
xorl %r12d, %r12d
jmp 0x95dd
leaq 0x118(%rsp), %rdi
callq 0x3de6
movq %rax, %r12
testb $0x1, %bl
je 0x95e7
xorl %r13d, %r13d
jmp 0x95f7
leaq 0xc8(%rsp), %rdi
callq 0x3de6
movq %rax, %r13
movl $0x3, %ebp
movq %r12, %rax
orq %r13, %rax
je 0x9ad9
movq %rbx, 0x18(%rsp)
xorl %r14d, %r14d
movb $0x1, 0xf(%rsp)
movl $0x0, %ebx
testq %r12, %r12
je 0x973f
movq 0x10(%rsp), %rbx
incq 0x10(%rbx)
movq %r12, %rdi
callq 0xb3d6
cltq
addq %rax, 0x20(%rbx)
movq 0x28(%r12), %rax
cmpq 0x68(%r12), %rax
jne 0x9674
movq 0x8(%r12), %rax
testq %rax, %rax
je 0x9668
movq (%r12), %rcx
xorl %ebx, %ebx
cmpb $0x20, (%rcx,%rbx)
je 0x973a
incq %rbx
cmpq %rbx, %rax
jne 0x9656
movb %r15b, 0xf(%rsp)
xorl %ebx, %ebx
jmp 0x973f
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0xb5fe
leaq 0x30(%rsp), %rbx
movl $0x3e, %r8d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x3e3f(%rip), %rcx      # 0xd4de
leaq 0x50(%rsp), %r14
callq 0x3330
movq %rbx, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x96cc
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x96d2
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x60(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x3390
movq 0x20(%rsp), %rdi
cmpq %rbx, %rdi
je 0x9710
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
movq 0x18(%rsp), %rbx
je 0x972c
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x10(%rsp), %rax
movb $0x0, 0x8(%rax)
jmp 0x9ad9
movb %r15b, 0xf(%rsp)
testq %r13, %r13
je 0x978f
movq 0x10(%rsp), %r15
incq 0x18(%r15)
movq %r13, %rdi
callq 0xb3d6
cltq
addq %rax, 0x28(%r15)
movq 0x28(%r13), %rax
cmpq 0x68(%r13), %rax
jne 0x97a0
movq 0x8(%r13), %rax
testq %rax, %rax
je 0x9865
movq (%r13), %rdx
xorl %ecx, %ecx
cmpb $0x20, (%rdx,%rcx)
je 0x9862
incq %rcx
cmpq %rcx, %rax
jne 0x9778
jmp 0x9865
movb $0x1, %al
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %r15
jmp 0x9865
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0xb5fe
movl $0x3e, %r8d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x3d57(%rip), %rcx      # 0xd51d
leaq 0x50(%rsp), %r14
callq 0x3330
leaq 0x30(%rsp), %rbx
movq %rbx, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x97f8
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x97fe
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x60(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x3390
movq 0x20(%rsp), %rdi
cmpq %rbx, %rdi
je 0x983c
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
movq 0x18(%rsp), %rbx
je 0x9858
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32e0
movb $0x0, 0x8(%r15)
jmp 0x9ad2
movl %ecx, %r14d
testq %r13, %r13
sete %al
testq %r12, %r12
sete %cl
orb %al, %cl
jne 0x99e0
cmpl %r14d, %ebx
jne 0x98ae
testl %ebx, %ebx
je 0x98a0
movq (%r12), %rax
movq (%r13), %rcx
movl %ebx, %edx
xorl %esi, %esi
movb (%rax,%rsi), %dil
cmpb (%rcx,%rsi), %dil
jne 0x98ae
incq %rsi
cmpq %rsi, %rdx
jne 0x988e
cmpl %r14d, %ebx
jne 0x98ae
xorl %ebp, %ebp
movb $0x1, %al
jmp 0x99d8
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
leaq 0x3c9f(%rip), %rsi      # 0xd55c
movq %r12, %rdx
callq 0x4d87
movq %rbx, %rdi
leaq 0x392a(%rip), %rsi      # 0xd1f9
callq 0x3560
leaq 0x50(%rsp), %r14
leaq 0x30(%rsp), %rbx
movq %r14, 0x40(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9901
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x9908
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
leaq 0x40(%rsp), %rdi
callq 0x30e0
movq %rbx, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9955
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x995b
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x60(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x3390
movq 0x20(%rsp), %rdi
cmpq %rbx, %rdi
je 0x9999
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x99b0
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x99cc
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32e0
movb $0x0, 0x8(%r15)
movl $0x3, %ebp
xorl %eax, %eax
testb %al, %al
je 0x9ae3
testq %r12, %r12
je 0x9a59
movq 0x60(%r12), %rdi
leaq 0x70(%r12), %rax
cmpq %rax, %rdi
je 0x99ff
movq (%rax), %rsi
incq %rsi
callq 0x32e0
movq 0x40(%r12), %rdi
leaq 0x50(%r12), %rax
cmpq %rax, %rdi
je 0x9a19
movq (%rax), %rsi
incq %rsi
callq 0x32e0
movq 0x20(%r12), %rdi
leaq 0x30(%r12), %rax
cmpq %rax, %rdi
je 0x9a33
movq (%rax), %rsi
incq %rsi
callq 0x32e0
movq (%r12), %rdi
leaq 0x10(%r12), %rax
cmpq %rax, %rdi
je 0x9a4c
movq (%rax), %rsi
incq %rsi
callq 0x32e0
movl $0x88, %esi
movq %r12, %rdi
callq 0x32e0
xorl %ebp, %ebp
testq %r13, %r13
movq 0x18(%rsp), %rbx
je 0x9ad2
movq 0x60(%r13), %rdi
leaq 0x70(%r13), %rax
cmpq %rax, %rdi
je 0x9a7d
movq (%rax), %rsi
incq %rsi
callq 0x32e0
movq 0x40(%r13), %rdi
leaq 0x50(%r13), %rax
cmpq %rax, %rdi
je 0x9a95
movq (%rax), %rsi
incq %rsi
callq 0x32e0
movq 0x20(%r13), %rdi
leaq 0x30(%r13), %rax
cmpq %rax, %rdi
je 0x9aad
movq (%rax), %rsi
incq %rsi
callq 0x32e0
movq (%r13), %rdi
leaq 0x10(%r13), %rax
cmpq %rax, %rdi
je 0x9ac5
movq (%rax), %rsi
incq %rsi
callq 0x32e0
movl $0x88, %esi
movq %r13, %rdi
callq 0x32e0
movb 0xf(%rsp), %al
movl %eax, %r15d
testl %ebp, %ebp
je 0x95c2
jmp 0x9af1
movb 0xf(%rsp), %al
movl %eax, %r15d
movq 0x18(%rsp), %rbx
jmp 0x9ad9
movq 0x10(%rsp), %rbx
movq 0x10(%rbx), %rax
cmpq 0x18(%rbx), %rax
je 0x9b21
movq 0x38(%rbx), %rdx
leaq 0x3a78(%rip), %rcx      # 0xd583
movl $0x28, %r8d
movq 0x60(%rsp), %rdi
xorl %esi, %esi
callq 0x3450
movb $0x0, 0x8(%rbx)
movq %rbx, %rdi
callq 0x9c2e
leaq 0xc8(%rsp), %rdi
callq 0x3a22
leaq 0x118(%rsp), %rdi
callq 0x3a22
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x9c19
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32e0
jmp 0x9c19
movq %rax, %rbx
jmp 0x9c19
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x9c26
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x32e0
jmp 0x9c26
jmp 0x9c09
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x9bcd
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32e0
jmp 0x9bcd
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x9c0c
movq 0x78(%rsp), %rsi
jmp 0x9bfb
jmp 0x9c09
jmp 0x9be9
jmp 0x9c09
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x9c0c
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32e0
jmp 0x9c0c
jmp 0x9c09
jmp 0x9c09
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x3a22
leaq 0x118(%rsp), %rdi
callq 0x3a22
movq %rbx, %rdi
callq 0x3510