// File: millanek[P]evo/evo_fullAnnotationExtract.cpp
// Function: parseAnnotExtractOptions(int, char**)
void parseAnnotExtractOptions(int argc, char** argv) {
    bool die = false;
    std::string regulString = "";
    for (char c; (c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1;)
    {
        std::istringstream arg(optarg != NULL ? optarg : "");
        switch (c)
        {
            case '?': die = true; break;
            case 'r': opt::regulatory = true; arg >> regulString;
                break;
            case 'h':
                std::cout << ANNOTEXTRACT_USAGE_MESSAGE;
                exit(EXIT_SUCCESS);
        }
    }
    
    if (regulString != "") {
        std::vector<string> upDown = split(regulString, ',');
        if (upDown.size() != 2) {
            std::cerr << "Check the format of your --regulatory argument\n";
            die = true;
        } else {
            opt::bp_5prime = atoi(upDown[0].c_str()); opt::bp_3prime = atoi(upDown[1].c_str());
        }
    }
    
    if (argc - optind < 2) {
        std::cerr << "missing arguments\n";
        die = true;
    }
    else if (argc - optind > 2)
    {
        std::cerr << "too many arguments\n";
        die = true;
    }
    
    if (die) {
        std::cout << "\n" << ANNOTEXTRACT_USAGE_MESSAGE;
        exit(EXIT_FAILURE);
    }
    opt::gpFile = argv[optind++];
    opt::annotationFile = argv[optind++];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0xab60
movq -0x218(%rbp), %rdx
leaq 0xdf9ab(%rip), %rsi     # 0x135edf
leaq -0x38(%rbp), %rdi
callq 0x2d6c0
jmp 0x5653f
leaq -0x39(%rbp), %rdi
callq 0xa640
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movq 0x14318a(%rip), %rdx    # 0x1996e0
leaq 0x140333(%rip), %rcx    # 0x196890
xorl %eax, %eax
movl %eax, %r8d
callq 0xaa40
movb %al, -0x4d(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0x56703
movq 0x142a13(%rip), %rax    # 0x198f90
cmpq $0x0, (%rax)
je 0x56596
movq 0x142a06(%rip), %rax    # 0x198f90
movq (%rax), %rax
movq %rax, -0x220(%rbp)
jmp 0x565a6
leaq 0xdf942(%rip), %rax     # 0x135edf
movq %rax, -0x220(%rbp)
jmp 0x565a6
movq -0x220(%rbp), %rax
movq %rax, -0x230(%rbp)
leaq -0x1f1(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0xab60
movq -0x230(%rbp), %rsi
movq -0x228(%rbp), %rdx
leaq -0x1f0(%rbp), %rdi
callq 0x2d6c0
jmp 0x565e3
leaq -0x1d0(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
movl $0x8, %edx
callq 0xaaa0
jmp 0x565fd
leaq -0x1f0(%rbp), %rdi
callq 0xac88
leaq -0x1f1(%rbp), %rdi
callq 0xa640
movsbl -0x4d(%rbp), %eax
movl %eax, -0x234(%rbp)
subl $0x3f, %eax
je 0x56698
jmp 0x56626
movl -0x234(%rbp), %eax
subl $0x68, %eax
je 0x566d6
jmp 0x56637
movl -0x234(%rbp), %eax
subl $0x72, %eax
je 0x5669e
jmp 0x566f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0xa640
jmp 0x568f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x56687
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0xac88
leaq -0x1f1(%rbp), %rdi
callq 0xa640
jmp 0x568ec
movb $0x1, -0x11(%rbp)
jmp 0x566f2
movb $0x1, 0x143813(%rip)    # 0x199eb8
leaq -0x1d0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xa750
jmp 0x566b7
jmp 0x566f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0xa290
jmp 0x568ec
movq 0x14300b(%rip), %rsi    # 0x1996e8
movq 0x1428d4(%rip), %rdi    # 0x198fb8
callq 0xa5c0
jmp 0x566eb
xorl %edi, %edi
callq 0xa700
leaq -0x1d0(%rbp), %rdi
callq 0xa290
jmp 0x56548
leaq 0xdf7d5(%rip), %rsi     # 0x135edf
leaq -0x38(%rbp), %rdi
callq 0x50eb0
movb %al, -0x235(%rbp)
jmp 0x5671b
movb -0x235(%rbp), %al
testb $0x1, %al
jne 0x5672a
jmp 0x567f5
leaq -0x210(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movl $0x2c, %edx
callq 0x7bbe0
jmp 0x56741
leaq -0x210(%rbp), %rdi
callq 0x3ffd0
cmpq $0x2, %rax
je 0x5679c
movq 0x142896(%rip), %rdi    # 0x198ff0
leaq 0xde3f3(%rip), %rsi     # 0x134b54
callq 0xa5c0
jmp 0x56768
movb $0x1, -0x11(%rbp)
jmp 0x567e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x568ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x3dfa0
jmp 0x568ec
leaq -0x210(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movl %eax, 0x142f1a(%rip)    # 0x1996dc
leaq -0x210(%rbp), %rdi
movl $0x1, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movl %eax, 0x142eef(%rip)    # 0x1996d8
leaq -0x210(%rbp), %rdi
callq 0x3dfa0
movl -0x4(%rbp), %eax
movq 0x1427c1(%rip), %rcx    # 0x198fc0
subl (%rcx), %eax
cmpl $0x2, %eax
jge 0x56821
movq 0x1427e3(%rip), %rdi    # 0x198ff0
leaq 0xdbc16(%rip), %rsi     # 0x13242a
callq 0xa5c0
jmp 0x5681b
movb $0x1, -0x11(%rbp)
jmp 0x5684d
movl -0x4(%rbp), %eax
movq 0x142795(%rip), %rcx    # 0x198fc0
subl (%rcx), %eax
cmpl $0x2, %eax
jle 0x5684b
movq 0x1427b7(%rip), %rdi    # 0x198ff0
leaq 0xdbbfd(%rip), %rsi     # 0x13243d
callq 0xa5c0
jmp 0x56847
movb $0x1, -0x11(%rbp)
jmp 0x5684d
testb $0x1, -0x11(%rbp)
je 0x5688e
movq 0x14275e(%rip), %rdi    # 0x198fb8
leaq 0xd902c(%rip), %rsi     # 0x12f88d
callq 0xa5c0
movq %rax, -0x240(%rbp)
jmp 0x5686f
movq -0x240(%rbp), %rdi
movq 0x142e6b(%rip), %rsi    # 0x1996e8
callq 0xa5c0
jmp 0x56884
movl $0x1, %edi
callq 0xa700
movq -0x10(%rbp), %rax
movq 0x142727(%rip), %rdx    # 0x198fc0
movslq (%rdx), %rcx
movl %ecx, %esi
incl %esi
movl %esi, (%rdx)
movq (%rax,%rcx,8), %rsi
leaq 0x1435cb(%rip), %rdi    # 0x199e78
callq 0xa810
jmp 0x568b4
movq -0x10(%rbp), %rax
movq 0x142701(%rip), %rdx    # 0x198fc0
movslq (%rdx), %rcx
movl %ecx, %esi
incl %esi
movl %esi, (%rdx)
movq (%rax,%rcx,8), %rsi
leaq 0x1435c5(%rip), %rdi    # 0x199e98
callq 0xa810
jmp 0x568da
leaq -0x38(%rbp), %rdi
callq 0xac88
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0xac88
movq -0x48(%rbp), %rdi
callq 0xab50
nop