// File: 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
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x160(%rbp)
movq %rdi, %rax
movq %rax, -0x158(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x150(%rbp)
movb $0x0, -0x1d(%rbp)
callq 0x48da0
movq -0x150(%rbp), %rdi
addq $0x60, %rdi
movq -0x18(%rbp), %rsi
callq 0x6b400
movq %rax, -0x148(%rbp)
jmp 0x8f43c
movq -0x148(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x3fee0
jmp 0x8f44e
leaq -0x69(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0xab60
movq -0x168(%rbp), %rdx
leaq 0xa6a73(%rip), %rsi     # 0x135edf
leaq -0x68(%rbp), %rdi
callq 0x2d6c0
jmp 0x8f477
leaq -0x69(%rbp), %rdi
callq 0xa640
leaq -0x91(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0xab60
movq -0x170(%rbp), %rdx
leaq 0xaccae(%rip), %rsi     # 0x13c14f
leaq -0x90(%rbp), %rdi
callq 0x2d6c0
jmp 0x8f4af
leaq -0x91(%rbp), %rdi
callq 0xa640
movq $0x0, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3ffd0
movq %rax, %rcx
movq -0x178(%rbp), %rax
cmpq %rcx, %rax
je 0x8f9fa
movq -0xa0(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x3d940
movq %rax, %rsi
leaq -0xb8(%rbp), %rdi
movl $0x9, %edx
callq 0x7bbe0
jmp 0x8f516
xorl %eax, %eax
movl %eax, %esi
leaq -0xb8(%rbp), %rdi
callq 0x3d940
movq %rax, %rsi
leaq -0xd8(%rbp), %rdi
callq 0xa250
jmp 0x8f537
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x180(%rbp)
movl $0x1, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movq -0x180(%rbp), %rdi
movl %eax, -0xdc(%rbp)
movl $0x2, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movq -0x180(%rbp), %rdi
movl %eax, -0xe0(%rbp)
movl $0x3, %esi
callq 0x3d940
movq %rax, %rsi
leaq -0x100(%rbp), %rdi
callq 0xa250
jmp 0x8f5ae
leaq 0xa554e(%rip), %rsi     # 0x134b03
leaq -0x100(%rbp), %rdi
callq 0x2d770
movb %al, -0x181(%rbp)
jmp 0x8f5c9
movb -0x181(%rbp), %al
testb $0x1, %al
jne 0x8f5d8
jmp 0x8f6c2
movl -0x1c(%rbp), %eax
movl -0xdc(%rbp), %ecx
subl $0xbb8, %ecx            # imm = 0xBB8
cmpl %ecx, %eax
jl 0x8f6c0
movl -0x1c(%rbp), %eax
cmpl -0xdc(%rbp), %eax
jge 0x8f6c0
leaq 0xbc649(%rip), %rsi     # 0x14bc4e
leaq -0x90(%rbp), %rdi
callq 0xa810
jmp 0x8f613
leaq -0x68(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0xa060
jmp 0x8f625
movl $0x2, -0x104(%rbp)
jmp 0x8f989
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x8fa91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0xa640
jmp 0x8fa6a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x91(%rbp), %rdi
callq 0xa640
jmp 0x8fa61
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x8fa55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x8f9ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x8f9e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x8f9d4
jmp 0x8f741
leaq 0xa5447(%rip), %rsi     # 0x134b10
leaq -0x100(%rbp), %rdi
callq 0x2d770
movb %al, -0x182(%rbp)
jmp 0x8f6dd
movb -0x182(%rbp), %al
testb $0x1, %al
jne 0x8f6e9
jmp 0x8f73f
movl -0x1c(%rbp), %eax
cmpl -0xe0(%rbp), %eax
jle 0x8f73d
movl -0x1c(%rbp), %eax
movl -0xe0(%rbp), %ecx
addl $0xbb8, %ecx            # imm = 0xBB8
cmpl %ecx, %eax
jg 0x8f73d
leaq 0xbc540(%rip), %rsi     # 0x14bc4e
leaq -0x90(%rbp), %rdi
callq 0xa810
jmp 0x8f71c
leaq -0x68(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0xa060
jmp 0x8f72e
movl $0x2, -0x104(%rbp)
jmp 0x8f989
jmp 0x8f73f
jmp 0x8f741
movl -0x1c(%rbp), %eax
cmpl -0xdc(%rbp), %eax
jl 0x8f97f
movl -0x1c(%rbp), %eax
cmpl -0xe0(%rbp), %eax
jg 0x8f97f
leaq 0xa53b5(%rip), %rsi     # 0x134b1b
leaq -0x90(%rbp), %rdi
callq 0xa810
jmp 0x8f774
leaq -0x68(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0xa060
jmp 0x8f786
movq -0x150(%rbp), %rdi
addq $0x90, %rdi
movq -0x18(%rbp), %rsi
callq 0x6b320
movq %rax, -0x190(%rbp)
jmp 0x8f7a6
movq -0x190(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x6b400
movq %rax, -0x198(%rbp)
jmp 0x8f7c2
movq -0x198(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0x3fee0
jmp 0x8f7d7
movq $0x0, -0x128(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0x1a0(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x3ffd0
movq %rax, %rcx
movq -0x1a0(%rbp), %rax
cmpq %rcx, %rax
je 0x8f959
movq -0x128(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0x3d940
movq %rax, %rsi
leaq -0x140(%rbp), %rdi
movl $0x9, %edx
callq 0x7bbe0
jmp 0x8f838
movl -0x1c(%rbp), %eax
movl %eax, -0x1a4(%rbp)
leaq -0x140(%rbp), %rdi
movl $0x1, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movl %eax, %ecx
movl -0x1a4(%rbp), %eax
cmpl %ecx, %eax
jl 0x8f8e9
movl -0x1c(%rbp), %eax
movl %eax, -0x1a8(%rbp)
leaq -0x140(%rbp), %rdi
movl $0x2, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movl %eax, %ecx
movl -0x1a8(%rbp), %eax
cmpl %ecx, %eax
jg 0x8f8e9
leaq 0xac8ae(%rip), %rsi     # 0x13c159
leaq -0x90(%rbp), %rdi
callq 0xa810
jmp 0x8f8b9
jmp 0x8f8e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x8f971
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x3dfa0
jmp 0x8f971
leaq 0xac869(%rip), %rsi     # 0x13c159
leaq -0x90(%rbp), %rdi
callq 0x2d770
movb %al, -0x1a9(%rbp)
jmp 0x8f904
movb -0x1a9(%rbp), %al
testb $0x1, %al
jne 0x8f910
jmp 0x8f91c
movl $0x5, -0x104(%rbp)
jmp 0x8f926
movl $0x0, -0x104(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x3dfa0
movl -0x104(%rbp), %eax
testl %eax, %eax
je 0x8f940
jmp 0x8f93e
jmp 0x8f959
jmp 0x8f942
movq -0x128(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x128(%rbp)
jmp 0x8f7e2
movl $0x2, -0x104(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x3dfa0
jmp 0x8f989
leaq -0x120(%rbp), %rdi
callq 0x3dfa0
jmp 0x8f9d4
movl $0x0, -0x104(%rbp)
leaq -0x100(%rbp), %rdi
callq 0xac88
leaq -0xd8(%rbp), %rdi
callq 0xac88
leaq -0xb8(%rbp), %rdi
callq 0x3dfa0
movl -0x104(%rbp), %eax
testl %eax, %eax
je 0x8f9bb
jmp 0x8f9b9
jmp 0x8f9fa
jmp 0x8f9bd
movq -0xa0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa0(%rbp)
jmp 0x8f4c6
leaq -0x100(%rbp), %rdi
callq 0xac88
leaq -0xd8(%rbp), %rdi
callq 0xac88
leaq -0xb8(%rbp), %rdi
callq 0x3dfa0
jmp 0x8fa55
movq -0x160(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x48dc0
jmp 0x8fa0c
movq -0x160(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x48dc0
jmp 0x8fa21
movb $0x1, -0x1d(%rbp)
movl $0x1, -0x104(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xac88
leaq -0x68(%rbp), %rdi
callq 0xac88
leaq -0x38(%rbp), %rdi
callq 0x3dfa0
testb $0x1, -0x1d(%rbp)
jne 0x8fa81
jmp 0x8fa75
leaq -0x90(%rbp), %rdi
callq 0xac88
leaq -0x68(%rbp), %rdi
callq 0xac88
leaq -0x38(%rbp), %rdi
callq 0x3dfa0
jmp 0x8fa91
movq -0x160(%rbp), %rdi
callq 0x3dfa0
movq -0x158(%rbp), %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq -0x160(%rbp), %rdi
callq 0x3dfa0
movq -0x40(%rbp), %rdi
callq 0xab50
nopw %cs:(%rax,%rax)