// File: /workspace/github_c_makefile_star2_O3/annoroad[P]fqtools_plus/fqtools.c
// Function: filter_pair
static void filter_pair(void){
	struct job* job;
	struct readclass* readclass;
	struct readline* read1=NULL;
	struct readline* read2=NULL;
	struct STAT* stat;
	for (;;){
		possess(compress_have);
		wait_for(compress_have,NOT_TO_BE,0);
		job = compress_head;
		//job != NULL
		if (job->seq == -1) break;
		if (job->next == NULL){
			compress_tail = &compress_head;
		}else{
			compress_head = job->next;
		}
		twist(compress_have,BY,-1);
		
		readclass = job->in->readclass;
		read1 = readclass->read1;
		if (g.single_or_pair) read2 = readclass->read2;
		stat = readclass->stat;
		//filter funtion---------------------------------------
		if (g.outraw){
			to_buffer_raw(readclass,job);
			push_job_raw(job);
		}

		if (!job->more) {
			push_job(job);
			continue;
		}

		if (g.single_or_pair){
			read1->seqlen = strlen(read1->reads[1])-1;
			read2->seqlen = strlen(read2->reads[1])-1;
			substr_((read1->reads)[0], read1->id);
			substr_((read2->reads)[0], read2->id);
			if (read1->seqlen < g.CUT || read2->seqlen < g.CUT) {
				push_job(job);
				continue;
			}
			raw_Q30(readclass);
			stat->raw_reads++;
			stat->raw_bases+= read1->seqlen + read2->seqlen;
			cutseq(readclass);
			read1->seqlen = g.CUT;
			read2->seqlen = g.CUT;
			if (!checkadapter(readclass)){
				stat->adapter_reads++;
				push_job(job);
				continue;
			}
			quality_base_percent(readclass);
			if (read1->low >= g.LOW_QUALITY || read2->low >= g.LOW_QUALITY){
				stat->low_quality_reads++;
				push_job(job);
				continue;
			}
			if (read1->N >= g.highN || read2->N >= g.highN){
			    stat->ns_reads++;
			  	push_job(job);
				continue;
			}
			if (check_ployAT((read1->reads)[1], g.ployAT) || check_ployAT((read2->reads)[1], g.ployAT)){
			  	stat->ployAT_reads++;
			}
			if (read1->GC >= g.highGC || read2->GC >= g.highGC){
			   	stat->HighGC_reads++;
			}
			if (read1->highAT_sign || read2->highAT_sign){
			   	stat->HighAT_reads++;
			}
			stat->clean_Q30_bases += read1->Q30 + read2->Q30;
			stat->clean_reads++;
			report(readclass);
		}else{
			read1->seqlen = strlen(read1->reads[1])-1;
			substr_((read1->reads)[0], read1->id);
			if (read1->seqlen < g.CUT) {
				push_job(job);
				continue;
			}
			raw_Q30(readclass);
			stat->raw_reads++;
			stat->raw_bases+= read1->seqlen;
			cutseq(readclass);
			read1->seqlen = g.CUT;
			if (!checkadapter(readclass)){
				stat->adapter_reads++;
				push_job(job);
				continue;
			}
			quality_base_percent(readclass);
			if (read1->low >= g.LOW_QUALITY){
				stat->low_quality_reads++;
				push_job(job);
				continue;
			}
			if (read1->N >= g.highN){
			    stat->ns_reads++;
			  	push_job(job);
				continue;
			}

			if (check_ployAT((read1->reads)[1], g.ployAT)){
			  	stat->ployAT_reads++;
			}
			if (read1->GC >= g.highGC){
			   	stat->HighGC_reads++;
			}
			if (read1->highAT_sign){
			   	stat->HighAT_reads++;
			}
			stat->clean_Q30_bases += read1->Q30;
			stat->clean_reads++;
			report(readclass);
		}
		//-----------------------------------------------------
		to_buffer(readclass,job);
		push_job(job);
	}
	release(compress_have);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x80d1(%rip), %rdi      # 0xb2e0
callq 0x6265
movq 0x80c5(%rip), %rdi      # 0xb2e0
movl $0x1, %esi
xorl %edx, %edx
callq 0x63cb
movq 0x80ba(%rip), %rbx      # 0xb2e8
cmpq $-0x1, (%rbx)
je 0x3615
movq $0x0, (%rsp)
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x3252
movq %rax, 0x8098(%rip)      # 0xb2e8
jmp 0x3260
leaq 0x808f(%rip), %rax      # 0xb2e8
movq %rax, 0x80a0(%rip)      # 0xb300
movq 0x8079(%rip), %rdi      # 0xb2e0
movl $0x1, %esi
movq $-0x1, %rdx
callq 0x6394
movq 0x10(%rbx), %rax
movq 0x8(%rax), %r14
movq (%r14), %rbp
cmpb $0x0, 0x7f3e(%rip)      # 0xb1c8
je 0x3294
movq 0x8(%r14), %rax
movq %rax, (%rsp)
movq 0x10(%r14), %r15
cmpb $0x0, 0x7f65(%rip)      # 0xb204
je 0x3316
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3afd
movq 0x803d(%rip), %rdi      # 0xb2f0
callq 0x6265
movq 0x8039(%rip), %rax      # 0xb2f8
testq %rax, %rax
je 0x32e6
movq (%rbx), %rdx
leaq 0x802a(%rip), %rcx      # 0xb2f8
cmpq %rdx, (%rax)
jg 0x32f7
movq %rax, %rcx
movq 0x28(%rax), %rax
testq %rax, %rax
je 0x32f1
cmpq %rdx, (%rax)
jle 0x32d3
jmp 0x32f3
leaq 0x800b(%rip), %rcx      # 0xb2f8
xorl %eax, %eax
jmp 0x32f7
xorl %eax, %eax
addq $0x28, %rcx
movq %rax, 0x28(%rbx)
movq %rbx, (%rcx)
movq 0x7feb(%rip), %rdi      # 0xb2f0
movq 0x7fec(%rip), %rax      # 0xb2f8
movq (%rax), %rdx
xorl %esi, %esi
callq 0x6394
cmpl $0x0, 0x8(%rbx)
je 0x35dd
movb 0x7ea1(%rip), %r12b     # 0xb1c8
leaq 0x41d(%rbp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x20c0
decl %eax
movl %eax, (%rbp)
testb %r12b, %r12b
je 0x34e4
movq (%rsp), %r13
leaq 0x41d(%r13), %r12
movq %r12, %rdi
callq 0x20c0
decl %eax
movl %eax, (%r13)
leaq 0x101d(%rbp), %rax
cmpb $0xa, 0x1d(%rbp)
je 0x337c
movb -0xfff(%rax), %cl
movb %cl, (%rax)
incq %rax
cmpb $0xa, %cl
jne 0x336c
movb $0x0, (%rax)
movq (%rsp), %rcx
leaq 0x101d(%rcx), %rax
cmpb $0xa, 0x1d(%rcx)
je 0x33a0
movb -0xfff(%rax), %cl
movb %cl, (%rax)
incq %rax
cmpb $0xa, %cl
jne 0x3390
movb $0x0, (%rax)
movl 0x7e23(%rip), %eax      # 0xb1cc
cmpl %eax, (%rbp)
jl 0x35dd
movq (%rsp), %rcx
cmpl %eax, (%rcx)
jl 0x35dd
movq %r12, 0x10(%rsp)
movq %r14, %rdi
callq 0x3bcb
movq %r15, %r13
incl (%r15)
movslq (%rbp), %rax
movq (%rsp), %r12
movslq (%r12), %rcx
addq %rax, %rcx
addq %rcx, 0x8(%r15)
movq %r14, %rdi
callq 0x3c49
movl 0x7dda(%rip), %eax      # 0xb1cc
movl %eax, (%rbp)
movl %eax, (%r12)
movq %r14, %rdi
callq 0x3d2d
testb %al, %al
je 0x35d3
movq %r14, %rdi
callq 0x3dc6
cvtsi2ssl 0x14(%rbp), %xmm1
movss 0x7dca(%rip), %xmm0     # 0xb1e8
ucomiss %xmm0, %xmm1
jae 0x35c7
movq (%rsp), %rax
xorps %xmm1, %xmm1
cvtsi2ssl 0x14(%rax), %xmm1
ucomiss %xmm0, %xmm1
jae 0x35c7
xorps %xmm1, %xmm1
cvtsi2ssl 0x18(%rbp), %xmm1
movss 0x7da0(%rip), %xmm0     # 0xb1ec
ucomiss %xmm0, %xmm1
jae 0x35d9
movq (%rsp), %rax
xorps %xmm1, %xmm1
cvtsi2ssl 0x18(%rax), %xmm1
ucomiss %xmm0, %xmm1
jae 0x35d9
movl 0x7d87(%rip), %r12d     # 0xb1f8
movq 0x8(%rsp), %rdi
movl %r12d, %esi
callq 0x4013
testb %al, %al
jne 0x3493
movq 0x10(%rsp), %rdi
movl %r12d, %esi
callq 0x4013
testb %al, %al
je 0x3497
incl 0x6c(%r15)
xorps %xmm1, %xmm1
cvtsi2ssl 0x10(%rbp), %xmm1
movss 0x7d4d(%rip), %xmm0     # 0xb1f4
ucomiss %xmm0, %xmm1
jae 0x34bd
movq (%rsp), %rax
xorps %xmm1, %xmm1
cvtsi2ssl 0x10(%rax), %xmm1
ucomiss %xmm0, %xmm1
jb 0x34c1
incl 0x64(%r15)
cmpb $0x0, 0x1c(%rbp)
jne 0x34d1
movq (%rsp), %rax
cmpb $0x0, 0x1c(%rax)
je 0x34d5
incl 0x5c(%r15)
movq (%rsp), %rax
movl 0x4(%rax), %eax
addl 0x4(%rbp), %eax
jmp 0x35a8
leaq 0x101d(%rbp), %rax
cmpb $0xa, 0x1d(%rbp)
je 0x3501
movb -0xfff(%rax), %cl
movb %cl, (%rax)
incq %rax
cmpb $0xa, %cl
jne 0x34f1
movb $0x0, (%rax)
movl (%rbp), %eax
cmpl 0x7cbf(%rip), %eax      # 0xb1cc
jl 0x35dd
movq %r14, %rdi
callq 0x3bcb
incl (%r15)
movslq (%rbp), %rax
addq %rax, 0x8(%r15)
movq %r14, %rdi
callq 0x3c49
movl 0x7c98(%rip), %eax      # 0xb1cc
movl %eax, (%rbp)
movq %r14, %rdi
callq 0x3d2d
testb %al, %al
je 0x35cd
movq %r14, %rdi
callq 0x3dc6
cvtsi2ssl 0x14(%rbp), %xmm0
ucomiss 0x7c8d(%rip), %xmm0     # 0xb1e8
jae 0x35c7
xorps %xmm0, %xmm0
cvtsi2ssl 0x18(%rbp), %xmm0
ucomiss 0x7c80(%rip), %xmm0     # 0xb1ec
jae 0x35d9
movl 0x7c84(%rip), %esi      # 0xb1f8
movq 0x8(%rsp), %rdi
callq 0x4013
testb %al, %al
je 0x3586
incl 0x6c(%r15)
xorps %xmm0, %xmm0
cvtsi2ssl 0x10(%rbp), %xmm0
ucomiss 0x7c5f(%rip), %xmm0     # 0xb1f4
jb 0x359b
incl 0x64(%r15)
cmpb $0x0, 0x1c(%rbp)
je 0x35a5
incl 0x5c(%r15)
movl 0x4(%rbp), %eax
cltq
addq %rax, 0x50(%r15)
incl 0x10(%r15)
movq %r14, %rdi
callq 0x4074
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4281
jmp 0x35dd
incl 0x24(%r15)
jmp 0x35dd
incl 0x34(%r15)
jmp 0x35dd
incl 0x34(%r13)
jmp 0x35dd
incl 0x2c(%r15)
movq %rbx, %rdi
callq 0x6188
movq 0x7cf4(%rip), %rdi      # 0xb2e0
callq 0x6265
movq 0x7ce8(%rip), %rdi      # 0xb2e0
movl $0x1, %esi
xorl %edx, %edx
callq 0x63cb
movq 0x7cdd(%rip), %rbx      # 0xb2e8
cmpq $-0x1, (%rbx)
jne 0x3240
movq 0x7cc4(%rip), %rdi      # 0xb2e0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6276