// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/anchor.cpp
// Function: h_ec_lchain_amz(ha_abuf_s*, unsigned int, char*, unsigned long, unsigned long, unsigned long, All_reads*, overlap_region_alloc*, Candidates_list*, double, int, int, kvec_t_u8_warp*, kvec_t_u64_warp*, st_mt_t*, unsigned int*, unsigned int*, unsigned int, unsigned int, long, double, unsigned int, unsigned int, unsigned long)
void h_ec_lchain_amz(ha_abuf_t *ab, uint32_t rid, char* rs, uint64_t rl, uint64_t mz_w, uint64_t mz_k, All_reads *rref, overlap_region_alloc *overlap_list, Candidates_list *cl, double bw_thres, 
								 int max_n_chain, 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 chain_cutoff, uint32_t mcopy_khit_cut, uint64_t ocv_w)
{
	extern void *ha_flt_tab;
	extern ha_pt_t *ha_idx;
	int64_t max_skip, max_iter, max_dis, quick_check; double chn_pen_gap, chn_pen_skip;
	set_lchain_dp_op(is_accurate, mz_k, &max_skip, &max_iter, &max_dis, &chn_pen_gap, &chn_pen_skip, &quick_check);
	// minimizers_gen(ab, rs, rl, mz_w, mz_k, cl, k_flag, ha_flt_tab, ha_idx, dbg_ct, sp, high_occ, low_occ);
	minimizers_qgen0_amz(ab, rs, rl, mz_w, mz_k, cl, k_flag, ha_flt_tab, ha_idx, rref, dbg_ct, sp, high_occ, low_occ);
	// lchain_gen(cl, overlap_list, rid, rl, NULL, uref, apend_be, f_cigar, max_n_chain, max_skip, max_iter, max_dis, chn_pen_gap, chn_pen_skip, bw_thres, quick_check, gen_off);
	// lchain_qgen(cl, overlap_list, rid, rl, NULL, uref, apend_be, f_cigar, max_n_chain, max_skip, max_iter, max_dis, chn_pen_gap, chn_pen_skip, bw_thres, quick_check, gen_off);
	///no need to sort here, overlap_list has been sorted at lchain_gen
	lchain_qgen_mcopy_fast(cl, overlap_list, rid, rl, rref, apend_be, max_n_chain, max_skip, max_iter, max_dis, chn_pen_gap, chn_pen_skip, bw_thres, quick_check, gen_off, enable_mcopy, mcopy_rate, chain_cutoff, mcopy_khit_cut, sp, ocv_w);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movsd %xmm1, 0x38(%rsp)
movsd %xmm0, 0x30(%rsp)
movq %r9, %r12
movq %r8, 0x28(%rsp)
movq %rcx, %rbx
movq %rdx, 0x20(%rsp)
movl %esi, 0x4(%rsp)
movq %rdi, 0x18(%rsp)
movslq 0x98(%rsp), %rax
movq %rax, 0x40(%rsp)
xorl %r14d, %r14d
cmpl $0x0, 0xd0(%rsp)
setne %r14b
movl %r12d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
leaq 0x104aed(%rip), %rax    # 0x22e980
mulsd (%rax,%r14,8), %xmm0
cvtsd2ss %xmm0, %xmm0
movq 0x90(%rsp), %r15
movq 0x80(%rsp), %r13
movq 0xb8(%rsp), %rbp
callq 0x2380
cvtss2sd %xmm0, %xmm0
movsd 0xfb62a(%rip), %xmm1    # 0x2254f0
mulsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
mulsd 0x104ac0(%rip), %xmm0   # 0x22e998
movsd %xmm0, 0x8(%rsp)
leaq 0x16154b(%rip), %rax    # 0x28b430
movq (%rax), %rax
leaq 0x161549(%rip), %rcx    # 0x28b438
movq (%rcx), %rcx
subq $0x40, %rsp
movaps 0x100(%rsp), %xmm0
movups %xmm0, 0x30(%rsp)
movq %rbp, 0x28(%rsp)
movq 0xf0(%rsp), %rdx
movq %rdx, 0x20(%rsp)
movq %r13, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq %rax, 0x8(%rsp)
movq 0xe8(%rsp), %rax
movq %rax, (%rsp)
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq %rbx, %rdx
movq 0x68(%rsp), %rcx
movq %r12, %r8
movq %r15, %r9
callq 0x125a92
addq $0x38, %rsp
movl $0x1388, %eax           # imm = 0x1388
movq %r15, %rdi
movq 0x90(%rsp), %rsi
movl 0xc(%rsp), %edx
movq %rbx, %rcx
movq %r13, %r8
movl 0xa8(%rsp), %r9d
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
movsd 0x40(%rsp), %xmm3
pushq 0x100(%rsp)
pushq %rbp
movl 0x108(%rsp), %r10d
pushq %r10
movl 0x108(%rsp), %r10d
pushq %r10
pushq 0x108(%rsp)
movl 0x108(%rsp), %r10d
pushq %r10
pushq %r14
pushq %rax
pushq %rax
pushq $0x19
pushq 0x98(%rsp)
callq 0x128b7f
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq