// File: 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
movq %rsp, %rbp
subq $0x80, %rsp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x20a0
movq %rax, %rdi
addq $0x32, %rdi
callq 0x2270
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x328a9b
cmpq $0x0, -0x18(%rbp)
je 0x328a9b
cmpq $0x0, -0x20(%rbp)
je 0x328a9b
cmpq $0x0, -0x28(%rbp)
je 0x328a9b
cmpq $0x0, -0x30(%rbp)
je 0x328a9b
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl 0x4(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0x328a40
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movl 0x8(%rax), %eax
xorl $0x1, %eax
movl %eax, -0x4c(%rbp)
movq -0x60(%rbp), %rax
movq (%rax), %rax
shrq $0x20, %rax
xorq $0x1, %rax
movl %eax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x4c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x4c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x54(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x54(%rbp), %eax
jae 0x3289c8
movq -0x68(%rbp), %rax
movl -0x48(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x3289bb
movq -0x68(%rbp), %rax
movl -0x48(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x50(%rbp), %eax
jne 0x3289bb
jmp 0x3289c8
jmp 0x3289bd
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x328982
movl -0x48(%rbp), %ecx
xorl %eax, %eax
cmpl -0x54(%rbp), %ecx
movb %al, -0x69(%rbp)
jae 0x328a06
movq -0x68(%rbp), %rax
movl -0x48(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movw 0x10(%rax), %ax
andw $0x3fff, %ax            # imm = 0x3FFF
movzwl %ax, %eax
movq -0x60(%rbp), %rcx
movw 0x10(%rcx), %cx
andw $0x3fff, %cx            # imm = 0x3FFF
movzwl %cx, %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x69(%rbp)
movb -0x69(%rbp), %al
testb $0x1, %al
jne 0x328a0f
jmp 0x328a11
jmp 0x328a30
leaq 0x6e36a(%rip), %rdi     # 0x396d82
leaq 0x6d79a(%rip), %rsi     # 0x3961b9
movl $0x10f8, %edx           # imm = 0x10F8
leaq 0x6e373(%rip), %rcx     # 0x396d9e
callq 0x2130
jmp 0x328a32
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x3288e2
movq -0x38(%rbp), %rdi
movq -0x8(%rbp), %rdx
leaq 0x5ea2d(%rip), %rsi     # 0x38747c
movb $0x0, %al
callq 0x2050
movq -0x38(%rbp), %rdi
leaq 0x70971(%rip), %rsi     # 0x3993d2
callq 0x2200
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x40(%rbp), %rax
leaq 0x63f1f(%rip), %r9      # 0x38c9a8
movq %rax, (%rsp)
callq 0xf1c10
movq -0x40(%rbp), %rdi
callq 0x21a0
cmpq $0x0, 0x10(%rbp)
je 0x328af7
movq -0x38(%rbp), %rdi
movq -0x8(%rbp), %rdx
leaq 0x64b47(%rip), %rsi     # 0x38d5f8
movb $0x0, %al
callq 0x2050
movq -0x38(%rbp), %rdi
leaq 0x7090f(%rip), %rsi     # 0x3993d2
callq 0x2200
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq 0x10(%rbp), %rsi
leaq 0x63ecd(%rip), %rdx     # 0x38c9a8
leaq 0x645a6(%rip), %rcx     # 0x38d088
leaq 0x5e4b0(%rip), %r8      # 0x386f99
callq 0x327950
movq -0x40(%rbp), %rdi
callq 0x21a0
cmpq $0x0, 0x18(%rbp)
je 0x328b50
cmpq $0x0, -0x10(%rbp)
je 0x328b50
movq -0x38(%rbp), %rdi
movq -0x8(%rbp), %rdx
leaq 0x6e309(%rip), %rsi     # 0x396e1d
movb $0x0, %al
callq 0x2050
movq -0x38(%rbp), %rdi
leaq 0x708ac(%rip), %rsi     # 0x3993d2
callq 0x2200
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq 0x18(%rbp), %rsi
movq -0x10(%rbp), %rcx
leaq 0x63e66(%rip), %rdx     # 0x38c9a8
callq 0x328450
movq -0x40(%rbp), %rdi
callq 0x21a0
movq -0x38(%rbp), %rdi
callq 0x2210
movq 0x9b480(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
leaq 0x5ebb1(%rip), %rsi     # 0x38771b
leaq 0x6e2b8(%rip), %rdx     # 0x396e29
movb $0x0, %al
callq 0x22a0
movl $0x1, %edi
callq 0x2240
nopw %cs:(%rax,%rax)