LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: mg_gchain_flt_sub(float, int, int, int, mg_gchain_t*)
int mg_gchain_flt_sub(float pri_ratio, int min_diff, int best_n, int n, mg_gchain_t *r)
{
	if (pri_ratio > 0.0f && n > 0) {
		int i, k, n_2nd = 0;
		for (i = k = 0; i < n; ++i) {
			int p = r[i].parent;
			if (p == i) { // primary
				r[i].flt = 0, ++k;
			} else if ((r[i].score >= r[p].score * pri_ratio || r[i].score + min_diff >= r[p].score) && n_2nd < best_n) {
				if (!(r[i].qs == r[p].qs && r[i].qe == r[p].qe && r[i].ps == r[p].ps && r[i].pe == r[p].pe)) // not identical hits; TODO: check path as well
					r[i].flt = 0, ++n_2nd, ++k;
				else r[i].flt = 1;
			} else r[i].flt = 1;
		}
		return k;
	}
	return n;
}

// Assembly:
movl %edx, %eax
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
setbe %dl
testl %eax, %eax
setle %r8b
orb %dl, %r8b
jne 0x19e6cd
pushq %rbp
pushq %r14
pushq %rbx
movl %eax, %edx
leaq 0x44(%rcx), %r8
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %eax, %eax
movl -0x40(%r8), %r11d
cmpq %r11, %r9
jne 0x19e639
andb $-0x2, 0x1(%r8)
jmp 0x19e6b7
movslq %r11d, %r11
movl -0x30(%r8), %ebx
xorps %xmm1, %xmm1
cvtsi2ss %ebx, %xmm1
leaq (%r11,%r11,8), %r11
movl 0x14(%rcx,%r11,8), %ebp
xorps %xmm2, %xmm2
cvtsi2ss %ebp, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm2, %xmm1
setae %r14b
addl %edi, %ebx
cmpl %ebp, %ebx
setge %bl
orb %r14b, %bl
cmpl %esi, %r10d
setl %bpl
andb %bl, %bpl
cmpb $0x1, %bpl
jne 0x19e6a8
leaq (%rcx,%r11,8), %r11
movl -0x2c(%r8), %ebx
cmpl 0x18(%r11), %ebx
jne 0x19e6af
movl -0x28(%r8), %ebx
cmpl 0x1c(%r11), %ebx
jne 0x19e6af
movl -0x20(%r8), %ebx
cmpl 0x24(%r11), %ebx
jne 0x19e6af
movl -0x1c(%r8), %ebx
cmpl 0x28(%r11), %ebx
jne 0x19e6af
orb $0x1, 0x1(%r8)
jmp 0x19e6b9
andb $-0x2, 0x1(%r8)
incl %r10d
incl %eax
incq %r9
addq $0x48, %r8
cmpq %r9, %rdx
jne 0x19e629
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: mg_gchain_restore_offset(mg_gchains_t*)
void mg_gchain_restore_offset(mg_gchains_t *gcs)
{
	int32_t i, j, n_a, n_lc;
	for (i = 0, n_a = n_lc = 0; i < gcs->n_gc; ++i) {
		mg_gchain_t *gc = &gcs->gc[i];
		gc->off = n_lc;
		for (j = 0, gc->n_anchor = 0; j < gc->cnt; ++j) {
			mg_llchain_t *lc = &gcs->lc[n_lc + j];
			lc->off = n_a;
			n_a += lc->cnt;
			gc->n_anchor += lc->cnt;
		}
		n_lc += gc->cnt;
	}
	assert(n_lc == gcs->n_lc && n_a == gcs->n_a);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movslq 0x8(%rdi), %rcx
testq %rcx, %rcx
jle 0x19e754
movq 0x18(%rdi), %rdx
xorl %esi, %esi
xorl %r9d, %r9d
xorl %eax, %eax
leaq (%rsi,%rsi,8), %r10
movl %r9d, 0x8(%rdx,%r10,8)
movl $0x0, 0x10(%rdx,%r10,8)
movslq 0xc(%rdx,%r10,8), %r8
testq %r8, %r8
jle 0x19e744
leaq (%rdx,%r10,8), %r10
movq 0x20(%rdi), %rbx
movl 0x10(%r10), %r11d
movslq %r9d, %r14
shlq $0x4, %r14
addq %r14, %rbx
addq $0x4, %rbx
movq %r8, %r14
shlq $0x4, %r14
xorl %r15d, %r15d
movl %eax, -0x4(%rbx,%r15)
movl (%rbx,%r15), %ebp
addl %ebp, %eax
addl %ebp, %r11d
addq $0x10, %r15
cmpq %r15, %r14
jne 0x19e729
movl %r11d, 0x10(%r10)
addl %r9d, %r8d
incq %rsi
movl %r8d, %r9d
cmpq %rcx, %rsi
jne 0x19e6e9
jmp 0x19e759
xorl %eax, %eax
xorl %r8d, %r8d
cmpl 0xc(%rdi), %r8d
jne 0x19e76f
cmpl 0x10(%rdi), %eax
jne 0x19e76f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9571e(%rip), %rdi     # 0x233e94
leaq 0x9520e(%rip), %rsi     # 0x23398b
leaq 0x95735(%rip), %rcx     # 0x233eb9
movl $0x875, %edx            # imm = 0x875
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: find_ul_ov_max(int, ul_ov_t const*, unsigned int)
int32_t find_ul_ov_max(int32_t n, const ul_ov_t *a, uint32_t x)
{
    int32_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
        int32_t m = s + (e - s) / 2;
        if (a[m].qe >= x) e = m;
        else s = m + 1;
    }
    assert(s == e);
    return s;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %edi, %edi
je 0x19f6e8
movslq %edi, %rcx
leaq (%rcx,%rcx,8), %r8
addq $-0x9, %r8
leaq (%r8,%r8,2), %r8
addq %r8, %rcx
decq %rcx
cmpl %edx, 0x8(%rsi,%rcx)
jae 0x19f6a2
decl %edi
movl %edi, %eax
retq
cmpl %edx, 0x8(%rsi)
jae 0x19f6e8
xorl %eax, %eax
testl %edi, %edi
jle 0x19f6e4
movl %edi, %r8d
subl %eax, %r8d
movl %r8d, %ecx
shrl $0x1f, %ecx
addl %r8d, %ecx
sarl %ecx
leal (%rcx,%rax), %r8d
movslq %r8d, %r9
leaq (%r9,%r9,8), %r10
leaq (%r10,%r10,2), %r10
addq %r9, %r10
cmpl %edx, 0x8(%rsi,%r10)
jb 0x19f6dc
movl %r8d, %edi
jmp 0x19f6e0
addl %ecx, %eax
incl %eax
cmpl %eax, %edi
jg 0x19f6ad
cmpl %edi, %eax
jne 0x19f6e9
retq
pushq %rax
leaq 0x9493b(%rip), %rdi     # 0x23402c
leaq 0x94293(%rip), %rsi     # 0x23398b
leaq 0x94934(%rip), %rcx     # 0x234033
movl $0x9c5, %edx            # imm = 0x9C5
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: get_ecov(ul_idx_t const*, ul_ov_t*, ul_ov_t*, long, long, double)
int64_t get_ecov(const ul_idx_t *uref, ul_ov_t *lv, ul_ov_t *lw, int64_t qlen, int64_t bw, double diff_ec_ul)
{
	int64_t dis_q = lv->qe - lw->qe, dis_t = 0, dif, mm;
	uint32_t i, v = ((lv->tn<<1)|lv->rev)^1, w = ((lw->tn<<1)|lw->rev)^1;
	const asg_t *g = uref->ug->g;
	uint32_t nv = asg_arc_n(g, v);
	asg_arc_t *av = asg_arc_a(g, v);
	for (i = 0; i < nv; i++) {
        if(av[i].del || av[i].v != w) continue;
		dis_t = ((uint32_t)av[i].ul);
		dis_t -= (lv->rev?lv->ts:g->seq[v>>1].len-lv->te);
		break;
    }
	
	dif = (dis_q>dis_t? dis_q-dis_t:dis_t-dis_q);
	mm = MAX(dis_q, dis_t); mm *= diff_ec_ul; if(mm < bw) mm = bw;
	// if((v>>1) == 1163 && (w>>1) == 1168) fprintf(stderr, ">>>>>>dis_q:%ld, dis_t:%ld, dif:%ld, mm:%ld\n", dis_q, dis_t, dif, mm);
	if(dif <= mm) return 1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl 0x8(%rsi), %eax
movl 0xc(%rsi), %r9d
movl 0x18(%rsi), %r10d
shldl $0x1, %r10d, %r9d
movl 0x8(%rdx), %ecx
movl %r9d, %r11d
xorl $0x1, %r11d
movq (%rdi), %rdi
movq 0x18(%rdi), %rdi
movq 0x28(%rdi), %rbx
movq (%rbx,%r11,8), %r14
testl %r14d, %r14d
je 0x19f793
movl 0xc(%rdx), %ebx
movl 0x18(%rdx), %r11d
shrdl $0x1f, %ebx, %r11d
movq 0x8(%rdi), %rbx
movq %r14, %rdx
shrq $0x20, %rdx
movl %r14d, %r12d
leaq (%rdx,%rdx,2), %r14
leaq (%rbx,%r14,8), %r15
addq $0xc, %r15
shlq $0x3, %r12
leaq (%r12,%r12,2), %r12
xorl %edx, %edx
xorl %r13d, %r13d
cmpl $0x0, (%r15,%r13)
js 0x19f788
movl -0x4(%r15,%r13), %ebp
xorl %r11d, %ebp
cmpl $0x1, %ebp
je 0x19f797
addq $0x18, %r13
cmpq %r13, %r12
jne 0x19f774
jmp 0x19f7c2
xorl %edx, %edx
jmp 0x19f7c2
leaq (%rbx,%r14,8), %rdx
movl (%r13,%rdx), %edx
testl %r10d, %r10d
js 0x19f7ba
movq 0x20(%rdi), %r10
shrl %r9d
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl (%r10,%r9,8), %edi
subl 0x14(%rsi), %edi
jmp 0x19f7bd
movl 0x10(%rsi), %edi
movl %edi, %esi
subq %rsi, %rdx
subl %ecx, %eax
movq %rdx, %rcx
subq %rax, %rcx
cmovgq %rdx, %rax
movq %rcx, %rdx
negq %rdx
cmovsq %rcx, %rdx
cvtsi2sd %rax, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
cmpq %r8, %rax
cmovgq %rax, %r8
xorl %eax, %eax
cmpq %r8, %rdx
setle %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: get_het_site(haplotype_evdience_alloc*, unsigned int)
uint64_t get_het_site(haplotype_evdience_alloc *hap, uint32_t oid)
{
	uint64_t k, l, i, occ = 0; SnpStats *s = NULL;
	for (k = 1, l = 0; k <= hap->length; ++k) {  
        if (k == hap->length || hap->list[k].overlapID != hap->list[l].overlapID) {
            if(hap->list[l].overlapID != oid) {
                l = k;
                continue;
            }
            for (i = l; i < k; i++) {
                if(hap->list[i].type!=1) continue; 
                s = &(hap->snp_stat.a[hap->list[i].overlapSite]);
                if(s->score == 1 && (!(s->occ_0 < 2 || s->occ_1 < 2))) {
					occ++;
                }
            }
            l = k;
        }
    }

	return (occ&((uint64_t)0x3FFFFFFF));
}

// Assembly:
movl 0x10(%rdi), %ecx
testq %rcx, %rcx
je 0x19fc4a
pushq %rbx
movl $0x1, %edx
xorl %eax, %eax
xorl %r8d, %r8d
cmpq %rcx, %rdx
je 0x19fbcd
movq (%rdi), %r9
leaq (%rdx,%rdx,2), %r10
movl 0x4(%r9,%r10,8), %r10d
leaq (%r8,%r8,2), %r11
cmpl 0x4(%r9,%r11,8), %r10d
je 0x19fc33
movq (%rdi), %r9
leaq (%r8,%r8,2), %r10
cmpl %esi, 0x4(%r9,%r10,8)
sete %r11b
cmpq %rdx, %r8
setb %bl
andb %r11b, %bl
cmpb $0x1, %bl
jne 0x19fc30
leaq (%r9,%r10,8), %r9
addq $0xc, %r9
cmpb $0x1, (%r9)
jne 0x19fc24
movq 0x218(%rdi), %r10
movl -0x4(%r9), %r11d
leaq (%r11,%r11,4), %r11
cmpl $0x1, 0x1c(%r10,%r11,8)
jne 0x19fc24
leaq (%r10,%r11,8), %r10
cmpl $0x2, 0x8(%r10)
jb 0x19fc24
cmpl $0x2, 0xc(%r10)
sbbq $-0x1, %rax
incq %r8
addq $0x18, %r9
cmpq %r8, %rdx
jne 0x19fbf3
movq %rdx, %r8
leaq 0x1(%rdx), %r9
cmpq %rcx, %rdx
movq %r9, %rdx
jne 0x19fbb1
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
popq %rbx
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: get_chain_x(overlap_region*, long)
int64_t get_chain_x(overlap_region* ot, int64_t q)
{
	int64_t x, y, off, i, lx = -1, ly = -1; Fake_Cigar* o = &(ot->f_cigar);
	x = get_fake_gap_pos(o, o->length - 1); 
	off = get_fake_gap_shift(o, o->length - 1);
	y = x - ot->x_pos_s + ot->y_pos_s + off;
	// if(ot->x_id == 98 && (q == 6681 || q == 6990)) fprintf(stderr, "o->length->%u, q->%ld, y->%ld, x->%ld\n", o->length, q, y, x);
	if(y == q) return x;

	for (i = 0; i < (int64_t)o->length; i++){
		x = get_fake_gap_pos(o, i); off = get_fake_gap_shift(o, i);
		y = x - ot->x_pos_s + ot->y_pos_s + off;
		// if(ot->x_id == 98 && (q == 6681 || q == 6990)) fprintf(stderr, "+i->%ld, q->%ld, y->%ld, x->%ld\n", i, q, y, x);
		if(q < y) {
			lx = x; ly = y;
			break;
		}
	}

	if(i == 0 || i == (int64_t)o->length) {
        fprintf(stderr, "ERROR at %s:%d, x_id->%u, y_id->%u, q->%ld, i->%ld, yi_s->%u, yi_e->%u\n", 
		__FILE__, __LINE__, ot->x_id, ot->y_id, q, i, ot->y_pos_s, ot->y_pos_e);
        exit(0);
    }

	x = get_fake_gap_pos(o, i-1); off = get_fake_gap_shift(o, i-1);
	y = x - ot->x_pos_s + ot->y_pos_s + off;
	y = (((double)(q - y))/((double)(ly - y)))*((double)(lx -x)) + x;
	// y = q - y + x;
	if(y < ot->x_pos_s) y = ot->x_pos_s;
	if(y > ot->x_pos_e) y = ot->x_pos_e;
	return y;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x38(%rdi), %r15
movl 0x40(%rdi), %esi
decl %esi
movq %r15, %rdi
callq 0x3dc2f
movslq %eax, %r12
movl 0x40(%rbx), %esi
decl %esi
movq %r15, %rdi
callq 0x3dc3a
cltq
movl 0x4(%rbx), %ecx
movl 0x14(%rbx), %edx
addq %r12, %rax
subq %rcx, %rax
addq %rdx, %rax
cmpq %r14, %rax
jne 0x19fc9d
movq %r12, %rax
jmp 0x19fd84
movq $-0x1, (%rsp)
cmpl $0x0, 0x40(%rbx)
je 0x19fceb
xorl %r12d, %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x3dc2f
movslq %eax, %r13
movq %r15, %rdi
movl %r12d, %esi
callq 0x3dc3a
movslq %eax, %rbp
movl 0x4(%rbx), %eax
movl 0x14(%rbx), %ecx
addq %r13, %rbp
subq %rax, %rbp
addq %rcx, %rbp
cmpq %r14, %rbp
jg 0x19fcf7
incq %r12
movl 0x40(%rbx), %eax
cmpq %rax, %r12
jb 0x19fcae
jmp 0x19fcee
xorl %r12d, %r12d
movq $-0x1, %rbp
jmp 0x19fcfb
movq %r13, (%rsp)
testq %r12, %r12
je 0x19fd93
movl 0x40(%rbx), %eax
cmpq %rax, %r12
je 0x19fd93
decl %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x3dc2f
movslq %eax, %r13
movq %r15, %rdi
movl %r12d, %esi
callq 0x3dc3a
movslq %eax, %rcx
movl 0x4(%rbx), %eax
movl 0x14(%rbx), %edx
addq %r13, %rcx
subq %rax, %rcx
addq %rdx, %rcx
subq %rcx, %r14
cvtsi2sd %r14, %xmm0
subq %rcx, %rbp
cvtsi2sd %rbp, %xmm1
divsd %xmm1, %xmm0
movq (%rsp), %rcx
subq %r13, %rcx
xorps %xmm1, %xmm1
cvtsi2sd %rcx, %xmm1
cvtsi2sd %r13d, %xmm2
mulsd %xmm0, %xmm1
addsd %xmm1, %xmm2
cvttsd2si %xmm2, %rcx
movl 0x8(%rbx), %edx
cmpq %rax, %rcx
cmovgq %rcx, %rax
cmpq %rdx, %rax
cmovgeq %rdx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x14(%rbx), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
callq 0x29f2e
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: get_het_occ(haplotype_evdience*, long, long, long, utg_ct_t*, long)
int64_t get_het_occ(haplotype_evdience *he_a, int64_t he_n, int64_t c_k, int64_t ylen, utg_ct_t *p, int64_t rev)
{
	int64_t k, occ = 0, ss;
	if(!rev) {
		for (k = c_k; k >= 0; k--) {
			if(he_a[k].cov >= p->s && he_a[k].cov < p->e) {
				occ++;
			} else {
				break;
			}
		}

		for (k = c_k+1; k < he_n; k++) {
			if(he_a[k].cov >= p->s && he_a[k].cov < p->e) {
				occ++;
			} else {
				break;
			}
		}
	} else {
		for (k = c_k; k >= 0; k--) {
			ss = ylen - he_a[k].cov - 1;
			if(ss >= p->s && ss < p->e) {
				occ++;
			} else {
				break;
			}
		}

		for (k = c_k+1; k < he_n; k++) {
			ss = ylen - he_a[k].cov - 1;
			if(ss >= p->s && ss < p->e) {
				occ++;
			} else {
				break;
			}
		}
	}

	assert(occ);
	return occ;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %r9, %r9
je 0x1a057a
leaq (%rdx,%rdx,2), %r9
testq %rdx, %rdx
js 0x1a05b4
movl 0x4(%r8), %r10d
leaq 0x1(%rdx), %r11
leaq (%rdi,%r9,8), %rbx
addq $0x10, %rbx
xorl %eax, %eax
movl (%rbx), %r14d
notq %r14
addq %rcx, %r14
cmpq %r10, %r14
jl 0x1a05b6
movl 0x8(%r8), %r15d
cmpq %r15, %r14
jge 0x1a05b6
incq %rax
addq $-0x18, %rbx
cmpq %rax, %r11
jne 0x1a0552
movq %r11, %rax
jmp 0x1a05b6
testq %rdx, %rdx
js 0x1a05f5
movl 0x4(%r8), %r9d
leaq 0x1(%rdx), %rcx
leaq (%rdx,%rdx,2), %rax
leaq (%rdi,%rax,8), %r10
addq $0x10, %r10
xorl %eax, %eax
movl (%r10), %r11d
cmpl %r9d, %r11d
jb 0x1a05f7
cmpl 0x8(%r8), %r11d
jae 0x1a05f7
incq %rax
addq $-0x18, %r10
cmpq %rax, %rcx
jne 0x1a0595
movq %rcx, %rax
jmp 0x1a05f7
xorl %eax, %eax
leaq 0x1(%rdx), %r10
cmpq %rsi, %r10
jge 0x1a062e
movl 0x4(%r8), %r10d
notq %rdx
addq %rsi, %rdx
leaq (%rdi,%r9,8), %rsi
addq $0x28, %rsi
movl (%rsi), %edi
notq %rdi
addq %rcx, %rdi
cmpq %r10, %rdi
jl 0x1a062e
movl 0x8(%r8), %r9d
cmpq %r9, %rdi
jge 0x1a062e
incq %rax
addq $0x18, %rsi
decq %rdx
jne 0x1a05d1
jmp 0x1a062e
xorl %eax, %eax
leaq 0x1(%rdx), %rcx
cmpq %rsi, %rcx
jge 0x1a062e
movl 0x4(%r8), %ecx
leaq (%rdx,%rdx,2), %r9
notq %rdx
addq %rsi, %rdx
leaq (%rdi,%r9,8), %rsi
addq $0x28, %rsi
movl (%rsi), %edi
cmpl %ecx, %edi
jb 0x1a062e
cmpl 0x8(%r8), %edi
jae 0x1a062e
incq %rax
addq $0x18, %rsi
decq %rdx
jne 0x1a0616
testq %rax, %rax
je 0x1a0639
popq %rbx
popq %r14
popq %r15
retq
leaq 0x83e4b(%rip), %rdi     # 0x22448b
leaq 0x93344(%rip), %rsi     # 0x23398b
leaq 0x93bbf(%rip), %rcx     # 0x23420d
movl $0xb23, %edx            # imm = 0xB23
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: check_contain_pair(ug_opt_t const*, unsigned int, unsigned int, unsigned int)
uint32_t check_contain_pair(const ug_opt_t *uopt, uint32_t x, uint32_t y, uint32_t check_el)
{
	ma_hit_t_alloc* src = uopt->sources;
	int64_t min_ovlp = uopt->min_ovlp;
	int64_t max_hang = uopt->max_hang;
	uint64_t z, qn, tn; int32_t r = 1; asg_arc_t e;
	for (z = 0; z < src[x].length; z++) {
		if(check_el && (!src[x].buffer[z].el)) continue;
		qn = Get_qn(src[x].buffer[z]); tn = Get_tn(src[x].buffer[z]);
		if(tn != y) continue;
		r = ma_hit2arc(&(src[x].buffer[z]), Get_READ_LENGTH(R_INF, qn), Get_READ_LENGTH(R_INF, tn), max_hang, asm_opt.max_hang_rate, min_ovlp, &e);
		if(r == MA_HT_QCONT || r == MA_HT_TCONT) break;
	}

	if(z < src[x].length) return 1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %r13d
movq 0x8(%rdi), %rax
movl %esi, %ecx
leaq (%rcx,%rcx,2), %rcx
movl 0xc(%rax,%rcx,8), %esi
testq %rsi, %rsi
setne %r12b
je 0x1a1356
movl %edx, %ebp
movl 0x44(%rdi), %r9d
movl %r9d, 0x14(%rsp)
movl 0x40(%rdi), %edi
movl %edi, 0x10(%rsp)
leaq (%rax,%rcx,8), %rcx
leaq 0xe9f81(%rip), %rax     # 0x28b230
movq 0x18(%rax), %rax
movq %rax, 0x20(%rsp)
leaq 0xe9499(%rip), %rax     # 0x28a758
movss 0x158(%rax), %xmm0
movss %xmm0, 0xc(%rsp)
leaq (,%rsi,8), %rax
leaq (%rax,%rax,4), %r14
movl $0x1, %r15d
xorl %ebx, %ebx
movq %rcx, 0x28(%rsp)
movq %rsi, 0x18(%rsp)
testl %r13d, %r13d
je 0x1a12fa
movq (%rcx), %rax
cmpb $0x0, 0x20(%rax,%rbx)
je 0x1a1343
movq (%rcx), %rdi
movl 0xc(%rdi,%rbx), %eax
cmpl %ebp, %eax
jne 0x1a1343
addq %rbx, %rdi
movl 0x4(%rdi), %ecx
movq 0x20(%rsp), %r9
movl (%r9,%rcx,8), %esi
movl (%r9,%rax,8), %edx
movl 0x10(%rsp), %ecx
movss 0xc(%rsp), %xmm0
movl 0x14(%rsp), %r8d
leaq 0x30(%rsp), %r9
callq 0x19c0d3
movq 0x28(%rsp), %rcx
movq 0x18(%rsp), %rsi
addl $0x3, %eax
cmpl $0x2, %eax
jb 0x1a1356
cmpq %rsi, %r15
setb %r12b
addq $0x28, %rbx
incq %r15
cmpq %rbx, %r14
jne 0x1a12eb
movzbl %r12b, %eax
andl $0x1, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: debug_contain_ovlps(ul_ov_t*, unsigned long, ug_opt_t const*)
void debug_contain_ovlps(ul_ov_t *a, uint64_t a_n, const ug_opt_t *uopt)
{
	uint64_t k, i, f; ul_ov_t *z = NULL, *w = NULL;
	for (k = 0; k < a_n; k++) {
		z = &(a[k]);
		if(!(z->tn&((uint32_t)(0x80000000)))) continue;
		for (i = 0, f = z->qn; i < a_n; i++) {
			w = &(a[i]);
			if(i == k) continue;
			if(w->tn&((uint32_t)(0x80000000))) continue;
			if(z->qs >= w->qs && z->qe <= w->qe && check_contain_pair(uopt, (z->tn<<1)>>1, w->tn, 1)) {
				f = (uint32_t)-1;
				break;
			}
		}
		if(z->qn != f) fprintf(stderr, "ERROR\n");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
testq %rsi, %rsi
je 0x1a1436
movq %rsi, %r14
movq %rdi, %r15
leaq 0xc(%rdi), %rax
movq %rax, (%rsp)
xorl %r13d, %r13d
leaq (,%r13,8), %rax
addq %r13, %rax
leaq (%rax,%rax,2), %r12
addq %r13, %r12
cmpl $0x0, 0xc(%r15,%r12)
jns 0x1a141a
addq %r15, %r12
movl (%r12), %eax
movq %rax, 0x8(%rsp)
movq (%rsp), %rbx
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0x1a1403
movl (%rbx), %edx
testl %edx, %edx
js 0x1a1403
movl 0x4(%r12), %eax
cmpl -0x8(%rbx), %eax
jb 0x1a1403
movl 0x8(%r12), %eax
cmpl -0x4(%rbx), %eax
ja 0x1a1403
movl 0xc(%r12), %esi
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %esi
movq 0x10(%rsp), %rdi
movl $0x1, %ecx
callq 0x1a1266
testl %eax, %eax
jne 0x1a1428
incq %rbp
addq $0x1c, %rbx
cmpq %rbp, %r14
jne 0x1a13c5
movq 0x8(%rsp), %rax
cmpl (%r12), %eax
jne 0x1a142f
incq %r13
cmpq %r14, %r13
jne 0x1a1399
jmp 0x1a1436
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1a1414
callq 0x29f7e
jmp 0x1a141a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: query_ovlp_src(ug_opt_t const*, unsigned int, unsigned int, long, double, unsigned int*)
ma_hit_t* query_ovlp_src(const ug_opt_t *uopt, uint32_t v, uint32_t w, int64_t o, double diff_ec_ul, uint32_t *ol)
{
	ma_hit_t_alloc* src = uopt->sources;
    int64_t min_ovlp = uopt->min_ovlp;
    int64_t max_hang = uopt->max_hang, d, l, max_l;
    uint64_t z, qn, tn, x = v>>1; int32_t r = 1; asg_arc_t e;
	l = (o>=0?o:-o); //l *= diff_ec_ul;
	if(l <= 0) return NULL;
    for (z = 0; z < src[x].length; z++) {
        qn = Get_qn(src[x].buffer[z]); tn = Get_tn(src[x].buffer[z]);
        if(tn != (w>>1)) continue;
        r = ma_hit2arc(&(src[x].buffer[z]), Get_READ_LENGTH(R_INF, qn), Get_READ_LENGTH(R_INF, tn), max_hang, asm_opt.max_hang_rate, min_ovlp, &e);
        if(r < 0) continue;
		if((e.ul>>32) != v || e.v != w) continue;
		// if(v == 56 && w == 25) fprintf(stderr, "+xxxx, o:%ld, e.ol:%u\n", o, e.ol);
		// if(v == 25 && w == 56) fprintf(stderr, "-xxxx, o:%ld, e.ol:%u\n", o, e.ol);
		d = (o>=e.ol?o-e.ol:e.ol-o);
		max_l = MAX(l, e.ol);
		if(d <= (max_l*diff_ec_ul)) {
			if(ol) (*ol) = e.ol;
			return &(src[x].buffer[z]);
		}
    }
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movsd %xmm0, 0x20(%rsp)
movl %edx, 0x4(%rsp)
movq %rcx, %r14
negq %r14
movq %rcx, 0x18(%rsp)
cmovsq %rcx, %r14
jae 0x1a1569
movq 0x8(%rdi), %rax
movl %esi, %ecx
shrl %ecx
leaq (%rcx,%rcx,2), %rcx
movl 0xc(%rax,%rcx,8), %ebp
testq %rbp, %rbp
je 0x1a1569
movq %r8, 0x10(%rsp)
movl 0x44(%rdi), %edx
movl %edx, 0xc(%rsp)
movl 0x40(%rdi), %r13d
leaq (%rax,%rcx,8), %rax
movq (%rax), %r15
movl 0x4(%rsp), %ebx
shrl %ebx
leaq 0xe9d81(%rip), %rax     # 0x28b230
movq 0x18(%rax), %r12
leaq 0xe929e(%rip), %rax     # 0x28a758
movss 0x158(%rax), %xmm0
movss %xmm0, 0x8(%rsp)
movl %esi, %eax
movq %rax, 0x28(%rsp)
movl 0xc(%r15), %eax
cmpl %ebx, %eax
jne 0x1a155c
movl 0x4(%r15), %ecx
movl (%r12,%rcx,8), %esi
movl (%r12,%rax,8), %edx
movq %r15, %rdi
movl %r13d, %ecx
movss 0x8(%rsp), %xmm0
movl 0xc(%rsp), %r8d
leaq 0x30(%rsp), %r9
callq 0x19c0d3
testl %eax, %eax
js 0x1a155c
movq 0x28(%rsp), %rax
cmpl %eax, 0x34(%rsp)
jne 0x1a155c
movl 0x4(%rsp), %eax
cmpl %eax, 0x38(%rsp)
jne 0x1a155c
movl 0x3c(%rsp), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, %rcx
subq 0x18(%rsp), %rcx
movq %rcx, %rdx
negq %rdx
cmovsq %rcx, %rdx
cmpq %rax, %r14
movq %rax, %rcx
cmovaq %r14, %rcx
xorps %xmm0, %xmm0
cvtsi2sd %rdx, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %rcx, %xmm1
mulsd 0x20(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jae 0x1a157e
addq $0x28, %r15
decq %rbp
jne 0x1a14cf
xorl %r15d, %r15d
movq %r15, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
je 0x1a156c
movl %eax, (%rcx)
jmp 0x1a156c
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: debug_infer_read_ovlp(ug_opt_t const*, double, ul_ov_t*, ul_ov_t*, ma_utg_t*, unsigned int, unsigned int, All_reads*, ma_ug_t*)
void debug_infer_read_ovlp(const ug_opt_t *uopt, double diff_ec_ul, ul_ov_t *li, ul_ov_t *lj, ma_utg_t *u, 
uint32_t i_idx, uint32_t j_idx, All_reads *ridx, ma_ug_t *ug)
{
	uint32_t li_v, lj_v; ma_hit_t *t = NULL;
	li_v = (((uint32_t)(li->tn))<<1)|((uint32_t)(li->rev));
	lj_v = (((uint32_t)(lj->tn))<<1)|((uint32_t)(lj->rev));
	if(lj->qe <= li->qs || li_v == lj_v) fprintf(stderr, "ERROR-1\n");
    t = query_ovlp_src(uopt, li_v^1, lj_v^1, infer_rovlp(li, lj, NULL, NULL, ridx, ug), diff_ec_ul, NULL);
	// ((int64_t)(lj->qe))-((int64_t)(li->qs))
	if(!t /**&& (li_v^1) == 648 && (lj_v^1) == 638 && li->qs == 63841**/) {
		fprintf(stderr, "ERROR-2, li_v^1->%u, li->qs->%u, li->qe->%u, lj_v^1->%u, lj->qs->%u, lj->qe->%u, infer_rovlp->%ld\n", 
		li_v^1, li->qs, li->qe, lj_v^1, lj->qs, lj->qe, infer_rovlp(li, lj, NULL, NULL, ridx, ug));
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, %r12
movsd %xmm0, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
movq 0x68(%rsp), %r13
movl 0xc(%rsi), %eax
movl 0x18(%rsi), %ebx
shrdl $0x1f, %eax, %ebx
movq 0x60(%rsp), %r15
movl 0x8(%rdx), %eax
movl 0xc(%rdx), %ecx
movl 0x18(%rdx), %ebp
shrdl $0x1f, %ecx, %ebp
cmpl 0x4(%rsi), %eax
jbe 0x1a16a9
cmpl %ebp, %ebx
je 0x1a16a9
xorl $0x1, %ebx
xorl $0x1, %ebp
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
movq %r13, %r9
callq 0x6f050
movq 0x8(%rsp), %rdi
movl %ebx, %esi
movl %ebp, %edx
movq %rax, %rcx
movsd 0x10(%rsp), %xmm0
xorl %r8d, %r8d
callq 0x1a1445
testq %rax, %rax
je 0x1a1626
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xe89b3(%rip), %rax     # 0x289fe0
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movl 0x4(%r12), %eax
movl %eax, 0x1c(%rsp)
movl 0x8(%r12), %eax
movl %eax, 0x18(%rsp)
movl 0x4(%r14), %eax
movq %rax, 0x10(%rsp)
movl 0x8(%r14), %eax
movq %rax, 0x8(%rsp)
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
movq %r13, %r9
callq 0x6f050
movq %rax, %r10
subq $0x8, %rsp
leaq 0x92beb(%rip), %rsi     # 0x234267
movq 0x28(%rsp), %rdi
movl %ebx, %edx
movl 0x24(%rsp), %ecx
movl 0x20(%rsp), %r8d
movl %ebp, %r9d
xorl %eax, %eax
pushq %r10
pushq 0x18(%rsp)
pushq 0x28(%rsp)
callq 0x22b0
addq $0x48, %rsp
jmp 0x1a161b
callq 0x29f9a
jmp 0x1a15dd
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: get_ug_edge_src(ma_ug_t*, ma_hit_t_alloc*, long, long, unsigned int, unsigned int)
ma_hit_t *get_ug_edge_src(ma_ug_t *ug, ma_hit_t_alloc *src, int64_t max_hang, int64_t min_ovlp, uint32_t uv, uint32_t uw)
{
	if(ug->u.a[uv>>1].circ || ug->u.a[uw>>1].circ) return NULL;
	uint32_t v, w, k, qn, tn; int32_t r; asg_arc_t t;
    v = ((uv&1)?(ug->u.a[uv>>1].start^1):(ug->u.a[uv>>1].end^1));
    w = ((uw&1)?(ug->u.a[uw>>1].end):(ug->u.a[uw>>1].start));
    ma_hit_t_alloc *x = &(src[v>>1]);

	for (k = 0; k < x->length; k++) {
        qn = Get_qn(x->buffer[k]);
        tn = Get_tn(x->buffer[k]);
        if(qn == (v>>1) && tn == (w>>1)) {
            r = ma_hit2arc(&(x->buffer[k]), Get_READ_LENGTH(R_INF, v>>1), Get_READ_LENGTH(R_INF, w>>1),
			max_hang, asm_opt.max_hang_rate, min_ovlp, &t);
            if(r < 0) continue;
            if((t.ul>>32)!=v || t.v!=w) continue;
			return &(x->buffer[k]);
        }
    }

	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x10(%rdi), %rax
movl %r8d, %ecx
shrl %ecx
leaq (%rcx,%rcx,4), %rdx
cmpl $0x0, (%rax,%rdx,8)
js 0x1a24de
movl %r9d, %ecx
shrl %ecx
leaq (%rcx,%rcx,4), %rcx
cmpl $0x0, (%rax,%rcx,8)
js 0x1a24de
xorl %edi, %edi
testb $0x1, %r8b
sete %dil
leaq (%rax,%rdx,8), %rdx
movl 0x4(%rdx,%rdi,4), %r13d
movl %r13d, %ebp
shrl %ebp
leaq (,%rbp,2), %rdx
addq %rbp, %rdx
movl 0xc(%rsi,%rdx,8), %r12d
testq %r12, %r12
je 0x1a24de
leaq (%rax,%rcx,8), %rax
andl $0x1, %r9d
movl 0x4(%rax,%r9,4), %ebx
leaq (%rsi,%rdx,8), %rax
xorq $0x1, %r13
movq (%rax), %r15
movq %rbx, 0x8(%rsp)
shrl %ebx
leaq 0xe8dbb(%rip), %rax     # 0x28b230
movq 0x18(%rax), %r14
leaq 0xe82d8(%rip), %rax     # 0x28a758
movss 0x158(%rax), %xmm0
movss %xmm0, 0x4(%rsp)
cmpl 0x4(%r15), %ebp
jne 0x1a24d5
cmpl %ebx, 0xc(%r15)
jne 0x1a24d5
movl (%r14,%rbp,8), %esi
movl (%r14,%rbx,8), %edx
movq %r15, %rdi
movq 0x10(%rsp), %rcx
movss 0x4(%rsp), %xmm0
movq 0x18(%rsp), %r8
leaq 0x20(%rsp), %r9
callq 0x19c0d3
testl %eax, %eax
js 0x1a24d5
cmpl %r13d, 0x24(%rsp)
jne 0x1a24d5
movq 0x8(%rsp), %rax
cmpl %eax, 0x28(%rsp)
je 0x1a24e1
addq $0x28, %r15
decq %r12
jne 0x1a248e
xorl %r15d, %r15d
movq %r15, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: get_rr_tse(ul_idx_t const*, ul_ov_t*, unsigned int*, unsigned int*, unsigned int*)
void get_rr_tse(const ul_idx_t *uref, ul_ov_t *li, uint32_t *ts, uint32_t *te, uint32_t *tl)
{
	(*tl) = uref?uref->ug->g->seq[li->tn].len:Get_READ_LENGTH(R_INF, li->tn); 
	if(!(li->rev)) {
		(*ts) = li->ts; (*te) = li->te;
	} else {
		(*ts) = (*tl) - li->te; (*te) = (*tl) - li->ts;
	}
}

// Assembly:
testq %rdi, %rdi
je 0x1a2754
movq (%rdi), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rdi
movl 0xc(%rsi), %r9d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl (%rdi,%r9,8), %eax
jmp 0x1a2765
leaq 0xe8ad5(%rip), %rax     # 0x28b230
movq 0x18(%rax), %rax
movl 0xc(%rsi), %edi
movl (%rax,%rdi,8), %eax
movl %eax, (%r8)
cmpl $0x0, 0x18(%rsi)
js 0x1a2778
movl 0x10(%rsi), %eax
movl %eax, (%rdx)
movl 0x14(%rsi), %eax
jmp 0x1a2783
subl 0x14(%rsi), %eax
movl %eax, (%rdx)
movl (%r8), %eax
subl 0x10(%rsi), %eax
movl %eax, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: check_trans_rate(ul_ov_t*, long, float)
uint32_t check_trans_rate(ul_ov_t *a, int64_t a_n, float trans_thres)
{
	uint32_t sp = (uint32_t)-1, ep = (uint32_t)-1, tts = (uint32_t)-1, tte = 0, el = 0, iel = 0; 
	int64_t k;
	for (k = a_n-1; k >= 0; k--) {
		if(a[k].qs < tts) tts = a[k].qs;
		if(a[k].qe > tte) tte = a[k].qe;
		if(!(a[k].el)) continue;
		if(sp == (uint32_t)-1 || a[k].qe <= sp) {
			if(sp != (uint32_t)-1) el += ep - sp;
            sp = a[k].qs;
            ep = a[k].qe;
		} else {
			sp = MIN(sp, a[k].qs);
		}
	}
	if(sp != (uint32_t)-1) el += ep - sp;
	iel = (tte - tts) - el;
	// fprintf(stderr, "[M::%s] el:%u, iel:%u\n", __func__, el, iel);
	if((iel == 0) || (iel <= ((tte - tts)*trans_thres))) return 1;
	return 0;
}

// Assembly:
movl $0x1, %eax
xorl %ecx, %ecx
testq %rsi, %rsi
jle 0x1a3c9b
pushq %rbp
pushq %rbx
leaq 0x1(%rsi), %r9
leaq (%rsi,%rsi,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rsi, %rdx
leaq (%rdi,%rdx), %r11
addq $-0x18, %r11
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
xorl %esi, %esi
xorl %edx, %edx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl (%r11), %ebx
movl 0x4(%r11), %ebp
cmpl %r10d, %ebx
cmovbl %ebx, %r10d
cmpl %edx, %ebp
cmoval %ebp, %edx
testb $0x40, 0x17(%r11)
je 0x1a3c87
cmpl $-0x1, %r8d
je 0x1a3c82
cmpl %r8d, %ebp
jbe 0x1a3c7d
cmpl %ebx, %r8d
cmovael %ebx, %r8d
jmp 0x1a3c87
subl %r8d, %edi
addl %edi, %esi
movl %ebx, %r8d
movl %ebp, %edi
decq %r9
addq $-0x1c, %r11
cmpq $0x1, %r9
jg 0x1a3c4f
subl %r10d, %edx
popq %rbx
popq %rbp
jmp 0x1a3cad
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %esi, %esi
movl $0x1, %edx
subl %r8d, %edi
cmpl $-0x1, %r8d
cmovel %ecx, %edi
addl %esi, %edi
movl %edx, %ecx
subl %edi, %ecx
je 0x1a3cd6
cvtsi2ss %rcx, %xmm1
movl %edx, %ecx
cvtsi2ss %rcx, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
jae 0x1a3cd6
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: quick_primary_assgin(ul_idx_t const*, ug_opt_t const*, long, double, ul_ov_t*, long)
uint32_t quick_primary_assgin(const ul_idx_t *uref, const ug_opt_t *uopt, int64_t bw, double diff_ec_ul, ul_ov_t *a, int64_t a_n)
{
	int64_t k, qo, share, f = 1; ul_ov_t *li, *lk; uint32_t li_v, lk_v;
	for (k = a_n - 1, li = NULL; k >= 0; k--) {
		lk = &(a[k]); lk_v = (lk->tn<<1)|lk->rev; lk->sec = SEC_MODE; 
		if(!(lk->tn&((uint32_t)(0x80000000)))) continue;
		if(li && lk->qe > li->qs) { ///lk is overlapped with li
			li->tn <<= 1; li->tn >>= 1; lk->tn <<= 1; lk->tn >>= 1;
			qo = infer_rovlp(li, lk, NULL, NULL, NULL, NULL);
			li->tn |= ((uint32_t)(0x80000000)); lk->tn |= ((uint32_t)(0x80000000));
			if(qo && li_v != lk_v && get_ecov_adv(uref, uopt, li_v^1, lk_v^1, bw, diff_ec_ul, qo, 1, &share)) {
				li->sec = k; f++; ///the end of a chain is a cis overlap
			} else {
				f = 0;
				break;
			}
		}
		li = lk; li_v = lk_v; 
	}
	return f;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movsd %xmm0, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, (%rsp)
testq %r8, %r8
jle 0x1a4b4d
movq %r8, %rbx
leaq (%r8,%r8,8), %rax
leaq (%rax,%rax,2), %rax
addq %r8, %rax
leaq (%rcx,%rax), %r13
addq $-0x1c, %r13
movl $0x1, %r15d
xorl %ebp, %ebp
movl 0xc(%r13), %r12d
movl 0x18(%r13), %eax
movl %eax, %ecx
orl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
movl %ecx, 0x18(%r13)
testl %r12d, %r12d
js 0x1a4a84
movl %r14d, %r12d
jmp 0x1a4b30
shldl $0x1, %eax, %r12d
testq %rbp, %rbp
je 0x1a4b2d
movl 0x8(%r13), %eax
cmpl 0x4(%rbp), %eax
jbe 0x1a4b2d
andb $0x7f, 0xf(%rbp)
andb $0x7f, 0xf(%r13)
movq %rbp, %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x6f050
orb $-0x80, 0xf(%rbp)
orb $-0x80, 0xf(%r13)
testq %rax, %rax
je 0x1a4b63
movl $0x0, %ecx
cmpl %r12d, %r14d
je 0x1a4b52
xorl $0x1, %r14d
movl %r12d, %ecx
xorl $0x1, %ecx
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movl %r14d, %edx
movq 0x10(%rsp), %r8
movsd 0x18(%rsp), %xmm0
movq %rax, %r9
leaq 0x20(%rsp), %rax
pushq %rax
pushq $0x1
callq 0x1a24f3
addq $0x10, %rsp
testq %rax, %rax
je 0x1a4b63
leal -0x1(%rbx), %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movl 0x18(%rbp), %ecx
movl $0xc0000000, %edx       # imm = 0xC0000000
andl %edx, %ecx
orl %eax, %ecx
movl %ecx, 0x18(%rbp)
incq %r15
movq %r13, %rbp
decq %rbx
leaq 0x1(%rbx), %rax
addq $-0x1c, %r13
movl %r12d, %r14d
movq %r15, %rcx
cmpq $0x1, %rax
jg 0x1a4a63
jmp 0x1a4b52
movl $0x1, %ecx
movl %ecx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ecx, %ecx
jmp 0x1a4b52
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: g_adjacent_dis(asg_t const*, unsigned int, unsigned int)
int64_t g_adjacent_dis(const asg_t *g, uint32_t v, uint32_t w)
{
	uint32_t nv, i; asg_arc_t *av = NULL;
	nv = asg_arc_n(g, v); av = asg_arc_a(g, v);
	for (i = 0; i < nv; i++) {
        if(av[i].del || av[i].v != w) continue;
		return (uint32_t)av[i].ul;
	}
	return -1;
}

// Assembly:
movq 0x28(%rdi), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %rsi
movq $-0x1, %rax
testl %esi, %esi
je 0x1a5e41
movq 0x8(%rdi), %rcx
movq %rsi, %rdi
shrq $0x20, %rdi
movl %esi, %r8d
leaq (%rdi,%rdi,2), %rsi
leaq (%rcx,%rsi,8), %rdi
addq $0xc, %rdi
shlq $0x3, %r8
leaq (%r8,%r8,2), %r9
xorl %r8d, %r8d
cmpl $0x0, (%rdi,%r8)
js 0x1a5e38
cmpl %edx, -0x4(%rdi,%r8)
je 0x1a5e42
addq $0x18, %r8
cmpq %r8, %r9
jne 0x1a5e2a
retq
leaq (%rcx,%rsi,8), %rax
movl (%r8,%rax), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: get_r_offset(ma_ug_t*, mg_lchain_t*, long*, long*, long*, long*)
void get_r_offset(ma_ug_t *ug, mg_lchain_t *x, int64_t *rs, int64_t *re, int64_t *qs, int64_t *qe)
{
	if(qs) *qs = x->qs; if(qe) *qe = x->qe;
	if(!(x->score&1)) {
		if(rs) *rs = x->rs + x->off;
		if(re) *re = x->re + x->off;
	} else {
		if(rs) *rs = x->off + ug->g->seq[x->score>>1].len - x->re;
		if(re) *re = x->off + ug->g->seq[x->score>>1].len - x->rs;
	}
}

// Assembly:
testq %r8, %r8
je 0x1a5e57
movslq 0x14(%rsi), %rax
movq %rax, (%r8)
testq %r9, %r9
je 0x1a5e63
movslq 0x18(%rsi), %rax
movq %rax, (%r9)
movl 0x1c(%rsi), %eax
testb $0x1, %al
jne 0x1a5e88
testq %rdx, %rdx
je 0x1a5e7c
movslq 0xc(%rsi), %rax
movslq (%rsi), %rdi
addq %rax, %rdi
movq %rdi, (%rdx)
testq %rcx, %rcx
je 0x1a5ed9
movl (%rsi), %eax
addl 0x10(%rsi), %eax
jmp 0x1a5ed4
testq %rdx, %rdx
je 0x1a5eb5
movq 0x18(%rdi), %r8
movq 0x20(%r8), %r8
movl %eax, %r9d
sarl %r9d
movslq %r9d, %r9
movl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
andl (%r8,%r9,8), %r10d
addl (%rsi), %r10d
subl 0x10(%rsi), %r10d
movslq %r10d, %r8
movq %r8, (%rdx)
testq %rcx, %rcx
je 0x1a5ed9
movq 0x18(%rdi), %rdx
movq 0x20(%rdx), %rdx
sarl %eax
movslq %eax, %rdi
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl (%rdx,%rdi,8), %eax
addl (%rsi), %eax
subl 0xc(%rsi), %eax
cltq
movq %rax, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: get_u_offset(ma_ug_t*, mg_lchain_t*, long*, long*, long*, long*)
void get_u_offset(ma_ug_t *ug, mg_lchain_t *x, int64_t *rs, int64_t *re, int64_t *qs, int64_t *qe)
{
	if(qs) *qs = x->qs; if(qe) *qe = x->qe;
	if(!(x->v&1)) {
		if(rs) *rs = x->rs + x->off;
		if(re) *re = x->re + x->off;
	} else {
		if(rs) *rs = x->off + ug->g->seq[x->v>>1].len - x->re;
		if(re) *re = x->off + ug->g->seq[x->v>>1].len - x->rs;
	}
}

// Assembly:
testq %r8, %r8
je 0x1a5ee6
movslq 0x14(%rsi), %rax
movq %rax, (%r8)
testq %r9, %r9
je 0x1a5ef2
movslq 0x18(%rsi), %rax
movq %rax, (%r9)
movl 0x8(%rsi), %eax
testb $0x1, %al
jne 0x1a5f17
testq %rdx, %rdx
je 0x1a5f0b
movslq 0xc(%rsi), %rax
movslq (%rsi), %rdi
addq %rax, %rdi
movq %rdi, (%rdx)
testq %rcx, %rcx
je 0x1a5f63
movl (%rsi), %edx
addl 0x10(%rsi), %edx
jmp 0x1a5f5d
testq %rdx, %rdx
je 0x1a5f41
movq 0x18(%rdi), %r8
movq 0x20(%r8), %r8
movl %eax, %r9d
shrl %r9d
movl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
andl (%r8,%r9,8), %r10d
addl (%rsi), %r10d
subl 0x10(%rsi), %r10d
movslq %r10d, %r8
movq %r8, (%rdx)
testq %rcx, %rcx
je 0x1a5f63
movq 0x18(%rdi), %rdx
movq 0x20(%rdx), %rdi
shrl %eax
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl (%rdi,%rax,8), %edx
addl (%rsi), %edx
subl 0xc(%rsi), %edx
movslq %edx, %rax
movq %rax, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: l2g_chain(ul_idx_t const*, kv_ul_ov_t*, vec_mg_lchain_t*)
void l2g_chain(const ul_idx_t *uref, kv_ul_ov_t *lidx, vec_mg_lchain_t *res)
{
	uint64_t k; 
	res->n = 0; kv_resize(mg_lchain_t, *res, lidx->n); res->n = lidx->n;
	for (k = 0; k < lidx->n; k++) {
		memset(&(res->a[k]), 0, sizeof(res->a[k]));
		res->a[k].v = (lidx->a[k].tn<<1)|(lidx->a[k].rev);
		res->a[k].off = lidx->a[k].qn; res->a[k].score = lidx->a[k].sec;
		res->a[k].qs = lidx->a[k].qs; res->a[k].qe = lidx->a[k].qe;
		res->a[k].rs = lidx->a[k].ts; res->a[k].re = lidx->a[k].te; 
		if(lidx->a[k].el) {
			res->a[k].score = retrieve_u_cov_region(uref, lidx->a[k].tn, 0, lidx->a[k].ts, lidx->a[k].te, NULL);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, (%rsp)
movq $0x0, 0x8(%rdx)
movq 0x8(%rsi), %rax
cmpq %rax, 0x10(%rdx)
jae 0x1a5fde
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 0x8(%r14), %rax
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x1a60ae
movl $0x18, %r12d
xorl %r13d, %r13d
xorps %xmm0, %xmm0
movl $0x3fffffff, %ebp       # imm = 0x3FFFFFFF
xorl %r15d, %r15d
movq (%rbx), %rax
movups %xmm0, 0x10(%rax,%r13)
movups %xmm0, (%rax,%r13)
movq $0x0, 0x20(%rax,%r13)
movq (%r14), %rax
movl -0xc(%rax,%r12), %esi
movl (%rax,%r12), %ecx
shrdl $0x1f, %esi, %ecx
movq (%rbx), %rdx
movl %ecx, 0x8(%rdx,%r13)
movl -0x18(%rax,%r12), %ecx
movl %ecx, (%rdx,%r13)
movl (%rax,%r12), %ecx
andl %ebp, %ecx
movl %ecx, 0x1c(%rdx,%r13)
movl -0x14(%rax,%r12), %ecx
movl %ecx, 0x14(%rdx,%r13)
movl -0x10(%rax,%r12), %ecx
movl %ecx, 0x18(%rdx,%r13)
movl -0x8(%rax,%r12), %ecx
movl %ecx, 0xc(%rdx,%r13)
movl -0x4(%rax,%r12), %ecx
movl %ecx, 0x10(%rdx,%r13)
testb $0x40, 0x3(%rax,%r12)
je 0x1a6099
movl -0x8(%rax,%r12), %ecx
movl -0x4(%rax,%r12), %r8d
movq (%rsp), %rdi
xorl %edx, %edx
xorl %r9d, %r9d
callq 0x36ec9
xorps %xmm0, %xmm0
movq (%rbx), %rcx
movl %eax, 0x1c(%rcx,%r13)
incq %r15
addq $0x28, %r13
addq $0x1c, %r12
cmpq 0x8(%r14), %r15
jb 0x1a6003
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: check_elen_gchain(ul_ov_t*, long, float)
int64_t check_elen_gchain(ul_ov_t *a, int64_t a_n, float trans_thres)
{
	uint32_t sp_e, ep_e, ts, te, tl = 0, el = 0, iel = 0; 
	sp_e = ep_e = ts = te = (uint32_t)-1;
	int64_t k;
	for (k = a_n-1; k >= 0; k--) {
		if(ts == (uint32_t)-1 || a[k].qe <= ts) {
			if(ts != (uint32_t)-1) tl += te - ts;
            ts = a[k].qs; te = a[k].qe;
		} else {
			ts = MIN(ts, a[k].qs);
		}
		if(!(a[k].el)) continue;

		if(sp_e == (uint32_t)-1 || a[k].qe <= sp_e) {
			if(sp_e != (uint32_t)-1) el += ep_e - sp_e;
            sp_e = a[k].qs;
            ep_e = a[k].qe;
		} else {
			sp_e = MIN(sp_e, a[k].qs);
		}
	}
	if(ts != (uint32_t)-1) tl += te - ts;
	if(sp_e != (uint32_t)-1) el += ep_e - sp_e;

	iel = tl - el;
	// fprintf(stderr, "[M::%s] el:%u, iel:%u\n", __func__, el, iel);
	if((iel == 0) || (iel <= (tl*trans_thres))) return 1;
	return 0;
}

// Assembly:
pushq %rbx
xorl %eax, %eax
testq %rsi, %rsi
jle 0x1a6635
leaq 0x1(%rsi), %r9
leaq (%rsi,%rsi,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rsi, %rcx
leaq (%rdi,%rcx), %r10
addq $-0x18, %r10
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %edx, %edx
xorl %edi, %edi
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
cmpl $-0x1, %r11d
je 0x1a65f4
cmpl %r11d, 0x4(%r10)
jbe 0x1a65ef
movl (%r10), %ebx
cmpl %ebx, %r11d
cmovael %ebx, %r11d
jmp 0x1a65fb
subl %r11d, %ecx
addl %ecx, %edi
movl (%r10), %r11d
movl 0x4(%r10), %ecx
testb $0x40, 0x17(%r10)
je 0x1a6626
cmpl $-0x1, %r8d
je 0x1a661f
cmpl %r8d, 0x4(%r10)
jbe 0x1a661a
movl (%r10), %ebx
cmpl %ebx, %r8d
cmovael %ebx, %r8d
jmp 0x1a6626
subl %r8d, %esi
addl %esi, %edx
movl (%r10), %r8d
movl 0x4(%r10), %esi
decq %r9
addq $-0x1c, %r10
cmpq $0x1, %r9
jg 0x1a65d7
jmp 0x1a664f
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %edi, %edi
xorl %edx, %edx
subl %r11d, %ecx
cmpl $-0x1, %r11d
cmovel %eax, %ecx
addl %edi, %ecx
subl %r8d, %esi
cmpl $-0x1, %r8d
cmovel %eax, %esi
addl %edx, %esi
movl $0x1, %eax
movl %ecx, %edx
subl %esi, %edx
je 0x1a6689
cvtsi2ss %rdx, %xmm1
movl %ecx, %ecx
cvtsi2ss %rcx, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
jae 0x1a6689
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1a6a9b
movq %rsi, %rdx
movq %rdi, %rbx
movq $0x0, 0x8(%rsi)
jle 0x1a6a9f
xorl %r12d, %r12d
xorl %r13d, %r13d
movq (%rbx), %rax
leaq (%r12,%r12,4), %rcx
cmpl $-0x1, 0x8(%rax,%rcx,8)
jne 0x1a6abd
leaq (%rax,%rcx,8), %rdi
movl 0x4(%rdi), %ebp
leal (,%rbp,2), %r14d
sarl %r14d
leal 0x1(%r14), %eax
cltq
movq %rax, 0x8(%rsp)
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 0x1a668b
testq %rax, %rax
je 0x1a6a24
cmpq %r12, %r13
movq %r15, %rdx
jne 0x1a6a29
movq 0x8(%rsp), %rax
addq %rax, %r13
jmp 0x1a6a8b
movq %r15, %rdx
jmp 0x1a6a86
testl %r14d, %r14d
js 0x1a6a86
shlq $0x21, %rbp
sarq $0x21, %rbp
notq %rbp
leaq (,%r12,8), %rax
leaq (%rax,%rax,4), %rax
leaq (,%r13,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 0x1a6a54
subq %r8, %r13
movq 0x8(%rsp), %rax
addq %rax, %r12
cmpq 0x18(%rsp), %r12
jl 0x1a69a3
jmp 0x1a6aa2
xorl %eax, %eax
jmp 0x1a6aae
xorl %r13d, %r13d
movq %r13, 0x8(%rbx)
xorl %eax, %eax
testq %r13, %r13
setne %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8dde3(%rip), %rdi     # 0x2348a7
leaq 0x8cec0(%rip), %rsi     # 0x23398b
leaq 0x8ddeb(%rip), %rcx     # 0x2348bd
movl $0x124a, %edx           # imm = 0x124A
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1a6ec7
movq 0x18(%rdi), %rax
movq %rax, %r8
shrq $0x20, %r8
cmpq %rcx, %r8
jle 0x1a6ec7
xorl %eax, %eax
movl 0x4(%rdi,%rax,8), %r8d
cmpq %rcx, %r8
jg 0x1a6e40
movl 0xc(%rdi,%rax,8), %r8d
cmpq %rcx, %r8
jg 0x1a6e4e
incq %rax
cmpq $0x3, %rax
jne 0x1a6e2c
movl $0x3, %eax
cmpq $0x3, %rax
jb 0x1a6e78
xorl %eax, %eax
movl 0x4(%rdi,%rax,8), %r8d
cmpq %rcx, %r8
jg 0x1a6e6a
movl 0xc(%rdi,%rax,8), %r8d
cmpq %rcx, %r8
jge 0x1a6e78
incq %rax
cmpq $0x3, %rax
jne 0x1a6e56
movl $0x3, %eax
cmpq $0x3, %rax
jae 0x1a6ed6
movl (%rdi,%rax,8), %r8d
movl 0x8(%rdi,%rax,8), %r9d
movq (%rdx,%r9,8), %rdi
movq (%rdx,%r8,8), %rax
subq %rax, %rdi
js 0x1a6ece
movl (%rsi,%r9,8), %edx
movl (%rsi,%r8,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
movl %eax, %eax
movq (%rdx,%rax,8), %rax
retq
movq $-0x1, %rax
retq
pushq %rax
leaq 0x8dbff(%rip), %rdi     # 0x234add
leaq 0x8caa6(%rip), %rsi     # 0x23398b
leaq 0x8dbf7(%rip), %rcx     # 0x234ae3
movl $0x12a3, %edx           # imm = 0x12A3
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1a6f3b
cmpq %rdx, %rax
jl 0x1a6f3b
cmpq %rdi, %rsi
jl 0x1a6f3b
cmpq %rsi, %r8
jg 0x1a6f3b
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