// File: /workspace/github_cpp_makefile_star2_O2/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 $0x428, %rsp            # imm = 0x428
movq %rsi, 0x28(%rsp)
movq %rdi, %rbx
movq 0x23500(%rip), %rdi     # 0x3cfc8
leaq 0x1343e(%rip), %rsi     # 0x2cf0d
callq 0x4330
movq %rax, %rdi
movq %rbx, %rsi
callq 0x42e0
movq %rax, %rdi
callq 0x41c0
leaq 0x220(%rsp), %r14
movq %r14, %rdi
callq 0x4380
movq (%rbx), %rsi
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x4200
leaq 0x298(%rsp), %rdi
callq 0x40c0
movb %al, 0xf(%rsp)
testb %al, %al
je 0x19d95
leaq 0x40(%rsp), %rbx
leaq 0x13ff0(%rip), %rbp     # 0x2db1a
leaq 0xd8(%rsp), %r15
leaq 0x158(%rsp), %r12
leaq 0x138(%rsp), %r13
movq 0x220(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x240(%rsp,%rax)
jne 0x19db5
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x4d3e
leaq 0x220(%rsp), %rdi
movq %r15, %rsi
callq 0x4090
cmpq $0x0, 0xe0(%rsp)
je 0x19d88
movq 0xd8(%rsp), %rax
cmpb $0x23, (%rax)
je 0x19d88
movb $0x9, 0x158(%rsp)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x26120
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rax
subq %rsi, %rax
cmpq $0xe0, %rax
jb 0x19d7e
movq %rbx, 0x30(%rsp)
andq $0x0, 0x38(%rsp)
xorl %ecx, %ecx
movb %cl, 0x40(%rsp)
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
andq $0x0, 0x80(%rsp)
movb %cl, 0x88(%rsp)
leaq 0xa8(%rsp), %rax
movq %rax, 0x98(%rsp)
andq $0x0, 0xa0(%rsp)
movb %cl, 0xa8(%rsp)
leaq 0xc8(%rsp), %rax
movq %rax, 0xb8(%rsp)
andq $0x0, 0xc0(%rsp)
movb %cl, 0xc8(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x41e0
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4130
movq %rax, 0x50(%rsp)
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4130
movq %rax, 0x58(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
callq 0x41e0
leaq 0xb8(%rsp), %rdi
movq %rbp, %rsi
callq 0x45e0
movq 0x10(%rsp), %r14
movq 0x60(%r14), %rdi
callq 0x43d0
movsd %xmm0, 0x70(%rsp)
subq $-0x80, %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0x4400
movq 0x10(%rsp), %rsi
movl $0xa0, %eax
addq %rax, %rsi
leaq 0x118(%rsp), %r14
movq %r14, %rdi
callq 0x4400
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x25f54
leaq 0x78(%rsp), %rdi
movq %r12, %rsi
callq 0x43c0
movq %r12, %rdi
callq 0x4638
movq %r14, %rdi
callq 0x4638
movq %r13, %rdi
callq 0x4638
movq 0x10(%rsp), %rsi
movq %r12, %rdi
leaq 0x142c8(%rip), %rdx     # 0x2dfe2
callq 0x95e2
movq 0x10(%rsp), %rdx
movl $0xc0, %eax
addq %rax, %rdx
leaq 0xf8(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x961a
movq %r12, %rdi
callq 0x4638
movq %r12, %rdi
movq %r14, %rsi
leaq 0x30(%rsp), %rdx
callq 0x1a054
movq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x1a23e
movq %r12, %rdi
callq 0x1a08a
movq %r14, %rdi
callq 0x4638
leaq 0x30(%rsp), %rdi
callq 0x165c8
leaq 0x10(%rsp), %rdi
callq 0x5d02
movq %r15, %rdi
callq 0x4638
jmp 0x19b42
movq 0x2322c(%rip), %rdi     # 0x3cfc8
leaq 0xfdb3(%rip), %rsi      # 0x29b56
callq 0x4330
movq %rax, %rdi
movq %rbx, %rsi
callq 0x42e0
jmp 0x19df5
leaq 0x220(%rsp), %rdi
callq 0x40a0
movq 0x231ff(%rip), %rdi     # 0x3cfc8
leaq 0x100d6(%rip), %rsi     # 0x29ea6
callq 0x4330
movq 0x28(%rsp), %rcx
movq 0x28(%rcx), %rsi
movq %rax, %rdi
callq 0x4230
leaq 0x13148(%rip), %rsi     # 0x2cf35
movq %rax, %rdi
callq 0x4330
movq %rax, %rdi
callq 0x41c0
leaq 0x220(%rsp), %rdi
callq 0x40d0
movb 0xf(%rsp), %al
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x19e65
jmp 0x19e78
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0x1a08a
jmp 0x19e3c
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
jmp 0x19e6d
jmp 0x19e78
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
jmp 0x19e6d
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x4638
leaq 0x138(%rsp), %rdi
callq 0x4638
jmp 0x19e7b
jmp 0x19e91
jmp 0x19ea3
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x165c8
leaq 0x10(%rsp), %rdi
callq 0x5d02
jmp 0x19e94
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x4638
jmp 0x19ea6
movq %rax, %rbx
leaq 0x220(%rsp), %rdi
callq 0x40d0
movq %rbx, %rdi
callq 0x45a0