// File: /workspace/github_cpp_makefile_star2_O3/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 0x271c0(%rip), %rbx     # 0x4bfc8
leaq 0x19106(%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 0x2543b
movb %bl, 0xf(%rsp)
movq 0x230(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x250(%rsp,%rax)
jne 0x253d0
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 0x19c29(%rip), %rbp     # 0x3eb0a
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)
movq 0x58(%rsp), %rdi
je 0x2539f
cmpb $0x23, (%rdi)
je 0x2539f
movb $0x9, 0x168(%rsp)
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x367c0
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rax
subq %rsi, %rax
cmpq $0xe0, %rax
jb 0x25390
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 0xd940
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 0xd940
movq %r13, %rdi
leaq 0x78(%rsp), %rsi
movq %rbx, %rdx
callq 0x36518
leaq 0x108(%rsp), %rdi
movq %r13, %rsi
callq 0x43e0
movq 0x168(%rsp), %rdi
leaq 0x178(%rsp), %rax
cmpq %rax, %rdi
je 0x25113
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x25138
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x2515a
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 0xd940
movq %r13, %rdi
leaq 0x19e47(%rip), %rsi     # 0x3efd2
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 0x251d3
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
jmp 0x251d9
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 0x25216
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x4340
movq %r13, %rdi
leaq 0x38(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x25876
movq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0x25b78
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0x2525d
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1f0(%rsp), %rdi
cmpq 0xb8(%rsp), %rdi
je 0x2527f
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1d0(%rsp), %rdi
leaq 0x1e0(%rsp), %rax
cmpq %rax, %rdi
je 0x252a4
movq 0x1e0(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x188(%rsp), %rdi
leaq 0x198(%rsp), %rax
cmpq %rax, %rdi
je 0x252c9
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x168(%rsp), %rdi
leaq 0x178(%rsp), %rax
cmpq %rax, %rdi
je 0x252ee
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2530a
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x148(%rsp), %rdi
cmpq 0x28(%rsp), %rdi
je 0x25329
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x2534e
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x25373
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xc0(%rsp), %rdi
cmpq %r14, %rdi
je 0x25390
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x10(%rsp), %rdi
callq 0x6aac
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x253b6
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x230(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x250(%rsp,%rax)
je 0x24ee6
leaq 0x230(%rsp), %rdi
callq 0x40a0
movb 0xf(%rsp), %bl
movq 0x26be0(%rip), %rdi     # 0x4bfc8
leaq 0x15acf(%rip), %rsi     # 0x3aebe
movl $0x9, %edx
callq 0x43a0
movq 0x30(%rsp), %rax
movq 0x28(%rax), %rsi
movq 0x26bbf(%rip), %rdi     # 0x4bfc8
callq 0x4210
movq %rax, %r14
leaq 0x18b25(%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 0x2547d
movq 0x26b86(%rip), %rdi     # 0x4bfc8
leaq 0x15725(%rip), %rsi     # 0x3ab6e
movl $0x1b, %edx
callq 0x43a0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x26b67(%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 0x258ca
jmp 0x254c6
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2555e
movq 0x48(%rsp), %rsi
jmp 0x2554d
jmp 0x254e2
movq %rax, %rbx
movq 0x168(%rsp), %rdi
leaq 0x178(%rsp), %rax
cmpq %rax, %rdi
je 0x2555e
movq 0x178(%rsp), %rsi
jmp 0x2554d
jmp 0x2555b
movq %rax, %rbx
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x25533
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x25533
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x2555e
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x2555e
jmp 0x2555b
jmp 0x2557e
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x2580a
leaq 0x10(%rsp), %rdi
callq 0x6aac
jmp 0x25581
jmp 0x25579
movq %rax, %rbx
jmp 0x2559d
movq %rax, %rbx
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x2559d
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x230(%rsp), %rdi
callq 0x40d0
movq %rbx, %rdi
callq 0x45a0