LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 0x145ad4(%rip), %rsi    # 0x1e9ce1
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 0xc4b84
testl %eax, %eax
je 0xa431a
leaq 0x145ab1(%rip), %rsi    # 0x1e9cf3
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 0xc4b84
testl %eax, %eax
je 0xa431a
incq %r12
incl %r13d
movq %r15, %rdi
callq 0x2220
movq 0x30(%rbx), %r15
movl %r12d, %edi
callq 0x2280
movq %rax, 0x30(%rbx)
leaq 0x145a4c(%rip), %rsi    # 0x1e9ce1
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 0x145a3a(%rip), %rsi    # 0x1e9cf3
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x1aff63(%rip), %rax    # 0x254230
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 0xc55cf
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)
pushq $0x1
popq %rbp
jmp 0xa4322
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_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: write_all_data_to_disk(ma_hit_t_alloc*, ma_hit_t_alloc*, All_reads*, char*)
void write_all_data_to_disk(ma_hit_t_alloc* sources, ma_hit_t_alloc* reverse_sources, All_reads *RNF, char* output_file_name)
{   
	char* gfa_name = (char*)malloc(strlen(output_file_name)+25);
	sprintf(gfa_name, "%s.ec", output_file_name);
	write_All_reads(RNF, gfa_name);

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

	sprintf(gfa_name, "%s.ovlp.source", output_file_name);
	write_ma_hit_ts(sources, RNF->total_reads, gfa_name);

	sprintf(gfa_name, "%s.ovlp.reverse", output_file_name);
	write_ma_hit_ts(reverse_sources, RNF->total_reads, gfa_name);

	free(gfa_name);
    fprintf(stderr, "bin files have been written.\n");
    if(asm_opt.bin_only) exit(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r13
movq %rcx, %rdi
callq 0x2090
leaq 0x19(%rax), %rdi
callq 0x2280
movq %rax, %r12
leaq 0x13eb53(%rip), %rsi    # 0x1e2eb8
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
movq %r14, %rdi
movq %r12, %rsi
callq 0x5958
callq 0xa4437
leaq 0x1af3cf(%rip), %rbp    # 0x253758
movq 0x20(%rbp), %rsi
movq 0x28(%rbp), %rdx
testq %rsi, %rsi
setne %cl
andb %al, %cl
testq %rdx, %rdx
setne %al
andb %cl, %al
cmpb $0x1, %al
jne 0xa43ae
movq 0x10(%rbp), %rdi
callq 0xa4047
leaq 0x145974(%rip), %rsi    # 0x1e9d29
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
movq 0x50(%r14), %rsi
movq %r13, %rdi
movq %r12, %rdx
callq 0xa3dcf
leaq 0x145960(%rip), %rsi    # 0x1e9d38
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
movq 0x50(%r14), %rsi
movq %rbx, %rdi
movq %r12, %rdx
callq 0xa3dcf
movq %r12, %rdi
callq 0x2220
movq 0x1aebdd(%rip), %rax    # 0x252fe0
movq (%rax), %rcx
leaq 0x14593b(%rip), %rdi    # 0x1e9d48
pushq $0x1d
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
cmpb $0x0, 0x24e(%rbp)
jne 0xa4430
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/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 0x13ea24(%rip), %rsi    # 0x1e2eb8
xorl %ebp, %ebp
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x1afd86(%rip), %rdi    # 0x254230
movq %rbx, %rsi
callq 0x5bfa
testl %eax, %eax
je 0xa457e
callq 0xa4437
testl %eax, %eax
je 0xa4501
leaq 0x1af28e(%rip), %r13    # 0x253758
cmpq $0x0, 0x20(%r13)
je 0xa44e8
cmpq $0x0, 0x28(%r13)
je 0xa44e8
movq 0x10(%r13), %rsi
movq %r13, %rdi
callq 0xa41de
testl %eax, %eax
jne 0xa4501
movq %r13, %rdi
callq 0xc55cf
movq 0x10(%r13), %rdi
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rdx
callq 0xa4047
leaq 0x1af250(%rip), %rax    # 0x253758
testb $0x4, (%rax)
je 0xa4538
andq $0x0, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %r15, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xa4597
testl %eax, %eax
je 0xa4538
andq $0x0, (%r12)
andq $0x0, (%r14)
pushq $0x1
popq %rbp
jmp 0xa457e
leaq 0x1457ea(%rip), %rsi    # 0x1e9d29
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
movq %r12, %rdi
movq %rbx, %rsi
callq 0xa3968
testl %eax, %eax
je 0xa457e
leaq 0x1457d4(%rip), %rsi    # 0x1e9d38
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa3968
movl %eax, %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
// File: /workspace/github_cpp_makefile_star2_O2/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, -0x8(%rsp)
movq (%rcx), %r10
movq 0x18(%rcx), %rax
movl (%rax), %r11d
xorl %ecx, %ecx
movabsq $0x1, %r9
movl %r11d, %ebp
xorl %eax, %eax
movl %ebp, %ebx
imulq $0x1c, %rbx, %rbx
movl (%r10,%rbx), %r14d
cmpl %edx, %r14d
je 0xa57f7
cmpl %r11d, %ebp
jne 0xa5783
movq 0x20(%rdi), %rbx
movl %r14d, %r15d
shrl %r15d
movl (%rbx,%r15,8), %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
jmp 0xa57ce
movq 0x8(%rdi), %r15
movq 0x28(%rdi), %rbx
movq (%rbx,%r14,8), %r12
movl %r12d, %ebx
shrq $0x20, %r12
imulq $0x18, %r12, %r13
leaq (%r15,%r13), %r12
addq %r15, %r13
addq $0xc, %r13
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0xa57c6
cmpl $0x0, (%r13)
js 0xa57ba
cmpl %ebp, -0x4(%r13)
je 0xa57c3
incq %r15
addq $0x18, %r13
jmp 0xa57a8
movq %r15, %rbx
imulq $0x18, %rbx, %rbx
movl (%r12,%rbx), %r15d
movq %r9, %rbx
testq %rsi, %rsi
je 0xa57e9
movq 0x10(%rsi), %rbx
movl %r14d, %r12d
shrl %r12d
imulq $0x28, %r12, %r12
movl 0x10(%rbx,%r12), %ebx
addq %r15, %rcx
addq %rbx, %rax
movl %r14d, %ebp
jmp 0xa5754
testq %r8, %r8
je 0xa57ff
movq %rcx, (%r8)
movq -0x8(%rsp), %rcx
testq %rcx, %rcx
je 0xa580c
movq %rax, (%rcx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
movq 0x18(%rcx), %rax
movl (%rax), %r8d
pxor %xmm0, %xmm0
leaq 0x1aea06(%rip), %rax    # 0x254230
movd 0x14238e(%rip), %xmm1   # 0x1e7bc0
movdqa 0x13d396(%rip), %xmm2   # 0x1e2bd0
movl %r8d, %edi
imulq $0x1c, %rdi, %rdi
movq (%rcx), %r9
movq 0x18(%rcx), %r10
movl (%r9,%rdi), %edi
cmpl (%r10), %r8d
jne 0xa585a
movl %edi, %r8d
cmpl %edx, %edi
jne 0xa583a
jmp 0xa58b2
shrl %r8d
imulq $0x28, %r8, %r8
addq 0x10(%rsi), %r8
xorl %r9d, %r9d
movl 0x10(%r8), %r10d
cmpq %r10, %r9
jae 0xa5851
movq 0x18(%r8), %r10
movq (%r10,%r9,8), %r10
shrq $0x21, %r10
movq 0x28(%rax), %rbx
movzbl (%rbx,%r10), %r11d
testb %r11b, %r11b
jne 0xa5890
movb $0x5, (%rbx,%r10)
movd %r11d, %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 %r9
jmp 0xa5868
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
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x1c
popq %rsi
callq 0x2120
movq %rax, (%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
andq $0x0, 0x38(%rsp)
andl $0x0, 0x30(%rsp)
andl $0x0, 0x28(%rsp)
andq $0x0, 0x20(%rsp)
andl $0x0, 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 0x84a86
cmpl 0xe8(%rsp), %eax
jne 0xa8892
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
movq 0x1aa747(%rip), %rax    # 0x252fe0
movq (%rax), %rcx
leaq 0x1424e1(%rip), %rdi    # 0x1ead84
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
jmp 0xa8848
// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rdi, %r15
movl 0x14(%rdi), %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
pushq $0x18
popq %r13
xorl %r12d, %r12d
xorl %r14d, %r14d
cmpq %r12, %rbp
je 0xa8b92
movq (%rbx), %rax
cmpl $0x0, (%rax,%r13)
js 0xa8b89
movq %r15, %rdi
movq %rbx, %rsi
movl %r12d, %edx
leaq 0x4(%rsp), %rcx
callq 0xa88b0
cmpq %r14, %rax
cmovbeq %r14, %rax
cmpl $0x0, 0x4(%rsp)
cmovneq %rax, %r14
incq %r12
addq $0x1c, %r13
jmp 0xa8b57
imulq $0x1c, %rbp, %rax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0xa8bae
movq (%rbx), %rdx
andl $0x7fffffff, 0x18(%rdx,%rcx) # imm = 0x7FFFFFFF
addq $0x1c, %rcx
jmp 0xa8b98
andq $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_O2/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 $0x28, %rsp
movl %ecx, %ebx
movq %rdx, %r14
movq 0x8(%rsi), %r9
movq 0x28(%rsi), %rax
movl %r8d, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %esi
movq %rax, %r8
shrq $0x20, %r8
movq 0x8(%rdi), %rax
movq %rdi, 0x18(%rsp)
movq 0x28(%rdi), %rdx
movq (%rdx,%rcx,8), %rdx
movq %rdx, %rcx
shrq $0x20, %rcx
imulq $0x18, %rsi, %r10
imulq $0x18, %r8, %rsi
leaq (%rsi,%r9), %r15
addq $0xc, %r15
xorl %esi, %esi
xorl %r8d, %r8d
cmpq %rsi, %r10
je 0xa9277
cmpl $0x0, (%r15,%rsi)
js 0xa9271
movl -0x4(%r15,%rsi), %edi
orb %bl, (%r14,%rdi)
incl %r8d
addq $0x18, %rsi
jmp 0xa9259
movq %r10, 0x10(%rsp)
movl %r8d, 0xc(%rsp)
movl %edx, %edx
imulq $0x18, %rdx, %rdx
movq %rdx, 0x20(%rsp)
imulq $0x18, %rcx, %rcx
leaq (%rcx,%rax), %r12
addq $0xc, %r12
xorl %ebp, %ebp
xorl %r13d, %r13d
cmpq %rbp, 0x20(%rsp)
je 0xa92d5
movl -0x4(%r12,%rbp), %esi
testb %bl, (%r14,%rsi)
je 0xa92cf
andb $0x7f, 0x3(%r12,%rbp)
incl %r13d
xorl $0x1, %esi
movl -0x8(%r12,%rbp), %edx
xorl $0x1, %edx
movq 0x18(%rsp), %rdi
xorl %ecx, %ecx
callq 0x6db50
addq $0x18, %rbp
jmp 0xa929d
xorl %eax, %eax
movl 0xc(%rsp), %ecx
movq 0x10(%rsp), %rdi
cmpq %rax, %rdi
je 0xa9305
cmpl $0x0, (%r15,%rax)
js 0xa92ff
movl -0x4(%r15,%rax), %esi
movb (%r14,%rsi), %dl
testb %bl, %dl
je 0xa92ff
subb %bl, %dl
movb %dl, (%r14,%rsi)
addq $0x18, %rax
jmp 0xa92e0
cmpl %r13d, %ecx
jne 0xa9319
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1a9cc0(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0x140bf6(%rip), %rsi    # 0x1e9f20
leaq 0x140c07(%rip), %rdx    # 0x1e9f38
movl %r13d, %r8d
xorl %eax, %eax
callq 0x22b0
leaq 0x140c07(%rip), %rdi    # 0x1e9f49
leaq 0x13ea48(%rip), %rsi    # 0x1e7d91
leaq 0x140c02(%rip), %rcx    # 0x1e9f52
movl $0x677c, %edx           # imm = 0x677C
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/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 0x251c
movl 0x14(%rbx), %r14d
addl %r14d, %r14d
xorl %r13d, %r13d
xorl %ebp, %ebp
cmpq %r13, %r14
je 0xaa8f8
movq 0x20(%rbx), %rax
movl %r13d, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0xaa8f3
movq 0x28(%rbx), %rax
testl $0xfffffffe, (%rax,%r13,8) # imm = 0xFFFFFFFE
je 0xaa8f3
movq %rbx, %rdi
movl %r13d, %esi
movq %r12, %rdx
movq %r15, %rcx
movq (%rsp), %r8
callq 0xaa653
addl %eax, %ebp
incq %r13
jmp 0xaa8ba
testl %ebp, %ebp
je 0xaa90c
movq %rbx, %rdi
callq 0x694eb
movq %rbx, %rdi
callq 0x69638
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_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
xorl %r8d, %r8d
movl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
xorl %r9d, %r9d
xorl %eax, %eax
cmpq %rcx, %r8
je 0xab013
movl (%rdx,%r8,4), %ebx
shrl %ebx
imulq $0xc, %rbx, %r14
movl 0x4(%rsi,%r14), %r11d
movl (%rsi,%r14), %ebp
andl %r10d, %ebp
subl %ebp, %r11d
imulq $0x18, %rbx, %r14
leaq (%rdi,%r14), %rbx
movl 0xc(%rdi,%r14), %r14d
imulq $0x28, %r14, %r14
xorl %r15d, %r15d
cmpq %r15, %r14
je 0xab00b
movq (%rbx), %r12
movl 0x8(%r12,%r15), %r13d
subl (%r12,%r15), %r13d
addq %r13, %rax
addq $0x28, %r15
jmp 0xaaff1
addq %r11, %r9
incq %r8
jmp 0xaafbf
cqto
idivq %r9
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: output_tangles(unsigned int, unsigned int, unsigned int*, unsigned int, char const*)
void output_tangles(uint32_t startID, uint32_t endId, uint32_t* a, uint32_t n, const char* lable)
{
    kvec_t(uint32_t) u_vecs;
    u_vecs.a = a, u_vecs.n = n;

    fprintf(stderr, "\n%sstartID: %u, dir: %u\n", lable, startID>>1, startID&1);
    fprintf(stderr, "%sendID: %u, dir: %u\n", lable, endId>>1, endId&1);
    uint32_t ijk;
    for (ijk = 0; ijk < u_vecs.n; ijk++)
    {
        fprintf(stderr, "%stangleID: %u, dir: %u\n", lable, u_vecs.a[ijk]>>1, u_vecs.a[ijk]&1);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %r14
movl %esi, %r15d
movl %edi, %r8d
movq 0x1a72cb(%rip), %r12    # 0x252fe0
movq (%r12), %rdi
movl %r8d, %ecx
shrl %ecx
andl $0x1, %r8d
leaq 0x13e54b(%rip), %rsi    # 0x1ea274
movq %rbx, %rdx
xorl %eax, %eax
callq 0x22b0
movq (%r12), %rdi
movl %r15d, %ecx
shrl %ecx
andl $0x1, %r15d
leaq 0x13e546(%rip), %rsi    # 0x1ea28d
movq %rbx, %rdx
movl %r15d, %r8d
xorl %eax, %eax
callq 0x22b0
movl %ebp, %r13d
leaq 0x13e545(%rip), %r15    # 0x1ea2a3
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0xabd88
movq (%r12), %rdi
movl (%r14,%rbp,4), %r8d
movl %r8d, %ecx
shrl %ecx
andl $0x1, %r8d
movq %r15, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x22b0
incq %rbp
jmp 0xabd60
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0xabde9
movq 0x8(%rdi), %rax
movq 0x28(%rdi), %rdi
movl %esi, %esi
movq (%rdi,%rsi,8), %rsi
movq %rsi, %rdi
shrq $0x20, %rdi
movl %esi, %r8d
imulq $0x18, %rdi, %rdi
addq %rdi, %rax
addq $0xc, %rax
xorl %edi, %edi
cmpq %rdi, %r8
je 0xabde5
cmpl $0x0, (%rax)
js 0xabddc
cmpl %edx, -0x4(%rax)
je 0xabdec
incq %rdi
addq $0x18, %rax
jmp 0xabdcd
movl %esi, %edi
jmp 0xabdfb
xorl %eax, %eax
retq
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_O2/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
cmpl %esi, %edx
jbe 0xabe24
movq 0x28(%rdi), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %rsi
testl %esi, %esi
je 0xabe28
movq %rsi, %rax
shrq $0x20, %rax
addl %esi, %eax
retq
pushq $-0x1
popq %rax
retq
movl %edx, %edx
cmpq %rcx, %rdx
je 0xabe3a
cmpl $0x0, (%rax,%rcx,8)
jne 0xabe43
incq %rcx
jmp 0xabe2a
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_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movl 0x4(%rdi), %eax
andl %ebp, %eax
leal (%rax,%r15), %ecx
cmpl (%rdi), %ecx
jbe 0xabe86
addl %ecx, %ecx
movl %ecx, (%rbx)
movq 0x8(%rbx), %rdi
imulq $0x18, %rcx, %rsi
callq 0x2370
movq %rax, 0x8(%rbx)
andl 0x4(%rbx), %ebp
movl %ebp, %eax
movl %eax, %eax
movl %r15d, %ecx
imulq $0x18, %rcx, %rcx
imulq $0x18, %rax, %rdx
cmpq %r14, %rax
jle 0xabec0
decq %rax
movq 0x8(%rbx), %rsi
leaq (%rdx,%rsi), %rdi
addq $-0x18, %rdi
movq -0x8(%rdx,%rsi), %r8
movq %r8, 0x10(%rcx,%rdi)
movups -0x18(%rdx,%rsi), %xmm0
movups %xmm0, (%rcx,%rdi)
addq $-0x18, %rdx
jmp 0xabe93
movl 0x4(%rbx), %eax
addl %eax, %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
andl $0x80000000, %eax       # imm = 0x80000000
orl %r15d, %eax
movl %eax, 0x4(%rbx)
imulq $0x18, %r14, %rax
addq 0x8(%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0xac128
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 0xac12c
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
andq $0x0, 0xc(%rbx)
andq $0x0, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: adjust_asg_by_ug(ma_ug_t*, asg_t*)
void adjust_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 == ALTER_LABLE)
        {
            node = &(ug->u.a[v]);
            for (i = 0; i < node->n; i++)
            {
                qn = node->a[i]>>33;
                read_g->seq[qn].c = ALTER_LABLE;
            }
        }
    }


    for (v = 0; v < n_vtx; ++v) 
    {
        if(nsg->seq[v].c == ALTER_LABLE)
        {
            node = &(ug->u.a[v]);
            for (i = 0; i < node->n; i++)
            {
                qn = node->a[i]>>33;
                ///read_g->seq[qn].c = ALTER_LABLE;
                asg_seq_drop(read_g, qn);
            }
        }
    }

    asg_cleanup(read_g);
	asg_symm(read_g);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, (%rsp)
movq 0x18(%rdi), %r15
movl 0x14(%r15), %r12d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %eax, %eax
cmpq %r12, %rax
je 0xac4cf
movq 0x20(%r15), %rcx
cmpb $0x1, 0x4(%rcx,%rax,8)
jne 0xac4ca
movq (%rsp), %rcx
movq 0x10(%rcx), %rdx
imulq $0x28, %rax, %rsi
leaq (%rdx,%rsi), %rcx
movl 0x10(%rdx,%rsi), %edx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0xac4ca
movq 0x18(%rcx), %rdi
movq (%rdi,%rsi,8), %rdi
movq 0x20(%rbx), %r8
shrq $0x21, %rdi
movb $0x1, 0x4(%r8,%rdi,8)
incq %rsi
jmp 0xac4aa
incq %rax
jmp 0xac484
xorl %r13d, %r13d
cmpq %r12, %r13
je 0xac518
movq 0x20(%r15), %rax
cmpb $0x1, 0x4(%rax,%r13,8)
jne 0xac513
imulq $0x28, %r13, %rbp
movq (%rsp), %rax
addq 0x10(%rax), %rbp
xorl %r14d, %r14d
movl 0x10(%rbp), %eax
cmpq %rax, %r14
jae 0xac513
movq 0x18(%rbp), %rax
movq (%rax,%r14,8), %rsi
shrq $0x21, %rsi
movq %rbx, %rdi
callq 0x80870
incq %r14
jmp 0xac4f2
incq %r13
jmp 0xac4d2
movq %rbx, %rdi
callq 0x694eb
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x69638
// File: /workspace/github_cpp_makefile_star2_O2/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), %rax
movl 0x14(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edx, %edx
cmpq %rcx, %rdx
je 0xac590
movq 0x20(%rax), %r8
cmpb $0x2, 0x4(%r8,%rdx,8)
jne 0xac58b
movq 0x10(%rdi), %r9
imulq $0x28, %rdx, %r10
leaq (%r9,%r10), %r8
movl 0x10(%r9,%r10), %r9d
xorl %r10d, %r10d
cmpq %r10, %r9
je 0xac58b
movq 0x18(%r8), %r11
movq (%r11,%r10,8), %r11
movq 0x20(%rsi), %rbx
shrq $0x21, %r11
movb $0x2, 0x4(%rbx,%r11,8)
incq %r10
jmp 0xac56b
incq %rdx
jmp 0xac546
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
movq (%rsi), %rax
movq 0x38(%rax), %rcx
movl 0x8(%rsi), %r8d
movl %r8d, %r8d
cmpq %r8, %rcx
jbe 0xac772
movq 0x48(%rax), %r9
movl (%r9,%r8,4), %r9d
shrl %r9d
movq 0x10(%rdi), %r10
imulq $0x28, %r9, %r11
leaq (%r10,%r11), %r9
movl 0x10(%r10,%r11), %r11d
movl 0xc(%rsi), %r10d
cmpl %r11d, %r10d
jae 0xac757
movl 0x10(%rsi), %ebx
cmpl %edx, %ebx
je 0xac764
incq %r10
movl %r10d, 0xc(%rsi)
incl %ebx
movl %ebx, 0x10(%rsi)
jmp 0xac73d
andl $0x0, 0xc(%rsi)
incl %r8d
movl %r8d, 0x8(%rsi)
jmp 0xac715
movq 0x18(%r9), %rax
movq (%rax,%r10,8), %rax
shrq $0x21, %rax
popq %rbx
retq
andl $0x0, 0x10(%rsi)
xorl %r8d, %r8d
xorl %r9d, %r9d
movl %r9d, 0x8(%rsi)
movl %r9d, %r9d
cmpq %r9, %rcx
jbe 0xac7d2
movq 0x48(%rax), %r10
movl (%r10,%r9,4), %r10d
shrl %r10d
movq 0x10(%rdi), %r11
andl $0x0, 0xc(%rsi)
imulq $0x28, %r10, %rbx
leaq (%r11,%rbx), %r10
movl 0x10(%r11,%rbx), %r11d
xorl %ebx, %ebx
cmpl %ebx, %r11d
je 0xac7c3
cmpl %r8d, %edx
je 0xac7c8
incq %rbx
movl %ebx, 0xc(%rsi)
incl %r8d
movl %r8d, 0x10(%rsi)
jmp 0xac7aa
incl %r9d
jmp 0xac77c
movq 0x18(%r10), %rax
movq (%rax,%rbx,8), %rax
jmp 0xac76c
andl $0x0, 0x10(%rsi)
andq $0x0, 0x8(%rsi)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xac770
// File: /workspace/github_cpp_makefile_star2_O2/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), %rcx
movq 0x38(%rcx), %r8
movl 0x8(%rsi), %eax
movl %eax, %eax
cmpq %rax, %r8
jbe 0xac84d
movq 0x48(%rcx), %r9
movl (%r9,%rax,4), %r9d
shrl %r9d
movq 0x10(%rdi), %r10
imulq $0x28, %r9, %r11
leaq (%r10,%r11), %r9
movl 0x10(%r10,%r11), %r10d
movl 0xc(%rsi), %r11d
cmpq %r10, %r11
jae 0xac839
movq 0x18(%r9), %rbx
movq (%rbx,%r11,8), %rbx
shrq $0x21, %rbx
cmpl %edx, %ebx
je 0xac844
incq %r11
movl %r11d, 0xc(%rsi)
incl 0x10(%rsi)
jmp 0xac818
andl $0x0, 0xc(%rsi)
incl %eax
movl %eax, 0x8(%rsi)
jmp 0xac7f1
movl 0x10(%rsi), %eax
popq %rbx
popq %r14
popq %r15
retq
andl $0x0, 0x10(%rsi)
xorl %eax, %eax
movabsq $0x1, %r9
xorl %r10d, %r10d
movl %r10d, 0x8(%rsi)
movl %r10d, %r10d
cmpq %r10, %r8
jbe 0xac8c1
movq 0x48(%rcx), %r11
movl (%r11,%r10,4), %r11d
shrl %r11d
movq 0x10(%rdi), %rbx
imulq $0x28, %r11, %r14
andl $0x0, 0xc(%rsi)
leaq (%rbx,%r14), %r11
movl 0x10(%rbx,%r14), %ebx
negq %rbx
movq %r9, %r14
leaq (%rbx,%r14), %r15
cmpq $0x1, %r15
je 0xac8bc
movq 0x18(%r11), %r15
movq -0x8(%r15,%r14,8), %r15
shrq $0x21, %r15
cmpl %edx, %r15d
je 0xac847
movl %r14d, 0xc(%rsi)
incl %eax
movl %eax, 0x10(%rsi)
incq %r14
jmp 0xac892
incl %r10d
jmp 0xac860
andl $0x0, 0x10(%rsi)
andq $0x0, 0x8(%rsi)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xac847
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %eax
imulq $0x18, %rax, %rax
leaq (%rsi,%rax), %rcx
movl 0xc(%rsi,%rax), %eax
imulq $0x28, %rax, %rsi
xorl %r10d, %r10d
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
xorl %ebx, %ebx
cmpq %r10, %rsi
je 0xac982
movq (%rcx), %rax
movl 0xc(%rax,%r10), %eax
movq 0x20(%rdi), %r15
cmpl $0x0, (%r15,%rax,8)
movq (%rdx), %r14
js 0xac944
movb $0x1, %bpl
cmpq %rax, %r14
jbe 0xac95f
movq 0x8(%rdx), %r14
movl (%r14,%rax,4), %r15d
movl %r11d, %r14d
cmpl $-0x1, %r15d
je 0xac962
movl %r15d, %r14d
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
shrl $0x1f, %r15d
movl %r15d, %ebp
jmp 0xac962
cmpq %rax, %r14
jbe 0xac979
movq 0x8(%rdx), %r12
movslq (%r12,%rax,4), %rax
testq %rax, %rax
js 0xac979
cmpl $0x0, (%r15,%rax,8)
jns 0xac918
jmp 0xac979
movl %r11d, %r14d
cmpl %r8d, %r14d
setne %r14b
xorb $0x1, %bpl
orb %r14b, %bpl
jne 0xac979
cmpl %r9d, %ebx
je 0xac985
incl %ebx
addq $0x28, %r10
jmp 0xac8f9
movl %r11d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_contig_overlap_interval(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int*, unsigned int*, unsigned int*, unsigned int*)
uint32_t get_contig_overlap_interval(uint32_t is_reverse, 
uint32_t q_beg, uint32_t q_end, uint32_t qLen, uint32_t t_beg, uint32_t t_end, uint32_t tLen, 
uint32_t* r_q_beg, uint32_t* r_q_end, uint32_t* r_t_beg, uint32_t* r_t_end)
{
    uint32_t k;
    (*r_q_beg) = (*r_q_end) = (*r_t_beg) = (*r_t_end) = (uint32_t)-1;
    if(q_end >= qLen || t_end >= tLen) return 0;
    if(q_beg >= qLen || t_beg >= tLen) return 0;

    if(is_reverse)
    {
        ///k = q_beg; q_beg = q_end; q_end = k;
        ///q_beg = qLen - q_beg - 1; q_end = qLen - q_end - 1; k = q_beg; q_beg = q_end; q_end = k;
        ///k = t_beg; t_beg = t_end; t_end = k;
        t_beg = tLen - t_beg - 1; t_end = tLen - t_end - 1; k = t_beg; t_beg = t_end; t_end = k;
    }




    if(q_beg <= t_beg)
    {
        t_beg = t_beg - q_beg; q_beg = 0;
    }
    else
    {
        q_beg = q_beg - t_beg; t_beg = 0;
    }

    uint32_t q_right_length = qLen - q_end - 1;
    uint32_t t_right_length = tLen - t_end - 1;
    if(q_right_length <= t_right_length)
    {
        q_end = qLen - 1; t_end = t_end + q_right_length;
    }
    else
    {
        t_end = tLen - 1; q_end = q_end + t_right_length;
    }

    if(is_reverse)
    {
        ///q_beg = qLen - q_beg - 1; q_end = qLen - q_end - 1; k = q_beg; q_beg = q_end; q_end = k;
        t_beg = tLen - t_beg - 1; t_end = tLen - t_end - 1; k = t_beg; t_beg = t_end; t_end = k;
    }

    (*r_q_beg) = q_beg; (*r_q_end) = q_end;
    (*r_t_beg) = t_beg; (*r_t_end) = t_end;
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x58(%rsp), %r10
orl $-0x1, (%r10)
movq 0x50(%rsp), %r11
orl $-0x1, (%r11)
movq 0x48(%rsp), %rbx
orl $-0x1, (%rbx)
movq 0x40(%rsp), %r14
orl $-0x1, (%r14)
movl 0x38(%rsp), %r15d
cmpl %ecx, %edx
setae %bpl
cmpl %r15d, %r9d
setae %r12b
xorl %eax, %eax
orb %bpl, %r12b
jne 0xaca69
cmpl %ecx, %esi
setae %bpl
cmpl %r15d, %r8d
setae %r12b
orb %bpl, %r12b
jne 0xaca69
movl %r8d, %ebp
notl %ebp
addl %r15d, %ebp
movl %r9d, %eax
notl %eax
addl %r15d, %eax
testl %edi, %edi
cmovel %r9d, %ebp
cmovel %r8d, %eax
xorl %r9d, %r9d
movl %eax, %r8d
subl %esi, %r8d
cmovbl %r9d, %r8d
movl %edx, %r12d
notl %r12d
addl %ecx, %r12d
movl %ebp, %r13d
notl %r13d
addl %r15d, %r13d
decl %ecx
addl %r12d, %ebp
addl %r13d, %edx
cmpl %r13d, %r12d
leal -0x1(%r15), %r12d
cmovbel %ebp, %r12d
cmovbel %ecx, %edx
movl %r12d, %ecx
notl %ecx
addl %r15d, %ecx
testl %edi, %edi
cmovel %r8d, %ecx
notl %r8d
addl %r15d, %r8d
testl %edi, %edi
cmovel %r12d, %r8d
subl %eax, %esi
cmovbl %r9d, %esi
movl %esi, (%r14)
movl %edx, (%rbx)
movl %ecx, (%r11)
movl %r8d, (%r10)
movl $0x1, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x694eb
movq %rbx, %rdi
callq 0x69518
movl $0x80000000, %ecx       # imm = 0x80000000
orl 0x14(%rbx), %ecx
movl %ecx, 0x14(%rbx)
xorl %eax, %eax
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpq %rcx, %rax
jae 0xaced8
movq 0x28(%rbx), %rcx
movq (%rcx,%rax,8), %rdx
movl %edx, %ecx
shrq $0x20, %rdx
imulq $0x18, %rdx, %rdx
addq 0x8(%rbx), %rdx
xorl %esi, %esi
cmpq %rcx, %rsi
je 0xacecd
imulq $0x18, %rsi, %rdi
movl 0x8(%rdx,%rdi), %r8d
cmpq %r8, %rax
jne 0xace8c
addq %rdx, %rdi
orb $-0x80, 0xf(%rdi)
incq %rsi
jmp 0xace6d
movq 0x8(%rbx), %r10
movq 0x28(%rbx), %r9
movq (%r9,%r8,8), %r8
movq %r8, %r11
shrq $0x20, %r11
movl %r8d, %r9d
imulq $0x18, %r11, %r11
addq %r10, %r11
addq $0x8, %r11
xorl %r10d, %r10d
cmpq %r10, %r9
je 0xace80
movl (%r11), %r14d
cmpq %r14, %rax
je 0xacec6
incq %r10
addq $0x18, %r11
jmp 0xaceb0
cmpl %r10d, %r8d
je 0xace80
jmp 0xace87
incq %rax
movl 0x14(%rbx), %ecx
jmp 0xace46
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x694eb
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x14(%rdi), %r13d
addl %r13d, %r13d
xorl %r12d, %r12d
cmpq %r13, %r12
je 0xae2e3
movq 0x20(%rbx), %rax
movl %r12d, %edx
shrl %edx
movl %r12d, %ecx
leaq 0x1a5ff2(%rip), %rdi    # 0x254230
movq 0x40(%rdi), %rsi
movl 0x8(%rsi,%rdx,8), %r8d
movq (%rsi,%rdx,8), %r9
subl %r9d, %r8d
addq 0x8(%rdi), %r9
andl $0x1, %ecx
cmpl $0x0, (%rax,%rdx,8)
movq 0x1a4d80(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
js 0xae2cd
leaq 0x13c0b4(%rip), %rsi    # 0x1ea320
xorl %eax, %eax
callq 0x22b0
movq 0x8(%rbx), %rax
movq 0x28(%rbx), %rcx
movq (%rcx,%r12,8), %rcx
movl %ecx, %edx
shrq $0x20, %rcx
imulq $0x18, %rdx, %r15
imulq $0x18, %rcx, %rcx
leaq (%rax,%rcx), %r14
addq $0xc, %r14
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0xae2db
cmpl $0x0, (%r14,%rbp)
jns 0xae2a9
addq $0x18, %rbp
jmp 0xae297
movq 0x1a4d30(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
movl -0x8(%r14,%rbp), %ecx
movl -0x4(%r14,%rbp), %edx
leaq 0x13c079(%rip), %rsi    # 0x1ea33d
xorl %eax, %eax
callq 0x22b0
jmp 0xae2a3
leaq 0x13c02f(%rip), %rsi    # 0x1ea303
xorl %eax, %eax
callq 0x22b0
incq %r12
jmp 0xae222
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq