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

	//get_new_candidates(i, &g_read, &overlap_list, &array_list, &l, 0.001, 0);
    ha_get_candidates_interface(b->ab, i, &b->self_read, &b->olist, &b->olist_hp, &b->clist, 0.001, 
    asm_opt.max_n_chain, 0, NULL/**&(b->k_flag)**/, &b->r_buf, &(R_INF.paf[i]), &(R_INF.reverse_paf[i]), &(b->tmp_region), NULL, &(b->sp));

	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);

	update_overlaps(&b->olist, &(R_INF.paf[i]), &b->self_read, &b->ovlp_read, 1, 1);
	update_overlaps(&b->olist, &(R_INF.reverse_paf[i]), &b->self_read, &b->ovlp_read, 2, 0);
	///recover missing exact overlaps
	update_exact_overlaps(&b->olist, &b->self_read, &b->ovlp_read);

	///Final_phasing(&overlap_list, &cigarline, &g_read, &overlap_read, c2n);
	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);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rdi, -0x28(%rbp)
movq %rsi, -0x30(%rbp)
movl %edx, -0x34(%rbp)
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq 0xe0(%rax), %rdi
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq $0x8, %rdx
movq -0x40(%rbp), %rcx
addq $0xa0, %rcx
movq -0x40(%rbp), %r8
addq $0xc0, %r8
movq -0x40(%rbp), %r9
addq $0x48, %r9
leaq 0x3a9c62(%rip), %rax    # 0x3c47f8
movl 0xe8(%rax), %r15d
movq -0x40(%rbp), %r14
addq $0x12160, %r14          # imm = 0x12160
movq 0x3aa799(%rip), %rbx    # 0x3c5348
imulq $0x18, -0x30(%rbp), %rax
addq %rax, %rbx
movq 0x3aa792(%rip), %r11    # 0x3c5350
imulq $0x18, -0x30(%rbp), %rax
addq %rax, %r11
movq -0x40(%rbp), %r10
addq $0x121a0, %r10          # imm = 0x121A0
movq -0x40(%rbp), %rax
addq $0x12250, %rax          # imm = 0x12250
movsd 0x366d5d(%rip), %xmm0   # 0x381940
xorl %r12d, %r12d
xorl %r12d, %r12d
movl %r15d, (%rsp)
movl $0x0, 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 -0x40(%rbp), %rax
movq 0xa0(%rax), %rdi
movq -0x40(%rbp), %rax
movq 0xb0(%rax), %rsi
callq 0x1dfd0
movq 0x3aa701(%rip), %rax    # 0x3c5348
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq 0x3aa6ef(%rip), %rax    # 0x3c5348
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, %esi
callq 0xcd020
movq 0x3aa6de(%rip), %rax    # 0x3c5350
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq 0x3aa6cc(%rip), %rax    # 0x3c5350
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, %esi
callq 0xcd020
movq -0x40(%rbp), %rdi
addq $0xa0, %rdi
movq 0x3aa6a0(%rip), %rsi    # 0x3c5348
imulq $0x18, -0x30(%rbp), %rax
addq %rax, %rsi
movq -0x40(%rbp), %rdx
addq $0x8, %rdx
movq -0x40(%rbp), %rcx
addq $0x28, %rcx
movl $0x1, %r9d
movl %r9d, %r8d
callq 0x17dd0
movq -0x40(%rbp), %rdi
addq $0xa0, %rdi
movq 0x3aa670(%rip), %rsi    # 0x3c5350
imulq $0x18, -0x30(%rbp), %rax
addq %rax, %rsi
movq -0x40(%rbp), %rdx
addq $0x8, %rdx
movq -0x40(%rbp), %rcx
addq $0x28, %rcx
movl $0x2, %r8d
xorl %r9d, %r9d
callq 0x17dd0
movq -0x40(%rbp), %rdi
addq $0xa0, %rdi
movq -0x40(%rbp), %rsi
addq $0x8, %rsi
movq -0x40(%rbp), %rdx
addq $0x28, %rdx
callq 0x18d50
movq 0x3aa61b(%rip), %rdi    # 0x3c5348
imulq $0x18, -0x30(%rbp), %rax
addq %rax, %rdi
movq 0x3aa614(%rip), %rsi    # 0x3c5350
movq -0x40(%rbp), %rdx
addq $0xa0, %rdx
movl $0x1, %ecx
callq 0x14520
movq 0x3aa5f8(%rip), %rdi    # 0x3c5350
imulq $0x18, -0x30(%rbp), %rax
addq %rax, %rdi
movq 0x3aa5e9(%rip), %rsi    # 0x3c5350
movq -0x40(%rbp), %rdx
addq $0xa0, %rdx
movl $0x2, %ecx
callq 0x14520
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)