// File: millanek[P]evo/evo_PBS.cpp
// Function: parsePBSoptions(int, char**)
void parsePBSoptions(int argc, char** argv) {
    bool die = false; string regionArgString; std::vector<string> regionArgs;
    std::vector<string> windowSizeStep;
    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 'f': arg >> opt::fixedWindowSize; break;
            case 'w':
                windowSizeStep = split(arg.str(), ',');
                opt::windowSize = atoi(windowSizeStep[0].c_str());
                opt::windowStep = atoi(windowSizeStep[1].c_str());
                break;
            case 'n': arg >> opt::runName; break;
            case 'i': opt::allowIndels = true; break;
            case OPT_ANNOT: arg >> opt::annotFile; break;
            case OPT_AF: opt::af = true; break;
            case 'h':
                std::cout << PBS_USAGE_MESSAGE;
                exit(EXIT_SUCCESS);
        }
    }
    
    if (argc - optind < 3) {
        std::cerr << "missing arguments\n";
        die = true;
    }
    else if (argc - optind > 3)
    {
        std::cerr << "too many arguments\n";
        die = true;
    }
    
    if (die) {
        std::cout << "\n" << PBS_USAGE_MESSAGE;
        exit(EXIT_FAILURE);
    }
    
    // Parse the input filenames
    opt::vcfFile = argv[optind++];
    opt::setsFile = argv[optind++];
    opt::PBStriosFile = argv[optind++];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x290, %rsp            # imm = 0x290
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xa820
leaq -0x50(%rbp), %rdi
callq 0x48da0
leaq -0x68(%rbp), %rdi
callq 0x48da0
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movq 0x9a3f9(%rip), %rdx     # 0x1999e8
leaq 0x98f8a(%rip), %rcx     # 0x198580
xorl %eax, %eax
movl %eax, %r8d
callq 0xaa40
movb %al, -0x69(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0xff8f7
movq 0x9997a(%rip), %rax     # 0x198f90
cmpq $0x0, (%rax)
je 0xff62f
movq 0x9996d(%rip), %rax     # 0x198f90
movq (%rax), %rax
movq %rax, -0x268(%rbp)
jmp 0xff63f
leaq 0x368a9(%rip), %rax     # 0x135edf
movq %rax, -0x268(%rbp)
jmp 0xff63f
movq -0x268(%rbp), %rax
movq %rax, -0x278(%rbp)
leaq -0x211(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0xab60
movq -0x278(%rbp), %rsi
movq -0x270(%rbp), %rdx
leaq -0x210(%rbp), %rdi
callq 0x2d6c0
jmp 0xff67c
leaq -0x1f0(%rbp), %rdi
leaq -0x210(%rbp), %rsi
movl $0x8, %edx
callq 0xaaa0
jmp 0xff696
leaq -0x210(%rbp), %rdi
callq 0xac88
leaq -0x211(%rbp), %rdi
callq 0xa640
movsbl -0x69(%rbp), %eax
movl %eax, -0x27c(%rbp)
testl %eax, %eax
je 0xff899
jmp 0xff6c2
movl -0x27c(%rbp), %eax
subl $0x1, %eax
je 0xff8b0
jmp 0xff6d3
movl -0x27c(%rbp), %eax
subl $0x3f, %eax
je 0xff77f
jmp 0xff6e4
movl -0x27c(%rbp), %eax
subl $0x66, %eax
je 0xff788
jmp 0xff6f5
movl -0x27c(%rbp), %eax
subl $0x68, %eax
je 0xff8b9
jmp 0xff706
movl -0x27c(%rbp), %eax
subl $0x69, %eax
je 0xff890
jmp 0xff717
movl -0x27c(%rbp), %eax
subl $0x6e, %eax
je 0xff879
jmp 0xff728
movl -0x27c(%rbp), %eax
subl $0x77, %eax
je 0xff7b9
jmp 0xff8d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0xff76e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x210(%rbp), %rdi
callq 0xac88
leaq -0x211(%rbp), %rdi
callq 0xa640
jmp 0xffa3d
movb $0x1, -0x11(%rbp)
jmp 0xff8d5
leaq 0x9a251(%rip), %rsi     # 0x1999e0
leaq -0x1f0(%rbp), %rdi
callq 0xa370
jmp 0xff79d
jmp 0xff8d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0xff8e6
leaq -0x260(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0xa900
jmp 0xff7ce
leaq -0x240(%rbp), %rdi
leaq -0x260(%rbp), %rsi
movl $0x2c, %edx
callq 0x7bbe0
jmp 0xff7e8
leaq -0x68(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x50c30
leaq -0x240(%rbp), %rdi
callq 0x3dfa0
leaq -0x260(%rbp), %rdi
callq 0xac88
leaq -0x68(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movl %eax, 0x9a1a5(%rip)     # 0x1999d8
leaq -0x68(%rbp), %rdi
movl $0x1, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movl %eax, 0x9a185(%rip)     # 0x1999dc
jmp 0xff8d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x260(%rbp), %rdi
callq 0xac88
jmp 0xff8e6
leaq 0x9ba90(%rip), %rsi     # 0x19b310
leaq -0x1f0(%rbp), %rdi
callq 0xa750
jmp 0xff88e
jmp 0xff8d5
movb $0x1, 0x9ba99(%rip)     # 0x19b330
jmp 0xff8d5
leaq 0x9ba50(%rip), %rsi     # 0x19b2f0
leaq -0x1f0(%rbp), %rdi
callq 0xa750
jmp 0xff8ae
jmp 0xff8d5
movb $0x1, 0x9ba7a(%rip)     # 0x19b331
jmp 0xff8d5
movq 0x9a130(%rip), %rsi     # 0x1999f0
movq 0x996f1(%rip), %rdi     # 0x198fb8
callq 0xa5c0
jmp 0xff8ce
xorl %edi, %edi
callq 0xa700
leaq -0x1f0(%rbp), %rdi
callq 0xa290
jmp 0xff5e1
leaq -0x1f0(%rbp), %rdi
callq 0xa290
jmp 0xffa3d
movl -0x4(%rbp), %eax
movq 0x996bf(%rip), %rcx     # 0x198fc0
subl (%rcx), %eax
cmpl $0x3, %eax
jge 0xff93a
movq 0x996e1(%rip), %rdi     # 0x198ff0
leaq 0x32b14(%rip), %rsi     # 0x13242a
callq 0xa5c0
jmp 0xff91d
movb $0x1, -0x11(%rbp)
jmp 0xff966
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0xffa3d
movl -0x4(%rbp), %eax
movq 0x9967c(%rip), %rcx     # 0x198fc0
subl (%rcx), %eax
cmpl $0x3, %eax
jle 0xff964
movq 0x9969e(%rip), %rdi     # 0x198ff0
leaq 0x32ae4(%rip), %rsi     # 0x13243d
callq 0xa5c0
jmp 0xff960
movb $0x1, -0x11(%rbp)
jmp 0xff966
testb $0x1, -0x11(%rbp)
je 0xff9a7
movq 0x99645(%rip), %rdi     # 0x198fb8
leaq 0x2ff13(%rip), %rsi     # 0x12f88d
callq 0xa5c0
movq %rax, -0x288(%rbp)
jmp 0xff988
movq -0x288(%rbp), %rdi
movq 0x9a05a(%rip), %rsi     # 0x1999f0
callq 0xa5c0
jmp 0xff99d
movl $0x1, %edi
callq 0xa700
movq -0x10(%rbp), %rax
movq 0x9960e(%rip), %rdx     # 0x198fc0
movslq (%rdx), %rcx
movl %ecx, %esi
incl %esi
movl %esi, (%rdx)
movq (%rax,%rcx,8), %rsi
leaq 0x9b8ca(%rip), %rdi     # 0x19b290
callq 0xa810
jmp 0xff9cd
movq -0x10(%rbp), %rax
movq 0x995e8(%rip), %rdx     # 0x198fc0
movslq (%rdx), %rcx
movl %ecx, %esi
incl %esi
movl %esi, (%rdx)
movq (%rax,%rcx,8), %rsi
leaq 0x9b8c4(%rip), %rdi     # 0x19b2b0
callq 0xa810
jmp 0xff9f3
movq -0x10(%rbp), %rax
movq 0x995c2(%rip), %rdx     # 0x198fc0
movslq (%rdx), %rcx
movl %ecx, %esi
incl %esi
movl %esi, (%rdx)
movq (%rax,%rcx,8), %rsi
leaq 0x9b8be(%rip), %rdi     # 0x19b2d0
callq 0xa810
jmp 0xffa19
leaq -0x68(%rbp), %rdi
callq 0x3dfa0
leaq -0x50(%rbp), %rdi
callq 0x3dfa0
leaq -0x38(%rbp), %rdi
callq 0xac88
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
leaq -0x68(%rbp), %rdi
callq 0x3dfa0
leaq -0x50(%rbp), %rdi
callq 0x3dfa0
leaq -0x38(%rbp), %rdi
callq 0xac88
movq -0x220(%rbp), %rdi
callq 0xab50
nopw %cs:(%rax,%rax)
nop