// File: millanek[P]evo/evo_FstAgainstAll.cpp
// Function: parseFstGlobaloptions(int, char**)
void parseFstGlobaloptions(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 OPT_ANNOT: arg >> opt::annotFile; break;
            case 'h':
                std::cout << FSTGLOBAL_USAGE_MESSAGE;
                exit(EXIT_SUCCESS);
        }
    }
    
    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" << FSTGLOBAL_USAGE_MESSAGE;
        exit(EXIT_FAILURE);
    }
    
    // Parse the input filenames
    opt::vcfFile = argv[optind++];
    opt::setsFile = 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 0x91c79(%rip), %rdx     # 0x199a08
leaq 0x908ea(%rip), %rcx     # 0x198680
xorl %eax, %eax
movl %eax, %r8d
callq 0xaa40
movb %al, -0x69(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0x108063
movq 0x911da(%rip), %rax     # 0x198f90
cmpq $0x0, (%rax)
je 0x107dcf
movq 0x911cd(%rip), %rax     # 0x198f90
movq (%rax), %rax
movq %rax, -0x268(%rbp)
jmp 0x107ddf
leaq 0x2e109(%rip), %rax     # 0x135edf
movq %rax, -0x268(%rbp)
jmp 0x107ddf
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 0x107e1c
leaq -0x1f0(%rbp), %rdi
leaq -0x210(%rbp), %rsi
movl $0x8, %edx
callq 0xaaa0
jmp 0x107e36
leaq -0x210(%rbp), %rdi
callq 0xac88
leaq -0x211(%rbp), %rdi
callq 0xa640
movsbl -0x69(%rbp), %eax
movl %eax, -0x27c(%rbp)
testl %eax, %eax
je 0x10800e
jmp 0x107e62
movl -0x27c(%rbp), %eax
subl $0x3f, %eax
je 0x107efd
jmp 0x107e73
movl -0x27c(%rbp), %eax
subl $0x66, %eax
je 0x107f06
jmp 0x107e84
movl -0x27c(%rbp), %eax
subl $0x68, %eax
je 0x108025
jmp 0x107e95
movl -0x27c(%rbp), %eax
subl $0x6e, %eax
je 0x107ff7
jmp 0x107ea6
movl -0x27c(%rbp), %eax
subl $0x77, %eax
je 0x107f37
jmp 0x108041
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x107eec
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 0x108183
movb $0x1, -0x11(%rbp)
jmp 0x108041
leaq 0x91af3(%rip), %rsi     # 0x199a00
leaq -0x1f0(%rbp), %rdi
callq 0xa370
jmp 0x107f1b
jmp 0x108041
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x108052
leaq -0x260(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0xa900
jmp 0x107f4c
leaq -0x240(%rbp), %rdi
leaq -0x260(%rbp), %rsi
movl $0x2c, %edx
callq 0x7bbe0
jmp 0x107f66
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, 0x91a47(%rip)     # 0x1999f8
leaq -0x68(%rbp), %rdi
movl $0x1, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movl %eax, 0x91a27(%rip)     # 0x1999fc
jmp 0x108041
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x260(%rbp), %rdi
callq 0xac88
jmp 0x108052
leaq 0x933c2(%rip), %rsi     # 0x19b3c0
leaq -0x1f0(%rbp), %rdi
callq 0xa750
jmp 0x10800c
jmp 0x108041
leaq 0x9338b(%rip), %rsi     # 0x19b3a0
leaq -0x1f0(%rbp), %rdi
callq 0xa750
jmp 0x108023
jmp 0x108041
movq 0x919e4(%rip), %rsi     # 0x199a10
movq 0x90f85(%rip), %rdi     # 0x198fb8
callq 0xa5c0
jmp 0x10803a
xorl %edi, %edi
callq 0xa700
leaq -0x1f0(%rbp), %rdi
callq 0xa290
jmp 0x107d81
leaq -0x1f0(%rbp), %rdi
callq 0xa290
jmp 0x108183
movl -0x4(%rbp), %eax
movq 0x90f53(%rip), %rcx     # 0x198fc0
subl (%rcx), %eax
cmpl $0x2, %eax
jge 0x1080a6
movq 0x90f75(%rip), %rdi     # 0x198ff0
leaq 0x2a3a8(%rip), %rsi     # 0x13242a
callq 0xa5c0
jmp 0x108089
movb $0x1, -0x11(%rbp)
jmp 0x1080d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x108183
movl -0x4(%rbp), %eax
movq 0x90f10(%rip), %rcx     # 0x198fc0
subl (%rcx), %eax
cmpl $0x2, %eax
jle 0x1080d0
movq 0x90f32(%rip), %rdi     # 0x198ff0
leaq 0x2a378(%rip), %rsi     # 0x13243d
callq 0xa5c0
jmp 0x1080cc
movb $0x1, -0x11(%rbp)
jmp 0x1080d2
testb $0x1, -0x11(%rbp)
je 0x108113
movq 0x90ed9(%rip), %rdi     # 0x198fb8
leaq 0x277a7(%rip), %rsi     # 0x12f88d
callq 0xa5c0
movq %rax, -0x288(%rbp)
jmp 0x1080f4
movq -0x288(%rbp), %rdi
movq 0x9190e(%rip), %rsi     # 0x199a10
callq 0xa5c0
jmp 0x108109
movl $0x1, %edi
callq 0xa700
movq -0x10(%rbp), %rax
movq 0x90ea2(%rip), %rdx     # 0x198fc0
movslq (%rdx), %rcx
movl %ecx, %esi
incl %esi
movl %esi, (%rdx)
movq (%rax,%rcx,8), %rsi
leaq 0x9320e(%rip), %rdi     # 0x19b340
callq 0xa810
jmp 0x108139
movq -0x10(%rbp), %rax
movq 0x90e7c(%rip), %rdx     # 0x198fc0
movslq (%rdx), %rcx
movl %ecx, %esi
incl %esi
movl %esi, (%rdx)
movq (%rax,%rcx,8), %rsi
leaq 0x93208(%rip), %rdi     # 0x19b360
callq 0xa810
jmp 0x10815f
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 (%rax,%rax)