// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rdx, %r14
movq %rdi, %rbx
movl %ecx, 0x4(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x8(%rsi), %rdi
movq %rdx, %rsi
callq 0x3c2be
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x3c304
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x20(%rax), %rsi
leaq 0x4(%rsp), %rdx
callq 0x3c387
movq %rax, %r15
movq 0x8(%rsp), %rax
subq 0x18(%rax), %r15
leaq 0x20(%rsp), %r12
leaq 0x38(%rsp), %r13
movq (%rax), %rax
cmpl %ebp, (%rax,%r15)
jg 0x3aefb
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x2b0a4
movq 0x8(%rsp), %rax
movq (%rax), %rax
movl (%rax,%r15), %esi
movq %r13, %rdi
callq 0x28ad3
movq %r12, %rdi
movq %r13, %rsi
callq 0x3490e
movq %r13, %rdi
callq 0x8978
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl (%rax,%r15), %esi
movq %r13, %rdi
callq 0x28ad3
movq %r12, %rdi
movq %r13, %rsi
callq 0x3490e
movq %r13, %rdi
callq 0x8978
movq %r12, %rdi
callq 0x28a08
movq 0x8(%rsp), %rax
addq $0x4, %r15
jmp 0x3ae74
leaq 0x8(%rsp), %rdi
callq 0x3b73c
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r12
movq %rax, %r15
jmp 0x3af4f
movq %rdx, %r12
movq %rax, %r15
jmp 0x3af59
jmp 0x3af3f
jmp 0x3af2d
jmp 0x3af3f
movq %rdx, %r12
movq %rax, %r15
leaq 0x38(%rsp), %rdi
callq 0x8978
jmp 0x3af45
movq %rdx, %r12
movq %rax, %r15
leaq 0x20(%rsp), %rdi
callq 0x28a08
leaq 0x8(%rsp), %rdi
callq 0x3b73c
cmpl $0x1, %r12d
jne 0x3afa4
movq %r15, %rdi
callq 0x81d0
movq 0xa207a(%rip), %rdi     # 0xdcfe8
leaq 0x632b3(%rip), %rsi     # 0x9e228
callq 0x8480
movq %rax, %rdi
movq %r14, %rsi
callq 0x8430
movq %rax, %rdi
callq 0x8230
callq 0x8780
jmp 0x3af05
movq %rax, %r15
jmp 0x3afa4
movq %rax, %r15
callq 0x8780
movq %rbx, %rdi
callq 0x29054
movq %r15, %rdi
callq 0x8870
movq %rax, %rdi
callq 0x21a26