// File: /workspace/github_cpp_makefile_star2_O3/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 %rcx, 0x8(%rsp)
movq 0x28(%rdi), %rbx
testq %rbx, %rbx
je 0x1e79a
movq %r8, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
leaq 0x40(%rsp), %rdi
callq 0x4240
leaq 0x20(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x204cf(%rip), %rdx     # 0x3eb0a
leaq 0x10(%rsp), %rdi
movq %rdx, %rsi
callq 0x5384
leaq 0x58(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x4490
movq %rbx, 0x38(%rsp)
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1e673
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4340
xorl %eax, %eax
movq 0x8(%rsp), %rcx
movq %rax, 0x8(%rcx)
movq (%rcx), %rcx
movb %al, (%rcx)
movq %rax, 0x8(%r14)
movq %r14, 0x30(%rsp)
movq (%r14), %rcx
movb %al, (%rcx)
movq 0x18(%r13), %rbp
addq $0x8, %r13
cmpq %r13, %rbp
je 0x1e73c
leaq 0x50(%rsp), %rbx
movq 0x20(%rbp), %rax
cmpq %r12, %rax
setb %cl
cmpq %r15, %rax
seta %al
orb %cl, %al
jne 0x1e728
movq 0x28(%rbp), %rsi
movq 0x30(%rbp), %rdx
movq 0x8(%rsp), %rdi
callq 0x4120
movl $0x8, %edx
movq %rbx, %rdi
leaq 0x1dca9(%rip), %rsi     # 0x3c385
callq 0x43a0
movq 0x20(%rbp), %rsi
movq %rbx, %rdi
callq 0x4210
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1befc(%rip), %rsi     # 0x3a5fb
callq 0x43a0
movq 0x28(%rbp), %rsi
movq 0x30(%rbp), %rdx
movq %r14, %rdi
callq 0x43a0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1f778(%rip), %rsi     # 0x3de9b
callq 0x43a0
movq %rbp, %rdi
callq 0x4230
movq %rax, %rbp
cmpq %r13, %rax
jne 0x1e6a7
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x44f0
leaq 0x10(%rsp), %rbx
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x43e0
movq (%rbx), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1e777
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x2d81a(%rip), %rsi     # 0x4bf98
leaq 0x40(%rsp), %rdi
callq 0x4260
leaq 0xc0(%rsp), %rdi
callq 0x4140
movq 0x38(%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 0x1e7d2
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1e7d5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x1e7d5
jmp 0x1e7d2
movq %rax, %rbx
movq 0x2d7bc(%rip), %rsi     # 0x4bf98
leaq 0x40(%rsp), %rdi
callq 0x4260
leaq 0xc0(%rsp), %rdi
callq 0x4140
movq %rbx, %rdi
callq 0x45a0