// File: /workspace/github_c_makefile_star2_O0/annoroad[P]fqtools_plus/fqtools.c
// Function: outreport
local void outreport(unsigned int (*base)[5], unsigned int (*quality)[50],  const char* outfile){
	FILE* fp=fopen(outfile,"w");
	fprintf(fp,"#\tA\tT\tC\tG\tN");
	int m,n;
	long long total_base = (long long)allstat.clean_reads * g.CUT;
	unsigned int q30=0;
	unsigned int q20=0;
	unsigned int N=0;
	unsigned int GC=0;

	float GC_bias=0;
	float AT_bias=0;
	float cur_GC_bias=0;
	float cur_AT_bias=0;

	for (m=0;m<42;m++){
		fprintf(fp,"\t%d",m);
	}
	fprintf(fp,"\n");
	for (n=0;n<g.CUT;n++){
		GC += base[n][2] + base[n][3];
		N += base[n][4];
		fprintf(fp,"%d\t%u\t%u\t%u\t%u\t%u",n+1,base[n][0],base[n][1],base[n][2],base[n][3],base[n][4]);
		cur_AT_bias=1.0 * abs(base[n][0] - base[n][1])/allstat.clean_reads;
		cur_GC_bias=1.0 * abs(base[n][2] - base[n][3])/allstat.clean_reads;
		if (cur_AT_bias > AT_bias){
			AT_bias = cur_AT_bias;
		}
		if (cur_GC_bias > GC_bias){
			GC_bias = cur_GC_bias;
		}
		for (m=0;m<42;m++){
			fprintf(fp,"\t%d",quality[n][m]);
			if (m >= 20){
				q20 += quality[n][m];
			}
			if (m >= 30){
				q30 += quality[n][m];
			}
		}	
		fprintf(fp,"\n");
	}
	fprintf(fp, "#total_reads\t%d\n",allstat.clean_reads);
	fprintf(fp, "#total_base\t%lld\n", total_base);
	fprintf(fp, "#GC_bias(%%)\t%.3f\n",(float)100.0*GC_bias);
	fprintf(fp, "#AT_bias(%%)\t%.3f\n",(float)100.0*AT_bias);
	fprintf(fp, "#N_percent(%%)\t%.3f\n",(float)100.0*(long long)N/total_base);
	fprintf(fp, "#Q20(%%)\t%.3f\n",(float)100.0*(long long)q20/total_base);
	fprintf(fp, "#Q30(%%)\t%.3f\n",(float)100.0*(long long)q30/total_base);
	fprintf(fp, "#GC_percent(%%)\t%.3f\n",(float)100.0*(long long)GC/total_base);
	fclose(fp);
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movq 0x50(%rsp), %rdi
leaq 0x30a6(%rip), %rsi      # 0xa4f5
callq 0x2250
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
leaq 0x3d02(%rip), %rsi      # 0xb167
movb $0x0, %al
callq 0x2150
movl 0x5eb6(%rip), %eax      # 0xd328
movslq 0x5d63(%rip), %rcx      # 0xd1dc
imulq %rcx, %rax
movq %rax, 0x38(%rsp)
movl $0x0, 0x34(%rsp)
movl $0x0, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
movl $0x0, 0x28(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x24(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x20(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x1c(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
movl $0x0, 0x44(%rsp)
cmpl $0x2a, 0x44(%rsp)
jge 0x74f9
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %edx
leaq 0x3c8e(%rip), %rsi      # 0xb173
movb $0x0, %al
callq 0x2150
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x74ce
movq 0x48(%rsp), %rdi
leaq 0x3d32(%rip), %rsi      # 0xb237
movb $0x0, %al
callq 0x2150
movl $0x0, 0x40(%rsp)
movl 0x40(%rsp), %eax
cmpl 0x5cbe(%rip), %eax      # 0xd1dc
jge 0x771e
movq 0x60(%rsp), %rax
movslq 0x40(%rsp), %rcx
leaq (%rcx,%rcx,4), %rdx
movl 0x8(%rax,%rdx,4), %ecx
movl 0xc(%rax,%rdx,4), %eax
addl %eax, %ecx
movl 0x28(%rsp), %eax
addl %ecx, %eax
movl %eax, 0x28(%rsp)
movq 0x60(%rsp), %rax
movslq 0x40(%rsp), %rcx
leaq (%rcx,%rcx,4), %rcx
movl 0x10(%rax,%rcx,4), %ecx
movl 0x2c(%rsp), %eax
addl %ecx, %eax
movl %eax, 0x2c(%rsp)
movq 0x48(%rsp), %rdi
movslq 0x40(%rsp), %rcx
movl %ecx, %edx
incl %edx
movq 0x60(%rsp), %rax
leaq (%rcx,%rcx,4), %r10
movl (%rax,%r10,4), %ecx
movl 0x4(%rax,%r10,4), %r8d
movl 0x8(%rax,%r10,4), %r9d
movl 0xc(%rax,%r10,4), %esi
movl 0x10(%rax,%r10,4), %r10d
movq %rsp, %rax
movl %r10d, 0x8(%rax)
movl %esi, (%rax)
leaq 0x3bd6(%rip), %rsi      # 0xb177
xorl %eax, %eax
callq 0x2150
movq 0x60(%rsp), %rcx
movslq 0x40(%rsp), %rax
leaq (%rax,%rax,4), %rdx
movl (%rcx,%rdx,4), %eax
movl 0x4(%rcx,%rdx,4), %ecx
subl %ecx, %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
cvtsi2sd %eax, %xmm0
movl 0x5d58(%rip), %eax      # 0xd328
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
movq 0x60(%rsp), %rcx
movslq 0x40(%rsp), %rax
leaq (%rax,%rax,4), %rdx
movl 0x8(%rcx,%rdx,4), %eax
movl 0xc(%rcx,%rdx,4), %ecx
subl %ecx, %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
cvtsi2sd %eax, %xmm0
movl 0x5d1c(%rip), %eax      # 0xd328
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x18(%rsp), %xmm0
ucomiss 0x20(%rsp), %xmm0
jbe 0x7638
movss 0x18(%rsp), %xmm0
movss %xmm0, 0x20(%rsp)
movss 0x1c(%rsp), %xmm0
ucomiss 0x24(%rsp), %xmm0
jbe 0x7651
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0x24(%rsp)
movl $0x0, 0x44(%rsp)
cmpl $0x2a, 0x44(%rsp)
jge 0x76fb
movq 0x48(%rsp), %rdi
movq 0x58(%rsp), %rax
movslq 0x40(%rsp), %rcx
imulq $0xc8, %rcx, %rcx
addq %rcx, %rax
movslq 0x44(%rsp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x3ae7(%rip), %rsi      # 0xb173
movb $0x0, %al
callq 0x2150
cmpl $0x14, 0x44(%rsp)
jl 0x76be
movq 0x58(%rsp), %rax
movslq 0x40(%rsp), %rcx
imulq $0xc8, %rcx, %rcx
addq %rcx, %rax
movslq 0x44(%rsp), %rcx
movl (%rax,%rcx,4), %eax
addl 0x30(%rsp), %eax
movl %eax, 0x30(%rsp)
cmpl $0x1e, 0x44(%rsp)
jl 0x76e9
movq 0x58(%rsp), %rax
movslq 0x40(%rsp), %rcx
imulq $0xc8, %rcx, %rcx
addq %rcx, %rax
movslq 0x44(%rsp), %rcx
movl (%rax,%rcx,4), %eax
addl 0x34(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0x76eb
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x7659
movq 0x48(%rsp), %rdi
leaq 0x3b30(%rip), %rsi      # 0xb237
movb $0x0, %al
callq 0x2150
movl 0x40(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x40(%rsp)
jmp 0x7514
movq 0x48(%rsp), %rdi
movl 0x5bff(%rip), %edx      # 0xd328
leaq 0x3a59(%rip), %rsi      # 0xb189
movb $0x0, %al
callq 0x2150
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rdx
leaq 0x3a52(%rip), %rsi      # 0xb19a
movb $0x0, %al
callq 0x2150
movq 0x48(%rsp), %rdi
movss 0x2bf4(%rip), %xmm0     # 0xa350
mulss 0x24(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3a3f(%rip), %rsi      # 0xb1ac
movb $0x1, %al
callq 0x2150
movq 0x48(%rsp), %rdi
movss 0x2bcf(%rip), %xmm0     # 0xa350
mulss 0x20(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3a2d(%rip), %rsi      # 0xb1bf
movb $0x1, %al
callq 0x2150
movq 0x48(%rsp), %rdi
movl 0x2c(%rsp), %eax
cvtsi2ss %rax, %xmm1
movss 0x2ba1(%rip), %xmm0     # 0xa350
mulss %xmm1, %xmm0
cvtsi2ssq 0x38(%rsp), %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3a09(%rip), %rsi      # 0xb1d2
movb $0x1, %al
callq 0x2150
movq 0x48(%rsp), %rdi
movl 0x30(%rsp), %eax
cvtsi2ss %rax, %xmm1
movss 0x2b6a(%rip), %xmm0     # 0xa350
mulss %xmm1, %xmm0
cvtsi2ssq 0x38(%rsp), %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x39e7(%rip), %rsi      # 0xb1e7
movb $0x1, %al
callq 0x2150
movq 0x48(%rsp), %rdi
movl 0x34(%rsp), %eax
cvtsi2ss %rax, %xmm1
movss 0x2b33(%rip), %xmm0     # 0xa350
mulss %xmm1, %xmm0
cvtsi2ssq 0x38(%rsp), %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x39bf(%rip), %rsi      # 0xb1f6
movb $0x1, %al
callq 0x2150
movq 0x48(%rsp), %rdi
movl 0x28(%rsp), %eax
cvtsi2ss %rax, %xmm1
movss 0x2afc(%rip), %xmm0     # 0xa350
mulss %xmm1, %xmm0
cvtsi2ssq 0x38(%rsp), %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3997(%rip), %rsi      # 0xb205
movb $0x1, %al
callq 0x2150
movq 0x48(%rsp), %rdi
callq 0x20b0
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)