// File: /workspace/github_cpp_makefile_star2_O1/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 0x1f3c99
movq %rsi, %rbx
movq %rdi, %r12
movq $0x0, 0x8(%rsp)
xorl %r15d, %r15d
xorl %ebp, %ebp
movq %rsi, 0x10(%rsp)
movq 0x48(%rbx), %r13
imulq $0x58, %rbp, %rcx
movq 0x20(%r13,%rcx), %rax
testq %rax, %rax
setne %dl
je 0x1f3c8a
movq %rbp, (%rsp)
shlq $0x4, %rbp
addq 0x10(%rbx), %rbp
addq %rcx, %r13
movq 0x30(%r13), %rcx
movb 0x20(%rcx), %sil
movl %esi, %edi
andb $-0x40, %dil
negb %dil
seto %dil
testb $0x1f, %sil
setne %sil
testb %sil, %dil
jne 0x1f3aa2
addq $0x44, %rcx
leaq -0x1(%rax), %rdx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x1f3c86
movb (%rcx), %dil
movl %edi, %r8d
andb $-0x40, %r8b
negb %r8b
setno %r8b
testb $0x1f, %dil
sete %dil
orb %r8b, %dil
addq $0x24, %rcx
incq %rsi
testb %dil, %dil
jne 0x1f3a6b
cmpq %rax, %rsi
setb %dl
testb %dl, %dl
je 0x1f3c86
cmpq %rax, 0x8(%rsp)
jae 0x1f3af8
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %r15, %rdi
movq %rsi, 0x8(%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 0x4639d(%rip), %rsi     # 0x239eb4
xorl %eax, %eax
callq 0x22b0
cmpq $0x0, 0x20(%r13)
je 0x1f3c86
xorl %ebp, %ebp
cmpb $0x0, (%r15,%rbp)
jne 0x1f3c79
movq 0x30(%r13), %rcx
leaq (,%rbp,8), %rax
addq %rbp, %rax
movb 0x20(%rcx,%rax,4), %cl
movl %ecx, %edx
andb $-0x40, %dl
negb %dl
setno %dl
testb $0x1f, %cl
sete %cl
orb %dl, %cl
jne 0x1f3c79
xorl %r9d, %r9d
cmpl $-0x1, %ebp
je 0x1f3b8a
movl %ebp, %ecx
movl %ecx, %esi
movl %ecx, %ecx
movb $0x1, (%r15,%rcx)
incl %r9d
movq 0x30(%r13), %rdx
leaq (%rcx,%rcx,8), %rcx
movl 0x1c(%rdx,%rcx,4), %ecx
cmpl $-0x1, %ecx
jne 0x1f3b6b
jmp 0x1f3b8c
movl %ebp, %esi
movl 0x18(%r13), %edx
movq 0x30(%r13), %rdi
movl 0x4(%rdi,%rax,4), %ecx
movl %esi, %eax
leaq (%rax,%rax,8), %rax
movl 0x8(%rdi,%rax,4), %r8d
movq %r12, %rdi
leaq 0x4630f(%rip), %rsi     # 0x239ebc
xorl %eax, %eax
callq 0x22b0
cmpl $-0x1, %ebp
je 0x1f3c67
movl %ebp, %eax
movq 0x30(%r13), %r14
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 0x34a3f(%rip), %rdx     # 0x22862b
movsbl (%rax,%rdx), %r8d
movzbl 0x20(%r14,%rbx,4), %eax
btl $0x5, %eax
leaq 0x325c1(%rip), %rax     # 0x2261c3
adcq $0x0, %rax
movsbl (%rax), %r9d
movq %r12, %rdi
leaq 0x462c3(%rip), %rsi     # 0x239ed7
movq 0x18(%rsp), %rdx
xorl %eax, %eax
callq 0x22b0
movl 0x18(%r14,%rbx,4), %edx
cmpl $-0x1, %edx
je 0x1f3c3d
movq %r12, %rdi
leaq 0x462b5(%rip), %rsi     # 0x239ee9
xorl %eax, %eax
callq 0x22b0
jmp 0x1f3c56
movl $0x3, %esi
movl $0x1, %edx
leaq 0x46297(%rip), %rdi     # 0x239ee5
movq %r12, %rcx
callq 0x2410
movq 0x30(%r13), %rax
movl 0x1c(%rax,%rbx,4), %eax
cmpl $-0x1, %eax
jne 0x1f3bbf
movl $0xa, %edi
movq %r12, %rsi
callq 0x2270
movq 0x10(%rsp), %rbx
incq %rbp
cmpq 0x20(%r13), %rbp
jb 0x1f3b2b
movq (%rsp), %rbp
incq %rbp
cmpq 0x50(%rbx), %rbp
jb 0x1f3a17
jmp 0x1f3c9c
xorl %r15d, %r15d
movq %r15, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2220