// File: chhylp123[P]hifiasm/ecovlp.cpp
// Function: worker_hap_dc_ec_gen_new_idx(void*, long, int)
static void worker_hap_dc_ec_gen_new_idx(void *data, long i, int tid)
{
    
    ec_ovec_buf_t0 *b = &(((ec_ovec_buf_t*)data)->a[tid]);
    uint32_t high_occ = asm_opt.hom_cov * (2.0 - HA_KMER_GOOD_RATIO);
    uint32_t low_occ = asm_opt.hom_cov * HA_KMER_GOOD_RATIO; uint32_t qlen = 0;

    recover_UC_Read(&b->self_read, &R_INF, i); qlen = b->self_read.length; 

    h_ec_lchain(b->ab, i, b->self_read.seq, b->self_read.length, asm_opt.mz_win, asm_opt.k_mer_length, &R_INF, &b->olist, &b->clist, /**0.02**/0.001, asm_opt.max_n_chain, 1, NULL, NULL, &(b->sp), &high_occ, &low_occ, 1, 1, 3, 0.7, 2, 32, COV_W);

    overlap_region_sort_y_id(b->olist.list, b->olist.length);

    // overlap_region_sort_y_id(b->olist.list, b->olist.length);
	// ma_hit_sort_tn(R_INF.paf[i].buffer, R_INF.paf[i].length);
	// ma_hit_sort_tn(R_INF.reverse_paf[i].buffer, R_INF.reverse_paf[i].length);

    // R_INF.paf[i].is_fully_corrected = is_well_cal(&b->v64, &(R_INF.paf[i]), &(R_INF.reverse_paf[i]), b->self_read.length, 4);

    // R_INF.paf[i].is_abnormal = abnormal;
    // R_INF.trio_flag[i] = AMBIGU;

    h_ec_lchain_fast_new(b->ab, i, &b->self_read, &b->ovlp_read, &R_INF, &b->olist, &b->clist, &b->exz, &b->v16, &b->v64, &(R_INF.paf[i]), &(R_INF.reverse_paf[i]), 0.866666);

    if((asm_opt.is_ont) && (is_uncorrected_read(&b->olist, &b->v64, qlen, 1600))) {
        b->olist.length = 0;
        // fprintf(stderr, "[M::%s] rid::%ld\t%.*s\n", __func__, i, (int)Get_NAME_LENGTH(R_INF, i), Get_NAME(R_INF, i));
    }

    push_ff_ovlp(&(R_INF.paf[i]), &b->olist, 1, &R_INF, b->cnt);
    push_ff_ovlp(&(R_INF.reverse_paf[i]), &b->olist, 2, &R_INF, b->cnt);

    /**
    copy_asg_arr(buf0, b->sp);
    if(gen_hap_dc_cov(&(b->v64), &buf0, &(R_INF.paf[i]), &R_INF, WINDOW_HC_FAST, 4, 0.7, &b->self_read, &b->ovlp_read, &scc, i)) {
        scc.f[i] = 1; b->num_read_base++;
        // fprintf(stderr, "-mm-[M::%s]\tqn::%u::%.*s\n", __func__, (uint32_t)(i), (int)Get_NAME_LENGTH(R_INF, i), Get_NAME((R_INF), i));
    } else {
        scc.f[i] = 0; b->num_correct_base++;
        // fprintf(stderr, "-um-[M::%s]\tqn::%u::%.*s\n", __func__, (uint32_t)(i), (int)Get_NAME_LENGTH(R_INF, i), Get_NAME((R_INF), i));
    }
    copy_asg_arr(b->sp, buf0);
    **/
   refresh_ec_ovec_buf_t0(b, REFRESH_N);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movq %rdi, -0x28(%rbp)
movq %rsi, -0x30(%rbp)
movl %edx, -0x34(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x34(%rbp), %rcx
imulq $0x5c0, %rcx, %rcx      # imm = 0x5C0
addq %rcx, %rax
movq %rax, -0x40(%rbp)
leaq 0x15c50b(%rip), %rax    # 0x3c47f8
cvtsi2sdl 0xd0(%rax), %xmm0
movsd 0x123523(%rip), %xmm1   # 0x38b820
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
movl %ecx, -0x44(%rbp)
cvtsi2sdl 0xd0(%rax), %xmm0
movsd 0x121f9f(%rip), %xmm1   # 0x38a2b8
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x15cf95(%rip), %rsi    # 0x3c52d0
callq 0xa380
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, -0x4c(%rbp)
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %rdi
movq -0x30(%rbp), %rax
movl %eax, %esi
movq -0x40(%rbp), %rax
movq (%rax), %rdx
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0x15c486(%rip), %rax    # 0x3c47f8
movslq 0x94(%rax), %r8
leaq 0x15c478(%rip), %rax    # 0x3c47f8
movslq 0x80(%rax), %r9
movq -0x40(%rbp), %r15
addq $0x98, %r15
movq -0x40(%rbp), %r14
addq $0x40, %r14
leaq 0x15c457(%rip), %rax    # 0x3c47f8
movl 0xe8(%rax), %ebx
movq -0x40(%rbp), %r11
addq $0x568, %r11            # imm = 0x568
leaq 0x15cf17(%rip), %r12    # 0x3c52d0
movsd 0x11957f(%rip), %xmm0   # 0x381940
xorl %eax, %eax
leaq -0x44(%rbp), %r10
leaq -0x48(%rbp), %rax
movsd 0x119e55(%rip), %xmm1   # 0x382228
movq %r12, (%rsp)
movq %r15, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movl $0x1, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movq %r11, 0x38(%rsp)
movq %r10, 0x40(%rsp)
movq %rax, 0x48(%rsp)
movl $0x1, 0x50(%rsp)
movl $0x1, 0x58(%rsp)
movq $0x3, 0x60(%rsp)
movl $0x2, 0x68(%rsp)
movl $0x20, 0x70(%rsp)
movq $0xc00, 0x78(%rsp)      # imm = 0xC00
callq 0x1acda0
movq -0x40(%rbp), %rax
movq 0x98(%rax), %rdi
movq -0x40(%rbp), %rax
movq 0xa8(%rax), %rsi
callq 0x1dfd0
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %rdi
movq -0x30(%rbp), %rax
movl %eax, %esi
movq -0x40(%rbp), %rdx
movq -0x40(%rbp), %rcx
addq $0x20, %rcx
movq -0x40(%rbp), %r9
addq $0x98, %r9
movq -0x40(%rbp), %r15
addq $0x40, %r15
movq -0x40(%rbp), %r14
addq $0x3e0, %r14            # imm = 0x3E0
movq -0x40(%rbp), %rbx
addq $0x500, %rbx            # imm = 0x500
movq -0x40(%rbp), %r11
addq $0x4d0, %r11            # imm = 0x4D0
leaq 0x15ce18(%rip), %rax    # 0x3c52d0
movq 0x78(%rax), %r10
imulq $0x18, -0x30(%rbp), %rax
addq %rax, %r10
leaq 0x15ce05(%rip), %rax    # 0x3c52d0
movq 0x80(%rax), %rax
imulq $0x18, -0x30(%rbp), %r8
addq %r8, %rax
leaq 0x15cdef(%rip), %r8     # 0x3c52d0
movsd 0x1266c7(%rip), %xmm0   # 0x38ebb0
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movq %rax, 0x28(%rsp)
callq 0x261eb0
leaq 0x15c2e6(%rip), %rax    # 0x3c47f8
cmpq $0x0, 0x2a8(%rax)
je 0x268555
movq -0x40(%rbp), %rdi
addq $0x98, %rdi
movq -0x40(%rbp), %rsi
addq $0x4d0, %rsi            # imm = 0x4D0
movl -0x4c(%rbp), %eax
movl %eax, %edx
movl $0x640, %ecx            # imm = 0x640
callq 0x258cd0
cmpl $0x0, %eax
je 0x268555
movq -0x40(%rbp), %rax
movq $0x0, 0xa8(%rax)
leaq 0x15cd74(%rip), %rax    # 0x3c52d0
movq 0x78(%rax), %rdi
imulq $0x18, -0x30(%rbp), %rax
addq %rax, %rdi
movq -0x40(%rbp), %rsi
addq $0x98, %rsi
movq -0x40(%rbp), %r8
addq $0xc0, %r8
movl $0x1, %edx
leaq 0x15cd46(%rip), %rcx    # 0x3c52d0
callq 0x256850
leaq 0x15cd3a(%rip), %rax    # 0x3c52d0
movq 0x80(%rax), %rdi
imulq $0x18, -0x30(%rbp), %rax
addq %rax, %rdi
movq -0x40(%rbp), %rsi
addq $0x98, %rsi
movq -0x40(%rbp), %r8
addq $0xc0, %r8
movl $0x2, %edx
leaq 0x15cd09(%rip), %rcx    # 0x3c52d0
callq 0x256850
movq -0x40(%rbp), %rdi
movl $0x80, %esi
callq 0x26e2d0
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopw (%rax,%rax)