// File: millanek[P]evo/process_vcf_annotation_tools.cpp
// Function: getReferenceForThisRegion(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string getReferenceForThisRegion(const std::vector<std::string>& thisRegionAnnotation, const std::string& strand, const std::string& currentScaffoldReference) {
    // std::cerr << "generating gene refseq" << std::endl;
    std::string refSeq = "";
    for (std::vector<std::string>::size_type j = 0; j != thisRegionAnnotation.size(); j++) {
        std::vector<string> annotLineVec = split(thisRegionAnnotation[j], '\t');
        refSeq = refSeq + currentScaffoldReference.substr(atoi(annotLineVec[1].c_str())-1,atoi(annotLineVec[2].c_str())-atoi(annotLineVec[1].c_str()) + 1);
    }
    if (strand == "-")
        refSeq = reverseComplementIUPAC(refSeq);
    // std::cerr << "Done" << std::endl;
    return refSeq;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0xc8(%rbp)
movq %rdi, %rax
movq %rax, -0xd0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movb $0x0, -0x21(%rbp)
leaq -0x22(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0xab60
movq -0xc8(%rbp), %rdi
movq -0xc0(%rbp), %rdx
leaq 0xa6d6a(%rip), %rsi     # 0x135edf
callq 0x2d6c0
jmp 0x8f17c
leaq -0x22(%rbp), %rdi
callq 0xa640
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3ffd0
movq %rax, %rcx
movq -0xd8(%rbp), %rax
cmpq %rcx, %rax
je 0x8f33f
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x52960
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
movl $0x9, %edx
callq 0x7bbe0
jmp 0x8f1d4
movq -0x20(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq -0x58(%rbp), %rdi
movq %rdi, -0x100(%rbp)
movl $0x1, %esi
movq %rsi, -0xf8(%rbp)
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movq -0x100(%rbp), %rdi
decl %eax
cltq
movq %rax, -0xe8(%rbp)
movl $0x2, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movq -0x100(%rbp), %rdi
movq -0xf8(%rbp), %rsi
movl %eax, -0xdc(%rbp)
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
movl %eax, %ecx
movl -0xdc(%rbp), %eax
subl %ecx, %eax
incl %eax
movslq %eax, %rcx
leaq -0x98(%rbp), %rdi
callq 0xa5f0
jmp 0x8f28b
movq -0xc8(%rbp), %rsi
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rdx
callq 0x3e140
jmp 0x8f2a4
movq -0xc8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0xa710
leaq -0x78(%rbp), %rdi
callq 0xac88
leaq -0x98(%rbp), %rdi
callq 0xac88
leaq -0x58(%rbp), %rdi
callq 0x3dfa0
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x8f18d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x22(%rbp), %rdi
callq 0xa640
jmp 0x8f3c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x8f3bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x8f334
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x98(%rbp), %rdi
callq 0xac88
leaq -0x58(%rbp), %rdi
callq 0x3dfa0
jmp 0x8f3bd
movq -0x18(%rbp), %rdi
leaq 0xa57c6(%rip), %rsi     # 0x134b10
callq 0x2d770
movb %al, -0x101(%rbp)
jmp 0x8f357
movb -0x101(%rbp), %al
testb $0x1, %al
jne 0x8f363
jmp 0x8f397
movq -0xc8(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x8e790
jmp 0x8f378
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xa710
leaq -0xb8(%rbp), %rdi
callq 0xac88
movb $0x1, -0x21(%rbp)
testb $0x1, -0x21(%rbp)
jne 0x8f3ad
movq -0xc8(%rbp), %rdi
callq 0xac88
movq -0xd0(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0xc8(%rbp), %rdi
callq 0xac88
movq -0x30(%rbp), %rdi
callq 0xab50
nopw %cs:(%rax,%rax)