LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_overlapLen(unsigned int, ma_hit_t_alloc*, unsigned int*, unsigned int*)
void get_overlapLen(uint32_t rId, ma_hit_t_alloc* sources, uint32_t* exactLen, uint32_t* inexactLen)
{
    (*exactLen) = (*inexactLen) = 0;
    ma_hit_t_alloc* x = &(sources[rId]);
    ma_hit_t *h = NULL;
    uint32_t i, len;
    for (i = 0; i < x->length; i++)
    {
        h = &(x->buffer[i]);
        len = Get_qe((*h)) - Get_qs((*h));
        if(h->el == 1)
        {
            (*exactLen) += len;
        }
        else
        {
            (*inexactLen) += len;
        }
    }
}

// Assembly:
andl $0x0, (%rcx)
andl $0x0, (%rdx)
movl %edi, %eax
imulq $0x18, %rax, %rax
addq %rsi, %rax
xorl %esi, %esi
xorl %edi, %edi
movl 0xc(%rax), %r8d
cmpq %r8, %rdi
jae 0x7886d
movq (%rax), %r8
movl 0x8(%r8,%rsi), %r9d
subl (%r8,%rsi), %r9d
cmpb $0x1, 0x20(%r8,%rsi)
movq %rcx, %r8
cmoveq %rdx, %r8
addl %r9d, (%r8)
incq %rdi
addq $0x28, %rsi
jmp 0x7883f
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_edge_from_source(ma_hit_t_alloc*, ma_sub_t*, R_to_U*, int, int, unsigned int, unsigned int, asg_arc_t*)
uint32_t get_edge_from_source(ma_hit_t_alloc* sources, ma_sub_t *coverage_cut, 
R_to_U* ruIndex, int max_hang, int min_ovlp, uint32_t query, uint32_t target, asg_arc_t* t)
{
    uint32_t qn = query>>1, i;
    int32_t r;
    ma_hit_t *h = NULL;
    ma_sub_t *sq = NULL;
    ma_sub_t *st = NULL;
    ma_hit_t_alloc* x = &(sources[qn]);
    for (i = 0; i < x->length; i++)
    {
        h = &(x->buffer[i]);
        sq = &(coverage_cut[Get_qn(*h)]);
        st = &(coverage_cut[Get_tn(*h)]);
    
        r = ma_hit2arc(h, sq->e - sq->s, st->e - st->s, max_hang, 
                                asm_opt.max_hang_rate, min_ovlp, t);
        
        ///if it is a contained read, skip
        if(r < 0) continue;

        if((t->ul>>32) != query) continue;
        if(t->v != target) continue;
        
        return 1;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq %rsi, %r14
movq 0x58(%rsp), %rbp
movl %r9d, %eax
movq %rax, 0x10(%rsp)
shrl %r9d
imulq $0x18, %r9, %r13
addq %rdi, %r13
movl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %r15d, %r15d
xorl %ebx, %ebx
movl 0xc(%r13), %eax
cmpq %rax, %rbx
jae 0x792bf
movq (%r13), %rax
leaq (%rax,%r15), %rdi
movl 0x4(%rax,%r15), %ecx
movl 0xc(%rax,%r15), %eax
imulq $0xc, %rcx, %rcx
imulq $0xc, %rax, %rax
movl 0x4(%r14,%rcx), %esi
movl (%r14,%rcx), %ecx
andl %r12d, %ecx
subl %ecx, %esi
movl 0x4(%r14,%rax), %edx
movl (%r14,%rax), %eax
andl %r12d, %eax
subl %eax, %edx
leaq 0x1da4d2(%rip), %rax    # 0x253758
movss 0x158(%rax), %xmm0
movl 0x8(%rsp), %ecx
movl 0xc(%rsp), %r8d
movq %rbp, %r9
callq 0x6a4a7
testl %eax, %eax
js 0x792b6
movq 0x10(%rsp), %rax
cmpl %eax, 0x4(%rbp)
jne 0x792b6
movl 0x50(%rsp), %eax
cmpl %eax, 0x8(%rbp)
je 0x792c3
incq %rbx
addq $0x28, %r15
jmp 0x79240
xorl %eax, %eax
jmp 0x792c6
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: detect_exact_ovec(ma_utg_t*, asg_t*, ma_hit_t_alloc*, ma_sub_t*, kvec_asg_arc_t_warp*, int, int, unsigned int, unsigned int)
uint32_t detect_exact_ovec(ma_utg_t* collection, asg_t* read_g, ma_hit_t_alloc* sources, 
ma_sub_t *coverage_cut, kvec_asg_arc_t_warp* edge, int max_hang, int min_ovlp,
uint32_t src, uint32_t dest_idx)
{
    asg_arc_t *t = NULL, i_t;
    uint32_t i, k, dest;
    for (i = dest_idx; i < collection->n; i++)
    {
        t = NULL;
        dest = (uint64_t)(collection->a[i])>>32;
        if(get_edge_from_source(sources, coverage_cut, NULL, max_hang, min_ovlp, src, dest, &i_t) == 0)
        {
            for (k = 0; k < edge->a.n; k++)
            {
                if(edge->a.a[k].del) continue;
                if((edge->a.a[k].ul>>32) == src && edge->a.a[k].v == dest)
                {
                    t = &(edge->a.a[k]);
                    break;
                }
            }
        }
        else
        {
            t = &i_t;
        }

        if(t == NULL) return (uint32_t)-1;
        if(t->el != 1) continue;
        return i;
    }

    return (uint32_t)-1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, 0xc(%rsp)
movq %r8, %r14
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rdi, %r13
movl 0x80(%rsp), %ebx
movl 0x78(%rsp), %ebp
movl 0x10(%r13), %eax
cmpq %rax, %rbx
jae 0x79da0
movq 0x18(%r13), %rax
movl 0x4(%rax,%rbx,8), %r15d
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl 0xc(%rsp), %ecx
movl 0x70(%rsp), %r8d
movl %ebp, %r9d
leaq 0x20(%rsp), %r12
pushq %r12
pushq %r15
callq 0x79204
popq %rcx
popq %rdx
testl %eax, %eax
je 0x79d6f
cmpb $0x1, 0x12(%r12)
je 0x79db2
incq %rbx
jmp 0x79d26
movq (%r14), %rax
xorl %ecx, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jbe 0x79da0
movq 0x10(%r14), %r12
imulq $0x18, %rcx, %rsi
cmpl $0x0, 0xc(%r12,%rsi)
js 0x79d9c
addq %rsi, %r12
cmpl %ebp, 0x4(%r12)
jne 0x79d9c
cmpl %r15d, 0x8(%r12)
je 0x79d62
incl %ecx
jmp 0x79d74
pushq $-0x1
popq %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebx, %eax
jmp 0x79da3
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_specific_edge(ma_hit_t_alloc*, ma_sub_t*, R_to_U*, kvec_asg_arc_t_warp*, asg_t*, int, int, unsigned int, unsigned int, asg_arc_t*)
void get_specific_edge(ma_hit_t_alloc* sources, ma_sub_t *coverage_cut, 
R_to_U* ruIndex, kvec_asg_arc_t_warp* edge, asg_t* read_g, int max_hang, 
int min_ovlp, uint32_t query, uint32_t target, asg_arc_t* t)
{
    uint32_t nv, k;
    (*t).ul = (uint64_t)-1; (*t).v = (uint32_t)-1;
    if(read_g)
    {
        asg_arc_t* av = asg_arc_a(read_g, query);
        nv = asg_arc_n(read_g, query);
        for (k = 0; k < nv; k++)
        {
            if(av[k].del) continue;
            if(av[k].v == target) 
            {
                (*t) = av[k];
                break;
            }
        }
    }

    if((*t).ul == (uint64_t)-1)
    {
        if(get_edge_from_source(sources, coverage_cut, NULL, max_hang, min_ovlp, query, target, t)==0)
        {
            (*t).ul = (uint64_t)-1;
        }
    }
    
    if((*t).ul == (uint64_t)-1)
    {
        for (k = 0; k < edge->a.n; k++)
        {
            if(edge->a.a[k].del) continue;
            if((edge->a.a[k].ul>>32) == query && edge->a.a[k].v == target)
            {
                (*t) = edge->a.a[k];
                break;
            }
        }
        if(k == edge->a.n) fprintf(stderr, "ERROR\n");
    }

}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %rdx
movq 0x48(%rsp), %r14
movl 0x40(%rsp), %r15d
movl 0x38(%rsp), %eax
movl 0x30(%rsp), %r8d
orq $-0x1, (%r14)
movq %rcx, %rbx
orl $-0x1, 0x8(%r14)
movl %eax, %r12d
testq %rdx, %rdx
je 0x79e44
movq 0x8(%rdx), %rcx
movq 0x28(%rdx), %rdx
movq (%rdx,%r12,8), %rdx
movl %edx, %r10d
shrq $0x20, %rdx
imulq $0x18, %r10, %r11
imulq $0x18, %rdx, %rdx
leaq (%rdx,%rcx), %r13
addq $0xc, %r13
xorl %r10d, %r10d
cmpq %r10, %r11
je 0x79e44
cmpl $0x0, (%r13,%r10)
js 0x79e23
cmpl %r15d, -0x4(%r13,%r10)
je 0x79e29
addq $0x18, %r10
jmp 0x79e0f
addq %rcx, %rdx
movups (%r10,%rdx), %xmm0
movups %xmm0, (%r14)
movq 0x10(%r10,%rdx), %rcx
movq %rcx, 0x10(%r14)
cmpq $-0x1, (%r14)
jne 0x79eaa
movl %r9d, %ecx
movl %eax, %r9d
pushq %r14
pushq %r15
callq 0x79204
popq %rcx
popq %rdx
testl %eax, %eax
je 0x79e61
cmpq $-0x1, (%r14)
jne 0x79eaa
jmp 0x79e65
orq $-0x1, (%r14)
movq (%rbx), %rcx
xorl %eax, %eax
movl %eax, %eax
cmpq %rax, %rcx
jbe 0x79ea5
movq 0x10(%rbx), %rdx
imulq $0x18, %rax, %rsi
cmpl $0x0, 0xc(%rdx,%rsi)
js 0x79e8f
addq %rsi, %rdx
cmpl %r12d, 0x4(%rdx)
jne 0x79e8f
cmpl %r15d, 0x8(%rdx)
je 0x79e93
incl %eax
jmp 0x79e6a
movq 0x10(%rdx), %rcx
movq %rcx, 0x10(%r14)
movups (%rdx), %xmm0
movups %xmm0, (%r14)
movq (%rbx), %rcx
cmpq %rax, %rcx
je 0x79eb4
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x1d9125(%rip), %rax    # 0x252fe0
movq (%rax), %rcx
leaq 0x170ebf(%rip), %rdi    # 0x1ead84
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2410
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: cal_circle_ov(ma_ug_t const*, unsigned int, unsigned int, asg_t*)
uint32_t cal_circle_ov(const ma_ug_t *ug, uint32_t uid, uint32_t rev, asg_t *sg)
{
    uint32_t v, w, vx, wx, k;
    v = w = (uid<<1)+(!!rev);
    vx = (v&1?((ug->u.a[v>>1].a[0]>>32)^1):(ug->u.a[v>>1].a[ug->u.a[v>>1].n-1]>>32));
    wx = (w&1?((ug->u.a[w>>1].a[ug->u.a[w>>1].n-1]>>32)^1):(ug->u.a[w>>1].a[0]>>32));
    v = vx; w = wx;

    if(sg) {
        asg_arc_t *av; uint32_t nv;
        av = asg_arc_a(sg, vx); nv = asg_arc_n(sg, vx);
        for (k = 0; k < nv; k++) {
            if(av[k].v == wx) return av[k].ol;
        }
    }
    return 0;
}

// Assembly:
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq 0x10(%rdi), %rdi
testl %edx, %edx
je 0x7c650
imulq $0x28, %rsi, %rdx
movq 0x18(%rdi,%rdx), %rsi
movl 0x4(%rsi), %eax
xorq $0x1, %rax
movl 0x10(%rdi,%rdx), %edx
decl %edx
movl 0x4(%rsi,%rdx,8), %edx
xorq $0x1, %rdx
jmp 0x7c666
imulq $0x28, %rsi, %rax
movq 0x18(%rdi,%rax), %rdx
movl 0x10(%rdi,%rax), %eax
decl %eax
movl 0x4(%rdx,%rax,8), %eax
movl 0x4(%rdx), %edx
testq %rcx, %rcx
je 0x7c6b6
movq 0x8(%rcx), %rsi
movq 0x28(%rcx), %rcx
movq (%rcx,%rax,8), %rax
movl %eax, %ecx
shrq $0x20, %rax
imulq $0x18, %rcx, %rdi
addq $0x18, %rdi
imulq $0x18, %rax, %rcx
leaq (%rcx,%rsi), %r8
addq $0x8, %r8
xorl %eax, %eax
xorl %r10d, %r10d
leaq 0x18(%r10), %r9
cmpq %r9, %rdi
je 0x7c6b5
cmpl %edx, (%r8,%r10)
movq %r9, %r10
jne 0x7c696
addq %rsi, %rcx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl -0xc(%r9,%rcx), %eax
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: prt_scaf_stats(sec_t*, ma_ug_t*, char const*, unsigned long)
void prt_scaf_stats(sec_t *scp, ma_ug_t *ctg, const char* prefix, uint64_t id)
{
    uint64_t k, tl0, tl1; ma_utg_t *z = NULL; char name[32];
    for (k = tl0 = tl1 = 0; k < scp->n; k++) {
        z = &(ctg->u.a[((uint32_t)scp->a[k])>>1]); tl0 += z->len; tl1 += (scp->a[k]>>32);
    }
    sprintf(name, "%s%.6lu%c", prefix, id + 1, "lc"[scp->is_c]);

    fprintf(stderr, "[M::%s] [M::%s] tot::%lu\tel::%lu\tnl::%lu\tis_c::%lu\t#::%lu\t%s\n", __func__, name, tl0+tl1, tl0, tl1, scp->is_c, (uint64_t)scp->n, ((scp->n>1)?"scf":"ctg"));
    for (k = 0; k < scp->n; k++) {
        z = &(ctg->u.a[((uint32_t)scp->a[k])>>1]);
        fprintf(stderr, "%s%.6u%c(%c)\tlen::%u\tNs::%lu\n", 
        prefix, (((uint32_t)scp->a[k])>>1)+1, "lc"[z->circ], "+-"[(((uint32_t)scp->a[k])&1)], z->len, (scp->a[k]>>32));
    }
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %rax
xorl %edx, %edx
xorl %r12d, %r12d
xorl %ebp, %ebp
cmpq %rdx, %rax
je 0x7cda6
movq 0x10(%r14), %rsi
movq 0x18(%r15), %rdi
movq (%rdi,%rdx,8), %rdi
movl %edi, %r8d
shrl %r8d
imulq $0x28, %r8, %r8
movl (%rsi,%r8), %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
addq %rsi, %r12
shrq $0x20, %rdi
addq %rdi, %rbp
incq %rdx
jmp 0x7cd72
incq %rcx
movq 0x10(%r15), %rax
leaq 0x1698d7(%rip), %rdx    # 0x1e668b
movsbl (%rax,%rdx), %r8d
leaq 0x16b652(%rip), %rsi    # 0x1e8412
movq %rsp, %r13
movq %r13, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2050
movq 0x1d6209(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq (%r12,%rbp), %r8
movq 0x8(%r15), %r10
cmpq $0x2, %r10
leaq 0x16b67c(%rip), %rax    # 0x1e8469
leaq 0x16b679(%rip), %r11    # 0x1e846d
cmovaeq %rax, %r11
leaq 0x16b61d(%rip), %rsi    # 0x1e841c
leaq 0x16b654(%rip), %rdx    # 0x1e845a
movq %r13, %rcx
movq %r12, %r9
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x10(%r15)
pushq %rbp
callq 0x22b0
addq $0x20, %rsp
leaq 0x1673fc(%rip), %r13    # 0x1e4223
leaq 0x16b643(%rip), %r12    # 0x1e8471
xorl %ebp, %ebp
cmpq 0x8(%r15), %rbp
jae 0x7ce9b
movq 0x10(%r14), %rax
movq 0x18(%r15), %rcx
movq (%rcx,%rbp,8), %r10
movl %r10d, %ecx
shrl %ecx
imulq $0x28, %rcx, %rdx
movq 0x1d618e(%rip), %rsi    # 0x252fe0
movq (%rsi), %rdi
incl %ecx
movl (%rax,%rdx), %r11d
movl %r11d, %eax
shrl $0x1f, %eax
leaq 0x169823(%rip), %rdx    # 0x1e668b
movsbl (%rax,%rdx), %r8d
movl %r10d, %eax
andl $0x1, %eax
movsbl (%rax,%r13), %r9d
andl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
shrq $0x20, %r10
movq %r12, %rsi
movq %rbx, %rdx
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x22b0
popq %rcx
popq %rdx
incq %rbp
jmp 0x7ce30
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: asg_cut_internal(asg_t*, int)
int asg_cut_internal(asg_t *g, int max_ext)
{
	asg64_v a = {0,0,0};
	uint32_t n_vtx = g->n_seq * 2, v, i, cnt = 0;
	for (v = 0; v < n_vtx; ++v) {
		if (g->seq[v>>1].del) continue;
		if (asg_is_utg_end(g, v, 0) != ASG_ET_MULTI_NEI) continue;
		if (asg_extend(g, v, max_ext, &a) != ASG_ET_MULTI_NEI) continue;
		/**
		 * so combining the last two lines, they are designed to reomve(n(1), n(2))?
							   ----->              <-------
							  |                		      |
							 n(0)--->n(1)---->n(2)---->n(3)
							  |                           |
							   ------>             <-------       
		**/
		for (i = 0; i < a.n; ++i)
			asg_seq_del(g, (uint32_t)a.a[i]>>1);
		++cnt;
	}
	free(a.a);
	if (cnt > 0) asg_cleanup(g);
	fprintf(stderr, "[M::%s] cut %d internal sequences\n", __func__, cnt);
	return cnt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebp
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r15
movaps %xmm0, (%r15)
andq $0x0, 0x10(%r15)
movl 0x14(%rdi), %r13d
addl %r13d, %r13d
xorl %r12d, %r12d
xorl %ebx, %ebx
movl %esi, 0x8(%rsp)
cmpl %r13d, %r12d
je 0x7d5ad
movq 0x20(%r14), %rax
movl %r12d, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0x7d5a8
movq %r14, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x6bf48
cmpl $0x3, %eax
jne 0x7d5a8
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movq %r15, %rcx
callq 0x6be7f
cmpl $0x3, %eax
jne 0x7d5a8
movl %ebx, 0xc(%rsp)
movq 0x10(%rsp), %r15
movq 0x20(%rsp), %rbx
xorl %eax, %eax
movl %eax, %ebp
cmpq %rbp, %r15
jbe 0x7d599
movl (%rbx,%rbp,8), %esi
shrl %esi
movq %r14, %rdi
callq 0x6f8da
leal 0x1(%rbp), %eax
jmp 0x7d580
movl 0xc(%rsp), %ebx
incl %ebx
movl 0x8(%rsp), %ebp
leaq 0x10(%rsp), %r15
incl %r12d
jmp 0x7d535
movq 0x20(%rsp), %rdi
callq 0x2220
testl %ebx, %ebx
je 0x7d5c3
movq %r14, %rdi
callq 0x694eb
movq 0x1d5a16(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0x16af4f(%rip), %rsi    # 0x1e8523
leaq 0x16af6b(%rip), %rdx    # 0x1e8546
movl %ebx, %ecx
xorl %eax, %eax
callq 0x22b0
movl %ebx, %eax
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: reset_weak_ovlp(ma_hit_t_alloc*, unsigned int, unsigned int)
uint32_t reset_weak_ovlp(ma_hit_t_alloc *sc, uint32_t src, uint32_t dst)
{
    ma_hit_t_alloc *x = &(sc[src]); uint32_t k, tn; int32_t idx;
    for (k = 0; k < x->length; k++) {
        if((x->buffer[k].bl&((uint32_t)0x40000000))) continue;
        if((x->buffer[k].del)) continue;
        tn = Get_tn(x->buffer[k]);
        if((Get_ts(x->buffer[k]) == 0) && (Get_te(x->buffer[k]) == Get_READ_LENGTH(R_INF, tn))) {
            idx = get_specific_overlap(&(sc[tn]), tn, dst);
            if((idx >= 0) && (!(sc[tn].buffer[idx].del)) && (!(sc[tn].buffer[idx].bl&((uint32_t)0x40000000)))) {
                return 1;
            }
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, 0x4(%rsp)
movabsq $0x4000000000000000, %r13 # imm = 0x4000000000000000
movl %esi, %eax
imulq $0x18, %rax, %rax
leaq (%rdi,%rax), %rbp
movq %rdi, 0x10(%rsp)
movl 0xc(%rdi,%rax), %r15d
leaq 0x1d6c04(%rip), %rax    # 0x254230
movq 0x18(%rax), %rdx
pushq $0x18
popq %r14
xorl %ebx, %ebx
movq %rdx, 0x8(%rsp)
cmpq %r15, %rbx
jae 0x7d69d
movq (%rbp), %rax
cmpq %r13, (%rax,%r14)
jae 0x7d694
cmpl $0x0, -0x8(%rax,%r14)
jne 0x7d694
movl -0xc(%rax,%r14), %esi
movl -0x4(%rax,%r14), %eax
cmpq %rax, (%rdx,%rsi,8)
jne 0x7d694
imulq $0x18, %rsi, %r12
addq 0x10(%rsp), %r12
movq %r12, %rdi
movl 0x4(%rsp), %edx
callq 0x696ab
movq 0x8(%rsp), %rdx
testl %eax, %eax
js 0x7d694
movq (%r12), %rcx
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
imulq $0x28, %rax, %rax
cmpq %r13, 0x18(%rcx,%rax)
jb 0x7d6ae
incq %rbx
addq $0x28, %r14
jmp 0x7d63b
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rax
jmp 0x7d69f
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: update_weak_by_contain(void*, long, int)
static void update_weak_by_contain(void *data, long i, int tid)
{
    sset_aux *sl = (sset_aux *)data;
    ma_hit_t_alloc *x = &(sl->src[i]);
    uint32_t k, qn, tn; int32_t idx;
    if(sl->ul_occ == 0) {
        for (k = 0; k < x->length; k++) {
            if(x->buffer[k].bl&((uint32_t)0x40000000)) x->buffer[k].del = 1;
        }
    } else if(sl->ul_occ == 1) {
        for (k = 0; k < x->length; k++) {
            qn = Get_qn(x->buffer[k]);
            tn = Get_tn(x->buffer[k]);
            if(qn > tn) continue;
            if((x->buffer[k].del) && (x->buffer[k].bl&((uint32_t)0x40000000))) {
                if(reset_weak_ovlp(sl->src, qn, tn)) {
                    idx = get_specific_overlap(&(sl->src[tn]), tn, qn);
                    sl->src[tn].buffer[idx].del = x->buffer[k].del = 0;
                }
            }            
        }
    } else {
        for (k = 0; k < x->length; k++) {
            if(x->buffer[k].bl&((uint32_t)0x40000000)) {
                x->buffer[k].bl -= ((uint32_t)0x40000000);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
imulq $0x18, %rsi, %r12
addq 0x8(%rdi), %r12
movq %rdi, 0x8(%rsp)
movq 0x30(%rdi), %rax
testq %rax, %rax
je 0x7d95d
cmpq $0x1, %rax
jne 0x7d9a3
pushq $0x18
popq %r13
xorl %ebx, %ebx
movl 0xc(%r12), %eax
cmpq %rax, %rbx
jae 0x7d9e3
movq (%r12), %r15
movl -0x14(%r15,%r13), %ebp
movl -0xc(%r15,%r13), %r14d
cmpl %ebp, %r14d
jb 0x7d951
movq (%r15,%r13), %rcx
movabsq $-0x4000000000000001, %rax # imm = 0xBFFFFFFFFFFFFFFF
movq %rcx, 0x20(%rsp)
cmpq %rax, %rcx
jbe 0x7d951
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movq %rdi, 0x18(%rsp)
movl %ebp, %esi
movl %r14d, %edx
callq 0x7d5f5
testl %eax, %eax
je 0x7d951
imulq $0x18, %r14, %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
addq %rax, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x696ab
movabsq $0x7fffffffffffffff, %rdx # imm = 0x7FFFFFFFFFFFFFFF
movq 0x20(%rsp), %rcx
andq %rdx, %rcx
movq %rcx, (%r15,%r13)
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0x10(%rsp), %rsi
movq (%rcx,%rsi), %rcx
cltq
imulq $0x28, %rax, %rax
andq %rdx, 0x18(%rcx,%rax)
incq %rbx
addq $0x28, %r13
jmp 0x7d8aa
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
movabsq $0x4000000000000000, %rdx # imm = 0x4000000000000000
imulq $0x28, %rax, %rsi
addq $0x18, %rsi
incq %rcx
movl 0xc(%r12), %edi
cmpq %rdi, %rax
jae 0x7d9e3
movq (%r12), %rdi
movq (%rdi,%rsi), %r8
testq %rdx, %r8
je 0x7d99a
orq %rcx, %r8
movq %r8, (%rdi,%rsi)
incq %rax
addq $0x28, %rsi
jmp 0x7d97c
movabsq $-0x4000000000000001, %rax # imm = 0xBFFFFFFFFFFFFFFF
pushq $0x18
popq %rcx
movabsq $0x4000000000000000, %rdx # imm = 0x4000000000000000
xorl %esi, %esi
movl 0xc(%r12), %edi
cmpq %rdi, %rsi
jae 0x7d9e3
movq (%r12), %rdi
movq (%rdi,%rcx), %r8
testq %rdx, %r8
je 0x7d9da
andq %rax, %r8
movq %r8, (%rdi,%rcx)
incq %rsi
addq $0x28, %rcx
jmp 0x7d9bc
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: ma_ug_print_bed(ma_ug_t const*, asg_t*, All_reads*, ma_sub_t*, ma_hit_t_alloc*, kvec_asg_arc_t_warp*, int, int, unsigned int, char const*, _IO_FILE*, trans_chain*)
void ma_ug_print_bed(const ma_ug_t *g, asg_t *read_g, All_reads *RNF, ma_sub_t *coverage_cut,
ma_hit_t_alloc* sources, kvec_asg_arc_t_warp* edge, int max_hang, int min_ovlp, uint32_t rate_thres,
const char* prefix, FILE *fp, trans_chain* t_ch)
{
	UC_Read g_read;
    init_UC_Read(&g_read);
    UC_Read tmp;
    init_UC_Read(&tmp);
    kvec_t_u32_warp exact_count, total_count;
    kv_init(exact_count.a);
    kv_init(total_count.a);
    uint32_t i, j, l, eLen, start;
    for (i = 0; i < g->u.n; ++i) {
		ma_utg_t *u = &g->u.a[i];
        if(u->m == 0) continue;
        if(u->n < 2) continue;
        l = 0;
        for (j = 0; j < u->n; ++j) 
        {
            start = l;
            eLen = (uint32_t)u->a[j];
			l += eLen;

            print_rough_inconsistent_sites(u, j, j+1, read_g, RNF, sources, coverage_cut, 
            edge, &g_read, &tmp, max_hang, min_ovlp, start, rate_thres, &exact_count, 
            &total_count, prefix, i+1, fp, t_ch? &(t_ch->bed.a[i]): NULL);
        }
    }

    destory_UC_Read(&g_read);
    destory_UC_Read(&tmp);
    kv_destroy(exact_count.a);
    kv_destroy(total_count.a);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %r9, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %rbx
movq 0x118(%rsp), %r13
leaq 0x98(%rsp), %rdi
callq 0x6bd1
leaq 0x78(%rsp), %rdi
callq 0x6bd1
leaq 0x50(%rsp), %rax
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
leaq 0x30(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
xorl %r14d, %r14d
movq %rbx, (%rsp)
movl %r14d, %r14d
cmpq %r14, (%rbx)
jbe 0x7e01c
movq 0x10(%rbx), %rbp
imulq $0x28, %r14, %rax
cmpl $0x0, 0xc(%rbp,%rax)
je 0x7df52
addq %rax, %rbp
movl 0x10(%rbp), %ecx
cmpl $0x2, %ecx
jae 0x7df5b
incl %r14d
movq (%rsp), %rbx
jmp 0x7df2c
leal 0x1(%r14), %r15d
xorl %esi, %esi
imulq $0x18, %r14, %r12
xorl %eax, %eax
movl %ecx, %ecx
cmpq %rcx, %rsi
jae 0x7df52
testq %r13, %r13
je 0x7df7c
movq 0x30(%r13), %r10
addq %r12, %r10
jmp 0x7df7f
xorl %r10d, %r10d
movq 0x18(%rbp), %rcx
movl (%rcx,%rsi,8), %r13d
addl %eax, %r13d
leaq 0x1(%rsi), %rbx
movq %rbp, %rdi
movl %ebx, %edx
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %r8
movq 0x20(%rsp), %r9
pushq %r10
pushq 0x118(%rsp)
pushq %r15
pushq 0x120(%rsp)
leaq 0x50(%rsp), %r10
pushq %r10
leaq 0x78(%rsp), %r10
pushq %r10
movl 0x130(%rsp), %r10d
pushq %r10
pushq %rax
movl 0x138(%rsp), %eax
pushq %rax
movl 0x138(%rsp), %eax
pushq %rax
leaq 0xc8(%rsp), %rax
pushq %rax
leaq 0xf0(%rsp), %rax
pushq %rax
pushq 0x88(%rsp)
pushq 0x80(%rsp)
callq 0x7a535
addq $0x70, %rsp
movl 0x10(%rbp), %ecx
movq %rbx, %rsi
movl %r13d, %eax
movq 0x118(%rsp), %r13
jmp 0x7df67
leaq 0x98(%rsp), %rdi
callq 0x6b07
leaq 0x78(%rsp), %rdi
callq 0x6b07
movq 0x60(%rsp), %rdi
callq 0x2220
movq 0x40(%rsp), %rdi
callq 0x2220
addq $0xb8, %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: push_cov_interval_direct(kvec_t_u64_warp*, long long, long long, long long, unsigned long)
uint32_t push_cov_interval_direct(kvec_t_u64_warp* a, long long x_beg, long long x_end, long long utg_len, uint64_t is_circle)
{
    if(x_beg <= x_end && x_beg >= 0 && x_end >= 0 && x_beg < utg_len && x_end < utg_len)
    {
        uint64_t key;
        key = x_beg; key <<= 1; key |= (!is_circle); key <<= 1; key|=1;
        kv_push(uint64_t, a->a, key);
        key = x_end + 1; key <<= 1; key |= (!is_circle); key <<= 1; 
        kv_push(uint64_t, a->a, key);
        return 1;
    }
    return 0;
}

// Assembly:
xorl %eax, %eax
cmpq %rcx, %rdx
jge 0x7e29b
cmpq %rcx, %rsi
jge 0x7e29b
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
cmpq %rdx, %rsi
jg 0x7e292
movq %r14, %rcx
orq %rsi, %rcx
js 0x7e292
movq %rdi, %rbx
xorl %r15d, %r15d
testq %r8, %r8
sete %r15b
shlq $0x2, %rsi
leaq (%rsi,%r15,2), %r13
incq %r13
movq (%rdi), %rcx
pushq $0x2
popq %r12
cmpq 0x8(%rdi), %rcx
jne 0x7e23f
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
cmoveq %r12, %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
jmp 0x7e243
movq 0x10(%rbx), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movq %r13, (%rax,%rcx,8)
addl %r15d, %r15d
leaq (%r15,%r14,4), %r14
addq $0x4, %r14
movq (%rbx), %rcx
cmpq 0x8(%rbx), %rcx
jne 0x7e284
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
cmoveq %r12, %rsi
movq %rsi, 0x8(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movq %r14, (%rax,%rcx,8)
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: push_cov_interval_advance(kvec_t_u64_warp*, long long, long long, long long, unsigned int)
uint32_t push_cov_interval_advance(kvec_t_u64_warp* a, long long x_beg, long long x_end, long long utg_len, uint32_t is_circle)
{
    if(x_beg > x_end) return 0;
    
    if(push_cov_interval_direct(a, x_beg, x_end, utg_len, 0)) return 1;
    

    if(x_beg < 0 && x_end < 0)
    {
        x_beg = utg_len + x_beg;
        x_end = utg_len + x_end;
        return push_cov_interval_direct(a, x_beg, x_end, utg_len, 0);
    }

    if(x_beg >= utg_len && x_end >= utg_len)
    {
        x_beg = x_beg - utg_len;
        x_end = x_end - utg_len;
        return push_cov_interval_direct(a, x_beg, x_end, utg_len, 0);
    }

    if(x_beg < 0 && x_end >= 0)
    {
        x_beg = utg_len + x_beg;
        if(push_cov_interval_direct(a, x_beg, utg_len - 1, utg_len, is_circle) || 
             push_cov_interval_direct(a, 0, x_end, utg_len, is_circle))
        {
            return 1;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebp, %ebp
cmpq %rdx, %rsi
jg 0x7e2cc
movl %r8d, %r13d
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
xorl %r8d, %r8d
callq 0x7e1c0
pushq $0x1
popq %rbp
testl %eax, %eax
je 0x7e2dd
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r12, %r14
js 0x7e334
movq %r12, %rsi
subq %rbx, %rsi
jge 0x7e342
testq %r12, %r12
setns %al
testq %r14, %r14
sets %cl
orb %al, %cl
jne 0x7e330
addq %rbx, %r12
leaq -0x1(%rbx), %rdx
movl %r13d, %r13d
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rcx
movq %r13, %r8
callq 0x7e1c0
testl %eax, %eax
jne 0x7e2cc
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %rcx
movq %r13, %r8
callq 0x7e1c0
testl %eax, %eax
jne 0x7e2cc
xorl %ebp, %ebp
jmp 0x7e2cc
addq %rbx, %r12
addq %rbx, %r14
movq %r15, %rdi
movq %r12, %rsi
jmp 0x7e348
subq %rbx, %r14
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7e1c0
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: debug_r_contig_pos(ma_utg_t*, unsigned int, All_reads*)
void debug_r_contig_pos(ma_utg_t *u, uint32_t tn, All_reads *RNF)
{
    uint32_t c_beg, c_end, l, k;
    for (k = l = 0; k < u->n; k++)
    {
        c_beg = l;
        c_end = c_beg + Get_READ_LENGTH((*RNF), (u->a[k]>>33));
        l += (uint32_t)u->a[k];
        if((u->a[k]>>33) == tn)
        {
            fprintf(stderr, "#####c_beg: %u, c_end: %u\n", c_beg, c_end);
            break;
        }
    }
}

// Assembly:
movq %rdx, %rax
movl 0x10(%rdi), %r8d
movl %esi, %ecx
xorl %esi, %esi
xorl %edx, %edx
cmpq %rsi, %r8
je 0x7e532
movq 0x18(%rdi), %r9
movq (%r9,%rsi,8), %r9
movq %r9, %r10
shrq $0x21, %r10
cmpl %ecx, %r10d
je 0x7e533
addl %r9d, %edx
incq %rsi
jmp 0x7e511
retq
movq 0x18(%rax), %rax
movl (%rax,%rcx,8), %ecx
addl %edx, %ecx
movq 0x1d4a9d(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0x16a197(%rip), %rsi    # 0x1e86e4
xorl %eax, %eax
jmp 0x22b0
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_overlap_contig_dir(unsigned int, unsigned int, ma_hit_t*, All_reads*, long long, unsigned int, unsigned int)
uint32_t get_overlap_contig_dir(uint32_t v, uint32_t tn, ma_hit_t *h, All_reads *RNF, long long ctg_beg,
uint32_t p_beg, uint32_t p_end)
{
    long long qs, qe, ts, te, c_beg, c_end;

    qs = Get_qs((*h)); qe = Get_qe((*h)) - 1;
    ts = Get_ts((*h)); te = Get_te((*h)) - 1;
    if(h->rev)
    {
        ts = (long long)(Get_READ_LENGTH((*RNF), tn)) - ((long long)(Get_te((*h))) - 1) - 1;
        te = (long long)(Get_READ_LENGTH((*RNF), tn)) - (long long)(Get_ts((*h))) - 1;
    }
    ts = qs - ts;
    te = qe + ((long long)(Get_READ_LENGTH((*RNF), tn)) - te - 1);
    c_beg = ts; c_end = te;

    if(v&1)
    {
        ts = (long long)(Get_READ_LENGTH((*RNF), v>>1)) - ts - 1;
        te = (long long)(Get_READ_LENGTH((*RNF), v>>1)) - te - 1;
        c_beg = te; c_end = ts;
    }

    c_end++;
    c_beg += ctg_beg; c_end += ctg_beg;

    if((p_beg != p_end && c_beg <= p_beg && c_end >= p_end) || 
                    (p_beg == p_end && c_beg < p_beg && c_end > p_end))
    {
        return 2;
    }

    if(c_beg < p_beg) return 0;
    if(c_end > p_end) return 1;

    return 2;

}

// Assembly:
pushq %rbx
movl (%rdx), %r10d
movl 0x8(%rdx), %r11d
decl %r11d
movl 0x10(%rdx), %ebx
movl 0x14(%rdx), %eax
testb $-0x80, 0x1b(%rdx)
jne 0x7e579
decl %eax
movq 0x18(%rcx), %rdx
movl %esi, %ecx
movq (%rdx,%rcx,8), %rcx
jmp 0x7e595
movq 0x18(%rcx), %rdx
movl %esi, %ecx
movq (%rdx,%rcx,8), %rcx
movq %rcx, %rsi
subq %rax, %rsi
notq %rbx
movq %rbx, %rax
addq %rcx, %rax
movq %rsi, %rbx
addq %rcx, %r11
subq %rbx, %r10
movl 0x10(%rsp), %ecx
notq %rax
addq %r11, %rax
testb $0x1, %dil
je 0x7e5c6
shrl %edi
movq (%rdx,%rdi,8), %rdx
notq %r10
movq %r10, %rsi
addq %rdx, %rsi
notq %rax
addq %rdx, %rax
movq %rax, %r10
movq %rsi, %rax
addq %r8, %r10
leaq (%r8,%rax), %rsi
incq %rsi
movl %r9d, %edx
movl %ecx, %edi
movl $0x2, %eax
cmpl %ecx, %r9d
je 0x7e5e9
cmpq %rdx, %r10
jg 0x7e5e9
cmpq %rdi, %rsi
jge 0x7e60a
cmpl %ecx, %r9d
jne 0x7e5f8
cmpq %rdx, %r10
jge 0x7e5f8
cmpq %rdi, %rsi
jg 0x7e60a
xorl %ecx, %ecx
cmpq %rdi, %rsi
setle %cl
incl %ecx
xorl %eax, %eax
cmpq %rdx, %r10
cmovgel %ecx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: push_sub_unitig(ma_ug_t*, ma_utg_t*, asg_t*, kvec_asg_arc_t_warp*, unsigned int, unsigned int)
void push_sub_unitig(ma_ug_t *n_ug, ma_utg_t *src_u, asg_t *read_g, kvec_asg_arc_t_warp* edge, 
uint32_t beg_idx, uint32_t occ)
{
    uint32_t i;
    uint64_t totalLen;
    ma_utg_t* p = NULL;
    kv_pushp(ma_utg_t, n_ug->u, &p);
    p->s = NULL;
    p->n = occ;
    p->circ = 0;
    if(beg_idx == 0 && occ == src_u->n) p->circ = src_u->circ;
    p->m = p->n;
    p->a = (uint64_t*)malloc(8 * p->m);
    for (i = 0; i < occ; i++) p->a[i] = src_u->a[beg_idx+i];
    fill_unitig(p->a, occ, read_g, edge, p->circ, &totalLen);
    p->len = totalLen;
    if(!p->circ)
    {
        p->start = p->a[0]>>32;
        p->end = (p->a[p->n-1]>>32)^1;
    }
    else
    {
        p->start = p->end = UINT32_MAX;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r12d
movl %r8d, %ebp
movq %rcx, 0x8(%rsp)
movq %rdx, (%rsp)
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rcx
cmpq 0x8(%rdi), %rcx
jne 0x7fc54
leaq (%rcx,%rcx), %rax
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmovneq %rax, %rcx
movq %rcx, 0x8(%rbx)
movq 0x10(%rbx), %rdi
imulq $0x28, %rcx, %rsi
callq 0x2370
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
jmp 0x7fc58
movq 0x10(%rbx), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
imulq $0x28, %rcx, %rcx
andq $0x0, 0x20(%rax,%rcx)
movl %r12d, %r13d
leaq (%rax,%rcx), %r14
movl %r12d, 0x10(%rax,%rcx)
movl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
andl (%rax,%rcx), %ebx
movl %ebx, (%rax,%rcx)
testl %ebp, %ebp
jne 0x7fc97
cmpl %r12d, 0x10(%r15)
jne 0x7fc97
movl $0x80000000, %eax       # imm = 0x80000000
andl (%r15), %eax
orl %eax, %ebx
movl %ebx, (%r14)
movl %r12d, 0xc(%r14)
shll $0x3, %r12d
movq %r12, %rdi
callq 0x2280
movq %rax, 0x18(%r14)
movl %ebp, %ecx
xorl %edx, %edx
cmpq %rdx, %r13
je 0x7fcc8
movq 0x18(%r15), %rsi
leal (%rcx,%rdx), %edi
movq (%rsi,%rdi,8), %rsi
movq %rsi, (%rax,%rdx,8)
incq %rdx
jmp 0x7fcaf
shrl $0x1f, %ebx
leaq 0x10(%rsp), %r15
movq %rax, %rdi
movl %r13d, %esi
movq (%rsp), %rdx
movq 0x8(%rsp), %rcx
movl %ebx, %r8d
movq %r15, %r9
callq 0xcfa82
movl (%r14), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl (%r15), %ecx
movl %eax, %edx
andl $0x80000000, %edx       # imm = 0x80000000
orl %ecx, %edx
movl %edx, (%r14)
testl %eax, %eax
js 0x7fd1c
movq 0x18(%r14), %rcx
movl 0x4(%rcx), %eax
movl 0x10(%r14), %edx
decl %edx
movl 0x4(%rcx,%rdx,8), %ecx
xorl $0x1, %ecx
jmp 0x7fd21
pushq $-0x1
popq %rax
movl %eax, %ecx
movl %eax, 0x4(%r14)
movl %ecx, 0x8(%r14)
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: renew_utg(ma_ug_t**, asg_t*, kvec_asg_arc_t_warp*)
void renew_utg(ma_ug_t **ug, asg_t* read_g, kvec_asg_arc_t_warp* edge)
{
    ma_ug_t* high_level_ug = NULL;
    asg_t* nsg = (*ug)->g;
    uint32_t i;
    ma_utg_t *u;
    high_level_ug = ma_ug_gen(nsg);
    for (i = 0; i < high_level_ug->u.n; i++)
    {
        high_level_ug->g->seq[i].c = PRIMARY_LABLE;
        u = &(high_level_ug->u.a[i]);
        if(u->m == 0) continue;
        merge_unitig_content(u, (*ug), read_g, edge);
        high_level_ug->g->seq[i].len = u->len;
    }
    ma_ug_destroy((*ug));
    (*ug) = high_level_ug;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x18(%rax), %rdi
callq 0x76d91
movq %rax, %r12
movq (%rax), %rbp
xorl %r14d, %r14d
movl %r14d, %r14d
cmpq %r14, %rbp
jbe 0x803bd
movq 0x18(%r12), %r15
movq 0x20(%r15), %rax
movb $0x0, 0x4(%rax,%r14,8)
movq 0x10(%r12), %r13
imulq $0x28, %r14, %rax
cmpl $0x0, 0xc(%r13,%rax)
je 0x803b8
addq %rax, %r13
movq (%rbx), %rsi
movq %r13, %rdi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
callq 0x92252
movl (%r13), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
movq 0x20(%r15), %rcx
movl (%rcx,%r14,8), %edx
movl $0x80000000, %esi       # imm = 0x80000000
andl %esi, %edx
orl %eax, %edx
movl %edx, (%rcx,%r14,8)
incl %r14d
jmp 0x80358
movq (%rbx), %rdi
callq 0x6921d
movq %r12, (%rbx)
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_stats(ma_ug_t*, char const*)
void print_utg_stats(ma_ug_t *ug, const char* command)
{
    uint32_t i;
    uint64_t len, occ_n, occ_m, occ_n_0;
    for (i = len = occ_n = occ_m = occ_n_0 = 0; i < ug->u.n; ++i) {
		ma_utg_t *u = &ug->u.a[i];
        len += u->len;
        occ_n += u->n;
        occ_m += u->m;
        if(u->n == 0) occ_n_0++;
    }

    fprintf(stderr, "%s: len: %lu, occ_n: %lu, occ_m: %lu, occ_n_0: %lu\n", 
                                command, len, occ_n, occ_m, occ_n_0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rdx
movq (%rdi), %rax
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
xorl %esi, %esi
xorl %r10d, %r10d
movl %r10d, %r10d
cmpq %r10, %rax
jbe 0x8042e
movq 0x10(%rdi), %r11
imulq $0x28, %r10, %rbx
movl (%r11,%rbx), %r14d
movl 0xc(%r11,%rbx), %r15d
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
addq %r14, %rcx
movl 0x10(%r11,%rbx), %r11d
addq %r11, %r8
addq %r15, %r9
cmpq $0x1, %r11
adcq $0x0, %rsi
incl %r10d
jmp 0x803f3
movq 0x1d2bab(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
movq %rsi, (%rsp)
leaq 0x16839d(%rip), %rsi    # 0x1e87e0
xorl %eax, %eax
callq 0x22b0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/./Overlaps.h
// Function: asg_seq_drop(asg_t*, unsigned int)
static inline void asg_seq_drop(asg_t *g, uint32_t s)
{
	///s is not at primary
	if(g->seq[s].c == ALTER_LABLE)
	{
		uint32_t k;
		for (k = 0; k < 2; ++k) 
		{
			///two directions of this node
			uint32_t i, v = s<<1 | k;
			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;
				///if output node is at primary
				/****************************may have hap bugs********************************/
				///if(g->seq[(av[i].v>>1)].c == PRIMARY_LABLE)
				///if(g->seq[(av[i].v>>1)].c == PRIMARY_LABLE || g->seq[(av[i].v>>1)].c == HAP_LABLE)
				if(g->seq[(av[i].v>>1)].c != ALTER_LABLE)
				{/****************************may have hap bugs********************************/
					av[i].del = 1;
					asg_arc_del(g, av[i].v^1, v^1, 1);
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movq 0x20(%rdi), %rax
movl %esi, %ecx
cmpb $0x1, 0x4(%rax,%rcx,8)
jne 0x1535b1
addl %esi, %esi
xorl %eax, %eax
cmpq $0x2, %rax
je 0x1535b1
movq %rax, %rcx
orq %rsi, %rcx
movq 0x28(%rdi), %rdx
movq (%rdx,%rcx,8), %r8
movl %r8d, %edx
shrq $0x20, %r8
imulq $0x18, %r8, %r8
addq 0x8(%rdi), %r8
xorl %r9d, %r9d
cmpq %rdx, %r9
je 0x1535a9
imulq $0x18, %r9, %r10
movl 0xc(%r8,%r10), %r11d
testl %r11d, %r11d
js 0x153554
addq %r8, %r10
movq 0x20(%rdi), %r14
movl 0x8(%r10), %ebx
movl %ebx, %r15d
shrl %r15d
cmpb $0x1, 0x4(%r14,%r15,8)
jne 0x153559
incq %r9
jmp 0x153528
orl $0x80000000, %r11d      # imm = 0x80000000
movl %r11d, 0xc(%r10)
xorq $0x1, %rbx
movq 0x8(%rdi), %r10
movq 0x28(%rdi), %r11
movq (%r11,%rbx,8), %r11
movl %r11d, %ebx
shrq $0x20, %r11
imulq $0x18, %r11, %r11
addq %r11, %r10
addq $0xc, %r10
imulq $0x18, %rbx, %r11
xorl %ebx, %ebx
cmpq %rbx, %r11
je 0x153554
movl -0x4(%r10,%rbx), %ebp
xorl %ecx, %ebp
cmpl $0x1, %ebp
jne 0x1535a3
orb $-0x80, 0x3(%r10,%rbx)
addq $0x18, %rbx
jmp 0x15358c
incq %rax
jmp 0x1534fe
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_num_trio_flag(ma_ug_t*, unsigned int, unsigned int)
uint32_t get_num_trio_flag(ma_ug_t *ug, uint32_t v, uint32_t flag)
{
    if(flag == (uint32_t)-1) return 0;
    ma_utg_t* u = NULL;
    asg_t* nsg = ug->g;
    uint32_t k, rId, flag_occ = 0;
    if (nsg->seq[v].del) return 0;
    u = &(ug->u.a[v]);
    if(u->m == 0) return 0;
    for (k = 0; k < u->n; k++)
    {
        rId = u->a[k]>>33;
        if(R_INF.trio_flag[rId] == flag) flag_occ++;
    }

    return flag_occ;
}

// Assembly:
xorl %eax, %eax
cmpl $-0x1, %edx
je 0x80ffb
movq 0x18(%rdi), %rcx
movq 0x20(%rcx), %rcx
movl %esi, %esi
cmpl $0x0, (%rcx,%rsi,8)
js 0x80ffb
movq 0x10(%rdi), %rcx
imulq $0x28, %rsi, %rsi
cmpl $0x0, 0xc(%rcx,%rsi)
je 0x80ffb
addq %rsi, %rcx
movl 0x10(%rcx), %esi
leaq 0x1d3266(%rip), %rax    # 0x254230
movq 0x28(%rax), %rdi
xorl %r8d, %r8d
xorl %eax, %eax
cmpq %r8, %rsi
je 0x80ffb
movq 0x18(%rcx), %r9
movq (%r9,%r8,8), %r9
shrq $0x21, %r9
movzbl (%rdi,%r9), %r9d
xorl %r10d, %r10d
cmpl %edx, %r9d
sete %r10b
addl %r10d, %eax
incq %r8
jmp 0x80fd3
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: print_buf_t(ma_ug_t*, buf_t*, char const*)
void print_buf_t(ma_ug_t *ug, buf_t* x, const char* command)
{
    fprintf(stderr, "%s\n", command);
    uint32_t i, ori;
    ma_utg_t* u = NULL;
    for (i = 0; i < x->b.n; i++)
    {
        u = &(ug->u.a[x->b.a[i]>>1]);
        if(u->n == 0) continue;
        ori = x->b.a[i] & 1;
        fprintf(stderr, "utg%.6ul\tori:%u\tocc:%u\tlen:%u\n", (x->b.a[i]>>1)+1, ori, (uint32_t)u->n, u->len);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x1d1e34(%rip), %r12    # 0x252fe0
movq (%r12), %rdi
leaq 0x16d086(%rip), %rsi    # 0x1ee23d
xorl %eax, %eax
callq 0x22b0
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
leaq 0x1676ec(%rip), %r15    # 0x1e88b6
xorl %r13d, %r13d
movl %r13d, %r13d
cmpq %r13, 0x38(%rbx)
jbe 0x81217
movq 0x10(%r14), %rax
movq 0x48(%rbx), %rcx
movl (%rcx,%r13,4), %ecx
movl %ecx, %edx
shrl %edx
imulq $0x28, %rdx, %rsi
movl 0x10(%rax,%rsi), %r8d
testl %r8d, %r8d
jne 0x811f9
incl %r13d
jmp 0x811cd
addq %rsi, %rax
andl $0x1, %ecx
movq (%r12), %rdi
incl %edx
movl (%rax), %r9d
andl %ebp, %r9d
movq %r15, %rsi
xorl %eax, %eax
callq 0x22b0
jmp 0x811f4
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: reset_u_trans_hit_idx(u_trans_hit_idx*, unsigned int*, unsigned int, ma_ug_t*, asg_t*, trans_chain*, unsigned int, unsigned int)
void reset_u_trans_hit_idx(u_trans_hit_idx *t, uint32_t* i_x_a, uint32_t i_x_n, ma_ug_t *i_ug, 
asg_t *i_read_sg, trans_chain* i_t_ch, uint32_t i_cBeg, uint32_t i_cEnd)
{
    t->a = i_x_a;
    t->an = i_x_n;
    t->ug = i_ug;
    t->read_sg = i_read_sg;
    t->t_ch = i_t_ch;
    t->cBeg = i_cBeg;
    t->cEnd = i_cEnd;
    t->u_i = t->r_i = t->len = t->s_pos_cur = t->s_pre_v = t->s_pre_w = 0;
    t->p_v = t->p_uId = t->p_idx = (uint32_t)-1; 
}

// Assembly:
movl 0x10(%rsp), %eax
movl 0x8(%rsp), %r10d
movq %rsi, 0x30(%rdi)
movl %edx, 0x38(%rdi)
movq %rcx, 0x40(%rdi)
movq %r8, 0x48(%rdi)
movq %r9, 0x50(%rdi)
movl %r10d, 0x24(%rdi)
movl %eax, 0x28(%rdi)
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movups %xmm0, (%rdi)
orl $-0x1, 0x20(%rdi)
orq $-0x1, 0x18(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: set_r_het_flag(ma_ug_t*, asg_t*, ma_sub_t*, ma_hit_t_alloc*, R_to_U*, unsigned char*)
void set_r_het_flag(ma_ug_t *ug, asg_t *sg, ma_sub_t* coverage_cut, ma_hit_t_alloc* sources, R_to_U* ruIndex, uint8_t* is_r_het)
{
    uint64_t m, dip_thre_max, dip_thres;
    uint8_t* primary_flag = (uint8_t*)calloc(sg->n_seq, sizeof(uint8_t));

    if(asm_opt.hom_global_coverage_set)
    {
        dip_thre_max = asm_opt.hom_global_coverage;
    }
    else
    {
        dip_thre_max = ((double)asm_opt.hom_global_coverage)/((double)HOM_PEAK_RATE);
    }
    // dip_thre_max *= 0.75;
    dip_thre_max = (double)(dip_thre_max) - (((double)(dip_thre_max)*0.5)/asm_opt.polyploidy);

    // fprintf(stderr, "dip_thre_max: %lu\n", dip_thre_max);
            
    for (m = 0; m < ug->g->n_seq; m++)
    {
        dip_thres = dip_thre_max;
        ///if(ug->u.a[m].n <= dip_thre_max) dip_thres = dip_thre_max * 1.1;
        set_ug_coverage_aggressive(ug, m, sg, coverage_cut, sources, ruIndex, primary_flag, is_r_het, dip_thres);
    }
    free(primary_flag); 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, 0x8(%rsp)
movq %rcx, (%rsp)
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
movl 0x14(%rsi), %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
pushq $0x1
popq %rsi
callq 0x2120
leaq 0x1cff0a(%rip), %rcx    # 0x253758
movslq 0x144(%rcx), %rdx
cvtsi2sd %edx, %xmm1
divsd 0x1643ff(%rip), %xmm1   # 0x1e7c60
movsd 0x15fa2f(%rip), %xmm0   # 0x1e3298
cvttsd2si %xmm1, %rsi
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %rdi
movq %rsi, %r8
sarq $0x3f, %r8
andq %rdi, %r8
orq %rsi, %r8
cmpl $0x0, 0x148(%rcx)
cmovneq %rdx, %r8
movq %r8, %xmm1
punpckldq 0x15f9d4(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x15f9dc(%rip), %xmm1   # 0x1e3280
movq %rax, %rbx
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
movsd 0x1643b5(%rip), %xmm1   # 0x1e7c70
mulsd %xmm2, %xmm1
cvtsi2sdl 0x1bc(%rcx), %xmm3
divsd %xmm3, %xmm1
addsd %xmm2, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rcx
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %r15
sarq $0x3f, %rcx
andq %rcx, %r15
orq %rax, %r15
xorl %r14d, %r14d
movq 0x18(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %r14
jae 0x8392d
subq $0x8, %rsp
movq %rbp, %rdi
movl %r14d, %esi
movq %r13, %rdx
movq %r12, %rcx
movq 0x8(%rsp), %r8
movq 0x10(%rsp), %r9
pushq %r15
pushq 0x20(%rsp)
pushq %rbx
callq 0x834a3
addq $0x20, %rsp
incq %r14
jmp 0x838ed
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: init_hc_links(hc_links*, unsigned long, trans_chain*)
void init_hc_links(hc_links* link, uint64_t ug_num, trans_chain* t_ch)
{
    kv_malloc(link->a, ug_num); link->a.n = ug_num;
    kv_malloc(link->enzymes, ug_num); link->enzymes.n = ug_num;
    uint64_t i;
    for (i = 0; i < link->a.n; i++)
    {
        kv_init(link->a.a[i].e);
        kv_init(link->a.a[i].f);
    }

    if(t_ch)
    {
        kv_u_trans_t *ta = &(t_ch->k_trans);
        uint64_t d = RC_1;
        for (i = 0; i < ta->n; i++)
        {
            if(ta->a[i].f == RC_2) continue;
            push_hc_edge(&(link->a.a[ta->a[i].qn]), ta->a[i].tn, 1, 1, &d);
            push_hc_edge(&(link->a.a[ta->a[i].tn]), ta->a[i].qn, 1, 1, &d);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, 0x8(%rdi)
imulq $0x30, %rsi, %rdi
callq 0x2280
movq %rax, %r12
movq %rax, 0x10(%r14)
movq %r15, (%r14)
movq %r15, 0x20(%r14)
leaq (,%r15,8), %rdi
callq 0x2280
movq %rax, 0x28(%r14)
movq %r15, 0x18(%r14)
xorps %xmm0, %xmm0
subq $0x1, %r15
jb 0x83d06
movups %xmm0, 0x20(%r12)
movups %xmm0, 0x10(%r12)
movups %xmm0, (%r12)
addq $0x30, %r12
jmp 0x83ce9
testq %rbx, %rbx
je 0x83d96
movq %rsp, %r15
movq $0x1, (%r15)
pushq $0x14
popq %r12
xorl %r13d, %r13d
pushq $0x1
popq %rbp
cmpq 0x138(%rbx), %r13
jae 0x83d96
movq 0x148(%rbx), %rax
movb 0x14(%rax,%r12), %cl
andb $0x3f, %cl
cmpb $0x2, %cl
je 0x83d8d
movl -0xc(%rax,%r12), %ecx
movl (%rax,%r12), %esi
imulq $0x30, %rcx, %rdi
addq 0x10(%r14), %rdi
movsd 0x15f547(%rip), %xmm0   # 0x1e32a0
movl %ebp, %edx
movq %r15, %rcx
callq 0xfa2fb
movq 0x148(%rbx), %rax
movl -0xc(%rax,%r12), %esi
movl (%rax,%r12), %eax
imulq $0x30, %rax, %rdi
addq 0x10(%r14), %rdi
movsd 0x15f51d(%rip), %xmm0   # 0x1e32a0
movl %ebp, %edx
movq %r15, %rcx
callq 0xfa2fb
incq %r13
addq $0x30, %r12
jmp 0x83d23
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: destory_hc_links(hc_links*)
void destory_hc_links(hc_links* link)
{
    uint64_t i;
    for (i = 0; i < link->a.n; i++)
    {
        kv_destroy(link->a.a[i].e);
        kv_destroy(link->a.a[i].f);
    }
    kv_destroy(link->a);
    kv_destroy(link->enzymes);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rdi
cmpq (%rbx), %r15
jae 0x83ddd
movq 0x10(%rdi,%r14), %rdi
callq 0x2220
movq 0x10(%rbx), %rax
movq 0x28(%rax,%r14), %rdi
callq 0x2220
incq %r15
addq $0x30, %r14
jmp 0x83db3
callq 0x2220
movq 0x28(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2220