// File: millanek[P]evo/./process_vcf_annotation_tools.h
// Function: LinkedCoordsBed::getMeanPerElement(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, double>>>&)
std::vector<double> getMeanPerElement(std::unordered_map<string, double>& posDxyMap) {
        std::vector<double> elementDxyValues;
        for (int i = 0; i < (int)elementCoordsVector.size(); i++) {
            std::vector<std::vector<string> > thisElement = elementCoordsVector[i];
            double elementDxyTotal = 0; int elementLengthTotal = 0;
            for (int j = 0; j < (int)thisElement.size(); j++) {
                std::vector<string> thisCoordVector = thisElement[j];
                string currentScaffold = thisCoordVector[0];
                int left = atoi(thisCoordVector[1].c_str());
                int right = atoi(thisCoordVector[2].c_str());
                int intervalLength = right - left;
                for (int k = 0; k < intervalLength; k++) {
                    string genomeLocation = currentScaffold+"\t"+numToString(left+k+1);
                    if (posDxyMap.count(genomeLocation) == 1) {
                        elementDxyTotal = elementDxyTotal + posDxyMap[genomeLocation];
                    }
                }
                elementLengthTotal = elementLengthTotal + intervalLength;
            }
            elementDxyValues.push_back(elementDxyTotal/elementLengthTotal);
        }
        return elementDxyValues;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x120(%rbp)
movq %rdi, %rax
movq %rax, -0x118(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x110(%rbp)
movb $0x0, -0x19(%rbp)
callq 0x48410
movl $0x0, -0x20(%rbp)
movq -0x110(%rbp), %rdi
movl -0x20(%rbp), %eax
movl %eax, -0x124(%rbp)
callq 0x45780
movq %rax, %rcx
movl -0x124(%rbp), %eax
cmpl %ecx, %eax
jge 0x3e923
movq -0x110(%rbp), %rdi
movslq -0x20(%rbp), %rsi
callq 0x48430
movq %rax, %rsi
leaq -0x38(%rbp), %rdi
callq 0x45190
jmp 0x3e617
xorps %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x128(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x409f0
movq %rax, %rcx
movl -0x128(%rbp), %eax
cmpl %ecx, %eax
jge 0x3e8d6
movslq -0x58(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x3ec10
movq %rax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x3fee0
jmp 0x3e66b
xorl %eax, %eax
movl %eax, %esi
leaq -0x70(%rbp), %rdi
callq 0x3d940
movq %rax, %rsi
leaq -0x90(%rbp), %rdi
callq 0xa250
jmp 0x3e689
leaq -0x70(%rbp), %rdi
movl $0x1, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movl %eax, -0x94(%rbp)
leaq -0x70(%rbp), %rdi
movl $0x2, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %eax
subl -0x94(%rbp), %eax
movl %eax, -0x9c(%rbp)
movl $0x0, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
cmpl -0x9c(%rbp), %eax
jge 0x3e890
leaq 0xf77d8(%rip), %rdx     # 0x135ede
leaq -0xe0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x3da80
jmp 0x3e71b
movl -0x94(%rbp), %edx
movl -0xa0(%rbp), %eax
movl %eax, %ecx
movl %edx, %eax
leal 0x1(%rax,%rcx), %esi
leaq -0x100(%rbp), %rdi
callq 0x3e190
jmp 0x3e73d
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
leaq -0x100(%rbp), %rdx
callq 0x3e070
jmp 0x3e759
leaq -0x100(%rbp), %rdi
callq 0xac88
leaq -0xe0(%rbp), %rdi
callq 0xac88
movq -0x18(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x3e530
movq %rax, -0x130(%rbp)
jmp 0x3e78a
movq -0x130(%rbp), %rax
cmpq $0x1, %rax
jne 0x3e870
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x140(%rbp)
movq -0x18(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x3e560
movq %rax, -0x138(%rbp)
jmp 0x3e7c1
movq -0x138(%rbp), %rax
movsd -0x140(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
jmp 0x3e870
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3e949
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3e918
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3e8cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3e8bf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3e848
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x100(%rbp), %rdi
callq 0xac88
leaq -0xe0(%rbp), %rdi
callq 0xac88
jmp 0x3e8bf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0xac88
jmp 0x3e8bf
leaq -0xc0(%rbp), %rdi
callq 0xac88
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0x3e6ed
movl -0x54(%rbp), %eax
addl -0x9c(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xac88
leaq -0x70(%rbp), %rdi
callq 0x3dfa0
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x3e62d
leaq -0x90(%rbp), %rdi
callq 0xac88
leaq -0x70(%rbp), %rdi
callq 0x3dfa0
jmp 0x3e918
movq -0x120(%rbp), %rdi
movsd -0x50(%rbp), %xmm0
cvtsi2sdl -0x54(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x108(%rbp)
leaq -0x108(%rbp), %rsi
callq 0x48450
jmp 0x3e901
leaq -0x38(%rbp), %rdi
callq 0x3ec50
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x3e5d3
leaq -0x38(%rbp), %rdi
callq 0x3ec50
jmp 0x3e949
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x3e939
movq -0x120(%rbp), %rdi
callq 0x3ecb0
movq -0x118(%rbp), %rax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0x120(%rbp), %rdi
callq 0x3ecb0
movq -0x40(%rbp), %rdi
callq 0xab50
nop