LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0xe9b03
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 0xe9aee
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 0xe9b88
movl %ebx, 0xc(%rsi)
movl %r12d, 0x10(%rsi)
incl %r12d
incq %r13
leal (%r14,%rbx), %ebp
incl %ebp
incl %ebx
cmpl $0x1, %ebp
jne 0xe9ac7
movl $0x0, 0xc(%rsi)
incl %r8d
movl %r8d, 0x8(%rsi)
xorl %ebx, %ebx
cmpq %r8, %rax
ja 0xe9a9f
xorl %r8d, %r8d
movl %r8d, 0x10(%rsi)
movl %r8d, 0x8(%rsi)
testq %rax, %rax
je 0xe9b72
movq 0x48(%rcx), %rcx
movq 0x10(%rdi), %rdi
movl (%rcx,%r8,4), %r9d
shrl %r9d
leaq (%r9,%r9,4), %r10
movl $0x0, 0xc(%rsi)
movl 0x10(%rdi,%r10,8), %r9d
testq %r9, %r9
je 0xe9b66
leaq (%rdi,%r10,8), %r10
movl 0x10(%rsi), %r11d
movl %edx, %ebx
subl %r11d, %ebx
incl %r11d
xorl %r14d, %r14d
cmpl %r14d, %ebx
je 0xe9b92
leaq 0x1(%r14), %r15
movl %r15d, 0xc(%rsi)
addl %r11d, %r14d
movl %r14d, 0x10(%rsi)
movq %r15, %r14
cmpl %r15d, %r9d
jne 0xe9b4a
incl %r8d
movl %r8d, 0x8(%rsi)
cmpq %r8, %rax
ja 0xe9b1b
movl $0x0, 0x10(%rsi)
movq $0x0, 0x8(%rsi)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xe9b9e
movq 0x18(%r15), %rax
movq (%rax,%r13,8), %rax
jmp 0xe9b9a
movq 0x18(%r10), %rax
movq (%rax,%r14,8), %rax
shrq $0x21, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
movq (%rsi), %rcx
movq 0x38(%rcx), %rax
movl 0x8(%rsi), %r8d
cmpq %r8, %rax
jbe 0xe9c32
movq 0x48(%rcx), %r9
movq 0x10(%rdi), %r10
movl 0xc(%rsi), %r11d
movl (%r9,%r8,4), %ebx
shrl %ebx
leaq (%rbx,%rbx,4), %r14
movl 0x10(%r10,%r14,8), %ebx
cmpl %ebx, %r11d
jae 0xe9c1c
leaq (%r10,%r14,8), %r15
movl %r11d, %r14d
shlq $0x3, %r14
addq 0x18(%r15), %r14
negl %ebx
incl %r11d
movq (%r14), %r15
shrq $0x21, %r15
cmpl %edx, %r15d
je 0xe9cae
movl %r11d, 0xc(%rsi)
incl 0x10(%rsi)
addq $0x8, %r14
leal (%rbx,%r11), %ebp
incl %ebp
incl %r11d
cmpl $0x1, %ebp
jne 0xe9bf3
movl $0x0, 0xc(%rsi)
incl %r8d
movl %r8d, 0x8(%rsi)
xorl %r11d, %r11d
cmpq %r8, %rax
ja 0xe9bcb
xorl %r8d, %r8d
movl %r8d, 0x10(%rsi)
movl %r8d, 0x8(%rsi)
testq %rax, %rax
je 0xe9c98
movq 0x48(%rcx), %rcx
movq 0x10(%rdi), %rdi
movl (%rcx,%r8,4), %r9d
shrl %r9d
leaq (%r9,%r9,4), %r10
movl $0x0, 0xc(%rsi)
movl 0x10(%rdi,%r10,8), %r9d
testq %r9, %r9
je 0xe9c8c
leaq (%rdi,%r10,8), %r10
movq 0x18(%r10), %r10
xorl %r11d, %r11d
movq (%r10,%r11,8), %rbx
shrq $0x21, %rbx
cmpl %edx, %ebx
je 0xe9cae
incq %r11
movl %r11d, 0xc(%rsi)
incl 0x10(%rsi)
cmpl %r11d, %r9d
jne 0xe9c71
incl %r8d
movl %r8d, 0x8(%rsi)
cmpq %r8, %rax
ja 0xe9c4a
movl $0x0, 0x10(%rsi)
movq $0x0, 0x8(%rsi)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xe9cb1
movl 0x10(%rsi), %eax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xe9d8f
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
leaq (%rsi,%rcx,8), %rcx
movq (%rcx), %rcx
movq 0x20(%rdi), %rsi
shlq $0x3, %rax
leaq (%rax,%rax,4), %rdi
xorl %r10d, %r10d
xorl %r11d, %r11d
movl 0xc(%rcx,%r10), %ebx
cmpl $0x0, (%rsi,%rbx,8)
movl %ebx, %eax
js 0xe9d3d
movl %eax, %r14d
movb $0x1, %bl
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq %r14, (%rdx)
jbe 0xe9d24
movq 0x8(%rdx), %r15
movl (%r15,%r14,4), %r14d
cmpl $-0x1, %r14d
je 0xe9d24
movl %r14d, %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
shrl $0x1f, %r14d
movl %r14d, %ebx
cmpl %r8d, %ebp
setne %bpl
xorb $0x1, %bl
orb %bpl, %bl
jne 0xe9d76
cmpl %r9d, %r11d
je 0xe9d88
incl %r11d
jmp 0xe9d76
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rbx, (%rdx)
jbe 0xe9d60
movq 0x8(%rdx), %r14
movl (%r14,%rbx,4), %ebx
cmpl $-0x1, %ebx
je 0xe9d60
movl %ebx, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shrl $0x1f, %ebx
jmp 0xe9d62
xorl %ebx, %ebx
cmpl $-0x1, %eax
sete %bpl
orb %bl, %bpl
jne 0xe9d76
movl %eax, %ebx
cmpl $0x0, (%rsi,%rbx,8)
jns 0xe9cf7
addq $0x28, %r10
cmpq %r10, %rdi
jne 0xe9cea
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_O1/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
movq 0x50(%rsp), %r11
movq 0x48(%rsp), %rbx
movq 0x40(%rsp), %r14
movl 0x38(%rsp), %r15d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, (%r10)
movl %eax, (%r11)
movl %eax, (%rbx)
movl %eax, (%r14)
cmpl %ecx, %edx
setae %bpl
cmpl %r15d, %r9d
setae %r12b
xorl %eax, %eax
orb %bpl, %r12b
jne 0xe9e71
cmpl %ecx, %esi
setae %bpl
cmpl %r15d, %r8d
setae %r12b
orb %bpl, %r12b
jne 0xe9e71
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_O1/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 %rbx
movq %rdi, %rbx
callq 0xa02fa
movq %rbx, %rdi
callq 0xa0333
movl 0x14(%rbx), %eax
movl %eax, %ecx
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0x14(%rbx)
testl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
je 0xea3ee
xorl %eax, %eax
movq 0x28(%rbx), %rcx
movq (%rcx,%rax,8), %rdx
testl %edx, %edx
je 0xea3d9
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 0xea3c9
movq 0x28(%rbx), %r9
movq (%r9,%r8,8), %r8
testl %r8d, %r8d
je 0xea3c1
movq 0x8(%rbx), %r9
movq %r8, %r10
shrq $0x20, %r10
leaq (%r10,%r10,2), %r10
leaq (%r9,%r10,8), %r10
addq $0x8, %r10
xorl %r9d, %r9d
movl (%r10), %r11d
cmpq %r11, %rax
je 0xea3c4
incl %r9d
addq $0x18, %r10
cmpl %r9d, %r8d
jne 0xea3a8
movl %r8d, %r9d
jmp 0xea3c4
xorl %r9d, %r9d
cmpl %r8d, %r9d
jne 0xea3d1
leaq (%rcx,%rdi,8), %rdi
orb $-0x80, 0xf(%rdi)
incq %rsi
cmpq %rdx, %rsi
jne 0xea373
incq %rax
movl 0x14(%rbx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpq %rcx, %rax
jb 0xea350
movq %rbx, %rdi
popq %rbx
jmp 0xa02fa
// File: /workspace/github_cpp_makefile_star2_O1/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 0xebb97
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %eax, %r13d
leaq 0x19f744(%rip), %rbp    # 0x28b230
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 0x19e4c3(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
js 0xebb6f
leaq 0x140707(%rip), %rsi    # 0x22c230
xorl %eax, %eax
callq 0x22b0
movq 0x28(%rbx), %rax
movq (%rax,%r15,8), %rax
testl %eax, %eax
je 0xebb7d
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 0xebb65
addq $0x18, %r12
decq %r14
jne 0xebb52
jmp 0xebb7d
movq %r12, %rdi
callq 0x1169a
jmp 0xebb5a
leaq 0x14069d(%rip), %rsi    # 0x22c213
xorl %eax, %eax
callq 0x22b0
incq %r15
cmpq %r13, %r15
jne 0xebaef
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xebc5e
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 0x19e3f5(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
js 0xebc41
leaq 0x14069d(%rip), %rsi    # 0x22c294
movl %r13d, %edx
xorl %eax, %eax
callq 0x22b0
movq 0x28(%r14), %rax
movq (%rax,%r13,8), %rax
testl %eax, %eax
je 0xebc52
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 0xebc34
addq $0x18, %rbp
decq %r12
jne 0xebc23
jmp 0xebc52
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x116bb
jmp 0xebc29
leaq 0x140620(%rip), %rsi    # 0x22c268
movl %r13d, %edx
xorl %eax, %eax
callq 0x22b0
incq %r13
cmpq %r15, %r13
jne 0xebbbd
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xec2a8
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 0xec291
jmp 0xec2aa
xorl %ecx, %ecx
cmpl %edx, %esi
je 0xec2b8
subl %edx, %esi
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
testq %rcx, %rcx
je 0xec2fd
xorl %ebx, %ebx
movl (%rdx,%rbx,8), %r14d
movq 0x20(%rdi), %r15
andl $0x7fffffff, (%r15,%r14,8) # imm = 0x7FFFFFFF
movb 0x4(%rdx,%rbx,8), %bpl
movq 0x20(%rdi), %r15
movb %bpl, 0x4(%r15,%r14,8)
incq %rbx
movl %ebx, %r14d
cmpq %rcx, %r14
jb 0xec2d4
movq 0x20(%rdi), %rcx
shrl %r8d
movb %r11b, 0x4(%rcx,%r8,8)
andb $0x7f, 0x3(%rcx,%r8,8)
movq 0x20(%rdi), %rcx
shrl %r9d
movb %r10b, 0x4(%rcx,%r9,8)
andb $0x7f, 0x3(%rcx,%r9,8)
testl %eax, %eax
je 0xec353
cmpq $0x0, (%rsi)
je 0xec353
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 0xec332
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: copy_ug_node(ma_ug_t*, asg_t*, unsigned int)
uint32_t copy_ug_node(ma_ug_t *ug, asg_t* nsg, uint32_t v)
{
    ma_utg_t *p;
    ma_utg_t *o = &(ug->u.a[v]);
    uint32_t n_node = nsg->n_seq;
    asg_seq_set(nsg, n_node, nsg->seq[v].len, 0);
    kv_pushp(ma_utg_t, ug->u, &p);

    p->s = 0, p->start = o->start, p->end = o->end, p->len = o->len;
    p->n = o->n, p->circ = o->circ, p->m = o->m;
    p->a = (uint64_t*)malloc(8 * p->m);
    memcpy(p->a, o->a, (8*p->m));

    return n_node;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rcx
movq %rdi, %r14
movq 0x10(%rdi), %r15
movl %edx, %r12d
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movl 0x14(%rsi), %esi
andl %ebp, %esi
movq 0x20(%rcx), %rax
movl (%rax,%r12,8), %edx
andl %ebp, %edx
movq %rcx, %rdi
movl %esi, 0x4(%rsp)
xorl %ecx, %ecx
callq 0xa0115
movq 0x8(%r14), %rax
cmpq %rax, (%r14)
jne 0xee1a0
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmovneq %rcx, %rax
movq %rax, 0x8(%r14)
movq 0x10(%r14), %rdi
shlq $0x3, %rax
leaq (%rax,%rax,4), %rsi
callq 0x2370
movq %rax, 0x10(%r14)
leaq (%r12,%r12,4), %r12
movq (%r14), %rax
movq 0x10(%r14), %r13
leaq 0x1(%rax), %rcx
movq %rcx, (%r14)
leaq (%rax,%rax,4), %rbx
movq $0x0, 0x20(%r13,%rbx,8)
movl 0x4(%r15,%r12,8), %eax
movl %eax, 0x4(%r13,%rbx,8)
movl 0x8(%r15,%r12,8), %eax
movl %eax, 0x8(%r13,%rbx,8)
andl (%r15,%r12,8), %ebp
movl $0x80000000, %eax       # imm = 0x80000000
movl (%r13,%rbx,8), %ecx
andl %eax, %ecx
orl %ebp, %ecx
movl %ecx, (%r13,%rbx,8)
movl 0x10(%r15,%r12,8), %ecx
movl %ecx, 0x10(%r13,%rbx,8)
andl (%r15,%r12,8), %eax
orl %ebp, %eax
movl %eax, (%r13,%rbx,8)
movl 0xc(%r15,%r12,8), %r14d
movl %r14d, 0xc(%r13,%rbx,8)
shll $0x3, %r14d
movq %r14, %rdi
callq 0x2280
movq %rax, 0x18(%r13,%rbx,8)
movq 0x18(%r15,%r12,8), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x2160
movl 0x4(%rsp), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: collect_ma_utg_ts(ma_ug_t*, unsigned int, unsigned int, ma_utg_t*)
uint32_t collect_ma_utg_ts(ma_ug_t *ug, uint32_t v, uint32_t w, ma_utg_t* result)
{
    uint32_t des_dir = w&1;
    long long i;
    uint64_t* aim = NULL;
    ma_utg_t *ma_w = &(ug->u.a[w>>1]);

    if(v == (uint32_t)-1)
    {
        result->start = ma_w->start;
        result->circ = ma_w->circ;
        result->end = ma_w->end;
        result->len = ma_w->len;
        result->n = 0;
    }

    
    if(result->m < (result->n + ma_w->n))
    {
        result->m = (result->n + ma_w->n);
        result->a = (uint64_t*)realloc(result->a, result->m * sizeof(uint64_t));
    }

    aim = result->a + result->n;

    if(des_dir == 1)
    {
        for (i = 0; i < (long long)ma_w->n; i++)
        {
            aim[ma_w->n - i - 1] = (ma_w->a[i])^(uint64_t)(0x100000000);
        }
    }
    else
    {
        for (i = 0; i < (long long)ma_w->n; i++)
        {
            aim[i] = ma_w->a[i];
        }
    }

    result->n = result->n + ma_w->n;
    return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rcx, %rbx
movl %edx, %ebp
movl %edx, %eax
shrl %eax
leaq (%rax,%rax,4), %r14
shlq $0x3, %r14
addq 0x10(%rdi), %r14
cmpl $-0x1, %esi
jne 0xee28c
movl 0x4(%r14), %eax
movl %eax, 0x4(%rbx)
movl $0x80000000, %eax       # imm = 0x80000000
andl (%r14), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl (%rbx), %edx
andl %ecx, %edx
orl %eax, %edx
movl %edx, (%rbx)
movl 0x8(%r14), %edx
movl %edx, 0x8(%rbx)
andl (%r14), %ecx
orl %eax, %ecx
movl %ecx, (%rbx)
movl $0x0, 0x10(%rbx)
movl 0x10(%r14), %eax
addl 0x10(%rbx), %eax
cmpl %eax, 0xc(%rbx)
jae 0xee2ae
movl %eax, 0xc(%rbx)
movq 0x18(%rbx), %rdi
movl %eax, %esi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x18(%rbx)
movq 0x18(%rbx), %rdx
movl 0x10(%rbx), %eax
movl 0x10(%r14), %ecx
testb $0x1, %bpl
jne 0xee2e0
testq %rcx, %rcx
je 0xee30e
leaq (%rdx,%rax,8), %rdx
movq 0x18(%r14), %rsi
xorl %edi, %edi
movq (%rsi,%rdi,8), %r8
movq %r8, (%rdx,%rdi,8)
incq %rdi
cmpq %rdi, %rcx
jne 0xee2ce
jmp 0xee30e
testq %rcx, %rcx
je 0xee30e
movq 0x18(%r14), %rsi
leaq (%rdx,%rax,8), %rdx
addq $-0x8, %rdx
movabsq $0x100000000, %rdi      # imm = 0x100000000
movq (%rsi), %r8
xorq %rdi, %r8
movq %r8, (%rdx,%rcx,8)
addq $0x8, %rsi
decq %rcx
jne 0xee2fb
addl 0x10(%r14), %eax
movl %eax, 0x10(%rbx)
movl $0x1, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: init_Edge_iter(asg_t*, unsigned int, asg_arc_t*, unsigned int, Edge_iter*)
void init_Edge_iter(asg_t* g, uint32_t v, asg_arc_t* new_edges, uint32_t new_edges_n, Edge_iter* x)
{
	x->av_i = x->new_edges_i = 0;
	x->g = g;
	x->av = asg_arc_a(g, v);
    x->nv = asg_arc_n(g, v);

	if(new_edges == NULL || new_edges_n == 0)
	{
		x->new_edges = NULL;
		x->new_edges_n = 0;
	}
	else
	{
		x->new_edges = new_edges;
		x->new_edges_n = new_edges_n;
	}
}

// Assembly:
xorl %eax, %eax
movl %eax, 0x24(%r8)
movl %eax, 0x14(%r8)
movq %rdi, (%r8)
movq 0x28(%rdi), %r9
movl %esi, %esi
movq (%r9,%rsi,8), %rsi
movq %rsi, %r9
shrq $0x20, %r9
leaq (%r9,%r9,2), %r9
shlq $0x3, %r9
addq 0x8(%rdi), %r9
movq %r9, 0x8(%r8)
movl %esi, 0x10(%r8)
testl %ecx, %ecx
movl $0x0, %esi
cmovneq %rdx, %rsi
testq %rdx, %rdx
cmovel %eax, %ecx
movq %rsi, 0x18(%r8)
movl %ecx, 0x20(%r8)
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_arc_t(Edge_iter*, asg_arc_t*)
int get_arc_t(Edge_iter* x, asg_arc_t* get)
{
    for (; x->av_i < x->nv; x->av_i++)
    {
        if(x->av[x->av_i].del) continue;
        get = &(x->av[x->av_i]);
        x->av_i++;
        return 1;
    }


    for (; x->new_edges_i < x->new_edges_n; x->new_edges_i++)
    {
        if(x->new_edges[x->new_edges_i].del) continue;
        get = &(x->new_edges[x->new_edges_i]);
        x->new_edges_i++;
        return 1;
    }

    return 0;
}

// Assembly:
movl 0x10(%rdi), %eax
movl 0x14(%rdi), %ecx
cmpl %eax, %ecx
jae 0xef54b
movq 0x8(%rdi), %rdx
movl %ecx, %esi
leaq (%rsi,%rsi,2), %rsi
incl %ecx
cmpl $0x0, 0xc(%rdx,%rsi,8)
movl %ecx, 0x14(%rdi)
jns 0xef574
cmpl %ecx, %eax
jne 0xef535
movl 0x20(%rdi), %ecx
movl 0x24(%rdi), %edx
xorl %eax, %eax
cmpl %ecx, %edx
jae 0xef573
movq 0x18(%rdi), %rsi
movl %edx, %r8d
leaq (%r8,%r8,2), %r8
incl %edx
cmpl $0x0, 0xc(%rsi,%r8,8)
movl %edx, 0x24(%rdi)
jns 0xef574
cmpl %edx, %ecx
jne 0xef55b
retq
movl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: load_coverage_cut(ma_sub_t**, char*)
int load_coverage_cut(ma_sub_t** coverage_cut, char* read_file_name)
{
    char* index_name = (char*)malloc(strlen(read_file_name)+15);
    sprintf(index_name, "%s.bin", read_file_name);
    FILE* fp = fopen(index_name, "r");
    if(!fp)
    {
        return 0;
    }
    int f_flag = 0;
    uint64_t n_read;
    f_flag += fread(&n_read, sizeof(n_read), 1, fp);
    (*coverage_cut) = (ma_sub_t*)malloc(sizeof(ma_sub_t)*n_read);

    // uint64_t i = 0, tmp;
    // for (i = 0; i < n_read; i++)
    // {
    //     f_flag += fread(&tmp, sizeof(tmp), 1, fp);
    //     (*coverage_cut)[i].c = tmp;
    //     f_flag += fread(&tmp, sizeof(tmp), 1, fp);
    //     (*coverage_cut)[i].del = tmp;
    //     f_flag += fread(&tmp, sizeof(tmp), 1, fp);
    //     (*coverage_cut)[i].e = tmp;
    //     f_flag += fread(&tmp, sizeof(tmp), 1, fp);
    //     (*coverage_cut)[i].s = tmp;
    // }
    fread((*coverage_cut), sizeof((*((*coverage_cut)))), n_read, fp);

    free(index_name);    
    fflush(fp);
    fclose(fp);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2090
leaq 0xf(%rax), %rdi
callq 0x2280
movq %rax, %r14
leaq 0x134037(%rip), %rsi    # 0x22463b
xorl %ebp, %ebp
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x142f8d(%rip), %rsi    # 0x2335a7
movq %r14, %rdi
callq 0x2210
testq %rax, %rax
je 0xf068c
movq %rax, %r15
leaq 0x8(%rsp), %r12
movl $0x8, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rax, %rcx
callq 0x22f0
movq (%r12), %r12
leaq (,%r12,4), %rax
leaq (%rax,%rax,2), %rdi
callq 0x2280
movq %rax, (%rbx)
movl $0xc, %esi
movq %rax, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x22f0
movq %r14, %rdi
callq 0x2220
movq %r15, %rdi
callq 0x2200
movq %r15, %rdi
callq 0x2190
movl $0x1, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: write_coverage_cut(ma_sub_t*, char*, unsigned long)
int write_coverage_cut(ma_sub_t* coverage_cut, char* read_file_name, uint64_t n_read)
{
    char* index_name = (char*)malloc(strlen(read_file_name)+15);
    sprintf(index_name, "%s.bin", read_file_name);
    FILE* fp = fopen(index_name, "w");
    fwrite(&n_read, sizeof(n_read), 1, fp);
    // uint64_t i = 0, tmp;
    // for (i = 0; i < n_read; i++)
    // {
    //     tmp = coverage_cut[i].c;
    //     fwrite(&tmp, sizeof(tmp), 1, fp);
    //     tmp = coverage_cut[i].del;
    //     fwrite(&tmp, sizeof(tmp), 1, fp);
    //     tmp = coverage_cut[i].e;
    //     fwrite(&tmp, sizeof(tmp), 1, fp);
    //     tmp = coverage_cut[i].s;
    //     fwrite(&tmp, sizeof(tmp), 1, fp);
    // }
    fwrite(coverage_cut, sizeof((*(coverage_cut))), n_read, fp);
    free(index_name);    
    fflush(fp);
    fclose(fp);

    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %rbx
movq %rsp, %r14
movq %rdx, (%r14)
movq %rsi, %rdi
callq 0x2090
leaq 0xf(%rax), %rdi
callq 0x2280
movq %rax, %r15
leaq 0x133f71(%rip), %rsi    # 0x22463b
movq %rax, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x14bd20(%rip), %rsi    # 0x23c3fe
movq %r15, %rdi
callq 0x2210
movq %rax, %r12
movl $0x8, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rax, %rcx
callq 0x2410
movq (%r14), %rdx
movl $0xc, %esi
movq %rbx, %rdi
movq %r12, %rcx
callq 0x2410
movq %r15, %rdi
callq 0x2220
movq %r12, %rdi
callq 0x2200
movq %r12, %rdi
callq 0x2190
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: write_ruIndex(R_to_U*, char*)
int write_ruIndex(R_to_U* ruIndex, char* read_file_name)
{
    char* index_name = (char*)malloc(strlen(read_file_name)+15);
    sprintf(index_name, "%s.bin", read_file_name);
    FILE* fp = fopen(index_name, "w");
    fwrite(&ruIndex->len, sizeof(ruIndex->len), 1, fp);
    fwrite(ruIndex->index, sizeof(ruIndex->index[0]), ruIndex->len, fp);
    fwrite(R_INF.trio_flag, sizeof(R_INF.trio_flag[0]), ruIndex->len, fp);
    // fwrite(ruIndex->is_het, 1, ruIndex->len, fp);
    fwrite(&(asm_opt.hom_global_coverage_set), sizeof(asm_opt.hom_global_coverage_set), 1, fp);
    fwrite(&(asm_opt.hom_global_coverage), sizeof(asm_opt.hom_global_coverage), 1, fp);
    free(index_name);    
    fflush(fp);
    fclose(fp);

    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x2090
leaq 0xf(%rax), %rdi
callq 0x2280
movq %rax, %rbx
leaq 0x133edb(%rip), %rsi    # 0x22463b
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x14bc8a(%rip), %rsi    # 0x23c3fe
movq %rbx, %rdi
callq 0x2210
movq %rax, %r14
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rax, %rcx
callq 0x2410
movq (%r15), %rdx
movq 0x8(%r15), %rdi
movl $0x4, %esi
movq %r14, %rcx
callq 0x2410
leaq 0x19aa81(%rip), %rax    # 0x28b230
movq 0x28(%rax), %rdi
movq (%r15), %rdx
movl $0x1, %esi
movq %r14, %rcx
callq 0x2410
leaq 0x199f8e(%rip), %r15    # 0x28a758
leaq 0x148(%r15), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x2410
addq $0x144, %r15            # imm = 0x144
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rcx
callq 0x2410
movq %rbx, %rdi
callq 0x2220
movq %r14, %rdi
callq 0x2200
movq %r14, %rdi
callq 0x2190
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: load_ruIndex(R_to_U*, char*)
int load_ruIndex(R_to_U* ruIndex, char* read_file_name)
{
    char* index_name = (char*)malloc(strlen(read_file_name)+15);
    sprintf(index_name, "%s.bin", read_file_name);
    FILE* fp = fopen(index_name, "r");
    if(!fp)
    {
        return 0;
    }
    int f_flag = 0;
    f_flag += fread(&(ruIndex)->len, sizeof((ruIndex)->len), 1, fp);
    (ruIndex)->index = (uint32_t*)malloc(sizeof(uint32_t)*(ruIndex)->len);
    f_flag += fread((ruIndex)->index, sizeof((*((ruIndex)->index))), (ruIndex)->len, fp);

    if(!(asm_opt.ar)) {
        R_INF.trio_flag = (uint8_t*)malloc(sizeof(uint8_t)*(ruIndex)->len);
        f_flag += fread(R_INF.trio_flag, sizeof((*(R_INF.trio_flag))), (ruIndex)->len, fp);
    } else {
        fseek(fp, sizeof((*(R_INF.trio_flag)))*(ruIndex)->len, SEEK_CUR);
    }

    // CALLOC(ruIndex->is_het, ruIndex->len);
    // f_flag += fread(ruIndex->is_het, 1, ruIndex->len, fp);

    f_flag += fread(&(asm_opt.hom_global_coverage_set), sizeof(asm_opt.hom_global_coverage_set), 1, fp);
    f_flag += fread(&(asm_opt.hom_global_coverage), sizeof(asm_opt.hom_global_coverage), 1, fp);

    free(index_name);    
    fflush(fp);
    fclose(fp);

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x2090
leaq 0xf(%rax), %rdi
callq 0x2280
movq %rax, %rbx
leaq 0x133df0(%rip), %rsi    # 0x22463b
xorl %ebp, %ebp
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x142d46(%rip), %rsi    # 0x2335a7
movq %rbx, %rdi
callq 0x2210
testq %rax, %rax
je 0xf094e
movq %rax, %r14
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rax, %rcx
callq 0x22f0
movq (%r15), %r12
leaq (,%r12,4), %rdi
callq 0x2280
movq %rax, 0x8(%r15)
movl $0x4, %esi
movq %rax, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0x22f0
leaq 0x199ea0(%rip), %r12    # 0x28a758
cmpq $0x0, 0x68(%r12)
movq (%r15), %r15
je 0xf08d5
movq %r14, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x21b0
jmp 0xf08fb
movq %r15, %rdi
callq 0x2280
leaq 0x19a94c(%rip), %rcx    # 0x28b230
movq %rax, 0x28(%rcx)
movl $0x1, %esi
movq %rax, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x22f0
leaq 0x148(%r12), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x22f0
addq $0x144, %r12            # imm = 0x144
movl $0x4, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %r14, %rcx
callq 0x22f0
movq %rbx, %rdi
callq 0x2220
movq %r14, %rdi
callq 0x2200
movq %r14, %rdi
callq 0x2190
movl $0x1, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: set_r_het_status(unsigned char*, kv_gg_status*, ma_ug_t*, unsigned int)
void set_r_het_status(uint8_t* r_het, kv_gg_status *sa, ma_ug_t *ug, uint32_t hapN)
{
    uint32_t i, k, o, f;
    ma_utg_t *u;
    mcg_node_t s;
    for (i = 0; i < sa->n; i++)
    {
        u = &(ug->u.a[i]);
        s = sa->a[i].s; o = 0;
        while (s) {
            o += (s&1); s>>=1;
        }

        f = N_HET;
        if(o < hapN) f = C_HET;
        for (k = 0; k < u->n; k++) r_het[u->a[k]>>33] = f;
    }
}

// Assembly:
cmpq $0x0, 0x8(%rsi)
je 0xf161c
xorl %eax, %eax
movq (%rsi), %r8
movq %rax, %r9
shlq $0x5, %r9
movl (%r8,%r9), %r9d
movl $0x0, %r8d
testl %r9d, %r9d
je 0xf15db
xorl %r8d, %r8d
movl %r9d, %r10d
movl %r9d, %r11d
andl $0x1, %r11d
addl %r11d, %r8d
shrl %r10d
cmpl $0x1, %r9d
movl %r10d, %r9d
ja 0xf15c5
leaq (%rax,%rax,4), %r9
shlq $0x3, %r9
addq 0x10(%rdx), %r9
cmpl $0x0, 0x10(%r9)
je 0xf1614
cmpl %ecx, %r8d
setb %r8b
xorl %r10d, %r10d
movq 0x18(%r9), %r11
movq (%r11,%r10,8), %r11
shrq $0x21, %r11
movb %r8b, (%rdi,%r11)
incq %r10
movl 0x10(%r9), %r11d
cmpq %r11, %r10
jb 0xf15f8
incl %eax
cmpq %rax, 0x8(%rsi)
ja 0xf15a6
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: output_tips(asg_t*, All_reads const*)
int output_tips(asg_t *g, const All_reads *RNF)
{
	uint32_t v, n_vtx = g->n_seq * 2;
    for (v = 0; v < n_vtx; ++v)
    {
        if (g->seq[v>>1].del) continue;

        if(asg_arc_n(g, v) == 0)
        {
            fprintf(stderr, "%.*s\n",
             (int)Get_NAME_LENGTH((*RNF), v>>1), 
             Get_NAME((*RNF), v>>1));
        }
    }

    return 1;
}

// Assembly:
movl 0x14(%rdi), %eax
addl %eax, %eax
je 0xf167b
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x40(%rsi), %r15
addq $0x8, %rbx
movl %eax, %r12d
xorl %r13d, %r13d
movq 0x20(%r14), %rax
movl %r13d, %esi
shrl %esi
cmpl $0x0, (%rax,%rsi,8)
js 0xf165b
movq 0x28(%r14), %rax
cmpl $0x0, (%rax,%r13,8)
je 0xf1665
incq %r13
cmpq %r13, %r12
jne 0xf1641
jmp 0xf1672
movq %r15, %rdi
movq %rbx, %rdx
callq 0x11d26
jmp 0xf165b
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
movl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_coverage(ma_hit_t_alloc*, ma_sub_t*, unsigned long)
long long get_coverage(ma_hit_t_alloc* sources, ma_sub_t* coverage_cut, uint64_t n_read)
{
    uint64_t i, j;
    ma_hit_t *h;
    long long R_bases = 0, C_bases = 0;
    for (i = 0; i < n_read; ++i) 
    {
        R_bases += coverage_cut[i].e - coverage_cut[i].s;
        for (j = 0; j < (uint64_t)(sources[i].length); j++)
        {
            h = &(sources[i].buffer[j]);
            C_bases += Get_qe((*h)) - Get_qs((*h));
        }
    }

    return C_bases/R_bases;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
xorl %eax, %eax
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
xorl %r9d, %r9d
leaq (%r9,%r9,2), %r10
movl 0xc(%rdi,%r10,8), %ebx
testq %rbx, %rbx
je 0xf1b44
leaq (%rdi,%r10,8), %r11
movq (%r11), %r11
shlq $0x3, %rbx
leaq (%rbx,%rbx,4), %rbx
xorl %r14d, %r14d
movl 0x8(%r11,%r14), %r15d
subl (%r11,%r14), %r15d
addq %r15, %rax
addq $0x28, %r14
cmpq %r14, %rbx
jne 0xf1b2f
movl 0x4(%rsi,%r10,4), %r11d
movl (%rsi,%r10,4), %r10d
andl %r8d, %r10d
subl %r10d, %r11d
addq %r11, %rcx
incq %r9
cmpq %rdx, %r9
jne 0xf1b0f
cqto
idivq %rcx
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: pre_clean(ma_hit_t_alloc*, ma_sub_t*, asg_t*, unsigned int)
void pre_clean(ma_hit_t_alloc* sources, ma_sub_t* coverage_cut, asg_t *sg, uint32_t pop_s_node)
{
    int tri_flag = 0;
    while(1)
    {
        tri_flag = 0;
        ///remove very simple circle
        tri_flag += asg_arc_del_simple_circle_untig(sources, coverage_cut, sg, 100, 0);

        ///remove isoloated single read
        if(pop_s_node)
        {
            tri_flag += asg_arc_del_single_node_directly(sg, asm_opt.max_short_tip, sources);///remove very small bubbles
        } 
        
        // if ((!ha_opt_triobin(&asm_opt))&&(!ha_opt_hic(&asm_opt)))
        // {
        //     tri_flag += asg_arc_del_triangular_advance(sg, bubble_dist);
        //     ///remove the cross at the bubble carefully, just remove inexact cross
        //     tri_flag += asg_arc_del_cross_bubble(sg, bubble_dist);
        // }
        // tri_flag += asg_arc_del_single_node_directly(sg, asm_opt.max_short_tip, sources);

        if(tri_flag == 0)
        {
            break;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %ecx, %ebx
movq %rdx, %r14
movq %rdi, %r15
leaq 0x198bd7(%rip), %r13    # 0x28a758
movl $0x64, %ecx
movq %r14, %rdx
xorl %r8d, %r8d
callq 0xe7e99
movq %rax, %r12
testl %ebx, %ebx
je 0xf1bb0
movslq 0x11c(%r13), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0xa85bb
addl %r12d, %eax
movl %eax, %r12d
testl %r12d, %r12d
jne 0xf1b81
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: asg_delete_node_by_trio(asg_t*, unsigned char)
void asg_delete_node_by_trio(asg_t* sg, uint8_t flag)
{
    uint32_t v, n_vtx = sg->n_seq;
    for (v = 0; v < n_vtx; ++v) 
    {
        if (sg->seq[v].del) continue;
        if (R_INF.trio_flag[v] == AMBIGU) continue;
        if(R_INF.trio_flag[v] != flag) asg_seq_del(sg, v);
    }
    asg_cleanup(sg);
}

// Assembly:
movl 0x14(%rdi), %eax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
je 0xa02fa
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
xorl %ecx, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movq 0x20(%rdi), %r9
movl (%r9,%rcx,8), %r10d
testl %r10d, %r10d
js 0xf1cee
leaq 0x199613(%rip), %rdx    # 0x28b230
movq 0x28(%rdx), %r11
movb (%r11,%rcx), %r11b
testb %r11b, %r11b
sete %bl
cmpb %sil, %r11b
sete %r11b
orb %bl, %r11b
jne 0xf1cee
orl $0x80000000, %r10d      # imm = 0x80000000
movl %r10d, (%r9,%rcx,8)
leaq (%rcx,%rcx), %r9
xorl %r10d, %r10d
leaq (%r10,%r9), %r11
movq 0x28(%rdi), %rbx
movq (%rbx,%r11,8), %r14
movq %r14, %rbx
andq %r8, %rbx
je 0xf1cde
shrq $0x20, %r14
leaq (%r14,%r14,2), %r14
shlq $0x3, %r14
addq 0x8(%rdi), %r14
xorl %r15d, %r15d
leaq (%r15,%r15,2), %r12
orb $-0x80, 0xf(%r14,%r12,8)
movl 0x8(%r14,%r12,8), %r12d
xorq $0x1, %r12
movq 0x28(%rdi), %r13
movq (%r13,%r12,8), %r13
movq %r13, %r12
andq %r8, %r12
je 0xf1cd6
movq 0x8(%rdi), %rbp
shrq $0x20, %r13
shlq $0x3, %r12
leaq (%r12,%r12,2), %r12
leaq (%r13,%r13,2), %r13
leaq 0xc(,%r13,8), %r13
addq %rbp, %r13
xorl %ebp, %ebp
movl -0x4(%r13,%rbp), %edx
xorl %r11d, %edx
cmpl $0x1, %edx
jne 0xf1ccd
orb $-0x80, 0x3(%r13,%rbp)
addq $0x18, %rbp
cmpq %rbp, %r12
jne 0xf1cba
incq %r15
cmpq %rbx, %r15
jne 0xf1c74
leaq 0x1(%r10), %rdx
testq %r10, %r10
movq %rdx, %r10
je 0xf1c4d
incq %rcx
cmpq %rax, %rcx
jne 0xf1c05
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa02fa
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: renew_graph_init(ma_hit_t_alloc*, ma_hit_t_alloc*, asg_t*, ma_sub_t*, R_to_U*, unsigned long)
void renew_graph_init(ma_hit_t_alloc* sources, ma_hit_t_alloc* reverse_sources, asg_t *sg, ma_sub_t *coverage_cut, R_to_U* ruIndex, uint64_t n_read)
{
    if(sg != NULL) asg_destroy(sg);
    sg = NULL;
    
    if(coverage_cut != NULL) free(coverage_cut);
    coverage_cut = NULL;

    memset(ruIndex->index, -1, sizeof(uint32_t)*(ruIndex->len));


    uint64_t i = 0, j = 0;
    for (i = 0; i < n_read; i++) {
        for (j = 0; j < sources[i].length; j++) {
            sources[i].buffer[j].del = 0;
        }

        for (j = 0; j < reverse_sources[i].length; j++) {
            reverse_sources[i].buffer[j].del = 0;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r9, %rbx
movq %r8, %r12
movq %rcx, %r13
movq %rsi, %r14
movq %rdi, %r15
testq %rdx, %rdx
je 0xf1d2e
movq %rdx, %rdi
callq 0x9fcdb
testq %r13, %r13
je 0xf1d3b
movq %r13, %rdi
callq 0x2220
movq (%r12), %rdx
movq 0x8(%r12), %rdi
shlq $0x2, %rdx
movl $0xff, %esi
callq 0x20e0
testq %rbx, %rbx
je 0xf1dc4
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
xorl %ecx, %ecx
leaq (%rcx,%rcx,2), %rdx
cmpl $0x0, 0xc(%r15,%rdx,8)
je 0xf1d92
leaq (%r15,%rdx,8), %rsi
movl $0x18, %edi
xorl %r8d, %r8d
movq (%rsi), %r9
andq %rax, (%r9,%rdi)
incq %r8
movl 0xc(%rsi), %r9d
addq $0x28, %rdi
cmpq %r9, %r8
jb 0xf1d7b
cmpl $0x0, 0xc(%r14,%rdx,8)
je 0xf1dbc
leaq (%r14,%rdx,8), %rdx
movl $0x18, %esi
xorl %edi, %edi
movq (%rdx), %r8
andq %rax, (%r8,%rsi)
incq %rdi
movl 0xc(%rdx), %r8d
addq $0x28, %rsi
cmpq %r8, %rdi
jb 0xf1da5
incq %rcx
cmpq %rbx, %rcx
jne 0xf1d63
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_corresponding_uId(ma_ug_t*, R_to_U*, unsigned int)
uint32_t get_corresponding_uId(ma_ug_t *ug, R_to_U* ruIndex, uint32_t t)
{
    uint32_t w, uId, is_Unitig;
    get_R_to_U(ruIndex, t>>1, &uId, &is_Unitig);
    /****************************may have bugs********************************/
    if(uId == ((uint32_t)(-1)) || is_Unitig == 0) return ((uint32_t)(-1));
    if(ug->g->seq[uId].del) return ((uint32_t)(-1));
    /****************************may have bugs********************************/
    w = (uint32_t)-1;
    if(t == ug->u.a[uId].start) w = uId<<1;
    if(t == ug->u.a[uId].end) w = (uId<<1)^1;
    return w;
}

// Assembly:
movl %edx, %ecx
shrl %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rcx, (%rsi)
jbe 0xf24ac
movq 0x8(%rsi), %rsi
movl (%rsi,%rcx,4), %esi
cmpl $-0x1, %esi
je 0xf24ac
movl %esi, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
testl %esi, %esi
setns %sil
jmp 0xf24b3
xorl %esi, %esi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $-0x1, %ecx
sete %r8b
orb %sil, %r8b
jne 0xf24f5
movq 0x18(%rdi), %rsi
movq 0x20(%rsi), %r8
movl %ecx, %esi
cmpl $0x0, (%r8,%rsi,8)
js 0xf24f5
movq 0x10(%rdi), %rax
leaq (%rsi,%rsi,4), %rsi
leal (%rcx,%rcx), %edi
cmpl %edx, 0x4(%rax,%rsi,8)
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
cmovel %edi, %r8d
cmpl %edx, 0x8(%rax,%rsi,8)
leal 0x1(%rcx,%rcx), %eax
cmovnel %r8d, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: minor_transitive_reduction(ma_ug_t*, R_to_U*, asg_arc_t*, unsigned int)
void minor_transitive_reduction(ma_ug_t *ug, R_to_U* ruIndex, asg_arc_t* rbub_edges, uint32_t num)
{
    asg_t* nsg = ug->g;
    uint32_t i, j, k, uId, nv, w;
    asg_arc_t* t = NULL;
    asg_arc_t* p = NULL;
    asg_arc_t *av = NULL;
    ///here all edges from v are saved in rbub_edges
    ///for edges already in graph, need to check del
    ///but for edges in rbub_edges, don't check del
    for (i = 0; i < num; i++)
    {
        t = &rbub_edges[i];
        ///if(t->del) continue;
        uId = get_corresponding_uId(ug, ruIndex, t->v);
        if(uId == ((uint32_t)(-1))) continue;

        nv = asg_arc_n(nsg, uId);
        av = asg_arc_a(nsg, uId);
        for (j = 0; j < nv; j++)
        {
            if(av[j].del) continue;
            w = av[j].v;

            ///note w is the unitig ID
            for (k = 0; k < num; k++)
            {
                p = &rbub_edges[k];
                ///if(p->del) continue;
                ///this line is not necessary at all
                if(k==i) continue;
                ///w is the unitig ID, p->v is the read ID
                if(get_corresponding_uId(ug, ruIndex, p->v) == w) p->del = 1;
            }
        }   
    }    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, 0x18(%rsp)
movq %rdi, (%rsp)
testl %ecx, %ecx
je 0xf2613
movq %rdx, %rbx
movq (%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
movl %ecx, %eax
movq %rax, 0x20(%rsp)
leaq (,%rax,8), %rax
leaq (%rax,%rax,2), %rbp
xorl %r12d, %r12d
xorl %eax, %eax
movq %rax, 0x28(%rsp)
leaq (%rax,%rax,2), %rax
movl 0x8(%rbx,%rax,8), %edx
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xf2482
cmpl $-0x1, %eax
je 0xf25fc
movq 0x8(%rsp), %rcx
movq 0x28(%rcx), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rax
testl %eax, %eax
je 0xf25fc
movq %rax, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rdx
shlq $0x3, %rdx
movq 0x8(%rsp), %rcx
addq 0x8(%rcx), %rdx
movq %rdx, 0x10(%rsp)
movl %eax, %eax
movq %rax, 0x30(%rsp)
xorl %r13d, %r13d
leaq (,%r13,2), %rax
addq %r13, %rax
movq 0x10(%rsp), %rcx
cmpl $0x0, 0xc(%rcx,%rax,8)
js 0xf25f2
movq 0x10(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
movl 0x8(%rax), %r14d
xorl %r15d, %r15d
cmpq %r15, %r12
je 0xf25e9
movl 0x8(%rbx,%r15), %edx
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xf2482
cmpl %r14d, %eax
jne 0xf25e9
orb $-0x80, 0xf(%rbx,%r15)
addq $0x18, %r15
cmpq %r15, %rbp
jne 0xf25c6
incq %r13
cmpq 0x30(%rsp), %r13
jne 0xf259f
movq 0x28(%rsp), %rax
incq %rax
addq $0x18, %r12
cmpq 0x20(%rsp), %rax
jne 0xf253d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq