// File: /workspace/github_cpp_makefile_star2_O1/schneebergerlab[P]DrLink/find_intersection.cpp
// Function: get_CO(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::multimap<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, BPINFO, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, BPINFO>>>*)
bool get_CO(string cofile, multimap<string, BPINFO>* aco)
{
    cout << "   Info: reading raw bp info from file " << cofile << endl;
    ifstream ifp;
    ifp.open(cofile.c_str(), ios::in);
    if(!ifp.is_open())
    {
        cout << "   Error: cannot open file " << cofile << endl;
        return false;
    } 
    while(ifp.good())
    {
        string line("");
        getline(ifp, line);
        if(line.size()==0 || line[0]=='#') continue;
        vector<string> lineinfo = split_string(line, '\t');
        // at least with: 0.chr  1.left_pos  2.right_pos  3.score  4.left_alleles  5.right_alleles  6.barcode
        if(lineinfo.size() < 7) continue; 
        //
        BPINFO tmpbp;
        tmpbp.chr      = lineinfo[0];
        tmpbp.leftp    = strtoul(lineinfo[1].c_str(), NULL, 0);
        tmpbp.rightp   = strtoul(lineinfo[2].c_str(), NULL, 0);
        tmpbp.leftMax  = 0;
        tmpbp.rightMin = 0;
        tmpbp.bpline   = line;
        tmpbp.ovline   = "";
        tmpbp.score    = atof(lineinfo[3].c_str());
        tmpbp.order    = check_allele_order(lineinfo[4], lineinfo[5]);        
        // chr#bc#order
        string key = lineinfo[0] + "#" + lineinfo[6];              
        (*aco).insert(std::pair<string, BPINFO>(key, tmpbp));
    }
    ifp.close();  
    cout << "   Info: " << (*aco).size() << " bp info collected." << endl; 
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
movq %rsi, 0x30(%rsp)
movq %rdi, %r14
movq 0x2702e(%rip), %rbx     # 0x4bfc8
leaq 0x18f74(%rip), %rsi     # 0x3df15
movl $0x27, %edx
movq %rbx, %rdi
callq 0x43a0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x43a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
leaq 0x230(%rsp), %r15
movq %r15, %rdi
callq 0x4390
movq (%r14), %rsi
movq %r15, %rdi
movl $0x8, %edx
callq 0x41e0
leaq 0x2a8(%rsp), %rdi
callq 0x40c0
movl %eax, %ebx
testb %al, %al
je 0x255cd
movb %bl, 0xf(%rsp)
movq 0x230(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x250(%rsp,%rax)
jne 0x25562
leaq 0xd0(%rsp), %r14
movl $0x98, %eax
leaq 0xc0(%rsp), %rcx
addq %rax, %rcx
movq %rcx, 0x28(%rsp)
leaq 0x168(%rsp), %r13
addq %r13, %rax
movq %rax, 0xb8(%rsp)
leaq 0x19aaf(%rip), %rbp     # 0x3eb22
leaq 0x58(%rsp), %r12
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq %r12, %rdi
movq %rbp, %rsi
movq %rbp, %rdx
callq 0x5384
movq 0x230(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x45c0
cmpq $0x0, 0x60(%rsp)
je 0x2552c
movq 0x58(%rsp), %rax
cmpb $0x23, (%rax)
je 0x2552c
movb $0x9, 0x168(%rsp)
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x36b7c
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rax
subq %rsi, %rax
cmpq $0xe0, %rax
jb 0x25522
movq %r14, 0xc0(%rsp)
xorl %ecx, %ecx
movq %rcx, 0xc8(%rsp)
movb %cl, 0xd0(%rsp)
leaq 0x118(%rsp), %rax
movq %rax, 0x108(%rsp)
movq %rcx, 0x110(%rsp)
movb %cl, 0x118(%rsp)
leaq 0x138(%rsp), %rax
movq %rax, 0x128(%rsp)
movq %rcx, 0x130(%rsp)
movb %cl, 0x138(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x148(%rsp)
movq %rcx, 0x150(%rsp)
movb %cl, 0x158(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x41c0
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4130
movq %rax, 0xe0(%rsp)
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4130
movq %rax, 0xe8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r14)
leaq 0x128(%rsp), %rdi
movq %r12, %rsi
callq 0x41c0
movq 0x150(%rsp), %rdx
leaq 0x148(%rsp), %rdi
xorl %esi, %esi
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0x44c0
movq 0x10(%rsp), %rbx
movq 0x60(%rbx), %rdi
callq 0x43f0
movsd %xmm0, 0x100(%rsp)
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x80(%rbx), %rsi
movq 0x88(%rbx), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rdi
callq 0xda32
movq 0x10(%rsp), %rax
leaq 0xa8(%rsp), %rcx
movq %rcx, 0x98(%rsp)
movq 0xa0(%rax), %rsi
movq 0xa8(%rax), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %rbx
movq %rbx, %rdi
callq 0xda32
movq %r13, %rdi
leaq 0x78(%rsp), %rsi
movq %rbx, %rdx
callq 0x368d0
leaq 0x108(%rsp), %rdi
movq %r13, %rsi
callq 0x43e0
movq 0x168(%rsp), %rdi
leaq 0x178(%rsp), %rax
cmpq %rax, %rdi
je 0x252a5
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x252ca
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x252ec
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x10(%rsp), %rax
leaq 0x178(%rsp), %rcx
movq %rcx, 0x168(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0xda32
movq %r13, %rdi
leaq 0x19cd5(%rip), %rsi     # 0x3eff2
callq 0x45e0
movq 0x10(%rsp), %rax
movq 0xc0(%rax), %rsi
movq 0xc8(%rax), %rdx
movq %r13, %rdi
callq 0x4120
leaq 0x48(%rsp), %rsi
movq %rsi, 0x38(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x25365
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
jmp 0x2536b
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x40(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x168(%rsp), %rdi
leaq 0x178(%rsp), %rax
cmpq %rax, %rdi
je 0x253a8
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x4340
movq %r13, %rdi
leaq 0x38(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x25a08
movq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0x25cfe
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0x253ef
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1f0(%rsp), %rdi
cmpq 0xb8(%rsp), %rdi
je 0x25411
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1d0(%rsp), %rdi
leaq 0x1e0(%rsp), %rax
cmpq %rax, %rdi
je 0x25436
movq 0x1e0(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x188(%rsp), %rdi
leaq 0x198(%rsp), %rax
cmpq %rax, %rdi
je 0x2545b
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x168(%rsp), %rdi
leaq 0x178(%rsp), %rax
cmpq %rax, %rdi
je 0x25480
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2549c
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x148(%rsp), %rdi
cmpq 0x28(%rsp), %rdi
je 0x254bb
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x254e0
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x25505
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xc0(%rsp), %rdi
cmpq %r14, %rdi
je 0x25522
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x10(%rsp), %rdi
callq 0x6aa2
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x25548
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x230(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x250(%rsp,%rax)
je 0x25078
leaq 0x230(%rsp), %rdi
callq 0x40a0
movb 0xf(%rsp), %bl
movq 0x26a4e(%rip), %rdi     # 0x4bfc8
leaq 0x1593d(%rip), %rsi     # 0x3aebe
movl $0x9, %edx
callq 0x43a0
movq 0x30(%rsp), %rax
movq 0x28(%rax), %rsi
movq 0x26a2d(%rip), %rdi     # 0x4bfc8
callq 0x4210
movq %rax, %r14
leaq 0x18993(%rip), %rsi     # 0x3df3d
movl $0x13, %edx
movq %rax, %rdi
callq 0x43a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4310
jmp 0x2560f
movq 0x269f4(%rip), %rdi     # 0x4bfc8
leaq 0x15593(%rip), %rsi     # 0x3ab6e
movl $0x1b, %edx
callq 0x43a0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x269d5(%rip), %rdi     # 0x4bfc8
callq 0x43a0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
leaq 0x230(%rsp), %rdi
callq 0x40d0
movl %ebx, %eax
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x25a5c
jmp 0x25658
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x256f0
movq 0x48(%rsp), %rsi
jmp 0x256df
jmp 0x25674
movq %rax, %rbx
movq 0x168(%rsp), %rdi
leaq 0x178(%rsp), %rax
cmpq %rax, %rdi
je 0x256f0
movq 0x178(%rsp), %rsi
jmp 0x256df
jmp 0x256ed
movq %rax, %rbx
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x256c5
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x256c5
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x256f0
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x256f0
jmp 0x256ed
jmp 0x25710
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x2599c
leaq 0x10(%rsp), %rdi
callq 0x6aa2
jmp 0x25713
jmp 0x2570b
movq %rax, %rbx
jmp 0x2572f
movq %rax, %rbx
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x2572f
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x230(%rsp), %rdi
callq 0x40d0
movq %rbx, %rdi
callq 0x45a0