// File: /workspace/github_cpp_makefile_star2_O2/schneebergerlab[P]DrLink/detect_recombsite.cpp
// Function: build_artSeq(std::map<unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>, unsigned long, unsigned long, 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 build_artSeq(map<unsigned long, string> alleleinfo, 
                  unsigned long regionBegin, 
                  unsigned long regionEnd, 
                  string*       artSeq,
                  string*       artSeqCheckingStr)
{
    // build artificial allele sequence within a given region at all possible markers.
    if(alleleinfo.size()==0) return false;
    std::stringstream posAllele;
    posAllele.str("");
    (*artSeq).clear();
    (*artSeqCheckingStr).clear();
    map<unsigned long, string>::iterator alitr;
    map<unsigned long, string>::iterator alitr_end;
    alitr     = alleleinfo.begin();
    alitr_end = alleleinfo.end();
    while(alitr != alitr_end)
    {
        if( (*alitr).first>=regionBegin && (*alitr).first<=regionEnd)
        {
            (*artSeq)   += (*alitr).second;
            posAllele << "        " << (*alitr).first << ":" << (*alitr).second << "\n";
        }
        alitr ++;
    }
    (*artSeqCheckingStr) = posAllele.str();
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %r8, 0x10(%rsp)
movq 0x28(%rdi), %rbx
testq %rbx, %rbx
je 0x14aff
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
leaq 0x40(%rsp), %rdi
callq 0x4250
leaq 0x1911e(%rip), %rsi     # 0x2db1a
leaq 0x20(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4d3e
movq %rbx, 0x18(%rsp)
leaq 0x58(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x4490
leaq 0x20(%rsp), %rdi
callq 0x4638
andq $0x0, 0x8(%r14)
movq (%r14), %rax
xorl %ecx, %ecx
movb %cl, (%rax)
movq 0x10(%rsp), %rax
andq $0x0, 0x8(%rax)
movq (%rax), %rax
movb %cl, (%rax)
movq 0x18(%r13), %rbx
addq $0x8, %r13
cmpq %r13, %rbx
je 0x14ac7
movq 0x20(%rbx), %rax
cmpq %r12, %rax
setb %cl
cmpq %r15, %rax
seta %al
orb %cl, %al
jne 0x14aba
leaq 0x28(%rbx), %rbp
movq %r14, %rdi
movq %rbp, %rsi
callq 0x45f0
leaq 0x50(%rsp), %rdi
leaq 0x168e5(%rip), %rsi     # 0x2b365
callq 0x4330
movq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x4230
movq %rax, %rdi
leaq 0x14b60(%rip), %rsi     # 0x295fb
callq 0x4330
movq %rax, %rdi
movq %rbp, %rsi
callq 0x42e0
movq %rax, %rdi
leaq 0x183de(%rip), %rsi     # 0x2ce93
callq 0x4330
movq %rbx, %rdi
callq 0x4240
movq %rax, %rbx
jmp 0x14a4c
leaq 0x20(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x44e0
leaq 0x20(%rsp), %rbx
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x43c0
movq %rbx, %rdi
callq 0x4638
leaq 0x40(%rsp), %rdi
callq 0x4280
movq 0x18(%rsp), %rbx
testq %rbx, %rbx
setne %al
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14b2a
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4638
jmp 0x14b2d
jmp 0x14b2a
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4280
movq %rbx, %rdi
callq 0x45a0