// File: /workspace/github_cpp_makefile_star2_O3/millanek[P]evo/./process_vcf_annotation_tools.h
// Function: SimpleCoordsBed::loadSimpleCoords(std::basic_ifstream<char, std::char_traits<char>>*&, std::map<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<int>, std::allocator<std::pair<int const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&)
std::map<string, std::vector<std::vector<string> > > loadSimpleCoords(std::ifstream*& bedFile, std::map<int,string>& linearToGenomeCoordMap) {
        std::map<string, std::vector<std::vector<string> > > coordsScaffoldMap;
        std::vector<std::vector<string> > coordsInScaffold;
        int linearPosition = 0; // Linear positions will be 0-indexed (will start at zero)
        string line;
        // Do the first line to find the name of the first scaffold
        getline(*bedFile, line);
        std::vector<string> bedVector = split(line, '\t');
        string currentScaffold = bedVector[0];
        int left = atoi(bedVector[1].c_str());
        int right = atoi(bedVector[2].c_str());
        int intervalLength = right - left;
        coordsInScaffold.push_back(bedVector);
        
        for (int i = 0; i < intervalLength; i++) {
            // Mapping will be 1-indexed, as in VCF files
            linearToGenomeCoordMap[linearPosition+i] = currentScaffold+"\t"+numToString(left+i+1);
        } linearPosition = linearPosition + intervalLength;
        
        //
        while (getline(*bedFile, line)) {
            std::vector<string> bedVector = split(line, '\t');
            string scaffold = bedVector[0];
            int left = atoi(bedVector[1].c_str());
            int right = atoi(bedVector[2].c_str());
            int intervalLength = right - left;
            
            for (int i = 0; i < intervalLength; i++) {
                // Mapping will be 1-indexed, as in VCF files
                int pos = linearPosition+i;
                if (pos % 1000000 == 0)
                    std::cerr << "Loaded and mapped " << pos/1000000 << "Mb" << std::endl;
                linearToGenomeCoordMap[pos] = currentScaffold+"\t"+numToString(left+i+1);
            } linearPosition = linearPosition + intervalLength;
            
            if (scaffold == currentScaffold) {
                coordsInScaffold.push_back(bedVector);
            } else {
                coordsScaffoldMap[currentScaffold] = coordsInScaffold;
                coordsInScaffold.clear();
                currentScaffold = scaffold;
            }
        }
        return coordsScaffoldMap;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rcx, 0xd8(%rsp)
leaq 0x8(%rdi), %rax
movl $0x0, 0x8(%rdi)
xorl %ecx, %ecx
movq %rcx, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rdi, 0x70(%rsp)
movq %rcx, 0x28(%rdi)
movq %rcx, 0xd0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xc0(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb $0x0, (%rax)
movq %rdx, 0x100(%rsp)
movq (%rdx), %rbx
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
leaq 0xe0(%rsp), %rsi
movq %rbx, %rdi
callq 0x8870
leaq 0x120(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movl $0x9, %edx
callq 0x4d650
movq 0x120(%rsp), %rax
leaq 0x88(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rdi
callq 0x2ba06
leaq 0x120(%rsp), %r15
movq (%r15), %rbx
movq 0x20(%rbx), %rdi
callq 0x86e0
movl %eax, %ebp
movq 0x40(%rbx), %rdi
callq 0x86e0
movl %eax, %ebx
leaq 0xc0(%rsp), %rdi
movq %r15, %rsi
callq 0x2f876
subl %ebp, %ebx
leaq 0x60(%rsp), %r14
movl %ebx, 0x24(%rsp)
testl %ebx, %ebx
jle 0x2f2b9
incl %ebp
xorl %r12d, %r12d
leaq 0x38(%rsp), %rbx
movq %rsp, %r15
leaq 0x50(%rsp), %r13
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x2ba06
movq %r15, %rdi
leaq 0x9e840(%rip), %rsi     # 0xcd9ca
callq 0x88c0
leal (%r12,%rbp), %esi
movq %r13, %rdi
callq 0x2e7e2
movq (%rsp), %rcx
movl $0xf, %edi
leaq 0x10(%rsp), %rax
cmpq %rax, %rcx
je 0x2f1b3
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %r8
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0x2f1df
movl $0xf, %edi
cmpq %r14, %rsi
je 0x2f1da
movq 0x60(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x2f1e9
movq %r15, %rdi
callq 0x8180
jmp 0x2f1f5
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x84d0
movq %rbx, 0x28(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x2f215
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x2f21b
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movl %r12d, 0xa0(%rsp)
movq 0xd8(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x2f8a2
movq %rax, %rdi
leaq 0x28(%rsp), %rsi
callq 0x8540
movq 0x28(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2f279
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x2f290
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x8480
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2f2ab
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
incl %r12d
cmpl %r12d, 0x24(%rsp)
jne 0x2f15f
leaq 0xe0(%rsp), %rbx
leaq 0x108(%rsp), %rbp
leaq 0x50(%rsp), %r13
movq 0x100(%rsp), %rax
movq (%rax), %r15
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2f66a
movq %rbp, %rdi
movq %rbx, %rsi
movl $0x9, %edx
callq 0x4d650
movq 0x108(%rsp), %rax
leaq 0x38(%rsp), %rcx
movq %rcx, 0x28(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x2ba06
movq 0x108(%rsp), %rbx
movq 0x20(%rbx), %rdi
callq 0x86e0
movl %eax, %ebp
movq 0x40(%rbx), %rdi
callq 0x86e0
movl %eax, %r12d
subl %ebp, %eax
movl %eax, 0x9c(%rsp)
jle 0x2f586
incl %ebp
negl %r12d
movl 0x24(%rsp), %ebx
movl %ebx, 0x4c(%rsp)
imull $0x68c26139, %ebx, %eax # imm = 0x68C26139
addl $0x218c0, %eax          # imm = 0x218C0
rorl $0x6, %eax
cmpl $0x10c6, %eax           # imm = 0x10C6
ja 0x2f40e
movl $0x12, %edx
movq 0xd2c49(%rip), %rdi     # 0x101fe8
leaq 0x9cb63(%rip), %rsi     # 0xcbf09
callq 0x84e0
movslq 0x4c(%rsp), %rax
imulq $0x431bde83, %rax, %rsi # imm = 0x431BDE83
movq %rsi, %rax
shrq $0x3f, %rax
sarq $0x32, %rsi
addl %eax, %esi
movq 0xd2c1d(%rip), %rdi     # 0x101fe8
callq 0x8810
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
leaq 0x9cb3a(%rip), %rsi     # 0xcbf1c
callq 0x84e0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r15, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq %r14, 0x50(%rsp)
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x2ba06
movq %r13, %rdi
leaq 0x9e595(%rip), %rsi     # 0xcd9ca
callq 0x88c0
leaq 0xa0(%rsp), %rdi
movl %ebp, %esi
callq 0x2e7e2
movq 0x50(%rsp), %rcx
movl $0xf, %edi
cmpq %r14, %rcx
je 0x2f45d
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %r8
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0x2f49a
movl $0xf, %edi
leaq 0xb0(%rsp), %r9
cmpq %r9, %rsi
je 0x2f495
movq 0xb0(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x2f4a4
movq %r13, %rdi
callq 0x8180
jmp 0x2f4b5
leaq 0xa0(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x84d0
leaq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x2f4d8
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x2f4de
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0xd8(%rsp), %rdi
leaq 0x4c(%rsp), %rsi
callq 0x2e91e
movq %rax, %rdi
movq %rsp, %rsi
callq 0x8540
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2f533
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x2f558
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x2f56f
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x8480
leal (%r12,%rbp), %eax
incl %eax
movl %ebp, %ecx
incl %ecx
incl %ebx
movl %ecx, %ebp
cmpl $0x1, %eax
jne 0x2f37a
movq 0x30(%rsp), %rdx
cmpq 0x80(%rsp), %rdx
jne 0x2f5ad
testq %rdx, %rdx
je 0x2f616
movq 0x78(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x8490
testl %eax, %eax
je 0x2f616
movq 0x70(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x2f908
leaq 0x108(%rsp), %rbp
movq %rax, %rdi
leaq 0xc0(%rsp), %rsi
callq 0x2f984
movq 0xc0(%rsp), %rbx
movq 0xc8(%rsp), %r12
cmpq %rbx, %r12
je 0x2f605
movq %rbx, %r15
movq %r15, %rdi
callq 0x2e784
addq $0x18, %r15
cmpq %r12, %r15
jne 0x2f5ec
movq %rbx, 0xc8(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x8270
jmp 0x2f62e
leaq 0xc0(%rsp), %rdi
leaq 0x108(%rsp), %rbp
movq %rbp, %rsi
callq 0x2f876
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x2f64a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8480
movl 0x9c(%rsp), %eax
addl %eax, 0x24(%rsp)
movq %rbp, %rdi
callq 0x2e784
leaq 0xe0(%rsp), %rbx
jmp 0x2f2ce
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x2f68c
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x120(%rsp), %rdi
callq 0x2e784
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x2f6be
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xc0(%rsp), %rdi
callq 0x2efec
movq 0x70(%rsp), %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2f763
movq %rax, %r15
jmp 0x2f825
jmp 0x2f6ee
movq %rax, %r15
jmp 0x2f832
jmp 0x2f763
jmp 0x2f6fa
movq %rax, %r15
jmp 0x2f735
movq %rax, %r15
jmp 0x2f71e
movq %rax, %r15
movq 0x28(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2f71e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x2f735
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x8480
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2f803
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x2f803
movq %rax, %r15
jmp 0x2f7f6
jmp 0x2f763
movq %rax, %r15
jmp 0x2f803
jmp 0x2f7d7
jmp 0x2f76f
movq %rax, %r15
jmp 0x2f7be
jmp 0x2f7d7
movq %rax, %r15
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2f799
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x2f799
movq %rax, %r15
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x2f7be
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x2f7da
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x2f7da
movq %rax, %r15
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x2f7f6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x108(%rsp), %rdi
callq 0x2e784
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x2f825
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x120(%rsp), %rdi
callq 0x2e784
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x2f857
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xc0(%rsp), %rdi
callq 0x2efec
movq 0x70(%rsp), %rdi
callq 0x30870
movq %r15, %rdi
callq 0x8840