// File: /workspace/github_cpp_makefile_star2_O3/millanek[P]evo/./process_vcf_annotation_tools.h
// Function: BedCoordinateFeatures::getFeaturesinRegion(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int)
std::vector<std::vector <string> > getFeaturesinRegion(const string& scaffold, const int start, const int end) {
        std::vector<std::vector <string> > allFeatures;
        try {
            std::vector<std::vector<int> > featuresThisSc = BedFeatureMap.at(scaffold);
            //std::cerr << "There are " << aGThisSc[0].size() << " accessible intervals" << std::endl;
            /*for (std::map<std::string, std::vector<std::vector<int> > >::iterator i = accessibleGenomeMap.begin(); i != accessibleGenomeMap.end(); i++) {
             std::cerr << "There is scaffold: " << i->first << " in the map" << std::endl;
             } */
            
            
            // Binary search to find the first feature whose end coordinate is greater
            // or equal to the start of the region in question
            std::vector<int>::iterator itStart = lower_bound(featuresThisSc[1].begin(),featuresThisSc[1].end(),start);
            std::vector<int>::size_type index = std::distance(featuresThisSc[1].begin(), itStart);
            // Now check that the start coordinate of the feature is within
            
            // Sum the lengths
            while (featuresThisSc[0][index] <= end) {
                std::vector <string> feature;
                feature.push_back(scaffold); feature.push_back(numToString(featuresThisSc[0][index]));
                feature.push_back(numToString(featuresThisSc[1][index]));
                index++;
            }
            return allFeatures;
        } catch (const std::out_of_range& oor) {
            std::cerr << "No features on scaffold: " << scaffold << std::endl;
            return allFeatures;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %r8d, %ebp
movl %ecx, %r15d
movq %rdx, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, (%rsp)
movq $0x0, 0x10(%rdi)
leaq 0x8(%rsi), %rdi
movq %rdx, %rsi
callq 0x48a2c
leaq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x48a80
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
movq %rcx, %r13
testq %rdx, %rdx
jle 0x4726f
movq %rcx, %r13
movq %rdx, %rsi
shrq %rsi
movq %rsi, %rdi
notq %rdi
addq %rdx, %rdi
leaq 0x4(,%rsi,4), %rdx
addq %r13, %rdx
cmpl %r15d, -0x4(%rdx)
cmovlq %rdx, %r13
cmovgeq %rsi, %rdi
movq %rdi, %rdx
testq %rdi, %rdi
jg 0x47241
subq %rcx, %r13
movq (%rax), %rax
cmpl %ebp, (%rax,%r13)
jg 0x47339
leaq 0x18(%rsp), %rbx
leaq 0x40(%rsp), %r15
leaq 0x8(%rsp), %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x3133c
movq 0x28(%rsp), %rax
movq (%rax), %rax
movl (%rax,%r13), %esi
movq %r12, %rdi
callq 0x2e7e2
movq %r15, %rdi
movq %r12, %rsi
callq 0x3e784
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x472e0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
movl (%rax,%r13), %esi
movq %r12, %rdi
callq 0x2e7e2
movq %r15, %rdi
movq %r12, %rsi
callq 0x3e784
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x47317
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x8480
movq %r15, %rdi
callq 0x2e784
movq 0x28(%rsp), %rax
movq (%rax), %rax
leaq 0x4(%r13), %rcx
cmpl %ebp, 0x4(%rax,%r13)
movq %rcx, %r13
jle 0x4728e
leaq 0x28(%rsp), %rdi
callq 0x480b0
movq (%rsp), %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r12
movq %rax, %r15
jmp 0x4739d
jmp 0x47364
jmp 0x47364
jmp 0x4736c
movq %rdx, %r12
movq %rax, %r15
jmp 0x47389
movq %rdx, %r12
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x47389
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x40(%rsp), %rdi
callq 0x2e784
leaq 0x28(%rsp), %rdi
callq 0x480b0
cmpl $0x1, %r12d
jne 0x473f5
movq %r15, %rdi
callq 0x81c0
movq 0xbac36(%rip), %rdi     # 0x101fe8
leaq 0x87f3b(%rip), %rsi     # 0xcf2f4
movl $0x19, %edx
callq 0x84e0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0xbac17(%rip), %rdi     # 0x101fe8
callq 0x84e0
movq %rax, %rdi
callq 0x8200
callq 0x8760
jmp 0x47343
movq %rax, %r15
jmp 0x473f5
movq %rax, %r15
callq 0x8760
movq (%rsp), %rdi
callq 0x2efec
movq %r15, %rdi
callq 0x8840
movq %rax, %rdi
callq 0x288e1