// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: print_ul_ovlps(all_ul_t*, int)
void print_ul_ovlps(all_ul_t *x, int32_t prt_ovlp)
{
	uint64_t k, i, ucov_occ = 0, cov_occ = 0, ucov_len = 0, cov_len = 0, unaligned_len = 0, unaligned_occ = 0, aligned_occ = 0;
	ul_vec_t *p = NULL; nid_t *z = NULL; uc_block_t *m = NULL;
	for (k = 0; k < x->n; k++) {
		z = &(x->nid.a[k]);
		p = &(x->a[k]);
		fprintf(stderr, "S\t%.*s\tq:id:%lu\tl:%u\tdd:%d\n", (int32_t)z->n, z->a, k, p->rlen, 
		((p->bb.n == 1&&p->bb.a[0].base)||(p->bb.n==0))?-1:(int32_t)p->dd);
		if(prt_ovlp) {
			for (i = 0; i < p->bb.n; i++) {
				m = &(p->bb.a[i]);
				if(m->base) {
					ucov_occ++;
					ucov_len += (m->qe-(m->hid&FLANK_M)) - (m->qs+((m->hid>>15)&FLANK_M));
					fprintf(stderr, "B\t%.*s\t%u\t%u\t%u\n", 
					(int32_t)z->n, z->a, p->rlen, (m->qs+((m->hid>>15)&FLANK_M)), (m->qe-(m->hid&FLANK_M)));
				} else {
					fprintf(stderr, "A\t%.*s(%lu)\t%u\t%u\t%u\t%c\t%.*s(%u)\t%u\t%u\t%u\n", 
					(int32_t)z->n, z->a, k, p->rlen, m->qs, m->qe, "+-"[m->rev], 
					(int32_t)Get_NAME_LENGTH(R_INF, m->hid), Get_NAME(R_INF, m->hid), m->hid,
					(uint32_t)Get_READ_LENGTH(R_INF, m->hid), m->ts, m->te);
					if(m->el) cov_occ++;
				}
			}
		}
		if((p->bb.n == 1 && p->bb.a[0].base)||(p->bb.n == 0)) {
			unaligned_len += p->rlen; unaligned_occ++;
		} else {
			aligned_occ++;
		}
		cov_len += p->rlen;
	}
	cov_len -= ucov_len;
	fprintf(stderr, "[M::%s::] ==>aligned_occ:%lu, unaligned_occ:%lu\n", __func__, aligned_occ, unaligned_occ);
	fprintf(stderr, "[M::%s::] ==>cov_len:%lu, ucov_len:%lu, unaligned_len:%lu\n", 
																	__func__, cov_len, ucov_len-unaligned_len, unaligned_len);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %esi, 0xc(%rsp)
movq 0xbf9c0(%rip), %r15     # 0x252fe0
xorl %eax, %eax
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %r14d, %r14d
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq %rdi, 0x20(%rsp)
cmpq 0x50(%rdi), %rax
jae 0x193887
movq %r13, 0x30(%rsp)
movq %rax, %rcx
movq 0x48(%rdi), %rax
movq %rcx, (%rsp)
imulq $0x58, %rcx, %rsi
leaq (%rax,%rsi), %r13
movq 0x20(%rax,%rsi), %rcx
pushq $-0x1
popq %rdx
movl %edx, %r10d
testq %rcx, %rcx
je 0x19368f
cmpq $0x1, %rcx
jne 0x19368a
movq 0x30(%r13), %rcx
testb $0x40, 0x20(%rcx)
pushq $-0x1
popq %rcx
movl %ecx, %r10d
jne 0x19368f
movzbl 0x50(%r13), %r10d
movq (%rsp), %r8
movq %r8, %rbx
shlq $0x4, %rbx
movq 0x20(%rsp), %rcx
movq 0x10(%rcx), %rbp
movq (%r15), %rdi
movl 0x8(%rbp,%rbx), %edx
movq (%rbp,%rbx), %rcx
movl 0x18(%rax,%rsi), %r9d
subq $0x8, %rsp
leaq 0x626c3(%rip), %rsi     # 0x1f5d82
xorl %eax, %eax
pushq %r10
callq 0x22b0
popq %rcx
popq %rdx
cmpl $0x0, 0xc(%rsp)
jne 0x1936da
movq 0x20(%r13), %rax
jmp 0x193842
movq %r14, 0x28(%rsp)
addq %rbx, %rbp
xorl %r14d, %r14d
xorl %ebx, %ebx
movq %r13, 0x38(%rsp)
movq 0x20(%r13), %rax
cmpq %rax, %rbx
jae 0x19383d
movq 0x30(%r13), %rax
movzbl 0x20(%rax,%r14), %esi
testb $0x40, %sil
jne 0x1937e2
movq (%r15), %rdi
movl 0x8(%rbp), %edx
movq (%rbp), %rcx
movl 0x18(%r13), %r9d
movq %rbx, 0x60(%rsp)
movl (%rax,%r14), %ebx
movl 0x4(%rax,%r14), %r8d
movq %r8, 0x58(%rsp)
movl 0x8(%rax,%r14), %r8d
movq %r8, 0x50(%rsp)
btl $0x5, %esi
leaq 0x50ae0(%rip), %rsi     # 0x1e4223
adcq $0x0, %rsi
movsbl (%rsi), %esi
movq %rsi, 0x48(%rsp)
leaq 0xc0ada(%rip), %r11     # 0x254230
movq 0x40(%r11), %rsi
leal 0x1(%rbx), %r8d
movl (%rsi,%r8,8), %r10d
movq (%rsi,%rbx,8), %r15
subl %r15d, %r10d
addq 0x8(%r11), %r15
movq 0x18(%r11), %rsi
movl (%rsi,%rbx,8), %esi
movq %rsi, 0x40(%rsp)
movl 0xc(%rax,%r14), %r13d
movq %rbp, %r11
movq %r12, %rbp
movl 0x10(%rax,%r14), %r12d
subq $0x8, %rsp
leaq 0x6261b(%rip), %rsi     # 0x1f5daf
movq 0x8(%rsp), %r8
xorl %eax, %eax
pushq %r12
movq %rbp, %r12
movq %r11, %rbp
pushq %r13
movq 0x50(%rsp), %r13
pushq 0x58(%rsp)
pushq %rbx
movq 0x88(%rsp), %rbx
pushq %r15
movq 0xbf820(%rip), %r15     # 0x252fe0
pushq %r10
pushq 0x80(%rsp)
pushq 0x90(%rsp)
pushq 0xa0(%rsp)
callq 0x22b0
addq $0x50, %rsp
jmp 0x193831
movl (%rax,%r14), %r9d
movl 0x8(%rax,%r14), %r10d
movl %r9d, %ecx
movl $0x7fff, %edx           # imm = 0x7FFF
andl %edx, %ecx
shrl $0xf, %r9d
andl %edx, %r9d
addl 0x4(%rax,%r14), %r9d
subl %ecx, %r10d
movl %r10d, %eax
subl %r9d, %eax
addq %rax, %r12
movq (%r15), %rdi
movl 0x8(%rbp), %edx
movq (%rbp), %rcx
movl 0x18(%r13), %r8d
subq $0x8, %rsp
leaq 0x62578(%rip), %rsi     # 0x1f5d9e
xorl %eax, %eax
pushq %r10
callq 0x22b0
popq %rcx
popq %rdx
incq %rbx
addq $0x24, %r14
jmp 0x1936ec
movq 0x28(%rsp), %r14
testq %rax, %rax
je 0x193862
cmpq $0x1, %rax
jne 0x193857
movq 0x30(%r13), %rax
testb $0x40, 0x20(%rax)
jne 0x193862
incq 0x10(%rsp)
movl 0x18(%r13), %eax
jmp 0x19386e
movl 0x18(%r13), %eax
addq %rax, %r14
incq 0x18(%rsp)
movq 0x30(%rsp), %r13
addq %rax, %r13
movq (%rsp), %rax
incq %rax
movq 0x20(%rsp), %rdi
jmp 0x193642
subq %r12, %r13
movq (%r15), %rdi
leaq 0x62546(%rip), %rsi     # 0x1f5dda
movq %r14, %rbx
leaq 0x6256d(%rip), %r14     # 0x1f5e0b
movq %r14, %rdx
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %r8
xorl %eax, %eax
callq 0x22b0
movq (%r15), %rdi
subq %rbx, %r12
leaq 0x6255b(%rip), %rsi     # 0x1f5e1a
movq %r14, %rdx
movq %r13, %rcx
movq %r12, %r8
movq %rbx, %r9
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22b0