// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: worker_for_trans_ovlp_mmhap_adv(void*, long, int)
static void worker_for_trans_ovlp_mmhap_adv(void *data, long i, int tid) // callback for kt_for()
{
    ug_trans_t *s = (ug_trans_t*)data;
    ha_ovec_buf_t *b = s->hab[tid]; kv_ul_ov_t *bl = &(s->ll[tid].tk);
	uint32_t high_occ = asm_opt.polyploidy + 1; uint64_t cnt;
	char *seq = s->ug->u.a[i].s; int64_t len = s->ug->u.a[i].len;
	if((!s->is_ovlp) && (s->is_cnt)) s->idx_n.a[i] = 0;
	if(s->ug->g->seq[i].del) return;
	if(is_mmhom_node(s->ccov->cov.a+s->ccov->idx[i], &(s->ug->u.a[i]), s->ccov->rg, s->ccov->hom_min, 0.9)) return;
	// asprintf(&as, "\n[M::%s] rid::%ld, len::%lu, name::%.*s\n", __func__, s->id+i, s->len[i], (int32_t)UL_INF.nid.a[s->id+i].n, UL_INF.nid.a[s->id+i].a);
    // push_vlog(&(overall_zdbg->a[s->id+i]), as); free(as); as = NULL;

	if(!s->is_ovlp) {
		if(s->is_cnt) {
			s->idx_n.a[i] = ug_map_lchain(b->abl, i, seq, len, s->w, s->k, &(s->udb), NULL, NULL, s->bw_thres, s->bw_thres_double,
            	s->max_n_chain, 1, NULL, &(b->tmp_region), NULL, &(b->sp), &high_occ, NULL, 0, 1, 0.2, 3, s->is_HPC, NULL, 0, NULL, 0, s->mini_cut, s->chain_cut, NULL);
		} else {
			cnt = ug_map_lchain(b->abl, i, seq, len, s->w, s->k, &(s->udb), NULL, NULL, s->bw_thres, s->bw_thres_double,
				s->max_n_chain, 1, NULL, &(b->tmp_region), NULL, &(b->sp), &high_occ, NULL, 0, 1, 0.2, 3, s->is_HPC, s->idx_a.a + s->idx_n.a[i], 0, NULL, 0, s->mini_cut, s->chain_cut, NULL);
			assert(cnt == ((s->idx_n.a[i+1]-s->idx_n.a[i])));
		}
		if(s->free_cnt[tid] >= FREE_BATCH) {
			clear_count_buf(s, tid, 1); s->free_cnt[tid] = 0;
		}
		s->free_cnt[tid]++;
		return;
	} 

	// if(i == 58) {
	// 	fprintf(stderr, "\n-1-[M::%s] utg%.6u%c, rid::%ld, is_ovlp::%d, is_cnt::%d, len::%ld, str::%u\n", 
	// 		__func__, (uint32_t)i+1, "lc"[s->ug->u.a[i].circ], i, s->is_ovlp, s->is_cnt, len, (uint32_t)(!!seq));
	// }

	if(!gen_trans_adaptive_mmhap_aln(s, i, b, bl, seq, len, s->filter, s->diff_ec_ul, s->diff_ec_ul_double, s->bw_thres, s->bw_thres_double)) {
		gen_trans_adaptive_mmhap_aln(s, i, b, bl, seq, len, NULL, s->diff_ec_ul_double, s->diff_ec_ul_double, s->bw_thres_double, s->bw_thres_double);
	}
	if(s->free_cnt[tid] >= FREE_BATCH) {
		clear_count_buf(s, tid, 0); s->free_cnt[tid] = 0;
	}
	s->free_cnt[tid]++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %r15
movq %rdi, %r14
movl %edx, 0xb8(%rsp)
movslq %edx, %rcx
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rbx
movq %rcx, 0xd0(%rsp)
movq (%rax,%rcx,8), %rbp
leaq 0xab44a(%rip), %rax     # 0x295758
movl 0x1bc(%rax), %eax
incl %eax
movl %eax, 0xbc(%rsp)
movq 0x8(%rdi), %rdx
movq 0x10(%rdx), %rax
leaq (%rsi,%rsi,4), %rcx
movq 0x20(%rax,%rcx,8), %rsi
movq %rsi, 0xc8(%rsp)
movl (%rax,%rcx,8), %r13d
movl 0xb8(%rdi), %r12d
testl %r12d, %r12d
jne 0x1ea35f
cmpl $0x0, 0xb4(%r14)
je 0x1ea35f
movq 0x88(%r14), %rsi
movq $0x0, (%rsi,%r15,8)
movq 0x18(%rdx), %rdx
movq 0x20(%rdx), %rdx
cmpl $0x0, (%rdx,%r15,8)
js 0x1ea6ba
leaq (%rax,%rcx,8), %rsi
movq 0x108(%r14), %rax
movq 0x8(%rax), %rdx
movq 0x10(%rax), %rcx
movq (%rcx,%r15,8), %rdi
shlq $0x3, %rdi
addq 0x28(%rax), %rdi
movq 0x30(%rax), %rcx
movsd 0x4725b(%rip), %xmm0    # 0x2315f8
callq 0x1c527b
testl %eax, %eax
jne 0x1ea6ba
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
testl %r12d, %r12d
je 0x1ea47e
movq 0xd0(%rsp), %r12
imulq $0x68, %r12, %rax
leaq (%rbx,%rax), %rcx
addq $0x18, %rcx
movq 0xf8(%r14), %rax
movsd 0x38(%r14), %xmm2
movsd 0x40(%r14), %xmm0
movsd 0x58(%r14), %xmm1
movsd 0x50(%r14), %xmm3
movq %rax, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %rcx, 0xc0(%rsp)
movq 0xc8(%rsp), %r8
movq %r13, %r9
callq 0x1c6c90
testq %rax, %rax
jne 0x1ea452
movsd 0x50(%r14), %xmm2
movsd 0x58(%r14), %xmm0
movq $0x0, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq 0xc0(%rsp), %rcx
movq 0xc8(%rsp), %r8
movq %r13, %r9
movaps %xmm0, %xmm1
movaps %xmm2, %xmm3
callq 0x1c6c90
movq 0x100(%r14), %rax
movl (%rax,%r12,4), %ecx
cmpl $0x10, %ecx
jb 0x1ea6b4
leaq 0x100(%r14), %rbx
movq %r14, %rdi
movl 0xb8(%rsp), %esi
xorl %edx, %edx
jmp 0x1ea6a2
movq %r13, 0xc0(%rsp)
leaq 0xc8(%r14), %rax
leaq 0x121a0(%rbp), %rcx
cmpl $0x0, 0xb4(%r14)
leaq 0x12250(%rbp), %rsi
movq 0xe8(%rbp), %rdi
movslq 0x30(%r14), %r8
movslq 0x34(%r14), %r9
movsd 0x38(%r14), %xmm0
movsd 0x50(%r14), %xmm1
movl 0x60(%r14), %edx
movl 0xa0(%r14), %r10d
je 0x1ea590
movslq 0xbc(%r14), %r11
movslq 0xc0(%r14), %rbx
xorl %r12d, %r12d
movq %r12, 0xa8(%rsp)
movq %rbx, 0xa0(%rsp)
movq %r11, 0x98(%rsp)
xorps %xmm2, %xmm2
movups %xmm2, 0x88(%rsp)
movups %xmm2, 0x78(%rsp)
movl %r10d, 0x70(%rsp)
movl $0x1, %r10d
movl %r10d, 0x60(%rsp)
movq %r12, 0x50(%rsp)
leaq 0xbc(%rsp), %r11
movq %r11, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %r12, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movq %r12, 0x28(%rsp)
movl %r10d, 0x20(%rsp)
movl %edx, 0x18(%rsp)
movups %xmm2, 0x8(%rsp)
movq %rax, (%rsp)
movl $0x3, 0x68(%rsp)
movl $0x0, 0x58(%rsp)
movsd 0x47018(%rip), %xmm2    # 0x231580
movl %r15d, %esi
movq 0xc8(%rsp), %rdx
movq 0xc0(%rsp), %rcx
callq 0x13470d
movq 0x88(%r14), %rcx
movq %rax, (%rcx,%r15,8)
jmp 0x1ea674
movq 0x88(%r14), %r11
movq (%r11,%r15,8), %r11
leaq (%r11,%r11,2), %r11
shlq $0x3, %r11
addq 0x70(%r14), %r11
movslq 0xbc(%r14), %rbx
movslq 0xc0(%r14), %r12
xorl %ebp, %ebp
movq %rbp, 0xa8(%rsp)
movq %r12, 0xa0(%rsp)
movq %rbx, 0x98(%rsp)
movq %rbp, 0x90(%rsp)
xorps %xmm2, %xmm2
movups %xmm2, 0x80(%rsp)
movq %r11, 0x78(%rsp)
movl %r10d, 0x70(%rsp)
movl $0x1, %r10d
movl %r10d, 0x60(%rsp)
movq %rbp, 0x50(%rsp)
leaq 0xbc(%rsp), %r11
movq %r11, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rbp, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movq %rbp, 0x28(%rsp)
movl %r10d, 0x20(%rsp)
movl %edx, 0x18(%rsp)
movups %xmm2, 0x8(%rsp)
movq %rax, (%rsp)
movl $0x3, 0x68(%rsp)
movl $0x0, 0x58(%rsp)
movsd 0x46f39(%rip), %xmm2    # 0x231580
movl %r15d, %esi
movq 0xc8(%rsp), %rdx
movq 0xc0(%rsp), %rcx
callq 0x13470d
movq 0x88(%r14), %rcx
movq 0x8(%rcx,%r15,8), %rdx
subq (%rcx,%r15,8), %rdx
cmpq %rdx, %rax
jne 0x1ea6cc
movq 0x100(%r14), %rax
movq 0xd0(%rsp), %r12
movl (%rax,%r12,4), %ecx
cmpl $0x10, %ecx
jb 0x1ea6b4
leaq 0x100(%r14), %rbx
movq %r14, %rdi
movl 0xb8(%rsp), %esi
movl $0x1, %edx
callq 0x1c6253
movq (%rbx), %rax
movl $0x0, (%rax,%r12,4)
xorl %ecx, %ecx
incl %ecx
movl %ecx, (%rax,%r12,4)
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5abbb(%rip), %rdi     # 0x24528e
leaq 0x55581(%rip), %rsi     # 0x23fc5b
leaq 0x5ac69(%rip), %rcx     # 0x24534a
movl $0x2988, %edx           # imm = 0x2988
callq 0x2110