// File: /workspace/github_c_makefile_star2_O0/annoroad[P]fqtools_plus/fqtools.c
// Function: single_filter_main
void single_filter_main(void){
    new_pool(&in_pool, -1);
	struct job* job = new_job();
	job->in = get_space(&in_pool);
	in_pool.head = job->in;
	struct readclass* readclass = job->in->readclass;
	struct readline* read1 = readclass->read1;
	struct readline* read2 = readclass->read2;
	struct STAT* stat = readclass->stat;

	for(;;){
		if (!readn(job->in)) break;
		if (g.outraw){
			to_buffer_raw(readclass,job);
			fwrite(job->buffer1_raw,sizeof(char),job->l1_r,g.fpout1_raw);
			if (g.single_or_pair) fwrite(job->buffer2_raw,sizeof(char),job->l2_r,g.fpout2_raw);
		}

		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) {
				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++;
				continue;
			}
			quality_base_percent(readclass);
			if (read1->low >= g.LOW_QUALITY || read2->low >= g.LOW_QUALITY){
				stat->low_quality_reads++;
				continue;
			}
			if (read1->N >= g.highN || read2->N >= g.highN){
			    stat->ns_reads++;
				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) {
				continue;
			}
			raw_Q30(readclass);
			stat->raw_reads++;
			stat->raw_bases+= read1->seqlen;
			cutseq(readclass);
			read1->seqlen = g.CUT;
			if (!checkadapter(readclass)){
				stat->adapter_reads++;
				continue;
			}
			quality_base_percent(readclass);
			if (read1->low >= g.LOW_QUALITY){
				stat->low_quality_reads++;
				continue;
			}
			if (read1->N >= g.highN){
			    stat->ns_reads++;
				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);
		fwrite(job->buffer1,sizeof(char),job->l1,g.fpout1);
		if (g.single_or_pair) fwrite(job->buffer2,sizeof(char),job->l2,g.fpout2);
		if (stat->clean_reads == g.QUOTA) break;
	}


	if (g.outraw){
		possess(job->calc);
		twist(job->calc,TO,1);	
	}

	gzclose(g.gzfp1);
    if (g.single_or_pair) gzclose(g.gzfp2);
    fclose(g.fpout1);
    if (g.single_or_pair) fclose(g.fpout2);
    if (g.outraw){
    	fclose(g.fpout1_raw);
	    if (g.single_or_pair) fclose(g.fpout2_raw);
    }

	if (job != NULL) free_job(job);
	merge_stat(&in_pool);
	free_pool(&in_pool);
}

