// File: /workspace/github_cpp_makefile_star2_O3/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, %r15
movq %r8, %r13
movq %rcx, %rbp
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, 0x10(%rsp)
callq 0x2090
leaq 0x32(%rax), %rdi
callq 0x2280
movq %rax, %r14
testq %rbx, %rbx
sete %al
movq %rbp, %xmm0
movq %r12, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
movq %r15, %xmm0
movq %r13, 0x20(%rsp)
movq %r13, %xmm2
punpcklqdq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0]
pxor %xmm0, %xmm0
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm0, %xmm1
movdqa %xmm1, %xmm0
shufps $0xdd, %xmm2, %xmm0     # xmm0 = xmm0[1,3],xmm2[1,3]
shufps $0x88, %xmm2, %xmm1     # xmm1 = xmm1[0,2],xmm2[0,2]
andps %xmm0, %xmm1
movmskps %xmm1, %ecx
testl %ecx, %ecx
setne %cl
orb %al, %cl
jne 0x1ff299
movq %r15, 0x18(%rsp)
movq 0x18(%rbx), %rdx
movl 0x4(%rdx), %eax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
jne 0x1ff37e
leaq 0x37801(%rip), %rsi     # 0x236a4e
movq %r14, %rdi
movq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x4947f(%rip), %rsi     # 0x2486e2
movq %r14, %rdi
callq 0x2210
movq %rax, %r15
movq %rax, (%rsp)
leaq 0x3cb12(%rip), %r9      # 0x23bd8b
movq %rbx, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq 0x20(%rsp), %rcx
movq 0x18(%rsp), %r8
callq 0xb8ee0
movq %r15, %rdi
callq 0x2190
movq 0x68(%rsp), %r12
movq 0x60(%rsp), %r13
testq %r13, %r13
je 0x1ff2f8
leaq 0x3d6e8(%rip), %rsi     # 0x23c997
movq %r14, %rdi
movq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x4941d(%rip), %rsi     # 0x2486e2
movq %r14, %rdi
callq 0x2210
movq %rax, %r15
leaq 0x3cab4(%rip), %rdx     # 0x23bd8b
leaq 0x3d149(%rip), %rcx     # 0x23c427
leaq 0x37288(%rip), %r8      # 0x23656d
movq %rax, %rdi
movq %r13, %rsi
callq 0x1fe6e7
movq %r15, %rdi
callq 0x2190
testq %rbx, %rbx
sete %al
testq %r12, %r12
sete %cl
orb %al, %cl
jne 0x1ff34d
leaq 0x46f5e(%rip), %rsi     # 0x24626d
movq %r14, %rdi
movq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x493bd(%rip), %rsi     # 0x2486e2
movq %r14, %rdi
callq 0x2210
movq %rax, %r15
leaq 0x3ca54(%rip), %rdx     # 0x23bd8b
movq %rax, %rdi
movq %r12, %rsi
movq %rbx, %rcx
callq 0x1feee3
movq %r15, %rdi
callq 0x2190
movq %r14, %rdi
callq 0x2220
movq 0x95c84(%rip), %rax     # 0x294fe0
movq (%rax), %rdi
leaq 0x37987(%rip), %rsi     # 0x236ced
leaq 0x46f0c(%rip), %rdx     # 0x246279
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 0x1ff408
leaq (%rcx,%r8,8), %r8
movl 0x4(%r8), %r9d
movq %r10, %r11
shrq $0x20, %r11
movl %r10d, %r15d
leaq (%r11,%r11,2), %r10
leaq (%rsi,%r10,8), %r10
shlq $0x3, %r15
leaq (%r15,%r15,2), %r15
xorl %r11d, %r11d
cmpl $0x0, -0x4(%r10,%r11)
js 0x1ff3dd
movl -0x8(%r10,%r11), %r13d
xorl %r9d, %r13d
cmpl $0x1, %r13d
je 0x1ff3e8
addq $0x18, %r11
cmpq %r11, %r15
jne 0x1ff3c7
jmp 0x1ff408
movzwl 0x10(%r8), %r8d
xorw (%r11,%r10), %r8w
testl $0x3fff, %r8d           # imm = 0x3FFF
jne 0x1ff408
incq %rdi
cmpq %rax, %rdi
jne 0x1ff38c
jmp 0x1ff246
leaq 0x46dc3(%rip), %rdi     # 0x2461d2
leaq 0x461f3(%rip), %rsi     # 0x245609
leaq 0x46dd1(%rip), %rcx     # 0x2461ee
movl $0x10f8, %edx           # imm = 0x10F8
callq 0x2110