// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: load_yak_binning(hifiasm_opt_t*, char*)
uint32_t load_yak_binning(hifiasm_opt_t *opt, char *ou)///asm_opt
{
    char* paf_name = (char*)malloc(strlen(ou)+50); 
    uint32_t len[2] = {0}; char *lst0, *lst1, *yak0, *yak1;
    lst0 = lst1 = yak0 = yak1 = NULL;

    sprintf(paf_name, "%s.hap1.phase.bin", ou); len[0] = strlen(paf_name)+1;
    if(!test_yak_binning(paf_name, opt->fn_bin_yak[0])) {
        free(paf_name); return 0;
    }

    sprintf(paf_name, "%s.hap2.phase.bin", ou); len[1] = strlen(paf_name)+1;
    if(!test_yak_binning(paf_name, opt->fn_bin_yak[1])) {
        free(paf_name); return 0;
    }
    free(paf_name); paf_name = NULL;

    lst0 = opt->fn_bin_list[0]; MALLOC(opt->fn_bin_list[0], len[0]); 
    sprintf(opt->fn_bin_list[0], "%s.hap1.phase.bin", ou);

    lst1 = opt->fn_bin_list[1]; MALLOC(opt->fn_bin_list[1], len[1]); 
    sprintf(opt->fn_bin_list[1], "%s.hap2.phase.bin", ou);

    memset(R_INF.trio_flag, AMBIGU, R_INF.total_reads * sizeof(uint8_t));
    yak0 = opt->fn_bin_yak[0]; opt->fn_bin_yak[0] = NULL;
    yak1 = opt->fn_bin_yak[1]; opt->fn_bin_yak[1] = NULL;
    ha_triobin(opt); 
    opt->fn_bin_yak[0] = yak0; opt->fn_bin_yak[1] = yak1;
    free(opt->fn_bin_list[0]); opt->fn_bin_list[0] = lst0;
    free(opt->fn_bin_list[1]); opt->fn_bin_list[1] = lst1;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20a0
movq %rax, %rdi
addq $0x32, %rdi
callq 0x2270
movq %rax, -0x20(%rbp)
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x2100
movq $0x0, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x2556e4(%rip), %rsi    # 0x3889cc
movb $0x0, %al
callq 0x2050
movq -0x20(%rbp), %rdi
callq 0x20a0
addq $0x1, %rax
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x16a000
cmpl $0x0, %eax
jne 0x13332a
movq -0x20(%rbp), %rdi
callq 0x2210
movl $0x0, -0x4(%rbp)
jmp 0x1334b5
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x2556a5(%rip), %rsi    # 0x3889de
movb $0x0, %al
callq 0x2050
movq -0x20(%rbp), %rdi
callq 0x20a0
addq $0x1, %rax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x16a000
cmpl $0x0, %eax
jne 0x13337b
movq -0x20(%rbp), %rdi
callq 0x2210
movl $0x0, -0x4(%rbp)
jmp 0x1334b5
movq -0x20(%rbp), %rdi
callq 0x2210
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x30(%rbp)
movl -0x28(%rbp), %eax
movl %eax, %edi
shlq $0x0, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0x255608(%rip), %rsi    # 0x3889cc
movb $0x0, %al
callq 0x2050
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x38(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %edi
shlq $0x0, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0x2555db(%rip), %rsi    # 0x3889de
movb $0x0, %al
callq 0x2050
leaq 0x291ebf(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rdi
leaq 0x291eb4(%rip), %rax    # 0x3c52d0
movq 0x50(%rax), %rdx
shlq $0x0, %rdx
xorl %esi, %esi
callq 0x2100
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x10(%rbp), %rdi
callq 0x16a7f0
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2210
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x2210
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop