// File: /workspace/github_cpp_makefile_star2_O2/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 0xd277d(%rip), %rsi     # 0x1ee846
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 0x926e3
addq $0x30, %rsp
testq %rbx, %rbx
je 0x11c14f
leaq 0xd273b(%rip), %rsi     # 0x1ee851
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0xde577(%rip), %rsi     # 0x1fa6a1
movq %r14, %rdi
callq 0x2210
movq %rax, %rbp
movq %r13, %rdi
movq (%rsp), %rsi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x11b65b
movq %rbp, %rdi
callq 0x2190
testq %r12, %r12
je 0x11c191
leaq 0xd2706(%rip), %rsi     # 0x1ee861
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0xde532(%rip), %rsi     # 0x1fa6a1
movq %r14, %rdi
callq 0x2210
movq %rax, %rbx
movq %r12, %rdi
movq (%rsp), %rsi
movq %rax, %rdx
callq 0x11b767
movq %rbx, %rdi
callq 0x2190
movq 0x18(%rsp), %r12
testq %r12, %r12
je 0x11c1de
leaq 0xd26d4(%rip), %rsi     # 0x1ee876
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0xde4eb(%rip), %rsi     # 0x1fa6a1
movq %r14, %rdi
callq 0x2210
movq %rax, %rbx
movq %r12, %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rax, %rcx
callq 0x11b871
movq %rbx, %rdi
callq 0x2190
movq 0x20(%rsp), %r12
testq %r12, %r12
je 0x11c236
leaq 0xd2698(%rip), %rsi     # 0x1ee887
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0xde49e(%rip), %rsi     # 0x1fa6a1
movq %r14, %rdi
callq 0x2210
movq %rax, %rbx
leaq 0xd1a66(%rip), %rdx     # 0x1edc7b
leaq 0xd20fb(%rip), %rcx     # 0x1ee317
leaq 0xcc24a(%rip), %r8      # 0x1e846d
movq %rax, %rdi
movq %r12, %rsi
callq 0x11b93a
movq %rbx, %rdi
callq 0x2190
movq %r14, %rdi
callq 0x2220
movq 0x136d9b(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0xcc99e(%rip), %rsi     # 0x1e8bed
leaq 0xd2642(%rip), %rdx     # 0x1ee898
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22b0