LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: Output_corrected_reads()
void Output_corrected_reads()
{
    long long i;
    UC_Read g_read;
    init_UC_Read(&g_read);
    char* gfa_name = (char*)malloc(strlen(asm_opt.output_file_name)+35);
    sprintf(gfa_name, "%s.ec.fa", asm_opt.output_file_name);
    FILE* output_file = fopen(gfa_name, "w");
    free(gfa_name);

    for (i = 0; i < (long long)R_INF.total_reads; i++)
    {
        recover_UC_Read(&g_read, &R_INF, i);
        fwrite(">", 1, 1, output_file);
        fwrite(Get_NAME(R_INF, i), 1, Get_NAME_LENGTH(R_INF, i), output_file);
        fwrite("\n", 1, 1, output_file);
        fwrite(g_read.seq, 1, g_read.length, output_file);
        fwrite("\n", 1, 1, output_file);
    }
    destory_UC_Read(&g_read);
    fclose(output_file);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x8(%rsp), %rdi
callq 0x32e2d
leaq 0x25c7ee(%rip), %rax    # 0x295758
movq 0x10(%rax), %rbx
movq %rbx, %rdi
callq 0x2090
leaq 0x23(%rax), %rdi
callq 0x2280
movq %rax, %r14
leaq 0x1f7d01(%rip), %rsi    # 0x230c8a
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x20f745(%rip), %rsi    # 0x2486e2
movq %r14, %rdi
callq 0x2210
movq %rax, %rbx
movq %r14, %rdi
callq 0x2220
cmpq $0x0, 0x25d2c8(%rip)    # 0x296280
jle 0x39053
xorl %r14d, %r14d
leaq 0x25d268(%rip), %r15    # 0x296230
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x333e0
movl $0x3e, %edi
movq %rbx, %rsi
callq 0x2270
movq 0x25d281(%rip), %rax    # 0x296270
movq (%rax,%r14,8), %rcx
movq 0x8(%rax,%r14,8), %rdx
movq 0x25d239(%rip), %rdi    # 0x296238
addq %rcx, %rdi
incq %r14
subq %rcx, %rdx
movl $0x1, %esi
movq %rbx, %rcx
callq 0x2410
movl $0xa, %edi
movq %rbx, %rsi
callq 0x2270
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
movl $0x1, %esi
movq %rbx, %rcx
callq 0x2410
movl $0xa, %edi
movq %rbx, %rsi
callq 0x2270
cmpq 0x25d233(%rip), %r14    # 0x296280
jl 0x38fcd
leaq 0x8(%rsp), %rdi
callq 0x32d68
movq %rbx, %rdi
callq 0x2190
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: Output_corrected_fastq()
void Output_corrected_fastq()
{
    long long i; uint64_t k;
    UC_Read g_read; asg8_v dv;
    init_UC_Read(&g_read); kv_init(dv);
    char* gfa_name = (char*)malloc(strlen(asm_opt.output_file_name)+35);
    sprintf(gfa_name, "%s.ec.fq", asm_opt.output_file_name);
    FILE* fp = fopen(gfa_name, "w");
    free(gfa_name);

    for (i = 0; i < (long long)R_INF.total_reads; i++) {
        recover_UC_Read(&g_read, &R_INF, i);
        fprintf(fp, "@%.*s\n", (int32_t)Get_NAME_LENGTH(R_INF, i), Get_NAME(R_INF, i));
        fprintf(fp, "%.*s\n", (int32_t)g_read.length, g_read.seq);        
        fprintf(fp, "+\n");
        retrive_bqual(&dv, NULL, i, -1, -1, 0, sc_bn);
        for (k = 0; k < dv.n; k++) fprintf(fp, "%c", (char)(sc_tb[dv.a[k]] + 33 - 1));
        fprintf(fp, "\n");
    }
    destory_UC_Read(&g_read); kv_destroy(dv);
    fclose(fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
leaq 0x28(%rsp), %rdi
callq 0x32e2d
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
leaq 0x25c6b7(%rip), %rax    # 0x295758
movq 0x10(%rax), %rbx
movq %rbx, %rdi
callq 0x2090
leaq 0x23(%rax), %rdi
callq 0x2280
movq %rax, %r14
leaq 0x1f7bd3(%rip), %rsi    # 0x230c93
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x20f60e(%rip), %rsi    # 0x2486e2
movq %r14, %rdi
callq 0x2210
movq %rax, %rbx
movq %r14, %rdi
callq 0x2220
cmpq $0x0, 0x25d191(%rip)    # 0x296280
jle 0x391eb
leaq 0x1f7670(%rip), %rbp    # 0x23076c
leaq 0x10(%rsp), %r14
leaq 0x1f7a88(%rip), %r12    # 0x230b90
xorl %r15d, %r15d
leaq 0x28(%rsp), %rdi
leaq 0x25d119(%rip), %rsi    # 0x296230
movq %r15, %rdx
callq 0x333e0
movq 0x25d14a(%rip), %rax    # 0x296270
movl 0x8(%rax,%r15,8), %edx
movq (%rax,%r15,8), %rcx
subl %ecx, %edx
addq 0x25d100(%rip), %rcx    # 0x296238
movq %rbx, %rdi
leaq 0x1f7b5a(%rip), %rsi    # 0x230c9c
xorl %eax, %eax
callq 0x22b0
movl 0x30(%rsp), %edx
movq 0x28(%rsp), %rcx
movq %rbx, %rdi
leaq 0x20d03e(%rip), %rsi    # 0x24619a
xorl %eax, %eax
callq 0x22b0
movl $0x2, %esi
movl $0x1, %edx
movq %rbp, %rdi
movq %rbx, %rcx
callq 0x2410
movq $0x2, (%rsp)
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq $-0x1, %rcx
movq $-0x1, %r8
xorl %r9d, %r9d
callq 0x33933
cmpq $0x0, 0x10(%rsp)
je 0x391ce
xorl %r13d, %r13d
movq 0x20(%rsp), %rax
movzbl (%rax,%r13), %eax
movb (%r12,%rax,8), %al
addb $0x20, %al
movsbl %al, %edi
movq %rbx, %rsi
callq 0x2270
incq %r13
cmpq 0x10(%rsp), %r13
jb 0x391a9
incq %r15
movl $0xa, %edi
movq %rbx, %rsi
callq 0x2270
cmpq 0x25d09b(%rip), %r15    # 0x296280
jl 0x3910b
leaq 0x28(%rsp), %rdi
callq 0x32d68
movq 0x20(%rsp), %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x2190
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: debug_print_pob_regions()
void debug_print_pob_regions()
{
    uint64_t i, total = 0;
    for (i = 0; i < R_INF.total_reads; i++)
    {
        if(R_INF.trio_flag[i]!=AMBIGU)
        {
            total++;
            fprintf(stderr, "(%lu) %.*s\n", i, (int)Get_NAME_LENGTH(R_INF, i), Get_NAME(R_INF, i));
        }
    }
    fprintf(stderr, "total hp reads: %lu, R_INF.total_reads: %lu\n", total, R_INF.total_reads);
    exit(1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x25d05b(%rip), %rcx    # 0x296280
testq %rcx, %rcx
jne 0x39253
xorl %ebx, %ebx
xorl %ecx, %ecx
movq 0x25bdab(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f7a70(%rip), %rsi    # 0x230caf
movq %rbx, %rdx
xorl %eax, %eax
callq 0x22b0
movl $0x1, %edi
callq 0x2250
movq 0x25cffe(%rip), %rax    # 0x296258
movq 0x25bd7f(%rip), %r12    # 0x294fe0
leaq 0x1f7a3b(%rip), %r14    # 0x230ca3
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpb $0x0, (%rax,%r15)
jne 0x3927e
incq %r15
cmpq %rcx, %r15
jb 0x3926d
jmp 0x3922e
incq %rbx
movq (%r12), %rdi
movq 0x25cfe4(%rip), %rax    # 0x296270
movl 0x8(%rax,%r15,8), %ecx
movq (%rax,%r15,8), %r8
subl %r8d, %ecx
addq 0x25cf99(%rip), %r8     # 0x296238
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x22b0
movq 0x25cfa5(%rip), %rax    # 0x296258
movq 0x25cfc6(%rip), %rcx    # 0x296280
jmp 0x39274
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: rescue_hp_reads(ha_ovec_buf_t**)
void rescue_hp_reads(ha_ovec_buf_t **b)
{
    int hom_cov, het_cov;
    ha_flt_tab_hp = ha_idx_hp = NULL;
    if (!(asm_opt.flag & HA_F_NO_KMER_FLT)) {
       ha_flt_tab_hp = ha_ft_gen(&asm_opt, &R_INF, &hom_cov, 1, 0);
    }
    ha_idx_hp = ha_pt_gen(&asm_opt, ha_flt_tab, 1, 1, &R_INF, &hom_cov, &het_cov);


    if (asm_opt.required_read_name)
		kt_for(asm_opt.thread_num, worker_ovec_related_reads, b, R_INF.total_reads);
	else
		kt_for(asm_opt.thread_num, worker_ovec, b, R_INF.total_reads);




    ha_ft_destroy(ha_flt_tab_hp); ha_flt_tab_hp = NULL;
    ha_pt_destroy(ha_idx_hp); ha_idx_hp = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x25d175(%rip), %r15    # 0x296448
xorl %eax, %eax
movq %rax, (%r15)
leaq 0x25d161(%rip), %r12    # 0x296440
movq %rax, (%r12)
leaq 0x25c46e(%rip), %r14    # 0x295758
testb $0x2, (%r14)
jne 0x39314
leaq 0x25c461(%rip), %rdi    # 0x295758
leaq 0x25cf32(%rip), %rsi    # 0x296230
leaq 0x8(%rsp), %rdx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x1390f
movq %rax, (%r12)
leaq 0x25d115(%rip), %rax    # 0x296430
movq (%rax), %rsi
leaq 0xc(%rsp), %rax
movq %rax, (%rsp)
leaq 0x25cf02(%rip), %r8     # 0x296230
leaq 0x8(%rsp), %r9
movq %r14, %rdi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x13d74
movq %rax, (%r15)
xorl %r13d, %r13d
cmpq %r13, 0x18(%r14)
movl 0x7c(%r14), %edi
movq 0x25cf26(%rip), %rcx    # 0x296280
leaq 0x78f(%rip), %rax       # 0x39af0
leaq 0x32(%rip), %rsi        # 0x3939a
cmoveq %rax, %rsi
movq %rbx, %rdx
callq 0x108f2c
movq (%r12), %rdi
callq 0x11a4e8
movq %r13, (%r12)
movq (%r15), %rdi
callq 0x1193ff
movq %r13, (%r15)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: prt_dbg_rs(_IO_FILE*, Debug_reads*, unsigned long)
void prt_dbg_rs(FILE *fp, Debug_reads* x, uint64_t round)
{
    uint64_t k, id; UC_Read g_read; init_UC_Read(&g_read);
    for (k = 0; k < R_INF_FLAG.query_num; k++) {
        id = x->read_id[k];
        if(id == ((uint64_t)-1)) continue;
        recover_UC_Read(&g_read, &R_INF, id);
        fprintf(fp, ">%.*s_r%lu\n", (int)Get_NAME_LENGTH((R_INF), id), Get_NAME((R_INF), id), round);
        fprintf(fp, "%.*s\n", (int)g_read.length, g_read.seq);
    }
    destory_UC_Read(&g_read);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %rdi
callq 0x32e2d
movq 0x25c37f(%rip), %rax    # 0x2962c8
testq %rax, %rax
je 0x39fcb
leaq 0x20c245(%rip), %r12    # 0x24619a
xorl %ebp, %ebp
movq 0x8(%r14), %rcx
movq (%rcx,%rbp,8), %r13
cmpq $-0x1, %r13
je 0x39fc3
leaq 0x8(%rsp), %rdi
leaq 0x25c2bf(%rip), %rsi    # 0x296230
movq %r13, %rdx
callq 0x333e0
movq 0x25c2f0(%rip), %rax    # 0x296270
movl 0x8(%rax,%r13,8), %edx
movq (%rax,%r13,8), %rcx
subl %ecx, %edx
addq 0x25c2a6(%rip), %rcx    # 0x296238
movq %r15, %rdi
leaq 0x1f6d9a(%rip), %rsi    # 0x230d36
movq %rbx, %r8
xorl %eax, %eax
callq 0x22b0
movl 0x10(%rsp), %edx
movq 0x8(%rsp), %rcx
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x22b0
movq 0x25c305(%rip), %rax    # 0x2962c8
incq %rbp
cmpq %rax, %rbp
jb 0x39f57
leaq 0x8(%rsp), %rdi
callq 0x32d68
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: ha_ec_dbg()
int ha_ec_dbg(void)
{
	int hom_cov, het_cov;

    ha_idx = ha_pt_gen(&asm_opt, 0, 0, 0, &R_INF, &hom_cov, &het_cov); // build the index
    asm_opt.hom_cov = hom_cov; asm_opt.het_cov = het_cov;
	ha_opt_update_cov(&asm_opt, hom_cov);

    cal_ec_r_dbg(asm_opt.thread_num, R_INF.total_reads);

    ha_pt_destroy(ha_idx); ha_idx = NULL;

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x10(%rsp), %r15
movq %r15, (%rsp)
leaq 0x25b508(%rip), %rbx    # 0x295758
leaq 0x25bfd9(%rip), %r8     # 0x296230
leaq 0x14(%rsp), %r14
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, %r9
callq 0x13d74
leaq 0x25c1c4(%rip), %r12    # 0x296438
movq %rax, (%r12)
movl (%r14), %esi
movl %esi, 0xd0(%rbx)
movl (%r15), %eax
movl %eax, 0xd4(%rbx)
movq %rbx, %rdi
callq 0x2f59
movslq 0x7c(%rbx), %rdi
movq 0x25bfe3(%rip), %rsi    # 0x296280
callq 0x194515
movq (%r12), %rdi
callq 0x1193ff
movq $0x0, (%r12)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: check_chain_indels(Fake_Cigar*, long long, long long, float)
int check_chain_indels(Fake_Cigar* chain, long long xBeg, long long xEnd, float indel_rate)
{
    uint64_t i = 0;
    long long indels = 0, xOffset;
    if(chain->length != 0)
    {
        indels += abs(get_fake_gap_shift(chain, 0));
        xOffset = get_fake_gap_pos(chain, 0);
        if(indels > (xOffset - xBeg + 1) * indel_rate) return 0;

        for (i = 1; i < chain->length; i++)
        {
            indels += abs((get_fake_gap_shift(chain, i) - get_fake_gap_shift(chain, i-1)));
            xOffset = get_fake_gap_pos(chain, i);
            if(indels > (xOffset - xBeg + 1) * indel_rate) return 0;
        }
    }

    if(indels > (xEnd - xBeg + 1) * indel_rate) return 0;
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r15
xorl %r14d, %r14d
cmpl $0x0, 0x8(%rdi)
je 0x3aefd
movq %rdi, %r12
xorl %esi, %esi
movss %xmm0, 0xc(%rsp)
callq 0x3d11b
movl %eax, %ebp
negl %ebp
cmovsl %eax, %ebp
movq %r12, %rdi
xorl %esi, %esi
callq 0x3d110
movss 0xc(%rsp), %xmm0
cltq
cvtsi2ss %ebp, %xmm2
subq %r15, %rax
incq %rax
cvtsi2ss %rax, %xmm1
mulss %xmm0, %xmm1
ucomiss %xmm1, %xmm2
ja 0x3af2e
movq %rbx, 0x10(%rsp)
movl %ebp, %r14d
cmpl $0x2, 0x8(%r12)
jb 0x3af05
movl $0x1, %r13d
movq %r14, %rbx
movq %r12, %rdi
movl %r13d, %esi
callq 0x3d11b
movl %eax, %ebp
leal -0x1(%r13), %esi
movq %r12, %rdi
callq 0x3d11b
subl %eax, %ebp
movl %ebp, %r14d
negl %r14d
cmovsl %ebp, %r14d
addq %rbx, %r14
movq %r12, %rdi
movl %r13d, %esi
callq 0x3d110
movss 0xc(%rsp), %xmm0
cltq
xorps %xmm2, %xmm2
cvtsi2ss %r14, %xmm2
subq %r15, %rax
incq %rax
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
mulss %xmm0, %xmm1
ucomiss %xmm1, %xmm2
ja 0x3af40
incq %r13
movl 0x8(%r12), %eax
cmpq %rax, %r13
jb 0x3ae91
jmp 0x3af05
movq %rbx, 0x10(%rsp)
xorl %r14d, %r14d
xorps %xmm2, %xmm2
cvtsi2ss %r14, %xmm2
movq 0x10(%rsp), %rax
subq %r15, %rax
incq %rax
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
mulss %xmm0, %xmm1
xorl %r14d, %r14d
ucomiss %xmm1, %xmm2
setbe %r14b
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
jmp 0x3af2e
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: update_exact_overlaps(overlap_region_alloc*, UC_Read*, UC_Read*)
void update_exact_overlaps(overlap_region_alloc* overlap_list, UC_Read* g_read, UC_Read* overlap_read)
{
    uint64_t j;
    for (j = 0; j < overlap_list->length; j++)
    {
        if (overlap_list->list[j].is_match != 1)
        {
            if((overlap_list->list[j].x_pos_e + 1 - overlap_list->list[j].x_pos_s) != 
               (overlap_list->list[j].y_pos_e + 1 - overlap_list->list[j].y_pos_s))
            {
                continue;
            }

            if(overlap_list->list[j].y_pos_strand == 0)
            {
                recover_UC_Read(overlap_read, &R_INF, overlap_list->list[j].y_id);
            }
            else
            {
                recover_UC_Read_RC(overlap_read, &R_INF, overlap_list->list[j].y_id);
            }

            if(if_exact_match(g_read->seq, g_read->length, overlap_read->seq, overlap_read->length, 
            overlap_list->list[j].x_pos_s, overlap_list->list[j].x_pos_e, 
            overlap_list->list[j].y_pos_s, overlap_list->list[j].y_pos_e))
            {
                overlap_list->list[j].is_match = 1;
                overlap_list->list[j].strong = 0;
                overlap_list->list[j].without_large_indel = 1;
                overlap_list->list[j].shared_seed = 1;
            }
        }
    }
}

// Assembly:
cmpq $0x0, 0x10(%rdi)
je 0x3b25d
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %r12
xorl %r13d, %r13d
xorl %ebp, %ebp
cmpb $0x1, 0x2c(%r12,%r13)
je 0x3b23b
movl 0x8(%r12,%r13), %eax
subl 0x4(%r12,%r13), %eax
movl 0x18(%r12,%r13), %ecx
subl 0x14(%r12,%r13), %ecx
cmpl %ecx, %eax
jne 0x3b23b
cmpl $0x0, 0x1c(%r12,%r13)
movl 0x10(%r12,%r13), %edx
movq %rbx, %rdi
leaq 0x25b04e(%rip), %rsi    # 0x296230
je 0x3b1eb
callq 0x334a6
jmp 0x3b1f0
callq 0x333e0
movq (%r15), %r12
movl 0x4(%r12,%r13), %edi
movl 0x8(%r12,%r13), %edx
movl 0x14(%r12,%r13), %esi
movl 0x18(%r12,%r13), %eax
subq %rdi, %rdx
subq %rsi, %rax
cmpq %rdx, %rax
jne 0x3b23b
incq %rdx
addq (%r14), %rdi
addq (%rbx), %rsi
callq 0x21a0
testl %eax, %eax
jne 0x3b23b
movw $0x101, 0x2c(%r12,%r13) # imm = 0x101
movb $0x0, 0x2e(%r12,%r13)
movl $0x1, 0x24(%r12,%r13)
incq %rbp
addq $0xa8, %r13
cmpq 0x10(%r15), %rbp
jb 0x3b1a9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: Final_phasing(overlap_region_alloc*, Cigar_record_alloc*, UC_Read*, UC_Read*, unsigned char*)
void Final_phasing(overlap_region_alloc* overlap_list, Cigar_record_alloc* cigarline,
UC_Read* g_read, UC_Read* overlap_read, uint8_t* c2n)
{
    uint64_t i, xLen, yStrand;
    char* x_string;
    char* y_string;
    Cigar_record* cigar;
    resize_Cigar_record_alloc(cigarline, overlap_list->length);



    for (i = 0; i < overlap_list->length; i++)
    {
        if(overlap_list->list[i].is_match == 1 ||
           overlap_list->list[i].is_match == 2 ||
           overlap_list->list[i].is_match == 3)
        {
            xLen = overlap_list->list[i].x_pos_e - overlap_list->list[i].x_pos_s + 1;
            yStrand = overlap_list->list[i].y_pos_strand;
            cigar = &(cigarline->buffer[i]);
            ///has already been matched exactly
            if(overlap_list->list[i].is_match == 1 && overlap_list->list[i].shared_seed == 1)
            {
                add_cigar_record(g_read->seq + overlap_list->list[i].x_pos_s, xLen, cigar, 0);
            }
            else 
            {
                if(yStrand == 0)
                {
                    recover_UC_Read(overlap_read, &R_INF, overlap_list->list[i].y_id);
                }
                else
                {
                    recover_UC_Read_RC(overlap_read, &R_INF, overlap_list->list[i].y_id);
                }
                x_string = g_read->seq;
                y_string = overlap_read->seq;

                fill_chain(&(overlap_list->list[i].f_cigar), x_string, y_string, 
                overlap_list->list[i].x_pos_s, overlap_list->list[i].y_pos_s,
                Get_READ_LENGTH(R_INF, overlap_list->list[i].x_id), 
                Get_READ_LENGTH(R_INF, overlap_list->list[i].y_id), cigar, c2n);
            }

        }
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rsi, %rax
movq %rdi, %r15
movq 0x10(%rdi), %rsi
movq %rax, 0x10(%rsp)
movq %rax, %rdi
callq 0x589d3
cmpq $0x0, 0x10(%r15)
je 0x3b348
movl $0x2c, %r13d
xorl %r14d, %r14d
leaq 0x25af8e(%rip), %rbp    # 0x296230
xorl %r12d, %r12d
movq %rbx, 0x8(%rsp)
movq (%r15), %rax
movb (%rax,%r13), %dl
leal -0x1(%rdx), %ecx
cmpb $0x2, %cl
ja 0x3b330
movl -0x10(%rax,%r13), %ecx
cmpb $0x1, %dl
jne 0x3b2f4
cmpl $0x1, -0x8(%rax,%r13)
jne 0x3b2f4
movl -0x24(%rax,%r13), %ebp
subl -0x28(%rax,%r13), %ebp
incl %ebp
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rbx
leaq (%rbx,%r14), %rdi
cmpb $0x0, (%rdi)
je 0x3b311
movl %ebp, %esi
xorl %edx, %edx
callq 0x58afb
jmp 0x3b31a
movl -0x1c(%rax,%r13), %edx
movq %rbx, %rdi
movq %rbp, %rsi
testl %ecx, %ecx
je 0x3b30a
callq 0x334a6
jmp 0x3b330
callq 0x333e0
jmp 0x3b330
movl %ebp, %esi
xorl %edx, %edx
callq 0x58b4b
addl %ebp, 0x20(%rbx,%r14)
movb $0x0, (%rbx,%r14)
movq 0x8(%rsp), %rbx
leaq 0x25af00(%rip), %rbp    # 0x296230
incq %r12
addq $0x40, %r14
addq $0xa8, %r13
cmpq 0x10(%r15), %r12
jb 0x3b2aa
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: reset_final_overlaps(overlap_region_alloc*)
void reset_final_overlaps(overlap_region_alloc *overlap_list)
{
    
    uint64_t i;
    for (i = 0; i < overlap_list->length; i++)
    {
        if (overlap_list->list[i].is_match == 1 || overlap_list->list[i].is_match == 2)
        {
            overlap_list->list[i].x_pos_s = overlap_list->list[i].x_pos_e = (uint32_t)-1;
            overlap_list->list[i].y_pos_s = overlap_list->list[i].y_pos_e = (uint32_t)-1;
            overlap_list->list[i].is_match = 0;
        }
    }

    ha_sort_list_by_anchor(overlap_list);
}

// Assembly:
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x12aa75
movq (%rdi), %rcx
addq $0x2c, %rcx
movq $-0x1, %rdx
movb (%rcx), %sil
decb %sil
cmpb $0x1, %sil
ja 0x3b389
movq %rdx, -0x28(%rcx)
movq %rdx, -0x18(%rcx)
movb $0x0, (%rcx)
addq $0xa8, %rcx
decq %rax
jne 0x3b372
jmp 0x12aa75
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: debug_affine_gap_alignment(overlap_region_alloc*, UC_Read*, UC_Read*)
void debug_affine_gap_alignment(overlap_region_alloc *overlap_list, UC_Read* g_read, UC_Read* overlap_read)
{
    uint64_t i;
    kvec_t(uint8_t) x_num;
    kvec_t(uint8_t) y_num;
    kv_init(x_num);
    kv_init(y_num);
    for (i = 0; i < overlap_list->length; i++)
    {
        if (overlap_list->list[i].is_match == 1 && overlap_list->list[i].shared_seed == 1)
        {

            kv_resize(uint8_t, x_num, (uint64_t)(Get_READ_LENGTH(R_INF, overlap_list->list[i].x_id)));
            kv_resize(uint8_t, y_num, (uint64_t)(Get_READ_LENGTH(R_INF, overlap_list->list[i].y_id)));

            get_affine_gap_score(&(overlap_list->list[i]), g_read, overlap_read, x_num.a, y_num.a,
            overlap_list->list[i].x_pos_e + 1 - overlap_list->list[i].x_pos_s, 
            overlap_list->list[i].y_pos_e + 1 - overlap_list->list[i].y_pos_s);
        }
    }

    kv_destroy(x_num);
    kv_destroy(y_num);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x3b504
movq %rdi, %r15
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %ebp, %ebp
xorl %r13d, %r13d
movq $0x0, 0x10(%rsp)
xorl %ebx, %ebx
movq (%r15), %rcx
cmpb $0x1, 0x2c(%rcx,%r14)
jne 0x3b4ef
cmpl $0x1, 0x24(%rcx,%r14)
jne 0x3b4ef
movq 0x25ae4e(%rip), %rsi    # 0x296248
movl (%rcx,%r14), %edx
movq (%rsi,%rdx,8), %rdx
cmpq %rdx, %rbx
jae 0x3b45a
decq %rdx
movq %rdx, %rax
shrq %rax
orq %rdx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rbx
shrq $0x10, %rbx
orq %rcx, %rbx
incq %rbx
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x2370
movq %rax, 0x10(%rsp)
movq 0x25adf1(%rip), %rsi    # 0x296248
movq (%r15), %rcx
movq %r13, %rax
movl 0x10(%rcx,%r14), %edx
movq (%rsi,%rdx,8), %rdx
cmpq %rdx, %rbp
jae 0x3b4b0
decq %rdx
movq %rdx, %rcx
shrq %rcx
orq %rdx, %rcx
movq %rcx, %rdx
shrq $0x2, %rdx
orq %rcx, %rdx
movq %rdx, %rcx
shrq $0x4, %rcx
orq %rdx, %rcx
movq %rcx, %rdx
shrq $0x8, %rdx
orq %rcx, %rdx
movq %rdx, %rbp
shrq $0x10, %rbp
orq %rdx, %rbp
incq %rbp
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2370
movq (%r15), %rcx
leaq (%rcx,%r14), %rdi
movl 0x8(%rcx,%r14), %r9d
movl 0x18(%rcx,%r14), %edx
subl 0x4(%rcx,%r14), %r9d
incl %r9d
subl 0x14(%rcx,%r14), %edx
incl %edx
movq %rdx, (%rsp)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %rax, %r13
movq %rax, %r8
callq 0x58ca2
movq 0x10(%r15), %rax
incq %r12
addq $0xa8, %r14
cmpq %rax, %r12
jb 0x3b3d8
jmp 0x3b510
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
movq 0x10(%rsp), %rdi
callq 0x2220
movq %r13, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: check_cluster(unsigned long*, long long, ma_hit_t_alloc*, float)
int check_cluster(uint64_t* list, long long listLen, ma_hit_t_alloc* paf, float threshold)
{
    long long i, k;
    uint32_t qn, tn;
    long long T_edges, A_edges;
    T_edges = A_edges = 0;
    for (i = 0; i < listLen; i++)
    {
        qn = (uint32_t)list[i];
        for (k = i + 1; k < listLen; k++)
        {
            tn = (uint32_t)list[k];
            if(get_specific_overlap(&(paf[qn]), qn, tn) != -1)
            {
                A_edges++;
            }

            if(get_specific_overlap(&(paf[tn]), tn, qn) != -1)
            {
                A_edges++;
            }

            T_edges = T_edges + 2;
        }

    }

    if(A_edges >= (T_edges*threshold))
    {
        return 1;
    }
    else
    {
        return 0;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, 0x10(%rsp)
testq %rsi, %rsi
jle 0x3b61f
movss %xmm0, 0xc(%rsp)
xorl %r15d, %r15d
xorl %ebx, %ebx
xorl %eax, %eax
movq %rsi, 0x28(%rsp)
movq %rdi, 0x20(%rsp)
leaq 0x1(%rax), %r14
cmpq %rsi, %r14
movq %r14, 0x18(%rsp)
jge 0x3b5ff
movq (%rdi,%rax,8), %rax
movq %rax, 0x38(%rsp)
movl %eax, %eax
leaq (%rax,%rax,2), %rax
movq 0x10(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
movq %rax, 0x30(%rsp)
movq (%rdi,%r14,8), %rbp
movl %ebp, %eax
movq %rax, 0x40(%rsp)
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %r13
movl %r13d, %esi
movl %ebp, %edx
callq 0xa0c99
xorl %r12d, %r12d
cmpq $-0x1, %rax
setne %r12b
addq %r15, %r12
movq 0x40(%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x10(%rsp), %rcx
leaq (%rcx,%rax,8), %rdi
movl %ebp, %esi
movl %r13d, %edx
callq 0xa0c99
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
xorl %r15d, %r15d
cmpq $-0x1, %rax
setne %r15b
addq %r12, %r15
addq $0x2, %rbx
incq %r14
cmpq %rsi, %r14
jl 0x3b592
movq 0x18(%rsp), %rax
cmpq %rsi, %rax
jne 0x3b563
cvtsi2ss %r15, %xmm1
cvtsi2ss %rbx, %xmm2
movss 0xc(%rsp), %xmm0
jmp 0x3b625
xorps %xmm2, %xmm2
xorps %xmm1, %xmm1
mulss %xmm0, %xmm2
xorl %eax, %eax
ucomiss %xmm2, %xmm1
setae %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: ha_overlap_final()
void ha_overlap_final(void)
{
	int i, hom_cov, het_cov;
	ha_ovec_buf_t **b;
    ha_flt_tab_hp = ha_idx_hp = NULL;

	CALLOC(b, asm_opt.thread_num);
	for (i = 0; i < asm_opt.thread_num; ++i)
		b[i] = ha_ovec_init(asm_opt.flag & HA_F_HIGH_HET, 1,0);///b[i] = ha_ovec_init(1, 1);
	ha_idx = ha_pt_gen(&asm_opt, ha_flt_tab, 1, 0, &R_INF, &hom_cov, &het_cov); // build the index
    // if(asm_opt.flag & HA_F_HIGH_HET)
    // {
    //     kt_for(asm_opt.thread_num, worker_ov_final_high_het, b, R_INF.total_reads);
    // }
    // else
    {
        kt_for(asm_opt.thread_num, worker_ov_final, b, R_INF.total_reads);
    }
    
	ha_pt_destroy(ha_idx);
	ha_idx = 0;
	for (i = 0; i < asm_opt.thread_num; ++i)
		ha_ovec_destroy(b[i]);
	free(b);
    asm_opt.hom_cov = hom_cov;
    asm_opt.het_cov = het_cov;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0x25adf7(%rip), %rax    # 0x296448
xorl %ecx, %ecx
movq %rcx, (%rax)
leaq 0x25ade3(%rip), %rax    # 0x296440
movq %rcx, (%rax)
leaq 0x25a0f1(%rip), %rbx    # 0x295758
movslq 0x7c(%rbx), %r15
movl $0x8, %esi
movq %r15, %rdi
callq 0x2120
movq %rax, %r14
testq %r15, %r15
jle 0x3b6a8
xorl %r15d, %r15d
movl $0x400, %ebp            # imm = 0x400
movl (%rbx), %edi
andl %ebp, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x387f4
movq %rax, (%r14,%r15,8)
incq %r15
movslq 0x7c(%rbx), %rax
cmpq %rax, %r15
jl 0x3b688
leaq 0x25ad81(%rip), %rax    # 0x296430
movq (%rax), %rsi
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
leaq 0x25ab6e(%rip), %r8     # 0x296230
leaq 0x14(%rsp), %r9
movq %rbx, %rdi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x13d74
leaq 0x25ad5b(%rip), %r15    # 0x296438
movq %rax, (%r15)
movl 0x7c(%rbx), %edi
movq 0x25ab96(%rip), %rcx    # 0x296280
leaq 0x5c(%rip), %rsi        # 0x3b74d
movq %r14, %rdx
callq 0x108f2c
movq (%r15), %rdi
callq 0x1193ff
movq $0x0, (%r15)
cmpl $0x0, 0x7c(%rbx)
jle 0x3b726
xorl %r15d, %r15d
movq (%r14,%r15,8), %rdi
callq 0x38b4b
incq %r15
movslq 0x7c(%rbx), %rax
cmpq %rax, %r15
jl 0x3b711
movq %r14, %rdi
callq 0x2220
movl 0x14(%rsp), %eax
movl %eax, 0xd0(%rbx)
movl 0x10(%rsp), %eax
movl %eax, 0xd4(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: worker_ov_final(void*, long, int)
static void worker_ov_final(void *data, long i, int tid)
{
	ha_ovec_buf_t *b = ((ha_ovec_buf_t**)data)[tid];

	//get_new_candidates(i, &g_read, &overlap_list, &array_list, &l, 0.001, 0);
    ha_get_candidates_interface(b->ab, i, &b->self_read, &b->olist, &b->olist_hp, &b->clist, 0.001, 
    asm_opt.max_n_chain, 0, NULL/**&(b->k_flag)**/, &b->r_buf, &(R_INF.paf[i]), &(R_INF.reverse_paf[i]), &(b->tmp_region), NULL, &(b->sp));

	overlap_region_sort_y_id(b->olist.list, b->olist.length);
	ma_hit_sort_tn(R_INF.paf[i].buffer, R_INF.paf[i].length);
	ma_hit_sort_tn(R_INF.reverse_paf[i].buffer, R_INF.reverse_paf[i].length);

	update_overlaps(&b->olist, &(R_INF.paf[i]), &b->self_read, &b->ovlp_read, 1, 1);
	update_overlaps(&b->olist, &(R_INF.reverse_paf[i]), &b->self_read, &b->ovlp_read, 2, 0);
	///recover missing exact overlaps
	update_exact_overlaps(&b->olist, &b->self_read, &b->ovlp_read);

	///Final_phasing(&overlap_list, &cigarline, &g_read, &overlap_read, c2n);
	push_final_overlaps(&(R_INF.paf[i]), R_INF.reverse_paf, &b->olist, 1);
	push_final_overlaps(&(R_INF.reverse_paf[i]), R_INF.reverse_paf, &b->olist, 2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq %edx, %rax
movq (%rdi,%rax,8), %r15
movq 0xe0(%r15), %rdi
leaq 0x8(%r15), %r12
leaq 0xa0(%r15), %rbx
leaq 0xc0(%r15), %r8
leaq 0x48(%r15), %r9
leaq 0x259fd5(%rip), %rax    # 0x295758
movl 0xe8(%rax), %eax
movq %rax, (%rsp)
leaq 0x12160(%r15), %r10
leaq (,%rsi,8), %rcx
leaq (%rcx,%rcx,2), %r14
movq 0x25ab01(%rip), %r11    # 0x2962a8
addq %r14, %r11
movq 0x25aaff(%rip), %r13    # 0x2962b0
addq %r14, %r13
leaq 0x121a0(%r15), %rbp
leaq 0x12250(%r15), %rax
subq $0x8, %rsp
movsd 0x1f544a(%rip), %xmm0   # 0x230c18
movq %r12, %rdx
movq %rbx, %rcx
pushq %rax
movl $0x0, %eax
pushq %rax
movl $0x0, %eax
pushq %rbp
pushq %r13
pushq %r11
pushq %r10
pushq %rax
pushq $0x0
pushq 0x48(%rsp)
callq 0x12a53a
addq $0x50, %rsp
movq 0xa0(%r15), %rdi
movq 0xb0(%r15), %rsi
callq 0x3cf83
movq 0x25aa97(%rip), %rax    # 0x2962a8
movq (%rax,%r14), %rdi
movl 0xc(%rax,%r14), %esi
callq 0xa0402
movq 0x25aa8a(%rip), %rax    # 0x2962b0
movq (%rax,%r14), %rdi
movl 0xc(%rax,%r14), %esi
callq 0xa0402
movq 0x25aa6d(%rip), %rsi    # 0x2962a8
addq %r14, %rsi
addq $0x28, %r15
movq %rbx, %rdi
movq %r12, %rdx
movq %r15, %rcx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x3abdc
movq 0x25aa4d(%rip), %rsi    # 0x2962b0
addq %r14, %rsi
movq %rbx, %rdi
movq %r12, %rdx
movq %r15, %rcx
movl $0x2, %r8d
xorl %r9d, %r9d
callq 0x3abdc
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3b182
movq 0x25aa16(%rip), %rdi    # 0x2962a8
addq %r14, %rdi
movq %rbx, %rdx
movl $0x1, %ecx
callq 0x383ed
addq 0x25aa07(%rip), %r14    # 0x2962b0
movq %r14, %rdi
movq %rbx, %rdx
movl $0x2, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x383ed
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: ha_ec_ff(int)
void ha_ec_ff(int renew_idx)
{
	int hom_cov, het_cov;
    ha_flt_tab_hp = ha_idx_hp = NULL;

    if(ha_idx && renew_idx) {
        ha_pt_destroy(ha_idx); ha_idx = NULL;
    }

    if(!ha_idx) {
        ha_idx = ha_pt_gen(&asm_opt, ha_flt_tab, 1, 0, &R_INF, &hom_cov, &het_cov); // build the index
        asm_opt.hom_cov = hom_cov; asm_opt.het_cov = het_cov;
    }

    cal_ov_r(asm_opt.thread_num, R_INF.total_reads, renew_idx);

	ha_pt_destroy(ha_idx); ha_idx = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
leaq 0x25ab6b(%rip), %rax    # 0x296448
xorl %ecx, %ecx
movq %rcx, (%rax)
leaq 0x25ab57(%rip), %rax    # 0x296440
movq %rcx, (%rax)
leaq 0x25ab45(%rip), %r12    # 0x296438
movq (%r12), %rdi
testq %rdi, %rdi
sete %al
testl %ebx, %ebx
sete %cl
orb %al, %cl
jne 0x3b915
callq 0x1193ff
movq $0x0, (%r12)
jmp 0x3b91a
testq %rdi, %rdi
jne 0x3b96b
leaq 0x25ab0f(%rip), %rax    # 0x296430
movq (%rax), %rsi
leaq 0x8(%rsp), %r13
movq %r13, (%rsp)
leaq 0x259e24(%rip), %r14    # 0x295758
leaq 0x25a8f5(%rip), %r8     # 0x296230
leaq 0xc(%rsp), %r15
movq %r14, %rdi
movl $0x1, %edx
xorl %ecx, %ecx
movq %r15, %r9
callq 0x13d74
movq %rax, (%r12)
movl (%r15), %eax
movl %eax, 0xd0(%r14)
movl (%r13), %eax
movl %eax, 0xd4(%r14)
leaq 0x259de6(%rip), %rax    # 0x295758
movslq 0x7c(%rax), %rdi
movq 0x25a903(%rip), %rsi    # 0x296280
movslq %ebx, %rdx
callq 0x19485c
movq (%r12), %rdi
callq 0x1193ff
movq $0x0, (%r12)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: ug_idx_build(ma_ug_t*, int)
void ug_idx_build(ma_ug_t *ug, int hap_n)
{
    int flag = asm_opt.flag&HA_F_NO_HPC, i;
    asm_opt.flag -= flag;
    // ha_flt_tab = ha_ft_ug_gen(&asm_opt, &(ug->u), hap_n, hap_n);
    // ha_idx = ha_pt_ug_gen(&asm_opt, ha_flt_tab, &(ug->u), hap_n);

    ha_ovec_buf_t **b = NULL;
    // overlap and correct reads
    CALLOC(b, asm_opt.thread_num);
    for (i = 0; i < asm_opt.thread_num; ++i)
    {
        b[i] = ha_ovec_init(1, 1, 0);
        b[i]->ua = &(ug->u);
    }
            
    kt_for(asm_opt.thread_num, worker_ov_utg, b, R_INF.total_reads);

    for (i = 0; i < asm_opt.thread_num; ++i)
        ha_ovec_destroy(b[i]);
    free(b);

    ha_ft_destroy(ha_flt_tab); 
    ha_pt_destroy(ha_idx);
    asm_opt.flag += flag;
    exit(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x259d9f(%rip), %r12    # 0x295758
movl (%r12), %ebp
movl %ebp, %eax
andl $-0x2, %eax
movl %eax, (%r12)
movslq 0x7c(%r12), %r15
movl $0x8, %esi
movq %r15, %rdi
callq 0x2120
movq %rax, %rbx
testq %r15, %r15
jle 0x3ba0c
xorl %r13d, %r13d
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x387f4
movq %rax, (%rbx,%r13,8)
movq %r14, 0x12248(%rax)
incq %r13
movslq 0x7c(%r12), %r15
cmpq %r15, %r13
jl 0x3b9e3
movq 0x25a86d(%rip), %rcx    # 0x296280
leaq 0x63(%rip), %rsi        # 0x3ba7d
movl %r15d, %edi
movq %rbx, %rdx
callq 0x108f2c
cmpl $0x0, 0x7c(%r12)
jle 0x3ba46
xorl %r14d, %r14d
movq (%rbx,%r14,8), %rdi
callq 0x38b4b
incq %r14
movslq 0x7c(%r12), %rax
cmpq %rax, %r14
jl 0x3ba30
andl $0x1, %ebp
movq %rbx, %rdi
callq 0x2220
leaq 0x25a9d8(%rip), %rax    # 0x296430
movq (%rax), %rdi
callq 0x11a4e8
leaq 0x25a9d1(%rip), %rax    # 0x296438
movq (%rax), %rdi
callq 0x1193ff
addl %ebp, (%r12)
movl $0x1, %edi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: worker_ov_utg(void*, long, int)
static void worker_ov_utg(void *data, long i, int tid)
{
	ha_ovec_buf_t *b = ((ha_ovec_buf_t**)data)[tid];
    if(b->ua->a[i].len == 0) return;

    ha_get_ug_candidates(b->ab, i, &(b->ua->a[i]), b->ua, &b->olist, &b->clist, 
    0.3, asm_opt.polyploidy*5, 0, &(b->k_flag), &b->r_buf, ha_flt_tab, ha_idx,
    &(b->tmp_region), NULL, /**0.3**/0);
    
	overlap_region_sort_y_id(b->olist.list, b->olist.length);
	ma_hit_sort_tn(R_INF.paf[i].buffer, R_INF.paf[i].length);
	ma_hit_sort_tn(R_INF.reverse_paf[i].buffer, R_INF.reverse_paf[i].length);

	update_overlaps(&b->olist, &(R_INF.paf[i]), &b->self_read, &b->ovlp_read, 1, 1);
	update_overlaps(&b->olist, &(R_INF.reverse_paf[i]), &b->self_read, &b->ovlp_read, 2, 0);
	///recover missing exact overlaps
	update_exact_overlaps(&b->olist, &b->self_read, &b->ovlp_read);

	///Final_phasing(&overlap_list, &cigarline, &g_read, &overlap_read, c2n);
	push_final_overlaps(&(R_INF.paf[i]), R_INF.reverse_paf, &b->olist, 1);
	push_final_overlaps(&(R_INF.reverse_paf[i]), R_INF.reverse_paf, &b->olist, 2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq %edx, %rax
movq (%rdi,%rax,8), %r14
movq 0x12248(%r14), %rcx
movq 0x10(%rcx), %rax
leaq (%rsi,%rsi,4), %rdx
testl $0x7fffffff, (%rax,%rdx,8) # imm = 0x7FFFFFFF
je 0x3bbfc
movq %rsi, %r15
leaq (%rax,%rdx,8), %rdx
movq 0xe0(%r14), %rdi
leaq 0xa0(%r14), %rbx
leaq 0x48(%r14), %r9
leaq 0x259c8d(%rip), %rax    # 0x295758
movl 0x1bc(%rax), %eax
leal (%rax,%rax,4), %eax
leaq 0x12180(%r14), %r10
leaq 0x12160(%r14), %r11
leaq 0x25a947(%rip), %r12    # 0x296430
leaq 0x25a948(%rip), %r13    # 0x296438
leaq 0x121a0(%r14), %rbp
movsd 0x1f5121(%rip), %xmm0   # 0x230c20
xorps %xmm1, %xmm1
movq %rbx, %r8
pushq $0x0
pushq %rbp
pushq (%r13)
pushq (%r12)
pushq %r11
pushq %r10
pushq $0x0
pushq %rax
callq 0x129f08
addq $0x40, %rsp
movq 0xa0(%r14), %rdi
movq 0xb0(%r14), %rsi
callq 0x3cf83
movq 0x25a76e(%rip), %rax    # 0x2962a8
shlq $0x3, %r15
leaq (%r15,%r15,2), %r15
movq (%rax,%r15), %rdi
movl 0xc(%rax,%r15), %esi
callq 0xa0402
movq 0x25a759(%rip), %rax    # 0x2962b0
movq (%rax,%r15), %rdi
movl 0xc(%rax,%r15), %esi
callq 0xa0402
movq 0x25a73c(%rip), %rsi    # 0x2962a8
addq %r15, %rsi
leaq 0x8(%r14), %r12
addq $0x28, %r14
movq %rbx, %rdi
movq %r12, %rdx
movq %r14, %rcx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x3abdc
movq 0x25a718(%rip), %rsi    # 0x2962b0
addq %r15, %rsi
movq %rbx, %rdi
movq %r12, %rdx
movq %r14, %rcx
movl $0x2, %r8d
xorl %r9d, %r9d
callq 0x3abdc
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x3b182
movq 0x25a6e1(%rip), %rdi    # 0x2962a8
addq %r15, %rdi
movq %rbx, %rdx
movl $0x1, %ecx
callq 0x383ed
addq 0x25a6d2(%rip), %r15    # 0x2962b0
movq %r15, %rdi
movq %rbx, %rdx
movl $0x2, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x383ed
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: ha_assemble_ovec()
int ha_assemble_ovec(void)
{
	extern void ha_extract_print_list(const All_reads *rs, int n_rounds, const char *o);
	int r = 0, hom_cov = -1;
	
    ha_flt_tab = ha_idx = NULL;

    // construct hash table for high occurrence k-mers
    if (!(asm_opt.flag & HA_F_NO_KMER_FLT) && ha_flt_tab == NULL) {
        ha_flt_tab = ha_ft_gen(&asm_opt, &R_INF, &hom_cov, 0, 0);
        ha_opt_update_cov(&asm_opt, hom_cov);
    }
    // error correction
    assert(asm_opt.number_of_round > 0);
    ha_opt_reset_to_round(&asm_opt, r); // this update asm_opt.roundID and a few other fields
    ha_overlap_cal(r, 0);
    fprintf(stderr, "[M::%s] size of buffer: %.3fGB\n", __func__, asm_opt.mem_buf / 1073741824.0);
    
    
    ha_print_ovlp_stat(R_INF.paf, R_INF.reverse_paf, R_INF.total_reads);
    ha_ft_destroy(ha_flt_tab);

    Output_PAF0(R_INF.paf, "0");
    Output_PAF0(R_INF.reverse_paf, "1");
    if (asm_opt.flag & HA_F_WRITE_PAF) Output_PAF();

	destory_All_reads(&R_INF);
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
leaq 0x25a816(%rip), %rax    # 0x296438
xorl %ecx, %ecx
movq %rcx, (%rax)
leaq 0x25a802(%rip), %r12    # 0x296430
movq %rcx, (%r12)
leaq 0x259b1f(%rip), %r15    # 0x295758
testb $0x2, (%r15)
jne 0x3bc71
leaq 0x259b12(%rip), %rbx    # 0x295758
leaq 0x25a5e3(%rip), %rsi    # 0x296230
leaq 0x4(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1390f
movq %rax, (%r12)
movl (%r14), %esi
movq %rbx, %rdi
callq 0x2f59
cmpl $0x0, 0xf8(%r15)
jle 0x3bc93
leaq 0x4(%rsp), %rdi
callq 0x4805
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1f525b(%rip), %rdi    # 0x230ef5
leaq 0x1f5270(%rip), %rsi    # 0x230f11
leaq 0x1f5276(%rip), %rcx    # 0x230f1e
movl $0x7ea, %edx            # imm = 0x7EA
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Assembly.cpp
// Function: ha_assemble_ovec_cc()
int ha_assemble_ovec_cc(void)
{
    ha_idx = NULL;

    ha_opt_reset_to_round(&asm_opt, 0); // this update asm_opt.roundID and a few other fields
    ha_ec_dbg();

    // Output_PAF0(R_INF.paf, "0");
	destory_All_reads(&R_INF);
	return 0;
}

// Assembly:
pushq %rax
leaq 0x25a77e(%rip), %rax    # 0x296438
movq $0x0, (%rax)
leaq 0x259a90(%rip), %rdi    # 0x295758
xorl %esi, %esi
callq 0x2f7e6
callq 0x3a235
leaq 0x25a555(%rip), %rdi    # 0x296230
callq 0x31ca8
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Hash_Table.cpp
// Function: clear_overlap_region_alloc(overlap_region_alloc*)
void clear_overlap_region_alloc(overlap_region_alloc* list)
{
    list->length = 0;
    list->mapped_overlaps_length = 0;
    uint64_t i = 0;
    for (i = 0; i < list->size; i++) {   
        clear_fake_cigar(&(list->list[i].f_cigar));
        clear_window_list_alloc(&(list->list[i].w_list));
        clear_window_list_alloc(&(list->list[i].boundary_cigars));
    }
}

// Assembly:
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x3d053
movq (%rdi), %rcx
addq $0x40, %rcx
xorl %edx, %edx
movl $0x0, (%rcx)
movq %rdx, 0x20(%rcx)
movq %rdx, 0x8(%rcx)
movq %rdx, 0x50(%rcx)
movq %rdx, 0x38(%rcx)
addq $0xa8, %rcx
decq %rax
jne 0x3d031
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Hash_Table.cpp
// Function: destory_overlap_region_alloc(overlap_region_alloc*)
void destory_overlap_region_alloc(overlap_region_alloc* list)
{
    uint64_t i = 0;
    for (i = 0; i < list->size; i++) {
        destory_fake_cigar(&(list->list[i].f_cigar));
        destory_window_list_alloc(&(list->list[i].w_list));
        destory_window_list_alloc(&(list->list[i].boundary_cigars));
    }
    free(list->list);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x3d0d7
xorl %r14d, %r14d
xorl %r15d, %r15d
movq (%rbx), %r12
cmpl $0x0, 0x44(%r12,%r14)
je 0x3d096
movq 0x38(%r12,%r14), %rdi
callq 0x2220
movq (%rbx), %r12
movq 0x58(%r12,%r14), %rdi
callq 0x2220
movq 0x70(%r12,%r14), %rdi
callq 0x2220
movq (%rbx), %r12
movq 0x88(%r12,%r14), %rdi
callq 0x2220
movq 0xa0(%r12,%r14), %rdi
callq 0x2220
incq %r15
addq $0xa8, %r14
cmpq 0x8(%rbx), %r15
jb 0x3d07e
movq (%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Hash_Table.cpp
// Function: gen_fake_cigar(Fake_Cigar*, overlap_region*, long, k_mer_hit*, long)
void gen_fake_cigar(Fake_Cigar* z, overlap_region *o, int64_t apend_be, k_mer_hit* hit, int64_t n_hit)
{
    int64_t k, dq, dr, dd, pdd; z->length = 0;
    if(apend_be == 1) add_fake_cigar(z, o->x_pos_s, 0, NULL);
    for (k = 0, pdd = INT32_MAX; k < n_hit; k++) {
        dq = hit[k].self_offset - o->x_pos_s; 
        dr = hit[k].offset - o->y_pos_s; 
        dd = dr - dq;
        // if(print) {
        //     fprintf(stderr, "[M::k->%lu] x::%u, y::%u, cnt::%u, dd::%ld, pdd::%ld, z->n::%u\n", 
        //         k, hit[k].self_offset, hit[k].offset, hit[k].cnt&(0xffu), dd, pdd, z->length);
        // }
        if(dd != pdd) {
            pdd = dd;
            add_fake_cigar(z, hit[k].self_offset, pdd, NULL);
        }
    }
    
    if((apend_be == 1) && (get_fake_gap_pos(z, z->length-1)!=((int64_t)o->x_pos_e))) {
        add_fake_cigar(z, o->x_pos_e, get_fake_gap_shift(z, z->length-1), NULL);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movl $0x0, 0x8(%rdi)
cmpq $0x1, %rdx
jne 0x3d16a
movl 0x4(%r14), %esi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3d202
testq %r15, %r15
jle 0x3d1aa
addq $0x8, %r13
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl -0x4(%r13), %ebp
movl (%r13), %esi
movl %esi, %ecx
subl 0x4(%r14), %ecx
subl 0x14(%r14), %ebp
subq %rcx, %rbp
cmpq %rax, %rbp
je 0x3d1a1
movq %rbx, %rdi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x3d202
movq %rbp, %rax
addq $0x10, %r13
decq %r15
jne 0x3d178
cmpq $0x1, %r12
jne 0x3d1ce
movl 0x8(%rbx), %eax
decl %eax
movq (%rbx), %rcx
cltq
movq (%rcx,%rax,8), %rax
movq %rax, %rcx
sarq $0x20, %rcx
movl 0x8(%r14), %esi
cmpq %rsi, %rcx
jne 0x3d1dd
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %ecx
shrl %ecx
movl %ecx, %edx
negl %edx
testb $0x1, %al
cmovel %ecx, %edx
movq %rbx, %rdi
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3d202
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Hash_Table.cpp
// Function: add_fake_cigar(Fake_Cigar*, unsigned int, int, void*)
void add_fake_cigar(Fake_Cigar* x, uint32_t gap_site, int32_t gap_shift, void *km)
{
    if(x->length + 1 > x->size)
    {
        x->size = x->length + 1;
        kroundup32(x->size);
        if(!km) {
            REALLOC(x->buffer, x->size);
        } else {
            KREALLOC(km, x->buffer, x->size);
        }
        // x->buffer = (uint64_t*)realloc(x->buffer, sizeof(uint64_t) * x->size);
    }

    x->buffer[x->length] = gap_site;
    x->buffer[x->length] = x->buffer[x->length] << 32;

    if(gap_shift < 0)
    {
        gap_shift = gap_shift * -1;
        gap_site = gap_shift;
        gap_site = gap_site << 1;
        gap_site = gap_site | ((uint32_t)1);
    }
    else
    {
        gap_site = gap_shift;
        gap_site = gap_site << 1;
    }

    x->buffer[x->length] = x->buffer[x->length] | ((uint32_t)gap_site);

    x->length++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %r15d
movl %esi, %r14d
movq %rdi, %rbx
movl 0x8(%rdi), %eax
leal 0x1(%rax), %edx
cmpl 0xc(%rdi), %edx
jbe 0x3d258
movl %eax, %edx
shrl %edx
orl %eax, %edx
movl %edx, %eax
shrl $0x2, %eax
orl %edx, %eax
movl %eax, %edx
shrl $0x4, %edx
orl %eax, %edx
movl %edx, %eax
shrl $0x8, %eax
orl %edx, %eax
movl %eax, %edx
shrl $0x10, %edx
orl %eax, %edx
incl %edx
movl %edx, 0xc(%rbx)
shlq $0x3, %rdx
movq (%rbx), %rsi
testq %rcx, %rcx
je 0x3d25d
movq %rcx, %rdi
callq 0x1ee21d
jmp 0x3d268
movq (%rbx), %rax
jmp 0x3d26b
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x2370
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
shlq $0x20, %r14
leal (%r15,%r15), %edx
movl $0x1, %esi
subl %edx, %esi
testl %r15d, %r15d
cmovnsl %edx, %esi
orq %r14, %rsi
movq %rsi, (%rax,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Hash_Table.cpp
// Function: debug_cigar(Fake_Cigar*, overlap_region*, long, k_mer_hit*, unsigned long)
void debug_cigar(Fake_Cigar* z, overlap_region *o, int64_t apend_be, k_mer_hit* hit, uint64_t n_hit)
{
    gen_fake_cigar(z, o, apend_be, hit, n_hit);
    if(!((z->length==o->f_cigar.length) && 
                    (!memcmp(z->buffer, o->f_cigar.buffer, sizeof((*(o->f_cigar.buffer)))*o->f_cigar.length)))) {
        uint64_t k;
        fprintf(stderr, "\n[M::%s] z->n::%u, o->n::%u, rev::%u\n", __func__, z->length, o->f_cigar.length, o->y_pos_strand);
        for (k = 0; k < z->length; k++) {
            fprintf(stderr, "[z::k->%lu] pos::%d, off::%d\n", k, 
                                    get_fake_gap_pos(z, k), get_fake_gap_shift(z, k));
        }
        for (k = 0; k < o->f_cigar.length; k++) {
            fprintf(stderr, "[o::k->%lu] pos::%d, off::%d\n", k, 
                                    get_fake_gap_pos(&(o->f_cigar), k), get_fake_gap_shift(&(o->f_cigar), k));
        }
        // gen_fake_cigar(z, o, apend_be, hit, n_hit, 1);
        // for (k = 0; k < o->f_cigar.length; k++) {
        // 	fprintf(stderr, "[M::k->%lu] x::%u, y::%u, cnt::%u\n", 
		// 			k, hit[k].self_offset, hit[k].offset, hit[k].cnt&(0xffu));
        // }
        
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3d133
movl 0x8(%r14), %r12d
leaq 0x38(%rbx), %r15
movl 0x40(%rbx), %ebp
cmpl %ebp, %r12d
jne 0x3d2e2
movq (%r14), %rdi
movq (%r15), %rsi
leaq (,%r12,8), %rdx
callq 0x21a0
testl %eax, %eax
jne 0x3d2e2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%r14), %r13
movq 0x257cf3(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
movl 0x1c(%rbx), %r9d
addq $0x40, %rbx
leaq 0x1f4019(%rip), %rsi    # 0x231318
leaq 0x1f4038(%rip), %rdx    # 0x23133e
movl %r12d, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x22b0
cmpl $0x0, (%r13)
jne 0x3d32c
cmpl $0x0, (%rbx)
je 0x3d2d3
movq %r15, %rdi
movq %rbx, %rsi
callq 0x50cb
jmp 0x3d2d3
movq %r14, %rdi
movq %r13, %rsi
callq 0x504b
jmp 0x3d31a
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Hash_Table.cpp
// Function: resize_fake_cigar(Fake_Cigar*, unsigned long, void*)
void resize_fake_cigar(Fake_Cigar* x, uint64_t size, void *km)
{
    if (size > x->size) {
        x->size = size;
        if(!km) {
            REALLOC(x->buffer, x->size);
        }
        else {
            KREALLOC(km, x->buffer, x->size);
        }
		
    }
    x->length = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0xc(%rdi), %eax
cmpq %rsi, %rax
jae 0x3dacd
movl %esi, 0xc(%rbx)
movl %esi, %eax
shlq $0x3, %rax
movq (%rbx), %rsi
testq %rdx, %rdx
je 0x3dabf
movq %rdx, %rdi
movq %rax, %rdx
callq 0x1ee21d
jmp 0x3daca
movq %rsi, %rdi
movq %rax, %rsi
callq 0x2370
movq %rax, (%rbx)
movl $0x0, 0x8(%rbx)
popq %rbx
retq