// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: prt_debug_hic(char const*, ma_ug_t*, ha_ug_index*, ug_opt_t*, kvec_pe_hit*, kv_u_trans_t*, kv_u_trans_t*, hc_links*, signed char*, bubble_type*)
void prt_debug_hic(const char* o_n, ma_ug_t* ug, ha_ug_index* idx, ug_opt_t *opt, kvec_pe_hit* hits, 
kv_u_trans_t *utg_trans, kv_u_trans_t *p_arcs, hc_links* lk, int8_t *s, bubble_type *bub)
{
    char* gfa_name = (char*)malloc(strlen(o_n)+100); FILE *fn = NULL;

    sprintf(gfa_name, "%s.hic.dbg", o_n);
    print_debug_gfa(idx->read_g, idx->ug, opt->coverage_cut, gfa_name, opt->sources, opt->ruIndex, 
    opt->max_hang, opt->min_ovlp, 0, 0, 0);

    if(hits) {
        sprintf(gfa_name, "%s.hic.hits.log", o_n); fn = fopen(gfa_name, "w");
        prt_hits_noid(idx, ug, hits, fn);
        fclose(fn);
    }

    if(utg_trans) {
        sprintf(gfa_name, "%s.hic.utg.trans.log", o_n); fn = fopen(gfa_name, "w");
        prt_utg_trans(utg_trans, ug, fn);
        fclose(fn);
    }

    if(p_arcs) {
        sprintf(gfa_name, "%s.hic.parcs.log", o_n); fn = fopen(gfa_name, "w");
        prt_kv_u_trans(p_arcs, lk, s, fn);
        fclose(fn);
    }
    
    if(bub) {
        sprintf(gfa_name, "%s.bub.noseq.gfa", o_n); fn = fopen(gfa_name, "w");
        prt_bubble_gfa_adv(fn, bub, "utg", "btg", "ctg");
        fclose(fn);
    }
    
    free(gfa_name);
    fprintf(stderr, "[M::%s::] done\n", __func__);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r12
movq %r8, %rbx
movq %rcx, %rbp
movq %rdx, %r13
movq %rsi, (%rsp)
movq %rdi, %r15
movq 0x78(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x18(%rsp)
callq 0x2090
leaq 0x64(%rax), %rdi
callq 0x2280
movq %rax, %r14
leaq 0x214f19(%rip), %rsi    # 0x23074a
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
movq (%r13), %rsi
movq 0x8(%r13), %rdi
movq (%rbp), %rdx
movq 0x8(%rbp), %r8
movq 0x30(%rbp), %r9
movl 0x40(%rbp), %eax
movl 0x44(%rbp), %r10d
subq $0x8, %rsp
movq %r14, %rcx
pushq $0x0
pushq $0x0
pushq $0x0
pushq %r10
pushq %rax
callq 0xa632
addq $0x30, %rsp
testq %rbx, %rbx
je 0x1b8b7
leaq 0x214ed7(%rip), %rsi    # 0x230755
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x220b6c(%rip), %rsi    # 0x23c3fe
movq %r14, %rdi
callq 0x2210
movq %rax, %rbp
movq %r13, %rdi
movq (%rsp), %rsi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x15a8d9
movq %rbp, %rdi
callq 0x2190
testq %r12, %r12
je 0x1b8f9
leaq 0x214ea2(%rip), %rsi    # 0x230765
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x220b27(%rip), %rsi    # 0x23c3fe
movq %r14, %rdi
callq 0x2210
movq %rax, %rbx
movq %r12, %rdi
movq (%rsp), %rsi
movq %rax, %rdx
callq 0x15a9f6
movq %rbx, %rdi
callq 0x2190
movq 0x18(%rsp), %r12
testq %r12, %r12
je 0x1b946
leaq 0x214e70(%rip), %rsi    # 0x23077a
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x220ae0(%rip), %rsi    # 0x23c3fe
movq %r14, %rdi
callq 0x2210
movq %rax, %rbx
movq %r12, %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rax, %rcx
callq 0x15ab0f
movq %rbx, %rdi
callq 0x2190
movq 0x20(%rsp), %r12
testq %r12, %r12
je 0x1b99e
leaq 0x214e34(%rip), %rsi    # 0x23078b
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x220a93(%rip), %rsi    # 0x23c3fe
movq %r14, %rdi
callq 0x2210
movq %rax, %rbx
leaq 0x2141be(%rip), %rdx    # 0x22fb3b
leaq 0x214897(%rip), %rcx    # 0x23021b
leaq 0x20e9f2(%rip), %r8     # 0x22a37d
movq %rax, %rdi
movq %r12, %rsi
callq 0x15ac00
movq %rbx, %rdi
callq 0x2190
movq %r14, %rdi
callq 0x2220
movq 0x26e633(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x20f146(%rip), %rsi    # 0x22aafd
leaq 0x214dde(%rip), %rdx    # 0x23079c
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22b0