// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Haplotype.cpp
// Function: SAHap::Haplotype::mec(unsigned long, unsigned long)
double Haplotype::mec(dnapos_t s, dnapos_t e) {
    double out = 0;
    assert(e>=s);

    for (unsigned j = 0; j < ploidyCount; j++) {
	for (dnapos_t i = s; i <= e && i < this->length; i++) {
	    if (solution[i] == (int)j) // solution is signed since (-1) is used to mean "undefined"
		continue;
	    if(weights[i][j] < 0 && weights[i][j] > -SMALL_ENOUGH_TO_IGNORE) weights[i][j] = 0;
	    assert(weights[i][j]>=0);
	    out += weights[i][j];
	}
    }
    assert(out>=0);
    return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jb 0x108f0
jmp 0x1090f
leaq 0xbd31(%rip), %rdi      # 0x1c628
leaq 0xbd2f(%rip), %rsi      # 0x1c62d
movl $0x5b, %edx
leaq 0xbd35(%rip), %rcx      # 0x1c63f
callq 0x2180
movl $0x0, -0x24(%rbp)
movq -0x38(%rbp), %rcx
movl -0x24(%rbp), %eax
cmpl 0x68(%rcx), %eax
jae 0x10a7c
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
xorl %eax, %eax
cmpq -0x18(%rbp), %rcx
movb %al, -0x39(%rbp)
ja 0x1094f
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
cmpq 0x18(%rcx), %rax
setb %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x1095b
jmp 0x10a6c
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x6160
movl (%rax), %eax
cmpl -0x24(%rbp), %eax
jne 0x10974
jmp 0x10a5b
movq -0x38(%rbp), %rdi
addq $0x20, %rdi
movq -0x30(%rbp), %rsi
callq 0x6090
movq %rax, %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0x6160
cmpl $0x0, (%rax)
jge 0x109eb
movq -0x38(%rbp), %rdi
addq $0x20, %rdi
movq -0x30(%rbp), %rsi
callq 0x6090
movq %rax, %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0x6160
cvtsi2sdl (%rax), %xmm0
movsd 0xbc5f(%rip), %xmm1     # 0x1c620
ucomisd %xmm1, %xmm0
jbe 0x109eb
movq -0x38(%rbp), %rdi
addq $0x20, %rdi
movq -0x30(%rbp), %rsi
callq 0x6090
movq %rax, %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0x6160
movl $0x0, (%rax)
movq -0x38(%rbp), %rdi
addq $0x20, %rdi
movq -0x30(%rbp), %rsi
callq 0x6090
movq %rax, %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0x6160
cmpl $0x0, (%rax)
jl 0x10a10
jmp 0x10a2f
leaq 0xbc59(%rip), %rdi      # 0x1c670
leaq 0xbc0f(%rip), %rsi      # 0x1c62d
movl $0x62, %edx
leaq 0xbc15(%rip), %rcx      # 0x1c63f
callq 0x2180
movq -0x38(%rbp), %rdi
addq $0x20, %rdi
movq -0x30(%rbp), %rsi
callq 0x6090
movq %rax, %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0x6160
cvtsi2sdl (%rax), %xmm0
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x1092e
jmp 0x10a6e
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x10916
movsd -0x20(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x10a8c
jmp 0x10aab
leaq 0xb6fe(%rip), %rdi      # 0x1c191
leaq 0xbb93(%rip), %rsi      # 0x1c62d
movl $0x66, %edx
leaq 0xbb99(%rip), %rcx      # 0x1c63f
callq 0x2180
movsd -0x20(%rbp), %xmm0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)