// File: chhylp123[P]hifiasm/anchor.cpp
// Function: get_pi_ec_chain(ha_abuf_s*, unsigned long, unsigned long, unsigned int, char*, unsigned long, unsigned long, unsigned long, overlap_region_alloc*, Candidates_list*, double, int, kvec_t_u8_warp*, kvec_t_u64_warp*, st_mt_t*, unsigned int*, unsigned int*, unsigned int, long, double, unsigned int, long, long, long, long, double, double)
void get_pi_ec_chain(ha_abuf_t *ab, uint64_t rid, uint64_t rl, uint32_t tid, char* ts, uint64_t tl, uint64_t mz_w, uint64_t mz_k, overlap_region_alloc *overlap_list, Candidates_list *cl, double bw_thres, 
								int apend_be, kvec_t_u8_warp* k_flag, kvec_t_u64_warp* dbg_ct, st_mt_t *sp, uint32_t *high_occ, uint32_t *low_occ, /**uint32_t is_accurate,**/ uint32_t gen_off, int64_t enable_mcopy, double mcopy_rate, uint32_t mcopy_khit_cut, 
								int64_t max_skip, int64_t max_iter, int64_t max_dis, int64_t quick_check, double chn_pen_gap, double chn_pen_skip)
{
	extern void *ha_flt_tab;
	extern ha_pt_t *ha_idx;
	uint64_t rn = ab->mz.n, tn, cn = 0;

	tn = get_mz1(ts, tl, mz_w, mz_k, 0, !(asm_opt.flag & HA_F_NO_HPC), ab, ha_flt_tab, NULL, asm_opt.mz_sample_dist, k_flag, dbg_ct, NULL, -1, asm_opt.dp_min_len, -1, sp, asm_opt.mz_rewin, 0, NULL, rn);

	cn = lchain_qgen_mcopy_fast_re0(ab, ha_idx, ab->mz.a, rn, ab->mz.a + rn, tn - rn, tid, cl, high_occ, low_occ);

	if(cn) {
		lchain_qgen_mcopy_fast_re1(cl, cl->length - cn, overlap_list, rid, rl, tl, apend_be, max_skip, max_iter, max_dis, chn_pen_gap, chn_pen_skip, bw_thres, quick_check, gen_off, enable_mcopy, mcopy_rate, mcopy_khit_cut);
	}

	ab->mz.n = rn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq 0x90(%rbp), %rax
movq 0x88(%rbp), %rax
movq 0x80(%rbp), %rax
movq 0x78(%rbp), %rax
movl 0x70(%rbp), %eax
movq 0x68(%rbp), %rax
movl 0x60(%rbp), %eax
movq 0x58(%rbp), %rax
movq 0x50(%rbp), %rax
movq 0x48(%rbp), %rax
movq 0x40(%rbp), %rax
movq 0x38(%rbp), %rax
movl 0x30(%rbp), %eax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movl %ecx, -0x44(%rbp)
movq %r8, -0x50(%rbp)
movq %r9, -0x58(%rbp)
movsd %xmm0, -0x60(%rbp)
movsd %xmm1, -0x68(%rbp)
movsd %xmm2, -0x70(%rbp)
movsd %xmm3, -0x78(%rbp)
movq -0x30(%rbp), %rax
movl 0x18(%rax), %eax
movq %rax, -0x80(%rbp)
movq $0x0, -0x90(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rax
movl %eax, %esi
movq 0x10(%rbp), %rax
movl %eax, %edx
movq 0x18(%rbp), %rax
movl %eax, %ecx
leaq 0x210bac(%rip), %rax    # 0x3c47f8
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %r9d
movq -0x30(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq 0x21185f(%rip), %rax    # 0x3c54d0
movq (%rax), %r13
leaq 0x210b7d(%rip), %rax    # 0x3c47f8
movl 0xa8(%rax), %r12d
movq 0x38(%rbp), %r15
movq 0x40(%rbp), %r14
leaq 0x210b67(%rip), %rax    # 0x3c47f8
movl 0x1f8(%rax), %ebx
movq 0x48(%rbp), %r11
leaq 0x210b56(%rip), %rax    # 0x3c47f8
movl 0xa0(%rax), %r10d
movq -0x80(%rbp), %rax
movq %rax, -0x98(%rbp)
xorl %r8d, %r8d
xorl %eax, %eax
movq -0xa0(%rbp), %rax
movss 0x1cb3a8(%rip), %xmm0   # 0x37f070
movq %rax, (%rsp)
movq -0x98(%rbp), %rax
movq %r13, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movl %r12d, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movq %r14, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movl $0xffffffff, 0x38(%rsp) # imm = 0xFFFFFFFF
movl %ebx, 0x40(%rsp)
movq %r11, 0x48(%rsp)
movl %r10d, 0x50(%rsp)
movl $0x0, 0x58(%rsp)
movq $0x0, 0x60(%rsp)
movq %rax, 0x68(%rsp)
callq 0x1b3940
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x21179c(%rip), %rax    # 0x3c54d8
movq (%rax), %rsi
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x80(%rbp), %rcx
movq -0x30(%rbp), %rax
movq 0x20(%rax), %r8
movq -0x80(%rbp), %rax
shlq $0x4, %rax
addq %rax, %r8
movq -0x88(%rbp), %r9
subq -0x80(%rbp), %r9
movl -0x44(%rbp), %eax
movl %eax, %ebx
movq 0x28(%rbp), %r11
movq 0x50(%rbp), %r10
movq 0x58(%rbp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x1a60d0
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
je 0x1b3e35
movq 0x28(%rbp), %rdi
movq 0x28(%rbp), %rax
movq 0x8(%rax), %rax
subq -0x90(%rbp), %rax
movl %eax, %esi
movq 0x20(%rbp), %rdx
movq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x40(%rbp), %r8
movq -0x58(%rbp), %r9
movl 0x30(%rbp), %r13d
movq 0x78(%rbp), %r12
movq 0x80(%rbp), %r15
movq 0x88(%rbp), %r14
movsd -0x70(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
movsd -0x60(%rbp), %xmm2
movq 0x90(%rbp), %rbx
movl 0x60(%rbp), %r11d
movq 0x68(%rbp), %r10
movsd -0x68(%rbp), %xmm3
movl 0x70(%rbp), %eax
movl %r13d, (%rsp)
movq %r12, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movl %r11d, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movl %eax, 0x38(%rsp)
callq 0x1ac130
movq -0x80(%rbp), %rax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x18(%rax)
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)