LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: kv_ul_ov_t_statistics(kv_ul_ov_t*, unsigned long, long*)
uint64_t kv_ul_ov_t_statistics(kv_ul_ov_t *olist, uint64_t qn, int64_t *occ)
{
	int64_t k, l = 0;
	uint32_t sp = (uint32_t)-1, ep = (uint32_t)-1;
	for (k = olist->n-1; k >= 0 && olist->a[k].qn == qn; k--) {
		if(!(olist->a[k].el)) continue;
		if(!(olist->a[k].tn&((uint32_t)(0x80000000)))) continue;
		if(sp == (uint32_t)-1 || olist->a[k].qe <= sp) {
			if(sp != (uint32_t)-1) l += ep - sp;
			sp = olist->a[k].qs;
			ep = olist->a[k].qe;
		} else {
			sp = MIN(sp, olist->a[k].qs);
		}
		(*occ)++;
	}
	if(sp != (uint32_t)-1) l += ep - sp;
	return l;
}

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdx)
movups %xmm0, 0x10(%rdx)
movups %xmm0, (%rdx)
movq 0x80(%rdi), %rax
testq %rax, %rax
je 0x17270f
movq (%rax,%r14,8), %rdi
movq %rcx, %rsi
callq 0xc6d6
addq %rax, (%rbx)
movq 0x88(%r15), %rax
testq %rax, %rax
je 0x172743
imulq $0x68, %r14, %rcx
movq 0x28(%rax,%rcx), %rdx
movq 0x50(%rax,%rcx), %rsi
addq 0x10(%rax,%rcx), %rdx
imulq $0x1c, %rdx, %rdx
leaq (%rdx,%rsi,8), %rdx
imulq $0x34, 0x40(%rax,%rcx), %rax
addq %rdx, %rax
addq %rax, 0x8(%rbx)
movq 0x78(%r15), %rax
testq %rax, %rax
je 0x172766
movq (%rax,%r14,8), %rax
movq (%rax), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0x1a3b6e
movq (%r12), %rax
addq %rax, 0x10(%rbx)
movq 0x90(%r15), %rax
testq %rax, %rax
je 0x1727c2
imulq $0xc0, %r14, %rcx
movq 0x28(%rax,%rcx), %rdx
movq 0x80(%rax,%rcx), %rsi
addq 0x10(%rax,%rcx), %rdx
imulq $0x28, %rdx, %rdx
imulq $0x30, 0x40(%rax,%rcx), %rdi
imulq $0xc, 0x70(%rax,%rcx), %r8
addq %rdi, %r8
addq %rdx, %r8
addq 0x58(%rax,%rcx), %rsi
addq 0x98(%rax,%rcx), %rsi
addq 0xb0(%rax,%rcx), %rsi
addq 0x18(%rbx), %r8
leaq (%r8,%rsi,8), %rax
movq %rax, 0x18(%rbx)
movq 0x60(%r15), %rax
testq %rax, %rax
je 0x1727de
movq %r14, %rcx
shlq $0x4, %rcx
movl 0x4(%rax,%rcx), %eax
imulq $0x18, %rax, %rax
addq %rax, 0x20(%rbx)
movq 0x68(%r15), %rax
testq %rax, %rax
je 0x1727fe
imulq $0x18, %r14, %rcx
movq 0x8(%rax,%rcx), %rcx
shlq $0x3, %rcx
addq 0x28(%rbx), %rcx
movq %rcx, 0x28(%rbx)
jmp 0x172802
movq 0x28(%rbx), %rcx
movdqu (%rbx), %xmm0
movdqu 0x10(%rbx), %xmm1
paddq %xmm0, %xmm1
pshufd $0xee, %xmm1, %xmm0     # xmm0 = xmm1[2,3,2,3]
paddq %xmm1, %xmm0
movq %xmm0, %rax
addq 0x20(%rbx), %rax
addq %rcx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: max_ovlp_src_contain(ug_opt_t const*, unsigned int)
int64_t max_ovlp_src_contain(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, dt; asg_arc_t e; int32_t r = 1;

	for (i = 0; i < src[x].length; i++) {
        qn = Get_qn(src[x].buffer[i]); tn = Get_tn(src[x].buffer[i]);
		r = 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);
		// if(qn == 20171 && tn == 20172) {
		// 	fprintf(stderr, "[r::%d]\t%.*s\t%c\tq::[%u, %u)\t%.*s\tt::[%u, %u)\n", r,
        //             (int)Get_NAME_LENGTH(R_INF, qn), Get_NAME(R_INF, qn), "+-"[src[x].buffer[i].rev], 
		// 			Get_qs(src[x].buffer[i]), Get_qe(src[x].buffer[i]), 
		// 			(int)Get_NAME_LENGTH(R_INF, tn), Get_NAME(R_INF, tn),
		// 			Get_ts(src[x].buffer[i]), Get_te(src[x].buffer[i]));
		// }
		if(r >= 0) {
			if((e.ul>>32) != v) continue;
			if(o < e.ol) o = e.ol;
		} else if(r == MA_HT_TCONT) {///tn is contained in qn
			if(v&1) dt = Get_qe(src[x].buffer[i]);
			else dt = Get_READ_LENGTH(R_INF, qn) - Get_qs(src[x].buffer[i]);
			if(o < dt) o = dt;
		}
    }

	return o;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x8(%rdi), %rax
