// File: /workspace/github_c_makefile_star2_O1/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 0x80b6(%rip), %rdi      # 0xb2d8
callq 0x6275
movq 0x80aa(%rip), %rdi      # 0xb2d8
movl $0x1, %esi
xorl %edx, %edx
callq 0x63db
movq 0x809f(%rip), %rbx      # 0xb2e0
cmpq $-0x1, (%rbx)
je 0x3623
movq $0x0, (%rsp)
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x3265
movq %rax, 0x807d(%rip)      # 0xb2e0
jmp 0x3273
leaq 0x8074(%rip), %rax      # 0xb2e0
movq %rax, 0x8085(%rip)      # 0xb2f8
movq 0x805e(%rip), %rdi      # 0xb2d8
movl $0x1, %esi
movq $-0x1, %rdx
callq 0x63a4
movq 0x10(%rbx), %rax
movq 0x8(%rax), %r14
movq (%r14), %rbp
cmpb $0x0, 0x7f23(%rip)      # 0xb1c0
je 0x32a7
movq 0x8(%r14), %rax
movq %rax, (%rsp)
movq 0x10(%r14), %r13
cmpb $0x0, 0x7f4a(%rip)      # 0xb1fc
je 0x3323
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3b2e
movq 0x8022(%rip), %rdi      # 0xb2e8
callq 0x6275
movq 0x801e(%rip), %rax      # 0xb2f0
testq %rax, %rax
je 0x32fd
movq (%rbx), %rdx
leaq 0x800f(%rip), %rcx      # 0xb2f0
cmpq %rdx, (%rax)
jg 0x3304
movq %rax, %rcx
movq 0x28(%rax), %rax
testq %rax, %rax
je 0x32f7
cmpq %rdx, (%rax)
jle 0x32e6
addq $0x28, %rcx
jmp 0x3304
leaq 0x7fec(%rip), %rcx      # 0xb2f0
movq %rax, 0x28(%rbx)
movq %rbx, (%rcx)
movq 0x7fd6(%rip), %rdi      # 0xb2e8
movq 0x7fd7(%rip), %rax      # 0xb2f0
movq (%rax), %rdx
xorl %esi, %esi
callq 0x63a4
cmpl $0x0, 0x8(%rbx)
je 0x35eb
movb 0x7e8c(%rip), %r12b     # 0xb1c0
leaq 0x41d(%rbp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x20c0
decl %eax
movl %eax, (%rbp)
testb %r12b, %r12b
je 0x34f1
movq (%rsp), %r15
leaq 0x41d(%r15), %r12
movq %r12, %rdi
callq 0x20c0
decl %eax
movl %eax, (%r15)
leaq 0x101d(%rbp), %rax
cmpb $0xa, 0x1d(%rbp)
je 0x3388
movb -0xfff(%rax), %cl
movb %cl, (%rax)
incq %rax
cmpb $0xa, %cl
jne 0x3378
movb $0x0, (%rax)
movq (%rsp), %rcx
leaq 0x101d(%rcx), %rax
cmpb $0xa, 0x1d(%rcx)
je 0x33ac
movb -0xfff(%rax), %cl
movb %cl, (%rax)
incq %rax
cmpb $0xa, %cl
jne 0x339c
movb $0x0, (%rax)
movl 0x7e0f(%rip), %eax      # 0xb1c4
cmpl %eax, (%rbp)
jl 0x35eb
movq (%rsp), %rcx
cmpl %eax, (%rcx)
jl 0x35eb
movq %r12, 0x10(%rsp)
movq %r14, %rdi
callq 0x3c14
movq %r13, %r15
incl (%r13)
movslq (%rbp), %rax
movq (%rsp), %r12
movslq (%r12), %rcx
addq %rax, %rcx
addq %rcx, 0x8(%r13)
movq %r14, %rdi
callq 0x3c92
movl 0x7dc5(%rip), %eax      # 0xb1c4
movl %eax, (%rbp)
movl %eax, (%r12)
movq %r14, %rdi
callq 0x3d76
testb %al, %al
je 0x35e1
movq %r14, %rdi
callq 0x3e0f
cvtsi2ssl 0x14(%rbp), %xmm1
movss 0x7db5(%rip), %xmm0     # 0xb1e0
ucomiss %xmm0, %xmm1
jae 0x35d5
movq (%rsp), %rax
xorps %xmm1, %xmm1
cvtsi2ssl 0x14(%rax), %xmm1
ucomiss %xmm0, %xmm1
jae 0x35d5
xorps %xmm1, %xmm1
cvtsi2ssl 0x18(%rbp), %xmm1
movss 0x7d8b(%rip), %xmm0     # 0xb1e4
ucomiss %xmm0, %xmm1
jae 0x35e7
movq (%rsp), %rax
xorps %xmm1, %xmm1
cvtsi2ssl 0x18(%rax), %xmm1
ucomiss %xmm0, %xmm1
jae 0x35e7
movl 0x7d72(%rip), %r15d     # 0xb1f0
movq 0x8(%rsp), %rdi
movl %r15d, %esi
callq 0x3ffa
testb %al, %al
jne 0x34a0
movq 0x10(%rsp), %rdi
movl %r15d, %esi
callq 0x3ffa
testb %al, %al
je 0x34a4
incl 0x6c(%r13)
xorps %xmm1, %xmm1
cvtsi2ssl 0x10(%rbp), %xmm1
movss 0x7d38(%rip), %xmm0     # 0xb1ec
ucomiss %xmm0, %xmm1
jae 0x34ca
movq (%rsp), %rax
xorps %xmm1, %xmm1
cvtsi2ssl 0x10(%rax), %xmm1
ucomiss %xmm0, %xmm1
jb 0x34ce
incl 0x64(%r13)
cmpb $0x0, 0x1c(%rbp)
jne 0x34de
movq (%rsp), %rax
cmpb $0x0, 0x1c(%rax)
je 0x34e2
incl 0x5c(%r13)
movq (%rsp), %rax
movl 0x4(%rax), %eax
addl 0x4(%rbp), %eax
jmp 0x35b6
leaq 0x101d(%rbp), %rax
cmpb $0xa, 0x1d(%rbp)
je 0x350e
movb -0xfff(%rax), %cl
movb %cl, (%rax)
incq %rax
cmpb $0xa, %cl
jne 0x34fe
movb $0x0, (%rax)
movl (%rbp), %eax
cmpl 0x7caa(%rip), %eax      # 0xb1c4
jl 0x35eb
movq %r14, %rdi
callq 0x3c14
incl (%r13)
movslq (%rbp), %rax
addq %rax, 0x8(%r13)
movq %r14, %rdi
callq 0x3c92
movl 0x7c82(%rip), %eax      # 0xb1c4
movl %eax, (%rbp)
movq %r14, %rdi
callq 0x3d76
testb %al, %al
je 0x35db
movq %r14, %rdi
callq 0x3e0f
cvtsi2ssl 0x14(%rbp), %xmm0
ucomiss 0x7c77(%rip), %xmm0     # 0xb1e0
jae 0x35d5
xorps %xmm0, %xmm0
cvtsi2ssl 0x18(%rbp), %xmm0
ucomiss 0x7c6a(%rip), %xmm0     # 0xb1e4
jae 0x35e7
movl 0x7c6e(%rip), %esi      # 0xb1f0
movq 0x8(%rsp), %rdi
callq 0x3ffa
testb %al, %al
je 0x3594
incl 0x6c(%r13)
xorps %xmm0, %xmm0
cvtsi2ssl 0x10(%rbp), %xmm0
ucomiss 0x7c49(%rip), %xmm0     # 0xb1ec
jb 0x35a9
incl 0x64(%r13)
cmpb $0x0, 0x1c(%rbp)
je 0x35b3
incl 0x5c(%r13)
movl 0x4(%rbp), %eax
cltq
addq %rax, 0x50(%r13)
incl 0x10(%r13)
movq %r14, %rdi
callq 0x407c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x428d
jmp 0x35eb
incl 0x24(%r13)
jmp 0x35eb
incl 0x34(%r13)
jmp 0x35eb
incl 0x34(%r15)
jmp 0x35eb
incl 0x2c(%r13)
movq %rbx, %rdi
callq 0x619d
movq 0x7cde(%rip), %rdi      # 0xb2d8
callq 0x6275
movq 0x7cd2(%rip), %rdi      # 0xb2d8
movl $0x1, %esi
xorl %edx, %edx
callq 0x63db
movq 0x7cc7(%rip), %rbx      # 0xb2e0
cmpq $-0x1, (%rbx)
jne 0x3253
movq 0x7cae(%rip), %rdi      # 0xb2d8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6286