// File: millanek[P]evo/./process_vcf_annotation_tools.h
// Function: BedCoordinateFeatures::loadBedFeatureMap[abi:cxx11](std::basic_ifstream<char, std::char_traits<char>>*&, bool)
std::map<string, std::vector<std::vector<int> > > loadBedFeatureMap(std::ifstream*& bedFile, bool debug) {
        std::map<string, std::vector<std::vector<int> > > BedFeatureMap;
        std::vector<std::vector<int> > BedFeaturesThisScaffold;
        std::vector<int> featureStarts;
        std::vector<int> featureEnds;
        string line;
        string previousScaffold = "";
        //std::cerr << "Loading scaffold: " << currentScaffold << std::endl;
        while (getline(*bedFile, line)) {
            std::vector<string> currentFeature = split(line, '\t');
            if (currentFeature[0] != previousScaffold && previousScaffold != "") {
                if (debug) {
                    std::cerr << "Loading scaffold: " << previousScaffold << std::endl;
                    std::cerr << "Starts: " << std::endl;
                    print_vector(featureStarts, std::cerr);
                    std::cerr << "Ends: " << std::endl;
                    print_vector(featureEnds, std::cerr);
                }
                BedFeaturesThisScaffold.push_back(featureStarts);
                BedFeaturesThisScaffold.push_back(featureEnds);
                BedFeatureMap[previousScaffold] = BedFeaturesThisScaffold;
                BedFeaturesThisScaffold.clear(); featureStarts.clear(); featureEnds.clear();
                // std::cerr << "Loading scaffold: " << currentScaffold << std::endl;
            }
            featureStarts.push_back(atoi(currentFeature[1].c_str()));
            featureEnds.push_back(atoi(currentFeature[2].c_str()));
            // std::cerr << "Loading scaffold: " << currentFeature[0] << "\t" << currentScaffold << std::endl;
            previousScaffold = currentFeature[0];
            //std::cerr << "Loading scaffold: " << currentFeature[0] << "\t" << currentScaffold << std::endl;
        }
        // Final line / final scaffold
        BedFeaturesThisScaffold.push_back(featureStarts);
        BedFeaturesThisScaffold.push_back(featureEnds);
        BedFeatureMap[previousScaffold] = BedFeaturesThisScaffold;
        return BedFeatureMap;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x128(%rbp)
movb %cl, %al
movq %rdi, %rcx
movq %rcx, -0x120(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movb $0x0, -0x1a(%rbp)
callq 0x6cc00
leaq -0x38(%rbp), %rdi
callq 0x6ccb0
leaq -0x50(%rbp), %rdi
callq 0x46270
leaq -0x68(%rbp), %rdi
callq 0x46270
leaq -0x88(%rbp), %rdi
callq 0xa820
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0xab60
movq -0x118(%rbp), %rdx
leaq 0xc97ff(%rip), %rsi     # 0x135edf
leaq -0xa8(%rbp), %rdi
callq 0x2d6c0
jmp 0x6c6ee
leaq -0xa9(%rbp), %rdi
callq 0xa640
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq -0x88(%rbp), %rsi
callq 0xa0d0
movq %rax, -0x130(%rbp)
jmp 0x6c716
movq -0x130(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0xa740
movb %al, -0x131(%rbp)
jmp 0x6c734
movb -0x131(%rbp), %al
testb $0x1, %al
jne 0x6c743
jmp 0x6ca9a
leaq -0xd8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movl $0x9, %edx
callq 0x7bbe0
jmp 0x6c75d
leaq -0xd8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3d940
movq %rax, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x56980
testb $0x1, %al
jne 0x6c785
jmp 0x6c9e5
leaq 0xc9753(%rip), %rsi     # 0x135edf
leaq -0xa8(%rbp), %rdi
callq 0x50eb0
movb %al, -0x132(%rbp)
jmp 0x6c7a0
movb -0x132(%rbp), %al
testb $0x1, %al
jne 0x6c7af
jmp 0x6c9e5
testb $0x1, -0x19(%rbp)
je 0x6c97e
movq 0x12c830(%rip), %rdi    # 0x198ff0
leaq 0xccf59(%rip), %rsi     # 0x139720
callq 0xa5c0
movq %rax, -0x140(%rbp)
jmp 0x6c7d5
movq -0x140(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0xa520
movq %rax, -0x148(%rbp)
jmp 0x6c7f1
movq -0x148(%rbp), %rdi
movq 0x12c789(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x6c806
movq 0x12c7e3(%rip), %rdi    # 0x198ff0
leaq 0xccf1f(%rip), %rsi     # 0x139733
callq 0xa5c0
movq %rax, -0x150(%rbp)
jmp 0x6c822
movq -0x150(%rbp), %rdi
movq 0x12c758(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x6c837
leaq -0xf0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4cf20
jmp 0x6c849
movq 0x12c7a0(%rip), %rsi    # 0x198ff0
leaq -0xf0(%rbp), %rdi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x5f9b0
jmp 0x6c868
leaq -0xf0(%rbp), %rdi
callq 0x48290
movq 0x12c775(%rip), %rdi    # 0x198ff0
leaq 0xcceba(%rip), %rsi     # 0x13973c
callq 0xa5c0
movq %rax, -0x158(%rbp)
jmp 0x6c890
movq -0x158(%rbp), %rdi
movq 0x12c6ea(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x6c8a5
leaq -0x108(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x4cf20
jmp 0x6c8b7
movq 0x12c732(%rip), %rsi    # 0x198ff0
leaq -0x108(%rbp), %rdi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x5f9b0
jmp 0x6c8d6
leaq -0x108(%rbp), %rdi
callq 0x48290
jmp 0x6c97e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0xa9(%rbp), %rdi
callq 0xa640
jmp 0x6cb31
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x6cb25
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x6ca89
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x48290
jmp 0x6ca89
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x48290
jmp 0x6ca89
leaq -0x38(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x6ccd0
jmp 0x6c98d
leaq -0x38(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x6ccd0
jmp 0x6c99c
movq -0x128(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x6cd40
movq %rax, -0x160(%rbp)
jmp 0x6c9b8
movq -0x160(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x6ce20
jmp 0x6c9ca
leaq -0x38(%rbp), %rdi
callq 0x6d070
leaq -0x50(%rbp), %rdi
callq 0x6d090
leaq -0x68(%rbp), %rdi
callq 0x6d090
leaq -0xd8(%rbp), %rdi
movl $0x1, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movl %eax, -0x10c(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x10c(%rbp), %rsi
callq 0x4ce80
jmp 0x6ca1e
leaq -0xd8(%rbp), %rdi
movl $0x2, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movl %eax, -0x110(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x4ce80
jmp 0x6ca57
xorl %eax, %eax
movl %eax, %esi
leaq -0xd8(%rbp), %rdi
callq 0x3d940
movq %rax, %rsi
leaq -0xa8(%rbp), %rdi
callq 0xa060
jmp 0x6ca78
leaq -0xd8(%rbp), %rdi
callq 0x3dfa0
jmp 0x6c6fa
leaq -0xd8(%rbp), %rdi
callq 0x3dfa0
jmp 0x6cb25
leaq -0x38(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x6ccd0
jmp 0x6caa9
leaq -0x38(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x6ccd0
jmp 0x6cab8
movq -0x128(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x6cd40
movq %rax, -0x168(%rbp)
jmp 0x6cad4
movq -0x168(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x6ce20
jmp 0x6cae6
movb $0x1, -0x1a(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0xac88
leaq -0x88(%rbp), %rdi
callq 0xac88
leaq -0x68(%rbp), %rdi
callq 0x48290
leaq -0x50(%rbp), %rdi
callq 0x48290
leaq -0x38(%rbp), %rdi
callq 0x6d0b0
testb $0x1, -0x1a(%rbp)
jne 0x6cb72
jmp 0x6cb66
leaq -0xa8(%rbp), %rdi
callq 0xac88
leaq -0x88(%rbp), %rdi
callq 0xac88
leaq -0x68(%rbp), %rdi
callq 0x48290
leaq -0x50(%rbp), %rdi
callq 0x48290
leaq -0x38(%rbp), %rdi
callq 0x6d0b0
movq -0x128(%rbp), %rdi
callq 0x6cbc0
jmp 0x6cb82
movq -0x128(%rbp), %rdi
callq 0x6cbc0
movq -0x120(%rbp), %rax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
movq -0xb8(%rbp), %rdi
callq 0xab50
nop