// File: chhylp123[P]hifiasm/inter.cpp
// Function: worker_for_ul_gchains_alignment(void*, long, int)
static void worker_for_ul_gchains_alignment(void *data, long i, int tid)
{
	ul_vec_t *p = &(UL_INF.a[i]); 
	utepdat_t *s = (utepdat_t*)data; uint32_t ff;
	ff = refine_rid_chain(s->rg, s->buf[tid], p, i);
	// fprintf(stderr, "[M::%s::%.*s(id:%ld), len:%u] ff:%u\n", __func__, 
	// UL_INF.nid.a[i].n, UL_INF.nid.a[i].a, i, p->rlen, ff);
	if(ff == 1) return;
	// if(p->dd == 1) return; //fully aligned
	// if(p->bb.n == 1 && p->bb.a[0].base) return;///no alignment
	// if(p->bb.n == 0) return;///no alignment
	s->hab[tid]->num_read_base++; 
	s->hab[tid]->num_correct_base += direct_gchain(s->buf[tid], p, &(s->ll[tid]), &(s->gdp[tid]), &(s->sps[tid]), &(s->hab[tid]->hap), s->uu, s->uopt, G_CHAIN_BW, s->opt->diff_ec_ul, UG_SKIP, i, &(s->hab[tid]->clist.chainDP), s->rg, ((ff==2)?1:0));
	// gl_chain_refine_advance(&b->olist, &b->correct, &b->hap, bl, s->uu, s->opt->diff_ec_ul, winLen, s->len[i], s->uopt, s->id+i, km);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movl %edx, -0x3c(%rbp)
leaq 0xd92c5(%rip), %rax     # 0x3c53b8
movq 0x48(%rax), %rax
imulq $0x58, -0x38(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x50(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x48(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x2e3e30
movl %eax, -0x54(%rbp)
cmpl $0x1, -0x54(%rbp)
jne 0x2ec13e
jmp 0x2ec285
movq -0x50(%rbp), %rax
movq 0x80(%rax), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0xf0(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0xf0(%rax)
movq -0x50(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rax
movq 0x88(%rax), %rdx
movslq -0x3c(%rbp), %rax
imulq $0x68, %rax, %rax
addq %rax, %rdx
movq -0x50(%rbp), %rax
movq 0x90(%rax), %rcx
movslq -0x3c(%rbp), %rax
imulq $0xc0, %rax, %rax
addq %rax, %rcx
movq -0x50(%rbp), %rax
movq 0x68(%rax), %r8
movslq -0x3c(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %r8
movq -0x50(%rbp), %rax
movq 0x80(%rax), %rax
movslq -0x3c(%rbp), %r9
movq (%rax,%r9,8), %r9
addq $0x9040, %r9            # imm = 0x9040
movq -0x50(%rbp), %rax
movq 0x30(%rax), %r15
movq -0x50(%rbp), %rax
movq 0x28(%rax), %r14
movq -0x50(%rbp), %rax
movq (%rax), %rax
movsd 0x68(%rax), %xmm0
movq -0x38(%rbp), %rbx
movq -0x50(%rbp), %rax
movq 0x80(%rax), %rax
movslq -0x3c(%rbp), %r10
movq (%rax,%r10,8), %r11
addq $0x48, %r11
addq $0x18, %r11
movq -0x50(%rbp), %rax
movq 0x20(%rax), %r10
movl -0x54(%rbp), %r13d
xorl %eax, %eax
movl $0x1, %r12d
cmpl $0x2, %r13d
cmovel %r12d, %eax
cltq
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
movq $0x10, 0x10(%rsp)
movq $0x5, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r11, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movq %rax, 0x38(%rsp)
callq 0x2dce60
movl %eax, %eax
movl %eax, %ecx
movq -0x50(%rbp), %rax
movq 0x80(%rax), %rax
movslq -0x3c(%rbp), %rdx
movq (%rax,%rdx,8), %rax
addq 0xf8(%rax), %rcx
movq %rcx, 0xf8(%rax)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)