// File: /workspace/github_cpp_makefile_star2_O1/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 0x49f44
leaq 0xb0(%rsp), %rdi
movq %rax, %rsi
callq 0x3273a
leaq 0x88(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x79bcf(%rip), %rdx     # 0xd1c7f
leaq 0x78(%rsp), %rdi
movq %rdx, %rsi
callq 0x28952
movq %r15, 0xc8(%rsp)
movq %r14, 0xd0(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x7fcb5(%rip), %rsi     # 0xd7d92
leaq 0x7fcb7(%rip), %rdx     # 0xd7d9b
leaq 0x30(%rsp), %rdi
callq 0x28952
movq 0xb0(%rsp), %rsi
cmpq %rsi, 0xb8(%rsp)
je 0x58418
leaq 0x20(%rsp), %r14
xorl %ebx, %ebx
leaq 0xd8(%rsp), %rbp
xorl %r12d, %r12d
addq %rbx, %rsi
movq %rbp, %rdi
movl $0x9, %edx
callq 0x50624
movq 0xd8(%rsp), %rax
movq %r14, 0x10(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x2e45c
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 0x2e45c
movq %r14, %rdi
leaq 0x78710(%rip), %rsi     # 0xd08a3
callq 0x8160
testl %eax, %eax
movq %r14, %rdi
movl 0xc(%rsp), %r14d
je 0x581d3
leaq 0x78705(%rip), %rsi     # 0xd08b0
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 0x581ee
jmp 0x5826e
leal -0xbb8(%r15), %eax
cmpl %r14d, %eax
setle %al
cmpl %r14d, %r15d
setg %cl
testb %al, %cl
jne 0x5826e
cmpl %r14d, %r15d
setg %al
cmpl %r14d, %r13d
setl %cl
orb %al, %cl
je 0x5829f
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
leaq 0x20(%rsp), %r14
je 0x58223
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x5823a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
movq %rbp, %rdi
callq 0x3123c
incq %r12
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
addq $0x20, %rbx
cmpq %rax, %r12
jne 0x58116
jmp 0x58418
leaq 0x30(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x8ef84(%rip), %rcx     # 0xe7202
movl $0x8, %r8d
xorl %esi, %esi
callq 0x86c0
leaq 0x78(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x8270
jmp 0x583d3
leaq 0x30(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x7860c(%rip), %rcx     # 0xd08bb
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 0x49ec8
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x49f44
leaq 0x98(%rsp), %rdi
movq %rax, %rsi
callq 0x3273a
movq 0x98(%rsp), %rsi
cmpq %rsi, 0xa0(%rsp)
je 0x583c6
xorl %r13d, %r13d
leaq 0xf0(%rsp), %rbx
leaq 0x7fa70(%rip), %rbp     # 0xd7d9c
leaq 0x30(%rsp), %r15
xorl %r14d, %r14d
addq %r13, %rsi
movq %rbx, %rdi
movl $0x9, %edx
callq 0x50624
movq 0xf0(%rsp), %r12
movq 0x20(%r12), %rdi
callq 0x86e0
cmpl 0xc(%rsp), %eax
jg 0x58384
movq 0x40(%r12), %rdi
callq 0x86e0
cmpl 0xc(%rsp), %eax
jl 0x58384
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 0x3123c
testl %r12d, %r12d
je 0x583c6
incq %r14
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
addq $0x20, %r13
cmpq %rax, %r14
jne 0x58334
leaq 0x98(%rsp), %rdi
callq 0x3123c
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
leaq 0x20(%rsp), %rbx
je 0x583f4
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x10(%rsp), %rdi
cmpq %rbx, %rdi
je 0x5840b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xd8(%rsp), %rdi
callq 0x3123c
leaq 0x78(%rsp), %rsi
movq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0x33db0
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x33db0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
leaq 0x88(%rsp), %r14
je 0x5845b
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x58475
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xb0(%rsp), %rdi
callq 0x3123c
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 0x3123c
jmp 0x584cd
jmp 0x584ab
movq %rax, %rbx
jmp 0x584da
movq %rax, %rbx
jmp 0x5854a
movq %rax, %rbx
jmp 0x5856c
jmp 0x5852b
movq %rax, %rbx
jmp 0x58579
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x3123c
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x584fb
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x584fb
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x5851c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x5851c
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x3123c
jmp 0x5852e
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x5854a
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x5856c
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xb0(%rsp), %rdi
callq 0x3123c
movq 0x50(%rsp), %rdi
callq 0x3123c
movq %rbx, %rdi
callq 0x8840
nop