// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x298, %rsp            # imm = 0x298
movq %rdi, 0x290(%rsp)
movq 0x290(%rsp), %rax
movq %rax, 0x78(%rsp)
movq (%rax), %rsi
leaq 0x220(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0x4180
movq 0x80(%rsp), %rsi
leaq 0x240(%rsp), %rdi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x4a00
jmp 0x10ce2
leaq 0x220(%rsp), %rdi
callq 0x4758
movq 0x78(%rsp), %rax
movq (%rax), %rsi
addq $0x20, %rsi
leaq 0x1a0(%rsp), %rdi
callq 0x4180
jmp 0x10d0a
leaq 0x1c0(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x4a00
jmp 0x10d28
leaq 0x1a0(%rsp), %rdi
callq 0x4758
movb $0x0, 0x19f(%rsp)
movb $0x0, 0x19e(%rsp)
jmp 0x10d47
movq $0x0, 0x190(%rsp)
movq $0x0, 0x188(%rsp)
testb $0x1, 0x19f(%rsp)
jne 0x10e0e
leaq 0x240(%rsp), %rdi
callq 0x5460
movq %rax, 0x70(%rsp)
jmp 0x10d81
movq 0x70(%rsp), %rax
movq %rax, 0x190(%rsp)
jmp 0x10e0e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x218(%rsp)
movl %eax, 0x214(%rsp)
leaq 0x220(%rsp), %rdi
callq 0x4758
jmp 0x11477
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x218(%rsp)
movl %eax, 0x214(%rsp)
jmp 0x1146a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x218(%rsp)
movl %eax, 0x214(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0x4758
jmp 0x1146a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x218(%rsp)
movl %eax, 0x214(%rsp)
jmp 0x1145d
testb $0x1, 0x19e(%rsp)
jne 0x10e39
leaq 0x1c0(%rsp), %rdi
callq 0x5460
movq %rax, 0x68(%rsp)
jmp 0x10e2c
movq 0x68(%rsp), %rax
movq %rax, 0x188(%rsp)
cmpq $0x0, 0x190(%rsp)
jne 0x10e54
cmpq $0x0, 0x188(%rsp)
jne 0x10e54
jmp 0x11400
movl $0x0, 0x184(%rsp)
movl $0x0, 0x180(%rsp)
cmpq $0x0, 0x190(%rsp)
je 0x11005
movq 0x78(%rsp), %rax
movq 0x10(%rax), %rcx
incq %rcx
movq %rcx, 0x10(%rax)
movq 0x190(%rsp), %rdi
callq 0x12cf0
movl %eax, 0x64(%rsp)
jmp 0x10e9c
movq 0x78(%rsp), %rax
movl 0x64(%rsp), %ecx
movslq %ecx, %rcx
addq 0x20(%rax), %rcx
movq %rcx, 0x20(%rax)
movq 0x190(%rsp), %rdi
addq $0x20, %rdi
callq 0x4590
movq %rax, 0x58(%rsp)
movq 0x190(%rsp), %rdi
addq $0x60, %rdi
callq 0x4590
movq %rax, %rcx
movq 0x58(%rsp), %rax
cmpq %rcx, %rax
je 0x10f83
movq 0x190(%rsp), %rsi
leaq 0x140(%rsp), %rdi
xorl %edx, %edx
callq 0x131e0
jmp 0x10f01
leaq 0x55d6(%rip), %rsi      # 0x164de
leaq 0x160(%rsp), %rdi
leaq 0x140(%rsp), %rdx
callq 0xd330
jmp 0x10f1f
movq 0x78(%rsp), %rdi
addq $0x30, %rdi
leaq 0x160(%rsp), %rsi
callq 0x4490
leaq 0x160(%rsp), %rdi
callq 0x4758
leaq 0x140(%rsp), %rdi
callq 0x4758
movq 0x78(%rsp), %rax
movb $0x0, 0x8(%rax)
jmp 0x11400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x218(%rsp)
movl %eax, 0x214(%rsp)
leaq 0x140(%rsp), %rdi
callq 0x4758
jmp 0x1145d
movl $0x0, 0x13c(%rsp)
movslq 0x13c(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x190(%rsp), %rdi
callq 0x4590
movq %rax, %rcx
movq 0x50(%rsp), %rax
cmpq %rcx, %rax
jae 0x11003
movq 0x190(%rsp), %rdi
movslq 0x13c(%rsp), %rsi
callq 0x4740
movq %rax, 0x48(%rsp)
jmp 0x10fd1
movq 0x48(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x10fee
movl 0x13c(%rsp), %eax
movl %eax, 0x184(%rsp)
jmp 0x11003
jmp 0x10ff0
movl 0x13c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x13c(%rsp)
jmp 0x10f8e
jmp 0x1100d
movb $0x1, 0x19f(%rsp)
cmpq $0x0, 0x188(%rsp)
je 0x111a8
movq 0x78(%rsp), %rax
movq 0x18(%rax), %rcx
incq %rcx
movq %rcx, 0x18(%rax)
movq 0x188(%rsp), %rdi
callq 0x12cf0
movl %eax, 0x44(%rsp)
jmp 0x1103f
movq 0x78(%rsp), %rax
movl 0x44(%rsp), %ecx
movslq %ecx, %rcx
addq 0x28(%rax), %rcx
movq %rcx, 0x28(%rax)
movq 0x188(%rsp), %rdi
addq $0x20, %rdi
callq 0x4590
movq %rax, 0x38(%rsp)
movq 0x188(%rsp), %rdi
addq $0x60, %rdi
callq 0x4590
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
je 0x11126
movq 0x188(%rsp), %rsi
leaq 0xf8(%rsp), %rdi
xorl %edx, %edx
callq 0x131e0
jmp 0x110a4
leaq 0x5472(%rip), %rsi      # 0x1651d
leaq 0x118(%rsp), %rdi
leaq 0xf8(%rsp), %rdx
callq 0xd330
jmp 0x110c2
movq 0x78(%rsp), %rdi
addq $0x30, %rdi
leaq 0x118(%rsp), %rsi
callq 0x4490
leaq 0x118(%rsp), %rdi
callq 0x4758
leaq 0xf8(%rsp), %rdi
callq 0x4758
movq 0x78(%rsp), %rax
movb $0x0, 0x8(%rax)
jmp 0x11400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x218(%rsp)
movl %eax, 0x214(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x4758
jmp 0x1145d
movl $0x0, 0xf4(%rsp)
movslq 0xf4(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x188(%rsp), %rdi
callq 0x4590
movq %rax, %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
jae 0x111a6
movq 0x188(%rsp), %rdi
movslq 0xf4(%rsp), %rsi
callq 0x4740
movq %rax, 0x28(%rsp)
jmp 0x11174
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x11191
movl 0xf4(%rsp), %eax
movl %eax, 0x180(%rsp)
jmp 0x111a6
jmp 0x11193
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x11131
jmp 0x111b0
movb $0x1, 0x19e(%rsp)
cmpq $0x0, 0x190(%rsp)
je 0x1138c
cmpq $0x0, 0x188(%rsp)
je 0x1138c
movb $0x1, 0xf3(%rsp)
movl 0x184(%rsp), %eax
cmpl 0x180(%rsp), %eax
jne 0x1127d
movl $0x0, 0xec(%rsp)
movl 0xec(%rsp), %eax
cmpl 0x184(%rsp), %eax
jge 0x1127b
movq 0x190(%rsp), %rdi
movslq 0xec(%rsp), %rsi
callq 0x4740
movq %rax, 0x20(%rsp)
jmp 0x11221
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
movl %eax, 0x14(%rsp)
movq 0x188(%rsp), %rdi
movslq 0xec(%rsp), %rsi
callq 0x4740
movq %rax, 0x18(%rsp)
jmp 0x11249
movl 0x14(%rsp), %eax
movq 0x18(%rsp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x11263
movb $0x0, 0xf3(%rsp)
jmp 0x1127b
jmp 0x11265
movl 0xec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xec(%rsp)
jmp 0x111f5
jmp 0x1127d
testb $0x1, 0xf3(%rsp)
je 0x1129b
movl 0x184(%rsp), %eax
cmpl 0x180(%rsp), %eax
je 0x1138a
movq 0x190(%rsp), %rdx
leaq 0x52b2(%rip), %rsi      # 0x1655c
leaq 0x88(%rsp), %rdi
callq 0x6920
jmp 0x112b9
leaq 0x4f39(%rip), %rdx      # 0x161f9
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0xceb0
jmp 0x112d7
movq 0x188(%rsp), %rdx
leaq 0xc8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xf270
jmp 0x112f6
movq 0x78(%rsp), %rdi
addq $0x30, %rdi
leaq 0xc8(%rsp), %rsi
callq 0x4490
leaq 0xc8(%rsp), %rdi
callq 0x4758
leaq 0xa8(%rsp), %rdi
callq 0x4758
leaq 0x88(%rsp), %rdi
callq 0x4758
movq 0x78(%rsp), %rax
movb $0x0, 0x8(%rax)
jmp 0x11400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x218(%rsp)
movl %eax, 0x214(%rsp)
jmp 0x11378
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x218(%rsp)
movl %eax, 0x214(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x4758
leaq 0x88(%rsp), %rdi
callq 0x4758
jmp 0x1145d
jmp 0x1138c
cmpq $0x0, 0x190(%rsp)
je 0x113c5
movq 0x190(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x113c3
movq 0x8(%rsp), %rdi
callq 0x6b10
movq 0x8(%rsp), %rdi
movl $0x88, %esi
callq 0x4370
jmp 0x113c5
cmpq $0x0, 0x188(%rsp)
je 0x113fb
movq 0x188(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x113f9
movq (%rsp), %rdi
callq 0x6b10
movq (%rsp), %rdi
movl $0x88, %esi
callq 0x4370
jmp 0x113fb
jmp 0x10d45
movq 0x78(%rsp), %rcx
movq 0x10(%rcx), %rax
cmpq 0x18(%rcx), %rax
je 0x1142f
movq 0x78(%rsp), %rdi
addq $0x30, %rdi
leaq 0x5164(%rip), %rsi      # 0x16583
callq 0x4500
jmp 0x11426
movq 0x78(%rsp), %rax
movb $0x0, 0x8(%rax)
movq 0x78(%rsp), %rdi
callq 0x11490
jmp 0x1143b
leaq 0x1c0(%rsp), %rdi
callq 0x4ca0
leaq 0x240(%rsp), %rdi
callq 0x4ca0
addq $0x298, %rsp            # imm = 0x298
retq
leaq 0x1c0(%rsp), %rdi
callq 0x4ca0
leaq 0x240(%rsp), %rdi
callq 0x4ca0
movq 0x218(%rsp), %rdi
callq 0x46a0
nopw %cs:(%rax,%rax)