// File: /workspace/github_cpp_makefile_star2_O2/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, %r12
movq %r8, %r13
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, 0x10(%rsp)
callq 0x2090
leaq 0x32(%rax), %rdi
callq 0x2280
movq %rax, %r15
testq %rbx, %rbx
sete %al
movq %rbp, %xmm0
movq %r14, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
movq %r12, 0x20(%rsp)
movq %r12, %xmm0
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 0x1b3268
movq %r15, 0x18(%rsp)
movq 0x18(%rbx), %rax
movl 0x4(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edx, %edx
cmpq %rcx, %rdx
je 0x1b3212
movq 0x8(%rax), %rsi
movq 0x28(%rax), %r9
imulq $0x18, %rdx, %r10
leaq (%rsi,%r10), %rdi
movl 0x4(%rsi,%r10), %r8d
movl 0x8(%rsi,%r10), %r10d
xorq $0x1, %r10
movq (%r9,%r10,8), %r9
movl %r9d, %r10d
shrq $0x20, %r9
imulq $0x18, %r9, %r9
leaq (%rsi,%r9), %r11
addq $0x10, %r11
imulq $0x18, %r10, %r15
xorl %r10d, %r10d
cmpq %r10, %r15
je 0x1b31f3
cmpl $0x0, -0x4(%r11,%r10)
js 0x1b31d6
movl -0x8(%r11,%r10), %r12d
xorl %r8d, %r12d
cmpl $0x1, %r12d
je 0x1b31dc
addq $0x18, %r10
jmp 0x1b31bb
addq %r9, %rsi
movzwl 0x10(%rdi), %edi
xorw 0x10(%r10,%rsi), %di
incq %rdx
testw $0x3fff, %di            # imm = 0x3FFF
je 0x1b3176
leaq 0x44ea8(%rip), %rdi     # 0x1f80a2
leaq 0x442d8(%rip), %rsi     # 0x1f74d9
leaq 0x44eb6(%rip), %rcx     # 0x1f80be
movl $0x10f8, %edx           # imm = 0x10F8
callq 0x2110
leaq 0x35735(%rip), %rsi     # 0x1e894e
movq 0x18(%rsp), %r15
movq %r15, %rdi
movq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x4746d(%rip), %rsi     # 0x1fa6a1
movq %r15, %rdi
callq 0x2210
movq %rax, %r12
movq %rax, (%rsp)
leaq 0x3aa31(%rip), %r9      # 0x1edc7b
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq 0x20(%rsp), %r8
callq 0x7de8f
movq %r12, %rdi
callq 0x2190
movq 0x68(%rsp), %r14
movq 0x60(%rsp), %r12
testq %r12, %r12
je 0x1b32c7
leaq 0x3b609(%rip), %rsi     # 0x1ee887
movq %r15, %rdi
movq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x4740d(%rip), %rsi     # 0x1fa6a1
movq %r15, %rdi
callq 0x2210
movq %rax, %r13
leaq 0x3a9d5(%rip), %rdx     # 0x1edc7b
leaq 0x3b06a(%rip), %rcx     # 0x1ee317
leaq 0x351b9(%rip), %r8      # 0x1e846d
movq %rax, %rdi
movq %r12, %rsi
callq 0x1b273e
movq %r13, %rdi
callq 0x2190
testq %rbx, %rbx
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x1b3322
leaq 0x44e5f(%rip), %rsi     # 0x1f813d
movq %r15, %rdi
movq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x473ad(%rip), %rsi     # 0x1fa6a1
movq %r15, %rdi
callq 0x2210
movq %r15, %r12
movq %rax, %r15
leaq 0x3a972(%rip), %rdx     # 0x1edc7b
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rcx
callq 0x1b2e6c
movq %r15, %rdi
movq %r12, %r15
callq 0x2190
movq %r15, %rdi
callq 0x2220
movq 0x9fcaf(%rip), %rax     # 0x252fe0
movq (%rax), %rdi
leaq 0x358b2(%rip), %rsi     # 0x1e8bed
leaq 0x44e07(%rip), %rdx     # 0x1f8149
xorl %eax, %eax
callq 0x22b0
pushq $0x1
popq %rdi
callq 0x2250