// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/ecovlp.cpp
// Function: direct_chain_cal(ha_abuf_s*, unsigned long, char*, unsigned long, unsigned long, char*, unsigned long, unsigned long, unsigned long, unsigned long, overlap_region_alloc*, Candidates_list*, kvec_t_u8_warp*, kvec_t_u64_warp*, st_mt_t*, unsigned int*, unsigned int*, double, int, unsigned long, unsigned long, unsigned int, long, double, unsigned int, long, long, long, long, double, double, bit_extz_t*, overlap_region*, double, long, long, long, asg16_v*)
uint64_t direct_chain_cal(ha_abuf_t *ab, uint64_t qid, char *qs, uint64_t ql, uint64_t tid, char *ts, uint64_t tl, uint64_t trev, uint64_t mz_w, uint64_t mz_k, overlap_region_alloc *olst, Candidates_list *cl, kvec_t_u8_warp* k_flag, kvec_t_u64_warp* dbg_ct, st_mt_t *sp, uint32_t *high_occ, uint32_t *low_occ, double bw_thres, 
								 int apend_be, uint64_t max_cnt, uint64_t min_cnt, 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,
                                 bit_extz_t *exz, overlap_region *aux_o, double e_rate, int64_t wl, int64_t khit, int64_t move_gap, asg16_v* buf)
{
    uint64_t ol0 = olst->length;
    get_pi_ec_chain(ab, qid, ql, tid, ts, tl, mz_w, mz_k, olst, cl, bw_thres, apend_be, k_flag, dbg_ct, sp, high_occ, low_occ, gen_off, enable_mcopy, mcopy_rate, mcopy_khit_cut, max_skip, max_iter, max_dis, quick_check, chn_pen_gap, chn_pen_skip);
    assert(olst->length - ol0 <= 1);
    if(olst->length > ol0) {
        if(gen_hc_r_alin_re(&(olst->list[ol0]), cl, qs, ql, ts, tl, exz, aux_o, e_rate, wl, qid, E_KHIT, 1, buf)) {
            olst->list[ol0].y_pos_strand = trev;
            return 1;
        } else {
            clear_fake_cigar(&(olst->list[ol0].f_cigar));
            clear_window_list_alloc(&(olst->list[ol0].w_list));
            clear_window_list_alloc(&(olst->list[ol0].boundary_cigars));
            olst->length--;
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movsd %xmm4, (%rsp)
movq %r9, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rbx
movq 0x68(%rsp), %r11
movq 0x60(%rsp), %r13
movq 0x40(%rsp), %r9
movaps 0x50(%rsp), %xmm4
movl 0x98(%rsp), %eax
movaps 0x70(%rsp), %xmm5
movaps 0x80(%rsp), %xmm6
movq 0x90(%rsp), %rcx
movl 0xb0(%rsp), %edx
movq 0xb8(%rsp), %rsi
movl 0xc0(%rsp), %r10d
movups 0xc8(%rsp), %xmm7
movups 0xd8(%rsp), %xmm8
movq 0x10(%r13), %rbp
subq $0x90, %rsp
movups %xmm8, 0x78(%rsp)
movups %xmm7, 0x68(%rsp)
movl %r10d, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movl %edx, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movups %xmm6, 0x38(%rsp)
movups %xmm5, 0x28(%rsp)
movl %eax, 0x20(%rsp)
movq %r11, 0x18(%rsp)
movq %r13, 0x10(%rsp)
movups %xmm4, (%rsp)
movq %rbx, %rsi
movq %r15, %rdx
movl %r8d, %ecx
movq %r14, %r8
callq 0x1345a7
addq $0x90, %rsp
movq 0x10(%r13), %rax
movq %rax, %rcx
subq %rbp, %rcx
cmpq $0x2, %rcx
jae 0x18c9fe
cmpq %rbp, %rax
jbe 0x18c9ed
imulq $0xa8, %rbp, %rbp
movq (%r13), %rdi
addq %rbp, %rdi
subq $0x8, %rsp
movq 0x70(%rsp), %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
movq 0x48(%rsp), %r9
movsd 0x8(%rsp), %xmm0
pushq 0x118(%rsp)
pushq $0x1
pushq $0x1f
pushq %rbx
pushq 0x120(%rsp)
pushq 0x120(%rsp)
pushq 0x120(%rsp)
callq 0x84832
addq $0x40, %rsp
testq %rax, %rax
je 0x18c9b6
movq 0x48(%rsp), %rax
movq (%r13), %rcx
movl %eax, 0x1c(%rcx,%rbp)
movl $0x1, %eax
jmp 0x18c9ef
movq (%r13), %rax
leaq (%rax,%rbp), %rdi
addq $0x38, %rdi
callq 0x3d054
movq (%r13), %rax
leaq (%rax,%rbp), %rdi
addq $0x48, %rdi
callq 0x3d05c
movq (%r13), %rax
leaq (%rax,%rbp), %rdi
addq $0x78, %rdi
callq 0x3d05c
decq 0x10(%r13)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb229f(%rip), %rdi     # 0x23eca4
leaq 0xb162f(%rip), %rsi     # 0x23e03b
leaq 0xb22a9(%rip), %rcx     # 0x23ecbc
movl $0x1251, %edx           # imm = 0x1251
callq 0x2110