// Assembly:
subq $0x28, %rsp
leaq 0x9c3d(%rip), %rdi      # 0xd2d8
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x3cf0
callq 0x2c10
movq %rax, 0x20(%rsp)
leaq 0x9c22(%rip), %rdi      # 0xd2d8
callq 0x2c90
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x9c09(%rip)      # 0xd2e0
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)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, (%rsp)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x2d80
cmpl $0x0, %eax
jne 0x3729
jmp 0x3c1d
cmpb $0x0, 0x9ae4(%rip)      # 0xd214
je 0x3792
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x3d40
movq 0x20(%rsp), %rax
movq 0x50(%rax), %rdi
movq 0x20(%rsp), %rax
movslq 0x58(%rax), %rdx
movq 0x9b56(%rip), %rcx      # 0xd2b0
movl $0x1, %esi
callq 0x22b0
cmpb $0x0, 0x9a6d(%rip)      # 0xd1d8
je 0x3790
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rdi
movq 0x20(%rsp), %rax
movslq 0x68(%rax), %rdx
movq 0x9b32(%rip), %rcx      # 0xd2b8
movl $0x1, %esi
callq 0x22b0
jmp 0x3792
cmpb $0x0, 0x9a3f(%rip)      # 0xd1d8
je 0x3a14
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 0x99b8(%rip), %eax      # 0xd1dc
jl 0x3835
movq 0x8(%rsp), %rax
movl (%rax), %eax
cmpl 0x99a9(%rip), %eax      # 0xd1dc
jge 0x383a
jmp 0x3711
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 0x9960(%rip), %ecx      # 0xd1dc
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
movl 0x9953(%rip), %ecx      # 0xd1dc
movq 0x8(%rsp), %rax
movl %ecx, (%rax)
movq 0x18(%rsp), %rdi
callq 0x4220
cmpb $0x0, %al
jne 0x38b0
movq (%rsp), %rax
movl 0x34(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x34(%rax)
jmp 0x3711
movq 0x18(%rsp), %rdi
callq 0x4360
movq 0x10(%rsp), %rax
cvtsi2ssl 0x14(%rax), %xmm0
ucomiss 0x992d(%rip), %xmm0     # 0xd1f8
jae 0x38e0
movq 0x8(%rsp), %rax
cvtsi2ssl 0x14(%rax), %xmm0
ucomiss 0x991a(%rip), %xmm0     # 0xd1f8
jb 0x38f2
movq (%rsp), %rax
movl 0x24(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x24(%rax)
jmp 0x3711
movq 0x10(%rsp), %rax
cvtsi2ssl 0x18(%rax), %xmm0
ucomiss 0x98f9(%rip), %xmm0     # 0xd1fc
jae 0x3918
movq 0x8(%rsp), %rax
cvtsi2ssl 0x18(%rax), %xmm0
ucomiss 0x98e6(%rip), %xmm0     # 0xd1fc
jb 0x392a
movq (%rsp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x3711
movq 0x10(%rsp), %rdi
addq $0x1d, %rdi
addq $0x400, %rdi            # imm = 0x400
movl 0x98c8(%rip), %esi      # 0xd208
callq 0x4790
movsbl %al, %eax
cmpl $0x0, %eax
jne 0x3970
movq 0x8(%rsp), %rdi
addq $0x1d, %rdi
addq $0x400, %rdi            # imm = 0x400
movl 0x98a5(%rip), %esi      # 0xd208
callq 0x4790
movsbl %al, %eax
cmpl $0x0, %eax
je 0x397d
movq (%rsp), %rax
movl 0x6c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x6c(%rax)
movq 0x10(%rsp), %rax
cvtsi2ssl 0x10(%rax), %xmm0
ucomiss 0x9876(%rip), %xmm0     # 0xd204
jae 0x39a3
movq 0x8(%rsp), %rax
cvtsi2ssl 0x10(%rax), %xmm0
ucomiss 0x9863(%rip), %xmm0     # 0xd204
jb 0x39b0
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 0x39cc
movq 0x8(%rsp), %rax
movsbl 0x1c(%rax), %eax
cmpl $0x0, %eax
je 0x39d9
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 0x3ba8
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 0x977f(%rip), %eax      # 0xd1dc
jge 0x3a64
jmp 0x3711
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 0x973f(%rip), %ecx      # 0xd1dc
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
movq 0x18(%rsp), %rdi
callq 0x4220
cmpb $0x0, %al
jne 0x3ac4
movq (%rsp), %rax
movl 0x34(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x34(%rax)
jmp 0x3711
movq 0x18(%rsp), %rdi
callq 0x4360
movq 0x10(%rsp), %rax
cvtsi2ssl 0x14(%rax), %xmm0
ucomiss 0x9719(%rip), %xmm0     # 0xd1f8
jb 0x3af3
movq (%rsp), %rax
movl 0x24(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x24(%rax)
jmp 0x3711
movq 0x10(%rsp), %rax
cvtsi2ssl 0x18(%rax), %xmm0
ucomiss 0x96f8(%rip), %xmm0     # 0xd1fc
jb 0x3b18
movq (%rsp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x3711
movq 0x10(%rsp), %rdi
addq $0x1d, %rdi
addq $0x400, %rdi            # imm = 0x400
movl 0x96da(%rip), %esi      # 0xd208
callq 0x4790
cmpb $0x0, %al
je 0x3b44
movq (%rsp), %rax
movl 0x6c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x6c(%rax)
movq 0x10(%rsp), %rax
cvtsi2ssl 0x10(%rax), %xmm0
ucomiss 0x96af(%rip), %xmm0     # 0xd204
jb 0x3b64
movq (%rsp), %rax
movl 0x64(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x64(%rax)
movq 0x10(%rsp), %rax
cmpb $0x0, 0x1c(%rax)
je 0x3b7c
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), %rax
movq 0x30(%rax), %rdi
movq 0x20(%rsp), %rax
movslq 0x38(%rax), %rdx
movq 0x96d0(%rip), %rcx      # 0xd2a0
movl $0x1, %esi
callq 0x22b0
cmpb $0x0, 0x95f7(%rip)      # 0xd1d8
je 0x3c06
movq 0x20(%rsp), %rax
movq 0x40(%rax), %rdi
movq 0x20(%rsp), %rax
movslq 0x48(%rax), %rdx
movq 0x96ac(%rip), %rcx      # 0xd2a8
movl $0x1, %esi
callq 0x22b0
movq (%rsp), %rax
movl 0x10(%rax), %eax
cmpq 0x95d4(%rip), %rax      # 0xd1e8
jne 0x3c18
jmp 0x3c1d
jmp 0x3711
cmpb $0x0, 0x95f0(%rip)      # 0xd214
je 0x3c49
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x8040
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x8280
movq 0x9640(%rip), %rdi      # 0xd290
callq 0x2030
cmpb $0x0, 0x957c(%rip)      # 0xd1d8
je 0x3c6a
movq 0x9633(%rip), %rdi      # 0xd298
callq 0x2030
movq 0x962f(%rip), %rdi      # 0xd2a0
callq 0x20b0
cmpb $0x0, 0x955b(%rip)      # 0xd1d8
je 0x3c8b
movq 0x9622(%rip), %rdi      # 0xd2a8
callq 0x20b0
cmpb $0x0, 0x9582(%rip)      # 0xd214
je 0x3cb7
movq 0x9615(%rip), %rdi      # 0xd2b0
callq 0x20b0
cmpb $0x0, 0x9531(%rip)      # 0xd1d8
je 0x3cb5
movq 0x9608(%rip), %rdi      # 0xd2b8
callq 0x20b0
jmp 0x3cb7
cmpq $0x0, 0x20(%rsp)
je 0x3cc9
movq 0x20(%rsp), %rdi
callq 0x2730
leaq 0x9608(%rip), %rdi      # 0xd2d8
callq 0x4ec0
leaq 0x95fc(%rip), %rdi      # 0xd2d8
callq 0x51c0
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)