// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/anchor.cpp
// Function: ug_map_lchain_simple(ha_abufl_s*, unsigned int, char*, unsigned long, unsigned long, unsigned long, ul_idx_t const*, overlap_region_alloc*, Candidates_list*, double, int, int, kvec_t_u8_warp*, overlap_region*, kvec_t_u64_warp*, st_mt_t*, unsigned int*, unsigned int*, unsigned int, unsigned int, double, unsigned int, unsigned int, ha_mzl_t*, unsigned long, ha_mzl_t*, unsigned long, unsigned long, unsigned long)
int64_t ug_map_lchain_simple(ha_abufl_t *ab, uint32_t rid, char* rs, uint64_t rl, uint64_t mz_w, uint64_t mz_k, const ul_idx_t *uref, overlap_region_alloc *overlap_list, Candidates_list *cl, double bw_thres,
								 int max_n_chain, int apend_be, kvec_t_u8_warp* k_flag, overlap_region* f_cigar, 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, double mcopy_rate, uint32_t mcopy_khit_cut, uint32_t is_hpc, ha_mzl_t *res, uint64_t res_n, ha_mzl_t *idx, uint64_t idx_n, uint64_t mzl_cutoff, uint64_t chain_cutoff)
{
	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);
	if((!overlap_list) || (!cl)) {
		ab->mz.n = 0;
		mz2_ha_sketch(rs, rl, mz_w, mz_k, rid, is_hpc, &ab->mz, 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);
		if(res) memcpy(res, ab->mz.a, ab->mz.n * (sizeof((*(ab->mz.a)))));
		return ab->mz.n;
	} else {
		sp->n = 0;
		minimizers_qgen_input(ab, rid, rs, rl, mz_w, mz_k, cl, k_flag, ha_flt_tab, ha_idx, NULL, uref, dbg_ct, sp, high_occ, low_occ, res, res_n, idx, idx_n, mzl_cutoff, chain_cutoff, NULL);
		// lchain_qgen_mcopy_input(cl, overlap_list, rid, rl, NULL, uref, apend_be, max_n_chain, max_skip, max_iter, max_dis, chn_pen_gap, chn_pen_skip, bw_thres, bw_thres_sec, quick_check, gen_off, mcopy_rate, mcopy_khit_cut, sp);
		lchain_qgen_mcopy(cl, overlap_list, rid, rl, NULL, uref, apend_be, max_n_chain, max_skip, max_iter, max_dis, chn_pen_gap, chn_pen_skip, bw_thres, quick_check, gen_off, mcopy_rate, chain_cutoff, mcopy_khit_cut, sp);
		return 0;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movsd %xmm1, 0x20(%rsp)
movsd %xmm0, 0x18(%rsp)
movq %r9, %r14
movq %r8, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq %rdx, %r13
movl %esi, %ebp
movq %rdi, %rbx
movq 0xa0(%rsp), %r12
movl 0xe8(%rsp), %edi
leaq 0x38(%rsp), %rax
leaq 0x28(%rsp), %r10
leaq 0x50(%rsp), %rdx
leaq 0x48(%rsp), %rcx
leaq 0x40(%rsp), %r8
leaq 0x30(%rsp), %r9
movl %r14d, %esi
pushq %rax
pushq %r10
callq 0xea117
popq %rax
popq %rcx
cmpq $0x0, 0x98(%rsp)
setne %al
testq %r12, %r12
setne %cl
testb %cl, %al
je 0xee40f
movq %r12, %r11
movq 0x130(%rsp), %r15
movq 0x128(%rsp), %rax
movq 0x120(%rsp), %rcx
movq 0x118(%rsp), %rdx
movq 0x110(%rsp), %rdi
movq 0xe0(%rsp), %r8
movq 0xd8(%rsp), %r9
movl 0xa8(%rsp), %r13d
movq 0x90(%rsp), %r14
movq 0xd0(%rsp), %r10
andq $0x0, (%r10)
movl %ebp, %esi
subq $0x90, %rsp
movq %r15, 0x78(%rsp)
movq %rax, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rdi, 0x58(%rsp)
movq 0x198(%rsp), %rax
movq %rax, 0x50(%rsp)
movq %r8, 0x48(%rsp)
movq %r9, 0x40(%rsp)
andq $0x0, 0x80(%rsp)
movq %r10, 0x38(%rsp)
andq $0x0, 0x20(%rsp)
movq %r14, 0x28(%rsp)
movq %r11, (%rsp)
movq %rbx, %rdi
callq 0xe7a3e
addq $0x90, %rsp
movslq %r13d, %rax
movsd 0x30(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
subq $0x8, %rsp
xorl %ebx, %ebx
movq %r12, %rdi
movq 0xa0(%rsp), %rsi
movl %ebp, %edx
movq 0x10(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
movsd 0x20(%rsp), %xmm2
movsd 0x28(%rsp), %xmm3
movl 0x100(%rsp), %r10d
pushq %r10
pushq %r15
movl 0x108(%rsp), %r10d
pushq %r10
pushq 0x58(%rsp)
pushq 0x68(%rsp)
pushq 0x78(%rsp)
pushq 0x88(%rsp)
pushq %rax
movl 0xf8(%rsp), %eax
pushq %rax
callq 0xe8dd6
addq $0x50, %rsp
jmp 0xee4a7
movl 0x100(%rsp), %r9d
movq 0xb8(%rsp), %r12
leaq 0x18(%rbx), %r15
andl $0x0, 0x18(%rbx)
leaq 0x16532a(%rip), %rcx    # 0x253758
movl 0xa0(%rcx), %eax
movl 0xa8(%rcx), %r11d
movl 0x1f8(%rcx), %r10d
movss 0xfe656(%rip), %xmm0    # 0x1ecaa0
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movl %r14d, %ecx
movl %ebp, %r8d
pushq $0x0
pushq $0x0
pushq %rax
pushq 0xe8(%rsp)
pushq %r10
pushq $-0x1
pushq $0x0
pushq 0x100(%rsp)
pushq %r12
pushq %r11
pushq $0x0
pushq %r15
callq 0xdf468
addq $0x60, %rsp
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0xee4a4
movq 0x20(%rbx), %rsi
movl 0x18(%rbx), %eax
imulq $0x18, %rax, %rdx
callq 0x2160
movl (%r15), %ebx
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq