LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: add_overlaps_from_different_sources(ma_hit_t_alloc*, ma_hit_t_alloc*, unsigned long*, long long)
void add_overlaps_from_different_sources(ma_hit_t_alloc* source_paf_list, ma_hit_t_alloc* dest_paf, 
uint64_t* source_index, long long listLen)
{
    long long i;
    ma_hit_t ele;
    ma_hit_t* tmp;
    uint32_t source_n, source_i;
    for (i = 0; i < listLen; i++)
    {
        source_n = source_index[i] >> 32;
        source_i = (uint32_t)(source_index[i]);
        tmp = &(source_paf_list[source_n].buffer[source_i]);

        ele.del = 0;
        ele.rev = tmp->rev;
        ele.qns = Get_tn((*tmp));
        ele.qns = ele.qns << 32;
        ele.qns = ele.qns | (uint64_t)(Get_ts((*tmp)));
        ele.qe = Get_te((*tmp));

        ele.tn = Get_qn((*tmp));
        ele.ts = Get_qs((*tmp));
        ele.te = Get_qe((*tmp));

        ele.bl = R_INF.read_length[ele.tn];
        ele.ml = tmp->ml;
        ele.el = tmp->el;
        ele.no_l_indel = tmp->no_l_indel;
        
        add_ma_hit_t_alloc(dest_paf, &ele);
    }
}

