// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: output_poly_trio(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, int, bub_label_t*, unsigned int)
void output_poly_trio(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 gap_fuzz, int is_bench, 
bub_label_t* b_mask_t, uint32_t hapN)
{
    uint32_t i;
    uint32_t *hapS = ha_polybin_list(&asm_opt);
    // debug_hapS(hapS, sg->n_seq);
    char *fp = NULL; MALLOC(fp, 100);
    for (i = 0; i < hapN; i++){
        update_poly_trio(1<<i, hapS, sg->n_seq);
        sprintf(fp, "hap%u", i+1);
        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, fp, NULL, NULL);
    }
    free(fp); free(hapS);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movss %xmm2, 0x74(%rsp)
movss %xmm1, 0x70(%rsp)
movss %xmm0, 0x6c(%rsp)
movq %r9, 0xb0(%rsp)
movq %r8, 0xa8(%rsp)
movq %rcx, 0xa0(%rsp)
movq %rdx, 0x98(%rsp)
movq %rsi, 0x90(%rsp)
movq %rdi, %rbp
movl 0x128(%rsp), %r15d
movq 0x120(%rsp), %rax
movq %rax, 0x88(%rsp)
movl 0x118(%rsp), %eax
movl %eax, 0x68(%rsp)
movl 0x110(%rsp), %eax
movl %eax, 0x64(%rsp)
movl 0x108(%rsp), %eax
movl %eax, 0x60(%rsp)
movl 0x100(%rsp), %eax
movl %eax, 0x5c(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x1c86e1(%rip), %rdi    # 0x28a758
callq 0x1033ce
movq %rax, %rbx
movl $0x64, %edi
callq 0x2280
movq %rax, %r14
testl %r15d, %r15d
je 0xc21ab
movl %r15d, %r13d
leaq 0x1c9191(%rip), %r12    # 0x28b230
xorl %r15d, %r15d
movl $0x1, %eax
movl %r15d, %ecx
shll %cl, %eax
movl 0x14(%rbp), %ecx
andq $0x7fffffff, %rcx       # imm = 0x7FFFFFFF
je 0xc20ef
xorl %edx, %edx
movq 0x28(%r12), %rsi
cmpb $0x5, (%rsi,%rdx)
je 0xc20e7
movb $0x0, (%rsi,%rdx)
movl (%rbx,%rdx,4), %esi
testl %esi, %esi
je 0xc20e7
andl %eax, %esi
cmpl $0x1, %esi
movl $0x0, %esi
adcb $0x1, %sil
movq 0x28(%r12), %rdi
movb %sil, (%rdi,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0xc20ba
incl %r15d
movq %r14, %rdi
leaq 0x16886d(%rip), %rsi    # 0x22a969
movl %r15d, %edx
xorl %eax, %eax
callq 0x2050
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rsp)
movq %r14, 0x40(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x38(%rsp)
movl 0x68(%rsp), %eax
movl %eax, 0x30(%rsp)
movl 0x64(%rsp), %eax
movl %eax, 0x28(%rsp)
movl 0x60(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0x5c(%rsp), %eax
movl %eax, 0x18(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
movl $0x1, %ecx
movq 0xa0(%rsp), %r8
movq 0xa8(%rsp), %r9
movss 0x6c(%rsp), %xmm0
movss 0x70(%rsp), %xmm1
movss 0x74(%rsp), %xmm2
callq 0xc21cc
cmpl %r13d, %r15d
jne 0xc20a2
movq %r14, %rdi
callq 0x2220
movq %rbx, %rdi
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2220