// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq 0xa333(%rip), %rdi      # 0xd2f0
callq 0x8040
movq 0xa327(%rip), %rdi      # 0xd2f0
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x8310
movq 0xa31a(%rip), %rax      # 0xd2f8
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq $-0x1, (%rax)
jne 0x2ff3
jmp 0x353a
movq 0x20(%rsp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x300f
leaq 0xa2f2(%rip), %rax      # 0xd2f8
movq %rax, 0xa303(%rip)      # 0xd310
jmp 0x301f
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0xa2d9(%rip)      # 0xd2f8
movq 0xa2ca(%rip), %rdi      # 0xd2f0
movl $0x1, %esi
movq $-0x1, %rdx
callq 0x8280
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
cmpb $0x0, 0xa17b(%rip)      # 0xd1d8
je 0x306d
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, (%rsp)
cmpb $0x0, 0xa193(%rip)      # 0xd214
je 0x309c
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x3d40
movq 0x20(%rsp), %rdi
callq 0x7a60
movq 0x20(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x30b6
movq 0x20(%rsp), %rdi
callq 0x7af0
jmp 0x2fb6
cmpb $0x0, 0xa11b(%rip)      # 0xd1d8
je 0x3360
movq 0x10(%rsp), %rdi
addq $0x1d, %rdi
addq $0x400, %rdi            # imm = 0x400
callq 0x20c0
subq $0x1, %rax
movl %eax, %ecx
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
movq 0x8(%rsp), %rdi
addq $0x1d, %rdi
addq $0x400, %rdi            # imm = 0x400
callq 0x20c0
subq $0x1, %rax
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, (%rax)
movq 0x10(%rsp), %rdi
addq $0x1d, %rdi
movq 0x10(%rsp), %rsi
addq $0x101d, %rsi           # imm = 0x101D
callq 0x3f20
movq 0x8(%rsp), %rdi
addq $0x1d, %rdi
movq 0x8(%rsp), %rsi
addq $0x101d, %rsi           # imm = 0x101D
callq 0x3f20
movq 0x10(%rsp), %rax
movl (%rax), %eax
cmpl 0xa094(%rip), %eax      # 0xd1dc
jl 0x3159
movq 0x8(%rsp), %rax
movl (%rax), %eax
cmpl 0xa085(%rip), %eax      # 0xd1dc
jge 0x3168
movq 0x20(%rsp), %rdi
callq 0x7af0
jmp 0x2fb6
movq 0x18(%rsp), %rdi
callq 0x3f70
movq (%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq 0x10(%rsp), %rax
movl (%rax), %eax
movq 0x8(%rsp), %rcx
addl (%rcx), %eax
movslq %eax, %rcx
movq (%rsp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rdi
callq 0x4080
movl 0xa032(%rip), %ecx      # 0xd1dc
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
movl 0xa025(%rip), %ecx      # 0xd1dc
movq 0x8(%rsp), %rax
movl %ecx, (%rax)
movq 0x18(%rsp), %rdi
callq 0x4220
cmpb $0x0, %al
jne 0x31e8
movq (%rsp), %rax
movl 0x34(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x34(%rax)
movq 0x20(%rsp), %rdi
callq 0x7af0
jmp 0x2fb6
movq 0x18(%rsp), %rdi
callq 0x4360
movq 0x10(%rsp), %rax
cvtsi2ssl 0x14(%rax), %xmm0
ucomiss 0x9ff5(%rip), %xmm0     # 0xd1f8
jae 0x3218
movq 0x8(%rsp), %rax
cvtsi2ssl 0x14(%rax), %xmm0
ucomiss 0x9fe2(%rip), %xmm0     # 0xd1f8
jb 0x3234
movq (%rsp), %rax
movl 0x24(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x24(%rax)
movq 0x20(%rsp), %rdi
callq 0x7af0
jmp 0x2fb6
movq 0x10(%rsp), %rax
cvtsi2ssl 0x18(%rax), %xmm0
ucomiss 0x9fb7(%rip), %xmm0     # 0xd1fc
jae 0x325a
movq 0x8(%rsp), %rax
cvtsi2ssl 0x18(%rax), %xmm0
ucomiss 0x9fa4(%rip), %xmm0     # 0xd1fc
jb 0x3276
movq (%rsp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
movq 0x20(%rsp), %rdi
callq 0x7af0
jmp 0x2fb6
movq 0x10(%rsp), %rdi
addq $0x1d, %rdi
addq $0x400, %rdi            # imm = 0x400
movl 0x9f7c(%rip), %esi      # 0xd208
callq 0x4790
movsbl %al, %eax
cmpl $0x0, %eax
jne 0x32bc
movq 0x8(%rsp), %rdi
addq $0x1d, %rdi
addq $0x400, %rdi            # imm = 0x400
movl 0x9f59(%rip), %esi      # 0xd208
callq 0x4790
movsbl %al, %eax
cmpl $0x0, %eax
je 0x32c9
movq (%rsp), %rax
movl 0x6c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x6c(%rax)
movq 0x10(%rsp), %rax
cvtsi2ssl 0x10(%rax), %xmm0
ucomiss 0x9f2a(%rip), %xmm0     # 0xd204
jae 0x32ef
movq 0x8(%rsp), %rax
cvtsi2ssl 0x10(%rax), %xmm0
ucomiss 0x9f17(%rip), %xmm0     # 0xd204
jb 0x32fc
movq (%rsp), %rax
movl 0x64(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x64(%rax)
movq 0x10(%rsp), %rax
movsbl 0x1c(%rax), %eax
cmpl $0x0, %eax
jne 0x3318
movq 0x8(%rsp), %rax
movsbl 0x1c(%rax), %eax
cmpl $0x0, %eax
je 0x3325
movq (%rsp), %rax
movl 0x5c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x5c(%rax)
movq 0x10(%rsp), %rax
movl 0x4(%rax), %eax
movq 0x8(%rsp), %rcx
addl 0x4(%rcx), %eax
movslq %eax, %rcx
movq (%rsp), %rax
addq 0x50(%rax), %rcx
movq %rcx, 0x50(%rax)
movq (%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq 0x18(%rsp), %rdi
callq 0x4890
jmp 0x351c
movq 0x10(%rsp), %rdi
addq $0x1d, %rdi
addq $0x400, %rdi            # imm = 0x400
callq 0x20c0
subq $0x1, %rax
movl %eax, %ecx
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
movq 0x10(%rsp), %rdi
addq $0x1d, %rdi
movq 0x10(%rsp), %rsi
addq $0x101d, %rsi           # imm = 0x101D
callq 0x3f20
movq 0x10(%rsp), %rax
movl (%rax), %eax
cmpl 0x9e33(%rip), %eax      # 0xd1dc
jge 0x33ba
movq 0x20(%rsp), %rdi
callq 0x7af0
jmp 0x2fb6
movq 0x18(%rsp), %rdi
callq 0x3f70
movq (%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq 0x10(%rsp), %rax
movslq (%rax), %rcx
movq (%rsp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rdi
callq 0x4080
movl 0x9de9(%rip), %ecx      # 0xd1dc
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
movq 0x18(%rsp), %rdi
callq 0x4220
cmpb $0x0, %al
jne 0x3424
movq (%rsp), %rax
movl 0x34(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x34(%rax)
movq 0x20(%rsp), %rdi
callq 0x7af0
jmp 0x2fb6
movq 0x18(%rsp), %rdi
callq 0x4360
movq 0x10(%rsp), %rax
cvtsi2ssl 0x14(%rax), %xmm0
ucomiss 0x9db9(%rip), %xmm0     # 0xd1f8
jb 0x345d
movq (%rsp), %rax
movl 0x24(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x24(%rax)
movq 0x20(%rsp), %rdi
callq 0x7af0
jmp 0x2fb6
movq 0x10(%rsp), %rax
cvtsi2ssl 0x18(%rax), %xmm0
ucomiss 0x9d8e(%rip), %xmm0     # 0xd1fc
jb 0x348c
movq (%rsp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
movq 0x20(%rsp), %rdi
callq 0x7af0
jmp 0x2fb6
movq 0x10(%rsp), %rdi
addq $0x1d, %rdi
addq $0x400, %rdi            # imm = 0x400
movl 0x9d66(%rip), %esi      # 0xd208
callq 0x4790
cmpb $0x0, %al
je 0x34b8
movq (%rsp), %rax
movl 0x6c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x6c(%rax)
movq 0x10(%rsp), %rax
cvtsi2ssl 0x10(%rax), %xmm0
ucomiss 0x9d3b(%rip), %xmm0     # 0xd204
jb 0x34d8
movq (%rsp), %rax
movl 0x64(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x64(%rax)
movq 0x10(%rsp), %rax
cmpb $0x0, 0x1c(%rax)
je 0x34f0
movq (%rsp), %rax
movl 0x5c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x5c(%rax)
movq 0x10(%rsp), %rax
movslq 0x4(%rax), %rcx
movq (%rsp), %rax
addq 0x50(%rax), %rcx
movq %rcx, 0x50(%rax)
movq (%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq 0x18(%rsp), %rdi
callq 0x4890
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x4d10
movq 0x20(%rsp), %rdi
callq 0x7af0
jmp 0x2fb6
movq 0x9daf(%rip), %rdi      # 0xd2f0
callq 0x8080
addq $0x28, %rsp
retq
nopl (%rax,%rax)