// File: /workspace/github_cpp_makefile_star2_O3/millanek[P]evo/process_vcf_fst.cpp
// Function: parseFstOptions(int, char**)
void parseFstOptions(int argc, char** argv) {
    bool die = false;
    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 OPT_VCF: arg >> opt::vcfFile; break;
            case OPT_SETS: arg >> opt::sampleSets; break;
            case OPT_ANC_SETS: arg >> opt::ancSets; break;
            case 'w':
                windowSizeStep = split(arg.str(), ',');
                opt::windowSize = atoi(windowSizeStep[0].c_str());
                opt::windowStep = atoi(windowSizeStep[1].c_str());
                break;
            case OPT_REG_ABOVE: arg >> opt::regAbove; break;
            case OPT_ANNOT: arg >> opt::annotFile; break;
            case OPT_MS: arg >> opt::msFile; break;
            case OPT_EIGEN: arg >> opt::eigensoftFile; break;
            case OPT_MS_SET1_SIZE: arg >> opt::msSet1Size; break;
            case OPT_MS_SET1_SAMPLE: arg >> opt::msSet1FstSample; break;
            case OPT_MS_SET2_SIZE: arg >> opt::msSet2Size; break;
            case OPT_MS_SET2_SAMPLE: arg >> opt::msSet2FstSample; break;
            case OPT_MS_PVALS: arg >> opt::msPvalCutoff; break;
            case OPT_ACC_GEN_BED: arg >> opt::accesibleGenBedFile; break;
            case OPT_PHYS_WINDOW_SIZE: arg >> opt::physicalWindowSize; break;
            case 's': arg >> opt::sampleNameFile; break;
            case 'n': arg >> opt::runName; break;
            case '?': die = true; break;
            case 'h': std::cout << FST_USAGE_MESSAGE;
                exit(EXIT_SUCCESS);
        }
    }
    if (argc - optind > 0)
    {
        std::cerr << "too many arguments\n";
        die = true;
    }
    
    if ((!opt::vcfFile.empty() && opt::sampleSets.empty()) || (opt::vcfFile.empty() && !opt::sampleSets.empty())) {
        std::cerr << "To calculate Fst statistics from a vcf, you need to use both the --vcf and the --sets options\n";
        die = true;
    }
    
    if ((!opt::msFile.empty() && (opt::msSet1Size == 0 || opt::msSet2Size == 0)) || (opt::msFile.empty() && (opt::msSet1Size != 0 || opt::msSet2Size != 0))) {
        std::cerr << "To calculate Fst statistics from ms output, you need to use the --ms and the --set1msSimSize and --set2msSimSize  options together\n";
        die = true;
    }
    
    if (opt::msPvalCutoff > 1) {
        std::cerr << "The pvalue cutoff cannot be more than one...\n";
        die = true;
    }
    
    if (opt::regAbove > 0 && opt::windowSize == 0) {
        std::cerr << "The window size (-w option) needs to be set for --regions-above option to work (you can set -w 1,1 for per variant Fst)\n";
        die = true;
    }
    
    
    if (die) {
        std::cout << "\n" << FST_USAGE_MESSAGE;
        exit(EXIT_FAILURE);
    }

    
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %r14
movl %edi, %ebp
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x445c7(%rip), %rdx     # 0xdbcfc
leaq 0x69704(%rip), %rcx     # 0x100e40
movq $0x0, 0x8(%rsp)
xorl %r8d, %r8d
callq 0x8770
movl %eax, %ebx
shll $0x18, %ebx
cmpl $0xff000000, %ebx       # imm = 0xFF000000
jne 0x977a7
movq 0x6a85f(%rip), %rax     # 0x101fc0
cmpl %ebp, (%rax)
movq 0x8(%rsp), %rbx
jge 0x97784
movb $0x1, %bl
movq 0x6a875(%rip), %rdi     # 0x101fe8
leaq 0x3477b(%rip), %rsi     # 0xcbef5
movl $0x13, %edx
callq 0x84e0
cmpq $0x0, 0x6c21c(%rip)     # 0x1039a8
movq 0x6c235(%rip), %rax     # 0x1039c8
je 0x97a49
testq %rax, %rax
jne 0x97a68
jmp 0x97a4e
movq $0x0, 0x8(%rsp)
leaq 0x10(%rsp), %r12
leaq 0x88(%rsp), %r13
movq 0x6a7bc(%rip), %rax     # 0x101f80
movq (%rax), %r15
testq %r15, %r15
leaq 0x361fa(%rip), %rax     # 0xcd9cb
cmoveq %rax, %r15
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r15, %rdi
callq 0x81f0
leaq (%rax,%r15), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x28a52
movq %r13, %rdi
movq %r12, %rsi
movl $0x8, %edx
callq 0x87b0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x97822
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
sarl $0x18, %ebx
cmpl $0x3e, %ebx
jg 0x97867
addl $-0x2, %ebx
cmpl $0xd, %ebx
ja 0x979d4
leaq 0x432d3(%rip), %rax     # 0xdab10
movslq (%rax,%rbx,4), %rdx
addq %rax, %rdx
leaq 0x6c175(%rip), %rsi     # 0x1039c0
leaq 0x6c276(%rip), %rcx     # 0x103ac8
leaq 0x6c283(%rip), %rax     # 0x103adc
jmpq *%rdx
leaq 0x6c13e(%rip), %rsi     # 0x1039a0
jmp 0x97992
cmpl $0x72, %ebx
jg 0x9788a
cmpl $0x3f, %ebx
je 0x97a21
cmpl $0x6e, %ebx
jne 0x97a2a
leaq 0x6c21b(%rip), %rsi     # 0x103aa0
jmp 0x97992
cmpl $0x73, %ebx
je 0x9798b
cmpl $0x77, %ebx
jne 0x979d4
movq %r12, %rdi
leaq 0x98(%rsp), %rsi
callq 0x8700
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movl $0x2c, %edx
callq 0x4d650
movq 0x40(%rsp), %rax
movapd 0x50(%rsp), %xmm0
movq 0x60(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movapd 0x30(%rsp), %xmm1
movapd %xmm0, 0x30(%rsp)
movapd %xmm1, 0x70(%rsp)
movq %rax, 0x80(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x2e784
movq %rbx, %rdi
callq 0x2e784
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x97931
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x30(%rsp), %rbx
movq (%rbx), %rdi
callq 0x86e0
movl %eax, 0x6c17c(%rip)     # 0x103ac0
movq 0x20(%rbx), %rdi
callq 0x86e0
movl %eax, 0x6c171(%rip)     # 0x103ac4
jmp 0x979d4
leaq 0x6c084(%rip), %rsi     # 0x1039e0
jmp 0x97992
leaq 0x6c0fb(%rip), %rsi     # 0x103a60
jmp 0x97992
leaq 0x6c0b2(%rip), %rsi     # 0x103a20
jmp 0x97992
leaq 0x6c0c9(%rip), %rsi     # 0x103a40
jmp 0x97992
leaq 0x6c100(%rip), %rsi     # 0x103a80
jmp 0x97992
leaq 0x6c15b(%rip), %rax     # 0x103ae4
jmp 0x979c9
leaq 0x6c06e(%rip), %rsi     # 0x103a00
movq %r13, %rdi
callq 0x8560
jmp 0x979d4
leaq 0x6abf5(%rip), %rax     # 0x102598
jmp 0x979c9
leaq 0x6c12c(%rip), %rax     # 0x103ad8
jmp 0x979c9
leaq 0x6c11b(%rip), %rcx     # 0x103ad0
movq %r13, %rdi
movq %rcx, %rsi
callq 0x82d0
jmp 0x979d4
leaq 0x6c117(%rip), %rax     # 0x103ae0
movq %r13, %rdi
movq %rax, %rsi
callq 0x82b0
movq %r13, %rdi
movq 0x6a5ba(%rip), %rsi     # 0x101f98
callq 0x8620
leaq 0x100(%rsp), %rdi
callq 0x8190
movl %ebp, %edi
movq %r14, %rsi
leaq 0x44300(%rip), %rdx     # 0xdbcfc
leaq 0x6943d(%rip), %rcx     # 0x100e40
xorl %r8d, %r8d
callq 0x8770
movl %eax, %ebx
shll $0x18, %ebx
cmpl $0xff000000, %ebx       # imm = 0xFF000000
jne 0x977bd
jmp 0x9775a
movb $0x1, %al
movq %rax, 0x8(%rsp)
jmp 0x979d4
cmpl $0x68, %ebx
jne 0x979d4
movq 0x6a582(%rip), %rdi     # 0x101fb8
leaq 0x44344(%rip), %rsi     # 0xdbd81
callq 0x8460
xorl %edi, %edi
callq 0x8530
testq %rax, %rax
je 0x97a68
movb $0x1, %bl
movq 0x6a591(%rip), %rdi     # 0x101fe8
leaq 0x440b5(%rip), %rsi     # 0xdbb13
movl $0x5e, %edx
callq 0x84e0
cmpq $0x0, 0x6c018(%rip)     # 0x103a88
movl 0x6c066(%rip), %ecx     # 0x103adc
movl 0x6c068(%rip), %eax     # 0x103ae4
je 0x97a8e
testl %ecx, %ecx
sete %cl
testl %eax, %eax
sete %al
orb %cl, %al
jne 0x97a92
jmp 0x97aac
orl %eax, %ecx
je 0x97aac
movb $0x1, %bl
movq 0x6a54d(%rip), %rdi     # 0x101fe8
leaq 0x440d0(%rip), %rsi     # 0xdbb72
movl $0x83, %edx
callq 0x84e0
movsd 0x6c01c(%rip), %xmm0    # 0x103ad0
ucomisd 0x34c54(%rip), %xmm0    # 0xcc710
ja 0x97afa
movsd 0x6c002(%rip), %xmm0    # 0x103ac8
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x97ad9
cmpl $0x0, 0x6bfe9(%rip)     # 0x103ac0
je 0x97b2d
testb $0x1, %bl
jne 0x97b45
leaq 0x30(%rsp), %rdi
callq 0x2e784
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x6a4e7(%rip), %rdi     # 0x101fe8
leaq 0x440ee(%rip), %rsi     # 0xdbbf6
movl $0x2d, %edx
callq 0x84e0
movsd 0x6bfae(%rip), %xmm0    # 0x103ac8
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x97b45
cmpl $0x0, 0x6bf95(%rip)     # 0x103ac0
jne 0x97b45
movq 0x6a4b4(%rip), %rdi     # 0x101fe8
leaq 0x440e9(%rip), %rsi     # 0xdbc24
movl $0x78, %edx
callq 0x84e0
movq 0x6a46c(%rip), %rdi     # 0x101fb8
leaq 0x338ea(%rip), %rsi     # 0xcb43d
movl $0x1, %edx
callq 0x84e0
movq 0x6a454(%rip), %rdi     # 0x101fb8
leaq 0x44216(%rip), %rsi     # 0xdbd81
callq 0x8460
movl $0x1, %edi
callq 0x8530
jmp 0x97ba1
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x97ba4
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x97ba4
jmp 0x97ba1
jmp 0x97bc7
movq %rax, %rbx
movq 0x6a3ed(%rip), %rsi     # 0x101f98
leaq 0x88(%rsp), %rdi
callq 0x8620
leaq 0x100(%rsp), %rdi
callq 0x8190
jmp 0x97beb
movq %rax, %rbx
jmp 0x97beb
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x97beb
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x30(%rsp), %rdi
callq 0x2e784
movq %rbx, %rdi
callq 0x8840
nop