// File: /workspace/github_cpp_makefile_star2_O2/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), %rbx
movslq %edx, %rax
imulq $0x5c0, %rax, %rbp      # imm = 0x5C0
leaq (%rbx,%rbp), %rdi
movq %rdi, 0xa0(%rsp)
leaq 0x10717b(%rip), %r12    # 0x253758
cvtsi2sdl 0xd0(%r12), %xmm0
movsd 0xa04a1(%rip), %xmm1    # 0x1eca90
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
leaq 0x94(%rsp), %rcx
movl %eax, (%rcx)
mulsd 0x9efb6(%rip), %xmm0    # 0x1eb5c0
cvttsd2si %xmm0, %rax
leaq 0x90(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x107c10(%rip), %rsi    # 0x254230
movq %rsi, %r14
movq %r15, %rdx
callq 0x715e
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(%rbx,%rbp), %r12
leaq 0x40(%rbx,%rbp), %rdi
leaq (%rbx,%rbp), %rdx
addq $0x3e0, %rdx            # imm = 0x3E0
leaq (%rbx,%rbp), %rsi
addq $0x4d0, %rsi            # imm = 0x4D0
leaq (%rbx,%rbp), %r10
addq $0x568, %r10            # imm = 0x568
imulq $0x18, %r15, %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)
pushq $0x1
popq %rax
movl %eax, 0x68(%rsp)
movl %eax, 0x60(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x38(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
movl %eax, 0x30(%rsp)
movq %r12, 0x8(%rsp)
orl $-0x1, 0x78(%rsp)
movq %r14, (%rsp)
andq $0x0, 0x70(%rsp)
movsd 0x93910(%rip), %xmm0    # 0x1e0018
movsd 0xa0a40(%rip), %xmm1    # 0x1ed150
movsd 0xa3788(%rip), %xmm2    # 0x1efea0
movq %r8, %rdi
movl %r15d, %esi
movq 0x98(%rsp), %r8
movq 0xa0(%rsp), %r14
movq %r14, %rdx
callq 0x148800
leaq 0x107af3(%rip), %rcx    # 0x254230
movq 0x78(%rcx), %rdi
addq %r13, %rdi
leaq (%rbx,%rbp), %r15
addq $0xc0, %r15
movq %r12, %rsi
pushq $0x1
popq %rdx
movq %rcx, %rbx
movq %r15, %r8
callq 0x14341f
addq 0x80(%rbx), %r13
pushq $0x2
popq %rdx
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rcx
movq %r15, %r8
callq 0x14341f
movl $0x80, %esi
movq %r14, %rdi
callq 0x14f9cd
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq