// File: /workspace/github_cpp_makefile_star2_O1/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 0x7b6c(%rip), %rcx      # 0x3eb22
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 0x373a6
movq %rax, %r12
leaq 0x8(%rbx), %rax
cmpq %rax, %r12
je 0x3709e
leaq 0x18(%rsp), %rdi
movq %r15, -0x8(%rdi)
leaq 0xc0(%rsp), %rsi
callq 0x20c50
addq $0x40, %r12
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
callq 0x37430
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3703e
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3705f
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3707a
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x371b5
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x371b5
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 0x20c50
leaq 0x168(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x37430
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x37107
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x37128
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x37143
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3715e
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x10(%rsp), %rdi
leaq 0x168(%rsp), %rdx
movq %r14, %rsi
callq 0x3732a
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x3766a
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0x20dfc
movq -0x20(%rbx), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x371a8
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x168(%rsp), %rdi
callq 0x20dfc
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x371da
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x371ff
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x37224
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x37249
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 0x3737e
jmp 0x37280
jmp 0x3727d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x372ba
jmp 0x37280
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x20dfc
jmp 0x372a5
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x372ba
jmp 0x372a5
jmp 0x372a2
jmp 0x372a2
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x2599c
movq %rbx, %rdi
callq 0x45a0