LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: check_trans_rate_gap(vec_mg_lchain_t*, kv_ul_ov_t*, overlap_region_alloc*, haplotype_evdience_alloc*, ul_idx_t const*, double, long, float)
int64_t check_trans_rate_gap(vec_mg_lchain_t *uc, kv_ul_ov_t *buf, overlap_region_alloc* olist, 
haplotype_evdience_alloc *hap, const ul_idx_t *uref, double diff_ec_ul, int64_t winLen, float trans_thres)
{
	if(uc->n <= 0) return 0;
	int64_t k, m, ucn = uc->n, k_cnt, z; mg_lchain_t *ix; buf->n = 0; 
	for (k = m = 0; k < ucn; k += k_cnt) {
		ix = &(uc->a[k]); assert(ix->v == (uint32_t)-1); k_cnt = ix->cnt + 1;
		if(ds_check_vec_mg_lchain_t(uc->a + k + 1, ix->cnt, buf, olist, hap, uref, diff_ec_ul, winLen, trans_thres)) {
			if(m == k) {
				m += k_cnt; 
			} else {
				for (z = 0; z < k_cnt; z++) uc->a[m++] = uc->a[k+z];
			}
		}
	}
	uc->n = m;
	if(uc->n) return 1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movss %xmm1, 0x14(%rsp)
movq %r9, 0x40(%rsp)
movsd %xmm0, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x8(%rdi), %rax
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x1afce1
movq %rsi, %rdx
movq %rdi, %rbx
movq $0x0, 0x8(%rsi)
jle 0x1afce5
xorl %r12d, %r12d
movq $0x0, 0x8(%rsp)
movq (%rbx), %rax
leaq (%r12,%r12,4), %rcx
cmpl $-0x1, 0x8(%rax,%rcx,8)
jne 0x1afd0e
leaq (%rax,%rcx,8), %rdi
movl 0x4(%rdi), %ebp
leal (,%rbp,2), %r14d
sarl %r14d
leal 0x1(%r14), %eax
movslq %eax, %r13
addq $0x28, %rdi
movq %rbp, %rsi
shlq $0x21, %rsi
sarq $0x21, %rsi
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq %rdx, %r15
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x30(%rsp), %r9
movsd 0x38(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
callq 0x1af8d7
testq %rax, %rax
je 0x1afc68
cmpq %r12, 0x8(%rsp)
movq %r15, %rdx
jne 0x1afc6d
leaq (%r12,%r13), %rax
movq %rax, 0x8(%rsp)
jmp 0x1afcd1
movq %r15, %rdx
jmp 0x1afcd1
testl %r14d, %r14d
js 0x1afcd1
shlq $0x21, %rbp
sarq $0x21, %rbp
notq %rbp
leaq (,%r12,8), %rax
leaq (%rax,%rax,4), %rax
movq 0x8(%rsp), %rcx
leaq (,%rcx,8), %rcx
leaq (%rcx,%rcx,4), %rcx
xorl %r8d, %r8d
movq (%rbx), %rsi
movq 0x20(%rsi,%rax), %rdi
movq %rdi, 0x20(%rsi,%rcx)
movups (%rsi,%rax), %xmm0
movups 0x10(%rsi,%rax), %xmm1
movups %xmm1, 0x10(%rsi,%rcx)
movups %xmm0, (%rsi,%rcx)
decq %r8
addq $0x28, %rax
addq $0x28, %rcx
cmpq %r8, %rbp
jne 0x1afc9d
subq %r8, 0x8(%rsp)
addq %r13, %r12
cmpq 0x18(%rsp), %r12
jl 0x1afbe8
jmp 0x1afcee
xorl %eax, %eax
jmp 0x1afcff
movq $0x0, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rbx)
xorl %eax, %eax
testq %rcx, %rcx
setne %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x90e62(%rip), %rdi     # 0x240b77
leaq 0x8ff3f(%rip), %rsi     # 0x23fc5b
leaq 0x90e6a(%rip), %rcx     # 0x240b8d
movl $0x124a, %edx           # imm = 0x124A
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: adjust_utg_chain_qoffset(unsigned long*, long*, long*, long)
int64_t adjust_utg_chain_qoffset(uint64_t *r_srt, int64_t *r_pos, int64_t *q_pos, int64_t r_off)
{
	if(r_off < ((int64_t)(r_srt[0]>>32))) {
		// fprintf(stderr, "r_off:%ld, r_srt[0]:%ld\n", r_off, ((int64_t)(r_srt[0]>>32))); 
		return q_pos[(uint32_t)r_srt[0]]; ///have small chance
	}
	if(r_off >= ((int64_t)(r_srt[3]>>32))) {
		// fprintf(stderr, "r_off:%ld, r_srt[3]:%ld\n", r_off, ((int64_t)(r_srt[3]>>32))); 
		return q_pos[(uint32_t)r_srt[3]]; ///have small chance
	}
	int64_t k, rdis, qdis;
	for (k = 0; k < 3; k++) {
		if(r_off >= ((int64_t)(r_srt[k]>>32)) && r_off < ((int64_t)(r_srt[k+1]>>32))) break;
	}
	// if(k >= 3) {
	// 	if(rs >= ((int64_t)(r_srt[2]>>32)) && rs <= ((int64_t)(r_srt[3]>>32))) k = 2;
	// }
	if(k >= 3) {
		for (k = 0; k < 3; k++) {
			if(r_off >= ((int64_t)(r_srt[k]>>32)) && r_off <= ((int64_t)(r_srt[k+1]>>32))) break;
		}
	}
	assert(k < 3);

	qdis = q_pos[(uint32_t)r_srt[k+1]] - q_pos[(uint32_t)r_srt[k]]; 
	rdis = r_pos[(uint32_t)r_srt[k+1]] - r_pos[(uint32_t)r_srt[k]]; 
	if(qdis < 0) return -1;
	return q_pos[(uint32_t)r_srt[k]] + get_offset_adjust(r_off-r_pos[(uint32_t)r_srt[k]], rdis, qdis);
}

// Assembly:
movq (%rdi), %rax
movq %rax, %r8
shrq $0x20, %r8
cmpq %rcx, %r8
jg 0x1b00dd
movq 0x18(%rdi), %rax
movq %rax, %r8
shrq $0x20, %r8
cmpq %rcx, %r8
jbe 0x1b00dd
movl $0x1, %r8d
movq -0x8(%rdi,%r8,8), %rax
movq %rax, %r9
shrq $0x20, %r9
cmpq %rcx, %r9
jg 0x1b0084
movq (%rdi,%r8,8), %r9
movq %r9, %r10
shrq $0x20, %r10
cmpq %rcx, %r10
ja 0x1b00e4
incq %r8
cmpq $0x4, %r8
jne 0x1b0063
movl $0x1, %r8d
movq -0x8(%rdi,%r8,8), %rax
movq %rax, %r9
shrq $0x20, %r9
cmpq %rcx, %r9
jg 0x1b00b4
movq (%rdi,%r8,8), %r9
movq %r9, %r10
shrq $0x20, %r10
cmpq %rcx, %r10
jae 0x1b00e4
incq %r8
cmpq $0x4, %r8
jne 0x1b0093
pushq %rax
leaq 0x90ce8(%rip), %rdi     # 0x240dad
leaq 0x8fb8f(%rip), %rsi     # 0x23fc5b
leaq 0x90ce0(%rip), %rcx     # 0x240db3
movl $0x12a3, %edx           # imm = 0x12A3
callq 0x2110
movl %eax, %eax
movq (%rdx,%rax,8), %rax
retq
movl %r9d, %r8d
movq (%rdx,%r8,8), %rdi
movl %eax, %r9d
movq (%rdx,%r9,8), %rax
subq %rax, %rdi
js 0x1b012a
movl (%rsi,%r8,8), %edx
movl (%rsi,%r9,8), %esi
subl %esi, %ecx
cvtsi2sd %rcx, %xmm0
subl %esi, %edx
cvtsi2sd %rdx, %xmm1
divsd %xmm1, %xmm0
movl %edi, %ecx
xorps %xmm1, %xmm1
cvtsi2sd %rcx, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %rcx
movl %ecx, %ecx
addq %rcx, %rax
retq
movq $-0x1, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: cal_qext_coor(long, long, long, long, long)
int64_t cal_qext_coor(int64_t pr, int64_t ar, int64_t pq, int64_t aq, int64_t r_off)
{
	int64_t q_off = -1, pd, ad; 
	if(r_off >= pr && r_off <= ar && ar >= pr && aq >= pq) {
		q_off = pq + get_offset_adjust(r_off - pr, ar - pr, aq - pq);
	} else {
		pd = ((r_off >= pr)?(r_off-pr):(pr-r_off));
		ad = ((r_off >= ar)?(r_off-ar):(ar-r_off));
		q_off = ((ad <= pd)?aq:pq);
	}
	return q_off;
}

// Assembly:
movq %rcx, %rax
movq %r8, %rcx
subq %rdi, %rcx
jl 0x1b0177
cmpq %rdx, %rax
jl 0x1b0177
cmpq %rdi, %rsi
jl 0x1b0177
cmpq %rsi, %r8
jg 0x1b0177
subl %edi, %esi
subl %edx, %eax
movl %ecx, %ecx
cvtsi2sd %rcx, %xmm0
cvtsi2sd %rsi, %xmm1
divsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movl %eax, %eax
addq %rdx, %rax
retq
movq %rcx, %rdi
negq %rdi
cmovsq %rcx, %rdi
subq %rsi, %r8
movq %r8, %rcx
negq %rcx
cmovsq %r8, %rcx
cmpq %rdi, %rcx
cmovaq %rdx, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: fill_unaligned_alignments(ma_ug_t*, mg_lchain_t*, long, long, long)
void fill_unaligned_alignments(ma_ug_t *ug, mg_lchain_t *a, int64_t a_n, int64_t offset, int64_t ulid)
{
	// fprintf(stderr, "\n[M::%s::] a_n->%ld, offset->%ld\n", __func__, a_n, offset);
	if(a_n == 0) return;
	int64_t k, l;
	for (k = 0, l = ug->g->seq[a[0].v>>1].len; k < a_n; k++) {
		l -= ug->g->seq[a[k].v>>1].len;
		if(a[k].off < 0) a[k].qs = a[k].qe = -1; 
		a[k].off = l; a[k].hash_pre = (uint32_t)-1;
		if(k > 0) a[k].hash_pre = offset + k - 1;
		// fprintf(stderr, "k->%ld, l->%ld, [M::utg%.6u%c::%c::len->%u], qs->%u, qe->%u, rs->%u, re->%u\n", k, l, 
		// (a[k].v>>1)+1, "lc"[ug->u.a[a[k].v>>1].circ], "+-"[a[k].v&1], ug->u.a[a[k].v>>1].len,
		//  a[k].qs, a[k].qe, a[k].rs, a[k].re);
		l += ug->g->seq[a[k].v>>1].len + a[k].dist_pre;
	}

	// debug_update_uovlp_chain_qse(ug, a, a_n, ulid);

	for (l = -1, k = 0; k <= a_n; k++) {
		if(k == a_n || a[k].qs >= 0) { ///a[k] and a[l] are anchors
			if(k-l>1) update_uovlp_chain_qse(ug, l, k, a, a_n);
			l = k;
		}
	}
}

// Assembly:
testq %rdx, %rdx
je 0x1b08a1
jle 0x1b08a1
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x18(%rdi), %rax
movq 0x20(%rax), %rax
movl 0x8(%rsi), %esi
shrl %esi
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl (%rax,%rsi,8), %esi
andl %edx, %esi
decl %ecx
xorl %edi, %edi
movq %r14, %r8
movl 0x8(%r8), %r9d
shrl %r9d
movl (%rax,%r9,8), %r10d
andl %edx, %r10d
cmpl $0x0, (%r8)
jns 0x1b0807
movq $-0x1, 0x14(%r8)
subl %r10d, %esi
movl %esi, (%r8)
leal (%rcx,%rdi), %r10d
cmpq $0x1, %rdi
movl $0x0, %r11d
sbbl %r11d, %r11d
orl %r10d, %r11d
movl %r11d, 0x24(%r8)
movl (%rax,%r9,8), %r9d
andl %edx, %r9d
addl 0x20(%r8), %esi
addl %r9d, %esi
incq %rdi
addq $0x28, %r8
cmpq %rdi, %rbx
jne 0x1b07eb
leaq 0x1(%rbx), %r13
leaq 0x14(%r14), %rbp
movq $-0x1, %rsi
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x1b085c
cmpl $0x0, (%rbp)
js 0x1b0881
movq %r12, %rcx
subq %rsi, %rcx
movq %r12, %rax
cmpq $0x2, %rcx
jl 0x1b0884
movq %r15, %rdi
movq %r12, %rdx
movq %r14, %rcx
movq %rbx, %r8
callq 0x1b0196
movq %r12, %rax
jmp 0x1b0884
movq %rsi, %rax
incq %r12
addq $0x28, %rbp
movq %rax, %rsi
cmpq %r12, %r13
jne 0x1b0851
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/inter.cpp
// Function: print_raw_chains(vec_mg_lchain_t*, long)
void print_raw_chains(vec_mg_lchain_t *uc, int64_t ulid)
{
	if(uc->n <= 0) return;
	int64_t k, m, ucn = uc->n, k_cnt, a_n; mg_lchain_t *ix, *a; 
	for (k = m = 0; k < ucn; k += k_cnt) {
		ix = &(uc->a[k]); assert(ix->v == (uint32_t)-1); k_cnt = ix->cnt + 1;
		a = uc->a + k + 1; a_n = ix->cnt;
		for (m = 0; m < a_n; m++) {
			if(a[m].off < 0) break;
		}
		if(m < a_n) fprintf(stderr, "ulid->%ld\n", ulid);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rdi), %r12
testq %r12, %r12
jle 0x1b0d85
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x90071(%rip), %r15     # 0x240d89
xorl %ebp, %ebp
movq (%r14), %rax
leaq (,%rbp,4), %rcx
addq %rbp, %rcx
cmpl $-0x1, 0x8(%rax,%rcx,8)
jne 0x1b0d94
leaq (%rax,%rcx,8), %rax
movl 0x4(%rax), %ecx
leal (%rcx,%rcx), %r13d
sarl %r13d
testl %r13d, %r13d
jle 0x1b0d5c
addq $0x28, %rax
shlq $0x21, %rcx
sarq $0x21, %rcx
cmpl $0x0, (%rax)
js 0x1b0d6c
addq $0x28, %rax
decq %rcx
jne 0x1b0d4e
incl %r13d
movslq %r13d, %rax
addq %rax, %rbp
cmpq %r12, %rbp
jl 0x1b0d1a
jmp 0x1b0d85
movq 0xe426d(%rip), %rax     # 0x294fe0
movq (%rax), %rdi
movq %r15, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x22b0
jmp 0x1b0d5c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8fddc(%rip), %rdi     # 0x240b77
leaq 0x8eeb9(%rip), %rsi     # 0x23fc5b
leaq 0x90243(%rip), %rcx     # 0x240fec
movl $0x13cf, %edx           # imm = 0x13CF
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: gen_gg_aln(overlap_region_alloc*, ul_idx_t const*, long, vec_mg_lchain_t*)
void gen_gg_aln(overlap_region_alloc* olist, const ul_idx_t *uref, int64_t trans_sc, vec_mg_lchain_t *res)
{
	uint64_t k; mg_lchain_t *p = NULL;
	res->n = 0; kv_resize(mg_lchain_t, *res, olist->length);
	for (k = 0; k < olist->length; k++) {
		p = &(res->a[res->n++]); memset(p, 0, sizeof((*p)));
		p->v = ((olist->list[k].y_id<<1)|(olist->list[k].y_pos_strand)); p->off = k; 
		p->score = aln_sc((olist->list[k]), (trans_sc), UG_TRANS_ERR_W);
		p->qs = olist->list[k].x_pos_s; p->qe = olist->list[k].x_pos_e+1;
		if((p->v&1)) {
			p->rs = uref->ug->u.a[p->v>>1].len - (olist->list[k].y_pos_e+1); 
			p->re = uref->ug->u.a[p->v>>1].len - olist->list[k].y_pos_s;
		} else {
			p->rs = olist->list[k].y_pos_s; 
			p->re = olist->list[k].y_pos_e+1;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq $0x0, 0x8(%rcx)
movq 0x10(%rdi), %rax
cmpq %rax, 0x10(%rcx)
jae 0x1b4471
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x10(%rbx)
movq (%rbx), %rdi
leaq 0x8(,%rcx,8), %rax
leaq (%rax,%rax,4), %rsi
callq 0x2370
movq %rax, (%rbx)
movq 0x10(%r12), %rax
testq %rax, %rax
je 0x1b4560
movl $0x30, %eax
xorl %ecx, %ecx
xorps %xmm0, %xmm0
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq (%rbx), %rsi
movq 0x8(%rbx), %rdi
leaq 0x1(%rdi), %r8
movq %r8, 0x8(%rbx)
leaq (%rdi,%rdi,4), %rdi
leaq (%rsi,%rdi,8), %rsi
movups %xmm0, 0x10(%rsi)
movups %xmm0, (%rsi)
movq $0x0, 0x20(%rsi)
movq (%r12), %rdi
movl -0x20(%rdi,%rax), %r8d
movl -0x14(%rdi,%rax), %r9d
addl %r8d, %r8d
orl %r9d, %r8d
movl %r8d, 0x8(%rsi)
movl %ecx, (%rsi)
movl -0x10(%rdi,%rax), %r10d
movl -0x8(%rdi,%rax), %r11d
subl %r11d, %r10d
imull %r14d, %r10d
movl (%rdi,%rax), %ebp
shll $0x6, %ebp
addl %r10d, %ebp
subl %ebp, %r11d
movl %r11d, 0x1c(%rsi)
movl -0x2c(%rdi,%rax), %r10d
movl %r10d, 0x14(%rsi)
movl -0x28(%rdi,%rax), %r10d
incl %r10d
movl %r10d, 0x18(%rsi)
testb $0x1, %r9b
jne 0x1b4518
movl -0x1c(%rdi,%rax), %r8d
movl %r8d, 0xc(%rsi)
movl -0x18(%rdi,%rax), %r8d
incl %r8d
jmp 0x1b4548
movq (%r15), %r9
movq 0x10(%r9), %r9
shrl %r8d
leaq (%r8,%r8,4), %r8
movl (%r9,%r8,8), %r10d
andl %edx, %r10d
movl -0x18(%rdi,%rax), %r11d
notl %r11d
addl %r10d, %r11d
movl %r11d, 0xc(%rsi)
movl (%r9,%r8,8), %r8d
andl %edx, %r8d
subl -0x1c(%rdi,%rax), %r8d
movl %r8d, 0x10(%rsi)
incq %rcx
addq $0xa8, %rax
cmpq 0x10(%r12), %rcx
jb 0x1b4489
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: get_overlap_region_sub_err_debug(overlap_region*, long, long*)
int64_t get_overlap_region_sub_err_debug(overlap_region *o, int64_t qs, int64_t *sec_err)
{
	(*sec_err) = 0;
	if(o->w_list.n <= 0) return 0;
	int64_t k; double rr; int64_t terr, dd;
	for (k = o->w_list.n-1, terr = 0; k >= 0 && qs < o->w_list.a[k].x_end; k--) {
		if(qs >= o->w_list.a[k].x_start && qs < o->w_list.a[k].x_end) {
			// if(qs == 102178) {
			// 	fprintf(stderr, "[M::%s::qs->%ld] k::%ld, wn::%u, x::[%d, %d), clen::%u, terr::%ld, sec_err::%ld\n", 
			// 	__func__, qs, k, (uint32_t)o->w_list.n, o->w_list.a[k].x_start, o->w_list.a[k].x_end, 
			// 	o->w_list.a[k].clen, terr, (*sec_err));
			// }
            if(o->w_list.a[k].clen > 0) {
                rr = ((double)(o->w_list.a[k].x_end-qs))/
							((double)(o->w_list.a[k].x_end-o->w_list.a[k].x_start));
				dd = o->w_list.a[k].clen*rr;
                (*sec_err) += (dd>0?dd:1);
            }

            terr += ((o->w_list.a[k].clen > 0)?(o->w_list.a[k].x_end-qs):(0));
            return terr;
		}
		if(o->w_list.a[k].clen > 0) {
			(*sec_err) += o->w_list.a[k].clen;
			terr += o->w_list.a[k].x_end-o->w_list.a[k].x_start;
		}
	}
	return terr;
}

// Assembly:
movq $0x0, (%rdx)
movq 0x48(%rdi), %r8
testq %r8, %r8
je 0x1b45ce
movq %r8, %rax
decq %rax
js 0x1b45ce
movq 0x58(%rdi), %rax
movq %r8, %rcx
shlq $0x5, %rcx
leaq (%rcx,%rax), %rdi
addq $-0x4, %rdi
xorl %ecx, %ecx
xorl %eax, %eax
movslq -0x18(%rdi), %r10
movq %r10, %r9
subq %rsi, %r9
jle 0x1b45cd
movslq -0x1c(%rdi), %r11
cmpq %rsi, %r11
jle 0x1b45d1
movl (%rdi), %r9d
testq %r9, %r9
je 0x1b45c1
addq %r9, %rcx
movq %rcx, (%rdx)
subq %r11, %r10
addq %r10, %rax
decq %r8
addq $-0x20, %rdi
testq %r8, %r8
jg 0x1b4598
retq
xorl %eax, %eax
retq
movl (%rdi), %esi
testl %esi, %esi
je 0x1b4610
cvtsi2sd %r9, %xmm0
subl %r11d, %r10d
cvtsi2sd %r10d, %xmm1
divsd %xmm1, %xmm0
movl %esi, %esi
xorps %xmm1, %xmm1
cvtsi2sd %rsi, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %rsi
cmpq $0x2, %rsi
movl $0x1, %edi
cmovgeq %rsi, %rdi
addq %rdi, %rcx
movq %rcx, (%rdx)
jmp 0x1b4613
xorl %r9d, %r9d
addq %r9, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: find_mg_lchain_max(long, mg_lchain_t const*, int)
int64_t find_mg_lchain_max(int64_t n, const mg_lchain_t *a, int32_t x)
{
    int64_t s = 0, e = n;
    if (n == 0) return -1;
    if (a[n-1].qe < x) return n - 1;
    if (a[0].qe >= x) return -1;
    while (e > s) { // TODO: finish this block
        int64_t m = s + (e - s) / 2;
        if (a[m].qe >= x) e = m;
        else s = m + 1;
    }
    assert(s == e);
    return s;
}

// Assembly:
movq $-0x1, %rax
testq %rdi, %rdi
je 0x1b56d3
leaq (%rdi,%rdi,4), %rcx
cmpl %edx, -0x10(%rsi,%rcx,8)
jge 0x1b5690
decq %rdi
movq %rdi, %rax
retq
cmpl %edx, 0x18(%rsi)
jge 0x1b56d3
xorl %eax, %eax
testq %rdi, %rdi
jle 0x1b56ce
movq %rdi, %r8
subq %rax, %r8
movq %r8, %rcx
shrq $0x3f, %rcx
addq %r8, %rcx
sarq %rcx
leaq (%rcx,%rax), %r8
leaq (%r8,%r8,4), %r9
cmpl %edx, 0x18(%rsi,%r9,8)
jl 0x1b56c3
movq %r8, %rdi
jmp 0x1b56c9
addq %rcx, %rax
incq %rax
cmpq %rax, %rdi
jg 0x1b569c
cmpq %rdi, %rax
jne 0x1b56d4
retq
pushq %rax
leaq 0x8ac20(%rip), %rdi     # 0x2402fc
leaq 0x8a578(%rip), %rsi     # 0x23fc5b
leaq 0x8baf6(%rip), %rcx     # 0x2411e0
movl $0x15d2, %edx           # imm = 0x15D2
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: hc_target_len(asg_t*, mg_lchain_t*, mg_lchain_t*)
int64_t hc_target_len(asg_t *g, mg_lchain_t *s, mg_lchain_t *e)
{
	// int64_t ql = s->qe - e->qe, tp, tm;
	// if((s->v^1)&1) tp = g->seq[s->v>>1].len - s->re;
	// else tp = s->rs;

	// if((e->v^1)&1) tm = g->seq[e->v>>1].len - e->re;
	// else tm = e->rs;
	int64_t ql = (int64_t)s->qs - (int64_t)e->qe, tp, tm;
	int64_t sts, ete;
	sts = (s->v&1)?g->seq[s->v>>1].len-s->re:s->rs; tp = g->seq[s->v>>1].len - sts;
	ete = (e->v&1)?g->seq[e->v>>1].len-e->rs:e->re; tm = g->seq[e->v>>1].len - ete;
	// fprintf(stderr, "[M::%s::] ql:%ld, tp:%ld, tm:%ld, sts:%ld, ete:%ld\n", __func__, ql, tp, tm, sts, ete);
	return ql + tp - tm;
}

// Assembly:
movl 0x8(%rsi), %r8d
testb $0x1, %r8b
jne 0x1b570a
movl 0xc(%rsi), %eax
movq 0x20(%rdi), %rcx
shrl %r8d
jmp 0x1b571d
movq 0x20(%rdi), %rcx
shrl %r8d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl (%rcx,%r8,8), %eax
subl 0x10(%rsi), %eax
movslq 0x14(%rsi), %rsi
movslq 0x18(%rdx), %r9
movl (%rcx,%r8,8), %r8d
movl 0x8(%rdx), %edi
testb $0x1, %dil
jne 0x1b573a
movl 0x10(%rdx), %r10d
shrl %edi
jmp 0x1b574a
shrl %edi
movl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
andl (%rcx,%rdi,8), %r10d
subl 0xc(%rdx), %r10d
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andq %rdx, %r8
cltq
addq %rax, %r9
subq %r9, %rsi
movslq %r10d, %rax
addq %r8, %rax
addq %rsi, %rax
movl (%rcx,%rdi,8), %ecx
andq %rdx, %rcx
subq %rcx, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: prt_chains(ul_ov_t*, long, ul_ov_t*, unsigned long*, long, vec_mg_lchain_t*, long)
void prt_chains(ul_ov_t *l_idx, int64_t l_idx_n, ul_ov_t *l_a, uint64_t *g_idx, int64_t g_idx_n, vec_mg_lchain_t *g_a, int64_t ql)
{
	int64_t k, i, s, e;
	if(l_idx && l_a) {
		fprintf(stderr, "\n[M::%s::qlen->%ld] print linear chains\n", __func__, ql);
		for (k = 0; k < l_idx_n; k++) {
			s = l_idx[k].ts; e = l_idx[k].te;
			fprintf(stderr, "[M::%s::linear_chain] sc::%u, occ::%ld\n", __func__, l_idx[k].qn, e-s);
			for (i = s; i < e; i++) {
				fprintf(stderr, "[M::%s::utg%.6dl] q::[%u, %u)\n", __func__, (int32_t)l_a[i].tn+1, l_a[i].qs, l_a[i].qe);
			}
		}
	}

	if(g_idx && g_a) {
		fprintf(stderr, "\n[M::%s::qlen->%ld] print graph chains\n", __func__, ql);
		for (k = s = e = 0; k < g_idx_n; ++k) {
			s = e; e += ((uint32_t)g_idx[k]);
			fprintf(stderr, "[M::%s::grapn_chain] sc::%lu, occ::%ld\n", __func__, g_idx[k]>>32, e-s);
			for (i = s; i < e; i++) {
				fprintf(stderr, "[M::%s::utg%.6dl] q::[%u, %u)\n", __func__, (int32_t)(g_a->a[i].v>>1)+1, g_a->a[i].qs, g_a->a[i].qe);
			}
    	}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %rcx
movq %rdi, %rdx
movq 0x30(%rsp), %r12
testq %rdi, %rdi
sete %al
testq %rcx, %rcx
sete %dil
orb %al, %dil
je 0x1b83c2
testq %r14, %r14
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
je 0x1b83cc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r12, %rdi
callq 0x29411
jmp 0x1b83a6
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x294f0
jmp 0x1b83b6
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: comput_err_partial_cigar(long, overlap_region*, long*)
int64_t comput_err_partial_cigar(int64_t ol, overlap_region *z, int64_t *rk)
{
	int64_t k = 0, err = 0, e = z->x_pos_s+ol, wn = z->w_list.n; (*rk) = -1;
	for (k = 0; k < wn; k++) {
		if(z->w_list.a[k].x_start >= e) break;
		if(z->w_list.a[k].y_end != -1) {
			err += z->w_list.a[k].error;
		}
	}
	k--;
	if(k < 0) return 0;
	if(z->w_list.a[k].y_end != -1) {
		err -= z->w_list.a[k].error;
	}

	if((int64_t)z->w_list.a[k].x_end+1 <= e) {
		if(z->w_list.a[k].y_end != -1) {
			err += z->w_list.a[k].error;
		}
	} else {
		// assert(z->w_list.a[k].x_start < e);
		if(z->w_list.a[k].y_end != -1) {
			err += (((double)(e-z->w_list.a[k].x_start))/
							((double)(z->w_list.a[k].x_end+1-z->w_list.a[k].x_start)))*z->w_list.a[k].error;
		} 
	}
	(*rk) = k;
	return err;
}

// Assembly:
movl 0x4(%rsi), %r8d
movq 0x48(%rsi), %r9
movq $-0x1, (%rdx)
testq %r9, %r9
jle 0x1b9b77
addq %rdi, %r8
movq 0x58(%rsi), %rdi
addq $0x14, %rdi
xorl %ecx, %ecx
xorl %eax, %eax
movslq -0x14(%rdi), %r10
cmpq %r10, %r8
jle 0x1b9b14
cmpl $-0x1, -0x8(%rdi)
je 0x1b9b03
movswq (%rdi), %r10
addq %r10, %rax
incq %rcx
addq $0x20, %rdi
cmpq %rcx, %r9
jne 0x1b9aed
movq %r9, %rcx
jmp 0x1b9b19
testq %rcx, %rcx
je 0x1b9b77
decq %rcx
movq 0x58(%rsi), %rdi
movq %rcx, %rsi
shlq $0x5, %rsi
cmpl $-0x1, 0xc(%rdi,%rsi)
je 0x1b9b73
addq %rsi, %rdi
movslq 0x4(%rdi), %rsi
cmpq %rsi, %r8
jg 0x1b9b73
movswq 0x14(%rdi), %r9
subq %r9, %rax
movslq (%rdi), %rdi
subq %rdi, %r8
cvtsi2sd %r8, %xmm0
subl %edi, %esi
incl %esi
cvtsi2sd %esi, %xmm1
divsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r9d, %xmm1
cvtsi2sd %rax, %xmm2
mulsd %xmm0, %xmm1
addsd %xmm1, %xmm2
cvttsd2si %xmm2, %rax
movq %rcx, (%rdx)
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: sum_w_err(window_list*, long)
int64_t sum_w_err(window_list *a, int64_t n)
{
	int64_t k, err = 0;
	for (k = 0; k < n; k++) {
		if(a[k].y_end != -1) err += a[k].error;
	}
	return err;
}

// Assembly:
testq %rsi, %rsi
jle 0x1b9b9c
addq $0x14, %rdi
xorl %eax, %eax
cmpl $-0x1, -0x8(%rdi)
je 0x1b9b92
movswq (%rdi), %rcx
addq %rcx, %rax
addq $0x20, %rdi
decq %rsi
jne 0x1b9b85
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: set_sec_e_min(overlap_region*, unsigned long*, long, long)
void set_sec_e_min(overlap_region *z, uint64_t *w_idx, int64_t wl, int64_t ql)
{
	int64_t wid, k, wn = z->w_list.n, ws, we;
	for (k = 0; k < wn; k++) {
		wid = z->w_list.a[k].x_start/wl;
		ws = wid*wl; we = ws+wl; if(we > ql) we = ql; we--;
		// fprintf(stderr, "[M::%s] ws::%ld, we::%ld, xs::%d, xe::%d, err::%d\n", __func__, 
		// ws, we, z->w_list.a[k].x_start, z->w_list.a[k].x_end, z->w_list.a[k].error);
		if(ws == z->w_list.a[k].x_start && we == z->w_list.a[k].x_end && z->w_list.a[k].y_end != -1) {
			if((w_idx[wid] == (uint64_t)-1) || (w_idx[wid] > (uint64_t)z->w_list.a[k].error)) {
				w_idx[wid] = z->w_list.a[k].error;
			}
		}
	}
}

// Assembly:
movq 0x48(%rdi), %r9
testq %r9, %r9
jle 0x1ba6ce
movq %rdx, %r8
movq 0x58(%rdi), %r10
addq $0x14, %r10
movslq -0x14(%r10), %rdi
movq %rdi, %rax
cqto
idivq %r8
movq %rax, %rdx
imulq %r8, %rdx
cmpq %rdi, %rdx
jne 0x1ba6c5
addq %r8, %rdi
cmpq %rcx, %rdi
cmovgeq %rcx, %rdi
decq %rdi
movslq -0x10(%r10), %rdx
cmpq %rdx, %rdi
jne 0x1ba6c5
cmpl $-0x1, -0x8(%r10)
je 0x1ba6c5
movq (%rsi,%rax,8), %rdi
cmpq $-0x1, %rdi
je 0x1ba6bd
movswq (%r10), %rdx
cmpq %rdx, %rdi
ja 0x1ba6c1
jmp 0x1ba6c5
movswq (%r10), %rdx
movq %rdx, (%rsi,%rax,8)
addq $0x20, %r10
decq %r9
jne 0x1ba673
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: cal_sec_e_min(overlap_region*, unsigned long*, long, long, long*)
int64_t cal_sec_e_min(overlap_region *z, uint64_t *w_idx, int64_t wl, int64_t ql, int64_t *sec_err)
{
	int64_t wid, k, wn = z->w_list.n, ws, we, o[2], tot_e, sc; uint64_t self_err;
	o[0] = o[1] = tot_e = 0;
	for (k = 0; k < wn; k++) {
		wid = z->w_list.a[k].x_start/wl;
		if(w_idx[wid] == (uint64_t)-1) continue;
		ws = wid*wl; we = ws+wl; if(we > ql) we = ql; we--;
		self_err = THRESHOLD_MAX_SIZE + 1;
		if(z->w_list.a[k].y_end != -1) self_err = z->w_list.a[k].error;
		
		if(ws == z->w_list.a[k].x_start && we == z->w_list.a[k].x_end) {
			if(self_err <= w_idx[wid]) {
				o[0] += we+1-ws;
			} else {
				o[1] += we+1-ws; tot_e += self_err - w_idx[wid];
			}
		}
	}
	if(sec_err) (*sec_err) = tot_e;

	sc = o[0] - (o[1]*ERROR_RATE)-(tot_e*5);
	return sc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x48(%rdi), %r11
testq %r11, %r11
jle 0x1ba76e
movq %rdx, %r9
movq 0x58(%rdi), %rbx
xorl %r10d, %r10d
xorl %r15d, %r15d
xorl %r14d, %r14d
movslq (%rbx), %rdi
movq %rdi, %rax
cqto
idivq %r9
movq (%rsi,%rax,8), %rdx
cmpq $-0x1, %rdx
je 0x1ba759
imulq %r9, %rax
leaq (%rax,%r9), %r12
cmpq %rcx, %r12
cmovgeq %rcx, %r12
cmpl $-0x1, 0xc(%rbx)
je 0x1ba727
movswq 0x14(%rbx), %r13
jmp 0x1ba72d
movl $0x20, %r13d
cmpq %rdi, %rax
jne 0x1ba759
leaq -0x1(%r12), %rax
movslq 0x4(%rbx), %rbp
cmpq %rbp, %rax
jne 0x1ba759
cmpq %rdx, %r13
jbe 0x1ba753
subq %rdi, %r14
addq %r12, %r14
subq %rdx, %r10
addq %r13, %r10
jmp 0x1ba759
subq %rdi, %r15
addq %r12, %r15
addq $0x20, %rbx
decq %r11
jne 0x1ba6f6
cvtsi2sd %r15, %xmm0
cvtsi2sd %r14, %xmm1
jmp 0x1ba779
xorpd %xmm1, %xmm1
xorl %r10d, %r10d
xorpd %xmm0, %xmm0
testq %r8, %r8
je 0x1ba781
movq %r10, (%r8)
mulsd 0x853ef(%rip), %xmm1    # 0x23fb78
addsd %xmm1, %xmm0
leaq (%r10,%r10,4), %rax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: ck_w_err(overlap_region*, unsigned long*, long, long)
uint32_t ck_w_err(overlap_region *z, uint64_t *w_idx, int64_t wl, int64_t ql)
{
	int64_t wid, k, wn = z->w_list.n, ws, we, ol, e[2];
	ol = e[0] = e[1] = 0;
	for (k = 0; k < wn; k++) {
		wid = z->w_list.a[k].x_start/wl;
		if(w_idx[wid] == (uint64_t)-1) continue;
		ws = wid*wl; we = ws+wl; if(we > ql) we = ql; we--;
		if(ws == z->w_list.a[k].x_start && we == z->w_list.a[k].x_end) {
			ol += we+1-ws; e[0] += w_idx[wid]; 
			if(z->w_list.a[k].y_end != -1) e[1] += z->w_list.a[k].error;
			else e[1] += THRESHOLD_MAX_SIZE + 1;
		}
	}
	// fprintf(stderr, "[M::%s::utg%.6dl] x::[%u, %u), ol::%ld, e[0]::%ld, e[1]::%ld\n", 
	// __func__, (int32_t)z->y_id+1, z->x_pos_s, z->x_pos_e+1, ol, e[0], e[1]);
	if(e[1] > (e[0]+64)) {
		if((e[1] > (e[0]+(ol*0.01)))/**||(e[1] > (e[0]+(e[0]*0.03)))**/) {
			z->non_homopolymer_errors = e[1] - e[0];
			return 0;
		}
	}
	// if((e[1] > (e[0]+16)) && (e[1] > (e[0]+(ol*0.01)))) return 0;
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x48(%rdi), %rbx
testq %rbx, %rbx
jle 0x1ba8a4
movq %rdx, %r8
movq 0x58(%rdi), %r14
xorl %r11d, %r11d
xorl %r10d, %r10d
xorl %r15d, %r15d
movslq (%r14), %r9
movq %r9, %rax
cqto
idivq %r8
movq (%rsi,%rax,8), %rdx
cmpq $-0x1, %rdx
je 0x1ba894
imulq %r8, %rax
leaq (%rax,%r8), %r12
cmpq %rcx, %r12
cmovgeq %rcx, %r12
cmpq %r9, %rax
jne 0x1ba894
leaq -0x1(%r12), %rax
movslq 0x4(%r14), %r13
cmpq %r13, %rax
jne 0x1ba894
subq %r9, %r12
addq %r12, %r15
addq %rdx, %r11
cmpl $-0x1, 0xc(%r14)
je 0x1ba890
movswq 0x14(%r14), %rax
addq %rax, %r10
jmp 0x1ba894
addq $0x20, %r10
addq $0x20, %r14
decq %rbx
jne 0x1ba83f
cvtsi2sd %r15, %xmm0
jmp 0x1ba8ae
xorpd %xmm0, %xmm0
xorl %r10d, %r10d
xorl %r11d, %r11d
leaq 0x40(%r11), %rcx
movl $0x1, %eax
cmpq %rcx, %r10
jle 0x1ba8e1
cvtsi2sd %r10, %xmm1
cvtsi2sd %r11, %xmm2
mulsd 0x80962(%rip), %xmm0    # 0x23b230
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
jbe 0x1ba8e1
subl %r11d, %r10d
movl %r10d, 0x30(%rdi)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: get_win_info(overlap_region*, unsigned long, long*, long*, long*)
uint64_t get_win_info(overlap_region *z, uint64_t wid, int64_t *ys, int64_t *ye, int64_t *err)
{
	(*err) = -2;
	if((wid > 0) && (z->w_list.a[wid].y_end != -1) && (z->w_list.a[wid-1].y_end != -1) && (z->w_list.a[wid].y_end > z->w_list.a[wid-1].y_end)) {
		(*ys) = z->w_list.a[wid-1].y_end+1; 
		(*ye) = z->w_list.a[wid].y_end; 
		(*err) = z->w_list.a[wid].error;
		return 1;
	}else if(z->w_list.a[wid].y_end == -1) {
		(*ys) = (*ye) = (*err) -1; 
		return 1;
	} 
	return 0;
}

// Assembly:
movq $-0x2, (%r8)
movq 0x58(%rdi), %rax
testq %rsi, %rsi
je 0x1bc38a
shlq $0x5, %rsi
movslq 0xc(%rax,%rsi), %rdi
cmpq $-0x1, %rdi
je 0x1bc393
movslq -0x14(%rax,%rsi), %r9
cmpl $-0x1, %r9d
sete %r10b
cmpl %r9d, %edi
setle %r11b
orb %r10b, %r11b
jne 0x1bc390
incq %r9
movq %r9, (%rdx)
movq %rdi, (%rcx)
movswq 0x14(%rax,%rsi), %rax
movq %rax, (%r8)
jmp 0x1bc3a0
cmpl $-0x1, 0xc(%rax)
je 0x1bc393
xorl %eax, %eax
retq
movq $-0x3, %rax
movq %rax, (%rcx)
movq %rax, (%rdx)
movl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: kv_ul_ov_t_statistics(kv_ul_ov_t*, unsigned long, long*)
uint64_t kv_ul_ov_t_statistics(kv_ul_ov_t *olist, uint64_t qn, int64_t *occ)
{
	int64_t k, l = 0;
	uint32_t sp = (uint32_t)-1, ep = (uint32_t)-1;
	for (k = olist->n-1; k >= 0 && olist->a[k].qn == qn; k--) {
		if(!(olist->a[k].el)) continue;
		if(!(olist->a[k].tn&((uint32_t)(0x80000000)))) continue;
		if(sp == (uint32_t)-1 || olist->a[k].qe <= sp) {
			if(sp != (uint32_t)-1) l += ep - sp;
			sp = olist->a[k].qs;
			ep = olist->a[k].qe;
		} else {
			sp = MIN(sp, olist->a[k].qs);
		}
		(*occ)++;
	}
	if(sp != (uint32_t)-1) l += ep - sp;
	return l;
}

// Assembly:
movq 0x8(%rdi), %rax
movq %rax, %rcx
decq %rcx
js 0x1bcce6
movq (%rdi), %rcx
leaq (%rax,%rax,8), %rdi
leaq (%rdi,%rdi,2), %rdi
addq %rax, %rdi
leaq (%rcx,%rdi), %r8
addq $-0x1c, %r8
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movl (%r8), %r10d
cmpq %rsi, %r10
jne 0x1bccd6
testb $0x40, 0x1b(%r8)
je 0x1bccca
cmpl $0x0, 0xc(%r8)
jns 0x1bccca
movl 0x8(%r8), %r10d
cmpl $-0x1, %r9d
je 0x1bccc0
cmpl %r9d, %r10d
jbe 0x1bccba
movl 0x4(%r8), %r10d
cmpl %r10d, %r9d
cmovael %r10d, %r9d
jmp 0x1bccc7
subl %r9d, %edi
addq %rdi, %rcx
movl 0x4(%r8), %r9d
movl %r10d, %edi
incq (%rdx)
decq %rax
addq $-0x1c, %r8
testq %rax, %rax
jg 0x1bcc88
subl %r9d, %edi
xorl %eax, %eax
cmpl $-0x1, %r9d
cmovnel %edi, %eax
addq %rcx, %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: get_utepdat_t_mem_tid(utepdat_t const*, long, long*, long*)
int64_t get_utepdat_t_mem_tid(const utepdat_t *b, int64_t tid, int64_t *mem, int64_t *mem_hab)
{
	km_stat_t kmst; memset(mem, 0, sizeof(*(mem))*6);
	if(b->hab) {
		mem[0] += ha_ovec_mem(b->hab[tid], mem_hab);
	}
	if(b->ll) {
		mem[1] += kv_mem(b->ll[tid].lo) + kv_mem(b->ll[tid].tk) + kv_mem(b->ll[tid].srt.a)+ kv_mem(b->ll[tid].tc);
	}
	if(b->buf) {
		km_stat(b->buf[tid]->km, &kmst);
		mem[2] += kmst.capacity;
	}
	if(b->gdp) {
		mem[3] += kv_mem(b->gdp[tid].l) + kv_mem(b->gdp[tid].swap) + kv_mem(b->gdp[tid].dst) + kv_mem(b->gdp[tid].out)
			+ kv_mem(b->gdp[tid].path) + kv_mem(b->gdp[tid].v) + kv_mem(b->gdp[tid].f) + kv_mem(b->gdp[tid].dst_done);
	}
	if(b->mzs) {
		mem[4] += kv_mem(b->mzs[tid]);
	}
	if(b->sps) {
		mem[5] += kv_mem(b->sps[tid]);
	}
	return mem[0] + mem[1] + mem[2] + mem[3] + mem[4] + mem[5];
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdx)
movups %xmm0, 0x10(%rdx)
movups %xmm0, (%rdx)
movq 0x80(%rdi), %rax
testq %rax, %rax
je 0x1bcd26
movq (%rax,%r14,8), %rdi
movq %rcx, %rsi
callq 0x38c68
addq %rax, (%rbx)
movq 0x88(%r15), %rax
testq %rax, %rax
je 0x1bcd61
imulq $0x68, %r14, %rcx
movq 0x28(%rax,%rcx), %rdx
movq 0x50(%rax,%rcx), %rsi
addq 0x10(%rax,%rcx), %rdx
leaq (%rdx,%rdx,8), %rdi
leaq (%rdi,%rdi,2), %rdi
addq %rdx, %rdi
leaq (%rdi,%rsi,8), %rdx
imulq $0x34, 0x40(%rax,%rcx), %rax
addq %rdx, %rax
addq %rax, 0x8(%rbx)
movq 0x78(%r15), %rax
testq %rax, %rax
je 0x1bcd84
movq (%rax,%r14,8), %rax
movq (%rax), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0x1ee2bf
movq (%r12), %rax
addq %rax, 0x10(%rbx)
movq 0x90(%r15), %rax
testq %rax, %rax
je 0x1bcded
leaq (%r14,%r14,2), %rcx
shlq $0x6, %rcx
movq 0x28(%rax,%rcx), %rdx
movq 0x40(%rax,%rcx), %rsi
addq 0x10(%rax,%rcx), %rdx
leaq (%rdx,%rdx,4), %rdx
leaq (%rsi,%rsi,2), %rsi
shlq $0x4, %rsi
movq 0x70(%rax,%rcx), %rdi
leaq (%rdi,%rdi,2), %rdi
movq 0x80(%rax,%rcx), %r8
addq 0x58(%rax,%rcx), %r8
addq 0x98(%rax,%rcx), %r8
addq 0xb0(%rax,%rcx), %r8
leaq (%rsi,%rdx,8), %rax
leaq (%rax,%rdi,4), %rax
addq 0x18(%rbx), %rax
leaq (%rax,%r8,8), %rax
movq %rax, 0x18(%rbx)
movq 0x60(%r15), %rax
testq %rax, %rax
je 0x1bce0d
movq %r14, %rcx
shlq $0x4, %rcx
movl 0x4(%rax,%rcx), %eax
leaq (%rax,%rax,2), %rax
shlq $0x3, %rax
addq %rax, 0x20(%rbx)
movq 0x68(%r15), %rax
testq %rax, %rax
je 0x1bce2d
leaq (%r14,%r14,2), %rcx
movq 0x8(%rax,%rcx,8), %rcx
shlq $0x3, %rcx
addq 0x28(%rbx), %rcx
movq %rcx, 0x28(%rbx)
jmp 0x1bce31
movq 0x28(%rbx), %rcx
movdqu (%rbx), %xmm0
movdqu 0x10(%rbx), %xmm1
paddq %xmm0, %xmm1
pshufd $0xee, %xmm1, %xmm0     # xmm0 = xmm1[2,3,2,3]
paddq %xmm1, %xmm0
movq %xmm0, %rax
addq 0x20(%rbx), %rax
addq %rcx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: quick_rechain_sc(ul_ov_t*, overlap_region_alloc*, ul_idx_t const*, ug_opt_t const*, long, double, All_reads*, kv_rtrace_t*, char*, UC_Read*, rtrace_iter*, double, bit_extz_t*, long, int*, long, long)
int64_t quick_rechain_sc(ul_ov_t *a, overlap_region_alloc* ol, const ul_idx_t *uref, const ug_opt_t *uopt, 
int64_t bw, double diff, All_reads *ridx, kv_rtrace_t *trace, char* qstr, UC_Read *tu, rtrace_iter *tc,
double e_rate, bit_extz_t *exz, int64_t trans_sc, int32_t *f, int64_t ai, int64_t aj)
{
	ul_ov_t *li = &(a[ai]), *lj = &(a[aj]);
	uint32_t li_v, lj_v; int64_t qo, is_c, err, sc = INT32_MIN;
	li_v = (li->tn<<1)|li->rev; lj_v = (lj->tn<<1)|lj->rev;
	if(li_v == lj_v) return INT32_MIN;
	if(lj->qe <= li->qs) return INT32_MIN;
	if(lj->qs > li->qs) return INT32_MIN;
	qo = infer_rovlp(li, lj, NULL, NULL, ridx, NULL);
	if(get_ecov_contain_adv(uref, uopt, li_v^1, lj_v^1, bw, diff, qo, &is_c)) {
		if(is_c == 0) {
			err = get_rid_backward_cigar_err(tc, li, trace, NULL, uref, qstr, tu, ol, NULL, exz, e_rate, lj->qe);
			sc = f[aj] + (li->qe - lj->qe) - (err*trans_sc);
		}
	}
	return sc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r10
movq %rcx, %r15
movq 0xb0(%rsp), %r8
movq 0xa8(%rsp), %rax
leaq (%rax,%rax,8), %rcx
leaq (%rcx,%rcx,2), %rbx
addq %rax, %rbx
leaq (%r8,%r8,8), %rax
leaq (%rax,%rax,2), %r14
addq %r8, %r14
movl 0xc(%rdi,%rbx), %eax
movl 0x18(%rdi,%rbx), %r12d
shrdl $0x1f, %eax, %r12d
movl 0xc(%rdi,%r14), %eax
movl 0x18(%rdi,%r14), %ebp
shrdl $0x1f, %eax, %ebp
movq $-0x80000000, %r13      # imm = 0x80000000
cmpl %ebp, %r12d
je 0x1be43c
addq %rdi, %rbx
addq %rdi, %r14
movl 0x4(%rbx), %eax
cmpl %eax, 0x8(%r14)
jbe 0x1be43c
cmpl %eax, 0x4(%r14)
ja 0x1be43c
movq %rdx, 0x8(%rsp)
movsd %xmm1, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r9, %r8
xorl %r9d, %r9d
movsd %xmm0, 0x28(%rsp)
movq %r10, 0x20(%rsp)
callq 0x6ea22
xorl $0x1, %r12d
xorl $0x1, %ebp
subq $0x8, %rsp
leaq 0x38(%rsp), %rdi
movq %r15, %rsi
movl %r12d, %edx
movl %ebp, %ecx
movq 0x28(%rsp), %r8
movsd 0x30(%rsp), %xmm0
movq %rax, %r9
pushq %rdi
callq 0x1bcf0f
addq $0x10, %rsp
testq %rax, %rax
je 0x1be43c
cmpq $0x0, 0x30(%rsp)
jne 0x1be43c
movq 0xa0(%rsp), %r12
movq 0x98(%rsp), %r15
movq 0x88(%rsp), %rdi
movq 0x78(%rsp), %r9
movq 0x70(%rsp), %rdx
movl 0x8(%r14), %eax
subq $0x8, %rsp
movq %rbx, %rsi
xorl %ecx, %ecx
movq 0x10(%rsp), %r8
movsd 0x18(%rsp), %xmm0
pushq %rax
pushq 0xa0(%rsp)
pushq $0x0
pushq 0x38(%rsp)
pushq 0xa8(%rsp)
callq 0x7fea8
addq $0x30, %rsp
movl 0x8(%rbx), %r13d
movq 0xb0(%rsp), %rcx
addl (%r12,%rcx,4), %r13d
subl 0x8(%r14), %r13d
imulq %r15, %rax
subq %rax, %r13
movq %r13, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: if_qchain_cnn(ul_idx_t const*, ug_opt_t const*, All_reads*, long, double, ul_ov_t*, ul_ov_t*, long*, long*)
uint32_t if_qchain_cnn(const ul_idx_t *uref, const ug_opt_t *uopt, All_reads *ridx, int64_t bw, double diff, ul_ov_t *li, ul_ov_t *lj, int64_t *is_c, int64_t *arc_len)
{
	uint32_t li_v = (li->tn<<1)|li->rev, lj_v = (lj->tn<<1)|lj->rev; int64_t qo;
	if((li_v == lj_v) || (lj->qe <= li->qs)) return 0;
	qo = infer_rovlp(li, lj, NULL, NULL, ridx, NULL); ///overlap length in query (UL read)
	if(get_ecov_contain_adv(uref, uopt, li_v^1, lj_v^1, bw, diff, qo, is_c)) return 1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r8, %rdi
movl 0xc(%r8), %eax
movl 0x18(%r8), %ebp
shrdl $0x1f, %eax, %ebp
movl 0xc(%r9), %eax
movl 0x18(%r9), %r15d
shrdl $0x1f, %eax, %r15d
xorl %eax, %eax
cmpl %r15d, %ebp
je 0x1be6de
movq %rcx, %rbx
movl 0x8(%r9), %ecx
cmpl 0x4(%rdi), %ecx
jbe 0x1be6de
movq %rdx, %r8
movq %rsi, %r14
movq 0x40(%rsp), %r12
movq %r9, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r9d, %r9d
movsd %xmm0, 0x8(%rsp)
callq 0x6ea22
xorl $0x1, %ebp
xorl $0x1, %r15d
movq %r12, (%rsp)
movq %r14, %rsi
movl %ebp, %edx
movl %r15d, %ecx
movq %rbx, %r8
movsd 0x8(%rsp), %xmm0
movq %rax, %r9
callq 0x1bcf0f
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: prt_rid_raw_chain(kv_ul_ov_t*, long, long)
void prt_rid_raw_chain(kv_ul_ov_t *idx, int64_t rid, int64_t qlen)
{
	uint64_t i;
	for (i = 0; i < idx->n; i++) {
		fprintf(stderr, "[M::%s::rid->%ld] qlen::%ld, q::[%u, %u), sc::%u, cha_n::%u, idx_n::%u\n", 
				__func__, rid, qlen, idx->a[i].qs, idx->a[i].qe, idx->a[i].qn, idx->a[i].te - idx->a[i].ts,
				(uint32_t)idx->n);
	}
	
}

// Assembly:
movq 0x8(%rdi), %r10
testq %r10, %r10
je 0x1c34f5
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
movl $0x14, %ebp
xorl %r12d, %r12d
movq 0xd1b51(%rip), %rdx     # 0x294fe0
movq (%rdx), %rdi
movq (%r13), %rax
movl -0x14(%rax,%rbp), %r11d
movl -0x10(%rax,%rbp), %r9d
movl -0xc(%rax,%rbp), %edx
movq %rdx, (%rsp)
movl (%rax,%rbp), %ebx
subl -0x4(%rax,%rbp), %ebx
leaq 0x7e6f9(%rip), %rsi     # 0x241baf
leaq 0x7e73a(%rip), %rdx     # 0x241bf7
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
pushq %r10
pushq %rbx
pushq %r11
pushq 0x18(%rsp)
callq 0x22b0
addq $0x20, %rsp
incq %r12
movq 0x8(%r13), %r10
addq $0x1c, %rbp
cmpq %r10, %r12
jb 0x1c3488
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/inter.cpp
// Function: ck_ul_alignment(ul_vec_t*)
uint32_t ck_ul_alignment(ul_vec_t *x)
{
	uc_block_t *a = x->bb.a, *p, *z0, *z1; uint64_t a_n = x->bb.n, k, rlen = x->rlen;
	for (k = 0; k < a_n; k++) {
		p = &(a[k]);
		if(p->base) continue;
		if(p->qs > rlen || p->qe > rlen || p->qs > p->qe) break;
		if(p->pidx != (uint32_t)-1) {
			if(a[p->pidx].aidx == (uint32_t)-1 || a[p->pidx].aidx != k) break;
			if(p->pidx >= k) break;
			z1 = p; z0 = &(a[p->pidx]);
			if(!(z1->qs >= z0->qs && z1->qe >= z0->qe)) break;
		}

		if(p->aidx != (uint32_t)-1) {
			if(a[p->aidx].pidx == (uint32_t)-1 || a[p->aidx].pidx != k) break;
			if(p->aidx <= k) break;
			z0 = p; z1 = &(a[p->aidx]);
			if(!(z1->qs >= z0->qs && z1->qe >= z0->qe)) break;
		}
	}
	if(k >= a_n) return 1;
	return 0;
}

// Assembly:
movq 0x20(%rdi), %rcx
testq %rcx, %rcx
je 0x1c3895
pushq %r14
pushq %rbx
movq 0x30(%rdi), %rdx
movl 0x18(%rdi), %esi
leaq 0x20(%rdx), %rdi
xorl %eax, %eax
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
testb $0x40, (%rdi)
jne 0x1c3875
movl -0x1c(%rdi), %r10d
cmpl %esi, %r10d
ja 0x1c388b
movl -0x18(%rdi), %r11d
cmpl %esi, %r11d
ja 0x1c388b
cmpl %r11d, %r10d
ja 0x1c388b
movl -0xc(%rdi), %ebx
cmpq %r8, %rbx
je 0x1c3844
cmpq %rbx, %r9
jbe 0x1c388b
leaq (%rbx,%rbx,8), %rbx
movl 0x1c(%rdx,%rbx,4), %r14d
cmpl $-0x1, %r14d
je 0x1c388b
cmpq %r14, %r9
jne 0x1c388b
leaq (%rdx,%rbx,4), %rbx
cmpl 0x4(%rbx), %r10d
jb 0x1c388b
cmpl 0x8(%rbx), %r11d
jb 0x1c388b
movl -0x4(%rdi), %ebx
cmpq %r8, %rbx
je 0x1c3875
cmpq %rbx, %r9
jae 0x1c388b
leaq (%rbx,%rbx,8), %rbx
movl 0x14(%rdx,%rbx,4), %r14d
cmpl $-0x1, %r14d
je 0x1c388b
cmpq %r14, %r9
jne 0x1c388b
leaq (%rdx,%rbx,4), %rbx
cmpl %r10d, 0x4(%rbx)
jb 0x1c388b
cmpl %r11d, 0x8(%rbx)
jb 0x1c388b
incq %r9
cmpq %rcx, %r9
setae %al
addq $0x24, %rdi
cmpq %r9, %rcx
jne 0x1c37f3
movzbl %al, %eax
andl $0x1, %eax
popq %rbx
popq %r14
retq
movl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: filter_by_reliable_ovlp0(u_trans_t*, unsigned long, unsigned long, unsigned long, double)
uint64_t filter_by_reliable_ovlp0(u_trans_t *a, uint64_t a_n, uint64_t s, uint64_t e, double sec_rate)
{
	uint64_t k, ovlp;
	for (k = 0; k < a_n; k++) {
		if(a[k].del) continue;
		if(a[k].f == RC_0 || a[k].f == RC_1) {
			ovlp = ((MIN(a[k].qe, e) > MAX(a[k].qs, s))? (MIN(a[k].qe, e)-MAX(a[k].qs, s)):0);
			if(ovlp == 0) continue;
			if((ovlp) && (ovlp > ((e-s)*sec_rate))) return 1;
		}
	}
	return 0;
}

// Assembly:
testq %rsi, %rsi
je 0x1c3e7e
movq %rcx, %rax
subq %rdx, %rax
movq %rax, %xmm2
punpckldq 0x6d475(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x6d47d(%rip), %xmm2    # 0x231290
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
mulsd %xmm0, %xmm1
movq 0x6d455(%rip), %xmm0    # 0x231280
movapd 0x6d45d(%rip), %xmm2    # 0x231290
xorl %eax, %eax
testb $-0x42, 0x28(%rdi)
jne 0x1c3e74
movl (%rdi), %r9d
movl 0x4(%rdi), %r8d
cmpq %rcx, %r8
cmovaeq %rcx, %r8
cmpq %rdx, %r9
cmovbeq %rdx, %r9
subq %r9, %r8
jbe 0x1c3e74
movq %r8, %xmm3
punpckldq %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
subpd %xmm2, %xmm3
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
addsd %xmm3, %xmm4
ucomisd %xmm1, %xmm4
ja 0x1c3e81
addq $0x30, %rdi
decq %rsi
jne 0x1c3e35
retq
xorl %eax, %eax
retq
movl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: is_mmhom_node(unsigned long*, ma_utg_t*, asg_t*, unsigned long, double)
uint32_t is_mmhom_node(uint64_t *ca, ma_utg_t *u, asg_t *sg, uint64_t cov_bd, double cut_rate)
{
	if(cut_rate < 0) cut_rate = 0; if(cut_rate > 1.0) cut_rate = 1.0;
	uint64_t k, a, na, a_cut = u->n*cut_rate, na_cut = u->n*(1.0-cut_rate);
	for (k = a = na = 0; k < u->n; k++) {
		if(ca[k] > (cov_bd*((uint64_t)sg->seq[u->a[k]>>33].len))) {
			a++; if((a) && (a>=a_cut)) return 1;
		} else {
			na++; if((na) && (na>=na_cut)) return 0;
		}
	}

	if((a) && (a>=a_cut)) return 1;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
xorpd %xmm2, %xmm2
maxsd %xmm0, %xmm2
movsd 0x6c082(%rip), %xmm0    # 0x231310
movapd %xmm0, %xmm1
minsd %xmm2, %xmm1
movl 0x10(%rsi), %eax
xorps %xmm2, %xmm2
cvtsi2sd %rax, %xmm2
movapd %xmm1, %xmm4
mulsd %xmm2, %xmm4
cvttsd2si %xmm4, %r9
movq %r9, %r10
movsd 0x6c04f(%rip), %xmm3    # 0x231308
subsd %xmm3, %xmm4
cvttsd2si %xmm4, %r8
sarq $0x3f, %r10
andq %r10, %r8
orq %r9, %r8
testq %rax, %rax
je 0x1c5349
subsd %xmm1, %xmm0
mulsd %xmm2, %xmm0
cvttsd2si %xmm0, %r10
movq %r10, %r11
subsd %xmm3, %xmm0
cvttsd2si %xmm0, %r9
sarq $0x3f, %r11
andq %r11, %r9
orq %r10, %r9
movq 0x20(%rdx), %r10
movq 0x18(%rsi), %rsi
xorl %r11d, %r11d
xorl %edx, %edx
xorl %ebx, %ebx
movq (%rsi,%rbx,8), %r14
shrq $0x21, %r14
movl (%r10,%r14,8), %r14d
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
imulq %rcx, %r14
cmpq %r14, (%rdi,%rbx,8)
jbe 0x1c5329
incq %rdx
jne 0x1c5333
xorl %edx, %edx
jmp 0x1c533f
incq %r11
jne 0x1c533a
xorl %r11d, %r11d
jmp 0x1c533f
cmpq %r8, %rdx
jb 0x1c533f
jmp 0x1c5364
cmpq %r9, %r11
jae 0x1c5360
incq %rbx
cmpq %rbx, %rax
jne 0x1c5303
jmp 0x1c534b
xorl %edx, %edx
testq %rdx, %rdx
setne %al
cmpq %r8, %rdx
setae %cl
andb %al, %cl
movzbl %cl, %eax
popq %rbx
popq %r14
retq
xorl %eax, %eax
jmp 0x1c535c
movl $0x1, %eax
jmp 0x1c535c
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: remove_trans_ovlp_connect(ma_ug_t*, unsigned long, kv_ul_ov_t*)
void remove_trans_ovlp_connect(ma_ug_t *ug, uint64_t rid, kv_ul_ov_t *bck)
{
	int64_t i; uint64_t m, k;
	for (i = ((int64_t)bck->n)-1; i >= 0 && bck->a[i].qn == rid; i--);
	m = i + 1;
	if(m >= bck->n) return;
	for (k = m; k < bck->n; k++) {
		if(!trans_ovlp_connect(&(bck->a[k]), ug)) continue;
		bck->a[m++] = bck->a[k];
	}
	bck->n = m;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rdi, 0x8(%rsp)
movq 0x8(%rdx), %rdi
movq %rdi, %r12
sarq $0x3f, %r12
andq %rdi, %r12
leaq (%rdi,%rdi,8), %rax
leaq (%rax,%rax,2), %rax
leaq (%rdi,%rax), %rcx
addq $-0x1c, %rcx
movq %rdi, %rax
testq %rax, %rax
jle 0x1c5de4
decq %rax
movq (%rbx), %r8
movl (%r8,%rcx), %r8d
addq $-0x1c, %rcx
cmpq %rsi, %r8
je 0x1c5dc6
incq %rax
movq %rax, %r12
cmpq %rdi, %r12
jae 0x1c5e54
leaq (%r12,%r12,8), %rax
leaq (%rax,%rax,2), %rbp
addq %r12, %rbp
movq %r12, %r14
movq %rdi, 0x10(%rsp)
movq (%rbx), %r13
movq %r13, %r15
addq %rbp, %r15
movq %r15, %rdi
movq 0x8(%rsp), %rsi
callq 0x1c3c2d
testl %eax, %eax
je 0x1c5e3f
leaq (%r14,%r14,8), %rax
leaq (%rax,%rax,2), %rax
addq %r14, %rax
incq %r14
movups (%r15), %xmm0
movups 0xc(%r15), %xmm1
movups %xmm1, 0xc(%r13,%rax)
movups %xmm0, (%r13,%rax)
movq 0x8(%rbx), %rdi
jmp 0x1c5e44
movq 0x10(%rsp), %rdi
incq %r12
addq $0x1c, %rbp
cmpq %rdi, %r12
jb 0x1c5df7
movq %r14, 0x8(%rbx)
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/inter.cpp
// Function: gen_reliable_cov_arr(unsigned int, kv_u_trans_t*, ug_rid_cov_t*, st_mt_t*)
uint64_t *gen_reliable_cov_arr(uint32_t id, kv_u_trans_t *idx, ug_rid_cov_t *ccov, st_mt_t *sp)
{
	u_trans_t *a; uint64_t n, k;
	a = u_trans_a(*idx, id); n = u_trans_n(*idx, id);
	kv_resize(uint64_t, *sp, ccov->ug->u.a[id].n);
	memcpy(sp->a, ccov->cov.a+ccov->idx[id], sizeof((*(sp->a)))*ccov->ug->u.a[id].n);
	for (k = 0; k < n; k++) {
		if(a[k].del) continue;
		if(a[k].f == RC_0 || a[k].f == RC_1) {
			append_cov_line_ug_rid_cov_t(id, sp->a, &(a[k]), ccov, ((uint64_t)-1), -1);
		}
	}
	return sp->a;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq 0x28(%rsi), %rax
movl %edi, %r15d
movq (%rax,%r15,8), %rax
movl %eax, %r13d
shrq $0x20, %rax
leaq (%rax,%rax,2), %r12
shlq $0x4, %r12
addq 0x10(%rsi), %r12
movq (%rdx), %rax
movq 0x10(%rax), %rax
leaq (%r15,%r15,4), %rbp
movl 0x10(%rax,%rbp,8), %edx
cmpq %rdx, 0x8(%rcx)
jae 0x1c65db
decq %rdx
movq %rdx, %rax
shrq %rax
orq %rdx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x10, %rax
orq %rcx, %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rbx)
movq 0x10(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x2370
movq %rax, %rdi
movq %rax, 0x10(%rbx)
movq (%r14), %rax
movq 0x10(%rax), %rax
movl 0x10(%rax,%rbp,8), %edx
jmp 0x1c65df
movq 0x10(%rbx), %rdi
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rsi
shlq $0x3, %rsi
addq 0x28(%r14), %rsi
shlq $0x3, %rdx
callq 0x2160
testq %r13, %r13
je 0x1c662f
testb $-0x42, 0x28(%r12)
jne 0x1c6626
movq 0x10(%rbx), %rsi
movq %r15, %rdi
movq %r12, %rdx
movq %r14, %rcx
movq $-0x1, %r8
movsd 0x6b017(%rip), %xmm0    # 0x231638
callq 0xc74f4
addq $0x30, %r12
decq %r13
jne 0x1c65fd
movq 0x10(%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq