// File: chhylp123[P]hifiasm/gfa_ut.cpp
// Function: print_uls_ovlp(_IO_FILE*, all_ul_t*, char const*, ma_ug_t*)
void print_uls_ovlp(FILE *fp, all_ul_t *uls, const char* utg_pre, ma_ug_t *ug)
{
    ul_vec_t *p = NULL; nid_t *z = NULL; uc_block_t *m = NULL; uint64_t k, i; uint32_t a, la, occ;
    kvec_t(uint8_t) f; kv_init(f);
    for (k = 0; k < uls->n; k++) {
        z = &(uls->nid.a[k]);
        p = &(uls->a[k]);
        for (i = 0; i < p->bb.n; i++) {
            m = &(p->bb.a[i]);
            if(m->base || (!m->el)) continue;
            if(m->pchain) break;
        }
        if(i >= p->bb.n) continue;
        kv_resize(uint8_t, f, p->bb.n); memset(f.a, 0, sizeof(*(f.a))*p->bb.n);
        fprintf(fp, ">\t%.*s\n", (int32_t)z->n, z->a);
        for (i = 0; i < p->bb.n; i++) {
            if(f.a[i]) continue;
            m = &(p->bb.a[i]);
            if(m->base || (!m->el) || (!m->pchain)) continue;
            for (a = i, la = i, occ = 0; a != (uint32_t)-1; a = p->bb.a[a].aidx) {
                la = a; f.a[a] = 1; occ++;
            }
            fprintf(fp, "C\tLEN:%u\tS:%u\tE:%u\tOCC:%u\n", p->rlen, p->bb.a[i].qs, p->bb.a[la].qe, occ);
            for (a = i; a != (uint32_t)-1; a = p->bb.a[a].aidx) {
                m = &(p->bb.a[a]);
                fprintf(fp, "%s%.6d%c[%c::", utg_pre, m->hid+1, "lc"[ug->u.a[(m->hid>>1)].circ], "+-"[m->rev]);
                if(m->pdis == (uint32_t)-1) fprintf(fp, "*]\t");
                else fprintf(fp, "%u]\t", m->pdis);
            }
            fprintf(fp, "\n");
        }
    }

    free(f.a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0x328851
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
imulq $0x58, -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x328546
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
imulq $0x24, -0x48(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movb 0x20(%rax), %al
shrb $0x6, %al
andb $0x1, %al
cmpb $0x0, %al
jne 0x328525
movq -0x38(%rbp), %rax
movb 0x20(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
jne 0x328527
jmp 0x328538
movq -0x38(%rbp), %rax
movb 0x20(%rax), %al
andb $0x1f, %al
cmpb $0x0, %al
je 0x328536
jmp 0x328546
jmp 0x328538
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x3284e5
movq -0x48(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jb 0x328559
jmp 0x328840
jmp 0x32855b
movq -0x68(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x3285f5
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shrq %rax
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shrq $0x2, %rax
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shrq $0x4, %rax
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shrq $0x8, %rax
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shrq $0x10, %rax
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, -0x60(%rbp)
jmp 0x3285f7
movq -0x60(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rdx
shlq $0x0, %rdx
xorl %esi, %esi
callq 0x2100
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl 0x8(%rax), %edx
movq -0x30(%rbp), %rax
movq (%rax), %rcx
leaq 0x6e721(%rip), %rsi     # 0x396d48
movb $0x0, %al
callq 0x22a0
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x32883e
movq -0x60(%rbp), %rax
movq -0x48(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x32865b
jmp 0x32882d
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
imulq $0x24, -0x48(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movb 0x20(%rax), %al
shrb $0x6, %al
andb $0x1, %al
cmpb $0x0, %al
jne 0x32869a
movq -0x38(%rbp), %rax
movb 0x20(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x32869a
movq -0x38(%rbp), %rax
movb 0x20(%rax), %al
andb $0x1f, %al
cmpb $0x0, %al
jne 0x32869f
jmp 0x32882d
movq -0x48(%rbp), %rax
movl %eax, -0x4c(%rbp)
movq -0x48(%rbp), %rax
movl %eax, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
cmpl $-0x1, -0x4c(%rbp)
je 0x3286ee
movl -0x4c(%rbp), %eax
movl %eax, -0x50(%rbp)
movq -0x60(%rbp), %rax
movl -0x4c(%rbp), %ecx
movb $0x1, (%rax,%rcx)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x4c(%rbp), %ecx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movl %eax, -0x4c(%rbp)
jmp 0x3286b4
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x18(%rax), %edx
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
imulq $0x24, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x50(%rbp), %esi
imulq $0x24, %rsi, %rsi
addq %rsi, %rax
movl 0x8(%rax), %r8d
movl -0x54(%rbp), %r9d
leaq 0x6e623(%rip), %rsi     # 0x396d50
movb $0x0, %al
callq 0x22a0
movq -0x48(%rbp), %rax
movl %eax, -0x4c(%rbp)
cmpl $-0x1, -0x4c(%rbp)
je 0x32881b
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x4c(%rbp), %ecx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rsi
movl (%rsi), %esi
shrl %esi
movl %esi, %esi
imulq $0x28, %rsi, %rsi
addq %rsi, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x5cb6e(%rip), %rax     # 0x385303
movsbl (%rax,%rsi), %r8d
movq -0x38(%rbp), %rax
movb 0x20(%rax), %al
shrb $0x5, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, %esi
leaq 0x5a6e9(%rip), %rax     # 0x382e9b
movsbl (%rax,%rsi), %r9d
leaq 0x6e5ad(%rip), %rsi     # 0x396d6b
movb $0x0, %al
callq 0x22a0
movq -0x38(%rbp), %rax
cmpl $-0x1, 0x18(%rax)
jne 0x3287e3
movq -0x8(%rbp), %rdi
leaq 0x6e59f(%rip), %rsi     # 0x396d79
movb $0x0, %al
callq 0x22a0
jmp 0x3287fc
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl 0x18(%rax), %edx
leaq 0x6e588(%rip), %rsi     # 0x396d7d
movb $0x0, %al
callq 0x22a0
jmp 0x3287fe
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x4c(%rbp), %ecx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movl %eax, -0x4c(%rbp)
jmp 0x32873b
movq -0x8(%rbp), %rdi
leaq 0x5e202(%rip), %rsi     # 0x386a28
movb $0x0, %al
callq 0x22a0
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x328636
jmp 0x328840
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x3284a0
movq -0x60(%rbp), %rdi
callq 0x2210
addq $0x70, %rsp
popq %rbp
retq