// File: /workspace/github_cpp_makefile_star2_O1/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 0x1000aa(%rip), %r12    # 0x28a758
cvtsi2sdl 0xd0(%r12), %xmm0
movsd 0xa42d0(%rip), %xmm1    # 0x22e990
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
leaq 0x94(%rsp), %rcx
movl %eax, (%rcx)
mulsd 0xa2df5(%rip), %xmm0    # 0x22d4d0
cvttsd2si %xmm0, %rax
leaq 0x90(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x100b3f(%rip), %rsi    # 0x28b230
movq %rsi, %r14
movq %r15, %rdx
callq 0x33cf8
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 0x97833(%rip), %xmm0    # 0x222018
movsd 0xa4823(%rip), %xmm1    # 0x22f010
movsd 0xa759b(%rip), %xmm2    # 0x231d90
movq %r8, %rdi
movl %r15d, %esi
movq 0x98(%rsp), %r8
movq 0xa0(%rsp), %r14
movq %r14, %rdx
callq 0x185ff0
leaq 0x100a16(%rip), %rcx    # 0x28b230
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 0x180580
addq 0x80(%rbx), %r13
movq %r13, %rdi
movq %r12, %rsi
movl $0x2, %edx
movq %rbx, %rcx
movq %r15, %r8
callq 0x180580
movl $0x80, %esi
movq %r14, %rdi
callq 0x18db6a
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq