// File: /workspace/github_c_makefile_star2_O1/annoroad[P]fqtools_plus/fqtools.c
// Function: merge_stat
local void merge_stat(struct pool* pool){
	struct space* space = pool->head;
	struct STAT* stat;
	memset(&allstat,0,sizeof(allstat));
	possess(pool->have);
	int m,n;
	while(space != NULL){
		stat = space->readclass->stat;
		allstat.raw_reads += stat->raw_reads;
		allstat.clean_reads += stat->clean_reads;
		allstat.low_quality_reads += stat->low_quality_reads;
		allstat.ns_reads += stat->ns_reads;
		allstat.adapter_reads += stat->adapter_reads;
		allstat.raw_bases += stat->raw_bases;
		allstat.raw_Q30_bases += stat->raw_Q30_bases;
		allstat.clean_Q30_bases += stat->clean_Q30_bases;
		allstat.HighAT_reads += stat->HighAT_reads;
		allstat.HighGC_reads += stat->HighGC_reads;
		allstat.ployAT_reads += stat->ployAT_reads;
		for(m=0;m<g.CUT;m++){
			for(n=0;n<5;n++){
				(allstat.base1)[m][n] += (stat->base1)[m][n];
				if (g.single_or_pair) (allstat.base2)[m][n] += (stat->base2)[m][n];
			}
			for(n=0;n<50;n++){
				(allstat.quality1)[m][n] += (stat->quality1)[m][n];
				if (g.single_or_pair) (allstat.quality2)[m][n] += (stat->quality2)[m][n];
			}
		}
		space = space->next;
	}
	release(pool->have);
	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x6f5e(%rip), %r14      # 0xb2c8
leaq 0x6f8f(%rip), %rdi      # 0xb300
movl $0x6e078, %edx          # imm = 0x6E078
movq %rdi, %rbx
xorl %esi, %esi
callq 0x2100
movq 0x6f39(%rip), %rdi      # 0xb2c0
callq 0x6275
testq %r14, %r14
je 0x457e
movl 0x6fd1(%rip), %ecx      # 0xb36c
movl 0x6fc3(%rip), %edx      # 0xb364
movl 0x6fb5(%rip), %esi      # 0xb35c
movq 0x6fa2(%rip), %rdi      # 0xb350
movq 0x6f8b(%rip), %r8       # 0xb340
movq 0x6f4c(%rip), %r9       # 0xb308
movl 0x6f71(%rip), %r10d     # 0xb334
movl 0x6f62(%rip), %r11d     # 0xb32c
movl 0x6f54(%rip), %ebp      # 0xb324
movl 0x6f3a(%rip), %eax      # 0xb310
movl %eax, 0xc(%rsp)
movl 0x6f1f(%rip), %r15d     # 0xb300
movl 0x6ddc(%rip), %r12d     # 0xb1c4
movl $0x5074, %eax           # imm = 0x5074
addq %rbx, %rax
movq %rax, 0x20(%rsp)
movl $0x3c074, %eax          # imm = 0x3C074
addq %rax, %rbx
movq %rbx, 0x28(%rsp)
movb 0x6db7(%rip), %r13b     # 0xb1c0
movl $0xc8, %ebx
movq 0x8(%r14), %rax
movq 0x10(%rax), %rax
addl (%rax), %r15d
movl %r15d, 0x10(%rsp)
movl %r15d, 0x6edb(%rip)     # 0xb300
movl 0xc(%rsp), %r15d
addl 0x10(%rax), %r15d
movl %r15d, 0xc(%rsp)
movl %r15d, 0x6ed6(%rip)     # 0xb310
addl 0x24(%rax), %ebp
movl %ebp, 0x14(%rsp)
movl %ebp, 0x6edd(%rip)      # 0xb324
addl 0x2c(%rax), %r11d
movl %r11d, 0x18(%rsp)
movl %r11d, 0x6ed5(%rip)     # 0xb32c
addl 0x34(%rax), %r10d
movl %r10d, 0x1c(%rsp)
movl %r10d, 0x6ecd(%rip)     # 0xb334
addq 0x8(%rax), %r9
movq %r9, 0x30(%rsp)
movq %r9, 0x6e91(%rip)       # 0xb308
addq 0x40(%rax), %r8
movq %r8, 0x38(%rsp)
movq %r8, 0x6eb9(%rip)       # 0xb340
addq 0x50(%rax), %rdi
movq %rdi, 0x40(%rsp)
movq %rdi, 0x6eb9(%rip)      # 0xb350
addl 0x5c(%rax), %esi
movl %esi, %ebp
movl %esi, 0x6eba(%rip)      # 0xb35c
addl 0x64(%rax), %edx
movl %edx, %r11d
movl %edx, 0x6eb6(%rip)      # 0xb364
addl 0x6c(%rax), %ecx
movl %ecx, %r10d
movl %ecx, 0x6eb2(%rip)      # 0xb36c
testl %r12d, %r12d
jle 0x4547
movl $0x5074, %ecx           # imm = 0x5074
addq %rax, %rcx
movl $0x3c074, %edx          # imm = 0x3C074
addq %rdx, %rax
movq 0x28(%rsp), %rdx
movq 0x20(%rsp), %rsi
xorl %edi, %edi
xorl %r8d, %r8d
movl -0x5000(%rcx,%r8,4), %r9d
addl %r9d, -0x5000(%rsi,%r8,4)
testb %r13b, %r13b
je 0x44ff
movl (%rcx,%r8,4), %r9d
addl %r9d, (%rsi,%r8,4)
incq %r8
cmpq $0x5, %r8
jne 0x44e2
xorl %r8d, %r8d
movl -0x32000(%rax,%r8,4), %r9d
addl %r9d, -0x32000(%rdx,%r8,4)
testb %r13b, %r13b
je 0x4528
movl (%rax,%r8,4), %r9d
addl %r9d, (%rdx,%r8,4)
incq %r8
cmpq $0x32, %r8
jne 0x450b
incq %rdi
addq $0x14, %rcx
addq $0x14, %rsi
addq %rbx, %rax
addq %rbx, %rdx
cmpq %r12, %rdi
jne 0x44df
movq 0x10(%r14), %r14
testq %r14, %r14
movl %r10d, %ecx
movl %r11d, %edx
movl %ebp, %esi
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %r8
movq 0x30(%rsp), %r9
movl 0x1c(%rsp), %r10d
movl 0x18(%rsp), %r11d
movl 0x14(%rsp), %ebp
movl 0x10(%rsp), %r15d
jne 0x440e
movq 0x6d3b(%rip), %rdi      # 0xb2c0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6286