// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/ecovlp.cpp
// Function: worker_hap_dc_ec_gen(void*, long, int)
static void worker_hap_dc_ec_gen(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;

    recover_UC_Read(&b->self_read, &R_INF, i); 

    // 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(b->ab, i, &b->self_read, &b->ovlp_read, asm_opt.mz_win, asm_opt.k_mer_length, &R_INF, &b->olist, &b->clist, &b->exz, &b->v16, &b->v64, 0.02, 1, NULL, NULL, &(b->sp), &high_occ, &low_occ, 1, 1, 0, 2, UINT32_MAX, &(R_INF.paf[i]), &(R_INF.reverse_paf[i]), 0.866666);

    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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r15
movq (%rdi), %rbp
movslq %edx, %rax
imulq $0x5c0, %rax, %rbx      # imm = 0x5C0
leaq (%rbx,%rbp), %rdi
movq %rdi, 0xa0(%rsp)
leaq 0x10286e(%rip), %r12    # 0x295758
cvtsi2sdl 0xd0(%r12), %xmm0
movsd 0xa7ca4(%rip), %xmm1    # 0x23aba0
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
leaq 0x94(%rsp), %rcx
movl %eax, (%rcx)
mulsd 0xa67c9(%rip), %xmm0    # 0x2396e0
cvttsd2si %xmm0, %rax
leaq 0x90(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x103303(%rip), %rsi    # 0x296230
movq %rsi, %r14
movq %r15, %rdx
callq 0x333e0
leaq (%rbx,%rbp), %rcx
addq $0x20, %rcx
movq 0x98(%rcx), %r8
movslq 0x94(%r12), %rax
movq %rax, 0x98(%rsp)
movslq 0x80(%r12), %r9
leaq 0x98(%rbp,%rbx), %r12
leaq 0x40(%rbp,%rbx), %rdi
leaq 0x3e0(%rbp,%rbx), %rdx
leaq (%rbx,%rbp), %rsi
addq $0x4d0, %rsi            # imm = 0x4D0
leaq (%rbx,%rbp), %r10
addq $0x568, %r10            # imm = 0x568
movq %r15, %r11
shlq $0x3, %r11
leaq (%r11,%r11,2), %r13
movq 0x78(%r14), %r11
addq %r13, %r11
movq 0x80(%r14), %rax
addq %r13, %rax
movq %rax, 0x88(%rsp)
movq %r11, 0x80(%rsp)
leaq 0x90(%rsp), %rax
movq %rax, 0x58(%rsp)
leaq 0x94(%rsp), %rax
movq %rax, 0x50(%rsp)
movq %r10, 0x48(%rsp)
movl $0x1, %eax
movl %eax, 0x68(%rsp)
movl %eax, 0x60(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x38(%rsp)
movl %eax, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
movq %r12, 0x8(%rsp)
movq %r14, (%rsp)
movl $0xffffffff, 0x78(%rsp) # imm = 0xFFFFFFFF
movq $0x0, 0x70(%rsp)
movsd 0x9aff7(%rip), %xmm0    # 0x22e018
movsd 0xa8237(%rip), %xmm1    # 0x23b260
movsd 0xaafaf(%rip), %xmm2    # 0x23dfe0
movq %r8, %rdi
movl %r15d, %esi
movq 0x98(%rsp), %r8
movq 0xa0(%rsp), %r14
movq %r14, %rdx
callq 0x18d637
leaq 0x1031da(%rip), %rcx    # 0x296230
movq 0x78(%rcx), %rdi
addq %r13, %rdi
leaq (%rbx,%rbp), %r15
addq $0xc0, %r15
movq %r12, %rsi
movl $0x1, %edx
movq %rcx, %rbx
movq %r15, %r8
callq 0x187aa2
addq 0x80(%rbx), %r13
movq %r13, %rdi
movq %r12, %rsi
movl $0x2, %edx
movq %rbx, %rcx
movq %r15, %r8
callq 0x187aa2
movl $0x80, %esi
movq %r14, %rdi
callq 0x19698b
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq