// File: chhylp123[P]hifiasm/Assembly.cpp
// Function: worker_ovec_cal0(void*, long, int)
static void worker_ovec_cal0(void *data, long i, int tid)
{
	ha_ovec_buf_t *b = ((ha_ovec_buf_t**)data)[tid];
	int fully_cov, abnormal;

    ha_get_candidates_interface(b->ab, i, &b->self_read, &b->olist, &b->olist_hp, &b->clist, 
    0.02, asm_opt.max_n_chain, 1, NULL/**&(b->k_flag)**/, &b->r_buf, &(R_INF.paf[i]), &(R_INF.reverse_paf[i]), &(b->tmp_region), NULL, &(b->sp));

	clear_Cigar_record(&b->cigar1);
	clear_Round2_alignment(&b->round2);

	correct_overlap(&b->olist, &R_INF, &b->self_read, &b->correct, &b->ovlp_read, &b->POA_Graph, &b->DAGCon,
			&b->cigar1, &b->hap, &b->round2, &b->r_buf, &(b->tmp_region.w_list), 0, 0/**1***/, &fully_cov, &abnormal);

	b->num_read_base += b->self_read.length;
	b->num_correct_base += b->correct.corrected_base;
	b->num_recorrect_base += b->round2.dumy.corrected_base;


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

    // R_INF.paf[i].is_fully_corrected = 0;
    // if (fully_cov) {
    //     if (get_cigar_errors(&b->cigar1) == 0 && get_cigar_errors(&b->round2.cigar) == 0)
    //         R_INF.paf[i].is_fully_corrected = 1;
    // }
    // R_INF.paf[i].is_abnormal = abnormal;
    // R_INF.trio_flag[i] = AMBIGU;
    
    push_final_overlaps(&(R_INF.paf[i]), R_INF.reverse_paf, &b->olist, 1);
    push_final_overlaps(&(R_INF.reverse_paf[i]), R_INF.reverse_paf, &b->olist, 2);

    if(het_cnt) het_cnt[i] = get_het_cnt(&b->hap);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movl %edx, -0x3c(%rbp)
movq -0x30(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq 0xe0(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq $0x8, %rdx
movq -0x48(%rbp), %rcx
addq $0xa0, %rcx
movq -0x48(%rbp), %r8
addq $0xc0, %r8
movq -0x48(%rbp), %r9
addq $0x48, %r9
leaq 0x3acc90(%rip), %rax    # 0x3c47f8
movl 0xe8(%rax), %r15d
movq -0x48(%rbp), %r14
addq $0x12160, %r14          # imm = 0x12160
movq 0x3ad7c7(%rip), %rbx    # 0x3c5348
imulq $0x18, -0x38(%rbp), %rax
addq %rax, %rbx
movq 0x3ad7c0(%rip), %r11    # 0x3c5350
imulq $0x18, -0x38(%rbp), %rax
addq %rax, %r11
movq -0x48(%rbp), %r10
addq $0x121a0, %r10          # imm = 0x121A0
movq -0x48(%rbp), %rax
addq $0x12250, %rax          # imm = 0x12250
movsd 0x367493(%rip), %xmm0   # 0x37f048
xorl %r12d, %r12d
movl %r15d, (%rsp)
movl $0x1, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r11, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movq %rax, 0x40(%rsp)
callq 0x1a3450
movq -0x48(%rbp), %rdi
addq $0x108, %rdi            # imm = 0x108
callq 0x31d60
movq -0x48(%rbp), %rdi
addq $0x9330, %rdi           # imm = 0x9330
callq 0x31cb0
movq -0x48(%rbp), %rdi
addq $0xa0, %rdi
movq -0x48(%rbp), %rdx
addq $0x8, %rdx
movq -0x48(%rbp), %rcx
addq $0x2c0, %rcx            # imm = 0x2C0
movq -0x48(%rbp), %r8
addq $0x28, %r8
movq -0x48(%rbp), %r9
addq $0x148, %r9             # imm = 0x148
movq -0x48(%rbp), %r13
addq $0x200, %r13            # imm = 0x200
movq -0x48(%rbp), %r12
addq $0x108, %r12            # imm = 0x108
movq -0x48(%rbp), %r15
addq $0x9040, %r15           # imm = 0x9040
movq -0x48(%rbp), %r14
addq $0x9330, %r14           # imm = 0x9330
movq -0x48(%rbp), %rbx
addq $0x12160, %rbx          # imm = 0x12160
movq -0x48(%rbp), %r11
addq $0x121a0, %r11          # imm = 0x121A0
addq $0x48, %r11
leaq 0x3ad63e(%rip), %rsi    # 0x3c52d0
xorl %eax, %eax
leaq -0x4c(%rbp), %r10
leaq -0x50(%rbp), %rax
movq %r13, (%rsp)
movq %r12, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r11, 0x28(%rsp)
movl $0x0, 0x30(%rsp)
movl $0x0, 0x38(%rsp)
movq %r10, 0x40(%rsp)
movq %rax, 0x48(%rsp)
callq 0x4c230
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x48(%rbp), %rax
addq 0xf0(%rax), %rcx
movq %rcx, 0xf0(%rax)
movq -0x48(%rbp), %rax
movq 0x2e0(%rax), %rcx
movq -0x48(%rbp), %rax
addq 0xf8(%rax), %rcx
movq %rcx, 0xf8(%rax)
movq -0x48(%rbp), %rax
movq 0x9350(%rax), %rcx
movq -0x48(%rbp), %rax
addq 0x100(%rax), %rcx
movq %rcx, 0x100(%rax)
movq 0x3ad5c5(%rip), %rax    # 0x3c52f8
movq -0x38(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq 0x3ad606(%rip), %rdi    # 0x3c5348
imulq $0x18, -0x38(%rbp), %rax
addq %rax, %rdi
movq 0x3ad5ff(%rip), %rsi    # 0x3c5350
movq -0x48(%rbp), %rdx
addq $0xa0, %rdx
movl $0x1, %ecx
callq 0x14520
movq 0x3ad5e3(%rip), %rdi    # 0x3c5350
imulq $0x18, -0x38(%rbp), %rax
addq %rax, %rdi
movq 0x3ad5d4(%rip), %rsi    # 0x3c5350
movq -0x48(%rbp), %rdx
addq $0xa0, %rdx
movl $0x2, %ecx
callq 0x14520
cmpq $0x0, 0x3ad6ef(%rip)    # 0x3c5488
je 0x17dbb
movq -0x48(%rbp), %rdi
addq $0x9040, %rdi           # imm = 0x9040
callq 0x15570
movl %eax, %edx
movq 0x3ad6d4(%rip), %rax    # 0x3c5488
movq -0x38(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw (%rax,%rax)