LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: gen_contig_trans_func(ma_ug_t*, ma_ug_t*, ma_ug_t*, scaf_res_t*, scaf_res_t*, asg_t*, bubble_type*, ug_opt_t*, kv_u_trans_t*, unsigned char, ma_ug_t**, scaf_res_t**)
kv_u_trans_t *gen_contig_trans_func(ma_ug_t *ref, ma_ug_t *hu0, ma_ug_t *hu1, scaf_res_t *cp0, scaf_res_t *cp1, asg_t *sg, bubble_type *bu, ug_opt_t *opt, kv_u_trans_t *bd, uint8_t is_sep, ma_ug_t **rmg, scaf_res_t **rms)
{

    kv_u_trans_t *os; CALLOC(os, 1);
    if(is_sep) {
        gen_contig_trans(opt, sg, hu1, cp1, hu0, cp0, ref, bd, hu0->u.n, 0, bu, os);
        gen_contig_trans(opt, sg, hu0, cp0, hu1, cp1, ref, bd, 0, hu0->u.n, bu, os);
    } else {
        ma_ug_t *mg = merge_utgs(hu0, hu1); scaf_res_t *ms = merge_scaf_res(cp0, cp1);
        gen_contig_self(opt, sg, mg, ms, ref, bd, hu0->u.n, bu, os, 0);
        if(!rmg) ma_ug_destroy(mg); 
        else (*rmg) = mg;
        if(!rms) destroy_scaf_res_t(ms);
        else (*rms) = ms;
    }

    kt_u_trans_t_idx(os, hu0->u.n + hu1->u.n);
    update_ctg_trans_cc(os);
    return os;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %rbp
movq %r8, %r13
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
movl $0x1, %edi
movl $0x30, %esi
callq 0x2120
movq %rax, %rbx
cmpb $0x0, 0x68(%rsp)
je 0xe003a
movl (%r14), %eax
xorl %r11d, %r11d
movq 0x58(%rsp), %rdi
movq %r13, %rcx
movq %r13, 0x10(%rsp)
movq %rbp, %r13
movq %rbp, %rsi
movq %r12, %rdx
movq %r14, %r8
movq %r15, %r9
pushq %rbx
movq 0x58(%rsp), %r10
pushq %r10
pushq %r11
pushq %rax
movq 0x80(%rsp), %rax
pushq %rax
movq 0x30(%rsp), %rbp
pushq %rbp
callq 0x27e25
addq $0x30, %rsp
movl (%r14), %eax
movq 0x58(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %r15, %rcx
movq %r12, %r8
movq 0x10(%rsp), %r9
pushq %rbx
pushq 0x58(%rsp)
pushq %rax
xorl %eax, %eax
pushq %rax
pushq 0x80(%rsp)
pushq %rbp
callq 0x27e25
addq $0x30, %rsp
jmp 0xe00ba
movq %r14, %rdi
movq %r12, (%rsp)
movq %r12, %rsi
callq 0xdfa4e
movq %rax, %r12
movq %r15, %rdi
movq %r13, %rsi
callq 0xdfd69
movq %rax, %r15
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %rax, %rcx
movq 0x8(%rsp), %r8
movq 0x60(%rsp), %r9
pushq $0x0
pushq %rbx
pushq 0x60(%rsp)
pushq (%r14)
callq 0x27feb
movq 0x90(%rsp), %rax
addq $0x20, %rsp
testq %rax, %rax
je 0xe0097
movq %r12, (%rax)
jmp 0xe009f
movq %r12, %rdi
callq 0xa0761
movq 0x78(%rsp), %rax
testq %rax, %rax
je 0xe00ae
movq %r15, (%rax)
jmp 0xe00b6
movq %r15, %rdi
callq 0x37e37
movq (%rsp), %r12
movl (%r12), %esi
addl (%r14), %esi
movq %rbx, %rdi
callq 0xc4edd
movq %rbx, %rdi
callq 0xdb90d
movq %rbx, %rax
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/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2090
leaq 0x32(%rax), %rdi
callq 0x2280
movq %rax, %r15
leaq 0x1569d9(%rip), %rsi    # 0x237de1
xorl %ebp, %ebp
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2050
movq %r15, %rdi
callq 0x2090
movq %rax, %r12
movq 0x20(%rbx), %rsi
movq %r15, %rdi
callq 0x107594
testl %eax, %eax
je 0xe1517
leaq 0x1569b6(%rip), %rsi    # 0x237df3
xorl %ebp, %ebp
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2050
movq %r15, %rdi
callq 0x2090
movq %rax, %r13
movq 0x28(%rbx), %rsi
movq %r15, %rdi
callq 0x107594
testl %eax, %eax
je 0xe1517
incq %r12
incl %r13d
movq %r15, %rdi
callq 0x2220
movq 0x30(%rbx), %r15
movl %r12d, %edi
callq 0x2280
movq %rax, 0x30(%rbx)
leaq 0x156951(%rip), %rsi    # 0x237de1
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2050
movq 0x38(%rbx), %r12
movq %r13, %rdi
callq 0x2280
movq %rax, 0x38(%rbx)
leaq 0x15693f(%rip), %rsi    # 0x237df3
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x1b4d68(%rip), %rax    # 0x296230
movq 0x28(%rax), %rdi
movq 0x50(%rax), %rdx
xorl %esi, %esi
callq 0x20e0
movups 0x20(%rbx), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movq %rbx, %rdi
callq 0x10803a
movaps (%rsp), %xmm0
movups %xmm0, 0x20(%rbx)
movq 0x30(%rbx), %rdi
callq 0x2220
movq %r15, 0x30(%rbx)
movq 0x38(%rbx), %rdi
callq 0x2220
movq %r12, 0x38(%rbx)
movl $0x1, %ebp
jmp 0xe151f
movq %r15, %rdi
callq 0x2220
movl %ebp, %eax
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/Overlaps.cpp
// Function: load_all_data_from_disk(ma_hit_t_alloc**, ma_hit_t_alloc**, char*)
int load_all_data_from_disk(ma_hit_t_alloc **sources, ma_hit_t_alloc **reverse_sources, char* output_file_name)
{
	char* gfa_name = (char*)malloc(strlen(output_file_name)+25);
	sprintf(gfa_name, "%s.ec", output_file_name);
	if (!load_All_reads(&R_INF, gfa_name)) {
		free(gfa_name);
		return 0;
	}

    if(ha_opt_triobin(&asm_opt)) {
        if(!((asm_opt.fn_bin_yak[0]) && (asm_opt.fn_bin_yak[1]) && 
                        (load_yak_binning(&asm_opt, asm_opt.output_file_name)))) {
            ha_triobin(&asm_opt); 
            write_yak_binning(asm_opt.output_file_name, asm_opt.fn_bin_yak[0], asm_opt.fn_bin_yak[1]);
        }
    }

    if((asm_opt.flag & HA_F_VERBOSE_GFA) && load_debug_graph(NULL, NULL, NULL, output_file_name, NULL, NULL, NULL))
    {
        (*sources) = NULL;
        (*reverse_sources) = NULL;
        free(gfa_name);
        return 1;
    }

	sprintf(gfa_name, "%s.ovlp.source", output_file_name);
	if (!load_ma_hit_ts(sources, gfa_name)) {
		free(gfa_name);
		return 0;
	}
	sprintf(gfa_name, "%s.ovlp.reverse", output_file_name);
	if (!load_ma_hit_ts(reverse_sources, gfa_name)) {
		free(gfa_name);
		return 0;
	}
	free(gfa_name);
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
movq %rdx, %rdi
callq 0x2090
leaq 0x19(%rax), %rdi
callq 0x2280
movq %rax, %rbx
leaq 0x14f969(%rip), %rsi    # 0x230ec8
xorl %ebp, %ebp
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x1b4cbb(%rip), %rdi    # 0x296230
movq %rbx, %rsi
callq 0x31d8d
testl %eax, %eax
je 0xe1613
leaq 0x1b41cc(%rip), %r13    # 0x295758
movq 0x20(%r13), %rcx
movq 0x28(%r13), %rax
testq %rcx, %rcx
sete %dl
testq %rax, %rax
sete %sil
orb %dl, %sil
cmpb $0x1, %sil
jne 0xe15b8
cmpq $0x0, 0x30(%r13)
je 0xe15de
cmpq $0x0, 0x38(%r13)
je 0xe15de
testq %rcx, %rcx
je 0xe1674
testq %rax, %rax
je 0xe1674
movq 0x10(%r13), %rsi
movq %r13, %rdi
callq 0xe13d9
testl %eax, %eax
je 0xe1674
testb $0x4, (%r13)
je 0xe162c
movq $0x0, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %r15, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xe167e
testl %eax, %eax
je 0xe162c
xorl %eax, %eax
movq %rax, (%r12)
movq %rax, (%r14)
movl $0x1, %ebp
movq %rbx, %rdi
callq 0x2220
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1567f6(%rip), %rsi    # 0x237e29
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
movq %r12, %rdi
movq %rbx, %rsi
callq 0xbaf3
testl %eax, %eax
je 0xe1613
leaq 0x1567e0(%rip), %rsi    # 0x237e38
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
movq %r14, %rdi
movq %rbx, %rsi
callq 0xbaf3
movl %eax, %ebp
jmp 0xe1613
callq 0x11271
jmp 0xe15de
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: asg_bub_backtrack_primary_length(asg_t*, ma_ug_t*, unsigned int, buf_t*, unsigned long*, unsigned long*)
void asg_bub_backtrack_primary_length(asg_t *g, ma_ug_t *utg, uint32_t v0, buf_t *b, uint64_t* path_base_len, uint64_t* path_nodes)
{
	uint32_t i, v, u, nv;
    uint64_t len = 0, node = 0;
    ///b->S.a[0] is the sink of this bubble
    asg_arc_t *av = NULL;

    ///v is the sink of this bubble
	v = b->S.a[0];
    len = 0;
	///recover node
    while (1)
    {
        u = b->a[v].p; // u->v
        if(u == v0) break;
        if(v == b->S.a[0])
        {
            len += g->seq[u>>1].len;
        } 
        else
        {
            nv = asg_arc_n(g, u);
            av = asg_arc_a(g, u);
            for (i = 0; i < nv; ++i)
            {
                if(av[i].del) continue;
                if(av[i].v == v) break;
            }
            ///if(i == nv) fprintf(stderr, "ERROR\n");
            len += (uint32_t)av[i].ul;
        }

        if(utg)
        {
            node += utg->u.a[u>>1].n;
        }
        else
        {
            node++;
        }
         
        v = u;
    }
    
    if(path_base_len) (*path_base_len) = len;
    if(path_nodes) (*path_nodes) = node;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r9, -0x10(%rsp)
movq %r8, -0x18(%rsp)
movq (%rcx), %r13
movq 0x18(%rcx), %rax
movl (%rax), %ecx
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %rax
addq %rcx, %rax
movl (%r13,%rax), %r14d
cmpl %edx, %r14d
jne 0xe2a25
xorl %r11d, %r11d
xorl %eax, %eax
jmp 0xe2afd
xorl %eax, %eax
xorl %r11d, %r11d
movl %ecx, %ebp
movq %rdi, -0x8(%rsp)
movl %r14d, %ebx
movl %r14d, %r14d
cmpl %ecx, %ebp
jne 0xe2a52
movq 0x20(%rdi), %r8
movl %ebx, %r9d
shrl %r9d
movl (%r8,%r9,8), %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
jmp 0xe2abc
movq 0x8(%rdi), %r15
movq 0x28(%rdi), %r8
movq (%r8,%r14,8), %r10
movq %r10, %r8
shrq $0x20, %r8
leaq (%r8,%r8,2), %r12
testl %r10d, %r10d
je 0xe2aad
movq %rcx, %rdi
movq %r13, %rcx
movl %r10d, %r9d
leaq (%r15,%r12,8), %r8
addq $0xc, %r8
xorl %r13d, %r13d
cmpl $0x0, (%r8)
js 0xe2a8e
cmpl %ebp, -0x4(%r8)
je 0xe2a9d
incq %r13
addq $0x18, %r8
cmpq %r13, %r9
jne 0xe2a82
movq %r10, %r13
movl %r13d, %r8d
movq %rcx, %r13
movq %rdi, %rcx
movq -0x8(%rsp), %rdi
jmp 0xe2ab0
xorl %r8d, %r8d
leaq (%r15,%r12,8), %r9
leaq (%r8,%r8,2), %r8
movl (%r9,%r8,8), %r15d
testq %rsi, %rsi
je 0xe2ad6
movq 0x10(%rsi), %r8
movl %ebx, %r9d
shrl %r9d
leaq (%r9,%r9,4), %r9
movl 0x10(%r8,%r9,8), %r8d
jmp 0xe2adc
movl $0x1, %r8d
addq %r8, %rax
addq %r15, %r11
leaq (%r14,%r14,8), %r8
leaq (%r8,%r8,2), %r8
addq %r14, %r8
movl (%r13,%r8), %r14d
movl %ebx, %ebp
cmpl %edx, %r14d
jne 0xe2a31
movq -0x18(%rsp), %rcx
testq %rcx, %rcx
je 0xe2b0a
movq %r11, (%rcx)
movq -0x10(%rsp), %rcx
testq %rcx, %rcx
je 0xe2b17
movq %rax, (%rcx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: asg_bub_backtrack_check_switch(asg_t*, ma_ug_t*, unsigned int, buf_t*)
int asg_bub_backtrack_check_switch(asg_t *g, ma_ug_t *utg, uint32_t v0, buf_t *b)
{
	uint32_t v, k, rId, father_occ = 0, mother_occ = 0;
    ma_utg_t* p = NULL;
    ///b->S.a[0] is the sink of this bubble
    ///v is the sink of this bubble
    v = b->S.a[0];
    ///recover node
    do {
        uint32_t u = b->a[v].p; // u->v
        if(v != b->S.a[0])
        {
            p = &(utg->u.a[v>>1]);
            for (k = 0; k < p->n; k++)
            {
                rId = p->a[k]>>33;
                if(R_INF.trio_flag[rId] == FATHER) father_occ++;
                if(R_INF.trio_flag[rId] == MOTHER) mother_occ++;
                if(R_INF.trio_flag[rId] != AMBIGU) continue;
                R_INF.trio_flag[rId] = DROP;
            }
        }
        v = u;
    } while (v != v0);

    if(father_occ > 0 && mother_occ > 0) return 1;

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
movq 0x18(%rcx), %rax
movl (%rax), %edi
pxor %xmm0, %xmm0
leaq 0x1b36fa(%rip), %rax    # 0x296230
movd 0x153132(%rip), %xmm1   # 0x235c70
movdqa 0x14e08a(%rip), %xmm2   # 0x230bd0
movl %edi, %r8d
movl %edi, %edi
leaq (%rdi,%rdi,8), %r9
leaq (%r9,%r9,2), %r9
addq %rdi, %r9
movq (%rcx), %rdi
movq 0x18(%rcx), %r10
movl (%rdi,%r9), %edi
cmpl (%r10), %r8d
je 0xe2bcf
movq 0x10(%rsi), %r9
shrl %r8d
leaq (%r8,%r8,4), %r10
movl 0x10(%r9,%r10,8), %r8d
testl %r8d, %r8d
je 0xe2bcf
leaq (%r9,%r10,8), %r9
movq 0x28(%rax), %r10
xorl %r11d, %r11d
movq 0x18(%r9), %rbx
movq (%rbx,%r11,8), %r14
shrq $0x21, %r14
movzbl (%r10,%r14), %ebx
testb %bl, %bl
jne 0xe2ba8
movb $0x5, (%r10,%r14)
movq 0x28(%rax), %r10
movl 0x10(%r9), %r8d
movd %ebx, %xmm3
punpcklbw %xmm3, %xmm3    # xmm3 = xmm3[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pcmpeqb %xmm1, %xmm3
punpcklbw %xmm3, %xmm3    # xmm3 = xmm3[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklwd %xmm3, %xmm3    # xmm3 = xmm3[0,0,1,1,2,2,3,3]
pand %xmm2, %xmm3
paddd %xmm3, %xmm0
incq %r11
movl %r8d, %ebx
cmpq %rbx, %r11
jb 0xe2b86
cmpl %edx, %edi
jne 0xe2b46
pshufd $0x50, %xmm0, %xmm0     # xmm0 = xmm0[0,0,1,1]
pxor %xmm1, %xmm1
pcmpeqd %xmm0, %xmm1
movmskpd %xmm1, %ecx
xorl $0x3, %ecx
xorl %eax, %eax
cmpl $0x3, %ecx
sete %al
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: debug_asg_bub_pop1_primary_trio(asg_t*, ma_ug_t*, unsigned int, unsigned long, buf_t*, unsigned int, unsigned int, unsigned int)
void debug_asg_bub_pop1_primary_trio(asg_t *g, ma_ug_t *utg, uint32_t v0, uint64_t max_dist, buf_t *b, 
uint32_t positive_flag, uint32_t negative_flag, uint32_t found)
{
    buf_t b_new;
    memset(&b_new, 0, sizeof(buf_t));
    b_new.a = (binfo_t*)calloc(g->n_seq * 2, sizeof(binfo_t));
    uint32_t n_pop = asg_bub_pop1_primary_trio(g, utg, v0, max_dist, &b_new, positive_flag, negative_flag, 0, NULL, NULL, NULL, 0, 0, NULL);
    if(n_pop != found) fprintf(stderr, "ERROR\n");

    free(b_new.a); free(b_new.S.a); free(b_new.T.a); free(b_new.b.a); free(b_new.e.a);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %r9d, %ebx
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r13
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %r12
movups %xmm0, 0x58(%r12)
movups %xmm0, 0x48(%r12)
movups %xmm0, 0x38(%r12)
movups %xmm0, 0x28(%r12)
movups %xmm0, 0x18(%r12)
movups %xmm0, 0x8(%r12)
movl 0x14(%rdi), %edi
addl %edi, %edi
movl $0x1c, %esi
callq 0x2120
movq %rax, (%r12)
xorl %eax, %eax
movq %rax, 0x38(%rsp)
movl %eax, 0x30(%rsp)
movl %eax, 0x28(%rsp)
movq %rax, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl %eax, 0x8(%rsp)
movl 0xe0(%rsp), %eax
movl %eax, (%rsp)
movq %r13, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %r14, %rcx
movq %r12, %r8
movl %ebx, %r9d
callq 0xc02d6
cmpl 0xe8(%rsp), %eax
jne 0xe63f2
movq 0x40(%rsp), %rdi
callq 0x2220
movq 0x58(%rsp), %rdi
callq 0x2220
movq 0x70(%rsp), %rdi
callq 0x2220
movq 0x88(%rsp), %rdi
callq 0x2220
movq 0xa0(%rsp), %rdi
callq 0x2220
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x11305
jmp 0xe63a8
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_bub_pop_max_dist(asg_t*, buf_t*)
uint64_t get_bub_pop_max_dist(asg_t *g, buf_t *b)
{
    uint32_t n_vtx = g->n_seq, i, p_bub;
    uint64_t cLen = 0, mLen = 0, tLen = 0;
    
    
    for (i = 0; i < n_vtx; ++i) 
    {
        if(b->a[i].s) continue;
        cLen = dfs_subgraph(g, b, i, &p_bub);
        tLen += cLen;
        if(p_bub == 0) continue;///no bubble
        if(cLen > mLen) mLen = cLen;
    }

    for (i = 0; i < n_vtx; ++i) 
    {
        ///if(b->a[i].s == 0) fprintf(stderr, "ERROR\n");
        b->a[i].s = 0;
        ///debug_tLen += g->seq[i].len;
    }
    ///if(debug_tLen != tLen) fprintf(stderr, "ERROR\n");

    ///fprintf(stderr, "mLen: %lu, tLen: %lu\n", mLen, tLen);
    b->S.n = 0;
    return mLen;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl 0x14(%rdi), %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
je 0xe675c
movq %rdi, %r15
movl $0x18, %r13d
xorl %r12d, %r12d
xorl %r14d, %r14d
movq (%rbx), %rax
cmpl $0x0, (%rax,%r13)
js 0xe6727
movq %r15, %rdi
movq %rbx, %rsi
movl %r12d, %edx
leaq 0x4(%rsp), %rcx
callq 0xe63f9
cmpq %r14, %rax
cmovbeq %r14, %rax
cmpl $0x0, 0x4(%rsp)
cmovneq %rax, %r14
incq %r12
addq $0x1c, %r13
cmpq %r12, %rbp
jne 0xe66fa
testl %ebp, %ebp
je 0xe675f
movl %ebp, %ecx
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %rax
addq %rcx, %rax
xorl %ecx, %ecx
movq (%rbx), %rdx
andl $0x7fffffff, 0x18(%rdx,%rcx) # imm = 0x7FFFFFFF
addq $0x1c, %rcx
cmpq %rcx, %rax
jne 0xe6746
jmp 0xe675f
xorl %r14d, %r14d
movq $0x0, 0x8(%rbx)
movq %r14, %rax
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/Overlaps.cpp
// Function: append_node_arcs(asg_t*, asg_t*, unsigned char*, unsigned char, unsigned int)
void append_node_arcs(asg_t *des, asg_t *src, uint8_t *s, uint8_t se, uint32_t v)
{
    asg_arc_t *av, *za; uint32_t an, zn, k, n0, n1;
    n0 = n1 = 0;
    za = asg_arc_a(src, v); zn = asg_arc_n(src, v); 
    av = asg_arc_a(des, v); an = asg_arc_n(des, v); 
    ///set
    for (k = 0; k < zn; k++) {
        if(za[k].del) continue;
        s[za[k].v] |= se; n0++;
    }

    for (k = 0; k < an; k++) {
        ///s[av[k].v]&se:: in the existing graph
        if(s[av[k].v]&se) {
            av[k].del = 0; n1++;
            asg_arc_del(des, av[k].v^1, (av[k].ul>>32)^1, 0);
        }
    }
    
    ///reset
    for (k = 0; k < zn; k++) {
        if(za[k].del) continue;
        if(s[za[k].v]&se) s[za[k].v] -= se;
    }
    if(!(n0 == n1)) {
        fprintf(stderr, "[M::%s] n0::%u, n1::%u\n", __func__, n0, n1);
    }
    assert(n0 == n1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rax
movq 0x8(%rsi), %r10
movq 0x28(%rsi), %rsi
movl %r8d, %edi
movq (%rsi,%rdi,8), %r8
movq %r8, %rsi
shrq $0x20, %rsi
movq %rsi, (%rsp)
movq 0x28(%rax), %rsi
movq (%rsi,%rdi,8), %r14
movq %r14, %rsi
shrq $0x20, %rsi
leaq (%rsi,%rsi,2), %r11
shlq $0x3, %r11
addq 0x8(%rax), %r11
xorl %esi, %esi
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl $0x0, %edi
movq %r8, 0x8(%rsp)
andq %r8, %rbx
je 0xe6f22
movq (%rsp), %rdi
leaq (%rdi,%rdi,2), %rdi
leaq (%r10,%rdi,8), %r15
addq $0xc, %r15
leaq (,%rbx,8), %rdi
leaq (%rdi,%rdi,2), %r12
xorl %r13d, %r13d
xorl %edi, %edi
cmpl $0x0, (%r15,%r13)
js 0xe6f19
movl -0x4(%r15,%r13), %r9d
orb %cl, (%rdx,%r9)
incl %edi
addq $0x18, %r13
cmpq %r13, %r12
jne 0xe6f07
movq %r10, 0x10(%rsp)
testl %r14d, %r14d
je 0xe6fb6
movl %r14d, %r14d
xorl %r15d, %r15d
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %esi, %esi
leaq (%r15,%r15,2), %r9
movl 0x8(%r11,%r9,8), %r10d
testb %cl, (%rdx,%r10)
je 0xe6fae
leaq (%r11,%r9,8), %r9
andb $0x7f, 0xf(%r9)
incl %esi
xorq $0x1, %r10
movq 0x28(%rax), %r13
movq (%r13,%r10,8), %r10
movq %r10, %r13
andq %r12, %r13
je 0xe6fae
movl 0x4(%r9), %ebp
movq 0x8(%rax), %r9
shrq $0x20, %r10
shlq $0x3, %r13
leaq (%r13,%r13,2), %r13
leaq (%r10,%r10,2), %r10
leaq (%r9,%r10,8), %r9
addq $0xc, %r9
xorl %r10d, %r10d
movl -0x4(%r9,%r10), %r8d
xorl %ebp, %r8d
cmpl $0x1, %r8d
jne 0xe6fa5
andb $0x7f, 0x3(%r9,%r10)
addq $0x18, %r10
cmpq %r10, %r13
jne 0xe6f91
incq %r15
cmpq %r14, %r15
jne 0xe6f3e
testq %rbx, %rbx
je 0xe7005
movl 0x8(%rsp), %r9d
movq (%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x10(%rsp), %r8
leaq (%r8,%rax,8), %rax
addq $0xc, %rax
shlq $0x3, %r9
leaq (%r9,%r9,2), %r8
xorl %r9d, %r9d
cmpl $0x0, (%rax,%r9)
js 0xe6ffc
movl -0x4(%rax,%r9), %r10d
movb (%rdx,%r10), %r11b
testb %cl, %r11b
je 0xe6ffc
subb %cl, %r11b
movb %r11b, (%rdx,%r10)
addq $0x18, %r9
cmpq %r9, %r8
jne 0xe6fe0
cmpl %esi, %edi
jne 0xe7018
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x11327
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: asg_arc_del_triangular_directly(asg_t*, long long, ma_hit_t_alloc*, R_to_U*)
int asg_arc_del_triangular_directly(asg_t *g, long long min_edge_length, 
ma_hit_t_alloc* reverse_sources, R_to_U* ruIndex)
{
    double startTime = Get_T();
    ///the reason is that each read has two direction (query->target, target->query)
    uint32_t v, n_vtx = g->n_seq * 2, n_reduced = 0;

    for (v = 0; v < n_vtx; ++v) 
    {
        uint32_t nv = asg_arc_n(g, v);
        if (g->seq[v>>1].del)
        {
            continue;
        } 

        if(nv < 2)
        {
            continue;
        }


        n_reduced += test_triangular_directly(g, v, min_edge_length, reverse_sources, ruIndex);
    }

    

    if (n_reduced) {
        asg_cleanup(g);
        asg_symm(g);
    }

    if(VERBOSE >= 1)
    {
        fprintf(stderr, "[M::%s] removed %d triangular overlaps\n", 
        __func__, n_reduced);
        fprintf(stderr, "[M::%s] takes %0.2f s\n\n", __func__, Get_T()-startTime);
    }
    return n_reduced;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
callq 0x2f3fc
movl 0x14(%rbx), %eax
addl %eax, %eax
je 0xe8ef6
movl %eax, %r14d
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x20(%rbx), %rax
movl %r13d, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0xe8ecc
movq 0x28(%rbx), %rax
testl $0xfffffffe, (%rax,%r13,8) # imm = 0xFFFFFFFE
je 0xe8ecc
movq %rbx, %rdi
movl %r13d, %esi
movq %r12, %rdx
movq %r15, %rcx
movq (%rsp), %r8
callq 0xe8731
addl %eax, %ebp
incq %r13
cmpq %r13, %r14
jne 0xe8e98
testl %ebp, %ebp
je 0xe8ef6
movq %rbx, %rdi
callq 0xa0a7d
movq %rbx, %rdi
callq 0xa0ab6
movq %rbx, %rdi
callq 0xa0b79
orb $-0x80, 0x17(%rbx)
jmp 0xe8ef8
xorl %ebp, %ebp
movl %ebp, %eax
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/Overlaps.cpp
// Function: get_untig_coverage(ma_hit_t_alloc*, ma_sub_t*, unsigned int*, unsigned long)
long long get_untig_coverage(ma_hit_t_alloc* sources, ma_sub_t* coverage_cut, uint32_t* b, uint64_t n)
{
    uint64_t k, j;
    uint32_t v;
    ma_hit_t *h;
    long long R_bases = 0, C_bases = 0;
    for (k = 0; k < n; ++k) 
    {
        v = b[k]>>1;
        R_bases += coverage_cut[v].e - coverage_cut[v].s;
        for (j = 0; j < (uint64_t)(sources[v].length); j++)
        {
            h = &(sources[v].buffer[j]);
            C_bases += Get_qe((*h)) - Get_qs((*h));
        }
    }
    return C_bases/R_bases;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %eax, %eax
movl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
xorl %r8d, %r8d
xorl %r10d, %r10d
movl (%rdx,%r10,4), %r11d
shrl %r11d
leaq (%r11,%r11,2), %r11
movl 0xc(%rdi,%r11,8), %r14d
testq %r14, %r14
je 0xe964f
leaq (%rdi,%r11,8), %rbx
movq (%rbx), %rbx
shlq $0x3, %r14
leaq (%r14,%r14,4), %r14
xorl %r15d, %r15d
movl 0x8(%rbx,%r15), %r12d
subl (%rbx,%r15), %r12d
addq %r12, %rax
addq $0x28, %r15
cmpq %r15, %r14
jne 0xe963a
movl 0x4(%rsi,%r11,4), %ebx
movl (%rsi,%r11,4), %r11d
andl %r9d, %r11d
subl %r11d, %ebx
addq %rbx, %r8
incq %r10
cmpq %rcx, %r10
jne 0xe9613
cqto
idivq %r8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_arc(asg_t*, unsigned int, unsigned int, asg_arc_t*)
int get_arc(asg_t *g, uint32_t src, uint32_t dest, asg_arc_t* result)
{
    uint32_t i;
    if(g->seq[src>>1].del) return 0;

    uint32_t nv = asg_arc_n(g, src);
    asg_arc_t *av = asg_arc_a(g, src);
    for (i = 0; i < nv; i++)
    {
        if(av[i].del) continue;
        if(av[i].v == dest)
        {
            (*result) = av[i];
            break;
        } 
    }

    if(i != nv) return 1;
    return 0;
}

// Assembly:
movq 0x20(%rdi), %rax
movl %esi, %r8d
shrl %r8d
cmpl $0x0, (%rax,%r8,8)
js 0xea740
movq 0x28(%rdi), %rax
movl %esi, %esi
movq (%rax,%rsi,8), %rsi
testl %esi, %esi
je 0xea743
movq 0x8(%rdi), %rax
movq %rsi, %rdi
shrq $0x20, %rdi
movl %esi, %r8d
leaq (%rdi,%rdi,2), %rdi
leaq (%rax,%rdi,8), %rax
addq $0xc, %rax
xorl %edi, %edi
cmpl $0x0, (%rax)
js 0xea730
cmpl %edx, -0x4(%rax)
je 0xea747
incq %rdi
addq $0x18, %rax
cmpq %rdi, %r8
jne 0xea726
movl %esi, %edi
jmp 0xea756
xorl %eax, %eax
retq
xorl %edi, %edi
jmp 0xea756
movq 0x4(%rax), %rdx
movq %rdx, 0x10(%rcx)
movups -0xc(%rax), %xmm0
movups %xmm0, (%rcx)
xorl %eax, %eax
cmpl %esi, %edi
setne %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: insert_index(asg_t*, unsigned int)
uint32_t insert_index(asg_t *g, uint32_t v)
{
    uint32_t v_tx = g->n_seq * 2;
    if(v >= v_tx) return (uint32_t)-1;
    if(asg_arc_n(g, v)!=0) return (g->idx[v]>>32) + asg_arc_n(g, v);
    ///now v itself does not have any edge
    while (v < v_tx && asg_arc_n(g, v) == 0){v++;}
    ///means there are no edge at the whole graph
    if(v>=v_tx) return g->n_arc;
    return (g->idx[v]>>32);
}

// Assembly:
movl 0x14(%rdi), %edx
addl %edx, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %esi, %edx
jbe 0xea783
movq 0x28(%rdi), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %rsi
testl %esi, %esi
je 0xea784
movq %rsi, %rax
shrq $0x20, %rax
addl %esi, %eax
retq
movl %edx, %edx
cmpl $0x0, (%rax,%rcx,8)
jne 0xea79d
incq %rcx
cmpq %rcx, %rdx
jne 0xea786
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl 0x4(%rdi), %eax
retq
movl %ecx, %ecx
movl 0x4(%rax,%rcx,8), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: insert_index_p(asg_t*, long long, unsigned int)
asg_arc_t* insert_index_p(asg_t *g, long long index, uint32_t m_distance)
{
    ///each edge has two direction
    if (g->n_arc + m_distance > g->m_arc) 
    {
        ///g->m_arc = g->n_arc + (m_distance<<1);
        g->m_arc = (g->n_arc + m_distance)<<1;
		g->arc = (asg_arc_t*)realloc(g->arc, g->m_arc * sizeof(asg_arc_t));
	}
    long long i = g->n_arc; i--;
    for (; i >= index; i--)
    {
        g->arc[i+m_distance] = g->arc[i];
    }

    g->n_arc = g->n_arc + m_distance;

    return &(g->arc[index]);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rdi), %eax
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
leal (%rcx,%r15), %edx
cmpl (%rdi), %edx
jbe 0xea7e9
addl %edx, %edx
movl %edx, (%rbx)
movq 0x8(%rbx), %rdi
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rsi
callq 0x2370
movq %rax, 0x8(%rbx)
movl 0x4(%rbx), %eax
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
cmpq %r14, %rcx
jle 0xea835
movl %r15d, %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rax
leaq (,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
decq %rcx
movq 0x8(%rbx), %rsi
leaq (%rdx,%rsi), %rdi
addq $-0x18, %rdi
movq -0x8(%rdx,%rsi), %r8
movq %r8, 0x10(%rax,%rdi)
movups -0x18(%rdx,%rsi), %xmm0
movups %xmm0, (%rax,%rdi)
addq $-0x18, %rdx
cmpq %r14, %rcx
jg 0xea807
movl 0x4(%rbx), %eax
addl %eax, %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
andl $0x80000000, %eax       # imm = 0x80000000
orl %r15d, %eax
movl %eax, 0x4(%rbx)
leaq (%r14,%r14,2), %rax
shlq $0x3, %rax
addq 0x8(%rbx), %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: append_ma_utg_t(ma_utg_t*, ma_utg_t*)
void append_ma_utg_t(ma_utg_t* v_x, ma_utg_t* v_y)
{
    if(v_x->m < (v_x->n + v_y->n))
    {
        v_x->m = v_x->n + v_y->n;
        v_x->a = (uint64_t*)realloc(v_x->a, v_x->m * sizeof(uint64_t));
    }
    memcpy(v_x->a+v_x->n, v_y->a, v_y->n*sizeof(uint64_t));
    v_x->n = v_x->n + v_y->n;
    free(v_y->a);
    v_y->m=v_y->n=0;v_y->a=NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x10(%rdi), %edx
movl 0x10(%rsi), %ecx
leal (%rcx,%rdx), %eax
cmpl %eax, 0xc(%rdi)
jae 0xeaabd
movl %eax, 0xc(%r14)
movq 0x18(%r14), %rdi
movl %eax, %esi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x18(%r14)
movl 0x10(%r14), %edx
movl 0x10(%rbx), %ecx
jmp 0xeaac1
movq 0x18(%r14), %rax
movl %edx, %edx
leaq (%rax,%rdx,8), %rdi
movq 0x18(%rbx), %rsi
movl %ecx, %edx
shlq $0x3, %rdx
callq 0x2160
movl 0x10(%rbx), %eax
addl %eax, 0x10(%r14)
movq 0x18(%rbx), %rdi
callq 0x2220
xorl %eax, %eax
movq %rax, 0xc(%rbx)
movq %rax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: lable_hap_asg_by_ug(ma_ug_t*, asg_t*)
void lable_hap_asg_by_ug(ma_ug_t *ug, asg_t *read_g)
{
    uint32_t v, n_vtx, i = 0, qn;
    asg_t* nsg = ug->g;
    n_vtx = nsg->n_seq;
    ma_utg_t* node = NULL;
    for (v = 0; v < n_vtx; ++v) 
    {
        if(nsg->seq[v].c == HAP_LABLE)
        {
            node = &(ug->u.a[v]);
            for (i = 0; i < node->n; i++)
            {
                qn = node->a[i]>>33;
                read_g->seq[qn].c = HAP_LABLE;
            }
        }
    }

}

// Assembly:
pushq %rbx
movq 0x18(%rdi), %rcx
movl 0x14(%rcx), %eax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
je 0xeb1cc
movq 0x20(%rcx), %rcx
xorl %edx, %edx
cmpb $0x2, 0x4(%rcx,%rdx,8)
jne 0xeb1c4
movq 0x10(%rdi), %r9
leaq (%rdx,%rdx,4), %r10
movl 0x10(%r9,%r10,8), %r8d
testq %r8, %r8
je 0xeb1c4
leaq (%r9,%r10,8), %r9
movq 0x18(%r9), %r9
movq 0x20(%rsi), %r10
xorl %r11d, %r11d
movq (%r9,%r11,8), %rbx
shrq $0x21, %rbx
movb $0x2, 0x4(%r10,%rbx,8)
incq %r11
cmpq %r11, %r8
jne 0xeb1ae
incq %rdx
cmpq %rax, %rdx
jne 0xeb186
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_rId_from_contig_by_offset(ma_ug_t*, rIdContig*, unsigned int)
uint32_t get_rId_from_contig_by_offset(ma_ug_t *ug, rIdContig* array, uint32_t offset)
{
    uint32_t uId, rId;
    ma_utg_t* reads;
    for (;array->untigI < array->b_0->b.n; array->untigI++)
    {
        uId = array->b_0->b.a[array->untigI]>>1;
        ///if(IsMerge(ug->u, uId)>0) continue;
        reads = &(ug->u.a[uId]);
        for (;array->readI < reads->n; array->readI++, array->offset++)
        {
            if(array->offset == offset)
            {
                rId = reads->a[array->readI]>>33;
                return rId;
            }
        }
        array->readI = 0;
    }


    array->offset = 0;
    for (array->untigI = 0;array->untigI < array->b_0->b.n; array->untigI++)
    {
        uId = array->b_0->b.a[array->untigI]>>1;
        ///if(IsMerge(ug->u, uId)>0) continue;
        reads = &(ug->u.a[uId]);
        for (array->readI = 0;array->readI < reads->n; array->readI++, array->offset++)
        {
            if(array->offset == offset)
            {
                rId = reads->a[array->readI]>>33;
                return rId;
            }
        }
    }

    array->untigI = array->readI = array->offset = 0;
    return (uint32_t)-1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%rsi), %rcx
movq 0x38(%rcx), %rax
movl 0x8(%rsi), %r8d
cmpq %r8, %rax
jbe 0xeb3da
movq 0x48(%rcx), %r9
movq 0x10(%rdi), %r10
movl 0xc(%rsi), %ebx
movl %edx, %r11d
negl %r11d
movl (%r9,%r8,4), %r14d
shrl %r14d
leaq (%r14,%r14,4), %r15
movl 0x10(%r10,%r15,8), %r14d
cmpl %r14d, %ebx
jae 0xeb3c5
leaq (%r10,%r15,8), %r15
movl 0x10(%rsi), %r12d
incl %r12d
movl %ebx, %r13d
negl %r14d
incl %ebx
leal (%r11,%r12), %ebp
cmpl $0x1, %ebp
je 0xeb456
movl %ebx, 0xc(%rsi)
movl %r12d, 0x10(%rsi)
incl %r12d
incq %r13
leal (%r14,%rbx), %ebp
incl %ebp
incl %ebx
cmpl $0x1, %ebp
jne 0xeb39e
movl $0x0, 0xc(%rsi)
incl %r8d
movl %r8d, 0x8(%rsi)
xorl %ebx, %ebx
cmpq %r8, %rax
ja 0xeb376
xorl %r8d, %r8d
movl %r8d, 0x10(%rsi)
movl %r8d, 0x8(%rsi)
testq %rax, %rax
je 0xeb440
movq 0x48(%rcx), %rcx
movq 0x10(%rdi), %rdi
xorl %r10d, %r10d
xorl %r9d, %r9d
movl (%rcx,%r10,4), %r10d
shrl %r10d
leaq (%r10,%r10,4), %r11
movl $0x0, 0xc(%rsi)
movl 0x10(%rdi,%r11,8), %r10d
testq %r10, %r10
je 0xeb431
leaq (%rdi,%r11,8), %r11
xorl %ebx, %ebx
cmpl %r8d, %edx
je 0xeb460
incq %rbx
movl %ebx, 0xc(%rsi)
incl %r8d
movl %r8d, 0x10(%rsi)
cmpl %ebx, %r10d
jne 0xeb41a
incl %r9d
movl %r9d, 0x8(%rsi)
movq %r9, %r10
cmpq %r9, %rax
ja 0xeb3f8
movl $0x0, 0x10(%rsi)
movq $0x0, 0x8(%rsi)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xeb46c
movq 0x18(%r15), %rax
movq (%rax,%r13,8), %rax
jmp 0xeb468
movq 0x18(%r11), %rax
movq (%rax,%rbx,8), %rax
shrq $0x21, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_offset_from_contig_by_rId(ma_ug_t*, rIdContig*, unsigned int)
uint32_t get_offset_from_contig_by_rId(ma_ug_t *ug, rIdContig* array, uint32_t query_rId)
{
    uint32_t uId, rId;
    ma_utg_t* reads;
    for (;array->untigI < array->b_0->b.n; array->untigI++)
    {
        uId = array->b_0->b.a[array->untigI]>>1;
        ///if(IsMerge(ug->u, uId)>0) continue;
        reads = &(ug->u.a[uId]);
        for (;array->readI < reads->n; array->readI++, array->offset++)
        {
            rId = reads->a[array->readI]>>33;
            if(rId == query_rId) return array->offset;
        }
        array->readI = 0;
    }


    array->offset = 0;
    for (array->untigI = 0;array->untigI < array->b_0->b.n; array->untigI++)
    {
        uId = array->b_0->b.a[array->untigI]>>1;
        ///if(IsMerge(ug->u, uId)>0) continue;
        reads = &(ug->u.a[uId]);
        for (array->readI = 0;array->readI < reads->n; array->readI++, array->offset++)
        {
            rId = reads->a[array->readI]>>33;
            if(rId == query_rId) return array->offset;
        }
    }

    array->untigI = array->readI = array->offset = 0;
    return (uint32_t)-1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq (%rsi), %r8
movq 0x38(%r8), %rcx
movl 0x8(%rsi), %eax
cmpq %rax, %rcx
jbe 0xeb4e7
movq 0x48(%r8), %r9
movq 0x10(%rdi), %r10
movl 0xc(%rsi), %ebx
movl (%r9,%rax,4), %r11d
shrl %r11d
leaq (%r11,%r11,4), %r14
movl 0x10(%r10,%r14,8), %r11d
cmpl %r11d, %ebx
jae 0xeb4d4
leaq (%r10,%r14,8), %r14
movq 0x18(%r14), %r14
movl %ebx, %ebx
movq (%r14,%rbx,8), %r15
shrq $0x21, %r15
cmpl %edx, %r15d
je 0xeb579
incq %rbx
movl %ebx, 0xc(%rsi)
incl 0x10(%rsi)
cmpq %rbx, %r11
jne 0xeb4b5
movl $0x0, 0xc(%rsi)
incl %eax
movl %eax, 0x8(%rsi)
xorl %ebx, %ebx
cmpq %rax, %rcx
ja 0xeb496
xorl %eax, %eax
movl %eax, 0x10(%rsi)
movl %eax, 0x8(%rsi)
testq %rcx, %rcx
je 0xeb563
movq 0x48(%r8), %r8
movq 0x10(%rdi), %rdi
xorl %r10d, %r10d
xorl %r9d, %r9d
movl (%r8,%r10,4), %r10d
shrl %r10d
leaq (%r10,%r10,4), %r11
movl $0x0, 0xc(%rsi)
movl 0x10(%rdi,%r11,8), %r10d
testq %r10, %r10
je 0xeb554
leaq (%rdi,%r11,8), %r11
movq 0x18(%r11), %r11
negq %r10
movl $0x1, %ebx
movq -0x8(%r11,%rbx,8), %r14
shrq $0x21, %r14
cmpl %edx, %r14d
je 0xeb57c
movl %ebx, 0xc(%rsi)
incl %eax
movl %eax, 0x10(%rsi)
leaq (%r10,%rbx), %r14
incq %r14
incq %rbx
cmpq $0x1, %r14
jne 0xeb52e
incl %r9d
movl %r9d, 0x8(%rsi)
movq %r9, %r10
cmpq %r9, %rcx
ja 0xeb502
movl $0x0, 0x10(%rsi)
movq $0x0, 0x8(%rsi)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xeb57c
movl 0x10(%rsi), %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_reverseId(asg_t*, ma_hit_t_alloc*, R_to_U*, unsigned int, unsigned int, unsigned int)
uint32_t get_reverseId(asg_t *read_g, ma_hit_t_alloc* reverse_sources,
R_to_U* ruIndex, uint32_t qn, uint32_t tn, uint32_t tn_off)
{
    uint32_t i, rId, is_Unitig, cId, cId_off = 0;
    for (i = 0; i < reverse_sources[qn].length; i++)
    {
        rId = Get_tn(reverse_sources[qn].buffer[i]);
        ///there are three cases: 
        ///1. read at primary contigs, get_R_to_U() return its corresponding contig Id  
        ///2. read at alternative contigs, get_R_to_U() return (uint32_t)-1
        ///3. read has bee deleted, get_R_to_U() return the id of read that contains it 
        if(read_g->seq[rId].del == 1)
        {
            ///get the id of read that contains it 
            get_R_to_U(ruIndex, rId, &rId, &is_Unitig);
            if(rId == (uint32_t)-1 || is_Unitig == 1 || read_g->seq[rId].del == 1) continue;
        }

        ///here rId is the id of the read coming from the different haplotype
        ///cId is the id of the corresponding contig (note here is the contig, instead of untig)
        get_R_to_U(ruIndex, rId, &cId, &is_Unitig);
        if(is_Unitig == 0) continue;
        ///if the read is at alternative contigs, cId might be (uint32_t)-1
        ///if(cId == (uint32_t)-1)
        if(cId == tn)
        {
            if(cId_off == tn_off) return rId;
            cId_off++;
        }
    }

    return (uint32_t)-1;
}

// Assembly:
movl %ecx, %eax
leaq (%rax,%rax,2), %rcx
movl 0xc(%rsi,%rcx,8), %eax
testq %rax, %rax
je 0xeb634
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
leaq (%rsi,%rcx,8), %rcx
movq (%rcx), %rcx
movq 0x20(%rdi), %rsi
movq (%rdx), %rdi
shlq $0x3, %rax
leaq (%rax,%rax,4), %r10
xorl %r11d, %r11d
xorl %ebx, %ebx
movl 0xc(%rcx,%r11), %eax
cmpl $0x0, (%rsi,%rax,8)
js 0xeb607
movb $0x1, %bpl
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpq %rax, %rdi
jbe 0xeb5ee
movq 0x8(%rdx), %r15
movl (%r15,%rax,4), %r15d
cmpl $-0x1, %r15d
je 0xeb5ee
movl %r15d, %r14d
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
shrl $0x1f, %r15d
movl %r15d, %ebp
cmpl %r8d, %r14d
setne %r14b
xorb $0x1, %bpl
orb %r14b, %bpl
jne 0xeb61f
cmpl %r9d, %ebx
je 0xeb62d
incl %ebx
jmp 0xeb61f
cmpq %rax, %rdi
jbe 0xeb61f
movq 0x8(%rdx), %r14
movslq (%r14,%rax,4), %rax
testq %rax, %rax
js 0xeb61f
cmpl $0x0, (%rsi,%rax,8)
jns 0xeb5c1
addq $0x28, %r11
cmpq %r11, %r10
jne 0xeb5b6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: process_bi_graph(asg_t*)
void process_bi_graph(asg_t *bi_g)
{
    asg_cleanup(bi_g);
    asg_arc_del_multi(bi_g);
	bi_g->is_symm = 1;
    uint32_t v, i, j;
    for (v = 0; v < bi_g->n_seq; v++)
    {
        uint32_t nv = asg_arc_n(bi_g, v), nw, w;
        asg_arc_t *av = asg_arc_a(bi_g, v), *aw;
        for (i = 0; i < nv; ++i)
        {
            w = av[i].v;
            if(w == v)
            {
                av[i].del = 1;
                continue;
            }
            nw = asg_arc_n(bi_g, w);
            aw = asg_arc_a(bi_g, w);
            for (j = 0; j < nw; j++)
            {
                if(aw[j].v == v) break;
            }

            if(j == nw) av[i].del = 1;
        }
    }

    asg_cleanup(bi_g);

    ///asg_symm(bi_g);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xa0a7d
movq %rbx, %rdi
callq 0xa0ab6
movl 0x14(%rbx), %eax
movl %eax, %ecx
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0x14(%rbx)
testl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
je 0xebdea
xorl %eax, %eax
movq 0x28(%rbx), %rdx
movq (%rdx,%rax,8), %rdx
testl %edx, %edx
je 0xebdd6
movq %rdx, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x8(%rbx), %rcx
movl %edx, %edx
xorl %esi, %esi
leaq (%rsi,%rsi,2), %rdi
movl 0x8(%rcx,%rdi,8), %r8d
cmpq %r8, %rax
je 0xebdc3
movq 0x28(%rbx), %r9
movq (%r9,%r8,8), %r8
testl %r8d, %r8d
je 0xebdbb
movq 0x8(%rbx), %r9
movq %r8, %r11
shrq $0x20, %r11
movl %r8d, %r10d
leaq (%r11,%r11,2), %r11
leaq (%r9,%r11,8), %r11
addq $0x8, %r11
xorl %r9d, %r9d
movl (%r11), %r14d
cmpq %r14, %rax
je 0xebdbe
incq %r9
addq $0x18, %r11
cmpq %r9, %r10
jne 0xebda5
jmp 0xebdc3
xorl %r9d, %r9d
cmpl %r8d, %r9d
jne 0xebdcb
leaq (%rcx,%rdi,8), %rdi
orb $-0x80, 0xf(%rdi)
incq %rsi
cmpq %rdx, %rsi
jne 0xebd6d
movl 0x14(%rbx), %ecx
incq %rax
movl %ecx, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
cmpq %rdx, %rax
jb 0xebd46
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa0a7d
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: print_gfa(asg_t*)
void print_gfa(asg_t *g)
{
    uint32_t v, i, n_vtx = g->n_seq * 2;
    for (v = 0; v < n_vtx; v++)
    {
        if(g->seq[v>>1].del)
        {
            fprintf(stderr, "(D) v>>1: %u, v&1: %u, %.*s\n", v>>1, v&1, 
                (int)Get_NAME_LENGTH((R_INF), v>>1), Get_NAME((R_INF), v>>1));
            continue;
        } 

        fprintf(stderr, "(E) v>>1: %u, v&1: %u, %.*s\n", v>>1, v&1, 
                (int)Get_NAME_LENGTH((R_INF), v>>1), Get_NAME((R_INF), v>>1));
        
        uint32_t nv = asg_arc_n(g, v);
		asg_arc_t *av = asg_arc_a(g, v);
        for (i = 0; i < nv; i++)
        {
            if(av[i].del) continue;
            fprintf(stderr, "av[i].v: %u, av[i].ul: %u\n", 
                            av[i].v, (uint32_t)(av[i].ul>>32));
        }

    }
    
}

// Assembly:
movl 0x14(%rdi), %eax
addl %eax, %eax
je 0xed486
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %eax, %r13d
leaq 0x1a8e55(%rip), %rbp    # 0x296230
xorl %r15d, %r15d
movq 0x20(%rbx), %rax
movl %r15d, %edx
shrl %edx
movl %r15d, %ecx
movq 0x40(%rbp), %rsi
movl 0x8(%rsi,%rdx,8), %r8d
movq (%rsi,%rdx,8), %r9
subl %r9d, %r8d
addq 0x8(%rbp), %r9
andl $0x1, %ecx
cmpl $0x0, (%rax,%rdx,8)
movq 0x1a7bd4(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
js 0xed45e
leaq 0x14b008(%rip), %rsi    # 0x238420
xorl %eax, %eax
callq 0x22b0
movq 0x28(%rbx), %rax
movq (%rax,%r15,8), %rax
testl %eax, %eax
je 0xed46c
movq %rax, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %r12
shlq $0x3, %r12
addq 0x8(%rbx), %r12
movl %eax, %r14d
cmpl $0x0, 0xc(%r12)
jns 0xed454
addq $0x18, %r12
decq %r14
jne 0xed441
jmp 0xed46c
movq %r12, %rdi
callq 0x113cb
jmp 0xed449
leaq 0x14af9e(%rip), %rsi    # 0x238403
xorl %eax, %eax
callq 0x22b0
incq %r15
cmpq %r13, %r15
jne 0xed3de
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/Overlaps.cpp
// Function: print_purge_gfa(asg_t*, unsigned long*)
void print_purge_gfa(asg_t *g, uint64_t* cCount)
{
    uint32_t v, i, n_vtx = g->n_seq, beg, end;
    for (v = 0; v < n_vtx; v++)
    {
        if(g->seq[v>>1].del)
        {
            fprintf(stderr, "(D) v: %u, Len: %u, start>>1: %u, flag: %u\n", v, (uint32_t)(cCount[v]>>33),
            ((uint32_t)cCount[v])>>1, g->seq[v].len);
            continue;
        } 

        fprintf(stderr, "(E) v: %u, Len: %u, start>>1: %u, flag: %u\n", v, (uint32_t)(cCount[v]>>33),
        ((uint32_t)cCount[v])>>1, g->seq[v].len);
        
        uint32_t nv = asg_arc_n(g, v);
		asg_arc_t *av = asg_arc_a(g, v);
        for (i = 0; i < nv; i++)
        {
            if(av[i].del) continue;
            beg = av[i].ul>>32;
            end = av[i].v;

            fprintf(stderr, "****beg: %u (Len: %u) ---> end: %u (Len: %u)\n", 
            beg, (uint32_t)(cCount[beg]>>33),
            end, (uint32_t)(cCount[end]>>33));

        }

    }
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x14(%rdi), %r15d
andq $0x7fffffff, %r15       # imm = 0x7FFFFFFF
je 0xed54d
movq %rsi, %rbx
movq %rdi, %r14
xorl %r13d, %r13d
movq 0x20(%r14), %rax
movl %r13d, %edx
shrl %edx
movq (%rbx,%r13,8), %r8
movq %r8, %rcx
shrq $0x21, %rcx
shrl %r8d
movl (%rax,%r13,8), %r9d
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl %esi, %r9d
cmpl $0x0, (%rax,%rdx,8)
movq 0x1a7b06(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
js 0xed530
leaq 0x14af9e(%rip), %rsi    # 0x238484
movl %r13d, %edx
xorl %eax, %eax
callq 0x22b0
movq 0x28(%r14), %rax
movq (%rax,%r13,8), %rax
testl %eax, %eax
je 0xed541
movq %rax, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rbp
shlq $0x3, %rbp
addq 0x8(%r14), %rbp
movl %eax, %r12d
cmpl $0x0, 0xc(%rbp)
jns 0xed523
addq $0x18, %rbp
decq %r12
jne 0xed512
jmp 0xed541
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x113ec
jmp 0xed518
leaq 0x14af21(%rip), %rsi    # 0x238458
movl %r13d, %edx
xorl %eax, %eax
callq 0x22b0
incq %r13
cmpq %r15, %r13
jne 0xed4ac
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/Overlaps.cpp
// Function: get_single_coverage(ma_hit_t_alloc*, ma_sub_t*, unsigned int)
uint32_t get_single_coverage(ma_hit_t_alloc* sources, ma_sub_t* coverage_cut, uint32_t rId)
{
    long long R_bases = 0, C_bases = 0;
    uint32_t j;
    ma_hit_t *h = NULL;

    R_bases += coverage_cut[rId].e - coverage_cut[rId].s;
    for (j = 0; j < (uint64_t)(sources[rId].length); j++)
    {
        h = &(sources[rId].buffer[j]);
        C_bases += Get_qe((*h)) - Get_qs((*h));
    }

    if(R_bases == 0) return 0;
    return (C_bases/R_bases);
}

// Assembly:
movl %edx, %eax
leaq (%rax,%rax,2), %rcx
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl (%rsi,%rcx,4), %edx
movl 0x4(%rsi,%rcx,4), %esi
movl 0xc(%rdi,%rcx,8), %r8d
xorl %eax, %eax
testq %r8, %r8
je 0xedbaf
leaq (%rdi,%rcx,8), %rcx
movq (%rcx), %rdi
shlq $0x3, %r8
leaq (%r8,%r8,4), %r8
xorl %r9d, %r9d
xorl %ecx, %ecx
movl 0x8(%rdi,%r9), %r10d
subl (%rdi,%r9), %r10d
addq %r10, %rcx
addq $0x28, %r9
cmpq %r9, %r8
jne 0xedb98
jmp 0xedbb1
xorl %ecx, %ecx
cmpl %edx, %esi
je 0xedbbf
subl %edx, %esi
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: recover_edges(asg_t*, kvec_t_u64_warp*, unsigned long*, unsigned long, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)
void recover_edges(asg_t* nsg, kvec_t_u64_warp* edges, uint64_t* nodes, uint64_t n,
uint32_t beg, uint32_t end, uint32_t beg_c, uint32_t end_c, uint32_t is_recover_edges)
{
    uint32_t i, v;
    asg_arc_t *a = NULL;
    for (i = 0; i < n; i++)
    {
        v = (uint32_t)nodes[i];
        nsg->seq[v].del = 0;
        nsg->seq[v].c = (nodes[i]>>32);
    }
    nsg->seq[beg>>1].c = beg_c; nsg->seq[beg>>1].del = 0;
    nsg->seq[end>>1].c = end_c; nsg->seq[end>>1].del = 0;

    if(is_recover_edges)
    {
        for (i = 0; i < edges->a.n; i++)
        {
            a = &(nsg->arc[(uint32_t)edges->a.a[i]]);
            a->del = 0;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movl 0x38(%rsp), %eax
movl 0x30(%rsp), %r10d
movl 0x28(%rsp), %r11d
movq 0x20(%rdi), %rbx
testq %rcx, %rcx
je 0xedc05
xorl %r14d, %r14d
movl (%rdx,%r14,8), %r15d
andl $0x7fffffff, (%rbx,%r15,8) # imm = 0x7FFFFFFF
movb 0x4(%rdx,%r14,8), %bpl
movq 0x20(%rdi), %rbx
movb %bpl, 0x4(%rbx,%r15,8)
incq %r14
movl %r14d, %r15d
cmpq %rcx, %r15
jb 0xedbe0
shrl %r8d
movb %r11b, 0x4(%rbx,%r8,8)
andb $0x7f, 0x3(%rbx,%r8,8)
movq 0x20(%rdi), %rcx
shrl %r9d
movb %r10b, 0x4(%rcx,%r9,8)
andb $0x7f, 0x3(%rcx,%r9,8)
testl %eax, %eax
je 0xedc57
cmpq $0x0, (%rsi)
je 0xedc57
movl $0x1, %eax
xorl %ecx, %ecx
movq 0x8(%rdi), %rdx
movq 0x10(%rsi), %r8
movl (%r8,%rcx,8), %ecx
leaq (%rcx,%rcx,2), %rcx
andl $0x7fffffff, 0xc(%rdx,%rcx,8) # imm = 0x7FFFFFFF
movl %eax, %ecx
incl %eax
cmpq %rcx, (%rsi)
ja 0xedc36
popq %rbx
popq %r14
popq %r15
popq %rbp
retq