LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rsi, %rbx
movq %rdi, %r14
movl 0x14(%rdi), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ebp, %ebp
movq %rax, (%rsp)
cmpq %rax, %rbp
je 0xae3f4
movq 0x20(%r14), %rax
movl %ebp, %edx
shrl %edx
movq (%rbx,%rbp,8), %r8
movq %r8, %rcx
shrq $0x21, %rcx
shrl %r8d
movl (%rax,%rbp,8), %r9d
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl %esi, %r9d
cmpl $0x0, (%rax,%rdx,8)
movq 0x1a4c99(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
js 0xae3d2
leaq 0x13c02d(%rip), %rsi    # 0x1ea384
movl %ebp, %edx
xorl %eax, %eax
callq 0x22b0
movq 0x8(%r14), %rax
movq %r14, %r15
movq 0x28(%r14), %rcx
movq (%rcx,%rbp,8), %rcx
movl %ecx, %edx
shrq $0x20, %rcx
imulq $0x18, %rdx, %r13
imulq $0x18, %rcx, %rcx
leaq (%rax,%rcx), %r12
addq $0xc, %r12
xorl %r14d, %r14d
cmpq %r14, %r13
je 0xae3e5
cmpl $0x0, (%r12,%r14)
jns 0xae39a
addq $0x18, %r14
jmp 0xae388
movq -0xc(%r12,%r14), %rdx
shrq $0x20, %rdx
movl -0x4(%r12,%r14), %r8d
movq 0x1a4c31(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
movq (%rbx,%rdx,8), %rcx
shrq $0x21, %rcx
movq (%rbx,%r8,8), %r9
shrq $0x21, %r9
leaq 0x13bfe7(%rip), %rsi    # 0x1ea3b0
xorl %eax, %eax
callq 0x22b0
jmp 0xae394
movq %r14, %r15
leaq 0x13bf7c(%rip), %rsi    # 0x1ea358
movl %ebp, %edx
xorl %eax, %eax
callq 0x22b0
incq %rbp
movq %r15, %r14
movq (%rsp), %rax
jmp 0xae311
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_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
imulq $0xc, %rax, %rcx
movl 0x4(%rsi,%rcx), %r8d
movl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
andl (%rsi,%rcx), %r9d
movl %r8d, %edx
subl %r9d, %edx
imulq $0x18, %rax, %rax
leaq (%rdi,%rax), %rcx
movl 0xc(%rdi,%rax), %eax
imulq $0x28, %rax, %rsi
xorl %edi, %edi
xorl %eax, %eax
cmpq %rdi, %rsi
je 0xae9d5
movq (%rcx), %r10
movl 0x8(%r10,%rdi), %r11d
subl (%r10,%rdi), %r11d
addq %r11, %rax
addq $0x28, %rdi
jmp 0xae9bb
xorl %ecx, %ecx
cmpl %r9d, %r8d
je 0xae9e6
movl %edx, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
movl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
xorl %ebx, %ebx
movl 0x38(%rsp), %eax
movl 0x30(%rsp), %r10d
movl 0x28(%rsp), %r11d
movl %ebx, %ebx
cmpq %rcx, %rbx
jae 0xaedd8
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)
incl %ebx
jmp 0xaedaf
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 0xaee24
xorl %eax, %eax
movl %eax, %eax
cmpq %rax, (%rsi)
jbe 0xaee24
movq 0x8(%rdi), %rcx
movq 0x10(%rsi), %rdx
movl (%rdx,%rax,8), %edx
imulq $0x18, %rdx, %rdx
andl $0x7fffffff, 0xc(%rcx,%rdx) # imm = 0x7FFFFFFF
incl %eax
jmp 0xaee02
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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, %r15
movq 0x10(%rdi), %r12
movl %edx, %ebx
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movl 0x14(%rsi), %esi
andl %ebp, %esi
movq 0x20(%rcx), %rax
movl (%rax,%rbx,8), %edx
andl %ebp, %edx
movq %rcx, %rdi
movl %esi, 0x4(%rsp)
xorl %ecx, %ecx
callq 0x69316
movq (%r15), %rax
movq 0x10(%r15), %r14
cmpq 0x8(%r15), %rax
jne 0xb054c
leaq (%rax,%rax), %rcx
testq %rax, %rax
pushq $0x2
popq %rax
cmovneq %rcx, %rax
movq %rax, 0x8(%r15)
imulq $0x28, %rax, %rsi
movq %r14, %rdi
callq 0x2370
movq %rax, %r14
movq %rax, 0x10(%r15)
movq (%r15), %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%r15)
imulq $0x28, %rax, %r13
andq $0x0, 0x20(%r14,%r13)
imulq $0x28, %rbx, %rbx
movq 0x4(%r12,%rbx), %rax
movq %rax, 0x4(%r14,%r13)
andl (%r12,%rbx), %ebp
movl $0x80000000, %eax       # imm = 0x80000000
movl (%r14,%r13), %ecx
andl %eax, %ecx
orl %ebp, %ecx
movl %ecx, (%r14,%r13)
movl 0x10(%r12,%rbx), %ecx
movl %ecx, 0x10(%r14,%r13)
andl (%r12,%rbx), %eax
orl %ebp, %eax
movl %eax, (%r14,%r13)
movl 0xc(%r12,%rbx), %r15d
movl %r15d, 0xc(%r14,%r13)
shll $0x3, %r15d
movq %r15, %rdi
callq 0x2280
movq %rax, 0x18(%r14,%r13)
movq 0x18(%r12,%rbx), %rsi
movq %rax, %rdi
movq %r15, %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_O2/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
imulq $0x28, %rax, %r14
addq 0x10(%rdi), %r14
cmpl $-0x1, %esi
je 0xb05f1
movl 0x10(%rbx), %ecx
jmp 0xb0621
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)
andl $0x0, 0x10(%rbx)
xorl %ecx, %ecx
movl 0x10(%r14), %eax
addl %ecx, %eax
cmpl %eax, 0xc(%rbx)
jae 0xb0647
movl %eax, 0xc(%rbx)
movq 0x18(%rbx), %rdi
movl %eax, %esi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x18(%rbx)
movl 0x10(%rbx), %ecx
jmp 0xb064b
movq 0x18(%rbx), %rax
movl %ecx, %ecx
movl 0x10(%r14), %edx
testb $0x1, %bpl
jne 0xb0673
leaq (%rax,%rcx,8), %rax
xorl %esi, %esi
cmpq %rsi, %rdx
je 0xb06ae
movq 0x18(%r14), %rdi
movq (%rdi,%rsi,8), %rdi
movq %rdi, (%rax,%rsi,8)
incq %rsi
jmp 0xb065d
leaq (,%rcx,8), %rsi
leaq (%rsi,%rdx,8), %rsi
addq %rsi, %rax
addq $-0x8, %rax
xorl %esi, %esi
movabsq $0x100000000, %rdi      # imm = 0x100000000
cmpq %rsi, %rdx
je 0xb06ae
movq 0x18(%r14), %r8
movq (%r8,%rsi,8), %r8
xorq %rdi, %r8
movq %r8, (%rax)
incq %rsi
addq $-0x8, %rax
jmp 0xb0692
addl %edx, %ecx
movl %ecx, 0x10(%rbx)
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
andl $0x0, 0x24(%r8)
andl $0x0, 0x14(%r8)
movq %rdi, (%r8)
movq 0x28(%rdi), %rax
movl %esi, %esi
movq (%rax,%rsi,8), %rax
movq %rax, %rsi
shrq $0x20, %rsi
imulq $0x18, %rsi, %rsi
addq 0x8(%rdi), %rsi
movq %rsi, 0x8(%r8)
movl %eax, 0x10(%r8)
xorl %eax, %eax
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_O2/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:
leaq 0x14(%rdi), %rax
movl 0x10(%rdi), %edx
movl 0x14(%rdi), %ecx
imulq $0x18, %rcx, %rsi
addq $0xc, %rsi
cmpq %rdx, %rcx
jae 0xb1940
movq 0x8(%rdi), %r8
cmpl $0x0, (%r8,%rsi)
jns 0xb196d
incq %rcx
movl %ecx, (%rax)
addq $0x18, %rsi
jmp 0xb1925
leaq 0x24(%rdi), %rax
movl 0x20(%rdi), %edx
movl 0x24(%rdi), %ecx
imulq $0x18, %rcx, %rsi
addq $0xc, %rsi
cmpq %rdx, %rcx
jae 0xb1975
movq 0x18(%rdi), %r8
cmpl $0x0, (%r8,%rsi)
jns 0xb196d
incq %rcx
movl %ecx, (%rax)
addq $0x18, %rsi
jmp 0xb1952
incl %ecx
movl %ecx, (%rax)
pushq $0x1
popq %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x12f9b5(%rip), %rsi    # 0x1e264b
xorl %ebp, %ebp
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x13ea0b(%rip), %rsi    # 0x1f16b7
movq %r14, %rdi
callq 0x2210
testq %rax, %rax
je 0xb2d0e
movq %rax, %r15
leaq 0x8(%rsp), %r12
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %r12, %rdi
movq %rax, %rcx
callq 0x22f0
movq (%r12), %r12
imulq $0xc, %r12, %rdi
callq 0x2280
movq %rax, (%rbx)
pushq $0xc
popq %rsi
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
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x12f8ff(%rip), %rsi    # 0x1e264b
movq %rax, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x147941(%rip), %rsi    # 0x1fa6a1
movq %r15, %rdi
callq 0x2210
movq %rax, %r12
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %rax, %rcx
callq 0x2410
movq (%r14), %rdx
pushq $0xc
popq %rsi
movq %rbx, %rdi
movq %r12, %rcx
callq 0x2410
movq %r15, %rdi
callq 0x2220
movq %r12, %rdi
callq 0x2200
movq %r12, %rdi
callq 0x2190
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r13
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 0x12f86d(%rip), %rsi    # 0x1e264b
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x1478af(%rip), %rsi    # 0x1fa6a1
movq %rbx, %rdi
callq 0x2210
movq %rax, %r14
pushq $0x8
popq %rsi
pushq $0x1
popq %r12
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %rcx
callq 0x2410
movq (%r15), %rdx
movq 0x8(%r15), %rdi
pushq $0x4
popq %r13
movq %r13, %rsi
movq %r14, %rcx
callq 0x2410
leaq 0x1a1401(%rip), %rax    # 0x254230
movq 0x28(%rax), %rdi
movq (%r15), %rdx
movq %r12, %rsi
movq %r14, %rcx
callq 0x2410
leaq 0x1a0910(%rip), %r15    # 0x253758
leaq 0x148(%r15), %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x2410
addq $0x144, %r15            # imm = 0x144
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x2410
movq %rbx, %rdi
callq 0x2220
movq %r14, %rdi
callq 0x2200
movq %r14, %rdi
callq 0x2190
pushq $0x1
popq %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x2090
leaq 0xf(%rax), %rdi
callq 0x2280
movq %rax, %rbx
leaq 0x12f785(%rip), %rsi    # 0x1e264b
xorl %ebp, %ebp
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x13e7db(%rip), %rsi    # 0x1f16b7
movq %rbx, %rdi
callq 0x2210
testq %rax, %rax
je 0xb2fbd
movq %rax, %r14
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %rax, %rcx
callq 0x22f0
movq (%r15), %r12
leaq (,%r12,4), %rdi
callq 0x2280
movq %rax, 0x8(%r15)
pushq $0x4
popq %rsi
movq %rax, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0x22f0
leaq 0x1a082b(%rip), %r12    # 0x253758
cmpq $0x0, 0x68(%r12)
movq (%r15), %r15
je 0xb2f48
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x21b0
jmp 0xb2f6c
movq %r15, %rdi
callq 0x2280
leaq 0x1a12d9(%rip), %rcx    # 0x254230
movq %rax, 0x28(%rcx)
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x22f0
pushq $0x1
popq %rbp
leaq 0x148(%r12), %rdi
pushq $0x4
popq %r15
pushq $0x1
popq %r13
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x22f0
addq $0x144, %r12            # imm = 0x144
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x22f0
movq %rbx, %rdi
callq 0x2220
movq %r14, %rdi
callq 0x2200
movq %r14, %rdi
callq 0x2190
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: write_debug_graph(asg_t*, ma_hit_t_alloc*, ma_sub_t*, char*, ma_hit_t_alloc*, R_to_U*, all_ul_t*)
int write_debug_graph(asg_t *sg, ma_hit_t_alloc* sources, ma_sub_t* coverage_cut, 
char* output_file_name, ma_hit_t_alloc* reverse_sources, R_to_U* ruIndex, all_ul_t *ul_r_inf)
{

    char* gfa_name = (char*)malloc(strlen(output_file_name)+55);

    ////write_All_reads(&R_INF, gfa_name);
    sprintf(gfa_name, "%s.all.debug.source", output_file_name);
    write_debug_ma_hit_ts(sources, R_INF.total_reads, gfa_name);
    sprintf(gfa_name, "%s.all.debug.reverse", output_file_name);
    write_debug_ma_hit_ts(reverse_sources, R_INF.total_reads, gfa_name);
    if(coverage_cut) {
        sprintf(gfa_name, "%s.all.debug.coverage_cut", output_file_name);
        write_coverage_cut(coverage_cut, gfa_name, R_INF.total_reads);
    }
    sprintf(gfa_name, "%s.all.debug.ruIndex", output_file_name);
    write_ruIndex(ruIndex, gfa_name);
    if(sg) {
        sprintf(gfa_name, "%s.all.debug.asg_t", output_file_name);
        write_asg_t(sg, gfa_name);
    }
    if(ul_r_inf) {
        sprintf(gfa_name, "%s.all.debug.ul.rinfor", output_file_name);
        write_all_ul_t(ul_r_inf, gfa_name, NULL);
    }
    free(gfa_name);
    fprintf(stderr, "debug_graph has been written.\n");
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x8(%rsp)
movq %r8, %rbp
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, 0x10(%rsp)
movq %rcx, %rdi
callq 0x2090
leaq 0x37(%rax), %rdi
callq 0x2280
movq %rax, %r14
leaq 0x137434(%rip), %rsi    # 0x1ea82a
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x1a0e26(%rip), %r15    # 0x254230
movq 0x50(%r15), %rsi
movq %r12, %rdi
movq %r14, %rdx
callq 0xa3f1c
leaq 0x13741e(%rip), %rsi    # 0x1ea83e
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2050
movq 0x50(%r15), %rsi
movq %rbp, %rdi
movq %r14, %rdx
callq 0xa3f1c
testq %r13, %r13
je 0xb3464
leaq 0x13740b(%rip), %rsi    # 0x1ea853
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2050
movq 0x50(%r15), %rdx
movq %r13, %rdi
movq %r14, %rsi
callq 0xb2d1d
movq 0x50(%rsp), %r13
leaq 0x1373fd(%rip), %rsi    # 0x1ea86d
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2050
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0xb2db4
movq 0x10(%rsp), %r15
testq %r15, %r15
je 0xb34b3
leaq 0x1373e7(%rip), %rsi    # 0x1ea882
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2050
movq %r15, %rdi
movq %r14, %rsi
callq 0xb2fce
testq %r13, %r13
je 0xb34d9
leaq 0x1373d6(%rip), %rsi    # 0x1ea895
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2050
movq %r13, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x19a7cf
movq %r14, %rdi
callq 0x2220
movq 0x19faf8(%rip), %rax    # 0x252fe0
movq (%rax), %rcx
leaq 0x1373ba(%rip), %rdi    # 0x1ea8ac
pushq $0x1e
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
pushq $0x1
popq %rax
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: print_utg_hap(ma_ug_t*, asg_t*, unsigned int, ma_hit_t_alloc*, R_to_U*)
void print_utg_hap(ma_ug_t *ug, asg_t* read_g, uint32_t uid, ma_hit_t_alloc* reverse_sources, 
R_to_U* ruIndex)
{
    
    uint32_t k, rId, qn, i, is_Unitig;
    ma_utg_t* u = &(ug->u.a[uid]);
    fprintf(stderr, "\nuid: %u, u->n: %u\n", uid, u->n);
    for (k = 0; k < u->n; k++)
    {
        rId = u->a[k]>>33;
        fprintf(stderr, "self[%u]: %u\n", k, rId);
    }

    for (k = 0; k < u->n; k++)
    {
        qn = u->a[k]>>33;
        fprintf(stderr, "****self[%u]: %u, Len: %u\n", k, qn, reverse_sources[qn].length);
        for (i = 0; i < reverse_sources[qn].length; i++)
        {
            rId = Get_tn(reverse_sources[qn].buffer[i]);
            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;
            }
            fprintf(stderr, "hap[%u]: %u\n", i, rId);
        }
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, 0x10(%rsp)
movq %rsi, %r15
movq 0x10(%rdi), %rax
movl %edx, %ecx
imulq $0x28, %rcx, %rcx
leaq (%rax,%rcx), %r14
movq 0x19fa9a(%rip), %rsi    # 0x252fe0
movq (%rsi), %rdi
movl 0x10(%rax,%rcx), %ecx
leaq 0x137419(%rip), %rsi    # 0x1ea96d
xorl %eax, %eax
callq 0x22b0
leaq 0x13741f(%rip), %r12    # 0x1ea981
xorl %r13d, %r13d
movl 0x10(%r14), %eax
cmpq %rax, %r13
jae 0xb3596
movq 0x18(%r14), %rax
movq (%rax,%r13,8), %rcx
shrq $0x21, %rcx
movq 0x19fa5f(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
movq %r12, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x22b0
incq %r13
jmp 0xb3565
xorl %ebp, %ebp
movq %r14, 0x8(%rsp)
movl %eax, %eax
cmpq %rax, %rbp
jae 0xb364f
movq 0x18(%r14), %rax
movq (%rax,%rbp,8), %rcx
shrq $0x21, %rcx
movq 0x19fa25(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
imulq $0x18, %rcx, %rax
movq 0x10(%rsp), %rdx
leaq (%rdx,%rax), %r13
movl 0xc(%rdx,%rax), %r8d
leaq 0x1373b8(%rip), %rsi    # 0x1ea98f
movl %ebp, %edx
xorl %eax, %eax
callq 0x22b0
pushq $0xc
popq %r14
xorl %r12d, %r12d
movl 0xc(%r13), %eax
cmpq %rax, %r12
jae 0xb363e
movq (%r13), %rax
movl (%rax,%r14), %ecx
movq 0x20(%r15), %rax
cmpl $0x0, (%rax,%rcx,8)
jns 0xb361a
cmpq %rcx, (%rbx)
jbe 0xb3635
movq 0x8(%rbx), %rdx
movslq (%rdx,%rcx,4), %rcx
testq %rcx, %rcx
js 0xb3635
cmpl $0x0, (%rax,%rcx,8)
js 0xb3635
movq 0x19f9bf(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0x13737f(%rip), %rsi    # 0x1ea9aa
movl %r12d, %edx
xorl %eax, %eax
callq 0x22b0
incq %r12
addq $0x28, %r14
jmp 0xb35e7
incq %rbp
movq 0x8(%rsp), %r14
movl 0x10(%r14), %eax
jmp 0xb359d
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: print_utg_coverage(ma_ug_t*, ma_sub_t*, unsigned int, ma_hit_t_alloc*)
void print_utg_coverage(ma_ug_t *ug, ma_sub_t* coverage_cut, uint32_t v, ma_hit_t_alloc* sources)
{
    asg_t* nsg = ug->g;
    uint32_t rId, k, j;
    ma_utg_t* u = NULL;
    ma_hit_t *h;

    if(nsg->seq[v].del) return;
    u = &(ug->u.a[v]);
    if(u->m == 0) return;
    long long R_bases = 0, C_bases = 0;
    long long U_R_bases = 0, U_C_bases = 0;
    for (k = 0; k < u->n; k++)
    {
        rId = u->a[k]>>33;
        C_bases = 0;
        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]);
            if(h->el != 1) continue;
            C_bases += Get_qe((*h)) - Get_qs((*h));
        }
        U_R_bases += R_bases;
        U_C_bases += C_bases;
        C_bases = C_bases/R_bases;

        fprintf(stderr, "%.*s\t%lld\n", (int)Get_NAME_LENGTH(R_INF, rId), Get_NAME(R_INF, rId), C_bases);
    }

    fprintf(stderr, "v: %u, coverage: %lld\n\n", v, U_C_bases/U_R_bases);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq 0x18(%rdi), %rax
movq 0x20(%rax), %rcx
movl %edx, %eax
cmpl $0x0, (%rcx,%rax,8)
js 0xb3850
movq 0x10(%rdi), %rbp
imulq $0x28, %rax, %rax
cmpl $0x0, 0xc(%rbp,%rax)
jne 0xb385f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %r15
movl %edx, 0x4(%rsp)
addq %rax, %rbp
xorl %ebx, %ebx
xorl %r12d, %r12d
xorl %r13d, %r13d
movl 0x10(%rbp), %eax
cmpq %rax, %rbx
jae 0xb3920
movq 0x18(%rbp), %rax
movq (%rax,%rbx,8), %rcx
shrq $0x21, %rcx
imulq $0xc, %rcx, %rax
movl 0x4(%r15,%rax), %edx
movl (%r15,%rax), %eax
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl %esi, %eax
subl %eax, %edx
imulq $0x18, %rcx, %rax
leaq (%r14,%rax), %rsi
movl 0xc(%r14,%rax), %eax
imulq $0x28, %rax, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
cmpq %r8, %rdi
je 0xb38d7
movq (%rsi), %r9
cmpb $0x1, 0x20(%r9,%r8)
jne 0xb38d1
movl 0x8(%r9,%r8), %r10d
subl (%r9,%r8), %r10d
addq %r10, %rax
addq $0x28, %r8
jmp 0xb38b5
movl %edx, %esi
addq %rsi, %r12
addq %rax, %r13
cqto
idivq %rsi
movq 0x19f6f5(%rip), %rdx    # 0x252fe0
movq (%rdx), %rdi
leaq 0x1a093b(%rip), %r8     # 0x254230
movq 0x40(%r8), %rsi
movl 0x8(%rsi,%rcx,8), %edx
movq (%rsi,%rcx,8), %rcx
subl %ecx, %edx
addq 0x8(%r8), %rcx
leaq 0x1370a9(%rip), %rsi    # 0x1ea9b7
movq %rax, %r8
xorl %eax, %eax
callq 0x22b0
incq %rbx
jmp 0xb3871
movq 0x19f6b9(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
movq %r13, %rax
cqto
idivq %r12
leaq 0x137089(%rip), %rsi    # 0x1ea9c2
movl 0x4(%rsp), %edx
movq %rax, %rcx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22b0
// File: /workspace/github_cpp_makefile_star2_O2/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:
xorl %eax, %eax
movl %eax, %eax
cmpq %rax, 0x8(%rsi)
jbe 0xb3d6f
movq 0x10(%rdx), %r8
movq (%rsi), %r9
movq %rax, %r10
shlq $0x5, %r10
movl (%r9,%r10), %r10d
xorl %r9d, %r9d
testl %r10d, %r10d
je 0xb3d3c
movl %r10d, %r11d
andl $0x1, %r11d
addl %r11d, %r9d
shrl %r10d
jmp 0xb3d28
imulq $0x28, %rax, %r10
addq %r10, %r8
cmpl %ecx, %r9d
setb %r9b
xorl %r10d, %r10d
movl 0x10(%r8), %r11d
cmpq %r11, %r10
jae 0xb3d6b
movq 0x18(%r8), %r11
movq (%r11,%r10,8), %r11
shrq $0x21, %r11
movb %r9b, (%rdi,%r11)
incq %r10
jmp 0xb3d4d
incl %eax
jmp 0xb3d0b
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x14(%rdi), %r12d
addl %r12d, %r12d
movq 0x19ec5f(%rip), %r13    # 0x252fe0
leaq 0x143ce2(%rip), %r15    # 0x1f806a
xorl %ebp, %ebp
cmpq %rbp, %r12
je 0xb43ce
movq 0x20(%r14), %rcx
movl %ebp, %eax
shrl %eax
cmpl $0x0, (%rcx,%rax,8)
js 0xb43a7
movq 0x28(%r14), %rcx
cmpl $0x0, (%rcx,%rbp,8)
je 0xb43ac
incq %rbp
jmp 0xb438a
movq (%r13), %rdi
movq 0x40(%rbx), %rcx
movl 0x8(%rcx,%rax,8), %edx
movq (%rcx,%rax,8), %rcx
subl %ecx, %edx
addq 0x8(%rbx), %rcx
movq %r15, %rsi
xorl %eax, %eax
callq 0x22b0
jmp 0xb43a7
pushq $0x1
popq %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: 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 %r12
pushq %rbx
xorl %ecx, %ecx
movl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
xorl %r8d, %r8d
xorl %eax, %eax
cmpq %rdx, %rcx
je 0xb4c2b
imulq $0xc, %rcx, %r11
movl 0x4(%rsi,%r11), %r10d
movl (%rsi,%r11), %r11d
andl %r9d, %r11d
subl %r11d, %r10d
imulq $0x18, %rcx, %rbx
leaq (%rdi,%rbx), %r11
movl 0xc(%rdi,%rbx), %ebx
imulq $0x28, %rbx, %rbx
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0xb4c23
movq (%r11), %r15
movl 0x8(%r15,%r14), %r12d
subl (%r15,%r14), %r12d
addq %r12, %rax
addq $0x28, %r14
jmp 0xb4c09
addq %r10, %r8
incq %rcx
jmp 0xb4bde
cqto
idivq %r8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r14
movq %rdi, %r15
pushq $0x64
popq %r12
leaq 0x19eb02(%rip), %rbp    # 0x253758
movq %r14, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0xab04f
movq %rax, %r13
testl %ebx, %ebx
je 0xb4c83
movslq 0x11c(%rbp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x6fc61
addl %r13d, %eax
movl %eax, %r13d
testl %r13d, %r13d
jne 0xb4c56
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_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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movl 0x14(%rdi), %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %r14d, %r14d
leaq 0x19f557(%rip), %r12    # 0x254230
cmpq %r14, %r15
je 0xb4d11
movq 0x20(%rbx), %rax
cmpl $0x0, (%rax,%r14,8)
js 0xb4d0c
movq 0x28(%r12), %rax
movb (%rax,%r14), %al
testb %al, %al
sete %cl
cmpb %bpl, %al
sete %al
orb %cl, %al
jne 0xb4d0c
movq %rbx, %rdi
movl %r14d, %esi
callq 0x6f8da
incq %r14
jmp 0xb4cd9
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x694eb
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r12
movq %rcx, %r13
movq %rsi, %r14
movq %rdi, %r15
testq %rdx, %rdx
je 0xb4d48
movq %rdx, %rdi
callq 0x68f68
movabsq $0x7fffffffffffffff, %rbp # imm = 0x7FFFFFFFFFFFFFFF
movq %r13, %rdi
callq 0x2220
movq (%r12), %rdx
movq 0x8(%r12), %rdi
shlq $0x2, %rdx
movl $0xff, %esi
callq 0x20e0
xorl %eax, %eax
pushq $0x18
popq %rcx
cmpq %rbx, %rax
je 0xb4dc8
imulq $0x18, %rax, %rdx
leaq (%r15,%rdx), %rsi
movq %rcx, %rdi
xorl %r8d, %r8d
movl 0xc(%rsi), %r9d
cmpq %r9, %r8
jae 0xb4da2
movq (%rsi), %r9
andq %rbp, (%r9,%rdi)
incq %r8
addq $0x28, %rdi
jmp 0xb4d89
addq %r14, %rdx
movq %rcx, %rsi
xorl %edi, %edi
movl 0xc(%rdx), %r8d
cmpq %r8, %rdi
jae 0xb4dc3
movq (%rdx), %r8
andq %rbp, (%r8,%rsi)
incq %rdi
addq $0x28, %rsi
jmp 0xb4daa
incq %rax
jmp 0xb4d76
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_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
pushq $-0x1
popq %rax
cmpq %rcx, (%rsi)
jbe 0xb544d
movq 0x8(%rsi), %rsi
movl (%rsi,%rcx,4), %ecx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
cmpq %rsi, %rcx
je 0xb544d
testl %ecx, %ecx
js 0xb544e
retq
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq 0x18(%rdi), %rsi
movq 0x20(%rsi), %rsi
cmpl $0x0, (%rsi,%rcx,8)
js 0xb544d
movq 0x10(%rdi), %rax
imulq $0x28, %rcx, %rsi
leal (%rcx,%rcx), %edi
cmpl %edx, 0x4(%rax,%rsi)
pushq $-0x1
popq %r8
cmovel %edi, %r8d
cmpl %edx, 0x8(%rax,%rsi)
leal 0x1(%rcx,%rcx), %eax
cmovnel %r8d, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rdx, %rbx
movq %rsi, 0x8(%rsp)
movq %rdi, %r15
movq 0x18(%rdi), %rax
movq %rax, 0x10(%rsp)
movl %ecx, %eax
movq %rax, 0x18(%rsp)
imulq $0x18, %rax, %rbp
xorl %r13d, %r13d
xorl %eax, %eax
cmpq 0x18(%rsp), %rax
je 0xb557c
movq %rax, 0x20(%rsp)
imulq $0x18, %rax, %rax
movl 0x8(%rbx,%rax), %edx
movq %r15, %rdi
movq 0x8(%rsp), %rsi
callq 0xb542c
cmpl $-0x1, %eax
je 0xb556b
movq 0x10(%rsp), %rdx
movq 0x28(%rdx), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rax
movl %eax, %ecx
movq %rcx, 0x28(%rsp)
shrq $0x20, %rax
imulq $0x18, %rax, %rax
addq 0x8(%rdx), %rax
movq %rax, (%rsp)
xorl %eax, %eax
cmpq 0x28(%rsp), %rax
je 0xb556b
movq %rax, 0x30(%rsp)
imulq $0x18, %rax, %rax
movq (%rsp), %rcx
cmpl $0x0, 0xc(%rcx,%rax)
js 0xb5561
addq (%rsp), %rax
movl 0x8(%rax), %r12d
xorl %r14d, %r14d
cmpq %r14, %rbp
je 0xb5561
cmpq %r14, %r13
je 0xb555b
movl 0x8(%rbx,%r14), %edx
movq %r15, %rdi
movq 0x8(%rsp), %rsi
callq 0xb542c
cmpl %r12d, %eax
jne 0xb555b
orb $-0x80, 0xf(%rbx,%r14)
addq $0x18, %r14
jmp 0xb5534
movq 0x30(%rsp), %rax
incq %rax
jmp 0xb550e
movq 0x20(%rsp), %rax
incq %rax
addq $0x18, %r13
jmp 0xb54b8
addq $0x38, %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: set_rtg_flag_by_bubble(bubble_type*, ma_ug_t*, asg_t*, unsigned int, unsigned char*, unsigned int)
void set_rtg_flag_by_bubble(bubble_type* bub, ma_ug_t* ug, asg_t *r_g, uint32_t v, uint8_t* vis_flag, 
uint32_t flag)
{
    uint32_t beg, sink, *a = NULL, n, i, k, uId, rId;
    ma_utg_t* nsu = NULL;
    get_bubbles(bub, v, &beg, &sink, &a, &n, NULL);
    for (i = 0; i < n; i++)
    {
        uId = a[i]>>1;

        nsu = &(ug->u.a[uId]);
        if(nsu->m > 0)
        {
            for (k = 0; k < nsu->n; k++)
            {
                rId = nsu->a[k]>>33;
                if(r_g->seq[rId].del) continue;
                vis_flag[rId] = flag;
            }
        }
    } 

    if(beg != (uint32_t)-1)
    {
        uId = beg>>1;

        nsu = &(ug->u.a[uId]);
        if(nsu->m > 0)
        {
            for (k = 0; k < nsu->n; k++)
            {
                rId = nsu->a[k]>>33;
                if(r_g->seq[rId].del) continue;
                vis_flag[rId] = flag;
            }
        }
    }
    
    if(sink != (uint32_t)-1)
    {
        uId = sink>>1;

        nsu = &(ug->u.a[uId]);
        if(nsu->m > 0)
        {
            for (k = 0; k < nsu->n; k++)
            {
                rId = nsu->a[k]>>33;
                if(r_g->seq[rId].del) continue;
                vis_flag[rId] = flag;
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %ebx
movq %r8, %r14
movq %rdx, %r15
movq %rsi, %r12
leaq 0x20(%rsp), %r13
andq $0x0, (%r13)
movl %ecx, %esi
andq $0x0, (%rsp)
leaq 0x18(%rsp), %rdx
leaq 0x14(%rsp), %rcx
leaq 0x1c(%rsp), %rbp
movq %r13, %r8
movq %rbp, %r9
callq 0xf6ab5
movl (%rbp), %eax
movq (%r13), %rcx
xorl %edx, %edx
cmpq %rax, %rdx
je 0xb7900
movl (%rcx,%rdx,4), %edi
shrl %edi
movq 0x10(%r12), %rsi
imulq $0x28, %rdi, %rdi
cmpl $0x0, 0xc(%rsi,%rdi)
je 0xb78fb
addq %rdi, %rsi
xorl %edi, %edi
movl 0x10(%rsi), %r8d
cmpq %r8, %rdi
jae 0xb78fb
movq 0x18(%rsi), %r8
movq (%r8,%rdi,8), %r8
shrq $0x21, %r8
movq 0x20(%r15), %r9
cmpl $0x0, (%r9,%r8,8)
js 0xb78f6
movb %bl, (%r14,%r8)
incq %rdi
jmp 0xb78d2
incq %rdx
jmp 0xb78b3
movl 0x18(%rsp), %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %rdx
je 0xb794c
shrl %edx
movq 0x10(%r12), %rcx
imulq $0x28, %rdx, %rdx
cmpl $0x0, 0xc(%rcx,%rdx)
je 0xb794c
addq %rdx, %rcx
xorl %edx, %edx
movl 0x10(%rcx), %esi
cmpq %rsi, %rdx
jae 0xb794c
movq 0x18(%rcx), %rsi
movq (%rsi,%rdx,8), %rsi
shrq $0x21, %rsi
movq 0x20(%r15), %rdi
cmpl $0x0, (%rdi,%rsi,8)
js 0xb7947
movb %bl, (%r14,%rsi)
incq %rdx
jmp 0xb7925
movl 0x14(%rsp), %ecx
cmpq %rax, %rcx
je 0xb7993
shrl %ecx
movq 0x10(%r12), %rax
imulq $0x28, %rcx, %rcx
cmpl $0x0, 0xc(%rax,%rcx)
je 0xb7993
addq %rcx, %rax
xorl %ecx, %ecx
movl 0x10(%rax), %edx
cmpq %rdx, %rcx
jae 0xb7993
movq 0x18(%rax), %rdx
movq (%rdx,%rcx,8), %rdx
shrq $0x21, %rdx
movq 0x20(%r15), %rsi
cmpl $0x0, (%rsi,%rdx,8)
js 0xb798e
movb %bl, (%r14,%rdx)
incq %rcx
jmp 0xb796c
addq $0x28, %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: minor_transitive_reduction_r_g(asg_t*, asg_arc_t*, unsigned int)
void minor_transitive_reduction_r_g(asg_t *r_g, asg_arc_t* rbub_edges, uint32_t num)
{
    uint32_t i, j, k, rId, 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];
        rId = t->v;

        nv = asg_arc_n(r_g, rId);
        av = asg_arc_a(r_g, rId);
        for (j = 0; j < nv; j++)
        {
            if(av[j].del) continue;
            w = av[j].v;
            for (k = 0; k < num; k++)
            {
                p = &rbub_edges[k];
                ///this line is not necessary at all
                if(k==i) continue;
                if(p->v == w) p->del = 1;
            }
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
movl %edx, %eax
imulq $0x18, %rax, %rcx
xorl %edx, %edx
xorl %r8d, %r8d
cmpq %rax, %r8
je 0xb7e88
imulq $0x18, %r8, %r9
movl 0x8(%rsi,%r9), %r9d
movq 0x28(%rdi), %r10
movq (%r10,%r9,8), %r10
movl %r10d, %r9d
shrq $0x20, %r10
imulq $0x18, %r10, %r10
addq 0x8(%rdi), %r10
xorl %r11d, %r11d
cmpq %r9, %r11
je 0xb7e7f
imulq $0x18, %r11, %rbx
cmpl $0x0, 0xc(%r10,%rbx)
js 0xb7e7a
addq %r10, %rbx
movl 0x8(%rbx), %ebx
xorl %r14d, %r14d
cmpq %r14, %rcx
je 0xb7e7a
cmpq %r14, %rdx
je 0xb7e74
cmpl %ebx, 0x8(%rsi,%r14)
jne 0xb7e74
orb $-0x80, 0xf(%rsi,%r14)
addq $0x18, %r14
jmp 0xb7e5d
incq %r11
jmp 0xb7e43
incq %r8
addq $0x18, %rdx
jmp 0xb7e1b
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/./Overlaps.h
// Function: asg_get_arc(asg_t*, unsigned int, unsigned int, asg_arc_t*)
static inline uint32_t asg_get_arc(asg_t *g, uint32_t v, uint32_t w, asg_arc_t* t)
{
	uint32_t i, 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;
		if(av[i].v == w)
		{
			(*t) = av[i];
			return 1;
		}
	}

	return 0;
}

// Assembly:
movq 0x8(%rdi), %r8
movq 0x28(%rdi), %rax
movl %esi, %esi
movq (%rax,%rsi,8), %rax
movl %eax, %esi
shrq $0x20, %rax
imulq $0x18, %rsi, %r9
imulq $0x18, %rax, %rsi
leaq (%rsi,%r8), %r10
addq $0xc, %r10
xorl %eax, %eax
xorl %edi, %edi
cmpq %rdi, %r9
je 0xbb310
cmpl $0x0, (%r10,%rdi)
js 0xbb2f4
cmpl %edx, -0x4(%r10,%rdi)
je 0xbb2fa
addq $0x18, %rdi
jmp 0xbb2e1
addq %r8, %rsi
movq 0x10(%rdi,%rsi), %rax
movq %rax, 0x10(%rcx)
movups (%rdi,%rsi), %xmm0
movups %xmm0, (%rcx)
pushq $0x1
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: reset_bub(bubble_type*, ma_ug_t*, trans_chain*, kvec_asg_arc_t_warp*)
void reset_bub(bubble_type* bub, ma_ug_t *ug, trans_chain* back_ug_chain, kvec_asg_arc_t_warp* new_rtg_edges)
{
    destory_bubbles(bub);
    memset(bub, 0, sizeof(bubble_type));

    if(new_rtg_edges) new_rtg_edges->a.n = 0;
    ///classify_untigs(ug, sg, coverage_cut, sources, reverse_sources, ruIndex, new_rtg_edges, max_hang, min_ovlp);
    identify_bubbles(ug, bub, back_ug_chain->ir_het, NULL);
    // update_bubble_chain(ug, bub, 0, 1);
    // resolve_bubble_chain_tangle(ug, bub);
    // fprintf(stderr, "bub.f_bub: %lu, bub.b_bub: %lu, bub.b_end_bub: %lu, bub.tangle_bub: %lu, bub.cross_bub: %lu\n", 
    // bub->f_bub, bub->b_bub, bub->b_end_bub, bub->tangle_bub, bub->cross_bub);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
callq 0xf6a60
movl $0x110, %edx            # imm = 0x110
movq %rbx, %rdi
xorl %esi, %esi
callq 0x20e0
testq %r12, %r12
je 0xbb4a1
andq $0x0, (%r12)
movq 0x10(%r15), %rdx
movq %r14, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xf7387