// File: 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:
subq $0x268, %rsp            # imm = 0x268
movq %rdi, 0x28(%rsp)
movq %rdi, 0x258(%rsp)
movq %rsi, 0x250(%rsp)
movq %rdx, 0x248(%rsp)
movq %rcx, 0x240(%rsp)
movq %r8, 0x238(%rsp)
callq 0x2d830
cmpq $0x0, %rax
jne 0x2b58c
movb $0x0, 0x267(%rsp)
jmp 0x2b80a
leaq 0xb0(%rsp), %rdi
callq 0x5320
leaq 0x8f(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x57c0
movq 0x20(%rsp), %rdx
leaq 0x3f5dd(%rip), %rsi     # 0x6ab94
leaq 0x90(%rsp), %rdi
callq 0x6880
jmp 0x2b5c6
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x5510
jmp 0x2b5dd
leaq 0x90(%rsp), %rdi
callq 0x58b8
leaq 0x8f(%rsp), %rdi
callq 0x54d0
movq 0x240(%rsp), %rdi
callq 0x55b0
movq 0x238(%rsp), %rdi
callq 0x55b0
leaq 0x70(%rsp), %rdi
callq 0x2d840
leaq 0x68(%rsp), %rdi
callq 0x2d840
movq 0x28(%rsp), %rdi
callq 0x2d860
movq 0x28(%rsp), %rdi
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x70(%rsp)
callq 0x2d610
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x2d5c0
testb $0x1, %al
jne 0x2b66f
jmp 0x2b7b4
leaq 0x70(%rsp), %rdi
callq 0x2d890
movq (%rax), %rax
cmpq 0x250(%rsp), %rax
jb 0x2b79e
leaq 0x70(%rsp), %rdi
callq 0x2d890
movq (%rax), %rax
cmpq 0x248(%rsp), %rax
ja 0x2b79e
leaq 0x70(%rsp), %rdi
callq 0x2d890
movq %rax, %rsi
addq $0x8, %rsi
movq 0x240(%rsp), %rdi
callq 0x5590
jmp 0x2b6c5
leaq 0xc0(%rsp), %rdi
leaq 0x3cd48(%rip), %rsi     # 0x6841c
callq 0x5460
movq %rax, 0x18(%rsp)
jmp 0x2b6e0
leaq 0x70(%rsp), %rdi
callq 0x2d890
movq 0x18(%rsp), %rdi
movq (%rax), %rsi
callq 0x50f0
movq %rax, 0x10(%rsp)
jmp 0x2b6fe
movq 0x10(%rsp), %rdi
leaq 0x3aef1(%rip), %rsi     # 0x665fb
callq 0x5460
movq %rax, 0x8(%rsp)
jmp 0x2b716
leaq 0x70(%rsp), %rdi
callq 0x2d890
movq 0x8(%rsp), %rdi
movq %rax, %rsi
addq $0x8, %rsi
callq 0x53e0
movq %rax, (%rsp)
jmp 0x2b737
movq (%rsp), %rdi
leaq 0x3e7f0(%rip), %rsi     # 0x69f32
callq 0x5460
jmp 0x2b749
jmp 0x2b79e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x2b77c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x58b8
leaq 0x8f(%rsp), %rdi
callq 0x54d0
jmp 0x2b7fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x2b7fb
leaq 0x70(%rsp), %rdi
xorl %esi, %esi
callq 0x2da40
movq %rax, 0x50(%rsp)
jmp 0x2b657
leaq 0x30(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x5440
jmp 0x2b7c8
movq 0x238(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x5550
leaq 0x30(%rsp), %rdi
callq 0x58b8
movb $0x1, 0x267(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x5350
jmp 0x2b80a
leaq 0xb0(%rsp), %rdi
callq 0x5350
jmp 0x2b81b
movb 0x267(%rsp), %al
andb $0x1, %al
addq $0x268, %rsp            # imm = 0x268
retq
movq 0x80(%rsp), %rdi
callq 0x57b0
nopl (%rax,%rax)