// File: chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: adjust_hap_overlaps_score(ma_utg_t*, float*, long long*, long long, long long, long long, long long)
void adjust_hap_overlaps_score(ma_utg_t* xReads, float *sim, long long *score, 
long long xUid, long long yUid, long long xBeg, long long xEnd)
{
    uint64_t all, found;
    if(count_unique_k_mers(xReads->s + xBeg, xEnd+1-xBeg, xUid, yUid, &all, &found))
    {
        double k_w = 1;
        if(sim) (*sim) = MAX((*sim), (all == 0?0:(((double)found)/((double)all))));
        if(all) k_w += ((double)(found)/(double)(all));
        if(score) (*score) = ((*score)*k_w)/2;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
addq -0x30(%rbp), %rdi
movq 0x10(%rbp), %rsi
addq $0x1, %rsi
subq -0x30(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq -0x38(%rbp), %r8
leaq -0x40(%rbp), %r9
callq 0x20fbc0
cmpq $0x0, %rax
je 0x177eb7
movsd 0x20a2dd(%rip), %xmm0   # 0x382000
movsd %xmm0, -0x48(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x177e34
movq -0x10(%rbp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x177d55
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x177d9d
movq -0x40(%rbp), %xmm0
movaps 0x20a2af(%rip), %xmm3   # 0x382010
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x20a2b3(%rip), %xmm2   # 0x382020
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x38(%rbp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x50(%rbp), %xmm0
movsd -0x58(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jb 0x177dc0
movq -0x10(%rbp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x60(%rbp)
jmp 0x177e23
cmpq $0x0, -0x38(%rbp)
jne 0x177dd1
xorps %xmm0, %xmm0
movsd %xmm0, -0x68(%rbp)
jmp 0x177e19
movq -0x40(%rbp), %xmm0
movaps 0x20a233(%rip), %xmm3   # 0x382010
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x20a237(%rip), %xmm2   # 0x382020
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x38(%rbp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, (%rax)
cmpq $0x0, -0x38(%rbp)
je 0x177e88
movq -0x40(%rbp), %xmm0
movaps 0x20a1c9(%rip), %xmm3   # 0x382010
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x20a1cd(%rip), %xmm2   # 0x382020
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x38(%rbp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x177eb5
movq -0x18(%rbp), %rax
cvtsi2sdq (%rax), %xmm0
mulsd -0x48(%rbp), %xmm0
movsd 0x20a443(%rip), %xmm1   # 0x3822e8
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x177eb7
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)