// File: /workspace/github_cpp_makefile_star2_O2/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 $0x1e8, %rsp            # imm = 0x1E8
movq %rsi, %r14
movl %edi, %ebx
xorpd %xmm0, %xmm0
leaq 0x10(%rsp), %rax
movapd %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq $0x0, 0x8(%rsp)
leaq 0x30(%rsp), %r12
leaq 0x68(%rsp), %r13
leaq 0x39e73(%rip), %r15     # 0xaa7f0
movl %ebx, %edi
movq %r14, %rsi
leaq 0x3b053(%rip), %rdx     # 0xab9dc
leaq 0x6b4d0(%rip), %rcx     # 0xdbe60
xorl %r8d, %r8d
callq 0x8790
movl %eax, %ebp
shll $0x18, %eax
cmpl $0xff000000, %eax       # imm = 0xFF000000
je 0x70b3c
movq 0x6c5e1(%rip), %rax     # 0xdcf90
movq (%rax), %rsi
testq %rsi, %rsi
leaq 0x29463(%rip), %rax     # 0x99e1f
cmoveq %rax, %rsi
movq %r12, %rdi
leaq 0x50(%rsp), %rdx
callq 0x21904
movq %r13, %rdi
movq %r12, %rsi
pushq $0x8
popq %rdx
callq 0x87e0
movsbl %bpl, %ebp
movq %r12, %rdi
callq 0x8978
leal -0x2(%rbp), %eax
cmpl $0xd, %eax
ja 0x70a16
movslq (%r15,%rax,4), %rdx
addq %r15, %rdx
leaq 0x6dfeb(%rip), %rsi     # 0xde9e8
leaq 0x6e0ec(%rip), %rcx     # 0xdeaf0
leaq 0x6e0f9(%rip), %rax     # 0xdeb04
jmpq *%rdx
leaq 0x6dfb4(%rip), %rsi     # 0xde9c8
jmp 0x70a8b
cmpl $0x3f, %ebp
je 0x70a60
cmpl $0x6e, %ebp
je 0x70a7b
cmpl $0x73, %ebp
je 0x70a84
cmpl $0x77, %ebp
je 0x70ada
cmpl $0x68, %ebp
jne 0x70acd
jmp 0x70c35
leaq 0x6dfc5(%rip), %rsi     # 0xdea08
jmp 0x70a8b
leaq 0x6e03c(%rip), %rsi     # 0xdea88
jmp 0x70a8b
leaq 0x6dff3(%rip), %rsi     # 0xdea48
jmp 0x70a8b
leaq 0x6e00a(%rip), %rsi     # 0xdea68
jmp 0x70a8b
movb $0x1, %al
movq %rax, 0x8(%rsp)
jmp 0x70acd
leaq 0x6e038(%rip), %rsi     # 0xdeaa8
jmp 0x70a8b
leaq 0x6e093(%rip), %rax     # 0xdeb0c
jmp 0x70ac2
leaq 0x6e046(%rip), %rsi     # 0xdeac8
jmp 0x70a8b
leaq 0x6df9d(%rip), %rsi     # 0xdea28
movq %r13, %rdi
callq 0x8570
jmp 0x70acd
leaq 0x6cb34(%rip), %rax     # 0xdd5d0
jmp 0x70ac2
leaq 0x6e05b(%rip), %rax     # 0xdeb00
jmp 0x70ac2
leaq 0x6e04a(%rip), %rcx     # 0xdeaf8
movq %r13, %rdi
movq %rcx, %rsi
callq 0x8300
jmp 0x70acd
leaq 0x6e046(%rip), %rax     # 0xdeb08
movq %r13, %rdi
movq %rax, %rsi
callq 0x82e0
movq %r13, %rdi
callq 0x8220
jmp 0x7097d
movq %r12, %rdi
leaq 0x78(%rsp), %rsi
callq 0x8710
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
pushq $0x2c
popq %rdx
callq 0x40349
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x2f6c0
movq %rbp, %rdi
callq 0x28a08
movq %r12, %rdi
callq 0x8978
movq 0x10(%rsp), %rbp
movq (%rbp), %rdi
callq 0x86f0
movl %eax, 0x6dfbd(%rip)     # 0xdeae8
movq 0x20(%rbp), %rdi
callq 0x86f0
movl %eax, 0x6dfb2(%rip)     # 0xdeaec
jmp 0x70acd
movq 0x6c47d(%rip), %rax     # 0xdcfc0
cmpl %ebx, (%rax)
movq 0x8(%rsp), %rbx
jge 0x70b61
movb $0x1, %bl
movq 0x6c493(%rip), %rdi     # 0xdcfe8
leaq 0x257d9(%rip), %rsi     # 0x96335
callq 0x8480
cmpq $0x0, 0x6de67(%rip)     # 0xde9d0
movq 0x6de80(%rip), %rax     # 0xde9f0
je 0x70b79
testq %rax, %rax
jne 0x70b93
jmp 0x70b7e
testq %rax, %rax
je 0x70b93
movb $0x1, %bl
movq 0x6c461(%rip), %rdi     # 0xdcfe8
leaq 0x3ac65(%rip), %rsi     # 0xab7f3
callq 0x8480
cmpq $0x0, 0x6df15(%rip)     # 0xdeab0
movl 0x6df63(%rip), %ecx     # 0xdeb04
movl 0x6df65(%rip), %eax     # 0xdeb0c
je 0x70bb9
testl %ecx, %ecx
sete %cl
testl %eax, %eax
sete %al
orb %cl, %al
jne 0x70bbd
jmp 0x70bd2
orl %eax, %ecx
je 0x70bd2
movb $0x1, %bl
movq 0x6c422(%rip), %rdi     # 0xdcfe8
leaq 0x3ac85(%rip), %rsi     # 0xab852
callq 0x8480
movsd 0x6df1e(%rip), %xmm0    # 0xdeaf8
ucomisd 0x26a0e(%rip), %xmm0    # 0x975f0
jbe 0x70bf9
movb $0x1, %bl
movq 0x6c3fb(%rip), %rdi     # 0xdcfe8
leaq 0x3ace2(%rip), %rsi     # 0xab8d6
callq 0x8480
movsd 0x6deef(%rip), %xmm0    # 0xdeaf0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x70c14
cmpl $0x0, 0x6ded6(%rip)     # 0xdeae8
je 0x70c4f
testb $0x1, %bl
jne 0x70c62
leaq 0x10(%rsp), %rdi
callq 0x28a08
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x6c37c(%rip), %rdi     # 0xdcfb8
leaq 0x3ae1e(%rip), %rsi     # 0xaba61
callq 0x8480
xorl %edi, %edi
callq 0x8540
movq 0x6c392(%rip), %rdi     # 0xdcfe8
leaq 0x3aca7(%rip), %rsi     # 0xab904
callq 0x8480
movq 0x6c34f(%rip), %rdi     # 0xdcfb8
leaq 0x22cdd(%rip), %rsi     # 0x9394d
callq 0x8480
leaq 0x3ade5(%rip), %rsi     # 0xaba61
movq %rax, %rdi
callq 0x8480
pushq $0x1
popq %rdi
callq 0x8540
jmp 0x70ca1
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x8978
jmp 0x70ca4
jmp 0x70ca1
jmp 0x70cb0
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x8220
jmp 0x70cc2
movq %rax, %rbx
jmp 0x70cc2
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x8978
leaq 0x10(%rsp), %rdi
callq 0x28a08
movq %rbx, %rdi
callq 0x8870