// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
cmpq $0x0, 0x50(%rsi)
je 0x1ff194
movq %rdi, %r12
movq $0x0, 0x10(%rsp)
xorl %r15d, %r15d
xorl %ebp, %ebp
movq %rsi, (%rsp)
movq 0x48(%rsi), %r13
imulq $0x58, %rbp, %rax
movq 0x20(%r13,%rax), %rdx
testq %rdx, %rdx
je 0x1ff185
movq %rbp, 0x8(%rsp)
shlq $0x4, %rbp
addq 0x10(%rsi), %rbp
addq %rax, %r13
movq 0x30(%r13), %rax
addq $0x20, %rax
movq %rdx, %rcx
movb (%rax), %sil
movl %esi, %edi
andb $-0x40, %dil
negb %dil
setno %dil
testb $0x1f, %sil
sete %sil
orb %dil, %sil
je 0x1fef77
addq $0x24, %rax
decq %rcx
jne 0x1fef4c
jmp 0x1ff17c
cmpq %rdx, 0x10(%rsp)
jae 0x1fefc9
decq %rdx
movq %rdx, %rax
shrq %rax
orq %rdx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %r15, %rdi
movq %rsi, 0x10(%rsp)
callq 0x2370
movq %rax, %r15
movq 0x20(%r13), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x20e0
movl 0x8(%rbp), %edx
movq (%rbp), %rcx
movq %r12, %rdi
leaq 0x471b4(%rip), %rsi     # 0x246198
xorl %eax, %eax
callq 0x22b0
movq 0x20(%r13), %rcx
testq %rcx, %rcx
je 0x1ff17c
xorl %ebp, %ebp
cmpb $0x0, (%r15,%rbp)
jne 0x1ff170
movq 0x30(%r13), %rsi
leaq (,%rbp,8), %rax
addq %rbp, %rax
movb 0x20(%rsi,%rax,4), %dl
movl %edx, %edi
andb $-0x40, %dil
negb %dil
setno %dil
testb $0x1f, %dl
sete %dl
orb %dil, %dl
jne 0x1ff170
cmpl $-0x1, %ebp
je 0x1ff135
xorl %r9d, %r9d
movl %ebp, %ecx
movl %ecx, %esi
movb $0x1, (%r15,%rsi)
incl %r9d
movq 0x30(%r13), %rdi
leaq (%rsi,%rsi,8), %rcx
movl 0x1c(%rdi,%rcx,4), %ecx
cmpl $-0x1, %ecx
jne 0x1ff042
movl 0x18(%r13), %edx
movl 0x4(%rdi,%rax,4), %ecx
leaq (%rsi,%rsi,8), %rax
movl 0x8(%rdi,%rax,4), %r8d
movq %r12, %rdi
leaq 0x47128(%rip), %rsi     # 0x2461a0
xorl %eax, %eax
callq 0x22b0
cmpl $-0x1, %ebp
je 0x1ff15f
movq 0x30(%r13), %r14
movl %ebp, %eax
movl %eax, %eax
leaq (%rax,%rax,8), %rbx
movl (%r14,%rbx,4), %eax
leal 0x1(%rax), %ecx
movq 0x20(%rsp), %rdx
movq 0x10(%rdx), %rdx
shrl %eax
leaq (%rax,%rax,4), %rax
movl (%rdx,%rax,8), %eax
shrl $0x1f, %eax
leaq 0x35684(%rip), %rdx     # 0x23473b
movsbl (%rax,%rdx), %r8d
movzbl 0x20(%r14,%rbx,4), %eax
btl $0x5, %eax
leaq 0x33206(%rip), %rax     # 0x2322d3
adcq $0x0, %rax
movsbl (%rax), %r9d
movq %r12, %rdi
leaq 0x470dc(%rip), %rsi     # 0x2461bb
movq 0x18(%rsp), %rdx
xorl %eax, %eax
callq 0x22b0
movl 0x18(%r14,%rbx,4), %edx
cmpl $-0x1, %edx
je 0x1ff108
movq %r12, %rdi
leaq 0x470ce(%rip), %rsi     # 0x2461cd
xorl %eax, %eax
callq 0x22b0
jmp 0x1ff121
movl $0x3, %esi
movl $0x1, %edx
leaq 0x470b0(%rip), %rdi     # 0x2461c9
movq %r12, %rcx
callq 0x2410
movq 0x30(%r13), %r14
movl 0x1c(%r14,%rbx,4), %eax
cmpl $-0x1, %eax
jne 0x1ff08e
jmp 0x1ff15f
movl 0x18(%r13), %edx
movl 0x4(%rsi,%rax,4), %ecx
movabsq $0x23ffffffe4, %rax     # imm = 0x23FFFFFFE4
movl (%rsi,%rax), %r8d
movq %r12, %rdi
leaq 0x4704b(%rip), %rsi     # 0x2461a0
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x22b0
movl $0xa, %edi
movq %r12, %rsi
callq 0x2270
movq 0x20(%r13), %rcx
incq %rbp
cmpq %rcx, %rbp
jb 0x1feffa
movq (%rsp), %rsi
movq 0x8(%rsp), %rbp
incq %rbp
cmpq 0x50(%rsi), %rbp
jb 0x1fef1b
jmp 0x1ff197
xorl %r15d, %r15d
movq %r15, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2220