// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Correct.cpp
// Function: ul_gap_filling_local(overlap_region_alloc*, Candidates_list*, kv_ul_ov_t*, unsigned long, ul_idx_t const*, hpc_t*, All_reads*, char*, UC_Read*, bit_extz_t*, overlap_region*, asg64_v*, asg64_v*, double, long, unsigned long, long, long, long)
void ul_gap_filling_local(overlap_region_alloc* ol, Candidates_list *cl, kv_ul_ov_t *aln, uint64_t wl, 
const ul_idx_t *uref, hpc_t *hpc_g, All_reads *rref, char* qstr, UC_Read *tu, bit_extz_t *exz, overlap_region *aux_o,  
asg64_v* buf, asg64_v* iidx, double e_rate, int64_t ql, uint64_t rid, int64_t khit, int64_t base_chekc_k_hit,
int64_t max_lgap)
{
    int64_t k, l, a_n = aln->n; uint64_t pqn, pk; overlap_region *z; //k_mer_hit *ch_a;
    count_k_hits_filter(ol, cl, buf, &(cl->chainDP));
    for (k = 1, l = 0, pqn = 0; k <= a_n; k++) {
        if(k == a_n || aln->a[l].qn != aln->a[k].qn) {
            z = &(ol->list[aln->a[l].qn]); assert(z->align_length == l);  
            for (pk = pqn; pk < aln->a[l].qn; pk++) ol->list[pk].w_list.n = 0;
            pqn = aln->a[l].qn+1;  
            cigar_gen_by_chain_adv_local(z, cl, aln->a+l, k-l, wl, uref, hpc_g, rref, qstr, tu, exz, aux_o, e_rate, ql, rid, khit);
            // ch_n = gen_cns_chain(z, cl, iidx, max_lgap, e_rate, 0);
            // if(ch_n) {
            //     cigar_gen_by_chain_adv(z, cl, cl->length, ch_n, aln->a+l, k-l, wl, uref, hpc_g, rref, qstr, tu, exz, aux_o, e_rate, ql, rid, khit);
            // }
            l = k;
        }
    }
    for (pk = pqn; pk < ol->length; pk++) ol->list[pk].w_list.n = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movsd %xmm0, 0x60(%rsp)
movq %r9, 0x58(%rsp)
movq %r8, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %rbx
movq 0xc8(%rsp), %rdx
movq 0x8(%r13), %r14
leaq 0x18(%rsi), %rcx
callq 0x62b84
testq %r14, %r14
jle 0x7a313
movl $0x1, %r15d
xorl %ecx, %ecx
xorl %eax, %eax
cmpq %r14, %r15
je 0x7a21c
movq (%r13), %rdx
leaq (%rax,%rax,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rax, %rsi
movl (%rdx,%rsi), %esi
leaq (%r15,%r15,8), %rdi
leaq (%rdi,%rdi,2), %rdi
addq %r15, %rdi
cmpl (%rdx,%rdi), %esi
je 0x7a301
movq (%rbx), %rdi
movq (%r13), %rdx
leaq (%rax,%rax,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rax, %rsi
movl (%rdx,%rsi), %r12d
imulq $0xa8, %r12, %r8
movl 0x28(%rdi,%r8), %r9d
cmpq %r9, %rax
jne 0x7a351
movq %r12, %r9
subq %rcx, %r9
jbe 0x7a270
imulq $0xa8, %rcx, %rcx
addq %rdi, %rcx
addq $0x48, %rcx
movq $0x0, (%rcx)
addq $0xa8, %rcx
decq %r9
jne 0x7a25d
addq %rsi, %rdx
addq %r8, %rdi
incl %r12d
movq %r15, %rcx
subq %rax, %rcx
movq 0xe8(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0xd8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rsi
movq 0x48(%rsp), %r8
movq 0x50(%rsp), %r9
movsd 0x60(%rsp), %xmm0
callq 0x6a8a9
movq %r15, %rax
movq %r12, %rcx
leaq 0x1(%r15), %rdx
cmpq %r14, %r15
movq %rdx, %r15
jne 0x7a1f1
jmp 0x7a315
xorl %ecx, %ecx
movq 0x10(%rbx), %rax
subq %rcx, %rax
jbe 0x7a342
movq (%rbx), %rdx
imulq $0xa8, %rcx, %rcx
addq %rdx, %rcx
addq $0x48, %rcx
movq $0x0, (%rcx)
addq $0xa8, %rcx
decq %rax
jne 0x7a32f
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ae620(%rip), %rdi    # 0x228978
leaq 0x1ab2e4(%rip), %rsi    # 0x225643
leaq 0x1ae729(%rip), %rcx    # 0x228a8f
movl $0x56a0, %edx           # imm = 0x56A0
callq 0x2110