movl 0x44(%rdi), %ecx
movl %ecx, 0x14(%rsp)
movl 0x40(%rdi), %ecx
movl %ecx, 0x10(%rsp)
movl %esi, %ecx
shrl %ecx
imulq $0x18, %rcx, %rcx
leaq (%rax,%rcx), %rdx
movq %rdx, 0x20(%rsp)
movl 0xc(%rax,%rcx), %eax
leaq 0xe09e4(%rip), %rcx     # 0x254230
movq 0x18(%rcx), %rbx
leaq 0xdff01(%rip), %rcx     # 0x253758
movss 0x158(%rcx), %xmm0
movss %xmm0, 0xc(%rsp)
movl %esi, 0x8(%rsp)
movl %esi, %ecx
movq %rcx, 0x18(%rsp)
imulq $0x28, %rax, %rax
movq %rax, 0x28(%rsp)
xorl %ebp, %ebp
xorl %r14d, %r14d
cmpq %rbp, 0x28(%rsp)
je 0x173911
movq 0x20(%rsp), %rax
movq (%rax), %r15
leaq (%r15,%rbp), %rdi
movq (%r15,%rbp), %r13
movl 0xc(%r15,%rbp), %eax
movq %r13, %rcx
shrq $0x20, %rcx
movq (%rbx,%rcx,8), %r12
movl (%rbx,%rax,8), %edx
movl %r12d, %esi
movl 0x10(%rsp), %ecx
movss 0xc(%rsp), %xmm0
movl 0x14(%rsp), %r8d
leaq 0x30(%rsp), %r9
callq 0x15d560
testl %eax, %eax
js 0x1738eb
movq 0x18(%rsp), %rax
cmpl %eax, 0x34(%rsp)
jne 0x173908
movl 0x3c(%rsp), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
cmpl %eax, %r14d
cmovbel %eax, %r14d
jmp 0x173908
cmpl $-0x3, %eax
jne 0x173908
testb $0x1, 0x8(%rsp)
jne 0x1738fc
subl %r13d, %r12d
jmp 0x173901
movl 0x8(%r15,%rbp), %r12d
cmpl %r12d, %r14d
cmovbel %r12d, %r14d
addq $0x28, %rbp
jmp 0x17387e
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: quick_rechain_sc(ul_ov_t*, overlap_region_alloc*, ul_idx_t const*, ug_opt_t const*, long, double, All_reads*, kv_rtrace_t*, char*, UC_Read*, rtrace_iter*, double, bit_extz_t*, long, int*, long, long)
int64_t quick_rechain_sc(ul_ov_t *a, overlap_region_alloc* ol, const ul_idx_t *uref, const ug_opt_t *uopt, 
int64_t bw, double diff, All_reads *ridx, kv_rtrace_t *trace, char* qstr, UC_Read *tu, rtrace_iter *tc,
double e_rate, bit_extz_t *exz, int64_t trans_sc, int32_t *f, int64_t ai, int64_t aj)
{
	ul_ov_t *li = &(a[ai]), *lj = &(a[aj]);
	uint32_t li_v, lj_v; int64_t qo, is_c, err, sc = INT32_MIN;
	li_v = (li->tn<<1)|li->rev; lj_v = (lj->tn<<1)|lj->rev;
	if(li_v == lj_v) return INT32_MIN;
	if(lj->qe <= li->qs) return INT32_MIN;
	if(lj->qs > li->qs) return INT32_MIN;
	qo = infer_rovlp(li, lj, NULL, NULL, ridx, NULL);
	if(get_ecov_contain_adv(uref, uopt, li_v^1, lj_v^1, bw, diff, qo, &is_c)) {
		if(is_c == 0) {
			err = get_rid_backward_cigar_err(tc, li, trace, NULL, uref, qstr, tu, ol, NULL, exz, e_rate, lj->qe);
			sc = f[aj] + (li->qe - lj->qe) - (err*trans_sc);
		}
	}
	return sc;
}

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq %rsi, %r14
movq %rdi, %r15
pushq $0x14
popq %rbp
xorl %r12d, %r12d
movq 0x8(%r15), %r10
cmpq %r10, %r12
jae 0x17817a
movq 0xdaeb2(%rip), %rax     # 0x252fe0
movq (%rax), %rdi
movq (%r15), %rax
movl -0x14(%rax,%rbp), %r11d
movl -0x10(%rax,%rbp), %r9d
movl -0xc(%rax,%rbp), %r13d
movl (%rax,%rbp), %ebx
subl -0x4(%rax,%rbp), %ebx
leaq 0x7b926(%rip), %rsi     # 0x1f3a77
leaq 0x7b967(%rip), %rdx     # 0x1f3abf
movq %r14, %rcx
movq (%rsp), %r8
xorl %eax, %eax
pushq %r10
pushq %rbx
pushq %r11
pushq %r13
callq 0x22b0
addq $0x20, %rsp
incq %r12
addq $0x1c, %rbp
jmp 0x17811e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: prt_all_chain(kv_ul_ov_t*, ul_ov_t*, long)
void prt_all_chain(kv_ul_ov_t *idx, ul_ov_t *a, int64_t ql)
{
	uint64_t i, k;
	for (i = 0; i < idx->n; i++) {
		fprintf(stderr, "\n[M::%s] q::[%u, %u), ql::%ld, sc::%u\n", __func__, idx->a[i].qs, idx->a[i].qe, ql, idx->a[i].qn);
		for (k = idx->a[i].ts; k < idx->a[i].te; k++) {
			fprintf(stderr, "%.*s\t%c\tq::[%u, %u)\tt::[%u, %u)\tc::%u\n", 
                    (int)Get_NAME_LENGTH(R_INF, a[k].tn), Get_NAME(R_INF, a[k].tn), "+-"[a[k].rev],
                    a[k].qs, a[k].qe, a[k].ts, a[k].te, !a[k].el);
		}
	}
	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x8(%rsp)
movq %rdi, %r15
addq $0x18, %rsi
movq %rsi, (%rsp)
xorl %ecx, %ecx
cmpq 0x8(%r15), %rcx
jae 0x1782a2
movq 0xdae26(%rip), %rax     # 0x252fe0
movq (%rax), %rdi
movq (%r15), %rax
movq %rcx, 0x10(%rsp)
imulq $0x1c, %rcx, %rbx
movl (%rax,%rbx), %r10d
movl 0x4(%rax,%rbx), %ecx
movl 0x8(%rax,%rbx), %r8d
subq $0x8, %rsp
leaq 0x7b8f0(%rip), %rsi     # 0x1f3ad1
leaq 0x7b910(%rip), %rdx     # 0x1f3af8
movq 0x10(%rsp), %r9
xorl %eax, %eax
pushq %r10
callq 0x22b0
popq %rcx
popq %rdx
movq (%r15), %rax
movl 0x10(%rax,%rbx), %r12d
imulq $0x1c, %r12, %r13
addq (%rsp), %r13
movl 0x14(%rax,%rbx), %eax
cmpq %rax, %r12
jae 0x178295
leaq 0xdc014(%rip), %rsi     # 0x254230
movq 0x40(%rsi), %rax
movl -0xc(%r13), %ecx
leal 0x1(%rcx), %edx
movl (%rax,%rdx,8), %edx
movq (%rax,%rcx,8), %rcx
subl %ecx, %edx
addq 0x8(%rsi), %rcx
movq 0xdada5(%rip), %rax     # 0x252fe0
movq (%rax), %rdi
movl (%r13), %eax
movl %eax, %esi
shrl $0x1f, %esi
leaq 0x6bfd5(%rip), %r8      # 0x1e4223
movsbl (%rsi,%r8), %r8d
movl -0x14(%r13), %r9d
movl -0x10(%r13), %r10d
movl -0x8(%r13), %r11d
movl -0x4(%r13), %r14d
xorl %ebp, %ebp
btl $0x1e, %eax
setae %bpl
leaq 0x7b892(%rip), %rsi     # 0x1f3b06
xorl %eax, %eax
pushq %rbp
pushq %r14
pushq %r11
pushq %r10
callq 0x22b0
addq $0x20, %rsp
incq %r12
movq (%r15), %rax
addq $0x1c, %r13
jmp 0x178208
movq 0x10(%rsp), %rcx
incq %rcx
jmp 0x1781a9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: ck_ul_alignment(ul_vec_t*)
uint32_t ck_ul_alignment(ul_vec_t *x)
{
	uc_block_t *a = x->bb.a, *p, *z0, *z1; uint64_t a_n = x->bb.n, k, rlen = x->rlen;
	for (k = 0; k < a_n; k++) {
		p = &(a[k]);
		if(p->base) continue;
		if(p->qs > rlen || p->qe > rlen || p->qs > p->qe) break;
		if(p->pidx != (uint32_t)-1) {
			if(a[p->pidx].aidx == (uint32_t)-1 || a[p->pidx].aidx != k) break;
			if(p->pidx >= k) break;
			z1 = p; z0 = &(a[p->pidx]);
			if(!(z1->qs >= z0->qs && z1->qe >= z0->qe)) break;
		}

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

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

// Assembly:
movq %rcx, %rax
subq %rdx, %rax
movq %rax, %xmm2
punpckldq 0x6a880(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x6a888(%rip), %xmm2    # 0x1e3280
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
mulsd %xmm0, %xmm1
movq 0x6a860(%rip), %xmm0    # 0x1e3270
movapd 0x6a868(%rip), %xmm2    # 0x1e3280
pushq $0x1
popq %rax
subq $0x1, %rsi
jb 0x178a66
testb $-0x42, 0x28(%rdi)
jne 0x178a60
movl (%rdi), %r9d
movl 0x4(%rdi), %r8d
cmpq %rcx, %r8
cmovaeq %rcx, %r8
cmpq %rdx, %r9
cmovbeq %rdx, %r9
subq %r9, %r8
jbe 0x178a60
movq %r8, %xmm3
punpckldq %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
subpd %xmm2, %xmm3
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
addsd %xmm3, %xmm4
ucomisd %xmm1, %xmm4
ja 0x178a68
addq $0x30, %rdi
jmp 0x178a1b
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: is_mmhom_node(unsigned long*, ma_utg_t*, asg_t*, unsigned long, double)
uint32_t is_mmhom_node(uint64_t *ca, ma_utg_t *u, asg_t *sg, uint64_t cov_bd, double cut_rate)
{
	if(cut_rate < 0) cut_rate = 0; if(cut_rate > 1.0) cut_rate = 1.0;
	uint64_t k, a, na, a_cut = u->n*cut_rate, na_cut = u->n*(1.0-cut_rate);
	for (k = a = na = 0; k < u->n; k++) {
		if(ca[k] > (cov_bd*((uint64_t)sg->seq[u->a[k]>>33].len))) {
			a++; if((a) && (a>=a_cut)) return 1;
		} else {
			na++; if((na) && (na>=na_cut)) return 0;
		}
	}

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorpd %xmm1, %xmm1
maxsd %xmm0, %xmm1
movsd 0x6946b(%rip), %xmm0    # 0x1e32a0
movapd %xmm0, %xmm2
minsd %xmm1, %xmm2
movl 0x10(%rsi), %r8d
cvtsi2sd %r8, %xmm1
subsd %xmm2, %xmm0
mulsd %xmm1, %xmm2
cvttsd2si %xmm2, %rax
movq %rax, %r10
sarq $0x3f, %r10
movsd 0x69436(%rip), %xmm3    # 0x1e3298
subsd %xmm3, %xmm2
cvttsd2si %xmm2, %r9
andq %r10, %r9
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %r11
orq %rax, %r9
movq %r11, %rax
sarq $0x3f, %rax
subsd %xmm3, %xmm0
cvttsd2si %xmm0, %r10
andq %rax, %r10
orq %r11, %r10
xorl %r11d, %r11d
movl $0x1, %eax
xorl %ebx, %ebx
xorl %r14d, %r14d
cmpq %r11, %r8
je 0x179eeb
movq 0x20(%rdx), %r15
movq 0x18(%rsi), %r12
movq (%r12,%r11,8), %r12
shrq $0x21, %r12
movl (%r15,%r12,8), %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
imulq %rcx, %r15
cmpq %r15, (%rdi,%r11,8)
jbe 0x179ed0
incq %rbx
jne 0x179eda
xorl %ebx, %ebx
jmp 0x179ee6
incq %r14
jne 0x179ee1
xorl %r14d, %r14d
jmp 0x179ee6
cmpq %r9, %rbx
jb 0x179ee6
jmp 0x179efc
cmpq %r10, %r14
jae 0x179f04
incq %r11
jmp 0x179e9d
testq %rbx, %rbx
setne %al
cmpq %r9, %rbx
setae %cl
andb %al, %cl
movzbl %cl, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0x179efc
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: remove_trans_ovlp_connect(ma_ug_t*, unsigned long, kv_ul_ov_t*)
void remove_trans_ovlp_connect(ma_ug_t *ug, uint64_t rid, kv_ul_ov_t *bck)
{
	int64_t i; uint64_t m, k;
	for (i = ((int64_t)bck->n)-1; i >= 0 && bck->a[i].qn == rid; i--);
	m = i + 1;
	if(m >= bck->n) return;
	for (k = m; k < bck->n; k++) {
		if(!trans_ovlp_connect(&(bck->a[k]), ug)) continue;
		bck->a[m++] = bck->a[k];
	}
	bck->n = m;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rdi, 0x10(%rsp)
movq 0x8(%rdx), %r13
movq %r13, %r12
sarq $0x3f, %r12
andq %r13, %r12
imulq $0x1c, %r13, %rax
addq $-0x1c, %rax
movq %r13, %rcx
testq %rcx, %rcx
jle 0x17a876
decq %rcx
movq (%rbx), %rdx
movl (%rdx,%rax), %edx
addq $-0x1c, %rax
cmpq %rsi, %rdx
je 0x17a859
incq %rcx
movq %rcx, %r12
cmpq %r13, %r12
jae 0x17a8dc
imulq $0x1c, %r12, %rbp
movq %r12, 0x8(%rsp)
cmpq %r13, %r12
jae 0x17a8d3
movq (%rbx), %r14
leaq (%r14,%rbp), %r15
movq %r15, %rdi
movq 0x10(%rsp), %rsi
callq 0x178842
testl %eax, %eax
je 0x17a8ca
movq 0x8(%rsp), %rcx
imulq $0x1c, %rcx, %rax
incq %rcx
movq %rcx, 0x8(%rsp)
movups (%r15), %xmm0
movups 0xc(%r15), %xmm1
movups %xmm1, 0xc(%r14,%rax)
movups %xmm0, (%r14,%rax)
movq 0x8(%rbx), %r13
incq %r12
addq $0x1c, %rbp
jmp 0x17a884
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: gen_reliable_cov_arr(unsigned int, kv_u_trans_t*, ug_rid_cov_t*, st_mt_t*)
uint64_t *gen_reliable_cov_arr(uint32_t id, kv_u_trans_t *idx, ug_rid_cov_t *ccov, st_mt_t *sp)
{
	u_trans_t *a; uint64_t n, k;
	a = u_trans_a(*idx, id); n = u_trans_n(*idx, id);
	kv_resize(uint64_t, *sp, ccov->ug->u.a[id].n);
	memcpy(sp->a, ccov->cov.a+ccov->idx[id], sizeof((*(sp->a)))*ccov->ug->u.a[id].n);
	for (k = 0; k < n; k++) {
		if(a[k].del) continue;
		if(a[k].f == RC_0 || a[k].f == RC_1) {
			append_cov_line_ug_rid_cov_t(id, sp->a, &(a[k]), ccov, ((uint64_t)-1), -1);
		}
	}
	return sp->a;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq 0x28(%rsi), %rax
movl %edi, %r15d
movq (%rax,%r15,8), %rax
movl %eax, %ebp
shrq $0x20, %rax
imulq $0x30, %rax, %r12
addq 0x10(%rsi), %r12
movq (%rdx), %rax
movq 0x10(%rax), %rax
imulq $0x28, %r15, %r13
movl 0x10(%rax,%r13), %edx
cmpq %rdx, 0x8(%rcx)
jae 0x17af2f
decq %rdx
movq %rdx, %rax
shrq %rax
orq %rdx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x10, %rax
orq %rcx, %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rbx)
movq 0x10(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x2370
movq %rax, %rdi
movq %rax, 0x10(%rbx)
movq (%r14), %rax
movq 0x10(%rax), %rax
movl 0x10(%rax,%r13), %edx
jmp 0x17af33
movq 0x10(%rbx), %rdi
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rsi
shlq $0x3, %rsi
addq 0x28(%r14), %rsi
shlq $0x3, %rdx
callq 0x2160
pushq $-0x1
popq %r13
subq $0x1, %rbp
jb 0x17af81
testb $-0x42, 0x28(%r12)
jne 0x17af7b
movq 0x10(%rbx), %rsi
movq %r15, %rdi
movq %r12, %rdx
movq %r14, %rcx
movq %r13, %r8
movsd 0x6860a(%rip), %xmm0    # 0x1e3580
callq 0x8af8f
addq $0x30, %r12
jmp 0x17af50
movq 0x10(%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: is_above_cov(unsigned long, overlap_region*, unsigned long*, ug_rid_cov_t*, double)
uint64_t is_above_cov(uint64_t uid, overlap_region *o, uint64_t *fc, ug_rid_cov_t *ccov, double sec_rate)
{
	u_trans_t p;
	p.qn = uid; p.tn = o->y_id; 
	p.rev = o->y_pos_strand; p.f = RC_3; p.nw = 0;
	p.qs = o->x_pos_s; p.qe = o->x_pos_e+1;
	if(p.rev) {
		p.ts = ccov->ug->u.a[p.tn].len - (o->y_pos_e+1); 
		p.te = ccov->ug->u.a[p.tn].len - o->y_pos_s;
	} else {
		p.ts = o->y_pos_s; 
		p.te = o->y_pos_e+1;
	}

	if(append_cov_line_ug_rid_cov_t(uid, fc, &p, ccov, ccov->hom_max, sec_rate)) return 0;
	return 1;
}

// Assembly:
subq $0x38, %rsp
movl %edi, 0x10(%rsp)
movl 0x10(%rsi), %eax
movl %eax, 0x1c(%rsp)
movb 0x1c(%rsi), %r8b
shlb $0x6, %r8b
andb $0x40, %r8b
leal 0x3(%r8), %r9d
movb %r9b, 0x30(%rsp)
andq $0x0, 0x28(%rsp)
movl 0x4(%rsi), %r9d
movl %r9d, 0x8(%rsp)
movl 0x8(%rsi), %r9d
incl %r9d
movl %r9d, 0xc(%rsp)
testb %r8b, %r8b
jne 0x17afe8
movl 0x14(%rsi), %eax
movl %eax, 0x14(%rsp)
movl 0x18(%rsi), %r8d
incl %r8d
jmp 0x17b00d
movq (%rcx), %r8
movq 0x10(%r8), %r9
imulq $0x28, %rax, %rax
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl (%r9,%rax), %r8d
movl 0x18(%rsi), %eax
notl %eax
addl %r8d, %eax
movl %eax, 0x14(%rsp)
subl 0x14(%rsi), %r8d
leaq 0x8(%rsp), %rax
movl %r8d, 0x10(%rax)
movq 0x38(%rcx), %r8
movq %rdx, %rsi
movq %rax, %rdx
callq 0x8af8f
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
movq %rcx, %rax
addq $0x38, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: get_high_simi(overlap_region*, double, unsigned long, unsigned long, unsigned long*, unsigned long*)
uint64_t get_high_simi(overlap_region *z, double erate, uint64_t maxe, uint64_t minov, uint64_t *re0, uint64_t *re1)
{
	uint64_t ol, err = z->non_homopolymer_errors, e0, e1, f0 = 0, f1 = 0;
	ol = z->x_pos_e+1-z->x_pos_s; (*re0) = (*re1) = (uint64_t)-1;
	if(ol > (z->y_pos_e+1-z->y_pos_s)) ol = z->y_pos_e+1-z->y_pos_s;
	if((err <= (ol*erate)) && (err <= maxe)) return 1;
	if(ol <= minov) return 0;///too short
	e0 = cal_cigar_err(z, 0, minov, 0);
	e1 = cal_cigar_err(z, z->x_pos_e+1-minov, z->x_pos_e+1, 1);
	if((e0 <= (minov*erate)) && (e0 <= maxe)) f0 = 1;
	if((e1 <= (minov*erate)) && (e1 <= maxe)) f1 = 1;
	if(f0 && f1 && (ol <= (minov<<1))) {
		if(e0 >= e1) f0 = 0;
		else f1 = 0;
	}
	if((!f0) && (!f1)) return 0;
	if(f0) (*re0) = e0;
	if(f1) (*re1) = e1;
	return 2; 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbp
movl 0x8(%rdi), %ecx
subl 0x4(%rdi), %ecx
movl 0x30(%rdi), %eax
orq $-0x1, (%r8)
incl %ecx
orq $-0x1, (%r14)
movl 0x18(%rdi), %r13d
subl 0x14(%rdi), %r13d
incl %r13d
cmpl %r13d, %ecx
cmovbl %ecx, %r13d
cmpq %rsi, %rax
ja 0x17c360
cvtsi2sd %rax, %xmm2
cvtsi2sd %r13, %xmm1
mulsd %xmm0, %xmm1
ucomisd %xmm2, %xmm1
jb 0x17c360
pushq $0x1
popq %rcx
jmp 0x17c450
cmpq %r15, %r13
jbe 0x17c44e
movq %r8, 0x8(%rsp)
movq %rbp, %rdi
xorl %esi, %esi
movq %r15, %rdx
xorl %ecx, %ecx
movsd %xmm0, 0x10(%rsp)
callq 0x17bf1e
movq %rax, %rbx
movl 0x8(%rbp), %edx
incl %edx
movq %rdx, %rsi
subq %r15, %rsi
pushq $0x1
popq %rcx
movq %rbp, %rdi
callq 0x17bf1e
movq %rbx, %xmm0
movq 0x66ec7(%rip), %xmm1    # 0x1e3270
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x66ecb(%rip), %xmm2    # 0x1e3280
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
cvtsi2sd %r15, %xmm0
mulsd 0x10(%rsp), %xmm0
ucomisd %xmm3, %xmm0
setae %cl
cmpq %r12, %rbx
setbe %dl
andb %cl, %dl
movq %rax, %xmm3
punpckldq %xmm1, %xmm3    # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
subpd %xmm2, %xmm3
movapd %xmm3, %xmm1
unpckhpd %xmm3, %xmm1            # xmm1 = xmm1[1],xmm3[1]
addsd %xmm3, %xmm1
ucomisd %xmm1, %xmm0
setae %cl
cmpq %r12, %rax
setbe %sil
andb %cl, %sil
pushq $0x2
popq %rcx
cmpb $0x1, %dl
jne 0x17c42d
testb %sil, %sil
je 0x17c42d
addq %r15, %r15
cmpq %r13, %r15
jae 0x17c423
movq %rbx, (%r14)
jmp 0x17c444
cmpq %rax, %rbx
setb %dl
setae %sil
movl %edx, %edi
orb %sil, %dil
cmpb $0x1, %dil
jne 0x17c44e
testb %dl, %dl
je 0x17c43f
movq %rbx, (%r14)
testb %sil, %sil
je 0x17c450
movq 0x8(%rsp), %rdx
movq %rax, (%rdx)
jmp 0x17c450
xorl %ecx, %ecx
movq %rcx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: hpc_check_naive(hpc_ss_t*, long, long, long, long)
int64_t hpc_check_naive(hpc_ss_t *a, int64_t n, int64_t s, int64_t e, int64_t bd)
{
	int64_t k, os, oe;
	for (k = 0; k < n; k++) {
		os = MAX(s, a[k].s); oe = MIN(e, a[k].e);
		if(oe - os >= -bd) return 1;
		if(a[k].s > (uint64_t)(e + bd)) break;
	}
	return 0;
}

// Assembly:
pushq %rbx
leaq (%r8,%rcx), %r9
negq %r8
xorl %eax, %eax
testq %rsi, %rsi
cmovleq %rax, %rsi
incq %rsi
addq $0x4, %rdi
movabsq $0x1, %rax
decq %rsi
je 0x17c4b2
movl -0x4(%rdi), %r10d
movl (%rdi), %r11d
cmpq %rdx, %r10
movq %rdx, %rbx
cmovgq %r10, %rbx
cmpq %rcx, %r11
cmovgeq %rcx, %r11
subq %rbx, %r11
cmpq %r8, %r11
jge 0x17c4b4
addq $0xc, %rdi
cmpq %r10, %r9
jae 0x17c484
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: hpc_check(hpc_ss_t*, long, long, long, long*, long)
int64_t hpc_check(hpc_ss_t *a, int64_t n, int64_t s, int64_t e, int64_t *idx, int64_t bd)
{
	if(n<=0) return 0;
	if((*idx) >= n) (*idx) = n - 1;
	if((*idx) < 0) (*idx) = 0;
	int64_t k = (*idx), os, oe;
	for (; k < n; k++) {
		os = MAX(s, a[k].s); oe = MIN(e, a[k].e);
		if(oe - os >= -bd) {
			(*idx) = k; return 1;
		}
		if(a[k].s > (uint64_t)(e + bd)) break;
	}
	os = (*idx); (*idx) = k; k = os - 1;
	for (; k >= 0; k--) {
		os = MAX(s, a[k].s); oe = MIN(e, a[k].e);
		if(oe - os >= -bd) {
			(*idx) = k; return 1;
		}
	}
	// assert(!hpc_check_naive(a, n, s, e, bd));
	return 0;
}

// Assembly:
testq %rsi, %rsi
jle 0x17c527
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%r8), %rax
leaq -0x1(%rsi), %r11
xorl %r10d, %r10d
testq %rax, %rax
cmovgq %rax, %r10
cmpq %rsi, %rax
cmovgeq %r11, %r10
movq %r9, %r11
negq %r11
addq %rcx, %r9
imulq $0xc, %r10, %rax
leaq (%rax,%rdi), %r14
addq $0x4, %r14
movq %r10, %rbx
cmpq %rsi, %rbx
jge 0x17c532
movl -0x4(%r14), %r15d
movl (%r14), %r12d
cmpq %rdx, %r15
movq %rdx, %r13
cmovgq %r15, %r13
cmpq %rcx, %r12
cmovgeq %rcx, %r12
subq %r13, %r12
cmpq %r11, %r12
jge 0x17c52a
cmpq %r15, %r9
jb 0x17c52f
incq %rbx
addq $0xc, %r14
jmp 0x17c4f4
xorl %eax, %eax
retq
movq %rbx, %r10
jmp 0x17c567
movq %rbx, %rsi
movq %rsi, (%r8)
leaq (%rax,%rdi), %rsi
addq $-0x8, %rsi
xorl %eax, %eax
testq %r10, %r10
jle 0x17c574
decq %r10
movl -0x4(%rsi), %edi
cmpq %rdx, %rdi
cmovleq %rdx, %rdi
movl (%rsi), %r9d
cmpq %rcx, %r9
cmovgeq %rcx, %r9
subq %rdi, %r9
addq $-0xc, %rsi
cmpq %r11, %r9
jl 0x17c53f
movq %r10, (%r8)
movabsq $0x1, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: cal_s_interval(ma_ug_t*, asg_arc_t*, ul_ov_t*)
void cal_s_interval(ma_ug_t *ug, asg_arc_t *p, ul_ov_t *res)
{
	memset(res, 0, sizeof((*res)));
	res->rev = (((p->ul>>32)^(p->v))&((uint32_t)1));
	res->qn = p->ul>>33; res->tn = p->v>>1;
	uint32_t ql = ug->g->seq[res->qn].len, tl = ug->g->seq[res->tn].len;
	if((p->ul>>32)&1) {
		res->qs = 0; res->qe = ((p->ol<=ql)?(p->ol):(ql));
	} else {
		res->qe = ql; res->qs = ((p->ol<=res->qe)?(res->qe-p->ol):(0));
	}

	if(p->v&1) {
		res->te = tl; res->ts = ((p->ol<=res->te)?(res->te-p->ol):(0));
	} else {
		res->ts = 0; res->te = ((p->ol<=tl)?(p->ol):(tl));
	}
}

// Assembly:
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rdx)
movups %xmm0, (%rdx)
movl 0x8(%rsi), %eax
xorl 0x4(%rsi), %eax
shll $0x1f, %eax
movl %eax, 0x18(%rdx)
movq (%rsi), %r9
movq %r9, %rax
shrq $0x21, %rax
movl %eax, (%rdx)
movl 0x8(%rsi), %ecx
movl %ecx, %r10d
shrl %r10d
movl %r10d, 0xc(%rdx)
movq 0x18(%rdi), %rdi
movq 0x20(%rdi), %r11
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movl (%r11,%rax,8), %r8d
andl %edi, %r8d
movl (%r11,%r10,8), %eax
andl %edi, %eax
btq $0x20, %r9
jb 0x17cb87
movl %r8d, 0x8(%rdx)
andl 0xc(%rsi), %edi
xorl %r9d, %r9d
subl %edi, %r8d
cmovbl %r9d, %r8d
pushq $0x4
popq %r9
movl %r8d, %edi
jmp 0x17cb95
andl 0xc(%rsi), %edi
cmpl %r8d, %edi
cmovael %r8d, %edi
pushq $0x8
popq %r9
movl %edi, (%rdx,%r9)
testb $0x1, %cl
jne 0x17cbb3
andl $0x0, 0x10(%rdx)
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl 0xc(%rsi), %ecx
cmpl %eax, %ecx
cmovbl %ecx, %eax
pushq $0x14
jmp 0x17cbc7
movl %eax, 0x14(%rdx)
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl 0xc(%rsi), %ecx
xorl %esi, %esi
subl %ecx, %eax
cmovbl %esi, %eax
pushq $0x10
popq %rcx
movl %eax, (%rdx,%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: infer_se(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int*, unsigned int*)
uint32_t infer_se(uint32_t qs, uint32_t qe, uint32_t ts, uint32_t te, uint32_t rev, 
uint32_t rqs, uint32_t rqe, uint32_t *rts, uint32_t *rte)
{
	if(rqs <= rqe && rqs >= qs && rqe <= qe) {
		uint32_t s_shift, e_shift, m;
		s_shift = get_offset_adjust(rqs-qs, qe-qs, te-ts);
		e_shift = get_offset_adjust(qe-rqe, qe-qs, te-ts);
		if(rev) {
			m = s_shift; s_shift = e_shift; e_shift = m;
		}
		// if(rqs == 2623 && rqe == 17620) {
		// 	fprintf(stderr, "[M::%s]\tqs::%u\tqe::%u\tts::%u\tte::%u\trqs::%u\trqe::%u\ts_shift::%u\te_shift::%u\n", __func__, 
		// 		qs, qe, ts, te, rqs, rqe, s_shift, e_shift);
		// }
		(*rts) = ts + s_shift; (*rte) = te - e_shift;
		if((*rts) <= (*rte) && (*rts) >= ts && (*rte) <= te) return 1;
	}
	(*rts) = (*rte) = (uint32_t)-1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
movq 0x28(%rsp), %r10
movq 0x20(%rsp), %rax
movl 0x18(%rsp), %ebp
movl %esi, %r11d
subl %ebp, %r11d
jb 0x17cc4f
movl %r9d, %ebx
subl %edi, %ebx
jb 0x17cc4f
cmpl %ebp, %r9d
ja 0x17cc4f
subl %edi, %esi
movl %ecx, %edi
subl %edx, %edi
cvtsi2sd %rbx, %xmm0
cvtsi2sd %rsi, %xmm1
cvtsi2sd %rdi, %xmm2
divsd %xmm1, %xmm0
mulsd %xmm2, %xmm0
cvttsd2si %xmm0, %rsi
cvtsi2sd %r11, %xmm0
divsd %xmm1, %xmm0
mulsd %xmm2, %xmm0
cvttsd2si %xmm0, %rdi
testl %r8d, %r8d
movl %edi, %r8d
cmovel %esi, %r8d
cmovel %edi, %esi
addl %edx, %r8d
movl %r8d, (%rax)
subl %esi, %ecx
movl %ecx, (%r10)
jb 0x17cc4f
movl (%rax), %esi
cmpl %ecx, %esi
ja 0x17cc4f
cmpl %edx, %esi
jb 0x17cc4f
movl $0x1, %eax
jmp 0x17cc58
orl $-0x1, (%r10)
orl $-0x1, (%rax)
xorl %eax, %eax
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: extend_batch(ul_ov_t*, long, long, long*, long*, long*, long*)
void extend_batch(ul_ov_t *z, int64_t ql, int64_t tl, int64_t *rqs, int64_t *rqe, int64_t *rts, int64_t *rte)
{
	int64_t q0, t0, q1, t1;
	(*rqs) = (*rqe) = (*rts) = (*rte) = -1;
	if(!(z->rev)) {
		q0 = z->qs; t0 = z->ts;
		if(q0 <= t0) {
			(*rqs) = z->qs - q0; (*rts) = z->ts - q0;
		} else {
			(*rqs) = z->qs - t0; (*rts) = z->ts - t0;
		}

		q1 = ql - z->qe; t1 = tl - z->te;
		if(q1 <= t1) {
			(*rqe) = z->qe + q1; (*rte) = z->te + q1;
		} else {
			(*rqe) = z->qe + t1; (*rte) = z->te + t1;
		}
	} else {
		q0 = z->qs; t0 = tl - z->te;
		if(q0 <= t0) {
			(*rqs) = z->qs - q0; (*rte) = z->te + q0;
		} else {
			(*rqs) = z->qs - t0; (*rte) = z->te + t0;
		}

		q1 = ql - z->qe; t1 = z->ts;
		if(q1 <= t1) {
			(*rqe) = z->qe + q1; (*rts) = z->ts - q1;
		} else {
			(*rqe) = z->qe + t1; (*rts) = z->ts - t1;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x20(%rsp), %rax
orq $-0x1, (%rax)
orq $-0x1, (%r9)
orq $-0x1, (%r8)
orq $-0x1, (%rcx)
cmpl $0x0, 0x18(%rdi)
movl 0x4(%rdi), %r10d
js 0x17eafc
movl 0x10(%rdi), %r11d
movq %r10, %rbx
subq %r11, %rbx
movq %r11, %r14
subq %r10, %r14
xorl %r15d, %r15d
cmpl %r11d, %r10d
cmovbeq %r15, %rbx
cmovaq %r15, %r14
movq %rbx, (%rcx)
movq %r14, (%r9)
movl 0x8(%rdi), %ecx
movl 0x14(%rdi), %edi
movq %rsi, %r9
subq %rcx, %r9
movq %rdx, %r10
subq %rdi, %r10
cmpq %r10, %r9
jle 0x17eb3d
addq %rcx, %r10
movq %r10, (%r8)
movq %rdx, (%rax)
jmp 0x17eb4e
movl 0x14(%rdi), %r11d
movq %rdx, %rbx
subq %r11, %rbx
addq %r10, %r11
xorl %r14d, %r14d
subq %rbx, %r10
cmovgq %r10, %r14
cmovgq %rdx, %r11
movq %r14, (%rcx)
movq %r11, (%rax)
movl 0x8(%rdi), %eax
movl 0x10(%rdi), %ecx
movq %rsi, %rdi
subq %rax, %rdi
movq %rcx, %rdx
subq %rdi, %rdx
jge 0x17eb48
addq %rax, %rcx
movq %rcx, (%r8)
andq $0x0, (%r9)
jmp 0x17eb4e
movq %rsi, (%r8)
addq %rdi, %r9
movq %r9, (%rax)
jmp 0x17eb4e
movq %rsi, (%r8)
movq %rdx, (%r9)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: check_ul_ov_t_consist(ul_ov_t*, ul_ov_t*, long, long, double)
uint64_t check_ul_ov_t_consist(ul_ov_t *x, ul_ov_t *y, int64_t ql, int64_t tl, double diff)
{
	if(x->qn == y->qn && x->tn == y->tn && x->rev == y->rev) {
		int64_t xqs, xqe, xts, xte, yqs, yqe, yts, yte, os, oe, ovlp;
		extend_batch(x, ql, tl, &xqs, &xqe, &xts, &xte);
		extend_batch(y, ql, tl, &yqs, &yqe, &yts, &yte);

		os = MAX(xqs, yqs); oe = MIN(xqe, yqe);
		if(oe <= os) return 0;
		ovlp = oe - os;
		if(ovlp <= ((xqe-xqs)*(1-diff))) return 0;
		if(ovlp <= ((yqe-yqs)*(1-diff))) return 0;

		os = MAX(xts, yts); oe = MIN(xte, yte);
		if(oe <= os) return 0;
		if(ovlp <= ((xte-xts)*(1-diff))) return 0;
		if(ovlp <= ((yte-yts)*(1-diff))) return 0;
		return 1;
	}
	return 0;
}

// Assembly:
movl (%rdi), %eax
cmpl (%rsi), %eax
jne 0x17eca4
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r15
movl 0xc(%rdi), %eax
cmpl 0xc(%rsi), %eax
jne 0x17eca7
movl 0x18(%r15), %eax
xorl 0x18(%rdi), %eax
js 0x17eca7
movq %rcx, %rbx
movq %rdx, %r14
movsd %xmm0, 0x10(%rsp)
leaq 0x28(%rsp), %rax
movq %rax, (%rsp)
leaq 0x50(%rsp), %r12
leaq 0x38(%rsp), %r8
leaq 0x30(%rsp), %r9
movq %rdx, %rsi
movq %rcx, %rdx
movq %r12, %rcx
callq 0x17ea92
leaq 0x18(%rsp), %rax
movq %rax, (%rsp)
leaq 0x48(%rsp), %rbp
leaq 0x40(%rsp), %r13
leaq 0x20(%rsp), %r9
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
movq %r13, %r8
callq 0x17ea92
movq (%r12), %rdx
movq (%rbp), %rax
cmpq %rax, %rdx
movq %rax, %r8
cmovgq %rdx, %r8
leaq 0x38(%rsp), %rcx
movq (%rcx), %rsi
movq (%r13), %rcx
cmpq %rcx, %rsi
movq %rcx, %rdi
cmovlq %rsi, %rdi
subq %r8, %rdi
jle 0x17eca7
cvtsi2sd %rdi, %xmm0
subq %rdx, %rsi
cvtsi2sd %rsi, %xmm2
movsd 0x64674(%rip), %xmm1    # 0x1e32a0
subsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
jae 0x17eca7
subq %rax, %rcx
cvtsi2sd %rcx, %xmm2
mulsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
jae 0x17eca7
movq 0x30(%rsp), %rdx
movq 0x20(%rsp), %rax
cmpq %rax, %rdx
movq %rax, %rdi
cmovgq %rdx, %rdi
movq 0x28(%rsp), %rsi
movq 0x18(%rsp), %rcx
cmpq %rcx, %rsi
movq %rcx, %r8
cmovlq %rsi, %r8
cmpq %rdi, %r8
jle 0x17eca7
subq %rdx, %rsi
cvtsi2sd %rsi, %xmm2
mulsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
jae 0x17eca7
subq %rax, %rcx
cvtsi2sd %rcx, %xmm2
mulsd %xmm2, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
setb %al
jmp 0x17eca9
xorl %eax, %eax
retq
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: full_lst_set(emask_t*, unsigned long, ul_ov_t*, unsigned long, unsigned long)
void full_lst_set(emask_t *a, uint64_t a_n, ul_ov_t *sa, uint64_t sn, uint64_t skip_n)
{
	uint64_t ff = 0, k, i; int64_t sql, stl, os, oe, ovlp;
	if(sn == 0 && skip_n == 0) {
		ff = 1;
	} else if(skip_n > 0) {
		ff = 0;
	} else {///sn > 0 && skip_n == 0
		for (k = 0; k < sn; k++) {
			sql = sa[k].qe - sa[k].qs;
			stl = sa[k].te - sa[k].ts;
			for (i = 0; i < a_n && sql > 0 && stl > 0; i++) {
				os = MAX(sa[k].qs, a[i].qs); oe = MIN(sa[k].qe, a[i].qe);
				ovlp = ((oe>os)?(oe-os):(0)); sql -= ovlp;

				os = MAX(sa[k].ts, a[i].ts); oe = MIN(sa[k].te, a[i].te);
				ovlp = ((oe>os)?(oe-os):(0)); stl -= ovlp;
			}
			if((sql > 256) && (sql > ((sa[k].qe - sa[k].qs)*0.06))) break;
			if((sql <= 256) && (sql > ((sa[k].qe - sa[k].qs)*0.6))) break;
			if((stl > 256) && (stl > ((sa[k].te - sa[k].ts)*0.06))) break;
			if((stl <= 256) && (stl > ((sa[k].te - sa[k].ts)*0.6))) break;
		}
		if(k < sn) ff = 0;
		else ff = 1;
	}
	for (k = 0; k < a_n; k++) a[k].full = ff;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, -0x20(%rsp)
movb $0x40, %al
movq %r8, %rdx
movq %rcx, -0x18(%rsp)
orq %rcx, %rdx
je 0x18009a
testq %r8, %r8
je 0x1800be
xorl %eax, %eax
addq $0x1c, %rdi
subq $0x1, %rsi
jb 0x1800b3
movb (%rdi), %cl
andb $-0x41, %cl
orb %al, %cl
movb %cl, (%rdi)
addq $0x20, %rdi
jmp 0x18009e
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18(%rdi), %rcx
movq %rcx, -0x28(%rsp)
xorl %r9d, %r9d
movsd 0x634e6(%rip), %xmm0    # 0x1e35b8
movsd 0x633fe(%rip), %xmm1    # 0x1e34d8
xorl %ecx, %ecx
cmpq -0x18(%rsp), %rcx
je 0x18009a
movq %rcx, -0x30(%rsp)
imulq $0x1c, %rcx, %rcx
movq -0x20(%rsp), %rdx
movl 0x4(%rdx,%rcx), %ebp
movl 0x8(%rdx,%rcx), %r15d
movl %r15d, %r14d
subl %ebp, %r14d
movl 0x14(%rdx,%rcx), %r12d
movl 0x10(%rdx,%rcx), %r13d
movl %r12d, %ebx
subl %r13d, %ebx
movq -0x28(%rsp), %r10
xorl %ecx, %ecx
movq %r14, -0x8(%rsp)
movq %rbx, -0x10(%rsp)
cmpq %rsi, %rcx
jae 0x180184
testq %r14, %r14
jle 0x180184
testq %rbx, %rbx
jle 0x180184
movl -0xc(%r10), %r8d
movl -0x8(%r10), %edx
cmpl %r8d, %ebp
cmoval %ebp, %r8d
cmpl %edx, %r15d
cmovbl %r15d, %edx
movq %r8, %r11
subq %rdx, %r11
cmpl %r8d, %edx
cmovbeq %r9, %r11
addq %r11, %r14
movl -0x4(%r10), %edx
cmpl %edx, %r13d
cmoval %r13d, %edx
movl (%r10), %r8d
cmpl %r8d, %r12d
cmovbl %r12d, %r8d
movq %rdx, %r11
subq %r8, %r11
cmpl %edx, %r8d
cmovbeq %r9, %r11
addq %r11, %rbx
incq %rcx
addq $0x20, %r10
jmp 0x180121
cvtsi2sdq -0x8(%rsp), %xmm2
cvtsi2sd %r14, %xmm3
cmpq $0x101, %r14            # imm = 0x101
jl 0x18019f
mulsd %xmm0, %xmm2
jmp 0x1801a3
mulsd %xmm1, %xmm2
ucomisd %xmm2, %xmm3
ja 0x180098
cvtsi2sdq -0x10(%rsp), %xmm2
cvtsi2sd %rbx, %xmm3
cmpq $0x101, %rbx            # imm = 0x101
jl 0x1801c8
mulsd %xmm0, %xmm2
jmp 0x1801cc
mulsd %xmm1, %xmm2
ucomisd %xmm2, %xmm3
movq -0x30(%rsp), %rcx
ja 0x180098
incq %rcx
jmp 0x1800dc
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: push_emask0(kv_emask_t*, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, ul_ov_t*)
void push_emask0(kv_emask_t *res, uint64_t q0l, uint64_t t0l, uint64_t e0l, uint64_t q1l, uint64_t t1l, uint64_t e1l,
uint64_t end, uint64_t is_pe, uint64_t minov, ul_ov_t *p)
{
	emask_t *m;
	m = &(res->a[res->n++]); memset(m, 0, sizeof((*m))); 
	m->dir = end; m->pe = is_pe;
	m->tn = p->tn; m->rev = p->rev; m->rn = (uint32_t)-1;
	if(!end) {///left end
		assert(q0l >= minov && t0l >= minov);
		m->el = e0l; 
		m->qs = p->qs; m->qe = p->qs + q0l;
		if(!(m->rev)) {
			m->ts = p->ts; m->te = p->ts + t0l;
		} else {
			m->te = p->te; m->ts = p->te - t0l;
		}
	} else {///right end
		assert(q1l >= minov && t1l >= minov);
		m->el = e1l;
		m->qe = p->qe; m->qs = p->qe - q1l;
		if(!(m->rev)) {
			m->te = p->te; m->ts = p->te - t1l;
		} else {
			m->ts = p->ts; m->te = p->ts + t1l;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x50(%rsp), %r10
movq 0x48(%rsp), %r11
movb 0x40(%rsp), %bpl
movq 0x38(%rsp), %rbx
movq (%rdi), %r14
movq 0x8(%rdi), %r15
leaq 0x1(%r15), %rax
movq %rax, 0x8(%rdi)
shlq $0x5, %r15
leaq (%r14,%r15), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14,%r15)
movups %xmm0, (%r14,%r15)
movl %ebx, %edi
andb $0x1f, %dil
shlb $0x5, %bpl
andb $0x20, %bpl
orb %dil, %bpl
movb %bpl, 0x1c(%r14,%r15)
movl 0xc(%r10), %edi
movl %edi, (%r14,%r15)
movl 0x18(%r10), %edi
movl %edi, %r12d
shrl $0x18, %r12d
andb $-0x80, %r12b
orb %bpl, %r12b
movb %r12b, 0x1c(%r14,%r15)
orl $-0x1, 0x4(%r14,%r15)
testq %rbx, %rbx
je 0x180299
cmpq %r11, %r8
jb 0x1802f0
cmpq %r11, %r9
jb 0x1802f0
movq 0x30(%rsp), %rcx
movl %ecx, 0x8(%rax)
movl 0x8(%r10), %ecx
movl %ecx, 0x10(%rax)
subl %r8d, %ecx
movl %ecx, 0xc(%rax)
testl %edi, %edi
js 0x1802c4
movl 0x14(%r10), %edx
movl %edx, 0x18(%rax)
subl %r9d, %edx
pushq $0x14
jmp 0x1802c1
cmpq %r11, %rsi
jb 0x18030f
cmpq %r11, %rdx
jb 0x18030f
movl %ecx, 0x8(%rax)
movl 0x4(%r10), %ecx
movl %ecx, 0xc(%rax)
addl %ecx, %esi
movl %esi, 0x10(%rax)
testl %edi, %edi
js 0x1802d6
movl 0x10(%r10), %ecx
movl %ecx, 0x14(%rax)
addl %ecx, %edx
pushq $0x18
popq %rcx
jmp 0x1802e4
movl 0x10(%r10), %ecx
movl %ecx, 0x14(%rax)
addl %ecx, %r9d
pushq $0x18
popq %rcx
movl %r9d, %edx
jmp 0x1802e4
movl 0x14(%r10), %esi
movl %esi, 0x18(%rax)
subl %edx, %esi
pushq $0x14
popq %rcx
movl %esi, %edx
movl %edx, (%rax,%rcx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x73ba3(%rip), %rdi     # 0x1f3e9a
leaq 0x71825(%rip), %rsi     # 0x1f1b23
leaq 0x73b11(%rip), %rcx     # 0x1f3e16
movl $0x2f92, %edx           # imm = 0x2F92
callq 0x2110
leaq 0x73ae3(%rip), %rdi     # 0x1f3df9
leaq 0x71806(%rip), %rsi     # 0x1f1b23
leaq 0x73af2(%rip), %rcx     # 0x1f3e16
movl $0x2f89, %edx           # imm = 0x2F89
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: get_emask_ovlp(idx_emask_t*, unsigned int, unsigned int, unsigned int*, unsigned int*)
emask_t* get_emask_ovlp(idx_emask_t *idx, uint32_t qn, uint32_t tn, uint32_t *occ, uint32_t *st)
{
	emask_t *a = NULL; (*occ) = 0; if(st) (*st) = (uint32_t)-1;
	if(qn >= idx->n) return a;
	uint32_t k;
	for (k = 0; k < idx->a[qn].n && idx->a[qn].a[k].tn < tn; k++);
	if(k < idx->a[qn].n && idx->a[qn].a[k].tn == tn) {
		a = idx->a[qn].a + k; if(st) (*st) = k;
		for ((*occ) = k; k < idx->a[qn].n && idx->a[qn].a[k].tn == tn; k++);
		(*occ) = k - (*occ);
		return a;
	}
	return a;
}

// Assembly:
andl $0x0, (%rcx)
testq %r8, %r8
je 0x181479
orl $-0x1, (%r8)
cmpl %esi, 0x8(%rdi)
jbe 0x1814d7
movq (%rdi), %rax
movl %esi, %esi
imulq $0x18, %rsi, %rsi
leaq (%rax,%rsi), %r10
movq 0x8(%rax,%rsi), %rsi
xorl %edi, %edi
movl %edi, %eax
cmpq %rax, %rsi
jbe 0x1814d7
movq (%r10), %r9
shlq $0x5, %rax
movl (%r9,%rax), %r11d
cmpl %edx, %r11d
jae 0x1814ad
incl %edi
jmp 0x181492
jne 0x1814d7
testq %r8, %r8
je 0x1814b7
movl %edi, (%r8)
addq %r9, %rax
movl %edi, (%rcx)
xorl %r8d, %r8d
leal (%rdi,%r8), %r10d
cmpq %r10, %rsi
jbe 0x1814da
shlq $0x5, %r10
cmpl %edx, (%r9,%r10)
jne 0x1814da
incl %r8d
jmp 0x1814bf
xorl %eax, %eax
retq
movl %r8d, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: detect_sysm_graph_bin(idx_emask_t*, unsigned int)
void detect_sysm_graph_bin(idx_emask_t *idx, uint32_t rid)
{
	kv_emask_t *r = &(idx->a[rid]); uint32_t k, an, st; 
	for (k = 0; k < r->n; k++) {
		get_emask_ovlp(idx, r->a[k].tn, rid, &an, &st);
		r->a[k].rn = (uint32_t)-1;
		if(!an) r->a[k].rn = st;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq (%rdi), %rax
movl %esi, 0xc(%rsp)
movl %esi, %ecx
imulq $0x18, %rcx, %rcx
leaq (%rax,%rcx), %r13
movq 0x8(%rax,%rcx), %rbp
xorl %r15d, %r15d
movl %r15d, %r15d
cmpq %r15, %rbp
jbe 0x181555
movq (%r13), %r12
movq %r15, %rbx
shlq $0x5, %rbx
movl (%r12,%rbx), %esi
movq %r14, %rdi
movl 0xc(%rsp), %edx
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
callq 0x18146d
orl $-0x1, 0x4(%r12,%rbx)
cmpl $0x0, 0x14(%rsp)
jne 0x181550
leaq (%r12,%rbx), %rax
addq $0x4, %rax
movl 0x10(%rsp), %ecx
movl %ecx, (%rax)
incl %r15d
jmp 0x181508
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq