// File: /workspace/github_cpp_makefile_star2_O2/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 $0x78, %rsp
movsd %xmm0, 0x70(%rsp)
movq %r9, 0x68(%rsp)
movq %r8, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movq %rdx, %r13
movq %rdi, %rbx
movq 0xd8(%rsp), %rdx
movq 0x8(%r13), %r14
leaq 0x18(%rsi), %rcx
movq %rsi, 0x50(%rsp)
callq 0x32093
xorl %esi, %esi
testq %r14, %r14
movl $0x0, %r15d
cmovgq %r14, %r15
incq %r15
pushq $0x1
popq %r12
xorl %eax, %eax
cmpq %r15, %r12
je 0x47535
imulq $0x1c, %rsi, %rcx
movq (%r13), %rdx
movl (%rdx,%rcx), %ebp
cmpq %r14, %r12
je 0x47460
imulq $0x1c, %r12, %rdi
cmpl (%rdx,%rdi), %ebp
je 0x4752d
movq (%rbx), %r8
imulq $0xa8, %rbp, %rdi
movl 0x28(%r8,%rdi), %r9d
cmpq %r9, %rsi
jne 0x4756c
addq %rcx, %rdx
addq %r8, %rdi
imulq $0xa8, %rax, %rcx
addq %r8, %rcx
addq $0x48, %rcx
cmpq %rbp, %rax
jae 0x474a1
andq $0x0, (%rcx)
incq %rax
addq $0xa8, %rcx
jmp 0x4748c
incl %ebp
movq %r12, %rcx
subq %rsi, %rcx
movq 0xf8(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0xe8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0xd0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %r8
movq 0x60(%rsp), %r9
movsd 0x70(%rsp), %xmm0
callq 0x39034
movq %r12, %rsi
movq %rbp, %rax
incq %r12
jmp 0x4743a
movq 0x10(%rbx), %rcx
imulq $0xa8, %rax, %rdx
addq $0x48, %rdx
cmpq %rcx, %rax
jae 0x4755d
movq (%rbx), %rsi
andq $0x0, (%rsi,%rdx)
incq %rax
addq $0xa8, %rdx
jmp 0x47544
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19f465(%rip), %rdi    # 0x1e69d8
leaq 0x19c129(%rip), %rsi    # 0x1e36a3
leaq 0x19f56e(%rip), %rcx    # 0x1e6aef
movl $0x56a0, %edx           # imm = 0x56A0
callq 0x2110