// File: /workspace/github_cpp_makefile_star2_O2/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)
movq %rdi, %r12
xorl %ecx, %ecx
xorl %r13d, %r13d
movq $0x0, (%rsp)
movq %rsi, 0x8(%rsp)
cmpq 0x50(%rsi), %rcx
jae 0x1b30c7
movq %rcx, %rbp
shlq $0x4, %rbp
addq 0x10(%rsi), %rbp
movq 0x48(%rsi), %rax
movq %rcx, 0x10(%rsp)
imulq $0x58, %rcx, %rcx
leaq (%rax,%rcx), %r15
movq 0x20(%rax,%rcx), %rdx
pushq $0x20
popq %rax
pushq $-0x1
popq %rcx
incq %rcx
cmpq %rcx, %rdx
je 0x1b30b5
movq 0x30(%r15), %rsi
movb (%rsi,%rax), %sil
addq $0x24, %rax
movl %esi, %edi
andb $-0x40, %dil
negb %dil
setno %dil
testb $0x1f, %sil
sete %sil
orb %dil, %sil
jne 0x1b2eca
cmpq %rdx, (%rsp)
jae 0x1b2f4c
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 %r13, %rdi
movq %rsi, (%rsp)
callq 0x2370
movq %rax, %r13
movq 0x20(%r15), %rdx
movq %r13, %rdi
xorl %esi, %esi
callq 0x20e0
movl 0x8(%rbp), %edx
movq (%rbp), %rcx
movq %r12, %rdi
leaq 0x45101(%rip), %rsi     # 0x1f8068
xorl %eax, %eax
callq 0x22b0
xorl %ebp, %ebp
cmpq 0x20(%r15), %rbp
jae 0x1b30b5
cmpb $0x0, (%r13,%rbp)
jne 0x1b30ad
movq 0x30(%r15), %rsi
imulq $0x24, %rbp, %rax
movb 0x20(%rsi,%rax), %cl
movl %ecx, %edx
andb $-0x40, %dl
negb %dl
setno %dl
testb $0x1f, %cl
sete %cl
orb %dl, %cl
jne 0x1b30ad
xorl %r9d, %r9d
movl %ebp, %edx
movl %ebp, %edi
cmpl $-0x1, %edx
je 0x1b2fd3
movl %edx, %ecx
movl %edx, %edx
movb $0x1, (%r13,%rdx)
incl %r9d
movq 0x30(%r15), %rsi
imulq $0x24, %rdx, %rdx
movl 0x1c(%rsi,%rdx), %edx
movl %ecx, %edi
jmp 0x1b2fb1
movl 0x18(%r15), %edx
movl 0x4(%rsi,%rax), %ecx
movl %edi, %eax
imulq $0x24, %rax, %rax
movl 0x8(%rsi,%rax), %r8d
movq %r12, %rdi
leaq 0x45080(%rip), %rsi     # 0x1f8070
xorl %eax, %eax
callq 0x22b0
movl %ebp, %eax
cmpl $-0x1, %eax
je 0x1b30a2
movq 0x30(%r15), %r14
movl %eax, %eax
imulq $0x24, %rax, %rbx
movl (%r14,%rbx), %eax
leal 0x1(%rax), %ecx
movq 0x20(%rsp), %rdx
movq 0x10(%rdx), %rdx
shrl %eax
imulq $0x28, %rax, %rax
movl (%rdx,%rax), %eax
shrl $0x1f, %eax
leaq 0x3365c(%rip), %rdx     # 0x1e668b
movsbl (%rax,%rdx), %r8d
movzbl 0x20(%r14,%rbx), %eax
btl $0x5, %eax
leaq 0x311de(%rip), %rax     # 0x1e4223
adcq $0x0, %rax
movsbl (%rax), %r9d
movq %r12, %rdi
leaq 0x45034(%rip), %rsi     # 0x1f808b
movq 0x18(%rsp), %rdx
xorl %eax, %eax
callq 0x22b0
movl 0x18(%r14,%rbx), %edx
cmpl $-0x1, %edx
je 0x1b3080
movq %r12, %rdi
leaq 0x45026(%rip), %rsi     # 0x1f809d
xorl %eax, %eax
callq 0x22b0
jmp 0x1b3095
leaq 0x45012(%rip), %rdi     # 0x1f8099
pushq $0x3
popq %rsi
pushq $0x1
popq %rdx
movq %r12, %rcx
callq 0x2410
movq 0x30(%r15), %rax
movl 0x1c(%rax,%rbx), %eax
jmp 0x1b2ff9
pushq $0xa
popq %rdi
movq %r12, %rsi
callq 0x2270
incq %rbp
jmp 0x1b2f70
movq 0x10(%rsp), %rcx
incq %rcx
movq 0x8(%rsp), %rsi
jmp 0x1b2e99
movq %r13, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2220