// Assembly:
testq %rcx, %rcx
jle 0xa0760
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
movq %rsp, %r13
movq (%r14,%rbp,8), %rax
movl %eax, %ecx
shrq $0x20, %rax
leaq (%rax,%rax,2), %rax
movq (%r12,%rax,8), %rax
leaq (%rcx,%rcx,4), %rcx
movq 0x18(%rax,%rcx,8), %rdx
movl 0xc(%rax,%rcx,8), %esi
movl 0x10(%rax,%rcx,8), %edi
shlq $0x20, %rsi
orq %rsi, %rdi
movq %rdi, (%rsp)
movl 0x14(%rax,%rcx,8), %esi
movl %esi, 0x8(%rsp)
movq (%rax,%rcx,8), %rsi
movq %rsi, %rdi
rorq $0x20, %rdi
movq %rdi, 0xc(%rsp)
movl 0x8(%rax,%rcx,8), %edi
movl %edi, 0x14(%rsp)
leaq 0x1f5b29(%rip), %rdi    # 0x296230
movq 0x18(%rdi), %rdi
shrq $0x20, %rsi
movq (%rdi,%rsi,8), %rsi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
shlq $0x20, %rsi
andl $0xc0000000, %edx       # imm = 0xC0000000
orq %rsi, %rdx
movq %rdx, 0x18(%rsp)
movb 0x20(%rax,%rcx,8), %dl
movb %dl, 0x20(%rsp)
movb 0x21(%rax,%rcx,8), %al
movb %al, 0x21(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0xa058c
incq %rbp
cmpq %rbp, %rbx
jne 0xa06b2
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: ma_ug_destroy(ma_ug_t*)
void ma_ug_destroy(ma_ug_t *ug)
{
	uint32_t i;
	if (ug == 0) return;
	for (i = 0; i < ug->u.n; ++i) {
		free(ug->u.a[i].a);
		free(ug->u.a[i].s);
	}
	free(ug->u.a);
	asg_destroy(ug->g);
    kv_destroy(ug->occ);
	free(ug);
}

// Assembly:
testq %rdi, %rdi
je 0xa07ce
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0xa07a7
movl $0x1, %ebp
xorl %eax, %eax
movq 0x10(%rbx), %rcx
shlq $0x3, %rax
leaq (%rax,%rax,4), %r14
movq 0x18(%rcx,%r14), %rdi
callq 0x2220
movq 0x10(%rbx), %rax
movq 0x20(%rax,%r14), %rdi
callq 0x2220
movl %ebp, %eax
incl %ebp
cmpq %rax, (%rbx)
ja 0xa077a
movq 0x10(%rbx), %rdi
callq 0x2220
movq 0x18(%rbx), %rdi
callq 0xa0494
movq 0x30(%rbx), %rdi
callq 0x2220
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2220
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: asg_arc_index_core(unsigned long, unsigned long, asg_arc_t const*)
uint64_t *asg_arc_index_core(size_t max_seq, size_t n, const asg_arc_t *a)
{
	size_t i, last;
	uint64_t *idx;
	idx = (uint64_t*)calloc(max_seq * 2, 8);


    /**
		 * ul: |____________31__________|__________1___________|______________32_____________|
	                       qns            direction of overlap       length of this node (not overlap length)
	**/
    ///so if we use high 32-bit, we store the index of each qn with two direction
	for (i = 1, last = 0; i <= n; ++i)
		if (i == n || a[i-1].ul>>32 != a[i].ul>>32)
			idx[a[i-1].ul>>32] = (uint64_t)last<<32 | (i - last), last = i;

    
	return idx;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
addq %rdi, %rdi
movl $0x8, %esi
callq 0x2120
testq %r14, %r14
je 0xa084d
leaq 0x1(%r14), %rdx
cmpq $0x3, %rdx
movl $0x2, %ecx
cmovaeq %rdx, %rcx
leaq (%r14,%r14,2), %rdx
leaq (%rbx,%rdx,8), %rdx
addq $-0x18, %rdx
movl $0x1, %esi
xorl %edi, %edi
cmpq %rsi, %r14
jne 0xa0819
movq (%rdx), %r8
jmp 0xa0829
movq (%rbx), %r8
movq 0x18(%rbx), %r9
xorq %r8, %r9
shrq $0x20, %r9
je 0xa0841
movq %rsi, %r9
subq %rdi, %r9
shlq $0x20, %rdi
orq %r9, %rdi
shrq $0x20, %r8
movq %rdi, (%rax,%r8,8)
movq %rsi, %rdi
incq %rsi
addq $0x18, %rbx
cmpq %rsi, %rcx
jne 0xa080f
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: asg_F_seq_set(asg_t*, int)
ma_utg_t* asg_F_seq_set(asg_t *g, int iid)
{
    if(iid < (int)g->r_seq) return NULL;
    uint32_t index = iid - g->r_seq, pre_n_F_seq = g->n_F_seq;

	///just malloc size
	if (index >= g->n_F_seq) {
		g->n_F_seq = index + 1;
		kv_roundup32(g->n_F_seq);
        g->F_seq = (ma_utg_t*)realloc(g->F_seq, g->n_F_seq*sizeof(ma_utg_t));
        memset(g->F_seq + pre_n_F_seq, 0, sizeof(ma_utg_t)*(g->n_F_seq-pre_n_F_seq));
	}

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
subl 0x18(%rdi), %ebx
jge 0xa0946
xorl %eax, %eax
jmp 0xa09c0
movq %rdi, %r14
movl 0x38(%rdi), %r12d
cmpl %r12d, %ebx
jae 0xa0958
movq 0x40(%r14), %r15
jmp 0xa09b6
movl %ebx, %eax
shrl %eax
orl %ebx, %eax
movl %eax, %ecx
shrl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x10, %eax
orl %ecx, %eax
incl %eax
movl %eax, 0x38(%r14)
movq 0x40(%r14), %rdi
shlq $0x3, %rax
leaq (%rax,%rax,4), %rsi
callq 0x2370
movq %rax, %r15
movq %rax, 0x40(%r14)
leaq (%r12,%r12,4), %rax
leaq (%r15,%rax,8), %rdi
movl 0x38(%r14), %eax
subl %r12d, %eax
shlq $0x3, %rax
leaq (%rax,%rax,4), %rdx
xorl %esi, %esi
callq 0x20e0
movl %ebx, %eax
leaq (%rax,%rax,4), %rax
leaq (%r15,%rax,8), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: asg_arc_rm(asg_t*)
void asg_arc_rm(asg_t *g)
{
	/**
	p->ul: |____________31__________|__________1___________|______________32_____________|
	                    qns            direction of overlap       length of this node (not overlap length)
	p->v : |___________31___________|__________1___________|
				        tns              relative strand between query and target
	p->ol: overlap length
	**/
	uint32_t e, n;
	///just clean arc requiring: 1. arc it self must be available 2. both the query and target are available
	for (e = n = 0; e < g->n_arc; ++e) {
		//u and v is the read id
		uint32_t u = g->arc[e].ul>>32, v = g->arc[e].v;
		if (!g->arc[e].del && !g->seq[u>>1].del && !g->seq[v>>1].del)
			g->arc[n++] = g->arc[e];
	}
	if (n < g->n_arc) { // arc index is out of sync
		if (g->idx) free(g->idx);
		g->idx = 0;
	}
	g->n_arc = n;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x4(%rdi), %eax
testl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
je 0xa0a64
xorl %ecx, %ecx
xorl %edx, %edx
xorl %ebp, %ebp
movq 0x8(%rbx), %rsi
cmpl $0x0, 0xc(%rsi,%rcx)
js 0xa0a31
leaq (%rsi,%rcx), %rdi
movq (%rdi), %r9
movq 0x20(%rbx), %r8
shrq $0x21, %r9
cmpl $0x0, (%r8,%r9,8)
js 0xa0a31
movl 0x8(%rsi,%rcx), %r9d
shrl %r9d
cmpl $0x0, (%r8,%r9,8)
js 0xa0a31
movl %ebp, %eax
incl %ebp
leaq (%rax,%rax,2), %rax
movq 0x10(%rdi), %r8
movq %r8, 0x10(%rsi,%rax,8)
movups (%rdi), %xmm0
movups %xmm0, (%rsi,%rax,8)
movl 0x4(%rbx), %eax
incq %rdx
movl %eax, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
addq $0x18, %rcx
cmpq %rsi, %rdx
jb 0xa09e6
cmpl %esi, %ebp
jae 0xa0a66
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0xa0a5a
callq 0x2220
movl 0x4(%rbx), %eax
movq $0x0, 0x28(%rbx)
jmp 0xa0a66
xorl %ebp, %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
andl $0x80000000, %eax       # imm = 0x80000000
orl %ebp, %eax
movl %eax, 0x4(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: asg_cleanup(asg_t*)
void asg_cleanup(asg_t *g)
{
    ///remove overlaps, instead of reads
    ///remove edges with del, and free idx
	asg_arc_rm(g);
	if (!g->is_srt) {
		/**
		 * sort by ul, that is, sort by qns + direction
		 * ul: |____________31__________|__________1___________|______________32_____________|
	                       qns            direction of overlap       length of this node (not overlap length)
		**/
		asg_arc_sort(g);
		g->is_srt = 1;
	}
	///index the overlaps in graph with query id
	if (g->idx == 0) asg_arc_index(g);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xa09cc
movslq 0x4(%rbx), %rax
testq %rax, %rax
js 0xa0aa4
movq 0x8(%rbx), %rdi
leaq (%rax,%rax,2), %rax
leaq (%rdi,%rax,8), %rsi
callq 0x9da3d
orb $-0x80, 0x7(%rbx)
cmpq $0x0, 0x28(%rbx)
je 0xa0aad
popq %rbx
retq
movq %rbx, %rdi
popq %rbx
jmp 0xa0855
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: asg_arc_del_multi(asg_t*)
int asg_arc_del_multi(asg_t *g)
{
	//the number of nodes are number of read times 2
	uint32_t *cnt, n_vtx = g->n_seq * 2, n_multi = 0, v;
	cnt = (uint32_t*)calloc(n_vtx, 4);
	for (v = 0; v < n_vtx; ++v) {
		///out-nodes of v
		asg_arc_t *av = asg_arc_a(g, v);
		int32_t i, nv = asg_arc_n(g, v);
		///if v just have one out-node, there is no muti-edge
		if (nv < 2) continue;
		for (i = nv - 1; i >= 0; --i) ++cnt[av[i].v];
		for (i = nv - 1; i >= 0; --i)
			if (--cnt[av[i].v] != 0)
				av[i].del = 1, ++n_multi;
	}
	free(cnt);
	if (n_multi) asg_cleanup(g);

    if(VERBOSE >= 1)
    {
        fprintf(stderr, "[M::%s] removed %d multi-arcs\n", __func__, n_multi);
    }
	
	return n_multi;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x14(%rdi), %r14d
addl %r14d, %r14d
movl $0x4, %esi
movq %r14, %rdi
callq 0x2120
testl %r14d, %r14d
je 0xa0b68
xorl %ecx, %ecx
xorl %ebp, %ebp
movq 0x28(%rbx), %rdx
movq (%rdx,%rcx,8), %rdx
cmpl $0x2, %edx
jl 0xa0b4a
movq 0x8(%rbx), %rsi
movq %rdx, %r8
shrq $0x20, %r8
decl %edx
leaq (,%rdx,8), %rdi
leaq (%rdi,%rdi,2), %rdi
leaq (%r8,%r8,2), %r8
leaq (%rsi,%r8,8), %r9
addq $0x8, %r9
movq %rdi, %r10
movl (%r9,%r10), %r11d
incl (%rax,%r11,4)
addq $-0x18, %r10
cmpq $-0x18, %r10
jne 0xa0b13
incq %rdx
leaq (%rdi,%r8,8), %rdi
addq %rdi, %rsi
addq $0xc, %rsi
movl -0x4(%rsi), %edi
decl (%rax,%rdi,4)
je 0xa0b41
orb $-0x80, 0x3(%rsi)
incl %ebp
addq $-0x18, %rsi
decq %rdx
jg 0xa0b33
incq %rcx
cmpq %r14, %rcx
jne 0xa0ade
movq %rax, %rdi
callq 0x2220
testl %ebp, %ebp
je 0xa0b70
movq %rbx, %rdi
callq 0xa0a7d
jmp 0xa0b72
movq %rax, %rdi
callq 0x2220
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: asg_arc_del_asymm(asg_t*)
int asg_arc_del_asymm(asg_t *g)
{
	uint32_t e, n_asymm = 0;
	///g->n_arc is the number of overlaps 
	for (e = 0; e < g->n_arc; ++e) {
		uint32_t v = g->arc[e].v^1, u = g->arc[e].ul>>32^1;
		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].v == u) break;
		if (i == nv) g->arc[e].del = 1, ++n_asymm;
	}
	if (n_asymm) asg_cleanup(g);
    if(VERBOSE >= 1)
    {
	    fprintf(stderr, "[M::%s] removed %d asymmetric arcs\n", __func__, n_asymm);
    }
	return n_asymm;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x4(%rdi), %ecx
testl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
je 0xa0c15
xorl %eax, %eax
xorl %ebx, %ebx
movq 0x8(%rdi), %rdx
movq 0x28(%rdi), %r8
leaq (%rax,%rax,2), %rsi
movl 0x8(%rdx,%rsi,8), %r9d
xorq $0x1, %r9
movq (%r8,%r9,8), %r8
movl $0x0, %r10d
testl %r8d, %r8d
je 0xa0beb
movl 0x4(%rdx,%rsi,8), %r9d
movq %r8, %r10
shrq $0x20, %r10
movl %r8d, %r11d
leaq (%r10,%r10,2), %r10
leaq (%rdx,%r10,8), %r14
addq $0x8, %r14
xorl %r10d, %r10d
movl (%r14), %ebp
xorl %r9d, %ebp
cmpl $0x1, %ebp
je 0xa0beb
incq %r10
addq $0x18, %r14
cmpq %r10, %r11
jne 0xa0bd2
jmp 0xa0bf0
cmpl %r8d, %r10d
jne 0xa0bfa
orb $-0x80, 0xf(%rdx,%rsi,8)
incl %ebx
movl 0x4(%rdi), %ecx
incq %rax
movl %ecx, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
cmpq %rdx, %rax
jb 0xa0b90
testl %ebx, %ebx
je 0xa0c15
callq 0xa0a7d
jmp 0xa0c17
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_specific_overlap(ma_hit_t_alloc*, unsigned int, unsigned int)
long long get_specific_overlap(ma_hit_t_alloc* x, uint32_t qn, uint32_t tn)
{
    long long i;
    for (i = 0; i < x->length; i++)
    {
        if(x->buffer[i].tn == tn 
        &&
          ((uint32_t)(x->buffer[i].qns>>32)) == qn)
        {
            return i;
        }        
    }

    return -1;
}

// Assembly:
movl 0xc(%rdi), %ecx
movq $-0x1, %rax
testq %rcx, %rcx
je 0xa0cc5
movq (%rdi), %r8
xorl %edi, %edi
cmpl %edx, 0xc(%r8)
jne 0xa0cb9
cmpl %esi, 0x4(%r8)
je 0xa0cc6
incq %rdi
addq $0x28, %r8
cmpq %rdi, %rcx
jne 0xa0cad
retq
movq %rdi, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: normalize_ma_hit_t_single_side_advance_mult(ma_hit_t_alloc*, long, long)
void normalize_ma_hit_t_single_side_advance_mult(ma_hit_t_alloc* src, int64_t n_src, int64_t n_thread)
{
    ma_hit_t_aux aux; int64_t k; uint64_t z; ma_hit_t e;
    aux.n_thread = n_thread; aux.src = src; CALLOC(aux.buf, aux.n_thread);

    kt_for(aux.n_thread, update_ma_hit_t_norm, &aux, n_src);

    for (k = 0; k < aux.n_thread; k++) {
        for (z = 0; z < aux.buf[k].a.n; z++) {
            set_reverse_overlap(&e, &(src[aux.buf[k].a.a[z]>>32].buffer[(uint32_t)(aux.buf[k].a.a[z])]));
            src[aux.buf[k].a.a[z]>>32].buffer[(uint32_t)(aux.buf[k].a.a[z])].del = e.del = 1;
            add_ma_hit_t_alloc(&(src[Get_qn(e)]), &e);
        }
        free(aux.buf[k].a.a);
    }
    free(aux.buf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x18(%rsp), %r12
movq %rdx, 0x10(%r12)
movq %rdi, 0x8(%r12)
movl $0x20, %esi
movq %rdx, %rdi
callq 0x2120
movq %rax, (%r12)
leaq 0x14c(%rip), %rsi       # 0xa11d3
movl %r14d, %edi
movq %r12, %rdx
movq %r15, %rcx
callq 0x108f2c
cmpq $0x0, 0x10(%r12)
jle 0xa11ba
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorl %ebp, %ebp
leaq -0x40000000(%rcx), %rdx
leaq 0x30(%rsp), %r13
movq %rdx, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rbp, 0x8(%rsp)
shlq $0x5, %rbp
cmpq $0x0, (%rax,%rbp)
je 0xa1193
andl $0x3fffffff, %r12d      # imm = 0x3FFFFFFF
movq %r12, %r14
orq %rcx, %r14
xorl %r15d, %r15d
movq 0x10(%rax,%rbp), %rax
movq (%rax,%r15,8), %rax
movl %eax, %ecx
shrq $0x20, %rax
leaq (%rax,%rax,2), %rax
movq (%rbx,%rax,8), %rax
leaq (%rcx,%rcx,4), %rcx
movl 0xc(%rax,%rcx,8), %edx
movl 0x10(%rax,%rcx,8), %esi
movq %rdx, %rdi
shlq $0x20, %rdi
orq %rdi, %rsi
movq %rsi, 0x30(%rsp)
movl 0x14(%rax,%rcx,8), %esi
movl %esi, 0x38(%rsp)
movq (%rax,%rcx,8), %rsi
rorq $0x20, %rsi
leaq (%rdx,%rdx,2), %rdx
movq %rsi, 0x3c(%rsp)
movl 0x8(%rax,%rcx,8), %esi
movl %esi, 0x44(%rsp)
movq 0x18(%rax,%rcx,8), %rsi
movb 0x20(%rax,%rcx,8), %dil
movb %dil, 0x50(%rsp)
movb 0x21(%rax,%rcx,8), %dil
movb %dil, 0x51(%rsp)
movq %rsi, %r12
andq 0x10(%rsp), %r12
orq %r14, %r12
movq %r12, 0x48(%rsp)
movabsq $-0x8000000000000000, %rdi # imm = 0x8000000000000000
orq %rdi, %rsi
movq %rsi, 0x18(%rax,%rcx,8)
leaq (%rbx,%rdx,8), %rdi
movq %r13, %rsi
callq 0xa058c
incq %r15
movq 0x18(%rsp), %rax
cmpq (%rax,%rbp), %r15
jb 0xa10e7
movq 0x10(%rax,%rbp), %rdi
callq 0x2220
movq 0x8(%rsp), %rbp
incq %rbp
cmpq 0x28(%rsp), %rbp
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
jl 0xa10be
movq 0x18(%rsp), %rdi
callq 0x2220
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_end_match_length(ma_hit_t*, UC_Read*, UC_Read*, unsigned int*, unsigned int*)
void get_end_match_length(ma_hit_t* edge, UC_Read* query, UC_Read* target,
uint32_t* left, uint32_t* right)
{
    (*left) = (*right) = 0;

    uint32_t query_beg, query_end, target_beg, target_end, targetLen, oLen;
    long long i;
    targetLen = Get_READ_LENGTH(R_INF, Get_tn(*edge));
    query_beg = Get_qs(*edge);
    query_end = Get_qe(*edge)-1;
    recover_UC_Read(query, &R_INF, Get_qn(*edge));
    
    if(edge->rev)
    {
        target_beg = targetLen-(Get_te(*edge)-1)-1;
        target_end = targetLen-Get_ts(*edge)-1;
        recover_UC_Read_RC(target, &R_INF, Get_tn(*edge));
    }
    else
    {
        target_beg = Get_ts(*edge);
        target_end = Get_te(*edge)-1;
        recover_UC_Read(target, &R_INF, Get_tn(*edge));
    }

    oLen = Get_qe(*edge) - Get_qs(*edge);
    /***************************left*******************************/
    for (i = 0; i < oLen; i++)
    {
        if(query->seq[query_beg+i]!=target->seq[target_beg+i]) break;
        (*left)++;
    }
    /***************************left*******************************/

    /***************************right*******************************/
    for (i = 0; i < oLen; i++)
    {
        if(query->seq[query_end-i]!=target->seq[target_end-i]) break;
        (*right)++;
    }
    /***************************right*******************************/
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %r8
movq %rdi, %r13
xorl %eax, %eax
movl %eax, (%rbx)
movl %eax, (%rcx)
leaq 0x1f4e50(%rip), %rsi    # 0x296230
movq 0x18(%rsi), %rax
movl 0xc(%rdi), %ecx
movq (%rax,%rcx,8), %r14
movq (%rdi), %rdx
movl 0x8(%rdi), %eax
movl %eax, 0x4(%rsp)
movq %rdx, 0x10(%rsp)
shrq $0x20, %rdx
movq %r8, 0x8(%rsp)
movq %r8, %rdi
callq 0x333e0
testb $-0x80, 0x1b(%r13)
jne 0xa1431
movl 0xc(%r13), %edx
movl 0x10(%r13), %r14d
movl 0x14(%r13), %ebp
decl %ebp
leaq 0x1f4e09(%rip), %rsi    # 0x296230
movq %r15, %rdi
callq 0x333e0
jmp 0xa1457
movl %r14d, %eax
subl 0x14(%r13), %eax
movl 0xc(%r13), %edx
movl 0x10(%r13), %ebp
notl %ebp
addl %r14d, %ebp
movl %eax, %r14d
leaq 0x1f4de1(%rip), %rsi    # 0x296230
movq %r15, %rdi
callq 0x334a6
movl (%r13), %ecx
movl 0x8(%r13), %edx
movl %edx, %eax
subl %ecx, %eax
movl 0x4(%rsp), %r11d
je 0xa14d7
decl %r11d
movl 0x10(%rsp), %esi
movq 0x8(%rsp), %rdi
addq (%rdi), %rsi
movl %r14d, %edi
addq (%r15), %rdi
cmpq $0x1, %rax
movq %rax, %r8
adcq $0x0, %r8
xorl %r9d, %r9d
movb (%rsi,%r9), %r10b
cmpb (%rdi,%r9), %r10b
jne 0xa14a3
incl (%r12)
incq %r9
cmpq %r9, %r8
jne 0xa148d
cmpl %ecx, %edx
je 0xa14d7
movl %r11d, %ecx
movl %ebp, %edx
xorl %esi, %esi
cmpq $0x1, %rax
movl $0x0, %edi
sbbq %rax, %rdi
addq (%r15), %rdx
movq 0x8(%rsp), %rax
addq (%rax), %rcx
movb (%rcx,%rsi), %al
cmpb (%rdx,%rsi), %al
jne 0xa14d7
incl (%rbx)
decq %rsi
cmpq %rsi, %rdi
jne 0xa14c5
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: drop_edges_by_trio(ma_hit_t_alloc*, long long)
void drop_edges_by_trio(ma_hit_t_alloc* sources, long long num_sources)
{
    double startTime = Get_T();

    long long i, j;
    uint32_t qn, tn;
    for (i = 0; i < num_sources; i++)
    {
        for (j = 0; j < sources[i].length; j++)
        {
            if(sources[i].buffer[j].del) continue;
            
            qn = Get_qn(sources[i].buffer[j]);
            tn = Get_tn(sources[i].buffer[j]);

            if(R_INF.trio_flag[qn] != AMBIGU && R_INF.trio_flag[tn] != AMBIGU)
            {
                if(R_INF.trio_flag[qn] != R_INF.trio_flag[tn])
                {
                    sources[i].buffer[j].del = 1;
                    continue;
                }
            }

            sources[i].buffer[j].del = 0;
        }
    }

    if(VERBOSE >= 1)
    {
        fprintf(stderr, "[M::%s] takes %0.2fs\n\n", __func__, Get_T()-startTime);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2f3fc
testq %rbx, %rbx
jle 0xa1a9d
xorl %eax, %eax
leaq 0x1f47fc(%rip), %rcx    # 0x296230
leaq (%rax,%rax,2), %rdx
cmpl $0x0, 0xc(%r14,%rdx,8)
je 0xa1a95
leaq (%r14,%rdx,8), %rdx
movl $0x18, %esi
xorl %edi, %edi
movq (%rdx), %r8
movq (%r8,%rsi), %r9
testq %r9, %r9
js 0xa1a85
movl -0x14(%r8,%rsi), %r10d
movq 0x28(%rcx), %r11
movb (%r11,%r10), %r10b
testb %r10b, %r10b
je 0xa1a81
movl -0xc(%r8,%rsi), %r15d
movb (%r11,%r15), %r11b
testb %r11b, %r11b
je 0xa1a81
cmpb %r11b, %r10b
je 0xa1a81
btsq $0x3f, %r9
movq %r9, (%r8,%rsi)
incq %rdi
movl 0xc(%rdx), %r8d
addq $0x28, %rsi
cmpq %r8, %rdi
jb 0xa1a4b
incq %rax
cmpq %rbx, %rax
jne 0xa1a34
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_specific_overlap_with_del(ma_hit_t_alloc*, ma_sub_t*, unsigned int, unsigned int)
ma_hit_t* get_specific_overlap_with_del(ma_hit_t_alloc* sources, ma_sub_t *coverage_cut, 
uint32_t qn, uint32_t tn)
{
    if(coverage_cut[qn].del || coverage_cut[tn].del) return NULL;
    ma_hit_t_alloc* x = &(sources[qn]);
    uint32_t i;
    for (i = 0; i < x->length; i++)
    {
        if(x->buffer[i].del) continue;
        if(coverage_cut[Get_qn(x->buffer[i])].del) continue;
        if(coverage_cut[Get_tn(x->buffer[i])].del) continue;

        if(Get_tn(x->buffer[i])==tn 
        &&
           Get_qn(x->buffer[i])==qn)
        {
            return &(x->buffer[i]);
        }        
    }

    return NULL;
}

// Assembly:
movl %edx, %eax
leaq (%rax,%rax,2), %rax
cmpl $0x0, (%rsi,%rax,4)
js 0xa1b12
movl %ecx, %r8d
leaq (%r8,%r8,2), %r8
cmpl $0x0, (%rsi,%r8,4)
js 0xa1b12
movl 0xc(%rdi,%rax,8), %r8d
testq %r8, %r8
je 0xa1b12
leaq (%rdi,%rax,8), %rax
movq (%rax), %rax
cmpq $0x0, 0x18(%rax)
js 0xa1b09
movq (%rax), %rdi
shrq $0x20, %rdi
leaq (%rdi,%rdi,2), %r9
cmpl $0x0, (%rsi,%r9,4)
js 0xa1b09
movl 0xc(%rax), %r9d
leaq (%r9,%r9,2), %r10
cmpl $0x0, (%rsi,%r10,4)
setns %r10b
xorl %ecx, %r9d
xorl %edx, %edi
orl %r9d, %edi
sete %dil
testb %r10b, %dil
jne 0xa1b14
addq $0x28, %rax
decq %r8
jne 0xa1ace
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: delete_all_edges(ma_hit_t_alloc*, ma_sub_t*, unsigned int)
void delete_all_edges(ma_hit_t_alloc* sources, ma_sub_t *coverage_cut, uint32_t qn)
{
    ma_hit_t_alloc* x = &(sources[qn]);
    uint32_t i;
    for (i = 0; i < x->length; i++)
    {
        x->buffer[i].del = 1;
        delete_single_edge(sources, coverage_cut, Get_tn(x->buffer[i]), Get_qn(x->buffer[i]));
    }
    coverage_cut[qn].del = 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edx, %eax
leaq (%rax,%rax,2), %rax
movq %rax, (%rsp)
cmpl $0x0, 0xc(%rdi,%rax,8)
je 0xa1b99
movq %rdi, %r14
movq (%rsp), %rax
leaq (%rdi,%rax,8), %r12
movabsq $-0x8000000000000000, %r13 # imm = 0x8000000000000000
xorl %ebp, %ebp
xorl %r15d, %r15d
movq (%r12), %rax
orq %r13, 0x18(%rax,%rbp)
movq (%r12), %rax
movl 0x4(%rax,%rbp), %ecx
movl 0xc(%rax,%rbp), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa1aa3
testq %rax, %rax
je 0xa1b88
orq %r13, 0x18(%rax)
incq %r15
movl 0xc(%r12), %eax
addq $0x28, %rbp
cmpq %rax, %r15
jb 0xa1b5f
movq (%rsp), %rax
orb $-0x80, 0x3(%rbx,%rax,4)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: set_R_to_U(R_to_U*, unsigned int, unsigned int, unsigned int, unsigned char*)
void set_R_to_U(R_to_U* x, uint32_t rID, uint32_t uID, uint32_t is_Unitig, uint8_t* flag)
{
    if(flag && (*flag) == FAKE_LABLE) return;
     
	if(rID >= x->len)
	{
		x->index = (uint32_t*)realloc(x->index, (rID + 1)*sizeof(uint32_t));
        memset(x->index + x->len, -1, sizeof(uint32_t)*((rID + 1) - x->len));
        x->len = rID + 1;
	}

	x->index[rID] = uID & (uint32_t)(0x7fffffff);
	x->index[rID] = x->index[rID] | (uint32_t)(is_Unitig<<31);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %r15
testq %r8, %r8
je 0xa2809
cmpb $0x4, (%r8)
je 0xa285c
movl %r14d, %r13d
movq 0x8(%r15), %r12
cmpq %r13, (%r15)
ja 0xa284d
incl %r14d
leaq (,%r14,4), %rsi
movq %r12, %rdi
callq 0x2370
movq %rax, %r12
movq %rax, 0x8(%r15)
movq (%r15), %rax
leaq (%r12,%rax,4), %rdi
movq %r14, %rdx
subq %rax, %rdx
shlq $0x2, %rdx
movl $0xff, %esi
callq 0x20e0
movq %r14, (%r15)
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
shll $0x1f, %ebx
orl %ebp, %ebx
movl %ebx, (%r12,%r13,4)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: collect_sides_trio(ma_hit_t_alloc*, unsigned long, ma_sub_t*, ma_sub_t*, unsigned int)
void collect_sides_trio(ma_hit_t_alloc* paf, uint64_t rLen, ma_sub_t* max_left, ma_sub_t* max_right,
uint32_t trio_flag)
{
    long long j;
    uint32_t qs, qe;
    for (j = 0; j < paf->length; j++)
    {
        if(paf->buffer[j].del) continue;

        if(R_INF.trio_flag[Get_tn(paf->buffer[j])] == trio_flag) continue;

        qs = Get_qs(paf->buffer[j]);
        qe = Get_qe(paf->buffer[j]);

        ///overlaps from left side
        if(qs == 0)
        {
            if(qs < max_left->s) max_left->s = qs;
            if(qe > max_left->e) max_left->e = qe;
        }

        ///overlaps from right side
        if(qe == rLen)
        {
            if(qs < max_right->s) max_right->s = qs;
            if(qe > max_right->e) max_right->e = qe;
        }

        ///note: if (qs == 0 && qe == rLen)
        ///this overlap would be added to both b_left and b_right
        ///that is what we want
    }
}

// Assembly:
cmpl $0x0, 0xc(%rdi)
je 0xa3007
pushq %rbp
pushq %r14
pushq %rbx
xorl %eax, %eax
leaq 0x1f32b5(%rip), %r9     # 0x296230
xorl %r10d, %r10d
movq (%rdi), %r11
cmpq $0x0, 0x18(%r11,%rax)
js 0xa2fef
movq 0x28(%r9), %rbx
movl 0xc(%r11,%rax), %r14d
movzbl (%rbx,%r14), %ebx
cmpl %r8d, %ebx
je 0xa2fef
movl (%r11,%rax), %ebx
movl 0x8(%r11,%rax), %r11d
testl %ebx, %ebx
jne 0xa2fc5
movl (%rdx), %ebp
testl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
je 0xa2fbb
andl $0x80000000, %ebp       # imm = 0x80000000
movl %ebp, (%rdx)
cmpl 0x4(%rdx), %r11d
jbe 0xa2fc5
movl %r11d, 0x4(%rdx)
cmpq %rsi, %r11
jne 0xa2fef
movl (%rcx), %ebp
movl %ebp, %r14d
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
cmpl %ebx, %r14d
jbe 0xa2fe5
andl $0x80000000, %ebp       # imm = 0x80000000
orl %ebx, %ebp
movl %ebp, (%rcx)
cmpl 0x4(%rcx), %r11d
jbe 0xa2fef
movl %r11d, 0x4(%rcx)
incq %r10
movl 0xc(%rdi), %r11d
addq $0x28, %rax
cmpq %r11, %r10
jb 0xa2f7e
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: intersection_check(ma_hit_t_alloc*, unsigned long, unsigned int, unsigned int)
int intersection_check(ma_hit_t_alloc* paf, uint64_t rLen, uint32_t interval_s, uint32_t interval_e)
{
    long long j, cov = 0;
    uint32_t qs, qe;

    for (j = 0; j < paf->length; j++)
    {
        qs = Get_qs(paf->buffer[j]);
        qe = Get_qe(paf->buffer[j]);
        ///[interval_s, interval_e) must be at least contained at one of the [qs, qe)
        if(qs<=interval_s && qe>=interval_e)
        {
            cov++;
        }
    }

    return cov;
}

// Assembly:
movl 0xc(%rdi), %eax
testq %rax, %rax
je 0xa354e
movq (%rdi), %rsi
shlq $0x3, %rax
leaq (%rax,%rax,4), %rdi
xorl %r8d, %r8d
xorl %eax, %eax
cmpl %edx, (%rsi,%r8)
ja 0xa3544
cmpl %ecx, 0x8(%rsi,%r8)
sbbl $-0x1, %eax
addq $0x28, %r8
cmpq %r8, %rdi
jne 0xa3536
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: intersection_check_by_base(ma_hit_t_alloc*, unsigned long, unsigned int, unsigned int, char*, char*)
int intersection_check_by_base(ma_hit_t_alloc* paf, uint64_t rLen, uint32_t interval_s, uint32_t interval_e,
char* bq, char* bt)
{
    long long j;
    uint32_t qs, qe;

    for (j = 0; j < paf->length; j++) {
        if(paf->buffer[j].del) continue;

        qs = Get_qs(paf->buffer[j]);
        qe = Get_qe(paf->buffer[j]);
        ///[interval_s, interval_e) must be at least contained at one of the [qs, qe)
        if(qs<=interval_s && qe>=interval_e) {
            if((paf->buffer[j].el) || 
                    (boundary_verify(interval_s, interval_e, &(paf->buffer[j]), bq, bt, &R_INF) == 0)) {
                return 1;
            }
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, 0x8(%rsp)
movl 0xc(%rdi), %eax
testl %eax, %eax
je 0xa35d7
movl %ecx, %ebp
movl %edx, %r15d
movq %rdi, %r12
xorl %ebx, %ebx
xorl %r14d, %r14d
movl $0x1, %r13d
movq (%r12), %rcx
cmpq $0x0, 0x18(%rcx,%rbx)
js 0xa35c9
leaq (%rcx,%rbx), %rdx
cmpl %r15d, (%rdx)
ja 0xa35c9
cmpl %ebp, 0x8(%rcx,%rbx)
jb 0xa35c9
cmpb $0x0, 0x20(%rcx,%rbx)
jne 0xa35da
movl %r15d, %edi
movl %ebp, %esi
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %r8
leaq 0x1f2c75(%rip), %r9     # 0x296230
callq 0xa2e47
testl %eax, %eax
je 0xa35da
movl 0xc(%r12), %eax
incq %r14
movl %eax, %ecx
addq $0x28, %rbx
cmpq %rcx, %r14
jb 0xa3583
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: asg_extend(asg_t const*, unsigned int, int, asg64_v*)
int asg_extend(const asg_t *g, uint32_t v, int max_ext, asg64_v *a)
{
	int ret;
	uint64_t lw;
	a->n = 0;
	kv_push(uint64_t, *a, v);
	do {
        /**
		 test (v) and (v^1), 
         if the out-degrees of both (v) and (v^1) are 1, ret == 0
        **/
		ret = asg_is_utg_end(g, v^1, &lw);
        /**
        #define ASG_ET_MERGEABLE 0
        #define ASG_ET_TIP       1
        #define ASG_ET_MULTI_OUT 2
        #define ASG_ET_MULTI_NEI 3
        **/
		if (ret != 0) break;
		kv_push(uint64_t, *a, lw);
		/**
		 ret == 0 means: 
		   v^1 and is the only prefix of (uint32_t)lw, 
		   and (uint32_t)lw is the only prefix of v^1
		**/
		
		v = (uint32_t)lw;
	} while (--max_ext > 0);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %r14
movq $0x0, (%rcx)
cmpq $0x0, 0x8(%rcx)
je 0xa3af4
movq 0x10(%rbx), %rax
xorl %ecx, %ecx
jmp 0xa3b11
movq $0x2, 0x8(%rbx)
movq 0x10(%rbx), %rdi
movl $0x10, %esi
callq 0x2370
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
movl %r12d, %edx
leaq 0x1(%rcx), %rsi
movq %rsi, (%rbx)
movq %rdx, (%rax,%rcx,8)
movl $0x2, %r13d
movq 0x28(%r14), %rsi
movl %r12d, %ecx
movq (%rsi,%rcx,8), %r8
movl $0x1, %ecx
testl %r8d, %r8d
jle 0xa3c51
movq 0x8(%r14), %rdx
movq %r8, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rdx,%rcx,8), %rdi
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
leaq (%rdx,%rcx,8), %r10
addq $0xc, %r10
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %r11d, %r11d
xorl %r9d, %r9d
xorl %ebp, %ebp
cmpl $0x0, (%r10)
setns %bpl
cmovnsl %r11d, %ecx
addl %ebp, %r9d
incq %r11
addq $0x18, %r10
cmpq %r11, %r8
jne 0xa3b6b
cmpl $0x1, %r9d
jne 0xa3c42
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %r8
movl 0x8(%rdi,%r8,8), %r12d
movq %r12, %rcx
xorq $0x1, %rcx
movq (%rsi,%rcx,8), %rsi
movl $0x3, %ecx
testl %esi, %esi
jle 0xa3c51
movq (%rdi,%r8,8), %rbp
shlq $0x20, %rbp
orq %r12, %rbp
movq %rsi, %rdi
shrq $0x20, %rdi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
leaq (%rdi,%rdi,2), %rdi
leaq (%rdx,%rdi,8), %rdi
addq $0xc, %rdi
xorl %edx, %edx
movl (%rdi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %edx
addq $0x18, %rdi
decq %rsi
jne 0xa3bdc
cmpl $0x1, %edx
jne 0xa3c51
movq (%rbx), %rcx
cmpq 0x8(%rbx), %rcx
jne 0xa3c22
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
cmoveq %r13, %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 %rbp, (%rax,%rcx,8)
leal -0x1(%r15), %ecx
cmpl $0x1, %r15d
movl %ecx, %r15d
jg 0xa3b25
xorl %ecx, %ecx
jmp 0xa3c51
movl $0x2, %ecx
testl %r9d, %r9d
jne 0xa3c51
movl $0x1, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_R_to_U(R_to_U*, unsigned int, unsigned int*, unsigned int*)
void get_R_to_U(R_to_U* x, uint32_t rID, uint32_t* uID, uint32_t* is_Unitig)
{
	if(rID >= x->len || (x->index[rID] == (uint32_t)(-1)))
	{
		(*uID) = (uint32_t)-1;
		(*is_Unitig) = (uint32_t)-1;
		return;
	}
    
    (*uID) = x->index[rID] & (uint32_t)(0x7fffffff);
	(*is_Unitig) = (x->index[rID]>>31);
}

// Assembly:
movl %esi, %eax
cmpq %rax, (%rdi)
jbe 0xa3c85
movq 0x8(%rdi), %rsi
movl (%rsi,%rax,4), %edi
cmpl $-0x1, %edi
je 0xa3c85
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movl %edi, (%rdx)
movl (%rsi,%rax,4), %eax
shrl $0x1f, %eax
jmp 0xa3c90
movl $0xffffffff, (%rdx)     # imm = 0xFFFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: prt_specific_overlap(ma_hit_t_alloc*, unsigned long, unsigned long, char const*)
void prt_specific_overlap(ma_hit_t_alloc *src, uint64_t qn, uint64_t tn, const char *cmd)
{
    ma_hit_t *h = NULL; int64_t idx = -1, k;
    if(tn != ((uint64_t)-1)) {
        idx = get_specific_overlap(&(src[qn]), qn, tn); h = &(src[qn].buffer[idx]);
        fprintf(stderr, "%s::idx::%ld[M::%s::] qn::%u, tn::%u, del::%u, bl::%u, ml::%u\n", cmd, idx, __func__, 
        Get_qn(*h), Get_tn(*h), h->del, h->bl, h->ml);
    } else {
        for (k = 0; k < src[qn].length; k++) {
            h = &(src[qn].buffer[k]);
            fprintf(stderr, "%s::idx::%ld[M::%s::] qn::%u, tn::%u, del::%u, bl::%u, ml::%u\n", cmd, idx, __func__, 
            Get_qn(*h), Get_tn(*h), h->del, h->bl, h->ml); 
        }
    }
}

// Assembly:
pushq %rax
movq %rdx, %rax
leaq (%rsi,%rsi,2), %rdx
leaq (%rdi,%rdx,8), %rdx
cmpq $-0x1, %rax
jne 0xa40ce
cmpl $0x0, 0xc(%rdx)
jne 0xa40db
popq %rax
retq
movq %rsi, %rdi
movq %rax, %rsi
callq 0xfeca
jmp 0xa40cc
leaq 0xc(%rdx), %rax
movq %rdx, %rdi
movq %rcx, %rsi
movq %rax, %rdx
callq 0xff62
jmp 0xa40cc
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: single_edge_length(asg_t*, unsigned int, unsigned int, long long)
long long single_edge_length(asg_t *g, uint32_t begNode, uint32_t endNode, long long edgeLen)
{
    
    uint32_t v = begNode;
    uint32_t nv = asg_arc_n(g, v);
    asg_arc_t *av = asg_arc_a(g, v);
    long long rLen = 0;

    while (rLen < edgeLen && nv == 1)
    {
        rLen++;
        if((av[0].v>>1) == endNode)
        {
            return rLen;
        }

        if(asg_is_single_edge(g, av[0].v, v>>1) != 1)
        {
            return -1;
        }

        v = av[0].v;
        nv = asg_arc_n(g, v);
        av = asg_arc_a(g, v);      
    }

    return -1;   

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq $-0x1, %r13
testq %rcx, %rcx
jle 0xa46f6
movq %rcx, %r14
movl %edx, %r8d
movq %rdi, %r15
movq 0x28(%rdi), %rcx
movl %esi, %eax
movq (%rcx,%rax,8), %rdx
movl %edx, %eax
cmpl $0x1, %eax
jne 0xa46f6
movq 0x8(%r15), %rax
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rbx
xorl %r13d, %r13d
movl $0x1, %r12d
movl %r8d, 0x4(%rsp)
incq %r13
movl 0x8(%rbx), %edx
movl %edx, %edi
shrl %edi
cmpl %r8d, %edi
je 0xa46f6
xorq $0x1, %rdx
movq (%rcx,%rdx,8), %rbp
testl %ebp, %ebp
jle 0xa46c6
movq %rbp, %rdx
shrq $0x20, %rdx
movl %ebp, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rdx
addq $0x8, %rdx
xorl %eax, %eax
movl (%rdx), %edi
xorl %esi, %edi
cmpl $0x2, %edi
cmovbl %r12d, %eax
addq $0x18, %rdx
decq %rcx
jne 0xa4680
testl %eax, %eax
je 0xa46c8
cmpl $0x1, %ebp
jne 0xa46ef
cmpq %r14, %r13
jge 0xa46ef
movl 0x8(%rbx), %esi
movq 0x8(%r15), %rax
movq 0x28(%r15), %rcx
movq (%rcx,%rsi,8), %rdx
movl %edx, %edi
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rbx
cmpl $0x1, %edi
je 0xa4644
jmp 0xa46ef
xorl %ebp, %ebp
movq 0x1f0911(%rip), %rax    # 0x294fe0
movq (%rax), %rcx
movl $0xa, %esi
movl $0x1, %edx
leaq 0x194a37(%rip), %rdi    # 0x23911a
callq 0x2410
movl 0x4(%rsp), %r8d
jmp 0xa4698
movq $-0x1, %r13
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: detect_bubble_end(asg_t*, unsigned int, unsigned int, unsigned int*, long long*, buf_t*)
int detect_bubble_end(asg_t *g, uint32_t begNode1, uint32_t begNode2, uint32_t* endNode, 
long long* minLen, buf_t* b)
{
    uint32_t e1, e2;
    long long l1, l2;

    if(detect_single_path(g, begNode1, &e1, &l1, b) == TWO_INPUT 
       && 
       detect_single_path(g, begNode2, &e2, &l2, b) == TWO_INPUT)
    {
        if(e1 == e2)
        {
            (*endNode) = e1;
            (*minLen) = (l1 <= l2)? l1: l2;
            return 1;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movq %r8, %rbx
movq %rcx, %r14
movl %edx, %r12d
movq %rdi, %r13
leaq 0x4(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r9, %r8
callq 0xa4708
xorl %ebp, %ebp
cmpl $0x1, %eax
jne 0xa499c
movq %rsp, %rdx
leaq 0x8(%rsp), %rcx
movq %r13, %rdi
movl %r12d, %esi
movq %r15, %r8
callq 0xa4708
cmpl $0x1, %eax
jne 0xa499c
movl 0x4(%rsp), %eax
cmpl (%rsp), %eax
jne 0xa499c
movl %eax, (%r14)
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq %rcx, %rax
cmovlq %rax, %rcx
movq %rcx, (%rbx)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: detect_bubble_end_with_bubbles(asg_t*, unsigned int, unsigned int, unsigned int*, long long*, buf_t*)
int detect_bubble_end_with_bubbles(asg_t *g, uint32_t begNode1, uint32_t begNode2, 
uint32_t* endNode, long long* minLen, buf_t* b)
{
    uint32_t e1, e2;
    long long l1, l2;

    if(detect_single_path_with_single_bubbles(g, begNode1, &e1, &l1, b, (uint32_t)-1) == TWO_INPUT 
       && 
       detect_single_path_with_single_bubbles(g, begNode2, &e2, &l2, b, (uint32_t)-1) == TWO_INPUT)
    {
        if(e1 == e2)
        {
            (*endNode) = e1;
            (*minLen) = (l1 <= l2)? l1: l2;
            return 1;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movq %r8, %rbx
movq %rcx, %r14
movl %edx, %r12d
movq %rdi, %r13
leaq 0x4(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r9, %r8
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0xa4c16
xorl %ebp, %ebp
cmpl $0x1, %eax
jne 0xa4f9e
movq %rsp, %rdx
leaq 0x8(%rsp), %rcx
movq %r13, %rdi
movl %r12d, %esi
movq %r15, %r8
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0xa4c16
cmpl $0x1, %eax
jne 0xa4f9e
movl 0x4(%rsp), %eax
cmpl (%rsp), %eax
jne 0xa4f9e
movl %eax, (%r14)
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq %rcx, %rax
cmovlq %rax, %rcx
movq %rcx, (%rbx)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: detect_mul_bubble_end_with_bubbles(asg_t*, unsigned int*, unsigned int, unsigned int*, long long*, buf_t*)
int detect_mul_bubble_end_with_bubbles(asg_t *g, uint32_t* begs, uint32_t occ, 
uint32_t* endNode, long long* minLen, buf_t* b)
{
    uint32_t e, flag, e_s;
    long long l, i, l_s;

    if(occ < 1) return 0;

    flag = detect_single_path_with_single_bubbles(g, begs[0], &e, &l, b, (uint32_t)-1);

    if(flag == TWO_INPUT || flag == MUL_INPUT)
    {
        e_s = e;
        l_s = l;
    }
    else
    {
        return 0;
    }
    


    for (i = 1; i < occ; i++)
    {
        flag = detect_single_path_with_single_bubbles(g, begs[i], &e, &l, b, (uint32_t)-1);
        if(flag == TWO_INPUT || flag == MUL_INPUT)
        {
            if(e != e_s) return 0;
            if(l < l_s) l_s = l;
        }
        else
        {
            return 0;
        }
    }

    if(asg_arc_n(g, e_s^1) == occ)
    {
        (*endNode) = e_s;
        (*minLen) = l_s;
        return 1;
    }
    
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
xorl %ebp, %ebp
testl %edx, %edx
je 0xa509e
movq %r9, %r13
movq %r8, %rbx
movq %rcx, %r15
movq %rsi, %r14
movq %rdi, %r12
movl %edx, 0x4(%rsp)
movl (%rsi), %esi
movq %rsp, %rdx
leaq 0x8(%rsp), %rcx
movq %r9, %r8
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0xa4c16
andl $0x5, %eax
cmpl $0x1, %eax
jne 0xa509e
movq %r15, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
movl (%rsp), %esi
movq 0x8(%rsp), %rbx
movl 0x4(%rsp), %eax
cmpl $0x1, %eax
je 0xa506c
movl %eax, %eax
movq %rax, 0x20(%rsp)
movl $0x1, %r15d
movq %rsi, %rbp
movl (%r14,%r15,4), %esi
movq %r12, %rdi
movq %rsp, %rdx
leaq 0x8(%rsp), %rcx
movq %r13, %r8
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0xa4c16
andl $0x5, %eax
cmpl $0x1, %eax
jne 0xa509c
movq %rbp, %rsi
cmpl %esi, (%rsp)
jne 0xa509c
movq 0x8(%rsp), %rax
cmpq %rbx, %rax
cmovlq %rax, %rbx
incq %r15
cmpq %r15, 0x20(%rsp)
jne 0xa5026
movq 0x28(%r12), %rax
movq %rsi, %rcx
xorq $0x1, %rcx
movl 0x4(%rsp), %edx
cmpl %edx, (%rax,%rcx,8)
movl $0x0, %ebp
jne 0xa509e
movq 0x10(%rsp), %rax
movl %esi, (%rax)
movq 0x18(%rsp), %rax
movq %rbx, (%rax)
movl $0x1, %ebp
jmp 0xa509e
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: asg_arc_identify_simple_bubbles_multi_back(asg_t*, int)
int asg_arc_identify_simple_bubbles_multi_back(asg_t *g, int check_cross)
{
    double startTime = Get_T();
    memset(g->seq_vis, 0, g->n_seq*2*sizeof(uint8_t));

    pthread_t *_r_threads;

	_r_threads = (pthread_t *)malloc(sizeof(pthread_t)*asm_opt.thread_num);

    int i = 0;

	for (i = 0; i < asm_opt.thread_num; i++)
	{
        para_for_simple_bub* arg = (para_for_simple_bub*)malloc(sizeof(*arg));
        arg->g = g;
        arg->thread_num = asm_opt.thread_num;
        arg->threadID = i;
        arg->check_cross = check_cross;

        pthread_create(_r_threads + i, NULL, asg_arc_identify_simple_bubbles_pthread, (void*)arg);
	}
    

    for (i = 0; i<asm_opt.thread_num; i++)
		pthread_join(_r_threads[i], NULL);


    free(_r_threads);

    uint32_t v, n_vtx = g->n_seq * 2;
    long long nodes, bub_nodes, cross_nodes;
    bub_nodes = nodes = cross_nodes = 0;
    for (v = 0; v < n_vtx; ++v) 
    {
        if (g->seq[v>>1].del) continue;
        nodes++;
        if(g->seq_vis[v] == 1) bub_nodes++;
        if(g->seq_vis[v] == 2) cross_nodes++;
    }


    if(VERBOSE >= 1)
    {
        fprintf(stderr, "[M::%s] takes %0.2f s\n\n", __func__, Get_T()-startTime);
    }
    return bub_nodes+cross_nodes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
callq 0x2f3fc
movq 0x30(%rbx), %rdi
movl 0x14(%rbx), %edx
addl %edx, %edx
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x20e0
leaq 0x1eda43(%rip), %rax    # 0x295758
movslq 0x7c(%rax), %r14
leaq (,%r14,8), %rdi
callq 0x2280
movq %rax, %r13
testq %r14, %r14
jle 0xa7da4
xorl %r12d, %r12d
movq %r13, (%rsp)
movl $0x18, %edi
callq 0x2280
movq %rbx, 0x10(%rax)
movl %r14d, 0x4(%rax)
movl %r12d, (%rax)
movl %r15d, 0x8(%rax)
movq %r13, %rdi
xorl %esi, %esi
leaq -0x1f0(%rip), %rdx      # 0xa7b6a
movq %rax, %rcx
callq 0x23c0
incq %r12
leaq 0x1ed9ec(%rip), %rax    # 0x295758
movslq 0x7c(%rax), %r14
addq $0x8, %r13
cmpq %r14, %r12
jl 0xa7d35
testl %r14d, %r14d
leaq 0x1ed9d5(%rip), %r15    # 0x295758
movq (%rsp), %r13
jle 0xa7da4
xorl %r14d, %r14d
movq (%r13,%r14,8), %rdi
xorl %esi, %esi
callq 0x2170
incq %r14
movslq 0x7c(%r15), %rax
cmpq %rax, %r14
jl 0xa7d8c
movq %r13, %rdi
callq 0x2220
movl 0x14(%rbx), %ecx
addl %ecx, %ecx
je 0xa7df7
movq 0x20(%rbx), %rax
movl %ecx, %ecx
xorl %edx, %edx
xorl %ebp, %ebp
xorl %esi, %esi
movl %edx, %edi
shrl %edi
cmpl $0x0, (%rax,%rdi,8)
js 0xa7ded
movq 0x30(%rbx), %rdi
movb (%rdi,%rdx), %dil
xorl %r8d, %r8d
cmpb $0x1, %dil
sete %r8b
addl %r8d, %esi
xorl %r8d, %r8d
cmpb $0x2, %dil
sete %r8b
addl %r8d, %ebp
incq %rdx
cmpq %rdx, %rcx
jne 0xa7dbf
addl %esi, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: asg_arc_identify_simple_bubbles_multi(asg_t*, bub_label_t*, int)
int asg_arc_identify_simple_bubbles_multi(asg_t *g, bub_label_t* x, int check_cross)
{
    double startTime = Get_T();
    memset(g->seq_vis, 0, g->n_seq*2*sizeof(uint8_t));
    uint64_t bub_dist = get_s_bub_pop_max_dist_advance(g, &(x->b[0]));
    ///fprintf(stderr, "+++[M::%s] takes %0.2f s, bub_dist: %lu\n\n", __func__, Get_T()-startTime, bub_dist);
    // startTime = Get_T();

    reset_bub_label_t(x, g, bub_dist, check_cross);
    kt_for(x->n_thres, bubble_identify_worker, x, g->n_seq<<1);
    uint32_t v, n_vtx = g->n_seq<<1;
    long long nodes, bub_nodes, cross_nodes;
    bub_nodes = nodes = cross_nodes = 0;
    for (v = 0; v < n_vtx; ++v) 
    {
        if (g->seq[v>>1].del) continue;
        nodes++;
        if(g->seq_vis[v] == 1) bub_nodes++;
        if(g->seq_vis[v] == 2) cross_nodes++;
    }
    ///fprintf(stderr, "---[M::%s] takes %0.2f s\n\n", __func__, Get_T()-startTime);

    if(VERBOSE >= 1)
    {
        fprintf(stderr, "[M::%s] takes %0.2f s\n\n", __func__, Get_T()-startTime);
    }
    return bub_nodes+cross_nodes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2f3fc
movq 0x30(%rbx), %rdi
movl 0x14(%rbx), %edx
addl %edx, %edx
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x20e0
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xa7ebe
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movl %r15d, %ecx
callq 0xa02e3
movl 0x8(%r14), %edi
movl 0x14(%rbx), %eax
addl %eax, %eax
movslq %eax, %rcx
leaq 0x1cd(%rip), %rsi       # 0xa802b
movq %r14, %rdx
callq 0x108f2c
movl 0x14(%rbx), %ecx
addl %ecx, %ecx
je 0xa7eb1
movq 0x20(%rbx), %rax
movl %ecx, %ecx
xorl %edx, %edx
xorl %ebp, %ebp
xorl %esi, %esi
movl %edx, %edi
shrl %edi
cmpl $0x0, (%rax,%rdi,8)
js 0xa7ea7
movq 0x30(%rbx), %rdi
movb (%rdi,%rdx), %dil
xorl %r8d, %r8d
cmpb $0x1, %dil
sete %r8b
addl %r8d, %esi
xorl %r8d, %r8d
cmpb $0x2, %dil
sete %r8b
addl %r8d, %ebp
incq %rdx
cmpq %rdx, %rcx
jne 0xa7e79
addl %esi, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq