// File: /workspace/github_cpp_makefile_star2_O3/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 $0x108, %rsp            # imm = 0x108
movl %ecx, 0xc(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x60(%rsi), %rdi
movq %rdx, %rsi
movq %rbx, 0x50(%rsp)
callq 0x46fb4
leaq 0xb0(%rsp), %rdi
movq %rax, %rsi
callq 0x2fc8e
leaq 0x88(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x757af(%rip), %rdx     # 0xcd9cb
leaq 0x78(%rsp), %rdi
movq %rdx, %rsi
callq 0x28a52
movq %r15, 0xc8(%rsp)
movq %r14, 0xd0(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x79687(%rip), %rsi     # 0xd18d0
leaq 0x79689(%rip), %rdx     # 0xd18d9
leaq 0x30(%rsp), %rdi
callq 0x28a52
movq 0xb0(%rsp), %rsi
cmpq %rsi, 0xb8(%rsp)
je 0x58584
leaq 0x20(%rsp), %r14
xorl %ebx, %ebx
leaq 0xd8(%rsp), %rbp
xorl %r12d, %r12d
addq %rbx, %rsi
movq %rbp, %rdi
movl $0x9, %edx
callq 0x4d650
movq 0xd8(%rsp), %rax
movq %r14, 0x10(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x2ba06
movq 0xd8(%rsp), %r14
movq 0x20(%r14), %rdi
callq 0x86e0
movl %eax, %r15d
movq 0x40(%r14), %rdi
callq 0x86e0
movl %eax, %r13d
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x60(%r14), %rsi
movq 0x68(%r14), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0x2ba06
movq %r14, %rdi
leaq 0x74dac(%rip), %rsi     # 0xcd0ab
callq 0x8160
testl %eax, %eax
movq %r14, %rdi
movl 0xc(%rsp), %r14d
je 0x5833f
leaq 0x74da1(%rip), %rsi     # 0xcd0b8
callq 0x8160
testl %eax, %eax
setne %al
cmpl %r14d, %r13d
setge %cl
orb %al, %cl
leal 0xbb8(%r13), %eax
cmpl %r14d, %eax
setl %al
orb %cl, %al
jne 0x5835a
jmp 0x583da
leal -0xbb8(%r15), %eax
cmpl %r14d, %eax
setle %al
cmpl %r14d, %r15d
setg %cl
testb %al, %cl
jne 0x583da
cmpl %r14d, %r15d
setg %al
cmpl %r14d, %r13d
setl %cl
orb %al, %cl
je 0x5840b
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
leaq 0x20(%rsp), %r14
je 0x5838f
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x583a6
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
movq %rbp, %rdi
callq 0x2e784
incq %r12
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
addq $0x20, %rbx
cmpq %rax, %r12
jne 0x58282
jmp 0x58584
leaq 0x30(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x85e90(%rip), %rcx     # 0xde27a
movl $0x8, %r8d
xorl %esi, %esi
callq 0x86c0
leaq 0x78(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x8270
jmp 0x5853f
leaq 0x30(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x74ca8(%rip), %rcx     # 0xcd0c3
movl $0x6, %r8d
xorl %esi, %esi
callq 0x86c0
leaq 0x78(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x8270
movq 0xc8(%rsp), %rdi
addq $0x90, %rdi
movq 0xd0(%rsp), %rsi
callq 0x46f38
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x46fb4
leaq 0x98(%rsp), %rdi
movq %rax, %rsi
callq 0x2fc8e
movq 0x98(%rsp), %rsi
cmpq %rsi, 0xa0(%rsp)
je 0x58532
xorl %r13d, %r13d
leaq 0xf0(%rsp), %rbx
leaq 0x79442(%rip), %rbp     # 0xd18da
leaq 0x30(%rsp), %r15
xorl %r14d, %r14d
addq %r13, %rsi
movq %rbx, %rdi
movl $0x9, %edx
callq 0x4d650
movq 0xf0(%rsp), %r12
movq 0x20(%r12), %rdi
callq 0x86e0
cmpl 0xc(%rsp), %eax
jg 0x584f0
movq 0x40(%r12), %rdi
callq 0x86e0
cmpl 0xc(%rsp), %eax
jl 0x584f0
movq 0x38(%rsp), %rdx
movl $0x4, %r8d
movq %r15, %rdi
xorl %esi, %esi
movq %rbp, %rcx
callq 0x86c0
movq %r15, %rdi
movq %rbp, %rsi
callq 0x8160
movl %eax, %r12d
movq %rbx, %rdi
callq 0x2e784
testl %r12d, %r12d
je 0x58532
incq %r14
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
addq $0x20, %r13
cmpq %rax, %r14
jne 0x584a0
leaq 0x98(%rsp), %rdi
callq 0x2e784
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
leaq 0x20(%rsp), %rbx
je 0x58560
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x10(%rsp), %rdi
cmpq %rbx, %rdi
je 0x58577
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xd8(%rsp), %rdi
callq 0x2e784
leaq 0x78(%rsp), %rsi
movq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0x3133c
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x3133c
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
leaq 0x88(%rsp), %r14
je 0x585c7
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x585e1
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xb0(%rsp), %rdi
callq 0x2e784
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0x2e784
jmp 0x58639
jmp 0x58617
movq %rax, %rbx
jmp 0x58646
movq %rax, %rbx
jmp 0x586b6
movq %rax, %rbx
jmp 0x586d8
jmp 0x58697
movq %rax, %rbx
jmp 0x586e5
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x2e784
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x58667
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x58667
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x58688
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x58688
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x2e784
jmp 0x5869a
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x586b6
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x586d8
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xb0(%rsp), %rdi
callq 0x2e784
movq 0x50(%rsp), %rdi
callq 0x2e784
movq %rbx, %rdi
callq 0x8840
nop