// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: print_debug_ul(char const*, ma_ug_t*, asg_t*, ma_sub_t const*, ma_hit_t_alloc*, R_to_U*, bubble_type*, all_ul_t*)
void print_debug_ul(const char* o_n, ma_ug_t *ug, asg_t *rg, const ma_sub_t *cov, ma_hit_t_alloc* src, R_to_U* ridx, 
bubble_type *bub, all_ul_t *uls)
{
    char* gfa_name = (char*)malloc(strlen(o_n)+50); FILE *fn;

    if(ug && rg && cov && src && ridx) {
        uint32_t k, m, v, w, an; asg_arc_t *p, *av;
        for (k = 0; k < ug->g->n_arc; k++) {
            p = &(ug->g->arc[k]); v = p->v^1; w = (p->ul>>32)^1;
            av = asg_arc_a(ug->g, v); an = asg_arc_n(ug->g, v);
            for (m = 0; m < an; m++) {
                if(av[m].del == 0 && av[m].v == w) break;
            }
            assert(m < an && av[m].ou == p->ou);
        }
        sprintf(gfa_name, "%s.r_utg.noseq.gfa", o_n); fn = fopen(gfa_name, "w");
        ma_ug_print_simple(ug, rg, cov, src, ridx, "utg", fn);
        fclose(fn);
    }

    if(bub) {
        sprintf(gfa_name, "%s.bub.noseq.gfa", o_n); fn = fopen(gfa_name, "w");
        print_bubble_gfa(fn, bub, "utg", "btg", "ctg");
        fclose(fn);
    }

    if(uls && ug) {
        sprintf(gfa_name, "%s.uls.ovlp", o_n); fn = fopen(gfa_name, "w");
        print_uls_ovlp(fn, uls, "utg", ug);
        fclose(fn);
    }

    free(gfa_name);
    fprintf(stderr, "[M::%s::] done\n", __func__);
    exit(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r13
movq %r8, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
callq 0x2090
leaq 0x32(%rax), %rdi
callq 0x2280
movq %rax, %r14
testq %rbx, %rbx
je 0x1f3d79
testq %r12, %r12
je 0x1f3d79
cmpq $0x0, 0x18(%rsp)
je 0x1f3d79
cmpq $0x0, 0x10(%rsp)
je 0x1f3d79
testq %r13, %r13
je 0x1f3d79
movq %r13, 0x20(%rsp)
movq 0x18(%rbx), %rdx
movl 0x4(%rdx), %eax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
jne 0x1f3e5a
leaq 0x36b31(%rip), %rsi     # 0x22a85e
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x486bd(%rip), %rsi     # 0x23c3fe
movq %r14, %rdi
callq 0x2210
movq %rax, %r13
movq %rax, (%rsp)
leaq 0x3bde4(%rip), %r9      # 0x22fb3b
movq %rbx, %rdi
movq %r12, %rsi
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq 0x20(%rsp), %r8
callq 0xb7f45
movq %r13, %rdi
callq 0x2190
movq 0x68(%rsp), %r12
movq 0x60(%rsp), %r13
testq %r13, %r13
je 0x1f3dd6
leaq 0x3c9fc(%rip), %rsi     # 0x23078b
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x4865b(%rip), %rsi     # 0x23c3fe
movq %r14, %rdi
callq 0x2210
movq %rax, %rbp
leaq 0x3bd86(%rip), %rdx     # 0x22fb3b
leaq 0x3c45f(%rip), %rcx     # 0x23021b
leaq 0x365ba(%rip), %r8      # 0x22a37d
movq %rax, %rdi
movq %r13, %rsi
callq 0x1f31e9
movq %rbp, %rdi
callq 0x2190
testq %rbx, %rbx
sete %al
testq %r12, %r12
sete %cl
orb %al, %cl
jne 0x1f3e29
leaq 0x4619c(%rip), %rsi     # 0x239f89
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x485fd(%rip), %rsi     # 0x23c3fe
movq %r14, %rdi
callq 0x2210
movq %rax, %r15
leaq 0x3bd28(%rip), %rdx     # 0x22fb3b
movq %rax, %rdi
movq %r12, %rsi
movq %rbx, %rcx
callq 0x1f39db
movq %r15, %rdi
callq 0x2190
movq %r14, %rdi
callq 0x2220
movq 0x961a8(%rip), %rax     # 0x289fe0
movq (%rax), %rdi
leaq 0x36cbb(%rip), %rsi     # 0x22aafd
leaq 0x4614c(%rip), %rdx     # 0x239f95
xorl %eax, %eax
callq 0x22b0
movl $0x1, %edi
callq 0x2250
movq 0x8(%rdx), %rcx
movq 0x28(%rdx), %rdx
leaq 0x10(%rcx), %rsi
xorl %edi, %edi
leaq (%rdi,%rdi,2), %r8
movl 0x8(%rcx,%r8,8), %r9d
xorq $0x1, %r9
movq (%rdx,%r9,8), %r10
testl %r10d, %r10d
je 0x1f3ee4
leaq (%rcx,%r8,8), %r8
movl 0x4(%r8), %r9d
movq %r10, %r11
shrq $0x20, %r11
movl %r10d, %r13d
leaq (%r11,%r11,2), %r10
leaq (%rsi,%r10,8), %r10
shlq $0x3, %r13
leaq (%r13,%r13,2), %r13
xorl %r11d, %r11d
cmpl $0x0, -0x4(%r10,%r11)
js 0x1f3eb9
movl -0x8(%r10,%r11), %ebp
xorl %r9d, %ebp
cmpl $0x1, %ebp
je 0x1f3ec4
addq $0x18, %r11
cmpq %r11, %r13
jne 0x1f3ea4
jmp 0x1f3ee4
movzwl 0x10(%r8), %r8d
xorw (%r11,%r10), %r8w
testl $0x3fff, %r8d           # imm = 0x3FFF
jne 0x1f3ee4
incq %rdi
cmpq %rax, %rdi
jne 0x1f3e68
jmp 0x1f3d26
leaq 0x46003(%rip), %rdi     # 0x239eee
leaq 0x45433(%rip), %rsi     # 0x239325
leaq 0x46011(%rip), %rcx     # 0x239f0a
movl $0x10f8, %edx           # imm = 0x10F8
callq 0x2110