// File: 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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movl %edx, -0x3c(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x5c0, %rcx, %rcx      # imm = 0x5C0
addq %rcx, %rax
movq %rax, -0x48(%rbp)
leaq 0x15cae9(%rip), %rax    # 0x3c47f8
cvtsi2sdl 0xd0(%rax), %xmm0
movsd 0x123b01(%rip), %xmm1   # 0x38b820
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
movl %ecx, -0x4c(%rbp)
cvtsi2sdl 0xd0(%rax), %xmm0
movsd 0x12257d(%rip), %xmm1   # 0x38a2b8
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq 0x15d57a(%rip), %rsi    # 0x3c52d0
callq 0xa380
movq -0x48(%rbp), %rax
movq 0xb8(%rax), %rdi
movq -0x38(%rbp), %rax
movl %eax, %esi
movq -0x48(%rbp), %rdx
movq -0x48(%rbp), %rcx
addq $0x20, %rcx
leaq 0x15ca79(%rip), %rax    # 0x3c47f8
movslq 0x94(%rax), %r8
leaq 0x15ca6b(%rip), %rax    # 0x3c47f8
movslq 0x80(%rax), %r9
movq -0x48(%rbp), %rax
addq $0x98, %rax
movq %rax, -0x68(%rbp)
movq -0x48(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %r13
addq $0x3e0, %r13            # imm = 0x3E0
movq -0x48(%rbp), %r12
addq $0x500, %r12            # imm = 0x500
movq -0x48(%rbp), %r15
addq $0x4d0, %r15            # imm = 0x4D0
movq -0x48(%rbp), %r14
addq $0x568, %r14            # imm = 0x568
leaq 0x15d4ef(%rip), %rax    # 0x3c52d0
movq 0x78(%rax), %r10
imulq $0x18, -0x38(%rbp), %rax
addq %rax, %r10
leaq 0x15d4dc(%rip), %rax    # 0x3c52d0
movq 0x80(%rax), %rax
imulq $0x18, -0x38(%rbp), %r11
addq %r11, %rax
movq %rax, -0x58(%rbp)
leaq 0x15d4c2(%rip), %rax    # 0x3c52d0
movsd 0x117232(%rip), %xmm0   # 0x37f048
xorl %r11d, %r11d
leaq -0x4c(%rbp), %rbx
leaq -0x50(%rbp), %r11
movsd 0x11a4bf(%rip), %xmm1   # 0x3822e8
movsd 0x126d7f(%rip), %xmm2   # 0x38ebb0
movq %rax, (%rsp)
movq -0x68(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0x60(%rbp), %rax
movq %rax, 0x10(%rsp)
movq -0x58(%rbp), %rax
movq %r13, 0x18(%rsp)
movq %r12, 0x20(%rsp)
movq %r15, 0x28(%rsp)
movl $0x1, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
movq %r14, 0x48(%rsp)
movq %rbx, 0x50(%rsp)
movq %r11, 0x58(%rsp)
movl $0x1, 0x60(%rsp)
movl $0x1, 0x68(%rsp)
movq $0x0, 0x70(%rsp)
movl $0xffffffff, 0x78(%rsp) # imm = 0xFFFFFFFF
movq %r10, 0x80(%rsp)
movq %rax, 0x88(%rsp)
callq 0x260980
leaq 0x15d410(%rip), %rax    # 0x3c52d0
movq 0x78(%rax), %rdi
imulq $0x18, -0x38(%rbp), %rax
addq %rax, %rdi
movq -0x48(%rbp), %rsi
addq $0x98, %rsi
movq -0x48(%rbp), %r8
addq $0xc0, %r8
movl $0x1, %edx
leaq 0x15d3e2(%rip), %rcx    # 0x3c52d0
callq 0x256850
leaq 0x15d3d6(%rip), %rax    # 0x3c52d0
movq 0x80(%rax), %rdi
imulq $0x18, -0x38(%rbp), %rax
addq %rax, %rdi
movq -0x48(%rbp), %rsi
addq $0x98, %rsi
movq -0x48(%rbp), %r8
addq $0xc0, %r8
movl $0x2, %edx
leaq 0x15d3a5(%rip), %rcx    # 0x3c52d0
callq 0x256850
movq -0x48(%rbp), %rdi
movl $0x80, %esi
callq 0x26e2d0
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq