// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: output_trio_graph(asg_t*, ma_sub_t*, char*, ma_hit_t_alloc*, ma_hit_t_alloc*, long long, float, long long, R_to_U*, float, float, int, int, int, long long, ug_opt_t*, bub_label_t*)
void output_trio_graph(asg_t *sg, ma_sub_t* coverage_cut, char* output_file_name, 
ma_hit_t_alloc* sources, ma_hit_t_alloc* reverse_sources, long long tipsLen, float tip_drop_ratio, 
long long stops_threshold, R_to_U* ruIndex, float chimeric_rate, float drop_ratio, int max_hang, 
int min_ovlp, int is_bench, long long gap_fuzz, ug_opt_t *opt, bub_label_t* b_mask_t)
{
    reduce_hamming_error_adv(NULL, sg, sources, coverage_cut, max_hang, min_ovlp, gap_fuzz, opt->ruIndex, NULL);
    uint8_t *rf = NULL;

    if(asm_opt.kpt_rate > 0) CALLOC(rf, sg->n_seq); 

    output_trio_unitig_graph(sg, coverage_cut, output_file_name, FATHER, sources, 
        reverse_sources, tipsLen, tip_drop_ratio, stops_threshold, ruIndex, chimeric_rate, 
        drop_ratio, max_hang, min_ovlp, gap_fuzz, is_bench, b_mask_t, NULL, rf, NULL);
    
    output_trio_unitig_graph(sg, coverage_cut, output_file_name, MOTHER, sources, 
        reverse_sources, tipsLen, tip_drop_ratio, stops_threshold, ruIndex, chimeric_rate, 
        drop_ratio, max_hang, min_ovlp, gap_fuzz, is_bench, b_mask_t, NULL, rf, NULL);

    if(rf) {
        kvec_asg_arc_t_warp r_edges; kv_init(r_edges.a);
        ma_ug_t *kug = NULL; 
        char* kug_n = (char*)malloc(strlen(output_file_name)+100);
        sprintf(kug_n, "%s.kdp", output_file_name);

        update_dump_trio(R_INF.trio_flag, sg->n_seq, rf, NULL);
        kug = output_trio_unitig_graph(sg, coverage_cut, output_file_name, FATHER, sources, 
                reverse_sources, tipsLen, tip_drop_ratio, stops_threshold, ruIndex, chimeric_rate, 
                drop_ratio, max_hang, min_ovlp, gap_fuzz, 1, b_mask_t, NULL, NULL, &r_edges);
        filter_set_kug(R_INF.trio_flag, sg, rf, &r_edges, asm_opt.kpt_rate, &kug);
        print_utg(&kug, sg, coverage_cut, kug_n, sources, ruIndex, max_hang, min_ovlp, &r_edges);
        
        free(kug_n), kv_destroy(r_edges.a); ma_ug_destroy(kug); 
        free(rf);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movss %xmm2, 0xc(%rsp)
movss %xmm1, 0x8(%rsp)
movss %xmm0, 0x4(%rsp)
movq %r9, 0x40(%rsp)
movq %r8, %r14
movq %rdx, %rbx
movq %rsi, %rax
movq %rdi, %rbp
movq 0xd8(%rsp), %rdx
movl 0xc8(%rsp), %r9d
movl 0xc0(%rsp), %r8d
subq $0x20, %rsp
andq $0x0, 0x10(%rsp)
movq %rdx, (%rsp)
movq $0x0, 0x30(%rsp)
xorl %edi, %edi
movq %rbp, %rsi
movq %rcx, %r12
movq %rcx, %rdx
movq %rax, %r15
movq %rax, %rcx
callq 0x922b
addq $0x20, %rsp
leaq 0x28a2e0(%rip), %rax    # 0x295758
movss 0x208(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0xb49e
movl 0x14(%rbp), %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
pushq $0x1
popq %rsi
callq 0x2120
movq %rax, 0x10(%rsp)
subq $0x8, %rsp
pushq $0x1
popq %rcx
movq %rbp, %rdi
movq %r15, 0x20(%rsp)
movq %r15, %rsi
movq %rbx, %rdx
movq %rbp, %r15
movq %r12, %r8
movq %r14, %rbp
movq %r14, %r9
movss 0xc(%rsp), %xmm0
movss 0x10(%rsp), %xmm1
movss 0x14(%rsp), %xmm2
pushq $0x0
movq 0x20(%rsp), %r14
pushq %r14
pushq $0x0
movq 0x108(%rsp), %rax
pushq %rax
movl 0xf8(%rsp), %eax
pushq %rax
movq 0x108(%rsp), %r13
pushq %r13
movl 0x100(%rsp), %eax
pushq %rax
movl 0x100(%rsp), %eax
pushq %rax
movq 0x100(%rsp), %rax
pushq %rax
movq 0x100(%rsp), %r13
pushq %r13
movq 0x98(%rsp), %r13
pushq %r13
callq 0xc30dd
addq $0x58, %rsp
pushq $0x2
popq %rcx
movq %r15, 0x38(%rsp)
movq %r15, %rdi
movq 0x20(%rsp), %rsi
movq %rbx, %r15
movq %rbx, %rdx
movq %r12, 0x40(%rsp)
movq %r12, %r8
movq %rbp, %rbx
movq %rbp, %r9
movss 0xc(%rsp), %xmm0
movss 0x10(%rsp), %xmm1
movss 0x14(%rsp), %xmm2
pushq $0x0
pushq %r14
pushq $0x0
pushq 0x108(%rsp)
movl 0xf8(%rsp), %eax
pushq %rax
pushq 0x108(%rsp)
movl 0x100(%rsp), %eax
pushq %rax
movl 0x100(%rsp), %eax
pushq %rax
pushq 0x100(%rsp)
movq 0x100(%rsp), %rax
movq %rax, %rbp
pushq %rax
pushq %r13
callq 0xc30dd
addq $0x60, %rsp
testq %r14, %r14
jne 0xb5c1
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %r15, %rdi
movq %r15, 0x20(%rsp)
callq 0x2090
leaq 0x64(%rax), %rdi
callq 0x2280
movq %rax, 0x28(%rsp)
leaq 0x22c1a9(%rip), %rsi    # 0x23779c
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x28ac29(%rip), %rax    # 0x296230
movq 0x28(%rax), %rdi
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq 0x30(%rsp), %r14
andl 0x14(%r14), %esi
movq 0x10(%rsp), %r12
movq %r12, %rdx
xorl %ecx, %ecx
callq 0xc2d98
subq $0x60, %rsp
leaq 0xb0(%rsp), %rax
movq %rax, 0x50(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rsp)
movq 0x148(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x138(%rsp), %rax
movl %eax, 0x28(%rsp)
movl 0x128(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0x120(%rsp), %eax
movl %eax, 0x18(%rsp)
movq 0x118(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rbp, 0x8(%rsp)
movq %r13, (%rsp)
movl $0x1, 0x30(%rsp)
pushq $0x1
popq %rcx
movq %r14, %rdi
movq 0x78(%rsp), %r15
movq %r15, %rsi
movq 0x80(%rsp), %rdx
movq 0x98(%rsp), %rbp
movq %rbp, %r8
movq %rbx, %r9
movss 0x64(%rsp), %xmm0
movss 0x68(%rsp), %xmm1
movss 0x6c(%rsp), %xmm2
callq 0xc30dd
addq $0x60, %rsp
leaq 0x48(%rsp), %r13
movq %rax, (%r13)
leaq 0x28ab53(%rip), %rax    # 0x296230
movq 0x28(%rax), %rdi
leaq 0x28a070(%rip), %rax    # 0x295758
movss 0x208(%rax), %xmm0
movq %r14, %rsi
movq %r12, %rdx
leaq 0x50(%rsp), %rbx
movq %rbx, %rcx
movq %r13, %r8
callq 0xd9e6e
subq $0x8, %rsp
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq 0x30(%rsp), %r14
movq %r14, %rcx
movq %rbp, %r8
movq 0xc0(%rsp), %r9
pushq %rbx
movl 0xd8(%rsp), %eax
pushq %rax
movl 0xd8(%rsp), %eax
pushq %rax
callq 0x7f44
addq $0x20, %rsp
movq %r14, %rdi
callq 0x2220
movq 0x10(%rbx), %rdi
callq 0x2220
movq (%r13), %rdi
callq 0xa0761
movq %r12, %rdi
callq 0x2220
jmp 0xb5b2