// File: /workspace/github_cpp_makefile_star2_O1/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, %ebx
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x4b5a3(%rip), %rdx     # 0xe370c
leaq 0x71cd0(%rip), %rcx     # 0x109e40
movq $0x0, 0x8(%rsp)
xorl %r8d, %r8d
callq 0x8770
movl %eax, %r12d
shll $0x18, %r12d
cmpl $0xff000000, %r12d      # imm = 0xFF000000
jne 0x982cf
movq 0x72e24(%rip), %rax     # 0x10afc0
cmpl %ebx, (%rax)
movq 0x8(%rsp), %rbx
jge 0x981bf
movb $0x1, %bl
movq 0x72e3a(%rip), %rdi     # 0x10afe8
leaq 0x36010(%rip), %rsi     # 0xce1c5
movl $0x13, %edx
callq 0x84e0
movq 0x747d2(%rip), %rax     # 0x10c998
testq %rax, %rax
je 0x981d5
cmpq $0x0, 0x747e5(%rip)     # 0x10c9b8
je 0x981e4
testq %rax, %rax
jne 0x981fe
cmpq $0x0, 0x747d6(%rip)     # 0x10c9b8
je 0x981fe
movb $0x1, %bl
movq 0x72dfb(%rip), %rdi     # 0x10afe8
leaq 0x4b32f(%rip), %rsi     # 0xe3523
movl $0x5e, %edx
callq 0x84e0
movq 0x74873(%rip), %rax     # 0x10ca78
testq %rax, %rax
je 0x98221
cmpl $0x0, 0x748bb(%rip)     # 0x10cacc
je 0x9822f
cmpl $0x0, 0x748ba(%rip)     # 0x10cad4
je 0x9822f
testq %rax, %rax
jne 0x98249
movl 0x748ad(%rip), %eax     # 0x10cad4
orl 0x7489f(%rip), %eax     # 0x10cacc
je 0x98249
movb $0x1, %bl
movq 0x72db0(%rip), %rdi     # 0x10afe8
leaq 0x4b343(%rip), %rsi     # 0xe3582
movl $0x83, %edx
callq 0x84e0
movsd 0x7486f(%rip), %xmm0    # 0x10cac0
ucomisd 0x371e7(%rip), %xmm0    # 0xcf440
jbe 0x98275
movb $0x1, %bl
movq 0x72d84(%rip), %rdi     # 0x10afe8
leaq 0x4b39b(%rip), %rsi     # 0xe3606
movl $0x2d, %edx
callq 0x84e0
movsd 0x7483b(%rip), %xmm0    # 0x10cab8
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x982aa
cmpl $0x0, 0x74822(%rip)     # 0x10cab0
jne 0x982aa
movb $0x1, %bl
movq 0x72d4f(%rip), %rdi     # 0x10afe8
leaq 0x4b394(%rip), %rsi     # 0xe3634
movl $0x78, %edx
callq 0x84e0
testb $0x1, %bl
jne 0x9858b
leaq 0x30(%rsp), %rdi
callq 0x3123c
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x0, 0x8(%rsp)
leaq 0x10(%rsp), %r13
leaq 0x88(%rsp), %rbp
movq 0x72c94(%rip), %rax     # 0x10af80
movq (%rax), %r15
testq %r15, %r15
leaq 0x39986(%rip), %rax     # 0xd1c7f
cmoveq %rax, %r15
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r15, %rdi
callq 0x81f0
leaq (%rax,%r15), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x28952
movq %rbp, %rdi
movq %r13, %rsi
movl $0x8, %edx
callq 0x87b0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x9834a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
sarl $0x18, %r12d
cmpl $0x3e, %r12d
jg 0x98393
addl $-0x2, %r12d
cmpl $0xd, %r12d
ja 0x98512
leaq 0x4a1b7(%rip), %rax     # 0xe2520
movslq (%rax,%r12,4), %rdx
addq %rax, %rdx
leaq 0x74639(%rip), %rsi     # 0x10c9b0
leaq 0x7473a(%rip), %rcx     # 0x10cab8
leaq 0x74747(%rip), %rax     # 0x10cacc
jmpq *%rdx
leaq 0x74602(%rip), %rsi     # 0x10c990
jmp 0x984d0
cmpl $0x72, %r12d
jg 0x983b9
cmpl $0x3f, %r12d
je 0x98562
cmpl $0x6e, %r12d
jne 0x9856b
leaq 0x746dc(%rip), %rsi     # 0x10ca90
jmp 0x984d0
cmpl $0x73, %r12d
je 0x984c9
cmpl $0x77, %r12d
jne 0x98512
movq %r13, %rdi
leaq 0x98(%rsp), %rsi
callq 0x8700
leaq 0x70(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movl $0x2c, %edx
callq 0x50624
xorpd %xmm0, %xmm0
movapd %xmm0, 0x50(%rsp)
movapd 0x30(%rsp), %xmm0
movq 0x40(%rsp), %rax
movups 0x70(%rsp), %xmm1
movaps %xmm1, 0x30(%rsp)
movq 0x80(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movapd 0x50(%rsp), %xmm1
movapd %xmm0, 0x50(%rsp)
movq %rax, 0x60(%rsp)
movupd %xmm1, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x3123c
movq %r15, %rdi
callq 0x3123c
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x9846f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x30(%rsp), %r15
movq (%r15), %rdi
callq 0x86e0
movl %eax, 0x7462e(%rip)     # 0x10cab0
movq 0x20(%r15), %rdi
callq 0x86e0
movl %eax, 0x74623(%rip)     # 0x10cab4
jmp 0x98512
leaq 0x74536(%rip), %rsi     # 0x10c9d0
jmp 0x984d0
leaq 0x745ad(%rip), %rsi     # 0x10ca50
jmp 0x984d0
leaq 0x74564(%rip), %rsi     # 0x10ca10
jmp 0x984d0
leaq 0x7457b(%rip), %rsi     # 0x10ca30
jmp 0x984d0
leaq 0x745b2(%rip), %rsi     # 0x10ca70
jmp 0x984d0
leaq 0x7460d(%rip), %rax     # 0x10cad4
jmp 0x98507
leaq 0x74520(%rip), %rsi     # 0x10c9f0
movq %rbp, %rdi
callq 0x8560
jmp 0x98512
leaq 0x730b7(%rip), %rax     # 0x10b598
jmp 0x98507
leaq 0x745de(%rip), %rax     # 0x10cac8
jmp 0x98507
leaq 0x745cd(%rip), %rcx     # 0x10cac0
movq %rbp, %rdi
movq %rcx, %rsi
callq 0x82d0
jmp 0x98512
leaq 0x745c9(%rip), %rax     # 0x10cad0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x82b0
movq %rbp, %rdi
movq 0x72a7c(%rip), %rsi     # 0x10af98
callq 0x8620
leaq 0x100(%rsp), %rdi
callq 0x8190
movl %ebx, %edi
movq %r14, %rsi
leaq 0x4b1d2(%rip), %rdx     # 0xe370c
leaq 0x718ff(%rip), %rcx     # 0x109e40
xorl %r8d, %r8d
callq 0x8770
movl %eax, %r12d
shll $0x18, %r12d
cmpl $0xff000000, %r12d      # imm = 0xFF000000
jne 0x982e5
jmp 0x98195
movb $0x1, %al
movq %rax, 0x8(%rsp)
jmp 0x98512
cmpl $0x68, %r12d
jne 0x98512
movq 0x72a40(%rip), %rdi     # 0x10afb8
leaq 0x4b212(%rip), %rsi     # 0xe3791
callq 0x8460
xorl %edi, %edi
callq 0x8530
movq 0x72a26(%rip), %rdi     # 0x10afb8
leaq 0x340e4(%rip), %rsi     # 0xcc67d
movl $0x1, %edx
callq 0x84e0
movq 0x72a0e(%rip), %rdi     # 0x10afb8
leaq 0x4b1e0(%rip), %rsi     # 0xe3791
callq 0x8460
movl $0x1, %edi
callq 0x8530
jmp 0x985e7
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x985ea
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x985ea
jmp 0x985e7
jmp 0x9860d
movq %rax, %rbx
movq 0x729a7(%rip), %rsi     # 0x10af98
leaq 0x88(%rsp), %rdi
callq 0x8620
leaq 0x100(%rsp), %rdi
callq 0x8190
jmp 0x98631
movq %rax, %rbx
jmp 0x98631
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x98631
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x30(%rsp), %rdi
callq 0x3123c
movq %rbx, %rdi
callq 0x8840
nop