// File: chhylp123[P]hifiasm/inter.cpp
// Function: print_ovlp_src_bl_stat(all_ul_t*, ug_opt_t const*)
void print_ovlp_src_bl_stat(all_ul_t *x, const ug_opt_t *uopt)
{
	uint64_t k, z, tc, ta;
	ma_hit_t_alloc* src = uopt->sources;
	for (k = tc = ta = 0; k < R_INF.total_reads; k++) {
		if(x->ridx.idx.a[k+1] - x->ridx.idx.a[k] == 0) continue;
		tc++;
		for (z = 0; z < src[k].length; z++) {
			if(src[k].buffer[z].bl) {
				ta++;
				break;
			}
		}
	}
	
	fprintf(stderr, "[M::%s::] ==> # HiFi reads:%lu, # covered HiFi reads:%lu, # chained HiFi reads:%lu\n", 
	__func__, R_INF.total_reads, tc, ta);

	uint64_t tt[4] = {0};
	for (k = 0; k < x->n; k++) {
		tt[x->a[k].dd]++;
		// if(x->a[k].dd == 1) {
		// 	fprintf(stderr, "(%lu) %.*s\n", k, (int32_t)x->nid.a[k].n, x->nid.a[k].a);
		// }
	}

	fprintf(stderr, "[M::%s::] ==> # passed UL reads:%lu, # fully corrected UL reads:%lu, # almost fully corrected UL reads:%lu, # UL reads have primary chains:%lu\n", 
	__func__, tt[0]+tt[1]+tt[2]+tt[3], tt[1], tt[2], tt[3]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
leaq 0xd4751(%rip), %rcx     # 0x3c52d0
cmpq 0x50(%rcx), %rax
jae 0x2f0c36
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x4(%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq -0x18(%rbp), %rdx
subl (%rcx,%rdx,4), %eax
cmpl $0x0, %eax
jne 0x2f0baf
jmp 0x2f0c25
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
imulq $0x18, -0x18(%rbp), %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jae 0x2f0c23
movq -0x38(%rbp), %rax
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
imulq $0x28, -0x20(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x20, %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
cmpl $0x0, %eax
je 0x2f0c13
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x2f0c23
jmp 0x2f0c15
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x2f0bc3
jmp 0x2f0c25
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2f0b74
movq 0xd33a3(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
leaq 0xd4689(%rip), %rax     # 0x3c52d0
movq 0x50(%rax), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
leaq 0xa3f6b(%rip), %rsi     # 0x394bc5
leaq 0xa3fb8(%rip), %rdx     # 0x394c19
movb $0x0, %al
callq 0x22a0
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x2100
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0x2f0cbe
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
imulq $0x58, -0x18(%rbp), %rcx
addq %rcx, %rax
movzbl 0x50(%rax), %eax
movq -0x60(%rbp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, -0x60(%rbp,%rax,8)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2f0c80
movq 0xd331b(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movq -0x60(%rbp), %rcx
addq -0x58(%rbp), %rcx
addq -0x50(%rbp), %rcx
addq -0x48(%rbp), %rcx
movq -0x58(%rbp), %r8
movq -0x50(%rbp), %r9
movq -0x48(%rbp), %rax
leaq 0xa3f45(%rip), %rsi     # 0x394c30
leaq 0xa3f27(%rip), %rdx     # 0x394c19
movq %rax, (%rsp)
movb $0x0, %al
callq 0x22a0
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)