// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Haplotype.cpp
// Function: SAHap::Haplotype::subtractMECValuesAt(unsigned long)
void Haplotype::subtractMECValuesAt(dnapos_t pos) {
	for (unsigned i = 0; i < ploidyCount; i++) {
		if ((int)i == solution[pos])
			continue;
		auto mec = weights[pos][i];
		total_mec -= mec;
		assert(total_mec>=0);

		if (isInRangeOf(window, pos))
			window_mec -= mec;
		if(window_mec < 0 && window_mec > -SMALL_ENOUGH_TO_IGNORE) window_mec = 0;
		assert(window_mec>=0);

		if(siteCoverages[i]) isitecost -= -log_poisson_1_cdf(READ_ERROR_RATE * siteCoverages[i], mec);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x30(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x68(%rcx), %eax
jae 0x11546
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rsi
callq 0x6160
movq %rax, %rcx
movl -0x34(%rbp), %eax
cmpl (%rcx), %eax
jne 0x11391
jmp 0x11538
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
movq -0x10(%rbp), %rsi
callq 0x6090
movq %rax, %rdi
movl -0x14(%rbp), %eax
movl %eax, %esi
callq 0x6160
movq %rax, %rcx
movq -0x30(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, -0x18(%rbp)
cvtsi2sdl -0x18(%rbp), %xmm1
movsd 0x50(%rax), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rax)
movsd 0x50(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x113de
jmp 0x113fd
leaq 0xb338(%rip), %rdi      # 0x1c71d
leaq 0xb241(%rip), %rsi      # 0x1c62d
movl $0xdd, %edx
leaq 0xb332(%rip), %rcx      # 0x1c72a
callq 0x2180
movq -0x30(%rbp), %rdi
movq 0xe0(%rdi), %rax
movq %rax, -0x28(%rbp)
movq 0xe8(%rdi), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rcx
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x11300
testb $0x1, %al
jne 0x1142e
jmp 0x11445
movq -0x30(%rbp), %rax
cvtsi2sdl -0x18(%rbp), %xmm1
movsd 0x58(%rax), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rax)
movq -0x30(%rbp), %rax
xorps %xmm0, %xmm0
ucomisd 0x58(%rax), %xmm0
jbe 0x11476
movq -0x30(%rbp), %rax
movsd 0x58(%rax), %xmm0
movsd 0xb1bc(%rip), %xmm1     # 0x1c620
ucomisd %xmm1, %xmm0
jbe 0x11476
movq -0x30(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x58(%rax)
movq -0x30(%rbp), %rax
movsd 0x58(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1148a
jmp 0x114a9
leaq 0xb1f6(%rip), %rdi      # 0x1c687
leaq 0xb195(%rip), %rsi      # 0x1c62d
movl $0xe2, %edx
leaq 0xb286(%rip), %rcx      # 0x1c72a
callq 0x2180
movq -0x30(%rbp), %rdi
addq $0x38, %rdi
movl -0x14(%rbp), %eax
movl %eax, %esi
callq 0x11df0
cmpq $0x0, (%rax)
je 0x11536
movq -0x30(%rbp), %rdi
addq $0x38, %rdi
movl -0x14(%rbp), %eax
movl %eax, %esi
callq 0x11df0
movq (%rax), %xmm1
movaps 0xab32(%rip), %xmm0     # 0x1c010
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0xab36(%rip), %xmm0     # 0x1c020
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movsd 0xab4f(%rip), %xmm0     # 0x1c050
mulsd %xmm1, %xmm0
movl -0x18(%rbp), %edi
callq 0x1b960
movq -0x30(%rbp), %rax
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm1
movsd 0x60(%rax), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x60(%rax)
jmp 0x11538
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1135f
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)