LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: get_trans_ul_ov_t(ug_trans_t*, unsigned int, unsigned int)
ul_ov_t* get_trans_ul_ov_t(ug_trans_t *s, uint32_t qn, uint32_t tn)
{
	ha_mzl_t *f = &(s->srt_a.a[qn]);
	if(!(f->rev)) return NULL;
	kv_ul_ov_t *bl = &(s->ll[(uint32_t)(f->x)].tk);
	uint64_t k = f->rid; k <<= 32; k += f->pos;
	// if(!(bl->a[k].qn == (f->x>>32))) {
	// 	fprintf(stderr, "[M::%s::] k::%lu, qn::%u, tn::%u, x>>32::%lu, (uint32_t)x::%u\n", 
	// 	__func__, k, qn, tn, (f->x>>32), (uint32_t)(f->x));
	// }
	// if(!(bl->a[k].qn == (f->x>>32))) {
	// 	fprintf(stderr, "[M::%s::] k::%lu, bl->a[k].qn::%u, (f->x>>32)::%lu, (uint32_t)(f->x)::%u\n", 
	// 				__func__, k, bl->a[k].qn, (f->x>>32), (uint32_t)(f->x));
	// }
	assert(bl->a[k].qn == (f->x>>32));
	for (; (k < bl->n) && (bl->a[k].qn == (f->x>>32)); k++) {
		if(bl->a[k].qn == bl->a[k].tn) continue;
		if(bl->a[k].tn == tn) return &(bl->a[k]);
	}
	return NULL;
}

// Assembly:
pushq %rax
movq 0x98(%rdi), %rcx
movl %esi, %eax
imulq $0x18, %rax, %rsi
movq 0x8(%rcx,%rsi), %rax
testl %eax, %eax
js 0x18157f
xorl %eax, %eax
popq %rcx
retq
addq %rsi, %rcx
movq 0x20(%rdi), %rsi
movq (%rcx), %r9
movl %r9d, %ecx
imulq $0x68, %rcx, %r8
movq %rax, %rcx
rolq $0x20, %rcx
movq 0x18(%rsi,%r8), %rdi
imulq $0x1c, %rcx, %rcx
movl (%rdi,%rcx), %ecx
shrq $0x20, %r9
cmpl %ecx, %r9d
jne 0x181624
addq %r8, %rsi
addq $0x18, %rsi
movl %eax, %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
shlq $0x20, %r8
movq %rax, %r9
shrq $0x20, %r9
movq 0x8(%rsi), %rsi
movabsq $0x1c00000000, %r10     # imm = 0x1C00000000
imulq %rax, %r10
imulq $0x1c, %r9, %rax
addq %r10, %rax
addq %rdi, %rax
addq $-0x1c, %rax
leaq (%r9,%r8), %rdi
decq %rdi
incq %rdi
cmpq %rsi, %rdi
jae 0x18157b
movl 0x1c(%rax), %r8d
cmpl %r8d, %ecx
jne 0x18157b
movl 0x28(%rax), %r9d
addq $0x1c, %rax
cmpl %r9d, %r8d
sete %r8b
cmpl %edx, %r9d
setne %r9b
orb %r8b, %r9b
jne 0x1815ef
jmp 0x18157d
leaq 0x7294e(%rip), %rdi     # 0x1f3f79
leaq 0x704f1(%rip), %rsi     # 0x1f1b23
leaq 0x7295a(%rip), %rcx     # 0x1f3f93
movl $0x310a, %edx           # imm = 0x310A
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: get_utepdat_t_mem(utepdat_t const*, long)
int64_t get_utepdat_t_mem(const utepdat_t *b, int64_t is_print)
{
	int64_t i, mem[7] = {0}, tt[6] = {0};
	for (i = 0; i < b->n_thread; i++) {
		get_utepdat_t_mem_tid(b, i, tt, NULL);
		mem[0] += tt[0]; mem[1] += tt[1]; mem[2] += tt[2]; mem[3] += tt[3]; mem[4] += tt[4]; mem[5] += tt[5];
	}

	for (i = 0; i < b->n; ++i) mem[6] += b->len[i];
	mem[6] += (sizeof(*(b->len))*b->n) + (sizeof(*(b->seq))*b->n);
	if(is_print) {
		for (i = 0; i < 7; i++) {
			fprintf(stderr, "[M::%s] size of buffer[%ld]: %.3fGB, %.3fKB, %ldB\n", 
				__func__, i, mem[i]/1073741824.0, mem[i]/1048576.0, mem[i]);
		}
	}

	return mem[0] + mem[1] + mem[2] + mem[3] + mem[4] + mem[5] + mem[6];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, 0x10(%rsp)
xorpd %xmm0, %xmm0
leaq 0x20(%rsp), %rax
movapd %xmm0, 0x20(%rax)
movapd %xmm0, 0x10(%rax)
movapd %xmm0, (%rax)
xorl %r9d, %r9d
xorl %ebp, %ebp
xorl %ebx, %ebx
xorl %r12d, %r12d
xorl %r14d, %r14d
xorl %r8d, %r8d
xorl %r15d, %r15d
cmpq 0xc0(%rdi), %r15
movq %r8, (%rsp)
jge 0x18196d
movq %rbx, 0x18(%rsp)
movq %r12, %rbx
movq %r14, %r12
movq %rbp, %r14
movq %r9, %rbp
movq %r15, %rsi
leaq 0x20(%rsp), %rdx
xorl %ecx, %ecx
movq %rdi, %r13
callq 0x1726d2
movq %r13, %rdi
movq %rbp, %r9
movq %r14, %rbp
movq %r12, %r14
movq %rbx, %r12
movq 0x18(%rsp), %rbx
movq (%rsp), %r8
addq 0x20(%rsp), %r8
addq 0x28(%rsp), %r14
addq 0x30(%rsp), %r12
addq 0x38(%rsp), %rbx
addq 0x40(%rsp), %rbp
addq 0x48(%rsp), %r9
incq %r15
jmp 0x181902
movq %r14, 0x58(%rsp)
movq %r12, 0x60(%rsp)
movq %rbx, 0x68(%rsp)
movq %rbp, 0x70(%rsp)
movq %r9, 0x78(%rsp)
movq %r8, 0x50(%rsp)
movslq 0x38(%rdi), %rax
xorl %r13d, %r13d
testq %rax, %rax
movl $0x0, %ecx
cmovgq %rax, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x1819b2
movq 0x48(%rdi), %rsi
addq (%rsi,%rdx,8), %r13
incq %rdx
jmp 0x1819a0
shlq $0x4, %rax
addq %rax, %r13
movq %r13, 0x80(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x181a21
xorl %r15d, %r15d
movq %r9, 0x8(%rsp)
cmpq $0x7, %r15
je 0x181a21
movq 0x50(%rsp,%r15,8), %r8
cvtsi2sd %r8, %xmm1
movq 0xd15f8(%rip), %rax     # 0x252fe0
movq (%rax), %rdi
movapd %xmm1, %xmm0
mulsd 0x61211(%rip), %xmm0    # 0x1e2c08
mulsd 0x70049(%rip), %xmm1    # 0x1f1a48
leaq 0x725ca(%rip), %rsi     # 0x1f3fd0
leaq 0x725f6(%rip), %rdx     # 0x1f4003
movq %r15, %rcx
movb $0x2, %al
callq 0x22b0
movq 0x8(%rsp), %r9
incq %r15
jmp 0x1819d1
movq (%rsp), %rax
addq %r13, %rax
addq %r12, %r14
addq %rax, %r14
addq %rbp, %rbx
addq %r9, %rbx
addq %r14, %rbx
movq %rbx, %rax
addq $0x88, %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: alignment_ul_pipeline(uldat_t*, enzyme const*)
int alignment_ul_pipeline(uldat_t* sl, const enzyme *fn)
{
    double index_time = yak_realtime();
    int i;
    for (i = 0; i < fn->n; i++){
        gzFile fp;
        if ((fp = gzopen(fn->a[i], "r")) == 0) return 0;
        sl->ks = kseq_init(fp);
        kt_pipeline(3, worker_ul_pipeline, sl, 3);
        kseq_destroy(sl->ks);
        gzclose(fp);
    }
	sl->hits.total_base = sl->total_base;
	sl->hits.total_pair = sl->total_pair;
    fprintf(stderr, "[M::%s::%.3f] ==> Qualification\n", __func__, yak_realtime()-index_time);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %r12d, %r12d
callq 0xefea7
movsd %xmm0, (%rsp)
leaq 0x6fc46(%rip), %r15     # 0x1f16b7
pushq $0x3
popq %rbp
movslq 0x8(%r14), %rax
cmpq %rax, %r12
jge 0x181adb
movq 0x10(%r14), %rax
movq (%rax,%r12,8), %rdi
movq %r15, %rsi
callq 0x22d0
testq %rax, %rax
je 0x181aca
movq %rax, %r13
movq %rax, %rdi
callq 0x181b19
movq %rax, 0x48(%rbx)
movl %ebp, %edi
leaq 0xb5(%rip), %rsi        # 0x181b5f
movq %rbx, %rdx
movl %ebp, %ecx
callq 0xc6979
movq 0x48(%rbx), %rdi
callq 0x181f21
movq %r13, %rdi
callq 0x2390
incq %r12
jmp 0x181a74
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movupd 0x60(%rbx), %xmm0
movupd %xmm0, 0x88(%rbx)
movq 0xd14f1(%rip), %rax     # 0x252fe0
movq (%rax), %rbx
callq 0xefea7
subsd (%rsp), %xmm0
leaq 0x6c85c(%rip), %rsi     # 0x1ee35f
leaq 0x7250b(%rip), %rdx     # 0x1f4015
movq %rbx, %rdi
movb $0x1, %al
callq 0x22b0
pushq $0x1
popq %rax
jmp 0x181acc
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: push_uc_block_t(ug_opt_t const*, kv_ul_ov_t*, char**, unsigned long*, unsigned long)
void push_uc_block_t(const ug_opt_t *uopt, kv_ul_ov_t *z, char **seq, uint64_t *len, uint64_t b_id)
{
	uint64_t k, l, rid;
	for (k = 1, l = 0; k <= z->n; k++) {
        if(k == z->n || z->a[k].qn != z->a[l].qn) {
			rid = b_id + z->a[l].qn;
			// fprintf(stderr, "rid->%lu, b_id->%lu, l->%lu, z->a[l].qn->%u, len[z->a[l].qn]->%lu, seq[z->a[l].qn]->%u\n", rid, b_id, l, z->a[l].qn, len[z->a[l].qn], seq[z->a[l].qn]?1:0);
			append_ul_t(&UL_INF, &rid, NULL, 0, seq[z->a[l].qn], len[z->a[l].qn], z->a + l, k - l, P_CHAIN_COV, uopt, 0);
			// append_ul_t_back(&UL_INF, &rid, NULL, 0, seq[z->a[l].qn], len[z->a[l].qn], z->a + l, k - l, P_CHAIN_COV);
			l = k;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x8(%rsp)
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
pushq $0x1
popq %rbp
pushq $0x1c
popq %rbx
xorl %eax, %eax
cmpq 0x8(%r12), %rbp
ja 0x18201f
movq (%r12), %r10
jne 0x181fb8
imulq $0x1c, %rax, %rcx
movl (%r10,%rcx), %ecx
jmp 0x181fc6
imulq $0x1c, %rax, %rcx
movl (%r10,%rcx), %ecx
cmpl %ecx, (%r10,%rbx)
je 0x182016
imulq $0x1c, %rax, %rdx
addq %rdx, %r10
movl %ecx, %ecx
movq 0x8(%rsp), %rdx
addq %rcx, %rdx
movq %rdx, 0x10(%rsp)
movq (%r15,%rcx,8), %r8
movq (%r14,%rcx,8), %r9
movq %rbp, %r11
subq %rax, %r11
leaq 0xd2327(%rip), %rdi     # 0x254318
leaq 0x10(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movss 0x6fa72(%rip), %xmm0    # 0x1f1a74
pushq $0x0
pushq %r13
pushq %r11
pushq %r10
callq 0x91e5
addq $0x20, %rsp
movq %rbp, %rax
incq %rbp
addq $0x1c, %rbx
jmp 0x181fa1
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: init_ucr_file_t(uldat_t*, char*, unsigned long)
int32_t init_ucr_file_t(uldat_t *sl, char* file, uint64_t mode)
{
	if(mode == 1 || mode == 2) {
		char *gfa_name = (char*)malloc(strlen(file)+25);
		sprintf(gfa_name, "%s.uidx.ucr.bin", file);
		CALLOC(sl->ucr_s, 1); 
		sl->ucr_s->flag = mode;
		sl->ucr_s->fp = fopen(gfa_name, mode==1?"w":"r");
		if (!(sl->ucr_s->fp)) {
			free(gfa_name);
			return 0;
		}
		free(gfa_name);
		return 1;
	}	
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq -0x1(%rdx), %rax
xorl %ebp, %ebp
cmpq $0x1, %rax
ja 0x1820bc
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2090
leaq 0x19(%rax), %rdi
callq 0x2280
movq %rax, %r15
leaq 0x7977c(%rip), %rsi     # 0x1fb7e2
movq %rax, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2050
pushq $0x1
popq %rdi
pushq $0x68
popq %rsi
callq 0x2120
cmpq $0x1, %r14
movq %rax, 0x40(%rbx)
movq %r14, 0x60(%rax)
leaq 0x78610(%rip), %rax     # 0x1fa6a1
leaq 0x6f61f(%rip), %rsi     # 0x1f16b7
cmoveq %rax, %rsi
movq %r15, %rdi
callq 0x2210
movq 0x40(%rbx), %rcx
movq %rax, (%rcx)
xorl %ebp, %ebp
testq %rax, %rax
setne %bpl
movq %r15, %rdi
callq 0x2220
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: destory_ucr_file_t(uldat_t*)
void destory_ucr_file_t(uldat_t *sl)
{
	if(sl->ucr_s) {
		free(sl->ucr_s->u.r_base.a);
		free(sl->ucr_s->u.bb.a);
		free(sl->ucr_s->u.N_site.a);

		fclose(sl->ucr_s->fp);
		free(sl->ucr_s);
		sl->ucr_s = NULL;
	}
}

// Assembly:
movq 0x40(%rdi), %rax
testq %rax, %rax
je 0x182112
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rax), %rdi
callq 0x2220
movq 0x40(%rbx), %rax
movq 0x38(%rax), %rdi
callq 0x2220
movq 0x40(%rbx), %rax
movq 0x40(%rax), %rdi
callq 0x2220
movq 0x40(%rbx), %rax
movq (%rax), %rdi
callq 0x2190
movq 0x40(%rbx), %rdi
callq 0x2220
andq $0x0, 0x40(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: rov2uov(unsigned long, ul_idx_t const*, utg_rid_dt*, uc_block_t*, ul_ov_t*, unsigned int, long)
uint64_t rov2uov(uint64_t rid, const ul_idx_t *uref, utg_rid_dt *ru_map, uc_block_t *rovlp, ul_ov_t *res, uint32_t adjust_rev, int64_t ulid)
{
	uint64_t ori = ru_map->u&1, ts, te;
	if(!ori) {
		ts = rovlp->ts; te = rovlp->te;
	} else {
		ts = uref->r_ug->rg->seq[rid].len - rovlp->te;
		te = uref->r_ug->rg->seq[rid].len - rovlp->ts;
	}
	// if(ulid == 14714) {
	// 	fprintf(stderr, "[M::%s::]\tori::%lu\trovlp->rev::%u\tro_t::[%u, %u)\tt::[%lu, %lu)\toff::%u\n", __func__, 
	// 		ori, rovlp->rev, rovlp->ts, rovlp->te, ts, te, ru_map->off);
	// }
	ts += ru_map->off; te += ru_map->off;
	if(ts >= 0 && te <= uref->ug->g->seq[ru_map->u>>1].len) {
		memset(res, 0, sizeof(*res));
		res->qn = 0; res->qs = rovlp->qs; res->qe = rovlp->qe; 
		res->tn = ru_map->u>>1; res->ts = ts; res->te = te; 
		res->el = rovlp->el; res->rev = (rovlp->rev == ori?0:1);
		if(adjust_rev && res->rev) {///for linear chaining
			res->ts = uref->ug->g->seq[res->tn].len - te;
			res->te = uref->ug->g->seq[res->tn].len - ts;
		}
		return 1;
	} 
	return 0;
	// if(ulid == 14714) {
	// 	fprintf(stderr, "[M::%s::]\tulen::%u\trlen::%u\tro_t::[%u, %u)\tt::[%lu, %lu)\toff::%u\n", __func__, 
	// 		uref->ug->g->seq[res->tn].len, uref->r_ug->rg->seq[rid].len, rovlp->ts, rovlp->te, ts, te, ru_map->off);
	// }
}

// Assembly:
movl (%rdx), %r10d
testb $0x1, %r10b
jne 0x182653
movl 0xc(%rcx), %eax
movl 0x10(%rcx), %r11d
jmp 0x182673
movq 0x28(%rsi), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rax
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
andl (%rax,%rdi,8), %r11d
movl %r11d, %eax
subl 0x10(%rcx), %eax
subl 0xc(%rcx), %r11d
pushq %r14
pushq %rbx
movl %r11d, %r11d
movl 0x4(%rdx), %edi
addq %rdi, %r11
movq (%rsi), %rbx
movq 0x18(%rbx), %rbx
movq 0x20(%rbx), %rbx
movl %r10d, %r14d
shrl %r14d
movl (%rbx,%r14,8), %ebx
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
cmpq %rbx, %r11
jbe 0x1826a6
xorl %eax, %eax
jmp 0x182734
andl $0x1, %r10d
addl %eax, %edi
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%r8)
movups %xmm0, (%r8)
movq 0x4(%rcx), %rax
movq %rax, 0x4(%r8)
movl (%rdx), %edx
shrl %edx
movl %edx, 0xc(%r8)
movl %edi, 0x10(%r8)
movl %r11d, 0x14(%r8)
movl 0x20(%rcx), %eax
shll $0x17, %eax
andl $0x40000000, %eax       # imm = 0x40000000
movl %eax, 0x18(%r8)
movl 0x20(%rcx), %ecx
shrl $0x5, %ecx
andl $0x1, %ecx
xorl %ebx, %ebx
cmpl %ecx, %r10d
setne %bl
shll $0x1f, %ebx
orl %eax, %ebx
movl %ebx, 0x18(%r8)
movabsq $0x1, %rax
testl %r9d, %r9d
je 0x182734
cmpl %ecx, %r10d
je 0x182734
movq (%rsi), %rcx
movq 0x18(%rcx), %rcx
movq 0x20(%rcx), %rcx
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl (%rcx,%rdx,8), %r9d
andl %esi, %r9d
subl %r11d, %r9d
movl %r9d, 0x10(%r8)
andl (%rcx,%rdx,8), %esi
subl %edi, %esi
movl %esi, 0x14(%r8)
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: get_add_cov_score(ul_idx_t const*, long, long, long, long, long, long*)
uint64_t get_add_cov_score(const ul_idx_t *uref, int64_t ps, int64_t pe, int64_t cs, int64_t ce, int64_t uid, int64_t *cov_i)
{
	int64_t os = MAX(ps, cs), oe = MIN(pe, ce);
	int64_t ovlp = ((oe > os)? (oe - os):0);
	// fprintf(stderr, "ovlp:%ld, os:%ld, oe:%ld, ps:%ld, pe:%ld, cs:%ld, ce::%ld\n", ovlp, os, oe, ps, pe, cs, ce);
	if(ovlp > 0) {
		return (os>cs?retrieve_u_cov_region(uref, uid, 0, cs, os, cov_i):0) + 
						(ce>oe?retrieve_u_cov_region(uref, uid, 0, oe, ce, cov_i):0);
	} 

	return retrieve_u_cov_region(uref, uid, 0, cs, ce, cov_i);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movq %r8, %rbx
movq %rdi, %r12
movq 0x40(%rsp), %r14
cmpq %rcx, %rsi
movq %rcx, %r8
cmovgq %rsi, %r8
cmpq %rbx, %rdx
movq %rbx, %rbp
cmovlq %rdx, %rbp
cmpq %r8, %rbp
jle 0x1829a2
movq %rdx, %r13
cmpq %rcx, %rsi
jle 0x1829c3
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r14, %r9
callq 0xa240
movq %rax, %rcx
jmp 0x1829c5
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rbx, %r8
movq %r14, %r9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa240
xorl %ecx, %ecx
cmpq %rbx, %r13
jge 0x1829e8
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rcx, %r15
movq %rbp, %rcx
movq %rbx, %r8
movq %r14, %r9
callq 0xa240
movq %r15, %rcx
jmp 0x1829ea
xorl %eax, %eax
addq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: gen_end_coord(ul_ov_t*, long, long, long*, long*, long*, long*)
void gen_end_coord(ul_ov_t *z, int64_t qlen, int64_t tlen, int64_t *r_qs, int64_t *r_qe, int64_t *r_ts, int64_t *r_te)
{
    int64_t qs, qe, ts, te, qtail, ttail;
    qs = z->qs; qe = z->qe; ts = z->ts; te = z->te;
    if(z->rev) {
        ts = tlen - z->te; te = tlen - z->ts;
    }
    
    if(qs <= ts) {
        ts -= qs; qs = 0;
    } else {
        qs -= ts; ts = 0;
    }

    qtail = qlen - qe; ttail = tlen - te;
    if(qtail <= ttail) {
        qe = qlen; te += qtail;
    }
    else {
        te = tlen; qe += ttail; 
    }

	if(r_qs) (*r_qs) = qs; if(r_qe) (*r_qe) = qe;
	if(r_ts) (*r_ts) = ts; if(r_te) (*r_te) = te;
    if(z->rev) {
        if(r_ts) (*r_ts) = tlen - te; 
		if(r_te) (*r_te) = tlen - ts;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x4(%rdi), %ebx
movl 0x8(%rdi), %r11d
movl 0x10(%rdi), %eax
movl 0x14(%rdi), %r15d
movq %rdx, %r14
subq %r15, %r14
movq %rdx, %r10
subq %rax, %r10
cmpl $0x0, 0x18(%rdi)
cmovnsq %rax, %r14
cmovnsq %r15, %r10
xorl %eax, %eax
movq %r14, %r15
subq %rbx, %r15
cmovgeq %r15, %rax
movq %rsi, %r15
subq %r11, %r15
movq %rdx, %r12
subq %r10, %r12
addq %r15, %r10
addq %r12, %r11
cmpq %r12, %r15
cmovgq %rdx, %r10
cmovleq %rsi, %r11
testq %rcx, %rcx
je 0x183a05
xorl %esi, %esi
subq %r14, %rbx
cmovgq %rbx, %rsi
movq %rsi, (%rcx)
testq %r8, %r8
je 0x183a0d
movq %r11, (%r8)
movq 0x28(%rsp), %rcx
testq %r9, %r9
je 0x183a1a
movq %rax, (%r9)
testq %rcx, %rcx
je 0x183a22
movq %r10, (%rcx)
cmpl $0x0, 0x18(%rdi)
jns 0x183a41
testq %r9, %r9
je 0x183a36
movq %rdx, %rsi
subq %r10, %rsi
movq %rsi, (%r9)
testq %rcx, %rcx
je 0x183a41
subq %rax, %rdx
movq %rdx, (%rcx)
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: is_end_check(unsigned int, ul_ov_t*, asg_t*)
uint32_t is_end_check(uint32_t v, ul_ov_t *z, asg_t *g)
{
	if(v&1) {
		if(z->ts==0) return 1;
	} else {
		if(z->te==g->seq[v>>1].len) return 1;
	}
	
	return 0;
}

// Assembly:
testb $0x1, %dil
jne 0x183a66
movq 0x20(%rdx), %rax
shrl %edi
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl (%rax,%rdi,8), %ecx
cmpl %ecx, 0x14(%rsi)
jne 0x183a6c
pushq $0x1
popq %rax
retq
cmpl $0x0, 0x10(%rsi)
je 0x183a62
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: extend_end_coord(mg_lchain_t*, ul_ov_t*, long, long, long*, long*, long*, long*)
void extend_end_coord(mg_lchain_t *li, ul_ov_t *ui, const int64_t qlen, const int64_t rlen, int64_t *r_qs, int64_t *r_qe, int64_t *r_rs, int64_t *r_re)
{
    int64_t qs = 0, qe = 0, rs = 0, re = 0, rev = 0, qtail = 0, rtail = 0;
	if(li) {
		qs = li->qs; qe = li->qe; rs = li->rs; re = li->re; rev = li->v&1; 
		if(rev) {
			rs = rlen - li->re; re = rlen - li->rs;
		}
	}
	if(ui) {
		qs = ui->qs; qe = ui->qe; rs = ui->ts; re = ui->te; rev = ui->rev; 
		if(rev) {
        rs = rlen - ui->te; re = rlen - ui->ts;
    	}
	}
    
    
    
    if(qs <= rs) {
        rs -= qs; qs = 0;
    } else {
        qs -= rs; rs = 0;
    }

    qtail = qlen - qe; rtail = rlen - re;
    if(qtail <= rtail) {
        qe = qlen; re += qtail;
    }
    else {
        re = rlen; qe += rtail; 
    }

	if(r_qs) (*r_qs) = qs; if(r_qe) (*r_qe) = qe;
	if(r_rs) (*r_rs) = rs; if(r_re) (*r_re) = re;
    if(rev) {
        if(r_rs) (*r_rs) = rlen - re; 
		if(r_re) (*r_re) = rlen - rs;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x18424f
movslq 0x14(%rdi), %r11
movslq 0x18(%rdi), %r10
movslq 0xc(%rdi), %rbx
movslq 0x10(%rdi), %rax
testb $0x1, 0x8(%rdi)
je 0x184259
movabsq $0x1, %rdi
movq %rcx, %r14
subq %rax, %r14
movq %rcx, %rax
subq %rbx, %rax
movq %r14, %rbx
jmp 0x18425b
xorl %r11d, %r11d
xorl %r10d, %r10d
xorl %ebx, %ebx
xorl %eax, %eax
xorl %edi, %edi
testq %rsi, %rsi
je 0x184291
movl 0x4(%rsi), %r11d
movl 0x8(%rsi), %r10d
movl 0x10(%rsi), %ebx
movl 0x14(%rsi), %eax
cmpl $0x0, 0x18(%rsi)
js 0x184278
xorl %edi, %edi
jmp 0x184291
movq %rcx, %rsi
subq %rax, %rsi
movq %rcx, %rax
subq %rbx, %rax
movabsq $0x1, %rdi
movq %rsi, %rbx
xorl %esi, %esi
movq %rbx, %r14
subq %r11, %r14
cmovgeq %r14, %rsi
movq %rdx, %r14
subq %r10, %r14
movq %rcx, %r15
subq %rax, %r15
addq %r14, %rax
addq %r15, %r10
cmpq %r15, %r14
cmovleq %rdx, %r10
cmovgq %rcx, %rax
testq %r8, %r8
je 0x1842cb
xorl %edx, %edx
subq %rbx, %r11
cmovgq %r11, %rdx
movq %rdx, (%r8)
movq 0x20(%rsp), %r8
testq %r9, %r9
je 0x1842d8
movq %r10, (%r9)
movq 0x28(%rsp), %rdx
testq %r8, %r8
je 0x1842e5
movq %rsi, (%r8)
testq %rdx, %rdx
je 0x1842ed
movq %rax, (%rdx)
testq %rdi, %rdi
je 0x18430b
testq %r8, %r8
je 0x184300
movq %rcx, %rdi
subq %rax, %rdi
movq %rdi, (%r8)
testq %rdx, %rdx
je 0x18430b
subq %rsi, %rcx
movq %rcx, (%rdx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: select_mul_way_nodes(mg_pathv_t*, long, vec_sp_node_t*, float, int, unsigned long*)
int64_t select_mul_way_nodes(mg_pathv_t *a, int64_t a_n, vec_sp_node_t *out, float len_dif, int32_t m_pathn, uint64_t *flag)
{
	int64_t i, k, pd, kd, occ, tt = 0; uint32_t pp; mg_pathv_t *p = NULL;
	if(a_n > 1) radix_sort_mg_pathv_t_d_srt(a, a + a_n);
	for (i = 0; i < a_n; i++) {
		p = &(a[i]); pp = (p->d<<1)>>1; pd = out->a[p->pre]->di>>32; occ = 1;
		
		if(p->d&0x80000000) break;
		for (k = 0; k < a_n; k++) {
			if(k == i) continue; ///same alignment
			if(((a[k].d<<1)>>1) == pp) continue; //same path
			if(a[k].v!=p->v) continue;
			kd = out->a[a[k].pre]->di>>32;
			if(kd >= (pd*(1-len_dif)) && kd <= (pd*(1+len_dif))) occ++;
		}
		if(occ >= m_pathn) {
			flag[p->pre] = 1; tt++;
		}
	}

	return tt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x8(%rsp)
movl %ecx, %ebp
movq %rdx, 0x10(%rsp)
movq %rsi, %r15
movq %rdi, %r12
cmpq $0x2, %rsi
jl 0x1844fe
imulq $0xc, %r15, %rsi
addq %r12, %rsi
movq %r12, %rdi
movss %xmm0, (%rsp)
callq 0x158f5f
movss (%rsp), %xmm0
movss 0x5bbca(%rip), %xmm1    # 0x1e00d0
movaps %xmm1, %xmm5
subss %xmm0, %xmm5
addss %xmm1, %xmm0
movslq %ebp, %rax
movq %rax, (%rsp)
xorl %eax, %eax
testq %r15, %r15
movl $0x0, %edx
cmovgq %r15, %rdx
leaq 0x8(%r12), %rbx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
xorl %r9d, %r9d
cmpq %rdx, %r9
je 0x1845ed
imulq $0xc, %r9, %rsi
movl 0x4(%r12,%rsi), %r10d
testl %r10d, %r10d
js 0x1845ed
movq 0x10(%rsp), %rcx
movq (%rcx), %r13
movslq 0x8(%r12,%rsi), %r11
movq (%r13,%r11,8), %rdi
movl 0x4(%rdi), %edi
cvtsi2ss %rdi, %xmm1
leaq (%r12,%rsi), %rbp
movaps %xmm5, %xmm2
mulss %xmm1, %xmm2
mulss %xmm0, %xmm1
movq %rbx, %rsi
xorl %r14d, %r14d
pushq $0x1
popq %rdi
cmpq %r14, %r15
je 0x1845cf
cmpq %r14, %r9
je 0x1845c6
movl -0x4(%rsi), %ecx
andl %r8d, %ecx
cmpl %r10d, %ecx
je 0x1845c6
movl -0x8(%rsi), %ecx
cmpl (%rbp), %ecx
jne 0x1845c6
movslq (%rsi), %rcx
movq (%r13,%rcx,8), %rcx
movl 0x4(%rcx), %ecx
cvtsi2ss %rcx, %xmm3
movaps %xmm2, %xmm4
cmpleps %xmm3, %xmm4
cmpleps %xmm1, %xmm3
andps %xmm4, %xmm3
movd %xmm3, %ecx
andl $0x1, %ecx
addq %rcx, %rdi
incq %r14
addq $0xc, %rsi
jmp 0x184581
cmpq (%rsp), %rdi
jl 0x1845e5
movq 0x8(%rsp), %rcx
movq $0x1, (%rcx,%r11,8)
incq %rax
incq %r9
jmp 0x184534
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: hc_chain_backtrack(long, long const*, unsigned long const*, unsigned long*, unsigned long*, unsigned long*, long*, long*)
int64_t hc_chain_backtrack(int64_t n, const int64_t *f, const uint64_t *p, uint64_t *srt, uint64_t *u, uint64_t *v, 
int64_t *n_u_, int64_t *n_v_)
{
	if(n_u_) *n_u_ = 0; if(n_v_) *n_v_ = 0;
	int64_t i, k, n_v, n_srt, n_v0, n_u, sc;
	if (n == 0) return 0;
	// v[] keeps the peak score up to i; f[] is the score ending at i, not always the peak
	*n_u_ = *n_v_ = 0;	
	for (i = 0, k = 0; i < n; ++i) {
		if(f[i] >= 0) {
			srt[k] = (uint64_t)f[i]; srt[k] <<= 32; srt[k] |= (((uint64_t)i)<<1); k++;
		}
	}
	n_srt = k;
	radix_sort_gfa64(srt, srt + n_srt); ///sort by score

	///from the largest to the smallest
	for (k = n_srt-1, n_v = n_u = 0; k >= 0; --k) { // precompute n_u
		n_v0 = n_v;
		for (i = ((uint32_t)srt[k])>>1; i >= 0 && (srt[i]&1) == 0; i = (p[i]==(uint64_t)-1?-1:p[i])) {
			v[n_v++] = i; srt[i] |= 1;
		}
		if(n_v <= n_v0) continue;
		sc = i < 0? srt[k]>>32: (int64_t)(srt[k]>>32)-f[i]; 
		u[n_u++] = (((uint64_t)sc)<<32) | ((uint64_t)(n_v-n_v0));
	}

	if(n_u_) *n_u_ = n_u; if(n_v_) *n_v_ = n_v;
	return n_u;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq 0x48(%rsp), %rax
movq 0x40(%rsp), %rcx
testq %rcx, %rcx
je 0x184d06
andq $0x0, (%rcx)
testq %rax, %rax
je 0x184d0f
andq $0x0, (%rax)
testq %rdi, %rdi
je 0x184dd7
andq $0x0, (%rax)
andq $0x0, (%rcx)
xorl %eax, %eax
testq %rdi, %rdi
cmovleq %rax, %rdi
xorl %ebp, %ebp
subq $0x1, %rdi
jb 0x184d4f
movq (%r13,%rax,4), %rcx
testq %rcx, %rcx
js 0x184d49
shlq $0x20, %rcx
orq %rax, %rcx
movq %rcx, (%r15,%rbp,8)
incq %rbp
addq $0x2, %rax
jmp 0x184d2b
leaq (%r15,%rbp,8), %rsi
movq %r15, %rdi
movq %r8, %r14
callq 0x156b0d
xorl %edi, %edi
xorl %eax, %eax
movq %rdi, %rcx
testq %rbp, %rbp
jle 0x184dc5
decq %rbp
movl (%r15,%rbp,8), %esi
shrl %esi
leaq (%rbx,%rcx,8), %rdi
xorl %edx, %edx
testq %rsi, %rsi
js 0x184d97
testb $0x1, (%r15,%rsi,8)
jne 0x184d97
movq %rsi, (%rdi,%rdx,8)
orb $0x1, (%r15,%rsi,8)
movq (%r12,%rsi,8), %rsi
incq %rdx
jmp 0x184d79
leaq (%rcx,%rdx), %rdi
cmpq %rcx, %rdi
jle 0x184d62
movl 0x4(%r15,%rbp,8), %edi
testq %rsi, %rsi
js 0x184daf
subq (%r13,%rsi,8), %rdi
addq %rdx, %rcx
shlq $0x20, %rdi
orq %rdx, %rdi
movq %rdi, (%r14,%rax,8)
incq %rax
movq %rcx, %rdi
jmp 0x184d62
movq 0x40(%rsp), %rdx
movq %rax, (%rdx)
movq 0x48(%rsp), %rdx
movq %rcx, (%rdx)
jmp 0x184dd9
xorl %eax, %eax
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: ck_hq_chain(mg_lchain_t*, mg_lchain_t*, ma_ug_t*, ul_idx_t const*, ug_opt_t const*, long, double)
uint64_t ck_hq_chain(mg_lchain_t *li, mg_lchain_t *lj, ma_ug_t *ug, const ul_idx_t *uref, const ug_opt_t *uopt, int64_t bw, double ng_diff_thre)
{
	if(lj->qe+G_CHAIN_INDEL <= li->qs) return 0;
	if(lj->qs >= li->qs/**+G_CHAIN_INDEL**/) return 0;
	ul_ov_t ui, uj; int64_t qo, share
;	set_ul_ov_t_by_mg_lchain_t(&ui, li); set_ul_ov_t_by_mg_lchain_t(&uj, lj);
	qo = infer_rovlp(&ui, &uj, NULL, NULL, NULL, ug); ///overlap length in query (UL read)
	if(li->v!=lj->v && get_ecov_adv(uref, uopt, li->v^1, lj->v^1, bw, ng_diff_thre, qo, 0, &share)) {
		return 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r15
movl 0x18(%rsi), %ecx
subl $-0x80, %ecx
movl 0x14(%rdi), %eax
cmpl %eax, %ecx
jle 0x184e98
movq %rsi, %r12
cmpl %eax, 0x14(%rsi)
jge 0x184e98
movq %r9, %rbx
movq %r8, %r14
movq %rdx, %rbp
movq %rdi, %r13
movsd %xmm0, (%rsp)
leaq 0x2c(%rsp), %rdi
movq %r13, %rsi
callq 0x16bf75
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x16bf75
leaq 0x2c(%rsp), %rdi
leaq 0x10(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rbp, %r9
callq 0x3d261
movl 0x8(%r13), %edx
movl 0x8(%r12), %ecx
cmpl %ecx, %edx
je 0x184e98
xorl $0x1, %edx
xorl $0x1, %ecx
leaq 0x8(%rsp), %r10
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %r8
movsd (%rsp), %xmm0
movq %rax, %r9
pushq %r10
pushq $0x0
callq 0x1631f5
popq %rcx
popq %rdx
testq %rax, %rax
je 0x184e98
pushq $0x1
popq %rax
jmp 0x184e9a
xorl %eax, %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: debug_gchain2(asg_t const*, mg_pathv_t*, unsigned long)
void debug_gchain2(const asg_t *g, mg_pathv_t *a, uint64_t n)
{
	uint64_t k, i, v, w, nv; asg_arc_t *av;
	for (k = 1; k < n; k++) {
		v = a[k-1].v; w = a[k].v;
		nv = asg_arc_n(g, v); av = asg_arc_a(g, v);
		for (i = 0; i < nv; i++) {
			if(av[i].v == w) break;
		}
		if(i >= nv) {
			// fprintf(stderr, "[M::%s::]\n", __func__);
			fprintf(stderr, "[M::%s::]\tutg%.6dl(%c)\t->\tutg%.6dl(%c)\n", __func__, (int32_t)(v>>1)+1, "+-"[v&1], (int32_t)(w>>1)+1, "+-"[w&1]);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %rbp
leaq 0x5f1df(%rip), %r12     # 0x1e4223
leaq 0x6f495(%rip), %r13     # 0x1f44e0
cmpq %rbx, %rbp
jae 0x1850dd
imulq $0xc, %rbp, %rax
movl -0xc(%r14,%rax), %edx
movl (%r14,%rax), %eax
movq 0x8(%r15), %rsi
movq 0x28(%r15), %rcx
movq (%rcx,%rdx,8), %rdi
movl %edi, %ecx
shrq $0x20, %rdi
imulq $0x18, %rcx, %rcx
addq $0x18, %rcx
imulq $0x18, %rdi, %rdi
addq %rdi, %rsi
addq $0x8, %rsi
xorl %edi, %edi
leaq 0x18(%rdi), %r8
cmpq %r8, %rcx
je 0x18509e
cmpl %eax, (%rsi,%rdi)
movq %r8, %rdi
jne 0x185088
incq %rbp
jmp 0x18504b
movq 0xcdf3b(%rip), %rcx     # 0x252fe0
movq (%rcx), %rdi
movl %edx, %ecx
shrl %ecx
incl %ecx
andl $0x1, %edx
movsbl (%rdx,%r12), %r8d
movl %eax, %r9d
shrl %r9d
incl %r9d
andl $0x1, %eax
movsbl (%rax,%r12), %eax
movl %eax, (%rsp)
leaq 0x6f3e7(%rip), %rsi     # 0x1f44b8
movq %r13, %rdx
xorl %eax, %eax
callq 0x22b0
jmp 0x185099
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: reverse_track(mg_pathv_t*, unsigned long)
void reverse_track(mg_pathv_t *a, uint64_t a_n)
{
	int64_t k, hn = (a_n>>1); mg_pathv_t z;
	for (k = a_n-1; k >= 1; k--) a[k].d -= a[k-1].d;

	for (k = 0; k < hn; k++) {
		z = a[k]; a[k] = a[a_n - k - 1]; a[a_n - k - 1] = z;
		a[k].v ^= 1; a[a_n - k - 1].v ^= 1;
	}
	if(a_n&1) a[k].v ^= 1;
}

// Assembly:
imulq $0xc, %rsi, %rcx
leaq (%rcx,%rdi), %rdx
addq $-0x8, %rdx
leaq -0x1(%rsi), %rax
testq %rax, %rax
jle 0x185111
movl -0xc(%rdx), %r8d
subl %r8d, (%rdx)
addq $-0xc, %rdx
decq %rax
jmp 0x1850fc
movq %rsi, %rax
shrq %rax
addq %rdi, %rcx
addq $-0xc, %rcx
movq %rdi, %rdx
movq %rax, %r8
subq $0x1, %r8
jb 0x18516a
movl 0x8(%rdx), %r9d
movl %r9d, -0x8(%rsp)
movq (%rdx), %r9
movq %r9, -0x10(%rsp)
movl 0x8(%rcx), %r9d
movl %r9d, 0x8(%rdx)
movq (%rcx), %r9
movq %r9, (%rdx)
movq -0x10(%rsp), %r9
movq %r9, (%rcx)
movl -0x8(%rsp), %r9d
movl %r9d, 0x8(%rcx)
xorb $0x1, (%rdx)
xorb $0x1, (%rcx)
addq $-0xc, %rcx
addq $0xc, %rdx
jmp 0x185124
testb $0x1, %sil
je 0x185178
imulq $0xc, %rax, %rax
xorb $0x1, (%rdi,%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: dbg_print(mg_pathv_t*, long)
void dbg_print(mg_pathv_t *a, int64_t a_n)
{
	int64_t k;
	for (k = 0; k < a_n; k++) {
		if(a[k].pre == -2) break;
	}
	
	if(k < a_n) {
		fprintf(stderr, "+[M::%s::] src:utg%.6dl(v:%u), dst:utg%.6dl(v:%u)\n", __func__,
		(int32_t)(a[0].v>>1)+1, a[0].v, (int32_t)(a[a_n-1].v>>1)+1, a[a_n-1].v);
		for (k = 0; k < a_n; k++) {
			fprintf(stderr, "-[M::%s::] utg%.6dl(v:%u), pre:%d, d:%u\n", __func__, (int32_t)(a[k].v>>1)+1, a[k].v, 
			a[k].pre, a[k].d);
		}
	}
	
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorl %r12d, %r12d
testq %rsi, %rsi
cmovgq %rsi, %r12
leaq 0x1(%r12), %rax
leaq 0x8(%rdi), %rcx
decq %rax
je 0x18522b
cmpl $-0x2, (%rcx)
leaq 0xc(%rcx), %rcx
jne 0x18519c
movq 0xcde2b(%rip), %r13     # 0x252fe0
movq (%r13), %rdi
movl (%rbx), %r8d
movl %r8d, %ecx
shrl %ecx
incl %ecx
imulq $0xc, %rsi, %rax
movl -0xc(%rbx,%rax), %eax
movl %eax, %r9d
shrl %r9d
incl %r9d
movl %eax, (%rsp)
leaq 0x6f310(%rip), %rsi     # 0x1f44ee
leaq 0x6f33c(%rip), %r14     # 0x1f4521
movq %r14, %rdx
xorl %eax, %eax
callq 0x22b0
addq $0x8, %rbx
leaq 0x6f331(%rip), %r15     # 0x1f452b
subq $0x1, %r12
jb 0x18522b
movq (%r13), %rdi
movl -0x8(%rbx), %r8d
movl -0x4(%rbx), %eax
movl %r8d, %ecx
shrl %ecx
incl %ecx
movl (%rbx), %r9d
movl %eax, (%rsp)
movq %r15, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x22b0
addq $0xc, %rbx
jmp 0x1851fa
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: print_chain(mg_lchain_t*, unsigned int)
void print_chain(mg_lchain_t *a, uint32_t a_n)
{
	uint32_t k;
	for (k = 0; k < a_n; k++) {
		if(a[k].off!=-1) {
			fprintf(stderr, "%u\t%u\t%c\tutg%.6dl\t%u\t%u\n", 
					a[k].qs, a[k].qe, "+-"[a[k].v&1], (int32_t)(a[k].v>>1)+1, a[k].rs, a[k].re);
		} else {
			fprintf(stderr, "*\t*\t%c\tutg%.6dl\t*\t*\n", "+-"[a[k].v&1], (int32_t)(a[k].v>>1)+1);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, %eax
imulq $0x28, %rax, %r12
movq 0xcdd8c(%rip), %r13     # 0x252fe0
leaq 0x5efc8(%rip), %rbp     # 0x1e4223
leaq 0x6f389(%rip), %r15     # 0x1f45eb
xorl %r14d, %r14d
cmpq %r14, %r12
je 0x1852d7
cmpl $-0x1, (%rbx,%r14)
movq (%r13), %rdi
jne 0x185297
movl 0x8(%rbx,%r14), %ecx
movl %ecx, %eax
andl $0x1, %eax
movsbl (%rax,%rbp), %edx
shrl %ecx
incl %ecx
leaq 0x6f376(%rip), %rsi     # 0x1f4604
xorl %eax, %eax
callq 0x22b0
jmp 0x1852d1
movl 0x14(%rbx,%r14), %edx
movl 0x18(%rbx,%r14), %ecx
movl 0x8(%rbx,%r14), %r9d
movl 0xc(%rbx,%r14), %r10d
movl %r9d, %eax
andl $0x1, %eax
movsbl (%rax,%rbp), %r8d
shrl %r9d
incl %r9d
movl 0x10(%rbx,%r14), %r11d
movq %r15, %rsi
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x22b0
popq %rcx
popq %rdx
addq $0x28, %r14
jmp 0x185265
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: update_exist_chain_adv(ul_idx_t const*, ul_ov_t*, unsigned long*, long, long, mg_lchain_t*)
void update_exist_chain_adv(const ul_idx_t *uref, ul_ov_t *ch, uint64_t *idx, int64_t idx_n, int64_t tid, mg_lchain_t *res)
{
	int64_t i, j, cov_i, sc = 0; memset(res, 0, sizeof(*res));
	ul_ov_t *li, *lj;
	if(idx_n <= 0) return;
	i = 0; 
	res->qs = (ch[idx[i]].qs<<1)>>1; res->qe = ch[idx[i]].qe;
	res->rs = ch[idx[i]].ts; res->re = ch[idx[i]].te;
	for (i = 0; i < idx_n; i++) {
		li = &(ch[idx[i]]); 

		if((int64_t)((li->qs<<1)>>1) < res->qs) res->qs = ((li->qs<<1)>>1); 
		if((int64_t)li->ts < res->rs) res->rs = li->ts;
		if((int64_t)li->qe > res->qe) res->qe = li->qe;
		if((int64_t)li->te > res->re) res->re = li->te;

		cov_i = 0; j = i - 1;
		if(j >= 0) {
			lj = &(ch[idx[j]]); 
			sc += get_add_cov_score(uref, lj->ts, lj->te, li->ts, li->te, tid, &cov_i);
		} else {
			sc += retrieve_u_cov_region(uref, tid, 0, li->ts, li->te, &cov_i);
		}
	}
	res->score = (sc>0x3FFFFFFF?0x3FFFFFFF:sc);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r9)
movups %xmm0, (%r9)
andq $0x0, 0x20(%r9)
testq %rcx, %rcx
jle 0x18666b
movq %r9, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
imulq $0x1c, (%rdx), %rax
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl 0x4(%rsi,%rax), %ecx
andl %edx, %ecx
movl %ecx, 0x14(%r9)
movl 0x8(%rsi,%rax), %ecx
movl %ecx, 0x18(%r9)
movq 0x10(%rsi,%rax), %rax
movq %rax, 0xc(%r9)
xorl %r14d, %r14d
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0x18665c
imulq $0x1c, (%r12,%rbp,8), %rax
movl 0x4(%r13,%rax), %ecx
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl %edx, %ecx
cmpl 0x14(%rbx), %ecx
jge 0x1865d4
movl %ecx, 0x14(%rbx)
addq %r13, %rax
movl 0x10(%rax), %ecx
movslq 0xc(%rbx), %rdx
cmpq %rdx, %rcx
jge 0x1865e6
movl %ecx, 0xc(%rbx)
movl 0x8(%rax), %edx
movslq 0x18(%rbx), %rsi
cmpq %rsi, %rdx
jle 0x1865f5
movl %edx, 0x18(%rbx)
movl 0x14(%rax), %r8d
movslq 0x10(%rbx), %rax
cmpq %rax, %r8
jle 0x186606
movl %r8d, 0x10(%rbx)
andq $0x0, 0x20(%rsp)
testq %rbp, %rbp
je 0x18663b
imulq $0x1c, -0x8(%r12,%rbp,8), %rax
movl 0x10(%r13,%rax), %esi
movl 0x14(%r13,%rax), %edx
leaq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %r9
callq 0x182953
jmp 0x186651
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
xorl %edx, %edx
leaq 0x20(%rsp), %r9
callq 0xa240
addq %rax, %r14
incq %rbp
jmp 0x1865b2
movl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
cmpq %rax, %r14
cmovlq %r14, %rax
movl %eax, 0x1c(%rbx)
addq $0x28, %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: extract_rovlp_by_ug(utg_ct_t*, mg_lchain_t*, vec_mg_lchain_t*, long)
int64_t extract_rovlp_by_ug(utg_ct_t *p, mg_lchain_t* o, vec_mg_lchain_t *chains, int64_t tOff)
{
	int64_t rs, re;
	rs = MAX((int32_t)p->s, o->rs); re = MIN((int32_t)p->e, o->re);
	if(rs > re) return 0;
	mg_lchain_t *x = NULL;
	kv_pushp(mg_lchain_t, *chains, &x); memset(x, 0, sizeof(*x));
	x->v = (p->x>>1)<<1; x->v += (((o->v&1) == (p->x&1))?0:1); x->rs = rs; x->re = re; x->off = tOff; 
	x->hash_pre = (uint32_t)-1; x->dist_pre = -1; x->qs = x->qe = -1;
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl 0x4(%rdi), %eax
movl 0x8(%rdi), %ecx
movl 0xc(%rsi), %ebp
movl 0x10(%rsi), %r13d
cmpl %ebp, %eax
cmovgl %eax, %ebp
cmpl %r13d, %ecx
cmovll %ecx, %r13d
cmpl %r13d, %ebp
jle 0x186ab0
xorl %eax, %eax
jmp 0x186b41
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
movq (%rdx), %rax
movq 0x8(%rdx), %rcx
cmpq 0x10(%rdx), %rcx
jne 0x186aee
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmovneq %rdx, %rcx
movq %rcx, 0x10(%r12)
imulq $0x28, %rcx, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, (%r12)
movq 0x8(%r12), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%r12)
imulq $0x28, %rcx, %rcx
xorps %xmm0, %xmm0
andq $0x0, 0x20(%rax,%rcx)
movups %xmm0, 0x10(%rax,%rcx)
movups %xmm0, (%rax,%rcx)
movl (%r15), %edx
movl %edx, %esi
andl $-0x2, %esi
movl %esi, 0x8(%rax,%rcx)
movl 0x8(%r14), %esi
andl $0x1, %esi
xorl %edx, %esi
movl %esi, 0x8(%rax,%rcx)
movl %ebp, 0xc(%rax,%rcx)
movl %r13d, 0x10(%rax,%rcx)
movl %ebx, (%rax,%rcx)
orq $-0x1, 0x20(%rax,%rcx)
orq $-0x1, 0x14(%rax,%rcx)
pushq $0x1
popq %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: convert_mg_lchain_t(utg_ct_t*, mg_lchain_t*)
int64_t convert_mg_lchain_t(utg_ct_t *p, mg_lchain_t *o)
{
	int64_t rs = p->s, re = p->e;
	rs = MAX(rs, o->rs); re = MIN(re, o->re);
	assert(rs < re);	
	if(!(p->x&1)) {
		o->rs = rs-p->s; o->re = re-p->s;
	} else {
		o->rs = p->e-re; o->re = p->e-rs;
	}
	return 1;
}

// Assembly:
movl 0x4(%rdi), %ecx
movl 0x8(%rdi), %eax
movslq 0xc(%rsi), %r8
cmpq %r8, %rcx
cmovgq %rcx, %r8
movslq 0x10(%rsi), %rdx
cmpq %rdx, %rax
cmovlq %rax, %rdx
cmpq %rdx, %r8
jge 0x1881b2
movl %r8d, %r9d
subl %ecx, %r9d
movl %eax, %r10d
subl %edx, %r10d
subl %ecx, %edx
subl %r8d, %eax
testb $0x1, (%rdi)
cmovel %r9d, %r10d
cmovel %edx, %eax
movl %r10d, 0xc(%rsi)
movl %eax, 0x10(%rsi)
pushq $0x1
popq %rax
retq
pushq %rax
leaq 0x6cd26(%rip), %rdi     # 0x1f4ee0
leaq 0x69962(%rip), %rsi     # 0x1f1b23
leaq 0x6cd20(%rip), %rcx     # 0x1f4ee8
movl $0x3d66, %edx           # imm = 0x3D66
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: g_adjacent_dis_mul(asg_t const*, ma_hit_t_alloc*, long, long, unsigned int, unsigned int)
int64_t g_adjacent_dis_mul(const asg_t *g, ma_hit_t_alloc *src, int64_t max_hang, int64_t min_ovlp, uint32_t v, uint32_t w)
{
	uint32_t i;
	if(g) {
		uint32_t nv; 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;
		}
	}

	if(src) {
		ma_hit_t_alloc *x = &(src[v>>1]); uint32_t qn, tn; 
		int32_t r; asg_arc_t e;
		for (i = 0; i < x->length; i++) {
			qn = Get_qn(x->buffer[i]);
			tn = Get_tn(x->buffer[i]);
			if(qn == (v>>1) && tn == (w>>1)) {
				r = ma_hit2arc(&(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(r < 0) continue;
				if((e.ul>>32) != v || e.v != w) continue;
				return (uint32_t)e.ul;
			}
		}
	}
	
	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r8d, %r14d
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl %r8d, %eax
movq %rax, 0x8(%rsp)
testq %rdi, %rdi
je 0x18849a
movq 0x8(%rdi), %rax
movq 0x28(%rdi), %rcx
movq 0x8(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %edx
shrq $0x20, %rcx
imulq $0x18, %rdx, %rdi
imulq $0x18, %rcx, %rcx
leaq (%rcx,%rax), %r8
addq $0xc, %r8
xorl %edx, %edx
cmpq %rdx, %rdi
je 0x18849a
cmpl $0x0, (%r8,%rdx)
js 0x188494
cmpl %r9d, -0x4(%r8,%rdx)
je 0x18854f
addq $0x18, %rdx
jmp 0x18847d
pushq $-0x1
popq %rax
testq %rsi, %rsi
je 0x188559
shrl %r14d
imulq $0x18, %r14, %rax
leaq (%rsi,%rax), %r13
movl 0xc(%rsi,%rax), %eax
movl %r9d, (%rsp)
movl %r9d, %ebp
shrl %ebp
leaq 0xcbd6b(%rip), %rcx     # 0x254230
movq 0x18(%rcx), %r15
leaq 0xcb288(%rip), %rcx     # 0x253758
movss 0x158(%rcx), %xmm0
movss %xmm0, 0x4(%rsp)
imulq $0x28, %rax, %r12
xorl %ebx, %ebx
cmpq %rbx, %r12
je 0x18854a
movq (%r13), %rdi
movq (%rdi,%rbx), %rax
shrq $0x20, %rax
cmpl %eax, %r14d
jne 0x188544
cmpl %ebp, 0xc(%rdi,%rbx)
jne 0x188544
addq %rbx, %rdi
movl (%r15,%rax,8), %esi
movl (%r15,%rbp,8), %edx
movq 0x10(%rsp), %rcx
movss 0x4(%rsp), %xmm0
movq 0x18(%rsp), %r8
leaq 0x20(%rsp), %r9
callq 0x15d560
testl %eax, %eax
js 0x188544
movq 0x20(%rsp), %rax
movq %rax, %rcx
shrq $0x20, %rcx
cmpl 0x8(%rsp), %ecx
jne 0x188544
movl (%rsp), %ecx
cmpl %ecx, 0x28(%rsp)
je 0x188557
addq $0x28, %rbx
jmp 0x1884e4
pushq $-0x1
popq %rax
jmp 0x188559
addq %rax, %rcx
movl (%rdx,%rcx), %eax
jmp 0x188559
movl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: print_debug_gchain(ul_idx_t const*, mg_lchain_t*, long, ul_vec_t*)
void print_debug_gchain(const ul_idx_t *uref, mg_lchain_t *a, int64_t a_n, ul_vec_t *rch)
{
	int64_t k;
	fprintf(stderr, "\n[M::%s] a_n->%ld\n", __func__, a_n);
	for (k = 0; k < a_n; k++) {
		fprintf(stderr, "[M::%s::k->%ld] utg%.6d%c(%c), qs->%d, qe->%d, rs->%u, re->%u, qlen->%u\n", __func__, k, 
		(int32_t)(a[k].v>>1)+1, "lc"[uref->ug->u.a[(a[k].v>>1)].circ], "+-"[(a[k].v&1)],
		a[k].off<0?-1:a[k].qs, a[k].off<0?-1:a[k].qe, a[k].rs, a[k].re, rch->rlen);
	}
	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, (%rsp)
movq 0xca462(%rip), %rax     # 0x252fe0
movq (%rax), %rdi
leaq 0x6c47d(%rip), %rsi     # 0x1f5005
leaq 0x6c489(%rip), %rdx     # 0x1f5018
xorl %r13d, %r13d
movq %r14, %rcx
xorl %eax, %eax
callq 0x22b0
testq %r14, %r14
cmovleq %r13, %r14
addq $0x18, %r15
xorl %ebp, %ebp
cmpq %rbp, %r14
je 0x188c5a
cmpl $0x0, -0x18(%r15)
pushq $-0x1
popq %rax
movl %eax, %ecx
movl %eax, %r11d
js 0x188bc8
movl -0x4(%r15), %ecx
movl (%r15), %r11d
movq %rcx, 0x10(%rsp)
movq 0xca40c(%rip), %rax     # 0x252fe0
movq (%rax), %rdi
movl -0x10(%r15), %eax
movl %eax, %ecx
shrl %ecx
imulq $0x28, %rcx, %rdx
movl %ecx, %r8d
incl %r8d
movq (%rsp), %rcx
movq (%rcx), %rcx
movq 0x10(%rcx), %rcx
movl (%rcx,%rdx), %ecx
shrl $0x1f, %ecx
leaq 0x5da8a(%rip), %rdx     # 0x1e668b
movsbl (%rcx,%rdx), %r9d
andl $0x1, %eax
leaq 0x5b613(%rip), %rcx     # 0x1e4223
movsbl (%rax,%rcx), %ebx
movl -0xc(%r15), %r13d
movl -0x8(%r15), %r12d
movq 0x8(%rsp), %rax
movl 0x18(%rax), %r10d
leaq 0x6c3ff(%rip), %rsi     # 0x1f502b
leaq 0x6c3e5(%rip), %rdx     # 0x1f5018
movq %rbp, %rcx
xorl %eax, %eax
pushq %r10
pushq %r12
pushq %r13
pushq %r11
pushq 0x30(%rsp)
pushq %rbx
callq 0x22b0
addq $0x30, %rsp
incq %rbp
addq $0x28, %r15
jmp 0x188ba9
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: update_ul_vec_t(ul_idx_t const*, kv_ul_ov_t*, kv_ul_ov_t*, ul_vec_t*, vec_mg_lchain_t*, vec_mg_lchain_t*, long, asg_t const*, Chain_Data*, long, long, long)
void update_ul_vec_t(const ul_idx_t *uref, kv_ul_ov_t *raw_idx, kv_ul_ov_t *raw_chn, ul_vec_t *rch, 
vec_mg_lchain_t *uc, vec_mg_lchain_t *swap, int64_t ulid, const asg_t *rg, Chain_Data* dp, 
int64_t dp_max_skip, int64_t dp_max_iter, int64_t dp_max_dis)
{
	// fprintf(stderr, "\n++[M::%s::%.*s(id:%ld), len:%u]\n", __func__, 
	// UL_INF.nid.a[ulid].n, UL_INF.nid.a[ulid].a, ulid, rch->rlen);

	int64_t k, ucn = uc->n; mg_lchain_t *ix; 
	for (k = 0, swap->n = 0; k < ucn; k += ix->cnt + 1) {
		ix = &(uc->a[k]); assert(ix->v == (uint32_t)-1);
		// if(ulid == 14714) {
		// 	fprintf(stderr, "\n[M::%s::ucn->%ld, k->%ld, kcnt->%d]\n", __func__, ucn, k, ix->cnt);
		// 	print_debug_gchain(uref, uc->a + k + 1, ix->cnt, rch);
		// }
		gen_rovlp_chain_by_ul(rg, rch, uref, raw_idx, raw_chn, uc->a + k + 1, ix->cnt, swap, dp, 
		dp_max_skip, dp_max_iter, dp_max_dis, ulid);
	}

	///up to now, given a <x> in swap
	///x->ts and x->te are the coordinates in unitig (x->score>>1), instead of HiFi read (x->v>>1)
	///x->qs and x->qe are the coordinates in UL
	///x->dist_pre is the idx of this chain at rch 
	// debug_intermediate_chain(uref->ug, swap->a, swap->n);
	dd_ul_vec_t(uref, swap->a, swap->n, rch, ulid);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdi, 0x8(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x88(%rsp), %rbx
movq %r8, %r12
movq 0x8(%r8), %r13
movq %r9, %rbp
andq $0x0, 0x8(%r9)
xorl %r14d, %r14d
cmpq %r13, %r14
jge 0x188d4f
movq (%r12), %r15
imulq $0x28, %r14, %rax
cmpl $-0x1, 0x8(%r15,%rax)
jne 0x188d74
addq %rax, %r15
leaq 0x28(%r15), %r9
movl 0x4(%r15), %eax
shlq $0x21, %rax
sarq $0x21, %rax
subq $0x10, %rsp
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %r8
pushq 0x40(%rsp)
pushq 0x40(%rsp)
pushq 0x40(%rsp)
pushq 0x40(%rsp)
pushq %rbp
pushq %rax
callq 0x187f86
addq $0x40, %rsp
movl 0x4(%r15), %eax
shlq $0x21, %rax
sarq $0x21, %rax
addq %rax, %r14
incq %r14
jmp 0x188cd9
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rcx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x188568
leaq 0x69cc4(%rip), %rdi     # 0x1f2a3f
leaq 0x68da1(%rip), %rsi     # 0x1f1b23
leaq 0x6c2eb(%rip), %rcx     # 0x1f5074
movl $0x3ea5, %edx           # imm = 0x3EA5
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: rov2uov_ctg(unsigned long, ul_idx_t const*, utg_rid_dt*, uc_block_t*, ul_ov_t*, unsigned int, unsigned int)
uint64_t rov2uov_ctg(uint64_t rid, const ul_idx_t *uref, utg_rid_dt *ru_map, uc_block_t *rovlp, ul_ov_t *res, uint32_t qidx, uint32_t adjust_rev)
{
    uint64_t ori = ru_map->u&1, ts, te;
    if(!ori) {
        ts = rovlp->ts; te = rovlp->te;
    } else {
        ts = Get_READ_LENGTH(R_INF, rid) - rovlp->te;
        te = Get_READ_LENGTH(R_INF, rid) - rovlp->ts;
    }
    
    ts += ru_map->pos; te += ru_map->pos;
    if(ts >= 0 && te <= uref->ug->g->seq[ru_map->u>>1].len) {
        memset(res, 0, sizeof(*res));
        res->qn = qidx; res->qs = rovlp->qs; res->qe = rovlp->qe; 
        res->tn = ru_map->u>>1; res->ts = ts; res->te = te; 
        res->el = rovlp->el; res->rev = (rovlp->rev == ori?0:1); res->sec = ru_map->off;
        if(adjust_rev && res->rev) {///for linear chaining
            res->ts = uref->ug->g->seq[ru_map->u>>1].len - te;
            res->te = uref->ug->g->seq[ru_map->u>>1].len - ts;
			res->sec = uref->ug->u.a[ru_map->u>>1].n - ru_map->off;
        }
        return 1;
    } 
    return 0;
}

// Assembly:
movl (%rdx), %r10d
testb $0x1, %r10b
jne 0x1894dd
movl 0xc(%rcx), %eax
movl 0x10(%rcx), %edi
jmp 0x1894f9
leaq 0xcad4c(%rip), %rax     # 0x254230
movq 0x18(%rax), %rax
movq (%rax,%rdi,8), %rax
movl 0xc(%rcx), %r11d
movq %rax, %rdi
subq %r11, %rdi
subl 0x10(%rcx), %eax
pushq %rbp
pushq %r14
pushq %rbx
movl 0x8(%rdx), %r11d
addq %r11, %rdi
movq (%rsi), %rbx
movq 0x18(%rbx), %rbx
movq 0x20(%rbx), %rbx
movl %r10d, %r14d
shrl %r14d
movl (%rbx,%r14,8), %ebx
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
cmpq %rbx, %rdi
jbe 0x18952b
xorl %eax, %eax
jmp 0x1895f5
movl 0x20(%rsp), %ebx
andl $0x1, %r10d
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%r8)
andq $0x0, 0x14(%r8)
movl %r9d, (%r8)
movq 0x4(%rcx), %r9
movq %r9, 0x4(%r8)
movl (%rdx), %r9d
shrl %r9d
movl %r9d, 0xc(%r8)
addl %eax, %r11d
movl %r11d, 0x10(%r8)
movl %edi, 0x14(%r8)
movl 0x20(%rcx), %eax
shll $0x17, %eax
andl $0x40000000, %eax       # imm = 0x40000000
movl %eax, 0x18(%r8)
movl 0x20(%rcx), %r9d
shrl $0x5, %r9d
andl $0x1, %r9d
xorl %ecx, %ecx
cmpl %r9d, %r10d
setne %cl
shll $0x1f, %ecx
orl %eax, %ecx
movl %ecx, 0x18(%r8)
movl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
andl 0x4(%rdx), %eax
orl %ecx, %eax
movl %eax, 0x18(%r8)
movabsq $0x1, %rax
testl %ebx, %ebx
je 0x1895f5
cmpl %r9d, %r10d
je 0x1895f5
movq (%rsi), %rsi
movq 0x18(%rsi), %r9
movq 0x20(%r9), %r9
movl (%rdx), %r10d
shrl %r10d
movl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
movl (%r9,%r10,8), %ebp
andl %ebx, %ebp
subl %edi, %ebp
movl %ebp, 0x10(%r8)
andl (%r9,%r10,8), %ebx
subl %r11d, %ebx
movl %ebx, 0x14(%r8)
movq 0x10(%rsi), %rsi
imulq $0x28, %r10, %rdi
movl 0x10(%rsi,%rdi), %esi
subl 0x4(%rdx), %esi
andl $0x3fffffff, %esi       # imm = 0x3FFFFFFF
orl %ecx, %esi
movl %esi, 0x18(%r8)
popq %rbx
popq %r14
popq %rbp
retq