// File: /workspace/github_cpp_makefile_star2_O3/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 $0x78, %rsp
movl %esi, 0x44(%rsp)
cmpq $0x0, 0x50(%rdi)
jne 0x25207
xorl %r13d, %r13d
xorl %r15d, %r15d
movq $0x0, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
jmp 0x2549f
movq 0x26fdd2(%rip), %rbp    # 0x294fe0
movq $0x0, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
xorl %r15d, %r15d
xorl %r13d, %r13d
xorl %r12d, %r12d
movq %rdi, 0x30(%rsp)
movq 0x48(%rdi), %rax
imulq $0x58, %r12, %rsi
leaq (%rax,%rsi), %r14
movq 0x20(%rax,%rsi), %rcx
pushq $-0x1
popq %rdx
movl %edx, %r10d
testq %rcx, %rcx
je 0x2526e
cmpq $0x1, %rcx
jne 0x25269
movq 0x30(%r14), %rcx
testb $0x40, 0x20(%rcx)
pushq $-0x1
popq %rcx
movl %ecx, %r10d
jne 0x2526e
movzbl 0x50(%r14), %r10d
movq %r12, %rbx
shlq $0x4, %rbx
movq 0x10(%rdi), %rcx
movq (%rbp), %rdi
movl 0x8(%rcx,%rbx), %edx
movq %rcx, 0x38(%rsp)
movq (%rcx,%rbx), %rcx
movl 0x18(%rax,%rsi), %r9d
subq $0x8, %rsp
leaq 0x21ec20(%rip), %rsi    # 0x243eba
movq %r12, %r8
xorl %eax, %eax
pushq %r10
callq 0x22b0
popq %rcx
popq %rdx
movq %r14, 0x10(%rsp)
movq 0x20(%r14), %rax
cmpl $0x0, 0x44(%rsp)
jne 0x252cc
movq %r12, 0x8(%rsp)
movq %r15, 0x48(%rsp)
movq 0x10(%rsp), %rbx
jmp 0x2544a
testq %rax, %rax
jne 0x252e0
movq 0x10(%rsp), %rbx
movq 0x30(%rsp), %rdi
jmp 0x25482
movq %r12, 0x8(%rsp)
movq %r15, 0x48(%rsp)
movq 0x38(%rsp), %r14
addq %rbx, %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x10(%rsp), %rbx
movq %r14, 0x38(%rsp)
movq 0x30(%rbx), %rax
movzbl 0x20(%rax,%r15), %esi
testb $0x40, %sil
jne 0x253e6
movq (%rbp), %rdi
movl 0x8(%r14), %edx
movq (%r14), %rcx
movl 0x18(%rbx), %r9d
movl (%rax,%r15), %r14d
movl 0x4(%rax,%r15), %r8d
movq %r8, 0x70(%rsp)
movl 0x8(%rax,%r15), %r8d
movq %r8, 0x68(%rsp)
btl $0x5, %esi
leaq 0x20cf8b(%rip), %rsi    # 0x2322d3
adcq $0x0, %rsi
movsbl (%rsi), %esi
movq %rsi, 0x60(%rsp)
leaq 0x270ed5(%rip), %rbx    # 0x296230
movq 0x40(%rbx), %rsi
leal 0x1(%r14), %r8d
movl (%rsi,%r8,8), %r10d
movq (%rsi,%r14,8), %r11
subl %r11d, %r10d
addq 0x8(%rbx), %r11
movq 0x18(%rbx), %rsi
movl (%rsi,%r14,8), %esi
movq %rsi, 0x58(%rsp)
movl 0xc(%rax,%r15), %esi
movq %rsi, 0x50(%rsp)
movq %rbp, %rbx
movq %r13, %rbp
movl 0x10(%rax,%r15), %r13d
subq $0x8, %rsp
leaq 0x21eb48(%rip), %rsi    # 0x243ee7
movq 0x10(%rsp), %r8
xorl %eax, %eax
pushq %r13
movq %rbp, %r13
movq %rbx, %rbp
movq 0x20(%rsp), %rbx
pushq 0x60(%rsp)
pushq 0x70(%rsp)
pushq %r14
movq 0x60(%rsp), %r14
pushq %r11
pushq %r10
pushq 0x98(%rsp)
pushq 0xa8(%rsp)
pushq 0xb8(%rsp)
callq 0x22b0
addq $0x50, %rsp
jmp 0x25436
movl (%rax,%r15), %r9d
movl 0x8(%rax,%r15), %r10d
movl %r9d, %ecx
movl $0x7fff, %edx           # imm = 0x7FFF
andl %edx, %ecx
shrl $0xf, %r9d
andl %edx, %r9d
addl 0x4(%rax,%r15), %r9d
subl %ecx, %r10d
movl %r10d, %eax
subl %r9d, %eax
addq %rax, %r13
movq (%rbp), %rdi
movl 0x8(%r14), %edx
movq (%r14), %rcx
movl 0x18(%rbx), %r8d
subq $0x8, %rsp
leaq 0x21eaab(%rip), %rsi    # 0x243ed6
xorl %eax, %eax
pushq %r10
callq 0x22b0
popq %rcx
popq %rdx
incq %r12
movq 0x20(%rbx), %rax
addq $0x24, %r15
cmpq %rax, %r12
jb 0x25302
testq %rax, %rax
movq 0x48(%rsp), %r15
je 0x25478
cmpq $0x1, %rax
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %r12
jne 0x2546e
movq 0x30(%rbx), %rax
testb $0x40, 0x20(%rax)
jne 0x25482
incq 0x18(%rsp)
movl 0x18(%rbx), %eax
jmp 0x2548f
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %r12
movl 0x18(%rbx), %eax
addq %rax, 0x28(%rsp)
incq 0x20(%rsp)
addq %rax, %r15
incq %r12
cmpq 0x50(%rdi), %r12
jb 0x25237
subq %r13, %r15
movq 0x26fb37(%rip), %rbx    # 0x294fe0
movq (%rbx), %rdi
leaq 0x21ea5f(%rip), %rsi    # 0x243f12
leaq 0x21ea89(%rip), %r14    # 0x243f43
movq %r14, %rdx
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %r8
xorl %eax, %eax
callq 0x22b0
movq (%rbx), %rdi
movq 0x28(%rsp), %r9
subq %r9, %r13
leaq 0x21ea72(%rip), %rsi    # 0x243f52
movq %r14, %rdx
movq %r15, %rcx
movq %r13, %r8
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22b0