// File: 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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq 0xe0(%rbp), %rax
movq 0xd8(%rbp), %rax
movq 0xd0(%rbp), %rax
movq 0xc8(%rbp), %rax
movq 0xc0(%rbp), %rax
movq 0xb8(%rbp), %rax
movq 0xb0(%rbp), %rax
movq 0xa8(%rbp), %rax
movq 0xa0(%rbp), %rax
movq 0x98(%rbp), %rax
movl 0x90(%rbp), %eax
movq 0x88(%rbp), %rax
movl 0x80(%rbp), %eax
movq 0x78(%rbp), %rax
movq 0x70(%rbp), %rax
movl 0x68(%rbp), %eax
movq 0x60(%rbp), %rax
movq 0x58(%rbp), %rax
movq 0x50(%rbp), %rax
movq 0x48(%rbp), %rax
movq 0x40(%rbp), %rax
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x38(%rbp)
movq %rsi, -0x40(%rbp)
movq %rdx, -0x48(%rbp)
movq %rcx, -0x50(%rbp)
movq %r8, -0x58(%rbp)
movq %r9, -0x60(%rbp)
movsd %xmm0, -0x68(%rbp)
movsd %xmm1, -0x70(%rbp)
movsd %xmm2, -0x78(%rbp)
movsd %xmm3, -0x80(%rbp)
movsd %xmm4, -0x88(%rbp)
movq 0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rax
movl %eax, %ecx
movq -0x60(%rbp), %r8
movq 0x10(%rbp), %r9
movq 0x20(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq 0x28(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq 0x30(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq 0x38(%rbp), %rax
movq %rax, -0xc8(%rbp)
movsd -0x68(%rbp), %xmm0
movl 0x68(%rbp), %eax
movl %eax, -0xbc(%rbp)
movq 0x40(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq 0x48(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq 0x50(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq 0x58(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq 0x60(%rbp), %r13
movl 0x80(%rbp), %r12d
movq 0x88(%rbp), %r15
movsd -0x70(%rbp), %xmm1
movl 0x90(%rbp), %r14d
movq 0x98(%rbp), %rbx
movq 0xa0(%rbp), %r11
movq 0xa8(%rbp), %r10
movq 0xb0(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0xe0(%rbp), %rax
movsd -0x78(%rbp), %xmm2
movsd -0x80(%rbp), %xmm3
movq %rax, (%rsp)
movq -0xd8(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0xd0(%rbp), %rax
movq %rax, 0x10(%rsp)
movq -0xc8(%rbp), %rax
movq %rax, 0x18(%rsp)
movl -0xbc(%rbp), %eax
movl %eax, 0x20(%rsp)
movq -0xb8(%rbp), %rax
movq %rax, 0x28(%rsp)
movq -0xb0(%rbp), %rax
movq %rax, 0x30(%rsp)
movq -0xa8(%rbp), %rax
movq %rax, 0x38(%rsp)
movq -0xa0(%rbp), %rax
movq %rax, 0x40(%rsp)
movq -0x98(%rbp), %rax
movq %r13, 0x48(%rsp)
movl %r12d, 0x50(%rsp)
movq %r15, 0x58(%rsp)
movl %r14d, 0x60(%rsp)
movq %rbx, 0x68(%rsp)
movq %r11, 0x70(%rsp)
movq %r10, 0x78(%rsp)
movq %rax, 0x80(%rsp)
callq 0x1b3b90
movq 0x30(%rbp), %rax
movq 0x10(%rax), %rax
subq -0x90(%rbp), %rax
cmpq $0x1, %rax
ja 0x25f479
jmp 0x25f498
leaq 0x130403(%rip), %rdi    # 0x38f883
leaq 0x12f784(%rip), %rsi    # 0x38ec0b
movl $0x1251, %edx           # imm = 0x1251
leaq 0x130408(%rip), %rcx    # 0x38f89b
callq 0x2130
movq 0x30(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x90(%rbp), %rax
jbe 0x25f5c7
movq 0x30(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x90(%rbp), %rax
addq %rax, %rdi
movq 0x38(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq -0x60(%rbp), %r8
movq 0x10(%rbp), %r9
movq 0xb8(%rbp), %r14
movq 0xc0(%rbp), %rbx
movsd -0x88(%rbp), %xmm0
movq 0xc8(%rbp), %r11
movq -0x40(%rbp), %r10
movq 0xe0(%rbp), %rax
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq $0x1f, 0x20(%rsp)
movq $0x1, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x9b8d0
cmpq $0x0, %rax
je 0x25f55b
movq 0x18(%rbp), %rax
movl %eax, %ecx
movq 0x30(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x90(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x1c(%rax)
movq $0x1, -0x30(%rbp)
jmp 0x25f5cf
movq 0x30(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x90(%rbp), %rax
addq %rax, %rdi
addq $0x38, %rdi
callq 0x1e1d0
movq 0x30(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x90(%rbp), %rax
addq %rax, %rdi
addq $0x48, %rdi
callq 0x1e1f0
movq 0x30(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x90(%rbp), %rax
addq %rax, %rdi
addq $0x78, %rdi
callq 0x1e1f0
movq 0x30(%rbp), %rax
movq 0x10(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x10(%rax)
jmp 0x25f5c7
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)