// File: /workspace/github_c_makefile_star2_O0/annoroad[P]fqtools_plus/fqtools.c
// Function: prepare
local void prepare(void){
	char line[1024];
	g.gzfp1 = NULL;
	g.gzfp2 = NULL;
	g.gzfp1 = gzopen(g.fq1,"rb");
	if (g.single_or_pair) g.gzfp2 = gzopen(g.fq2,"rb");
	g.fpout1 = NULL;
	g.fpout2 = NULL;
	if ((g.fpout1 = fopen(g.outfq1,"w")) == NULL){
		fprintf(stderr, "%s can not open\n", g.outfq1);
		exit(0);
	}
	if (g.single_or_pair) {
		if ((g.fpout2 = fopen(g.outfq2,"w")) == NULL){
			fprintf(stderr, "%s can not open\n", g.outfq2);
			exit(0);
		}	
	}

	
	if (gzgets(g.gzfp1,line,1024)==NULL){
		exit(0);
	}
	if (gzgets(g.gzfp1,line,1024)==NULL){
		exit(0);
	}
	int readlen = strlen(line)-1-g.start;

	if (g.CUT == 0){
		g.CUT = readlen;
	}else{
		if (readlen < g.CUT){
			g.CUT = readlen;
		}
	}
	if (g.start + g.CUT > strlen(line)){
		fprintf(stderr, "start: %d  CUT: %d range out seqlen: %d\n", g.start, g.CUT, (int)strlen(line)-1);
		exit(0);
	}
	if (g.QUOTA == 0){
		g.QUOTA = LONG_MAX;
		g.outraw = 0;
	}else{
		if (g.single_or_pair==0) g.QUOTA /= g.CUT;
		if (g.single_or_pair==1) g.QUOTA /= g.CUT*2;
		g.outraw = 1;
	}

	g.fpout1_raw = NULL;
	g.fpout2_raw = NULL;
	if (g.outraw){
		if ((g.fpout1_raw = fopen(g.rawcutfq1,"w"))==NULL){
			fprintf(stderr, "%s can not open\n", g.rawcutfq1);
			exit(0);	
		}
		if (g.single_or_pair){
			if ((g.fpout2_raw = fopen(g.rawcutfq2,"w"))==NULL){

				fprintf(stderr, "%s can not open\n", g.rawcutfq2);
				exit(0);	
			}	
		}
	}


	g.LOW_QUALITY = g.LOW_QUALITY * g.CUT;
	g.highN = g.highN * g.CUT;
	g.highAT = g.highAT * g.CUT;
	g.highGC = g.highGC * g.CUT;
	gzseek(g.gzfp1,0L,SEEK_SET);
}

// Assembly:
subq $0x428, %rsp            # imm = 0x428
movq $0x0, 0x56fe(%rip) # 0xd290
movq $0x0, 0x56fb(%rip) # 0xd298
movq 0x56ac(%rip), %rdi      # 0xd250
leaq 0x3360(%rip), %rsi      # 0xaf0b
callq 0x2200
movq %rax, 0x56d9(%rip)      # 0xd290
cmpb $0x0, 0x561a(%rip)      # 0xd1d8
je 0x7bda
movq 0x5691(%rip), %rdi      # 0xd258
leaq 0x333d(%rip), %rsi      # 0xaf0b
callq 0x2200
movq %rax, 0x56be(%rip)      # 0xd298
movq $0x0, 0x56bb(%rip) # 0xd2a0
movq $0x0, 0x56b8(%rip) # 0xd2a8
movq 0x5669(%rip), %rdi      # 0xd260
leaq 0x28f7(%rip), %rsi      # 0xa4f5
callq 0x2250
movq %rax, 0x5696(%rip)      # 0xd2a0
cmpq $0x0, %rax
jne 0x7c36
movq 0x53e1(%rip), %rax      # 0xcff8
movq (%rax), %rdi
movq 0x563f(%rip), %rdx      # 0xd260
leaq 0x32e6(%rip), %rsi      # 0xaf0e
movb $0x0, %al
callq 0x2150
xorl %edi, %edi
callq 0x22a0
cmpb $0x0, 0x559b(%rip)      # 0xd1d8
je 0x7c87
movq 0x5622(%rip), %rdi      # 0xd268
leaq 0x28a8(%rip), %rsi      # 0xa4f5
callq 0x2250
movq %rax, 0x564f(%rip)      # 0xd2a8
cmpq $0x0, %rax
jne 0x7c85
movq 0x5392(%rip), %rax      # 0xcff8
movq (%rax), %rdi
movq 0x55f8(%rip), %rdx      # 0xd268
leaq 0x3297(%rip), %rsi      # 0xaf0e
movb $0x0, %al
callq 0x2150
xorl %edi, %edi
callq 0x22a0
jmp 0x7c87
movq 0x5602(%rip), %rdi      # 0xd290
leaq 0x20(%rsp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x2080
cmpq $0x0, %rax
jne 0x7caa
xorl %edi, %edi
callq 0x22a0
movq 0x55df(%rip), %rdi      # 0xd290
leaq 0x20(%rsp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x2080
cmpq $0x0, %rax
jne 0x7ccd
xorl %edi, %edi
callq 0x22a0
leaq 0x20(%rsp), %rdi
callq 0x20c0
subq $0x1, %rax
movslq 0x54fe(%rip), %rcx      # 0xd1e0
subq %rcx, %rax
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x54ec(%rip)      # 0xd1dc
jne 0x7cfe
movl 0x1c(%rsp), %eax
movl %eax, 0x54e0(%rip)      # 0xd1dc
jmp 0x7d16
movl 0x1c(%rsp), %eax
cmpl 0x54d4(%rip), %eax      # 0xd1dc
jge 0x7d14
movl 0x1c(%rsp), %eax
movl %eax, 0x54c8(%rip)      # 0xd1dc
jmp 0x7d16
movl 0x54c4(%rip), %eax      # 0xd1e0
addl 0x54ba(%rip), %eax      # 0xd1dc
cltq
movq %rax, 0x10(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x20c0
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
jbe 0x7d94
movq 0x52b1(%rip), %rax      # 0xcff8
movq (%rax), %rax
movq %rax, (%rsp)
movl 0x548c(%rip), %eax      # 0xd1e0
movl %eax, 0x8(%rsp)
movl 0x547e(%rip), %eax      # 0xd1dc
movl %eax, 0xc(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x20c0
movq (%rsp), %rdi
movl 0x8(%rsp), %edx
movl 0xc(%rsp), %ecx
movl %eax, %r8d
subl $0x1, %r8d
leaq 0x3199(%rip), %rsi      # 0xaf1f
movb $0x0, %al
callq 0x2150
xorl %edi, %edi
callq 0x22a0
cmpq $0x0, 0x544c(%rip)      # 0xd1e8
jne 0x7db8
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x5439(%rip)      # 0xd1e8
movb $0x0, 0x545e(%rip)      # 0xd214
jmp 0x7e0f
movzbl 0x5419(%rip), %eax      # 0xd1d8
cmpl $0x0, %eax
jne 0x7dde
movslq 0x5411(%rip), %rcx      # 0xd1dc
movq 0x5416(%rip), %rax      # 0xd1e8
cqto
idivq %rcx
movq %rax, 0x540a(%rip)      # 0xd1e8
movzbl 0x53f3(%rip), %eax      # 0xd1d8
cmpl $0x1, %eax
jne 0x7e08
movl 0x53ec(%rip), %eax      # 0xd1dc
shll %eax
movslq %eax, %rcx
movq 0x53ec(%rip), %rax      # 0xd1e8
cqto
idivq %rcx
movq %rax, 0x53e0(%rip)      # 0xd1e8
movb $0x1, 0x5405(%rip)      # 0xd214
movq $0x0, 0x5496(%rip) # 0xd2b0
movq $0x0, 0x5493(%rip) # 0xd2b8
cmpb $0x0, 0x53e8(%rip)      # 0xd214
je 0x7ecb
movq 0x5437(%rip), %rdi      # 0xd270
leaq 0x26b5(%rip), %rsi      # 0xa4f5
callq 0x2250
movq %rax, 0x5464(%rip)      # 0xd2b0
cmpq $0x0, %rax
jne 0x7e78
movq 0x519f(%rip), %rax      # 0xcff8
movq (%rax), %rdi
movq 0x540d(%rip), %rdx      # 0xd270
leaq 0x30a4(%rip), %rsi      # 0xaf0e
movb $0x0, %al
callq 0x2150
xorl %edi, %edi
callq 0x22a0
cmpb $0x0, 0x5359(%rip)      # 0xd1d8
je 0x7ec9
movq 0x53f0(%rip), %rdi      # 0xd278
leaq 0x2666(%rip), %rsi      # 0xa4f5
callq 0x2250
movq %rax, 0x541d(%rip)      # 0xd2b8
cmpq $0x0, %rax
jne 0x7ec7
movq 0x5150(%rip), %rax      # 0xcff8
movq (%rax), %rdi
movq 0x53c6(%rip), %rdx      # 0xd278
leaq 0x3055(%rip), %rsi      # 0xaf0e
movb $0x0, %al
callq 0x2150
xorl %edi, %edi
callq 0x22a0
jmp 0x7ec9
jmp 0x7ecb
movss 0x5325(%rip), %xmm0     # 0xd1f8
cvtsi2ssl 0x5301(%rip), %xmm1 # 0xd1dc
mulss %xmm1, %xmm0
movss %xmm0, 0x5311(%rip)     # 0xd1f8
movss 0x530d(%rip), %xmm0     # 0xd1fc
cvtsi2ssl 0x52e5(%rip), %xmm1 # 0xd1dc
mulss %xmm1, %xmm0
movss %xmm0, 0x52f9(%rip)     # 0xd1fc
movss 0x52f5(%rip), %xmm0     # 0xd200
cvtsi2ssl 0x52c9(%rip), %xmm1 # 0xd1dc
mulss %xmm1, %xmm0
movss %xmm0, 0x52e1(%rip)     # 0xd200
movss 0x52dd(%rip), %xmm0     # 0xd204
cvtsi2ssl 0x52ad(%rip), %xmm1 # 0xd1dc
mulss %xmm1, %xmm0
movss %xmm0, 0x52c9(%rip)     # 0xd204
movq 0x534e(%rip), %rdi      # 0xd290
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x20d0
addq $0x428, %rsp            # imm = 0x428
retq
nopw %cs:(%rax,%rax)
nop