// File: 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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdi, -0x30(%rbp)
movl %esi, -0x34(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x78(%rbp)
movq $0x0, -0x80(%rbp)
movq $0x0, -0x88(%rbp)
movq $0x0, -0x90(%rbp)
movq $0x0, -0x98(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0x2f0903
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
imulq $0x58, -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq 0xd3aca(%rip), %rax     # 0x3c3fe0
movq (%rax), %rax
movq %rax, -0xc0(%rbp)
movq -0x90(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0xb4(%rbp)
movq -0x90(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x88(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x9c(%rbp)
movq -0x88(%rbp), %rax
cmpq $0x1, 0x20(%rax)
jne 0x2f0581
movq -0x88(%rbp), %rax
movq 0x30(%rax), %rax
movb 0x20(%rax), %al
shrb $0x6, %al
andb $0x1, %al
cmpb $0x0, %al
jne 0x2f058f
movq -0x88(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x2f059c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0xc4(%rbp)
jmp 0x2f05ad
movq -0x88(%rbp), %rax
movzbl 0x50(%rax), %eax
movl %eax, -0xc4(%rbp)
movl -0x9c(%rbp), %r9d
movq -0xa8(%rbp), %r8
movq -0xb0(%rbp), %rcx
movl -0xb4(%rbp), %edx
movq -0xc0(%rbp), %rdi
movl -0xc4(%rbp), %eax
leaq 0xa44b2(%rip), %rsi     # 0x394a8e
movl %eax, (%rsp)
movb $0x0, %al
callq 0x22a0
cmpl $0x0, -0x34(%rbp)
je 0x2f0881
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x88(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x2f087f
movq -0x88(%rbp), %rax
movq 0x30(%rax), %rax
imulq $0x24, -0x48(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movb 0x20(%rax), %al
shrb $0x6, %al
andb $0x1, %al
cmpb $0x0, %al
je 0x2f0708
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x98(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x98(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
subl %ecx, %eax
movq -0x98(%rbp), %rcx
movl 0x4(%rcx), %ecx
movq -0x98(%rbp), %rdx
movl (%rdx), %edx
shrl $0xf, %edx
andl $0x7fff, %edx           # imm = 0x7FFF
addl %edx, %ecx
subl %ecx, %eax
movl %eax, %eax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq 0xd394a(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movq -0x90(%rbp), %rax
movl 0x8(%rax), %edx
movq -0x90(%rbp), %rax
movq (%rax), %rcx
movq -0x88(%rbp), %rax
movl 0x18(%rax), %r8d
movq -0x98(%rbp), %rax
movl 0x4(%rax), %r9d
movq -0x98(%rbp), %rax
movl (%rax), %eax
shrl $0xf, %eax
andl $0x7fff, %eax           # imm = 0x7FFF
addl %eax, %r9d
movq -0x98(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x98(%rbp), %rsi
movl (%rsi), %esi
andl $0x7fff, %esi           # imm = 0x7FFF
subl %esi, %eax
leaq 0xa43b1(%rip), %rsi     # 0x394aaa
movl %eax, (%rsp)
movb $0x0, %al
callq 0x22a0
jmp 0x2f086c
movq 0xd38d1(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movq -0x90(%rbp), %rax
movl 0x8(%rax), %edx
movq -0x90(%rbp), %rax
movq (%rax), %rcx
movq -0x40(%rbp), %r8
movq -0x88(%rbp), %rax
movl 0x18(%rax), %r9d
movq -0x98(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x98(%rbp), %rsi
movl 0x8(%rsi), %r13d
movq -0x98(%rbp), %rsi
movb 0x20(%rsi), %sil
shrb $0x5, %sil
andb $0x1, %sil
movzbl %sil, %esi
movl %esi, %r10d
leaq 0x92730(%rip), %rsi     # 0x382e9b
movsbl (%rsi,%r10), %r12d
leaq 0xd4b59(%rip), %rsi     # 0x3c52d0
movq 0x40(%rsi), %rsi
movq -0x98(%rbp), %r10
movl (%r10), %r10d
addl $0x1, %r10d
movl %r10d, %r10d
movq (%rsi,%r10,8), %rsi
leaq 0xd4b39(%rip), %r10     # 0x3c52d0
movq 0x40(%r10), %r10
movq -0x98(%rbp), %r11
movl (%r11), %r11d
subq (%r10,%r11,8), %rsi
movl %esi, %r15d
leaq 0xd4b1d(%rip), %rsi     # 0x3c52d0
movq 0x8(%rsi), %r14
leaq 0xd4b12(%rip), %rsi     # 0x3c52d0
movq 0x40(%rsi), %rsi
movq -0x98(%rbp), %r10
movl (%r10), %r10d
addq (%rsi,%r10,8), %r14
movq -0x98(%rbp), %rsi
movl (%rsi), %ebx
leaq 0xd4af0(%rip), %rsi     # 0x3c52d0
movq 0x18(%rsi), %rsi
movq -0x98(%rbp), %r10
movl (%r10), %r10d
movq (%rsi,%r10,8), %rsi
movl %esi, %r11d
movq -0x98(%rbp), %rsi
movl 0xc(%rsi), %r10d
movq -0x98(%rbp), %rsi
movl 0x10(%rsi), %esi
movl %esi, -0xc8(%rbp)
leaq 0xa42a4(%rip), %rsi     # 0x394abb
movl %eax, (%rsp)
movl -0xc8(%rbp), %eax
movl %r13d, 0x8(%rsp)
movl %r12d, 0x10(%rsp)
movl %r15d, 0x18(%rsp)
movq %r14, 0x20(%rsp)
movl %ebx, 0x28(%rsp)
movl %r11d, 0x30(%rsp)
movl %r10d, 0x38(%rsp)
movl %eax, 0x40(%rsp)
movb $0x0, %al
callq 0x22a0
movq -0x98(%rbp), %rax
movb 0x20(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x2f086a
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x2f086c
jmp 0x2f086e
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2f05f8
jmp 0x2f0881
movq -0x88(%rbp), %rax
cmpq $0x1, 0x20(%rax)
jne 0x2f08a6
movq -0x88(%rbp), %rax
movq 0x30(%rax), %rax
movb 0x20(%rax), %al
shrb $0x6, %al
andb $0x1, %al
cmpb $0x0, %al
jne 0x2f08b4
movq -0x88(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x2f08d4
movq -0x88(%rbp), %rax
movl 0x18(%rax), %eax
addq -0x70(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x2f08e0
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
movq -0x88(%rbp), %rax
movl 0x18(%rax), %eax
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x2f04cc
movq -0x60(%rbp), %rcx
movq -0x68(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x68(%rbp)
movq 0xd36c7(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %r8
leaq 0xa41bb(%rip), %rsi     # 0x394ae6
leaq 0xa41e5(%rip), %rdx     # 0x394b17
movb $0x0, %al
callq 0x22a0
movq 0xd36a0(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
subq -0x70(%rbp), %r8
movq -0x70(%rbp), %r9
leaq 0xa41cc(%rip), %rsi     # 0x394b26
leaq 0xa41b6(%rip), %rdx     # 0x394b17
movb $0x0, %al
callq 0x22a0
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw (%rax,%rax)