LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: get_lchain_ovlp(mg_lchain_t*, mg_lchain_t*, asg_t const*, long, ma_ug_t const*)
int64_t get_lchain_ovlp(mg_lchain_t *lp, mg_lchain_t *la, const asg_t *g, const int64_t qlen, const ma_ug_t *ug)
{
	int64_t o = lp->qe - la->qs, oj;
	uint32_t v = la->v^1, w = lp->v^1, i;
	int32_t pqe, aqs;
	if(o <= 0) return 0;
	if(v == w) return o;
	transfor_coord(lp, qlen, ug->u.a[lp->v>>1].len, NULL, &pqe, NULL, NULL);
	transfor_coord(la, qlen, ug->u.a[la->v>>1].len, &aqs, NULL, NULL, NULL);
	uint32_t nv = asg_arc_n(g, v);
    asg_arc_t *av = asg_arc_a(g, v), *p = NULL;
	for (i = 0; i < nv; i++) {
		if(av[i].del) continue;
		if(av[i].v == w) {
			// o -= av[i].ol;
			p = &(av[i]);
			break;
		}
	}
	oj = o;
	if(p) oj = pqe - aqs - p->ol;
	if(o > oj) o = oj;
	if(o < 0) o = 0;
	return o;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movslq 0x18(%rdi), %rbx
movslq 0x14(%rsi), %rax
subq %rax, %rbx
testl %ebx, %ebx
jle 0x1a4a98
movq %rsi, %r12
movl 0x8(%rsi), %ebp
movl 0x8(%rdi), %r13d
cmpl %r13d, %ebp
je 0x1a4ab9
movq %rcx, %r15
movq %rbp, %r14
xorq $0x1, %r14
movq 0x10(%r8), %rcx
movq %rcx, 0x18(%rsp)
movl %r13d, %eax
shrl %eax
leaq (%rax,%rax,4), %rax
movq %rdx, 0x20(%rsp)
movl (%rcx,%rax,8), %edx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andq %rax, %rdx
xorl %eax, %eax
movq %rax, (%rsp)
leaq 0x14(%rsp), %r8
movq %r15, %rsi
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x1a4876
shrl %ebp
leaq (,%rbp,4), %rax
addq %rbp, %rax
movq 0x18(%rsp), %rcx
movl (%rcx,%rax,8), %edx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andq %rax, %rdx
xorl %eax, %eax
movq %rax, (%rsp)
leaq 0x10(%rsp), %rcx
movq %r12, %rdi
movq %r15, %rsi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1a4876
movq 0x20(%rsp), %rdx
movq 0x28(%rdx), %rax
movq (%rax,%r14,8), %rax
movq %rbx, %rcx
testl %eax, %eax
je 0x1a4aa9
movq 0x8(%rdx), %rcx
movq %rax, %rdx
shrq $0x20, %rdx
movl %eax, %esi
leaq (%rdx,%rdx,2), %rax
leaq (%rcx,%rax,8), %rax
addq $0xc, %rax
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rcx
xorl %edx, %edx
movl (%rax,%rdx), %esi
testl %esi, %esi
js 0x1a4a8a
movl -0x4(%rax,%rdx), %edi
xorl %r13d, %edi
cmpl $0x1, %edi
je 0x1a4a9c
addq $0x18, %rdx
cmpq %rdx, %rcx
jne 0x1a4a77
movq %rbx, %rcx
jmp 0x1a4aa9
xorl %ebx, %ebx
jmp 0x1a4ab9
movl 0x14(%rsp), %eax
addl 0x10(%rsp), %esi
subl %esi, %eax
movslq %eax, %rcx
cmpq %rbx, %rcx
cmovlq %rcx, %rbx
xorl %eax, %eax
testq %rbx, %rbx
cmovleq %rax, %rbx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: get_lchain_gap(mg_lchain_t*, mg_lchain_t*, asg_t const*, long, ma_ug_t const*, int)
int64_t get_lchain_gap(mg_lchain_t *lp, mg_lchain_t *la, const asg_t *g, const int64_t qlen, const ma_ug_t *ug, int32_t double_ol)
{
	int64_t gg = la->qs - lp->qe, ggj;
	uint32_t v = la->v^1, w = lp->v^1, i;
	int32_t aqs, pqe;
	if(double_ol == 0 && gg >= 0) return gg;
	if(v == w) return gg;
	transfor_coord(la, qlen, ug->u.a[la->v>>1].len, &aqs, NULL, NULL, NULL);
	transfor_coord(lp, qlen, ug->u.a[lp->v>>1].len, NULL, &pqe, NULL, NULL);
	uint32_t nv = asg_arc_n(g, v);
    asg_arc_t *av = asg_arc_a(g, v), *p = NULL;;
	for (i = 0; i < nv; i++) {
		if(av[i].del) continue;
		if(av[i].v == w) {
			// gg += av[i].ol;
			p = &(av[i]);
			break;
		}
	}
	ggj = gg;
	if(p) ggj = aqs - pqe + p->ol + (double_ol?p->ol:0);
	// if(gg < ggj) gg = ggj;
	// return gg;
	return ggj;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r15
movq %rdx, %r10
movq %rdi, %r12
movl 0x8(%rsi), %eax
movl 0x14(%rsi), %ebp
subl 0x18(%rdi), %ebp
movl 0x8(%rdi), %ecx
testl %r9d, %r9d
sete %dl
testl %ebp, %ebp
setns %dil
andb %dl, %dil
cmpl %ecx, %eax
sete %dl
orb %dil, %dl
jne 0x1a4bea
movl %r9d, 0x14(%rsp)
movl %eax, %eax
movl %ecx, %r13d
movl %eax, %ebx
xorl $0x1, %ebx
movq 0x10(%r8), %r14
shrl %eax
leaq (%rax,%rax,4), %rax
movl (%r14,%rax,8), %edx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andq %rax, %rdx
xorl %eax, %eax
movq %rax, (%rsp)
leaq 0x1c(%rsp), %rcx
movq %rsi, %rdi
movq %r15, %rsi
xorl %r8d, %r8d
xorl %r9d, %r9d
movq %r10, 0x20(%rsp)
callq 0x1a4876
movl %r13d, %eax
shrl %eax
leaq (%rax,%rax,4), %rax
movl (%r14,%rax,8), %edx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andq %rax, %rdx
xorl %eax, %eax
movq %rax, (%rsp)
leaq 0x18(%rsp), %r8
movq %r12, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x1a4876
movq 0x20(%rsp), %rcx
movq 0x28(%rcx), %rax
movq (%rax,%rbx,8), %rax
testl %eax, %eax
je 0x1a4bea
movq 0x8(%rcx), %rcx
movq %rax, %rdx
shrq $0x20, %rdx
movl %eax, %esi
leaq (%rdx,%rdx,2), %rax
leaq (%rcx,%rax,8), %rax
addq $0xc, %rax
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rcx
xorl %esi, %esi
movl (%rax,%rsi), %edx
testl %edx, %edx
js 0x1a4bc8
movl -0x4(%rax,%rsi), %edi
xorl %r13d, %edi
cmpl $0x1, %edi
je 0x1a4bd3
addq $0x18, %rsi
cmpq %rsi, %rcx
jne 0x1a4bb5
jmp 0x1a4bea
movl 0x1c(%rsp), %eax
subl 0x18(%rsp), %eax
addl %edx, %eax
movl 0x14(%rsp), %ecx
testl %ecx, %ecx
cmovel %ecx, %edx
addl %eax, %edx
movl %edx, %ebp
movslq %ebp, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: max_ovlp_src(ug_opt_t const*, unsigned int)
int64_t max_ovlp_src(const ug_opt_t *uopt, uint32_t v)
{
	ma_hit_t_alloc* src = uopt->sources;
    int64_t min_ovlp = uopt->min_ovlp, max_hang = uopt->max_hang;
	uint32_t i, qn, tn, o = 0, x = v>>1; asg_arc_t e;

	for (i = 0; i < src[x].length; i++) {
        qn = Get_qn(src[x].buffer[i]); tn = Get_tn(src[x].buffer[i]);
        if(ma_hit2arc(&(src[x].buffer[i]), Get_READ_LENGTH(R_INF, qn), Get_READ_LENGTH(R_INF, tn), 
														max_hang, asm_opt.max_hang_rate, min_ovlp, &e) < 0) {
			continue;
		}
		if((e.ul>>32) != v) continue;
		if(o < e.ol) o = e.ol;
    }

	return o;
}

// Assembly:
movq 0x8(%rdi), %rcx
movl %esi, %eax
shrl %eax
leaq (%rax,%rax,2), %r8
movl 0xc(%rcx,%r8,8), %r9d
xorl %eax, %eax
testq %r9, %r9
je 0x1a4e14
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq $0x0, -0x18(%rsp)
movl 0x44(%rdi), %eax
movl 0x40(%rdi), %edx
leaq (%rcx,%r8,8), %rcx
movq (%rcx), %rdi
leaq 0xf159d(%rip), %rcx     # 0x296230
movq 0x18(%rcx), %r8
leaq 0xf0aba(%rip), %rcx     # 0x295758
movss 0x158(%rcx), %xmm0
movl %eax, %ecx
movl %esi, %eax
movq %rax, -0x10(%rsp)
shlq $0x3, %r9
leaq (%r9,%r9,4), %rax
movq %rax, -0x8(%rsp)
xorl %r10d, %r10d
movl %edx, -0x1c(%rsp)
movl 0xc(%rdi,%r10), %eax
movl (%r8,%rax,8), %r11d
testb $-0x80, 0x1b(%rdi,%r10)
jne 0x1a4ce9
movl 0x10(%rdi,%r10), %r13d
movl 0x14(%rdi,%r10), %r12d
subl %r12d, %r11d
movl %r11d, %ebp
movl %r13d, %r11d
jmp 0x1a4cf9
movl 0x10(%rdi,%r10), %r13d
movl 0x14(%rdi,%r10), %r12d
subl %r12d, %r11d
movl %r13d, %ebp
movq (%rdi,%r10), %r14
movq %r14, %rax
shrq $0x20, %rax
movl (%r8,%rax,8), %r9d
cmpl %r14d, %r11d
movl %r14d, %eax
cmovll %r11d, %eax
movl 0x8(%rdi,%r10), %r15d
movl %r9d, %ebx
subl %r15d, %ebx
cmpl %ebp, %ebx
movl %ebp, %esi
cmovll %ebx, %esi
cmpl %edx, %eax
jg 0x1a4d78
cmpl %edx, %esi
jg 0x1a4d78
movl %ecx, %edx
movl %r15d, %ecx
subl %r14d, %ecx
xorps %xmm1, %xmm1
cvtsi2ss %rcx, %xmm1
addl %eax, %ecx
addl %esi, %ecx
xorps %xmm2, %xmm2
cvtsi2ss %rcx, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
ja 0x1a4d72
subl %r13d, %r12d
xorps %xmm1, %xmm1
cvtsi2ss %r12, %xmm1
addl %eax, %esi
addl %r12d, %esi
xorps %xmm2, %xmm2
cvtsi2ss %rsi, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
jbe 0x1a4d89
movl %edx, %ecx
movl -0x1c(%rsp), %edx
addq $0x28, %r10
cmpq %r10, -0x8(%rsp)
jne 0x1a4cc3
jmp 0x1a4e03
cmpl %ebp, %ebx
setl %al
setg %r12b
cmpl %r11d, %r14d
setg %r13b
setl %bl
orb %r12b, %r13b
cmpb $0x1, %r13b
jne 0x1a4d72
orb %al, %bl
je 0x1a4d72
cmpl %edx, %ecx
movl %edx, %ecx
jl 0x1a4d74
cmpl %ecx, %esi
jl 0x1a4d74
addl %r15d, %ebp
movl %r9d, %ebx
subl %ebp, %ebx
xorl %ecx, %ecx
movl %r14d, %eax
subl %r11d, %eax
setle %sil
cmovlel %ebx, %eax
testl %eax, %eax
js 0x1a4d72
movb %sil, %cl
shrq $0x1f, %r14
andl $-0x2, %r14d
orq %rcx, %r14
cmpl -0x10(%rsp), %r14d
jne 0x1a4d72
subl %eax, %r9d
andl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
movq -0x18(%rsp), %rax
cmpl %r9d, %eax
cmovbel %r9d, %eax
movq %rax, -0x18(%rsp)
jmp 0x1a4d72
movq -0x18(%rsp), %rax
movl %eax, %eax
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: compress_lchain(mg_lchain_t*, int, int, ma_ug_t const*, mg128_t const*)
void compress_lchain(mg_lchain_t *lc, int32_t n_lc, int32_t qlen, const ma_ug_t *ug, const mg128_t *a)
{
	int32_t i, k, q_span;
	mg_lchain_t *ri = NULL;
	for (i = 0; i < n_lc; ++i) {
		ri = &lc[i];
		k = ri->off;
		ri->rs = (int32_t)a[k].x + 1 > q_span? (int32_t)a[k].x + 1 - q_span : 0; // for HPC k-mer
        ri->qs = (int32_t)a[k].y + 1 - (a[k].y>>32 & 0xff);
        ri->re = (int32_t)a[k + ri->cnt - 1].x + 1;
        ri->qe = (int32_t)a[k + ri->cnt - 1].y + 1;
	}
}

// Assembly:
testl %esi, %esi
jle 0x1a50f5
movl %esi, %eax
shlq $0x3, %rax
leaq (%rax,%rax,4), %rax
xorl %ecx, %ecx
movslq (%rdi,%rcx), %rdx
movl $0x0, 0xc(%rdi,%rcx)
movq %rdx, %rsi
shlq $0x4, %rsi
movq 0x8(%r8,%rsi), %rsi
movq %rsi, %r9
shrq $0x20, %r9
movzbl %r9b, %r9d
subl %r9d, %esi
incl %esi
movl %esi, 0x14(%rdi,%rcx)
movl 0x4(%rdi,%rcx), %esi
shlq $0x21, %rsi
sarq $0x21, %rsi
addq %rdx, %rsi
shlq $0x4, %rsi
movl -0x10(%r8,%rsi), %edx
incl %edx
movl %edx, 0x10(%rdi,%rcx)
movl -0x8(%r8,%rsi), %edx
incl %edx
movl %edx, 0x18(%rdi,%rcx)
addq $0x28, %rcx
cmpq %rcx, %rax
jne 0x1a5097
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: print_gchain(gc_frag_t*, long const*, mg_lchain_t*, long, ma_ug_t const*, int)
void print_gchain(gc_frag_t *a, const int64_t *p, mg_lchain_t *lc, const int64_t nlc, const ma_ug_t *ug, int32_t qlen)
{
	int64_t k, i;
	gc_frag_t *ai = NULL;
    mg_lchain_t *li = NULL;
	for (k = 0; k < nlc; k++) {
		fprintf(stderr, "\n");
		for (i = k; i >= 0; i = p[i]) {
			ai = &a[i]; li = &lc[ai->i];
			fprintf(stderr, "*\tXXXXXX\tutg%.6d%c\t%c\tqs:%u\tqe:%u\tql:%d\tts:%u\tte:%u\ttl:%u\n", 
					(li->v>>1)+1, "lc"[ug->u.a[li->v>>1].circ], "+-"[li->v&1], li->qs, li->qe, qlen, li->rs, li->re, ug->u.a[li->v>>1].len);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, 0x8(%rsp)
testq %rcx, %rcx
jle 0x1a520c
movl %r9d, %r13d
movq %r8, %r14
movq %rdx, %r12
movq %rdi, %rbp
movq 0xefebb(%rip), %rax     # 0x294fe0
xorl %r15d, %r15d
movq %rsi, 0x18(%rsp)
movq (%rax), %rsi
movl $0xa, %edi
callq 0x2270
movq %r15, 0x10(%rsp)
movslq 0x4(%rbp,%r15,8), %rax
leaq (%rax,%rax,4), %rax
movq 0xefe91(%rip), %rcx     # 0x294fe0
movq (%rcx), %rdi
movl 0x8(%r12,%rax,8), %esi
movl 0xc(%r12,%rax,8), %ecx
movq %rcx, 0x20(%rsp)
movl %esi, %ecx
shrl %ecx
leaq (%rcx,%rcx,4), %r8
movl %ecx, %edx
incl %edx
movq 0x10(%r14), %rcx
movl (%rcx,%r8,8), %r11d
movl %r11d, %ecx
shrl $0x1f, %ecx
leaq 0x8f5b9(%rip), %r8      # 0x23473b
movsbl (%rcx,%r8), %ecx
andl $0x1, %esi
leaq 0x8d142(%rip), %r8      # 0x2322d3
movsbl (%rsi,%r8), %r8d
movl 0x14(%r12,%rax,8), %r9d
movq %r14, %rbx
movl 0x18(%r12,%rax,8), %r14d
movq %rbp, %r10
movq %r13, %rbp
movl 0x10(%r12,%rax,8), %r13d
andl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
subq $0x8, %rsp
leaq 0x9ac76(%rip), %rsi     # 0x23fe36
xorl %eax, %eax
pushq %r11
pushq %r13
movq %rbp, %r13
movq %r10, %rbp
pushq 0x38(%rsp)
pushq %r13
pushq %r14
movq %rbx, %r14
movq 0x48(%rsp), %rbx
callq 0x22b0
addq $0x30, %rsp
movq (%rbx,%r15,8), %r15
testq %r15, %r15
jns 0x1a513f
movq 0x10(%rsp), %r15
incq %r15
cmpq 0x8(%rsp), %r15
movq 0xefdda(%rip), %rax     # 0x294fe0
jne 0x1a512d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: mg_gchain_restore_order(void*, mg_gchains_t*)
void mg_gchain_restore_order(void *km, mg_gchains_t *gcs)
{
	int32_t i, n_a, n_lc;
	mg_llchain_t *lc;
	mg128_t *a;
	KMALLOC(km, lc, gcs->n_lc);
	KMALLOC(km, a, gcs->n_a);
	n_a = n_lc = 0;
	for (i = 0; i < gcs->n_gc; ++i) {
		mg_gchain_t *gc = &gcs->gc[i];
		assert(gc->cnt > 0);
		memcpy(&lc[n_lc], &gcs->lc[gc->off], gc->cnt * sizeof(mg_llchain_t));
		memcpy(&a[n_a], &gcs->a[gcs->lc[gc->off].off], gc->n_anchor * sizeof(mg128_t));
		n_lc += gc->cnt, n_a += gc->n_anchor;
	}
	memcpy(gcs->lc, lc, gcs->n_lc * sizeof(mg_llchain_t));
	memcpy(gcs->a, a, gcs->n_a * sizeof(mg128_t));
	kfree(km, lc); kfree(km, a);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movslq 0xc(%rsi), %rsi
shlq $0x4, %rsi
callq 0x1ee115
movq %rax, 0x8(%rsp)
movslq 0x10(%r15), %rsi
shlq $0x4, %rsi
movq %rbx, 0x10(%rsp)
movq %rbx, %rdi
callq 0x1ee115
movq %rax, (%rsp)
cmpl $0x0, 0x8(%r15)
jle 0x1a64e1
xorl %r13d, %r13d
movl $0x10, %ebp
xorl %ebx, %ebx
xorl %r14d, %r14d
movq 0x18(%r15), %r12
movslq -0x4(%r12,%rbp), %rdx
testq %rdx, %rdx
jle 0x1a653b
movslq %r14d, %r14
movq %r14, %rdi
shlq $0x4, %rdi
addq 0x8(%rsp), %rdi
movslq -0x8(%r12,%rbp), %rsi
shlq $0x4, %rsi
addq 0x20(%r15), %rsi
shlq $0x4, %rdx
callq 0x2160
movslq %ebx, %rbx
movq %rbx, %rdi
shlq $0x4, %rdi
addq (%rsp), %rdi
movq 0x20(%r15), %rax
movslq -0x8(%r12,%rbp), %rcx
shlq $0x4, %rcx
movslq (%rax,%rcx), %rsi
shlq $0x4, %rsi
addq 0x28(%r15), %rsi
movslq (%r12,%rbp), %rdx
shlq $0x4, %rdx
callq 0x2160
addl -0x4(%r12,%rbp), %r14d
addl (%r12,%rbp), %ebx
incq %r13
movslq 0x8(%r15), %rax
addq $0x48, %rbp
cmpq %rax, %r13
jl 0x1a6459
movq 0x20(%r15), %rdi
movslq 0xc(%r15), %rdx
shlq $0x4, %rdx
movq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x2160
movq 0x28(%r15), %rdi
movslq 0x10(%r15), %rdx
shlq $0x4, %rdx
movq (%rsp), %r15
movq %r15, %rsi
callq 0x2160
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1ee04f
movq %rbx, %rdi
movq %r15, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1ee04f
leaq 0x99ab7(%rip), %rdi     # 0x23fff9
leaq 0x99712(%rip), %rsi     # 0x23fc5b
leaq 0x99ab5(%rip), %rcx     # 0x240005
movl $0x782, %edx            # imm = 0x782
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: mg_gchain_sort_by_score(void*, mg_gchains_t*)
void mg_gchain_sort_by_score(void *km, mg_gchains_t *gcs)
{
	mg128_t *z;
	mg_gchain_t *gc;
	int32_t i;
	KMALLOC(km, z, gcs->n_gc);
	KMALLOC(km, gc, gcs->n_gc);
	for (i = 0; i < gcs->n_gc; ++i)
		z[i].x = (uint64_t)gcs->gc[i].score << 32 | gcs->gc[i].hash, z[i].y = i;
	radix_sort_128x(z, z + gcs->n_gc);
	for (i = gcs->n_gc - 1; i >= 0; --i)
		gc[gcs->n_gc - 1 - i] = gcs->gc[z[i].y];
	memcpy(gcs->gc, gc, gcs->n_gc * sizeof(mg_gchain_t));
	kfree(km, z); kfree(km, gc);
	mg_gchain_restore_order(km, gcs); // this put gcs in the proper order
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x8(%rsi), %rsi
shlq $0x4, %rsi
callq 0x1ee115
movq %rax, %r15
movslq 0x8(%rbx), %rax
shlq $0x3, %rax
leaq (%rax,%rax,8), %rsi
movq %r14, %rdi
callq 0x1ee115
movq %rax, %r12
movslq 0x8(%rbx), %rsi
testq %rsi, %rsi
jle 0x1a65ca
movq 0x18(%rbx), %rax
leaq 0x8(%r15), %rcx
addq $0x14, %rax
xorl %edx, %edx
movl (%rax), %edi
movl 0x24(%rax), %r8d
shlq $0x20, %rdi
orq %rdi, %r8
movq %r8, -0x8(%rcx)
movq %rdx, (%rcx)
incq %rdx
addq $0x10, %rcx
addq $0x48, %rax
cmpq %rdx, %rsi
jne 0x1a65a6
shlq $0x4, %rsi
addq %r15, %rsi
movq %r15, %rdi
callq 0x19febb
movslq 0x8(%rbx), %rcx
testq %rcx, %rcx
jle 0x1a662e
leaq 0x1(%rcx), %rax
movl %ecx, %edx
negl %edx
shlq $0x4, %rcx
leaq (%rcx,%r15), %r8
addq $-0x8, %r8
movq (%r8), %rcx
leaq (%rcx,%rcx,8), %rsi
shlq $0x3, %rsi
movl 0x8(%rbx), %ecx
addq 0x18(%rbx), %rsi
addl %edx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,8), %rcx
leaq (%r12,%rcx,8), %rdi
movl $0x12, %ecx
rep  movsl (%rsi), %es:(%rdi)
decq %rax
incl %edx
addq $-0x10, %r8
cmpq $0x1, %rax
ja 0x1a65f6
movl 0x8(%rbx), %ecx
movq 0x18(%rbx), %rdi
movslq %ecx, %rax
shlq $0x3, %rax
leaq (%rax,%rax,8), %rdx
movq %r12, %rsi
callq 0x2160
movq %r14, %rdi
movq %r15, %rsi
callq 0x1ee04f
movq %r14, %rdi
movq %r12, %rsi
callq 0x1ee04f
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1a6402
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1a73d9
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 0x1a7345
andb $-0x2, 0x1(%r8)
jmp 0x1a73c3
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 0x1a73b4
leaq (%rcx,%r11,8), %r11
movl -0x2c(%r8), %ebx
cmpl 0x18(%r11), %ebx
jne 0x1a73bb
movl -0x28(%r8), %ebx
cmpl 0x1c(%r11), %ebx
jne 0x1a73bb
movl -0x20(%r8), %ebx
cmpl 0x24(%r11), %ebx
jne 0x1a73bb
movl -0x1c(%r8), %ebx
cmpl 0x28(%r11), %ebx
jne 0x1a73bb
orb $0x1, 0x1(%r8)
jmp 0x1a73c5
andb $-0x2, 0x1(%r8)
incl %r10d
incl %eax
incq %r9
addq $0x48, %r8
cmpq %r9, %rdx
jne 0x1a7335
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1a745f
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 0x1a744f
leaq (%rdx,%r10,8), %r10
movq 0x20(%rdi), %r11
movslq %r9d, %rbx
shlq $0x4, %rbx
addq %rbx, %r11
addq $0x4, %r11
movq %r8, %rbx
shlq $0x4, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movl %eax, -0x4(%r11,%r14)
movl (%r11,%r14), %r15d
addl %r15d, %eax
addl %r15d, %ebp
addq $0x10, %r14
cmpq %r14, %rbx
jne 0x1a7433
movl %ebp, 0x10(%r10)
addl %r9d, %r8d
incq %rsi
movl %r8d, %r9d
cmpq %rcx, %rsi
jne 0x1a73f5
jmp 0x1a7464
xorl %eax, %eax
xorl %r8d, %r8d
cmpl 0xc(%rdi), %r8d
jne 0x1a747a
cmpl 0x10(%rdi), %eax
jne 0x1a747a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x98ce3(%rip), %rdi     # 0x240164
leaq 0x987d3(%rip), %rsi     # 0x23fc5b
leaq 0x98cfa(%rip), %rcx     # 0x240189
movl $0x875, %edx            # imm = 0x875
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1a8424
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 0x1a83de
decl %edi
movl %edi, %eax
retq
cmpl %edx, 0x8(%rsi)
jae 0x1a8424
xorl %eax, %eax
testl %edi, %edi
jle 0x1a8420
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 0x1a8418
movl %r8d, %edi
jmp 0x1a841c
addl %ecx, %eax
incl %eax
cmpl %eax, %edi
jg 0x1a83e9
cmpl %edi, %eax
jne 0x1a8425
retq
pushq %rax
leaq 0x97ecf(%rip), %rdi     # 0x2402fc
leaq 0x97827(%rip), %rsi     # 0x23fc5b
leaq 0x97ec8(%rip), %rcx     # 0x240303
movl $0x9c5, %edx            # imm = 0x9C5
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1a84cf
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 0x1a84c4
movl -0x4(%r15,%r13), %ebp
xorl %r11d, %ebp
cmpl $0x1, %ebp
je 0x1a84d3
addq $0x18, %r13
cmpq %r13, %r12
jne 0x1a84b0
jmp 0x1a84fe
xorl %edx, %edx
jmp 0x1a84fe
leaq (%rbx,%r14,8), %rdx
movl (%r13,%rdx), %edx
testl %r10d, %r10d
js 0x1a84f6
movq 0x20(%rdi), %r10
shrl %r9d
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl (%r10,%r9,8), %edi
subl 0x14(%rsi), %edi
jmp 0x1a84f9
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_O3/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 0x1a8990
pushq %r14
pushq %rbx
movq (%rdi), %rdx
leaq 0xc(%rdx), %r8
movl $0x1, %r9d
xorl %eax, %eax
xorl %r10d, %r10d
cmpq %rcx, %r9
jne 0x1a8908
leaq (%r10,%r10,2), %r11
movl 0x4(%rdx,%r11,8), %r11d
jmp 0x1a891c
leaq (%r9,%r9,2), %rbx
leaq (%r10,%r10,2), %r11
movl 0x4(%rdx,%r11,8), %r11d
cmpl %r11d, 0x4(%rdx,%rbx,8)
je 0x1a8977
cmpl %esi, %r11d
sete %r11b
cmpq %r9, %r10
setb %bl
andb %r11b, %bl
cmpb $0x1, %bl
jne 0x1a8974
leaq (%r10,%r10,2), %r11
leaq (%r8,%r11,8), %r11
cmpb $0x1, (%r11)
jne 0x1a8968
movq 0x218(%rdi), %rbx
movl -0x4(%r11), %r14d
leaq (%r14,%r14,4), %r14
cmpl $0x1, 0x1c(%rbx,%r14,8)
jne 0x1a8968
leaq (%rbx,%r14,8), %rbx
cmpl $0x2, 0x8(%rbx)
jb 0x1a8968
cmpl $0x2, 0xc(%rbx)
sbbq $-0x1, %rax
incq %r10
addq $0x18, %r11
cmpq %r10, %r9
jne 0x1a8939
movq %r9, %r10
leaq 0x1(%r9), %r11
cmpq %rcx, %r9
movq %r11, %r9
jne 0x1a88f8
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
popq %rbx
popq %r14
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
testq %r9, %r9
je 0x1a92f5
testq %rdx, %rdx
js 0x1a932e
movl 0x4(%r8), %r9d
leaq (%rdx,%rdx,2), %rax
incq %rdx
leaq (%rdi,%rax,8), %r10
addq $0x10, %r10
xorl %eax, %eax
movl (%r10), %r11d
notq %r11
addq %rcx, %r11
cmpq %r9, %r11
jl 0x1a9333
movl 0x8(%r8), %ebx
cmpq %rbx, %r11
jae 0x1a9333
incq %rax
addq $-0x18, %r10
cmpq %rax, %rdx
jne 0x1a92cd
movq %rdx, %rax
jmp 0x1a9333
testq %rdx, %rdx
js 0x1a9372
movl 0x4(%r8), %ecx
leaq (%rdx,%rdx,2), %rax
incq %rdx
leaq (%rdi,%rax,8), %r9
addq $0x10, %r9
xorl %eax, %eax
movl (%r9), %r10d
cmpl %ecx, %r10d
jb 0x1a9377
cmpl 0x8(%r8), %r10d
jae 0x1a9377
incq %rax
addq $-0x18, %r9
cmpq %rax, %rdx
jne 0x1a930f
movq %rdx, %rax
jmp 0x1a9377
incq %rdx
xorl %eax, %eax
movq %rdx, %r9
subq %rsi, %r9
jge 0x1a93b3
movl 0x4(%r8), %esi
leaq (%rdx,%rdx,2), %rdx
leaq (%rdi,%rdx,8), %rdi
addq $0x10, %rdi
xorl %edx, %edx
movl (%rdi), %r10d
notq %r10
addq %rcx, %r10
cmpq %rsi, %r10
jl 0x1a93b0
movl 0x8(%r8), %r11d
cmpq %r11, %r10
jae 0x1a93b0
decq %rdx
addq $0x18, %rdi
cmpq %rdx, %r9
jne 0x1a934d
jmp 0x1a93ab
incq %rdx
xorl %eax, %eax
movq %rdx, %rcx
subq %rsi, %rcx
jge 0x1a93b3
movl 0x4(%r8), %esi
leaq (%rdx,%rdx,2), %rdx
leaq (%rdi,%rdx,8), %rdi
addq $0x10, %rdi
xorl %edx, %edx
movl (%rdi), %r9d
cmpl %esi, %r9d
jb 0x1a93b0
cmpl 0x8(%r8), %r9d
jae 0x1a93b0
decq %rdx
addq $0x18, %rdi
cmpq %rdx, %rcx
jne 0x1a9391
subq %rdx, %rax
jmp 0x1a93b8
subq %rdx, %rax
testq %rax, %rax
je 0x1a93ba
popq %rbx
retq
leaq 0x870da(%rip), %rdi     # 0x23049b
leaq 0x96893(%rip), %rsi     # 0x23fc5b
leaq 0x9710e(%rip), %rcx     # 0x2404dd
movl $0xb23, %edx            # imm = 0xB23
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x28, %rsp
movq %rdx, 0x20(%rsp)
movq %rdi, 0x8(%rsp)
testq %rsi, %rsi
je 0x1aa27c
movq %rsi, %r14
movq 0x8(%rsp), %rax
addq $0xc, %rax
movq %rax, 0x18(%rsp)
xorl %r13d, %r13d
leaq (,%r13,8), %rax
addq %r13, %rax
leaq (%rax,%rax,2), %r12
addq %r13, %r12
movq 0x8(%rsp), %rax
movl 0xc(%rax,%r12), %ebp
testl %ebp, %ebp
jns 0x1aa260
addq 0x8(%rsp), %r12
movl (%r12), %eax
movl %eax, 0x14(%rsp)
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movq 0x18(%rsp), %rbx
xorl %r15d, %r15d
cmpq %r15, %r13
je 0x1aa254
movl (%rbx), %edx
testl %edx, %edx
js 0x1aa254
movl 0x4(%r12), %eax
cmpl -0x8(%rbx), %eax
jb 0x1aa254
movl 0x8(%r12), %eax
cmpl -0x4(%rbx), %eax
ja 0x1aa254
movq 0x20(%rsp), %rdi
movl %ebp, %esi
movl $0x1, %ecx
callq 0x1a9fdf
testl %eax, %eax
jne 0x1aa26e
incq %r15
addq $0x1c, %rbx
cmpq %r15, %r14
jne 0x1aa220
incq %r13
cmpq %r14, %r13
jne 0x1aa1e5
jmp 0x1aa27c
cmpl $-0x1, 0x14(%rsp)
je 0x1aa260
callq 0x2933d
jmp 0x1aa260
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/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 0x1aa5ee
cmpl %ebp, %ebx
je 0x1aa5ee
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 0x6ea22
movq 0x8(%rsp), %rdi
movl %ebx, %esi
movl %ebp, %edx
movq %rax, %rcx
movsd 0x10(%rsp), %xmm0
xorl %r8d, %r8d
callq 0x1aa28b
testq %rax, %rax
je 0x1aa56b
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xeaa6e(%rip), %rax     # 0x294fe0
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 0x6ea22
movq %rax, %r10
subq $0x8, %rsp
leaq 0x95f76(%rip), %rsi     # 0x240537
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 0x1aa560
callq 0x29359
jmp 0x1aa522
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1ab999
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 0x1ab9aa
leaq 0xea890(%rip), %rax     # 0x296230
movq 0x18(%rax), %rax
movl 0xc(%rsi), %edi
movl (%rax,%rdi,8), %eax
movl %eax, (%r8)
cmpl $0x0, 0x18(%rsi)
js 0x1ab9bd
movl 0x10(%rsi), %eax
movl %eax, (%rdx)
movl 0x14(%rsi), %eax
jmp 0x1ab9c8
subl 0x14(%rsi), %eax
movl %eax, (%rdx)
movl (%r8), %eax
subl 0x10(%rsi), %eax
movl %eax, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
testq %rsi, %rsi
jle 0x1aced0
pushq %rbx
leaq 0x1(%rsi), %r8
leaq (%rsi,%rsi,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rsi, %rcx
addq %rcx, %rdi
addq $-0x18, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
xorl %edx, %edx
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
movl (%rdi), %r10d
movl 0x4(%rdi), %ebx
cmpl %esi, %r10d
cmovbl %r10d, %esi
cmpl %edx, %ebx
cmoval %ebx, %edx
testb $0x40, 0x17(%rdi)
jne 0x1ace8f
movl %r11d, %r10d
jmp 0x1aceac
cmpl $-0x1, %r11d
je 0x1acea9
cmpl %r11d, %ebx
jbe 0x1acea3
cmpl %r10d, %r11d
cmovbl %r11d, %r10d
jmp 0x1aceac
subl %r11d, %r9d
addl %r9d, %ecx
movl %ebx, %r9d
decq %r8
addq $-0x1c, %rdi
movl %r10d, %r11d
cmpq $0x1, %r8
ja 0x1ace72
subl %esi, %edx
subl %r10d, %r9d
xorl %esi, %esi
cmpl $-0x1, %r10d
cmovnel %r9d, %esi
addl %esi, %ecx
popq %rbx
jmp 0x1aced7
xorl %ecx, %ecx
movl $0x1, %edx
movl %edx, %esi
subl %ecx, %esi
je 0x1acef4
cvtsi2ss %rsi, %xmm1
movl %edx, %ecx
cvtsi2ss %rcx, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
jae 0x1acef4
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: dump_chain(kv_ul_ov_t*, ul_ov_t*, ul_ov_t*, void*)
void dump_chain(kv_ul_ov_t *des, ul_ov_t *src, ul_ov_t *chain, void *km)
{
	///note: dump results to <des> may change <chain>, so we should save <chain> in advance
	uint64_t beg = chain->ts, occ = chain->te - chain->ts;
	kv_resize_km(km, ul_ov_t, *des, occ); des->n = occ;
	memcpy(des->a, src + beg, occ*sizeof((*src)));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x10(%rdx), %r12d
movl 0x14(%rdx), %r15d
subl %r12d, %r15d
movq (%rdi), %rax
cmpq %r15, 0x10(%rdi)
jae 0x1ad233
leaq -0x1(%r15), %rdx
movq %rdx, %rsi
shrq %rsi
orq %rdx, %rsi
movq %rsi, %rdx
shrq $0x2, %rdx
orq %rsi, %rdx
movq %rdx, %rsi
shrq $0x4, %rsi
orq %rdx, %rsi
movq %rsi, %rdx
shrq $0x8, %rdx
orq %rsi, %rdx
movq %rdx, %rsi
shrq $0x10, %rsi
orq %rdx, %rsi
leaq 0x1(%rsi), %rdx
movq %rdx, 0x10(%r14)
leaq (%rdx,%rdx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rsi, %rdx
incq %rdx
movq %rcx, %rdi
movq %rax, %rsi
callq 0x1ee21d
movq %rax, (%r14)
movq %r15, 0x8(%r14)
leaq (%r12,%r12,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %r12, %rbx
addq %rcx, %rbx
leaq (%r15,%r15,8), %rcx
leaq (%rcx,%rcx,2), %rdx
addq %r15, %rdx
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2160
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x38, %rsp
movsd %xmm0, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
testq %r8, %r8
jle 0x1add88
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, %edx
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 0x1adcb9
movl %r14d, %r12d
jmp 0x1add6b
shldl $0x1, %eax, %r12d
testq %rbp, %rbp
je 0x1add68
movl 0x8(%r13), %eax
cmpl 0x4(%rbp), %eax
jbe 0x1add68
movl %edx, 0xc(%rsp)
andb $0x7f, 0xf(%rbp)
andb $0x7f, 0xf(%r13)
xorl %r15d, %r15d
movq %rbp, %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x6ea22
orb $-0x80, 0xf(%rbp)
orb $-0x80, 0xf(%r13)
testq %rax, %rax
je 0x1add8e
cmpl %r12d, %r14d
je 0x1add8e
xorl $0x1, %r14d
movl %r12d, %ecx
xorl $0x1, %ecx
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl %r14d, %edx
movq 0x20(%rsp), %r8
movsd 0x28(%rsp), %xmm0
movq %rax, %r9
leaq 0x30(%rsp), %rax
pushq %rax
pushq $0x1
callq 0x1ab640
addq $0x10, %rsp
testq %rax, %rax
movl 0xc(%rsp), %edx
je 0x1add8e
leal -0x1(%rbx), %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movl 0x18(%rbp), %ecx
movl $0xc0000000, %esi       # imm = 0xC0000000
andl %esi, %ecx
orl %eax, %ecx
movl %ecx, 0x18(%rbp)
incl %edx
movq %r13, %rbp
decq %rbx
leaq 0x1(%rbx), %rax
addq $-0x1c, %r13
movl %r12d, %r14d
movl %edx, %r15d
cmpq $0x1, %rax
ja 0x1adc98
jmp 0x1add8e
movl $0x1, %r15d
movl %r15d, %eax
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: 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 0x1af0bf
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 0x1af0b6
cmpl %edx, -0x4(%rdi,%r8)
je 0x1af0c0
addq $0x18, %r8
cmpq %r8, %r9
jne 0x1af0a8
retq
leaq (%rcx,%rsi,8), %rax
movl (%r8,%rax), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1af0d5
movslq 0x14(%rsi), %rax
movq %rax, (%r8)
testq %r9, %r9
je 0x1af0e1
movslq 0x18(%rsi), %rax
movq %rax, (%r9)
movl 0x1c(%rsi), %eax
testb $0x1, %al
jne 0x1af106
testq %rdx, %rdx
je 0x1af0fa
movslq 0xc(%rsi), %rax
movslq (%rsi), %rdi
addq %rax, %rdi
movq %rdi, (%rdx)
testq %rcx, %rcx
je 0x1af157
movl (%rsi), %eax
addl 0x10(%rsi), %eax
jmp 0x1af152
testq %rdx, %rdx
je 0x1af133
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 0x1af157
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_O3/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 0x1af164
movslq 0x14(%rsi), %rax
movq %rax, (%r8)
testq %r9, %r9
je 0x1af170
movslq 0x18(%rsi), %rax
movq %rax, (%r9)
movl 0x8(%rsi), %eax
testb $0x1, %al
jne 0x1af195
testq %rdx, %rdx
je 0x1af189
movslq 0xc(%rsi), %rax
movslq (%rsi), %rdi
addq %rax, %rdi
movq %rdi, (%rdx)
testq %rcx, %rcx
je 0x1af1e1
movl (%rsi), %edx
addl 0x10(%rsi), %edx
jmp 0x1af1db
testq %rdx, %rdx
je 0x1af1bf
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 0x1af1e1
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_O3/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 0x1af260
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 0x1af325
movq (%rbx), %rcx
movl $0x18, %r12d
xorl %r13d, %r13d
xorps %xmm3, %xmm3
movl $0x3fffffff, %ebp       # imm = 0x3FFFFFFF
xorl %r15d, %r15d
movups %xmm3, 0x10(%rcx,%r13)
movups %xmm3, (%rcx,%r13)
movq $0x0, 0x20(%rcx,%r13)
movq (%r14), %rax
movl -0xc(%rax,%r12), %esi
movl (%rax,%r12), %edx
shrdl $0x1f, %esi, %edx
movq (%rbx), %rcx
movl %edx, 0x8(%rcx,%r13)
movl -0x18(%rax,%r12), %edx
movl %edx, (%rcx,%r13)
movl (%rax,%r12), %edx
andl %ebp, %edx
movl %edx, 0x1c(%rcx,%r13)
movq -0x14(%rax,%r12), %xmm1
movq -0x8(%rax,%r12), %xmm0
movdqa %xmm0, %xmm2
punpcklqdq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0]
movdqu %xmm2, 0xc(%rcx,%r13)
testb $0x40, 0x3(%rax,%r12)
je 0x1af310
movd %xmm0, %ecx
pshufd $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movd %xmm0, %r8d
movq (%rsp), %rdi
xorl %edx, %edx
xorl %r9d, %r9d
callq 0x363d1
xorps %xmm3, %xmm3
movq (%rbx), %rcx
movl %eax, 0x1c(%rcx,%r13)
incq %r15
addq $0x28, %r13
addq $0x1c, %r12
cmpq 0x8(%r14), %r15
jb 0x1af284
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: 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:
testq %rsi, %rsi
jle 0x1af8b0
pushq %rbx
leaq 0x1(%rsi), %rax
leaq (%rsi,%rsi,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rsi, %rcx
leaq (%rdi,%rcx), %r8
addq $-0x18, %r8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
xorl %esi, %esi
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
cmpl $-0x1, %r9d
je 0x1af849
movl 0x4(%r8), %ebx
cmpl %r9d, %ebx
jbe 0x1af84f
movl (%r8), %r10d
cmpl %r10d, %r9d
cmovael %r10d, %r9d
jmp 0x1af85c
movl 0x4(%r8), %ebx
jmp 0x1af854
subl %r9d, %edx
addl %edx, %esi
movl (%r8), %r10d
movl %r10d, %r9d
movl %ebx, %edx
testb $0x40, 0x17(%r8)
jne 0x1af868
movl %r11d, %r10d
jmp 0x1af883
cmpl $-0x1, %r11d
je 0x1af881
cmpl %r11d, %ebx
jbe 0x1af87c
cmpl %r10d, %r11d
cmovbl %r11d, %r10d
jmp 0x1af883
subl %r11d, %edi
addl %edi, %ecx
movl %ebx, %edi
decq %rax
addq $-0x1c, %r8
movl %r10d, %r11d
cmpq $0x1, %rax
ja 0x1af82e
subl %r9d, %edx
xorl %eax, %eax
cmpl $-0x1, %r9d
cmovel %eax, %edx
addl %esi, %edx
subl %r10d, %edi
cmpl $-0x1, %r10d
cmovel %eax, %edi
addl %edi, %ecx
popq %rbx
jmp 0x1af8b4
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %eax
movl %edx, %esi
subl %ecx, %esi
je 0x1af8d6
cvtsi2ss %rsi, %xmm1
movl %edx, %ecx
cvtsi2ss %rcx, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
jae 0x1af8d6
xorl %eax, %eax
retq