// File: /workspace/github_cpp_makefile_star2_O3/schneebergerlab[P]DrLink/insert_raw_bp.cpp
// Function: insert_raw_bp(std::multimap<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::multimap<unsigned long, BPINFO, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, 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, std::multimap<unsigned long, BPINFO, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, BPINFO>>>>>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long, unsigned long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool insert_raw_bp(multimap<string, multimap<unsigned long, BPINFO> >* rawbpmap,
                   string        chr,
                   unsigned long leftp,
                   unsigned long rightp,
                   double        score,
                   string        order,
                   string        bpline)
{
    /*  
      struct BPINFO
      {
          string         chr;
          unsigned long  leftp;
          unsigned long  rightp;
          unsigned long  leftMax;
          unsigned long  rightMin;
          double         score;
          string         order; // allele transition order, either "12" or "21"
          string         bpline;// raw bp info line
          string         ovline;// bp info line overlapping with the above, the smaller interval used as a representative
      };    
    */
    BPINFO tmpbp;
    tmpbp.chr      = chr;
    tmpbp.leftp    = leftp;
    tmpbp.rightp   = rightp;
    tmpbp.leftMax  = 0;
    tmpbp.rightMin = 0;
    tmpbp.bpline   = bpline;
    tmpbp.ovline   = "";
    tmpbp.score    = score;
    tmpbp.order    = order;
    //
    multimap<string, multimap<unsigned long, BPINFO> >::iterator chritr;
    chritr = (*rawbpmap).find(chr);
    if(chritr == (*rawbpmap).end())
    {
        // initialize map with new item of chr
        multimap<unsigned long, BPINFO> tmp;
        tmp.insert(std::pair<unsigned long, BPINFO>(leftp, tmpbp));
        //
        (*rawbpmap).insert(std::pair<string, multimap<unsigned long, BPINFO> >(chr, tmp));   
    } 
    else
    {
        // update map of chr
        ((*chritr).second).insert(std::pair<unsigned long, BPINFO>(leftp, tmpbp));
    }
    
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %r9, %r13
movq %r8, %r12
movsd %xmm0, 0x8(%rsp)
movq %rcx, %rbp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xd0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x118(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x138(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x158(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0xc0(%rsp), %rdi
callq 0x41c0
leaq 0x128(%rsp), %rdi
movq %r15, -0x48(%rdi)
movq %rbp, -0x40(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, -0x38(%rdi)
movq %r13, %rsi
callq 0x41c0
leaq 0x148(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x7f48(%rip), %rcx      # 0x3eb0a
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x44c0
leaq 0x108(%rsp), %rdi
movsd 0x8(%rsp), %xmm0
movsd %xmm0, -0x8(%rdi)
movq %r12, %rsi
callq 0x41c0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x36fb2
movq %rax, %r12
leaq 0x8(%rbx), %rax
cmpq %rax, %r12
je 0x36caa
leaq 0x18(%rsp), %rdi
movq %r15, -0x8(%rdi)
leaq 0xc0(%rsp), %rsi
callq 0x20ad0
addq $0x40, %r12
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
callq 0x3703c
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36c4a
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36c6b
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36c86
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36dc1
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x36dc1
leaq 0x170(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq 0x18(%rsp), %rdi
movq %r15, -0x8(%rdi)
leaq 0xc0(%rsp), %rsi
callq 0x20ad0
leaq 0x168(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x3703c
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36d13
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36d34
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36d4f
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36d6a
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x10(%rsp), %rdi
leaq 0x168(%rsp), %rdx
movq %r14, %rsi
callq 0x36f36
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x37278
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0x20c7c
movq -0x20(%rbx), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x36db4
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x168(%rsp), %rdi
callq 0x20c7c
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x36de6
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x36e0b
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x36e30
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x36e55
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x4340
movb $0x1, %al
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x36f8a
jmp 0x36e8c
jmp 0x36e89
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x36ec6
jmp 0x36e8c
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x20c7c
jmp 0x36eb1
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x36ec6
jmp 0x36eb1
jmp 0x36eae
jmp 0x36eae
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x2580a
movq %rbx, %rdi
callq 0x45a0