// File: /workspace/github_cpp_makefile_star2_O1/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 0x50624
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 0x2e45c
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 0x32338
subl %ebp, %ebx
leaq 0x60(%rsp), %r14
movl %ebx, 0x24(%rsp)
testl %ebx, %ebx
jle 0x31d6e
incl %ebp
xorl %ebx, %ebx
movq %rsp, %r15
leaq 0x50(%rsp), %r13
leaq 0x28(%rsp), %r12
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x2e45c
movq %r15, %rdi
leaq 0xa0045(%rip), %rsi     # 0xd1c7e
callq 0x88c0
leal (%rbx,%rbp), %esi
movq %r13, %rdi
callq 0x31297
movq (%rsp), %rcx
movl $0xf, %esi
leaq 0x10(%rsp), %rax
cmpq %rax, %rcx
je 0x31c61
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %r8
movq 0x58(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0x31c8a
movl $0xf, %esi
cmpq %r14, 0x50(%rsp)
je 0x31c85
movq 0x60(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x31c99
movq 0x50(%rsp), %rsi
movq %r15, %rdi
callq 0x8180
jmp 0x31ca5
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x84d0
leaq 0x38(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x31cca
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x31cd0
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movl %ebx, 0xa0(%rsp)
movq 0xd8(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x32364
movq %rax, %rdi
movq %r12, %rsi
callq 0x8540
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x31d30
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x31d47
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x8480
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x31d62
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
incl %ebx
cmpl %ebx, 0x24(%rsp)
jne 0x31c0e
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 0x32124
movq %rbp, %rdi
movq %rbx, %rsi
movl $0x9, %edx
callq 0x50624
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 0x2e45c
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 0x32040
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 0x31ec3
movl $0x12, %edx
movq 0xd9194(%rip), %rdi     # 0x10afe8
leaq 0x9c37e(%rip), %rsi     # 0xce1d9
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 0xd9168(%rip), %rdi     # 0x10afe8
callq 0x8810
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
leaq 0x9c355(%rip), %rsi     # 0xce1ec
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 0x2e45c
movq %r13, %rdi
leaq 0x9fd94(%rip), %rsi     # 0xd1c7e
callq 0x88c0
leaq 0xa0(%rsp), %rdi
movl %ebp, %esi
callq 0x31297
movq 0x50(%rsp), %rcx
movl $0xf, %esi
cmpq %r14, %rcx
je 0x31f12
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %r8
movq 0xa8(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0x31f4c
movl $0xf, %esi
leaq 0xb0(%rsp), %rdi
cmpq %rdi, 0xa0(%rsp)
je 0x31f47
movq 0xb0(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x31f5e
movq 0xa0(%rsp), %rsi
movq %r13, %rdi
callq 0x8180
jmp 0x31f6f
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 0x31f92
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x31f98
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 0x313d4
movq %rax, %rdi
movq %rsp, %rsi
callq 0x8540
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x31fed
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x32012
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x32029
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 0x31e2f
movq 0x30(%rsp), %rdx
cmpq 0x80(%rsp), %rdx
jne 0x32067
testq %rdx, %rdx
je 0x320d0
movq 0x78(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x8490
testl %eax, %eax
je 0x320d0
movq 0x70(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x323c8
leaq 0x108(%rsp), %rbp
movq %rax, %rdi
leaq 0xc0(%rsp), %rsi
callq 0x32444
movq 0xc0(%rsp), %rbx
movq 0xc8(%rsp), %r12
cmpq %rbx, %r12
je 0x320bf
movq %rbx, %r15
movq %r15, %rdi
callq 0x3123c
addq $0x18, %r15
cmpq %r12, %r15
jne 0x320a6
movq %rbx, 0xc8(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x8270
jmp 0x320e8
leaq 0xc0(%rsp), %rdi
leaq 0x108(%rsp), %rbp
movq %rbp, %rsi
callq 0x32338
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x32104
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8480
movl 0x9c(%rsp), %eax
addl %eax, 0x24(%rsp)
movq %rbp, %rdi
callq 0x3123c
leaq 0xe0(%rsp), %rbx
jmp 0x31d83
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x32146
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x120(%rsp), %rdi
callq 0x3123c
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x32178
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xc0(%rsp), %rdi
callq 0x31aa2
movq 0x70(%rsp), %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x32225
movq %rax, %r15
jmp 0x322e7
jmp 0x321ab
movq %rax, %r15
jmp 0x322f4
jmp 0x32225
jmp 0x321b7
movq %rax, %r15
jmp 0x321f7
movq %rax, %r15
jmp 0x321e0
movq %rax, %r15
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x321e0
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x321f7
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x8480
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x322c5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x322c5
movq %rax, %r15
jmp 0x322b8
jmp 0x32225
movq %rax, %r15
jmp 0x322c5
jmp 0x32299
jmp 0x32231
movq %rax, %r15
jmp 0x32280
jmp 0x32299
movq %rax, %r15
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3225b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x3225b
movq %rax, %r15
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x32280
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x3229c
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x3229c
movq %rax, %r15
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x322b8
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x108(%rsp), %rdi
callq 0x3123c
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x322e7
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x120(%rsp), %rdi
callq 0x3123c
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x32319
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xc0(%rsp), %rdi
callq 0x31aa2
movq 0x70(%rsp), %rdi
callq 0x33302
movq %r15, %rdi
callq 0x8840