LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/kthread.cpp
// Function: ktp_worker(void*)
static void *ktp_worker(void *data)
{
	ktp_worker_t *w = (ktp_worker_t*)data;
	ktp_t *p = w->pl;
	while (w->step < p->n_steps) {
		// test whether we can kick off the job with this worker
		pthread_mutex_lock(&p->mutex);
		for (;;) {
			int i;
			// test whether another worker is doing the same step
			for (i = 0; i < p->n_workers; ++i) {
				if (w == &p->workers[i]) continue; // ignore itself
				if (p->workers[i].step <= w->step && p->workers[i].index < w->index)
					break;
			}
			if (i == p->n_workers) break; // no workers with smaller indices are doing w->step or the previous steps
			pthread_cond_wait(&p->cv, &p->mutex);
		}
		pthread_mutex_unlock(&p->mutex);

		// working on w->step
		w->data = p->func(p->shared, w->step, w->step? w->data : 0); // for the first step, input is NULL

		// update step and let other workers know
		pthread_mutex_lock(&p->mutex);
		w->step = w->step == p->n_steps - 1 || w->data? (w->step + 1) % p->n_steps : p->n_steps;
		if (w->step == 0) w->index = p->index++;
		pthread_cond_broadcast(&p->cv);
		pthread_mutex_unlock(&p->mutex);
	}
	pthread_exit(0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r12
leaq 0x28(%r12), %r14
leaq 0x50(%r12), %r15
movl 0x10(%rbx), %eax
cmpl 0x1c(%r12), %eax
jge 0xc6b9a
movq %r14, %rdi
callq 0x22c0
movl 0x18(%r12), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovgl %eax, %ecx
xorl %esi, %esi
xorl %edx, %edx
cmpq %rdx, %rcx
je 0xc6b10
movq 0x20(%r12), %rdi
leaq (%rdi,%rsi), %r8
cmpq %rbx, %r8
je 0xc6b05
movl 0x10(%rdi,%rsi), %r8d
cmpl 0x10(%rbx), %r8d
jg 0xc6b05
movq 0x8(%rdi,%rsi), %rdi
cmpq 0x8(%rbx), %rdi
jl 0xc6b0e
incq %rdx
addq $0x20, %rsi
jmp 0xc6adc
movl %edx, %ecx
cmpl %eax, %ecx
je 0xc6b21
movq %r15, %rdi
movq %r14, %rsi
callq 0x2300
jmp 0xc6ac9
movq %r14, %rdi
callq 0x2130
movq (%r12), %rdi
movq 0x8(%r12), %rax
movl 0x10(%rbx), %esi
testl %esi, %esi
je 0xc6b3f
movq 0x18(%rbx), %rdx
jmp 0xc6b41
xorl %edx, %edx
callq *%rax
movq %rax, 0x18(%rbx)
movq %r14, %rdi
callq 0x22c0
movl 0x10(%rbx), %eax
movl 0x1c(%r12), %ecx
leal -0x1(%rcx), %edx
cmpl %edx, %eax
je 0xc6b65
cmpq $0x0, 0x18(%rbx)
je 0xc6b6c
incl %eax
cltd
idivl %ecx
movl %edx, %ecx
movl %ecx, 0x10(%rbx)
testl %ecx, %ecx
jne 0xc6b85
movq 0x10(%r12), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x10(%r12)
movq %rax, 0x8(%rbx)
movq %r15, %rdi
callq 0x2070
movq %r14, %rdi
callq 0x2130
jmp 0xc6ab3
xorl %edi, %edi
callq 0x23b0
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: print_peak_line(int, int, int, long)
void print_peak_line(int c, int x, int exceed, int64_t cnt)
{
	int j;
	if (c >= 0) fprintf(stderr, "[M::%s] %5d: ", __func__, c);
	else fprintf(stderr, "[M::%s] %5s: ", __func__, "rest");
	for (j = 0; j < x; ++j) fputc('*', stderr);
	if (exceed) fputc('>', stderr);
	fprintf(stderr, " %lld\n", (long long)cnt);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r14d
movl %edi, %ecx
movq 0x18c039(%rip), %r15    # 0x252fe0
movq (%r15), %rdi
testl %ecx, %ecx
js 0xc6fc5
leaq 0x124633(%rip), %rsi    # 0x1eb5e8
leaq 0x12463a(%rip), %rdx    # 0x1eb5f6
xorl %eax, %eax
callq 0x22b0
jmp 0xc6fe1
leaq 0x12463a(%rip), %rsi    # 0x1eb606
leaq 0x124623(%rip), %rdx    # 0x1eb5f6
leaq 0x12463a(%rip), %rcx    # 0x1eb614
xorl %eax, %eax
callq 0x22b0
xorl %r12d, %r12d
testl %r14d, %r14d
cmovgl %r14d, %r12d
pushq $0x2a
popq %r14
subl $0x1, %r12d
jb 0xc7002
movq (%r15), %rsi
movl %r14d, %edi
callq 0x2270
jmp 0xc6fef
testl %ebp, %ebp
je 0xc7011
movq (%r15), %rsi
pushq $0x3e
popq %rdi
callq 0x2270
movq (%r15), %rdi
leaq 0x123ba7(%rip), %rsi    # 0x1eabc2
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x22b0
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: print_peak(long long*, long long, long long)
void print_peak(long long* cov_buf, long long cov_buf_length, long long max_i)
{
    long long i;
    const long long hist_max = 100;
    // print histogram
	for (i = 0; i < cov_buf_length; ++i) 
    {
		long long x, exceed = 0;
		x = (int)((double)hist_max * cov_buf[i] / cov_buf[max_i] + .499);
		if (x > hist_max) exceed = 1, x = hist_max; // may happen if cnt[2] is higher
		if (i > max_i && x == 0) break;
		print_peak_line(i, x, exceed, cov_buf[i]);
	}
	{
		long long x, exceed = 0;
		long long rest = 0;
		for (; i < cov_buf_length; ++i) rest += cov_buf[i];
		x = (int)((double)hist_max * rest / cov_buf[max_i] + .499);
		if (x > hist_max) exceed = 1, x = hist_max;
		print_peak_line(-1, x, exceed, rest);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
xorl %r13d, %r13d
testq %rsi, %rsi
movl $0x0, %ebp
cmovgq %rsi, %rbp
movq %rdi, %r12
pushq $0x64
popq %rbx
cmpq %r13, %rbp
je 0xc70a3
movq (%r12,%r13,8), %rcx
cvtsi2sd %rcx, %xmm0
mulsd 0x124527(%rip), %xmm0   # 0x1eb590
cvtsi2sdq (%r12,%r14,8), %xmm1
divsd %xmm1, %xmm0
addsd 0x118f95(%rip), %xmm0   # 0x1e0010
cvttsd2si %xmm0, %esi
cmpq %r14, %r13
jle 0xc7088
testl %esi, %esi
je 0xc70a0
xorl %edx, %edx
cmpl $0x64, %esi
cmovgel %ebx, %esi
setg %dl
movl %r13d, %edi
callq 0xc6f8e
incq %r13
jmp 0xc7053
movq %r13, %rbp
cmpq %rbp, %r15
cmovleq %rbp, %r15
xorl %ecx, %ecx
cmpq %rbp, %r15
je 0xc70ba
addq (%r12,%rbp,8), %rcx
incq %rbp
jmp 0xc70ac
cvtsi2sd %rcx, %xmm0
mulsd 0x1244c9(%rip), %xmm0   # 0x1eb590
cvtsi2sdq (%r12,%r14,8), %xmm1
divsd %xmm1, %xmm0
addsd 0x118f37(%rip), %xmm0   # 0x1e0010
cvttsd2si %xmm0, %eax
xorl %edx, %edx
cmpl $0x65, %eax
setge %dl
cmpl $0x64, %eax
cmovll %eax, %ebx
pushq $-0x1
popq %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc6f8e
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: init_hap_alignment_struct(hap_alignment_struct*, unsigned int)
void init_hap_alignment_struct(hap_alignment_struct* x, uint32_t size)
{
    x->vote_counting = (uint64_t*)malloc(sizeof(uint64_t)*size);
    memset(x->vote_counting, 0, sizeof(uint64_t)*size);

    x->visit = (uint8_t*)malloc(sizeof(uint8_t)*size);
    memset(x->visit, 0, size);

    kv_init(x->u_vecs.a);
    kv_init(x->u_buffer.a);
    kv_init(x->u_buffer_tailIndex.a);
    kv_init(x->u_buffer_prevIndex.a);
    kv_init(x->u_buffer_beg.a);
    kv_init(x->u_buffer_flag.a);
    kv_init(x->u_can.a);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl %esi, %r14d
leaq (,%r14,8), %rsi
pushq $0x1
popq %r15
movq %r15, %rdi
callq 0x2120
movq %rax, (%rbx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x2120
movq %rax, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
andq $0x0, 0x20(%rbx)
movups %xmm0, 0x30(%rbx)
andq $0x0, 0x40(%rbx)
movups %xmm0, 0x50(%rbx)
andq $0x0, 0x60(%rbx)
movups %xmm0, 0x70(%rbx)
andq $0x0, 0x80(%rbx)
movups %xmm0, 0x90(%rbx)
andq $0x0, 0xa0(%rbx)
movups %xmm0, 0xb0(%rbx)
andq $0x0, 0xc0(%rbx)
movups %xmm0, 0xd0(%rbx)
andq $0x0, 0xe0(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: init_pip_hh(asg_t*, ma_hit_t_alloc*, ma_sub_t*, long long)
uint8_t *init_pip_hh(asg_t *rg, ma_hit_t_alloc* reverse_sources, ma_sub_t *coverage_cut, long long sc)
{
    uint8_t *c = NULL; CALLOC(c, rg->n_seq);
    ma_hit_t *h = NULL;
    uint32_t i, k;
    long long R_Base, C_Base;
    for (i = 0; i < rg->n_seq; i++) {
        if(sc <= 0){
            c[i] = 1;
            continue;
        }
        R_Base = (coverage_cut[i].e - coverage_cut[i].s);
        for (k = 0, C_Base = 0; k < reverse_sources[i].length; k++){
            h = &(reverse_sources[i].buffer[k]);
            C_Base += (Get_qe((*h)) - Get_qs((*h)));
        }
        C_Base = (R_Base!=0?(C_Base/R_Base):0);
        C_Base /= sc;
        c[i] = 1;
        if(C_Base < REV_W) c[i] = REV_W -  C_Base;
    }
    return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl 0x14(%rdi), %r12d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
pushq $0x1
popq %rsi
movq %r12, %rdi
callq 0x2120
movq %rax, %rcx
xorl %esi, %esi
cmpq %r12, %rsi
je 0xc7b0a
testq %rbx, %rbx
jle 0xc7ade
imulq $0xc, %rsi, %rax
movl 0x4(%r14,%rax), %edx
movl (%r14,%rax), %r8d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %r8d
movl %edx, %r9d
subl %r8d, %r9d
imulq $0x18, %rsi, %rax
leaq (%r15,%rax), %r10
movl 0xc(%r15,%rax), %eax
imulq $0x28, %rax, %r11
xorl %r13d, %r13d
xorl %eax, %eax
cmpq %r13, %r11
je 0xc7ad5
movq (%r10), %rbp
movl 0x8(%rbp,%r13), %edi
subl (%rbp,%r13), %edi
addq %rdi, %rax
addq $0x28, %r13
jmp 0xc7aba
cmpl %r8d, %edx
jne 0xc7ae4
xorl %eax, %eax
jmp 0xc7aec
movb $0x1, (%rcx,%rsi)
jmp 0xc7b02
movl %r9d, %edi
xorl %edx, %edx
divq %rdi
cqto
idivq %rbx
movb $0x1, (%rcx,%rsi)
cmpq $0x7, %rax
jg 0xc7b02
movb $0x8, %dl
subb %al, %dl
movb %dl, (%rcx,%rsi)
incq %rsi
jmp 0xc7a7b
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: destory_hap_alignment_struct_pip(hap_alignment_struct_pip*)
void destory_hap_alignment_struct_pip(hap_alignment_struct_pip* x)
{
    uint32_t i;
    for (i = 0; i < x->num_threads; i++)
    {
        destory_hap_alignment_struct(&(x->buf[i]));
    }

    free(x->buf);
    free(x->hh);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
movl 0x8(%rbx), %eax
movq (%rbx), %rdi
cmpq %rax, %r15
jae 0xc7c88
addq %r14, %rdi
callq 0xc79eb
incq %r15
addq $0xf0, %r14
jmp 0xc7c69
callq 0x2220
movq 0x10(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: init_hap_overlaps_list(hap_overlaps_list*, unsigned int)
void init_hap_overlaps_list(hap_overlaps_list* x, uint32_t num)
{
    uint32_t i = 0;
    x->num = num;
    x->x = (kvec_hap_overlaps*)malloc(sizeof(kvec_hap_overlaps)*x->num);
    for (i = 0; i < x->num; i++)
    {
        kv_init(x->x[i].a);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl %esi, 0x8(%rdi)
movl %esi, %eax
imulq $0x18, %rax, %rbx
movq %rbx, %rdi
callq 0x2280
movq %rax, (%r14)
xorl %ecx, %ecx
xorps %xmm0, %xmm0
cmpq %rcx, %rbx
je 0xc7cd0
movups %xmm0, (%rax,%rcx)
andq $0x0, 0x10(%rax,%rcx)
addq $0x18, %rcx
jmp 0xc7cbb
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: destory_hap_overlaps_list(hap_overlaps_list*)
void destory_hap_overlaps_list(hap_overlaps_list* x)
{
    uint32_t i = 0;
    for (i = 0; i < x->num; i++)
    {
        kv_destroy(x->x[i].a);
    }
    free(x->x);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x10
popq %r14
xorl %r15d, %r15d
movl 0x8(%rbx), %eax
movq (%rbx), %rdi
cmpq %rax, %r15
jae 0xc7d0c
movq (%rdi,%r14), %rdi
callq 0x2220
incq %r15
addq $0x18, %r14
jmp 0xc7cef
popq %rbx
popq %r14
popq %r15
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: prefilter(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, float, unsigned int)
uint32_t prefilter(uint32_t x_pos, uint32_t y_pos, uint32_t xLen, uint32_t yLen, uint32_t dir, 
float Hap_rate, uint32_t seedOcc)
{
    uint32_t max_count = 0, min_count = 0;
    uint32_t /**xLeftBeg, **/xLeftLen, yLeftBeg, yLeftLen;
    uint32_t xRightBeg, xRightLen, yRightBeg, yRightLen;
    if(dir == 0)
    {
        /**xLeftBeg = 0;**/ xLeftLen = x_pos; xRightBeg = x_pos; xRightLen = xLen - xRightBeg;
        yLeftBeg = 0; yLeftLen = y_pos; yRightBeg = y_pos; yRightLen = yLen - yRightBeg;
    }
    else
    {
        /**xLeftBeg = 0;**/ xLeftLen = x_pos; xRightBeg = x_pos; xRightLen = xLen - xRightBeg;

        yLeftBeg = y_pos + 1; yLeftLen = yLen - yLeftBeg;
        yRightBeg = 0; yRightLen = y_pos + 1;
    }



    max_count = seedOcc;
    min_count = MIN(xLeftLen, yLeftLen) + MIN(xRightLen, yRightLen);
    if(min_count == 0) return NON_PLOID;
    if(max_count <= min_count*Hap_rate) return NON_PLOID;
    return PLOID;
}

// Assembly:
movl %ecx, %eax
subl %esi, %eax
leal 0x1(%rsi), %r10d
subl %r10d, %ecx
testl %r8d, %r8d
cmovel %esi, %ecx
cmovnel %r10d, %eax
subl %edi, %edx
cmpl %edi, %ecx
cmovael %edi, %ecx
cmpl %eax, %edx
cmovael %eax, %edx
addl %ecx, %edx
je 0xc7d57
movl %r9d, %eax
cvtsi2ss %rax, %xmm1
movl %edx, %eax
cvtsi2ss %rax, %xmm2
mulss %xmm0, %xmm2
xorl %eax, %eax
ucomiss %xmm1, %xmm2
setae %al
retq
pushq $0x1
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: print_debug_unitig(ma_utg_t*, unsigned long*, char const*)
void print_debug_unitig(ma_utg_t *xReads, uint64_t* position_index, const char* infor)
{
    uint32_t k;
    fprintf(stderr, "\n%s: n = %u\n", infor, xReads->n);
    for (k = 0; k < xReads->n; k++)
    {
        fprintf(stderr, "(%u)v: %u, len: %u, index: %u, pos: %u\n", 
        k, (uint32_t)(xReads->a[k]>>32), (uint32_t)xReads->a[k], (uint32_t)(position_index[xReads->a[k]>>33]),
        (uint32_t)(position_index[xReads->a[k]>>33]>>32));
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18b26b(%rip), %r13    # 0x252fe0
movq (%r13), %rdi
movl 0x10(%r14), %ecx
leaq 0x123895(%rip), %rsi    # 0x1eb619
xorl %eax, %eax
callq 0x22b0
leaq 0x123894(%rip), %r15    # 0x1eb626
xorl %r12d, %r12d
movl 0x10(%r14), %eax
cmpq %rax, %r12
jae 0xc7dd8
movq (%r13), %rdi
movq 0x18(%r14), %rax
movq (%rax,%r12,8), %r8
movq %r8, %rcx
shrq $0x20, %rcx
movq %r8, %rax
shrq $0x21, %rax
movq (%rbx,%rax,8), %r9
movq %r9, %rax
shrq $0x20, %rax
movl %eax, (%rsp)
movq %r15, %rsi
movl %r12d, %edx
xorl %eax, %eax
callq 0x22b0
incq %r12
jmp 0xc7d95
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: deduplicate_edge(kvec_asg_arc_t_offset*)
void deduplicate_edge(kvec_asg_arc_t_offset* u_buffer)
{
    if(u_buffer->a.n == 0) return;
    long long i = u_buffer->a.n - 1, k, i_off;
    uint32_t v = u_buffer->a.a[i].x.ul>>33, m;

    for (; i >= 0; i--) {
        if((u_buffer->a.a[i].x.ul>>33) != v) break;
    }

    i = i + 1;
    for (m = i; i < (long long)u_buffer->a.n; i++)
    {
        if(u_buffer->a.a[i].x.del) continue;

        i_off = Cal_Off(u_buffer->a.a[i].Off);

        for (k = i + 1; k < (long long)u_buffer->a.n; k++)
        {
            if(u_buffer->a.a[k].x.del) continue;
            if(u_buffer->a.a[i].x.el != u_buffer->a.a[k].x.el) continue;
            if(i_off != Cal_Off(u_buffer->a.a[k].Off)) continue;
            u_buffer->a.a[k].x.del = 1;
            u_buffer->a.a[i].weight += u_buffer->a.a[k].weight;
        }
        u_buffer->a.a[m] = u_buffer->a.a[i];
        m++;
    }

    u_buffer->a.n = m;
    ///fprintf(stderr, "u_buffer->a.n: %u, i: %lld\n", u_buffer->a.n, i);
}

// Assembly:
movq (%rdi), %rcx
testq %rcx, %rcx
je 0xc7f18
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq -0x1(%rcx), %rdx
movq 0x10(%rdi), %rax
imulq $0x28, %rcx, %rsi
addq %rax, %rsi
addq $-0x28, %rsi
movq (%rsi), %r8
cmpq $-0x1, %rdx
movabsq $-0x1, %rax
cmovlq %rdx, %rax
testq %rdx, %rdx
js 0xc7e3f
movq (%rsi), %r9
xorq %r8, %r9
shrq $0x21, %r9
jne 0xc7e3c
decq %rdx
addq $-0x28, %rsi
jmp 0xc7e22
movq %rdx, %rax
incq %rax
movl %eax, %edx
movl %edx, %esi
cmpq %rcx, %rax
jge 0xc7f0d
movq 0x10(%rdi), %r8
imulq $0x28, %rax, %r9
cmpl $0x0, 0xc(%r8,%r9)
js 0xc7f05
leaq (%r8,%r9), %r10
movq 0x18(%r10), %r10
movl %r10d, %r11d
shrq $0x20, %r10
subq %r11, %r10
movq %rax, %r11
leaq (%r8,%r9), %r14
addq $0x12, %r14
imulq $0x28, %r11, %rbx
incq %r11
addq $0x34, %rbx
cmpq %rcx, %r11
jge 0xc7edc
movl (%r8,%rbx), %ebp
testl %ebp, %ebp
js 0xc7eb6
movb (%r14), %r15b
cmpb 0x6(%r8,%rbx), %r15b
jne 0xc7eb6
movq 0xc(%r8,%rbx), %r15
movl %r15d, %r12d
shrq $0x20, %r15
subq %r12, %r15
cmpq %r15, %r10
je 0xc7ebf
incq %r11
addq $0x28, %rbx
jmp 0xc7e8b
orl $0x80000000, %ebp       # imm = 0x80000000
movl %ebp, (%r8,%rbx)
movq 0x10(%rdi), %r8
movq 0x14(%r8,%rbx), %rcx
addq %rcx, 0x20(%r8,%r9)
movq (%rdi), %rcx
jmp 0xc7e78
imulq $0x28, %rsi, %rcx
movq 0x20(%r8,%r9), %rsi
movq %rsi, 0x20(%r8,%rcx)
movups (%r8,%r9), %xmm0
movups 0x10(%r8,%r9), %xmm1
movups %xmm1, 0x10(%r8,%rcx)
movups %xmm0, (%r8,%rcx)
incl %edx
movq (%rdi), %rcx
incq %rax
jmp 0xc7e44
movq %rsi, (%rdi)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: cmp_hap_alignment(void const*, void const*)
int cmp_hap_alignment(const void * a, const void * b)
{
    if((*(asg_arc_t_offset*)a).x.el > (*(asg_arc_t_offset*)b).x.el) return 1;
    if((*(asg_arc_t_offset*)a).x.el < (*(asg_arc_t_offset*)b).x.el) return -1;

    long long aOff = Cal_Off((*(asg_arc_t_offset*)a).Off);
    long long bOff = Cal_Off((*(asg_arc_t_offset*)b).Off);

    if(aOff > bOff) return 1;
    if(aOff < bOff) return -1;

    if(((*(asg_arc_t_offset*)a).Off>>32) > ((*(asg_arc_t_offset*)b).Off>>32)) return 1;
    if(((*(asg_arc_t_offset*)a).Off>>32) < ((*(asg_arc_t_offset*)b).Off>>32)) return -1;

    if((uint32_t)((*(asg_arc_t_offset*)a).Off) > (uint32_t)((*(asg_arc_t_offset*)b).Off)) return 1;
    if((uint32_t)((*(asg_arc_t_offset*)a).Off) < (uint32_t)((*(asg_arc_t_offset*)b).Off)) return -1;

    if((*(asg_arc_t_offset*)a).weight < (*(asg_arc_t_offset*)b).weight) return 1;
    if((*(asg_arc_t_offset*)a).weight > (*(asg_arc_t_offset*)b).weight) return -1;

    return 0;
}

// Assembly:
movb 0x12(%rsi), %al
movl $0x1, %ecx
cmpb %al, 0x12(%rdi)
jbe 0xc7f29
movl %ecx, %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jae 0xc7f31
retq
pushq %r14
pushq %rbx
movq 0x18(%rdi), %rdx
movq %rdx, %r8
shrq $0x20, %r8
movl %edx, %r9d
movq %r8, %r11
subq %r9, %r11
movq 0x18(%rsi), %r9
movq %r9, %r10
shrq $0x20, %r10
movl %r9d, %ebx
movq %r10, %r14
subq %rbx, %r14
cmpq %r14, %r11
popq %rbx
popq %r14
jg 0xc7f26
jl 0xc7f30
cmpl %r10d, %r8d
ja 0xc7f26
cmpl %r10d, %r8d
jb 0xc7f30
cmpl %r9d, %edx
ja 0xc7f26
jb 0xc7f30
movq 0x20(%rdi), %rdx
movq 0x20(%rsi), %rsi
movl %ecx, %eax
cmpq %rsi, %rdx
jb 0xc7f30
xorl %eax, %eax
cmpq %rdx, %rsi
sbbl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: cmp_hap_alignment_chaining(void const*, void const*)
int cmp_hap_alignment_chaining(const void * a, const void * b)
{
    if((*(asg_arc_t_offset*)a).x.el > (*(asg_arc_t_offset*)b).x.el) return 1;
    if((*(asg_arc_t_offset*)a).x.el < (*(asg_arc_t_offset*)b).x.el) return -1;

    if(((*(asg_arc_t_offset*)a).Off>>32) > ((*(asg_arc_t_offset*)b).Off>>32)) return 1;
    if(((*(asg_arc_t_offset*)a).Off>>32) < ((*(asg_arc_t_offset*)b).Off>>32)) return -1;

    if((uint32_t)((*(asg_arc_t_offset*)a).Off) > (uint32_t)((*(asg_arc_t_offset*)b).Off)) return 1;
    if((uint32_t)((*(asg_arc_t_offset*)a).Off) < (uint32_t)((*(asg_arc_t_offset*)b).Off)) return -1;

    return 0;
}

// Assembly:
movb 0x12(%rsi), %al
pushq $0x1
popq %rcx
cmpb %al, 0x12(%rdi)
jbe 0xc7f9c
movl %ecx, %eax
retq
pushq $-0x1
popq %rax
jae 0xc7fa2
retq
movq 0x18(%rdi), %rdx
movq %rdx, %rdi
shrq $0x20, %rdi
movq 0x18(%rsi), %rsi
movq %rsi, %r8
shrq $0x20, %r8
cmpq %r8, %rdi
ja 0xc7f99
cmpl %r8d, %edi
jb 0xc7fa1
movl %ecx, %eax
cmpl %esi, %edx
ja 0xc7fa1
xorl %eax, %eax
cmpl %esi, %edx
sbbl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: cmp_hap_candidates(void const*, void const*)
int cmp_hap_candidates(const void * a, const void * b)
{
    if((*(hap_candidates*)a).weight < (*(hap_candidates*)b).weight) return 1;
    if((*(hap_candidates*)a).weight > (*(hap_candidates*)b).weight) return -1;

    if((*(hap_candidates*)a).index_beg > (*(hap_candidates*)b).index_beg) return 1;
    if((*(hap_candidates*)a).index_beg < (*(hap_candidates*)b).index_beg) return -1;
    
    return 0;
}

// Assembly:
movq (%rsi), %rcx
pushq $0x1
popq %rax
cmpq %rcx, (%rdi)
jae 0xc7fdb
retq
jbe 0xc7fe1
pushq $-0x1
popq %rax
retq
movl 0x18(%rdi), %ecx
movl 0x18(%rsi), %edx
cmpl %edx, %ecx
ja 0xc7fda
xorl %eax, %eax
cmpl %edx, %ecx
sbbl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: classify_hap_overlap(long long, long long, long long, long long, long long, long long, long long*, long long*, long long*, long long*)
uint32_t classify_hap_overlap(long long xBeg, long long xEnd, long long xLen,
long long yBeg, long long yEnd, long long yLen, long long* r_xBeg, long long* r_xEnd, 
long long* r_yBeg, long long* r_yEnd)
{
    long long n_x_beg, n_x_end, n_y_beg, n_y_end;
    get_hap_overlapLen(xBeg, xEnd, xLen, yBeg, yEnd, yLen, &n_x_beg, &n_x_end, &n_y_beg, &n_y_end);
    if(r_xBeg) (*r_xBeg) = n_x_beg;
    if(r_xEnd) (*r_xEnd) = n_x_end;
    if(r_yBeg) (*r_yBeg) = n_y_beg;
    if(r_yEnd) (*r_yEnd) = n_y_end;
    if(n_x_beg == 0 && n_x_end == xLen - 1) return YCX;
    if(n_y_beg == 0 && n_y_end == yLen - 1) return XCY;
    if(n_y_beg == 0 && n_x_end == xLen - 1) return X2Y;
    if(n_x_beg == 0 && n_y_end == yLen - 1) return Y2X;
    return XCY;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %r9, %rbx
movq %rdx, %r14
movq 0x58(%rsp), %r15
movq 0x50(%rsp), %r12
movq %rsp, %rax
leaq 0x10(%rsp), %r10
leaq 0x8(%rsp), %r11
leaq 0x18(%rsp), %r13
pushq %rax
pushq %r10
pushq %r11
pushq %r13
callq 0xd3bc4
addq $0x20, %rsp
testq %r12, %r12
je 0xc803f
movq 0x18(%rsp), %rax
movq %rax, (%r12)
movq 0x60(%rsp), %rax
testq %r15, %r15
je 0xc8051
movq 0x8(%rsp), %rcx
movq %rcx, (%r15)
movq 0x68(%rsp), %rcx
testq %rax, %rax
je 0xc8063
movq 0x10(%rsp), %rdx
movq %rdx, (%rax)
testq %rcx, %rcx
je 0xc806f
movq (%rsp), %rax
movq %rax, (%rcx)
movq 0x18(%rsp), %rdx
testq %rdx, %rdx
jne 0xc8088
leaq -0x1(%r14), %rax
cmpq %rax, 0x8(%rsp)
jne 0xc8088
pushq $0x3
jmp 0xc80a3
cmpq $0x0, 0x10(%rsp)
pushq $0x2
popq %rcx
je 0xc80a6
testq %rdx, %rdx
jne 0xc80b0
decq %rbx
cmpq %rbx, (%rsp)
jne 0xc80b0
pushq $0x1
popq %rax
jmp 0xc80b2
leaq -0x1(%rbx), %rax
cmpq %rax, (%rsp)
jne 0xc80c0
movl %ecx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
decq %r14
xorl %eax, %eax
cmpq %r14, 0x8(%rsp)
jne 0xc8093
jmp 0xc80b2
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: get_pair_hap_coverage(unsigned long*, unsigned int, ma_hit_t_alloc*, ma_sub_t*)
uint64_t get_pair_hap_coverage(uint64_t* readIDs, uint32_t Len, ma_hit_t_alloc* sources, ma_sub_t* coverage_cut)
{
    uint32_t m, n, qn;
    ma_hit_t *h;
    uint64_t R_bases = 0, C_bases = 0;

    for (m = 0; m < Len; m++)
    {
        qn = readIDs[m]>>33;
        R_bases += coverage_cut[qn].e - coverage_cut[qn].s;
        for (n = 0; n < (uint64_t)(sources[qn].length); n++)
        {
            h = &(sources[qn].buffer[n]);
            C_bases += Get_qe((*h)) - Get_qs((*h));
        }
    }

    return C_bases/R_bases;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %esi, %esi
xorl %r9d, %r9d
movl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
xorl %r8d, %r8d
xorl %eax, %eax
cmpq %rsi, %r9
je 0xc813e
movq (%rdi,%r9,8), %rbx
shrq $0x21, %rbx
imulq $0xc, %rbx, %r14
movl 0x4(%rcx,%r14), %r11d
movl (%rcx,%r14), %ebp
andl %r10d, %ebp
subl %ebp, %r11d
imulq $0x18, %rbx, %r14
leaq (%rdx,%r14), %rbx
movl 0xc(%rdx,%r14), %r14d
imulq $0x28, %r14, %r14
xorl %r15d, %r15d
cmpq %r15, %r14
je 0xc8136
movq (%rbx), %r12
movl 0x8(%r12,%r15), %r13d
subl (%r12,%r15), %r13d
addq %r13, %rax
addq $0x28, %r15
jmp 0xc811c
addq %r11, %r8
incq %r9
jmp 0xc80e8
xorl %edx, %edx
divq %r8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: vote_overlap_type(kvec_asg_arc_t_offset*, hap_candidates*, unsigned long*, ma_utg_t*, ma_utg_t*)
uint32_t vote_overlap_type(kvec_asg_arc_t_offset* u_buffer, hap_candidates* hap_can, 
uint64_t* position_index, ma_utg_t* xReads, ma_utg_t* yReads)
{
    uint32_t i, xBasePos, yBasePos;
    asg_arc_t_offset* arch = NULL;
    uint32_t flag[4];
    flag[X2Y] = flag[Y2X] = flag[XCY] = flag[YCX] = 0;


    for (i = hap_can->index_beg; i <= hap_can->index_end; i++)
    {
        arch = &(u_buffer->a.a[i]);
        xBasePos = (uint32_t)(arch->Off>>32);
        yBasePos = (uint32_t)(arch->Off);
        flag[classify_hap_overlap(xBasePos, xBasePos, xReads->len, yBasePos, yBasePos, yReads->len,
        NULL, NULL, NULL, NULL)]++;
    }
    
    uint32_t max_flag_i = 0;
    for (i = 0; i < 4; i++)
    {
        if(i == max_flag_i) continue;
        if(flag[i] > flag[max_flag_i])
        {
            max_flag_i = i;
        }
    }
    
    return max_flag_i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movl 0x18(%rsi), %ebp
movl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
cmpl 0x1c(%r15), %ebp
ja 0xc9374
movq 0x10(%r12), %rax
movl %ebp, %ecx
imulq $0x28, %rcx, %rcx
movq 0x18(%rax,%rcx), %rdi
movl %edi, %ecx
shrq $0x20, %rdi
movl (%r14), %edx
andq %r13, %rdx
movl (%rbx), %r9d
andq %r13, %r9
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rdi, %rsi
movq %rcx, %r8
callq 0xc7ff2
movl %eax, %eax
incl 0x20(%rsp,%rax,4)
incl %ebp
jmp 0xc932b
xorl %ecx, %ecx
xorl %eax, %eax
cmpq $0x4, %rcx
je 0xc939a
movl %eax, %edx
cmpq %rdx, %rcx
je 0xc9395
movl 0x20(%rsp,%rcx,4), %edi
movl %ecx, %esi
cmpl 0x20(%rsp,%rdx,4), %edi
ja 0xc9393
movl %eax, %esi
movl %esi, %eax
incq %rcx
jmp 0xc9378
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: print_asg_arc_t_offset(asg_arc_t_offset*, long long, char const*)
void print_asg_arc_t_offset(asg_arc_t_offset* x, long long n, const char* info)
{
    fprintf(stderr,"\n\n(%s)n: %lld\n", info, n);
    long long i, x_off, y_off;
    for (i = 0; i < n; i++)
    {
        x_off = (long long)(x[i].Off>>32);
        y_off = (long long)((uint32_t)x[i].Off);
        fprintf(stderr, "i: %lld, x_off: %lld, y_off: %lld, weight: %lu, rev: %u, ol: %u\n", 
        i, x_off, y_off, (unsigned long)x[i].weight, x[i].x.el, x[i].x.ol);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18947b(%rip), %r13    # 0x252fe0
movq (%r13), %rdi
leaq 0x121ade(%rip), %rsi    # 0x1eb64e
xorl %r15d, %r15d
movq %rbx, %rcx
xorl %eax, %eax
callq 0x22b0
testq %rbx, %rbx
cmovleq %r15, %rbx
addq $0x20, %r14
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
leaq 0x121ac9(%rip), %r15    # 0x1eb65d
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0xc9bd6
movq -0x8(%r14), %rcx
movq (%r14), %r9
movl %ecx, %r8d
shrq $0x20, %rcx
movq (%r13), %rdi
movzbl -0xe(%r14), %r10d
movl -0x14(%r14), %r11d
andl %ebp, %r11d
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x22b0
popq %rcx
popq %rdx
incq %r12
addq $0x28, %r14
jmp 0xc9b97
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/Purge_Dups.cpp
// Function: get_idx_by_base(ma_utg_t*, asg_t*, long long, long long, long long*, long long*)
void get_idx_by_base(ma_utg_t *x, asg_t *read_g, long long beg_base, long long end_base, 
                                            long long* beg_idx, long long* end_idx)
{
    long long offset, r_beg, r_end;
    uint64_t i, rId;
    (*beg_idx) = (*end_idx) = -1;
    for (i = 0, offset = 0; i < x->n; i++)
    {
        rId = x->a[i]>>33;
        r_beg = offset; r_end = offset + (long long)(read_g->seq[rId].len) - 1;
        offset += (uint32_t)x->a[i];
        if(beg_base > r_end || r_beg > end_base)
        {
            if((*beg_idx) != -1 && (*end_idx) != -1) break;
            continue;
        } 
        if((*beg_idx) == -1) (*beg_idx) = i;
        (*end_idx) = i;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
orq $-0x1, (%r9)
orq $-0x1, (%r8)
movl 0x10(%rdi), %eax
xorl %r10d, %r10d
xorl %r11d, %r11d
cmpq %r10, %rax
je 0xcaf4f
movq 0x18(%rdi), %rbx
movq (%rbx,%r10,8), %rbx
movq (%r8), %r14
cmpq %rcx, %r11
jg 0xcaf39
movq 0x20(%rsi), %r15
movq %rbx, %r12
shrq $0x21, %r12
movl (%r15,%r12,8), %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
addq %r11, %r15
cmpq %rdx, %r15
jle 0xcaf39
cmpq $-0x1, %r14
jne 0xcaf34
movq %r10, (%r8)
movq %r10, (%r9)
jmp 0xcaf45
cmpq $-0x1, %r14
je 0xcaf45
cmpq $-0x1, (%r9)
jne 0xcaf4f
movl %ebx, %ebx
addq %rbx, %r11
incq %r10
jmp 0xcaef8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: adjust_hap_overlaps_score(ma_utg_t*, float*, long long*, long long, long long, long long, long long)
void adjust_hap_overlaps_score(ma_utg_t* xReads, float *sim, long long *score, 
long long xUid, long long yUid, long long xBeg, long long xEnd)
{
    uint64_t all, found;
    if(count_unique_k_mers(xReads->s + xBeg, xEnd+1-xBeg, xUid, yUid, &all, &found))
    {
        double k_w = 1;
        if(sim) (*sim) = MAX((*sim), (all == 0?0:(((double)found)/((double)all))));
        if(all) k_w += ((double)(found)/(double)(all));
        if(score) (*score) = ((*score)*k_w)/2;
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %r8, %rax
movq %rdx, %rbx
movq %rsi, %r14
movq 0x30(%rsp), %rsi
movq 0x20(%rdi), %rdi
addq %r9, %rdi
subq %r9, %rsi
incq %rsi
leaq 0x10(%rsp), %r8
leaq 0x8(%rsp), %r9
movq %rcx, %rdx
movq %rax, %rcx
callq 0x11f451
testq %rax, %rax
je 0xcc3df
movq 0x10(%rsp), %rax
movq %rax, %xmm0
testq %r14, %r14
je 0xcc369
movss (%r14), %xmm1
movsd 0x116f6e(%rip), %xmm3   # 0x1e3270
movsd 0x8(%rsp), %xmm4
unpcklps %xmm3, %xmm4            # xmm4 = xmm4[0],xmm3[0],xmm4[1],xmm3[1]
movapd 0x116f6d(%rip), %xmm5   # 0x1e3280
subpd %xmm5, %xmm4
movapd %xmm4, %xmm2
unpckhpd %xmm4, %xmm2            # xmm2 = xmm2[1],xmm4[1]
addsd %xmm4, %xmm2
movdqa %xmm0, %xmm4
punpckldq %xmm3, %xmm4    # xmm4 = xmm4[0],xmm3[0],xmm4[1],xmm3[1]
subpd %xmm5, %xmm4
movapd %xmm4, %xmm3
unpckhpd %xmm4, %xmm3            # xmm3 = xmm3[1],xmm4[1]
addsd %xmm4, %xmm3
divsd %xmm3, %xmm2
xorpd %xmm3, %xmm3
testq %rax, %rax
je 0xcc34c
movapd %xmm2, %xmm3
cvtss2sd %xmm1, %xmm5
xorpd %xmm4, %xmm4
je 0xcc35a
cvtsd2ss %xmm2, %xmm4
ucomisd %xmm3, %xmm5
jae 0xcc364
movapd %xmm4, %xmm1
movss %xmm1, (%r14)
testq %rax, %rax
je 0xcc3b9
movsd 0x8(%rsp), %xmm2
movsd 0x116ef4(%rip), %xmm3   # 0x1e3270
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movapd 0x116ef9(%rip), %xmm4   # 0x1e3280
subpd %xmm4, %xmm2
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm4, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
divsd %xmm2, %xmm1
addsd 0x116ee9(%rip), %xmm1   # 0x1e32a0
jmp 0xcc3c1
movsd 0x116edf(%rip), %xmm1   # 0x1e32a0
testq %rbx, %rbx
je 0xcc3df
cvtsi2sdq (%rbx), %xmm0
mulsd %xmm0, %xmm1
mulsd 0x117171(%rip), %xmm1   # 0x1e3548
cvttsd2si %xmm1, %rax
movq %rax, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: print_hap_paf(ma_ug_t*, hap_overlaps*)
void print_hap_paf(ma_ug_t *ug, hap_overlaps* ovlp)
{
    fprintf(stderr, "utg%.6d%c\t%u(%u)\t%u(%u)\t%u(%u)\t%c\tutg%.6d%c\t%u(%u)\t%u(%u)\t%u(%u)\t%u\t%u\t%lld(%u)\n", 
    ovlp->xUid+1, "lc"[ug->u.a[ovlp->xUid].circ], ug->u.a[ovlp->xUid].len, ug->u.a[ovlp->xUid].n,
    ovlp->x_beg_pos, ovlp->x_beg_id, ovlp->x_end_pos, ovlp->x_end_id, "+-"[ovlp->rev], 
    ovlp->yUid+1, "lc"[ug->u.a[ovlp->yUid].circ], ug->u.a[ovlp->yUid].len, ug->u.a[ovlp->yUid].n,
    ovlp->y_beg_pos, ovlp->y_beg_id, ovlp->y_end_pos, ovlp->y_end_id, ovlp->type, ovlp->weight, 
    ovlp->score, ovlp->status);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r10
movq %rdi, %rax
movq 0x18640b(%rip), %rcx    # 0x252fe0
movq (%rcx), %rdi
movl 0x24(%rsi), %ecx
leal 0x1(%rcx), %edx
movq 0x10(%rax), %rax
imulq $0x28, %rcx, %rcx
movl (%rax,%rcx), %r8d
movl 0x10(%rax,%rcx), %r9d
movl %r8d, %ecx
shrl $0x1f, %ecx
leaq 0x119a8f(%rip), %rsi    # 0x1e668b
movsbl (%rcx,%rsi), %ecx
movl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
andl %ebx, %r8d
movl 0x14(%r10), %r11d
movq %r11, 0x38(%rsp)
movl 0x4(%r10), %r11d
movq %r11, 0x40(%rsp)
movzbl (%r10), %r11d
leaq 0x1175fe(%rip), %r14    # 0x1e4223
movsbl (%r11,%r14), %r11d
movq %r11, 0x30(%rsp)
movl 0x28(%r10), %r14d
imulq $0x28, %r14, %r11
movl (%rax,%r11), %r13d
movl 0x10(%rax,%r11), %eax
movq %rax, 0x10(%rsp)
movl %r13d, %eax
shrl $0x1f, %eax
movsbl (%rax,%rsi), %eax
movq %rax, 0x18(%rsp)
movl 0x8(%r10), %eax
movq %rax, 0x28(%rsp)
andl %ebx, %r13d
movl 0x18(%r10), %eax
movq %rax, 0x20(%rsp)
leal 0x1(%r14), %eax
movq %rax, 0x8(%rsp)
movl 0xc(%r10), %eax
movq %rax, (%rsp)
movl 0x1c(%r10), %r15d
movl 0x10(%r10), %r12d
movl 0x20(%r10), %ebp
movzbl 0x1(%r10), %r11d
movl 0x2c(%r10), %ebx
movzbl 0x2(%r10), %r14d
subq $0x8, %rsp
leaq 0x11ea3c(%rip), %rsi    # 0x1eb6db
xorl %eax, %eax
pushq %r14
pushq 0x30(%r10)
pushq %rbx
pushq %r11
pushq %rbp
pushq %r12
pushq %r15
pushq 0x40(%rsp)
pushq 0x58(%rsp)
pushq %r13
pushq 0x70(%rsp)
pushq 0x68(%rsp)
pushq 0x98(%rsp)
pushq 0x90(%rsp)
pushq 0xa0(%rsp)
pushq 0xb8(%rsp)
pushq 0xc8(%rsp)
callq 0x22b0
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: print_chain_data(int*, int*, int*, long long)
void print_chain_data(int32_t* Scores, int32_t* Pres, int32_t* Begs, long long n)
{
    fprintf(stderr,"*****\nn_chain: %lld\n", n);
    long long i;
    for (i = 0; i < n; i++)
    {
        fprintf(stderr, "i: %lld, Scores: %d, Pres: %d, Begs: %d\n", 
        i, Scores[i], Pres[i], Begs[i]);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq 0x1862c7(%rip), %r13    # 0x252fe0
movq (%r13), %rdi
leaq 0x11ea08(%rip), %rsi    # 0x1eb72c
xorl %ebp, %ebp
movq %rcx, %rdx
xorl %eax, %eax
callq 0x22b0
testq %rbx, %rbx
cmovleq %rbp, %rbx
xorl %ebp, %ebp
cmpq %rbp, %rbx
je 0xccd64
movq (%r13), %rdi
movl (%r12,%rbp,4), %ecx
movl (%r15,%rbp,4), %r8d
movl (%r14,%rbp,4), %r9d
leaq 0x11e9ec(%rip), %rsi    # 0x1eb741
movq %rbp, %rdx
xorl %eax, %eax
callq 0x22b0
incq %rbp
jmp 0xccd39
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/Purge_Dups.cpp
// Function: set_reverse_hap_overlap(hap_overlaps*, hap_overlaps*, unsigned int*)
void set_reverse_hap_overlap(hap_overlaps* dest, hap_overlaps* source, uint32_t* types)
{
    dest->status = REVE_EXIST;
    dest->rev = source->rev;
    dest->type = types[source->type];
    dest->weight = source->weight;
    dest->xUid = source->yUid;
    dest->yUid = source->xUid;
    dest->x_beg_pos = source->y_beg_pos;
    dest->x_end_pos = source->y_end_pos;
    dest->y_beg_pos = source->x_beg_pos;
    dest->y_end_pos = source->x_end_pos;
    dest->x_beg_id = source->y_beg_id;
    dest->x_end_id = source->y_end_id;
    dest->y_beg_id = source->x_beg_id;
    dest->y_end_id = source->x_end_id;
    dest->score = source->score;
}

// Assembly:
movb $0x1, 0x2(%rdi)
movb (%rsi), %al
movb %al, (%rdi)
movzbl 0x1(%rsi), %eax
movb (%rdx,%rax,4), %al
movb %al, 0x1(%rdi)
movl 0x2c(%rsi), %eax
movl %eax, 0x2c(%rdi)
movl 0x28(%rsi), %eax
movl %eax, 0x24(%rdi)
movl 0x24(%rsi), %eax
movl %eax, 0x28(%rdi)
movq 0xc(%rsi), %rax
movq %rax, 0x4(%rdi)
movsd 0x1c(%rsi), %xmm0
movsd 0x4(%rsi), %xmm1
movlhps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movups %xmm1, 0xc(%rdi)
movq 0x14(%rsi), %rax
movq %rax, 0x1c(%rdi)
movq 0x30(%rsi), %rax
movq %rax, 0x30(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: filter_hap_overlaps_by_length(hap_overlaps_list*, unsigned int)
void filter_hap_overlaps_by_length(hap_overlaps_list* all_ovlp, uint32_t minLen)
{
    if(minLen == 0) return;
    hap_overlaps *x = NULL;
    uint32_t v, i, m, uId;    

    for (v = 0; v < all_ovlp->num; v++)
    {
        uId = v;
        m = 0;
        for (i = 0; i < all_ovlp->x[uId].a.n; i++)
        {
            x = &(all_ovlp->x[uId].a.a[i]);
            if(x->x_end_id - x->x_beg_id < minLen) continue;
            all_ovlp->x[uId].a.a[m] = (*x);
            m++;
        }
        all_ovlp->x[uId].a.n = m;
    }
}

// Assembly:
testl %esi, %esi
je 0xce15b
pushq %rbx
xorl %eax, %eax
movl 0x8(%rdi), %ecx
cmpq %rcx, %rax
jae 0xce15a
xorl %ecx, %ecx
imulq $0x18, %rax, %rdx
xorl %r8d, %r8d
movl %ecx, %ecx
movq (%rdi), %r11
leaq (%r11,%rdx), %r10
movl %r8d, %r9d
cmpq %rcx, (%r11,%rdx)
jbe 0xce152
movq 0x10(%r10), %r10
movq %rcx, %r11
shlq $0x6, %r11
movl 0x18(%r10,%r11), %ebx
subl 0x14(%r10,%r11), %ebx
cmpl %esi, %ebx
jb 0xce14e
addq %r10, %r11
shlq $0x6, %r9
movups (%r11), %xmm0
movups 0x10(%r11), %xmm1
movups 0x20(%r11), %xmm2
movups 0x30(%r11), %xmm3
movups %xmm3, 0x30(%r10,%r9)
movups %xmm2, 0x20(%r10,%r9)
movups %xmm1, 0x10(%r10,%r9)
movups %xmm0, (%r10,%r9)
incl %r8d
incl %ecx
jmp 0xce0ef
movq %r9, (%r10)
incq %rax
jmp 0xce0de
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: asg_pop_bubble_purge_graph(asg_t*)
int asg_pop_bubble_purge_graph(asg_t *purge_g)
{
	uint32_t v, n_vtx = purge_g->n_seq * 2;
	uint64_t n_pop = 0;
	buf_t b;
	if (!purge_g->is_symm) asg_symm(purge_g);
	memset(&b, 0, sizeof(buf_t));
	///set information for each node
	b.a = (binfo_t*)calloc(n_vtx, sizeof(binfo_t));
	//traverse all node with two directions 
	for (v = 0; v < n_vtx; ++v) {
		uint32_t i, n_arc = 0, nv = asg_arc_n(purge_g, v);
		asg_arc_t *av = asg_arc_a(purge_g, v);
		///some node could be deleted
		if (nv < 2 || purge_g->seq[v>>1].del || purge_g->seq[v>>1].c == ALTER_LABLE) continue;
		///some edges could be deleted
		for (i = 0; i < nv; ++i) // asg_bub_pop1() may delete some edges/arcs
			if (!av[i].del) ++n_arc;
		if (n_arc > 1)
			n_pop += asg_bub_pop1_purge_graph(purge_g, v, purge_g->n_seq, &b);            
	}
	free(b.a); free(b.S.a); free(b.T.a); free(b.b.a); free(b.e.a);
	if (n_pop) asg_cleanup(purge_g);

	if(VERBOSE >= 1)
    {
        fprintf(stderr, "[M::%s] popped %lu bubbles\n", __func__, (unsigned long)n_pop);
    }
    return n_pop;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movl 0x14(%rdi), %eax
leal (%rax,%rax), %ebp
testl %eax, %eax
js 0xcec41
movq %rbx, %rdi
callq 0x69638
xorps %xmm0, %xmm0
movq %rsp, %r15
movups %xmm0, 0x58(%r15)
movups %xmm0, 0x48(%r15)
movups %xmm0, 0x38(%r15)
movups %xmm0, 0x28(%r15)
movups %xmm0, 0x18(%r15)
movups %xmm0, 0x8(%r15)
movl %ebp, %r12d
pushq $0x1c
popq %rsi
movq %r12, %rdi
callq 0x2120
movq %rax, (%r15)
xorl %r13d, %r13d
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
xorl %r14d, %r14d
cmpq %r12, %r13
je 0xced00
movq 0x28(%rbx), %rax
movq (%rax,%r13,8), %rax
testl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
je 0xcecfb
movq 0x20(%rbx), %rcx
movl %r13d, %edx
shrl %edx
cmpl $0x0, (%rcx,%rdx,8)
js 0xcecfb
cmpb $0x1, 0x4(%rcx,%rdx,8)
je 0xcecfb
movq 0x8(%rbx), %rcx
movq %rax, %rdx
shrq $0x20, %rdx
movl %eax, %eax
imulq $0x18, %rax, %rax
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
addq $0xc, %rcx
xorl %edx, %edx
xorl %esi, %esi
cmpq %rdx, %rax
je 0xcece0
movl (%rcx,%rdx), %edi
notl %edi
shrl $0x1f, %edi
addl %edi, %esi
addq $0x18, %rdx
jmp 0xceccb
cmpl $0x2, %esi
jb 0xcecfb
movl 0x14(%rbx), %edx
andl %ebp, %edx
movq %rbx, %rdi
movl %r13d, %esi
movq %r15, %rcx
callq 0xce734
addq %rax, %r14
incq %r13
jmp 0xcec81
movq (%rsp), %rdi
callq 0x2220
movq 0x18(%rsp), %rdi
callq 0x2220
movq 0x30(%rsp), %rdi
callq 0x2220
movq 0x48(%rsp), %rdi
callq 0x2220
movq 0x60(%rsp), %rdi
callq 0x2220
testq %r14, %r14
je 0xced3e
movq %rbx, %rdi
callq 0x694eb
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: get_hap_arch(hap_overlaps*, unsigned int, unsigned int, int, float, int, asg_arc_t*)
int get_hap_arch(hap_overlaps* hap, uint32_t qLen, uint32_t tLen, int max_hang, float max_hang_rate, 
int min_ovlp, asg_arc_t* t)
{
    int r;
    ma_hit_t h;
    h.qns = hap->xUid;
    h.qns = h.qns << 32;
    h.qns = h.qns | hap->x_beg_pos;
    h.qe = hap->x_end_pos;
    h.tn = hap->yUid;
    h.ts = hap->y_beg_pos;
    h.te = hap->y_end_pos;
    h.rev = hap->rev;
    h.del = 0;
    h.bl = h.el = h.ml = h.no_l_indel = 0;

    r = ma_hit2arc(&h, qLen, tLen, max_hang, max_hang_rate, min_ovlp, t);
    if(r < 0) return r;
    uint64_t score = (hap->score >= 0? (hap->score) : (hap->score*(-1)));
    if(hap->score >= 0) score += (((uint64_t)1)<<63);
    t->ol = (uint32_t)score;
    t->ul >>= 32; t->ul <<= 32; t->ul |= (score>>32);
    return r;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbx
movq %rdi, %r14
movl 0x4(%rdi), %eax
movl 0x24(%rdi), %edi
shlq $0x20, %rdi
orq %rdi, %rax
movq %rsp, %rdi
movq %rax, (%rdi)
movl 0x8(%r14), %eax
movl %eax, 0x8(%rdi)
movl 0x28(%r14), %eax
movl %eax, 0xc(%rdi)
movq 0xc(%r14), %rax
movq %rax, 0x10(%rdi)
movl (%r14), %eax
shll $0x1f, %eax
andw $0x0, 0x20(%rdi)
movq %rax, 0x18(%rdi)
callq 0xc99c6
testl %eax, %eax
js 0xceddf
movq 0x30(%r14), %rcx
movq %rcx, %rdx
negq %rdx
cmovsq %rcx, %rdx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
andq %rcx, %rsi
orq %rdx, %rsi
movl $0x80000000, %ecx       # imm = 0x80000000
andl 0xc(%rbx), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
orl %edx, %ecx
movl %ecx, 0xc(%rbx)
movl 0x4(%rbx), %ecx
shldq $0x20, %rsi, %rcx
btcq $0x1f, %rcx
movq %rcx, (%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: clean_purge_graph(asg_t*, float, unsigned int)
void clean_purge_graph(asg_t *purge_g, float drop_ratio, uint32_t is_force_break)
{
    uint64_t operation = 1;
    while (operation > 0)
    {
        operation = 0;
        operation += asg_pop_bubble_purge_graph(purge_g);
        operation += purge_g_arc_del_short_diploid_by_score(purge_g, drop_ratio);
    }
    
    if(is_force_break) purge_g_arc_del_short_diploid_by_score(purge_g, 1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebp
movss %xmm0, 0xc(%rsp)
movq %rdi, %rbx
pushq $0x1
popq %rax
testq %rax, %rax
je 0xcf321
movq %rbx, %rdi
callq 0xcec1e
movslq %eax, %r14
movq %rbx, %rdi
movss 0xc(%rsp), %xmm0
callq 0xceffc
cltq
addq %r14, %rax
jmp 0xcf2fc
testl %ebp, %ebp
je 0xcf33d
movss 0x110da3(%rip), %xmm0   # 0x1e00d0
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xceffc
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: collect_trans_purge_cov(hap_cov_t*, ma_ug_t*, hap_overlaps*, unsigned int)
void collect_trans_purge_cov(hap_cov_t *cov, ma_ug_t *ug, hap_overlaps* x, uint32_t is_keep_X)
{
    if(ug->u.a[x->xUid].n == 0 || ug->u.a[x->yUid].n == 0) return;
    uint64_t *pri = NULL, pri_n, *aux = NULL, aux_n, i, rId, uCov = 0, uLen = 0;

    if(is_keep_X)
    {
        pri = ug->u.a[x->xUid].a + x->x_beg_id;
        pri_n = x->x_end_id - x->x_beg_id;

        aux = ug->u.a[x->yUid].a + x->y_beg_id;
        aux_n = x->y_end_id - x->y_beg_id;
    }
    else
    {
        pri = ug->u.a[x->yUid].a + x->y_beg_id;
        pri_n = x->y_end_id - x->y_beg_id;

        aux = ug->u.a[x->xUid].a + x->x_beg_id;
        aux_n = x->x_end_id - x->x_beg_id;
    }


    uCov = uLen = 0;
    for (i = 0; i < aux_n; i++)
    {
        rId = aux[i]>>33;
        uCov += cov->cov[rId];
    }

    for (i = 0; i < pri_n; i++)
    {
        rId = pri[i]>>33;
        uLen += cov->read_g->seq[rId].len;
    }
    
    uCov = (uLen == 0? 0 : uCov / uLen);


    for (i = 0; i < pri_n; i++)
    {
        rId = pri[i]>>33;
        cov->cov[rId] += (uCov * cov->read_g->seq[rId].len);
    }
}

// Assembly:
movq 0x10(%rsi), %r8
movl 0x24(%rdx), %eax
imulq $0x28, %rax, %rsi
cmpl $0x0, 0x10(%r8,%rsi)
je 0xcfe19
movl 0x28(%rdx), %eax
imulq $0x28, %rax, %rax
cmpl $0x0, 0x10(%r8,%rax)
je 0xcfe19
addq %r8, %rsi
addq %r8, %rax
xorl %r8d, %r8d
xorl %r9d, %r9d
testl %ecx, %ecx
setne %r8b
sete %r9b
movq %rsi, %r10
cmoveq %rax, %r10
cmoveq %rsi, %rax
movl 0x14(%rdx,%r9,8), %ecx
movl 0x18(%rdx,%r9,8), %esi
subl %ecx, %esi
shlq $0x3, %rcx
addq 0x18(%r10), %rcx
movl 0x14(%rdx,%r8,8), %r9d
movl 0x18(%rdx,%r8,8), %edx
subl %r9d, %edx
movq %r9, %r8
shlq $0x3, %r8
addq 0x18(%rax), %r8
xorl %r9d, %r9d
xorl %eax, %eax
cmpq %r9, %rdx
je 0xcfda7
movq (%r8,%r9,8), %r10
movq 0x8(%rdi), %r11
shrq $0x21, %r10
movl (%r11,%r10,4), %r10d
addq %r10, %rax
incq %r9
jmp 0xcfd8a
movl %esi, %esi
xorl %edx, %edx
xorl %r8d, %r8d
cmpq %rdx, %rsi
je 0xcfdd6
movq (%rcx,%rdx,8), %r9
movq 0x30(%rdi), %r10
movq 0x20(%r10), %r10
shrq $0x21, %r9
movl (%r10,%r9,8), %r9d
andl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
addq %r9, %r8
incq %rdx
jmp 0xcfdae
testq %r8, %r8
je 0xcfde2
xorl %edx, %edx
divq %r8
jmp 0xcfde4
xorl %eax, %eax
xorl %edx, %edx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
cmpq %rdx, %rsi
je 0xcfe19
movq (%rcx,%rdx,8), %r9
shrq $0x21, %r9
movq 0x8(%rdi), %r10
movq 0x30(%rdi), %r11
movq 0x20(%r11), %r11
movl (%r11,%r9,8), %r11d
andl %r8d, %r11d
imull %eax, %r11d
addl %r11d, (%r10,%r9,4)
incq %rdx
jmp 0xcfdec
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: print_all_purge_ovlp(ma_ug_t*, hap_overlaps_list*, char const*)
void print_all_purge_ovlp(ma_ug_t *ug, hap_overlaps_list* all_ovlp, const char* cmd)
{
    fprintf(stderr, "\n%s--->ug->u.n: %u\n", cmd, (uint32_t)ug->u.n);
    uint32_t v, uId, i;
    for (v = 0; v < all_ovlp->num; v++)
    {
        uId = v;
        for (i = 0; i < all_ovlp->x[uId].a.n; i++)
        {
            print_hap_paf(ug, &(all_ovlp->x[uId].a.a[i]));
        }
    }

}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x182175(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
movl (%r14), %ecx
leaq 0x11ab12(%rip), %rsi    # 0x1eb98a
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x22b0
movl 0x8(%rbx), %eax
cmpq %rax, %r15
jae 0xd0ebd
xorl %eax, %eax
imulq $0x18, %r15, %r12
movl %eax, %r13d
movq (%rbx), %rax
cmpq %r13, (%rax,%r12)
jbe 0xd0eb8
addq %r12, %rax
movq %r13, %rsi
shlq $0x6, %rsi
addq 0x10(%rax), %rsi
movq %r14, %rdi
callq 0xccbba
leal 0x1(%r13), %eax
jmp 0xd0e90
incq %r15
jmp 0xd0e82
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq