// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_annotation_tools.cpp
// Function: Annotation::getSNPgeneDetails(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
std::vector<string> Annotation::getSNPgeneDetails(const string& SNPscaffold, const int SNPlocus) {
    std::vector<string> SNPgeneDetails;
    std::vector<string> scaffoldTranscriptStartEnd = transcriptStartEndMap[SNPscaffold];
    string inGene = ""; string SNPcategory = "nonCoding";
    for (std::vector<std::vector<string> >::size_type i = 0; i != scaffoldTranscriptStartEnd.size(); i++) {
        std::vector<string> startEndVec = split(scaffoldTranscriptStartEnd[i], '\t');
        string thisTranscript = startEndVec[0];
        int geneStart = atoi(startEndVec[1].c_str()); int geneEnd = atoi(startEndVec[2].c_str()); string strand = startEndVec[3];
        //if (SNPlocus == 20001) { print_vector_stream(startEndVec, std::cerr);}
        if (strand == "+") {
            if (SNPlocus >= (geneStart-3000) && SNPlocus < geneStart) {
                SNPcategory = "promoter"; inGene = thisTranscript;
                break;
            }
        } else if (strand == "-") {
            if (SNPlocus > geneEnd && SNPlocus <= (geneEnd+3000)) {
                SNPcategory = "promoter"; inGene = thisTranscript;
                break;
            }
        }
        if (SNPlocus >= geneStart && SNPlocus <= geneEnd) {
            //int numDots = (int)std::count(thisTranscript.begin(), thisTranscript.end(), '.');
            SNPcategory = "intron";
            //if (numDots == 4)  inGene = geneFromTranscript(thisTranscript);
            inGene = thisTranscript;
            std::vector<string> exons = annotationMapTranscriptMap[SNPscaffold][thisTranscript];
            // std::cerr << exons.size() << std::endl;
            for (std::vector<string>::size_type j = 0; j != exons.size(); j++) {
                std::vector<string> exonVec = split(exons[j], '\t');
                //if (SNPlocus == 20001) { print_vector_stream(exonVec, std::cerr); }
                if (SNPlocus >= atoi(exonVec[1].c_str()) && SNPlocus <= atoi(exonVec[2].c_str())) {
                    SNPcategory = "exon";
                }
                if (SNPcategory == "exon") { break; }
            }
            break;
        }
        //else if (SNPcategory == "intron") { if (inGene != geneFromTranscript(startEndVec[0])) { break; } }
    }
    SNPgeneDetails.push_back(inGene); SNPgeneDetails.push_back(SNPcategory);
    return SNPgeneDetails;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl %ecx, %r12d
movq %rdx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq %rsi, 0x20(%rsp)
leaq 0x60(%rsi), %rdi
movq %rdx, %rsi
movq %rbx, 0x10(%rsp)
callq 0x3abd8
leaq 0xa8(%rsp), %rdi
movq %rax, %rsi
callq 0x297dc
leaq 0x531e1(%rip), %rsi     # 0x99e1f
leaq 0xc0(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x21904
movq %r14, 0x18(%rsp)
leaq 0x593c6(%rip), %rsi     # 0xa0022
leaq 0x38(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x21904
xorl %ecx, %ecx
leaq 0x90(%rsp), %rbp
leaq 0x58(%rsp), %r13
xorl %edx, %edx
movl %r12d, 0xc(%rsp)
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %rax, %rdx
je 0x46eeb
movq %rdx, 0x28(%rsp)
movq %rcx, 0x30(%rsp)
addq %rcx, %rsi
movq %rbp, %rdi
pushq $0x9
popq %rdx
callq 0x40349
movq 0x90(%rsp), %rsi
movq %r13, %r14
movq %r13, %rdi
callq 0x8600
movq 0x90(%rsp), %r12
movq 0x20(%r12), %rdi
callq 0x86f0
movl %eax, %r13d
movq 0x40(%r12), %rdi
callq 0x86f0
movl %eax, %r15d
addq $0x60, %r12
leaq 0xf8(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8600
movq %rbx, %rdi
leaq 0x51d34(%rip), %rsi     # 0x98a43
callq 0x2193f
testb %al, %al
movl 0xc(%rsp), %r12d
je 0x46d36
leal -0xbb8(%r13), %eax
cmpl %r12d, %eax
setle %al
cmpl %r12d, %r13d
setg %cl
testb %al, %cl
je 0x46d60
jmp 0x46da6
movq %rbx, %rdi
leaq 0x51d10(%rip), %rsi     # 0x98a50
callq 0x2193f
cmpl %r12d, %r15d
setge %cl
xorb $0x1, %al
orb %cl, %al
leal 0xbb8(%r15), %ecx
cmpl %r12d, %ecx
setl %cl
orb %al, %cl
je 0x46da6
cmpl %r12d, %r13d
setg %al
cmpl %r12d, %r15d
setl %cl
orb %al, %cl
je 0x46dce
leaq 0xf8(%rsp), %rdi
callq 0x8978
movq %r14, %r13
movq %r14, %rdi
callq 0x8978
movq %rbp, %rdi
callq 0x28a08
movq 0x28(%rsp), %rdx
incq %rdx
movq 0x30(%rsp), %rcx
addq $0x20, %rcx
jmp 0x46c81
leaq 0x68725(%rip), %rsi     # 0xaf4d2
leaq 0x38(%rsp), %rdi
callq 0x88f0
leaq 0xc0(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x82a0
jmp 0x46ec7
leaq 0x51c86(%rip), %rsi     # 0x98a5b
leaq 0x38(%rsp), %rdi
callq 0x88f0
leaq 0xc0(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x82a0
movq 0x20(%rsp), %rdi
addq $0x90, %rdi
movq 0x18(%rsp), %rsi
callq 0x3ab72
leaq 0x58(%rsp), %rsi
movq %rax, %rdi
callq 0x3abd8
leaq 0x78(%rsp), %rdi
movq %rax, %rsi
callq 0x297dc
pushq $-0x1
popq %r14
xorl %r15d, %r15d
leaq 0xe0(%rsp), %rbx
pushq $0x9
popq %rbp
leaq 0x38(%rsp), %r12
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
incq %r14
cmpq %rax, %r14
je 0x46ebd
addq %r15, %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x40349
movq 0xe0(%rsp), %r13
movq 0x20(%r13), %rdi
callq 0x86f0
cmpl 0xc(%rsp), %eax
jg 0x46e96
movq 0x40(%r13), %rdi
callq 0x86f0
cmpl 0xc(%rsp), %eax
jl 0x46e96
movq %r12, %rdi
leaq 0x5919b(%rip), %rsi     # 0xa002c
callq 0x88f0
addq $0x20, %r15
movq %r12, %rdi
leaq 0x59188(%rip), %rsi     # 0xa002c
callq 0x2193f
movl %eax, %r13d
movq %rbx, %rdi
callq 0x28a08
testb %r13b, %r13b
je 0x46e38
leaq 0x78(%rsp), %rdi
callq 0x28a08
leaq 0xf8(%rsp), %rdi
callq 0x8978
leaq 0x58(%rsp), %rdi
callq 0x8978
leaq 0x90(%rsp), %rdi
callq 0x28a08
leaq 0xc0(%rsp), %rsi
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x2b0a4
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x2b0a4
leaq 0x38(%rsp), %rdi
callq 0x8978
leaq 0xc0(%rsp), %rdi
callq 0x8978
leaq 0xa8(%rsp), %rdi
callq 0x28a08
movq %rbx, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x46f64
movq %rax, %rbx
jmp 0x46fba
movq %rax, %rbx
jmp 0x46fc7
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x28a08
jmp 0x46f73
movq %rax, %rbx
jmp 0x46f7d
jmp 0x46f8c
movq %rax, %rbx
jmp 0x46fd4
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x28a08
leaq 0xf8(%rsp), %rdi
callq 0x8978
jmp 0x46f94
movq %rax, %rbx
jmp 0x46fb0
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x8978
jmp 0x46fa3
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x28a08
leaq 0x38(%rsp), %rdi
callq 0x8978
leaq 0xc0(%rsp), %rdi
callq 0x8978
leaq 0xa8(%rsp), %rdi
callq 0x28a08
movq 0x10(%rsp), %rdi
callq 0x28a08
movq %rbx, %rdi
callq 0x8870