// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]Dsuite/Dmin.cpp
// Function: parseDminOptions(int, char**)
void parseDminOptions(int argc, char** argv) {
    bool die = false; string regionArgString; std::vector<string> regionArgs;
    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 'n': arg >> opt::runName; break;
            case 't': arg >> opt::treeFile; break;
            case 'j': arg >> opt::jkWindowSize; break;
            case 'k': arg >> opt::jkNum; break;
            case OPT_NO_F4: opt::fStats = false; break;
            case OPT_KS_TEST: opt::KStest = true; break;
            case 'c': opt::combine = false; break;
            case 'g': opt::useGenotypeProbabilities = true; break;
            case 'l': arg >> opt::providedNumLines; break;
            case 'o': arg >> opt::providedOutPrefix; break;
            case 'p': opt::poolSeq = true; arg >> opt::poolMinDepth; break;
            case 'r': arg >> regionArgString; regionArgs = split(regionArgString, ',');
                if (regionArgs.size() != 2) {
                    std::cerr << "the --region argument should be two numbers separated by a comma\n";
                    die = true;
                } else {
                    opt::regionStart = (int)stringToDouble(regionArgs[0]); opt::regionLength = (int)stringToDouble(regionArgs[1]);  break;
                }
            case 'h':
                std::cout << DMIN_USAGE_MESSAGE;
                exit(EXIT_SUCCESS);
        }
    }
    
    int maxNumArgs = 2; int minNumArgs = 2; // if (opt::poolSeq) { minNumArgs = 1; }
    
    if (opt::poolSeq && opt::useGenotypeProbabilities) {
        std::cerr << "Error: The -p and -g options are not compatible. Please check your command line. Exiting ....\n";
        die = true;
    }
    
    if (argc - optind < minNumArgs) {
        std::cerr << "missing arguments\n";
        die = true;
    }
    else if (argc - optind > maxNumArgs)
    {
        std::cerr << "too many arguments\n";
        die = true;
    }
    
    if (die) {
        std::cout << "\n" << DMIN_USAGE_MESSAGE;
        exit(EXIT_FAILURE);
    }
    
    // Parse the input filenames
    opt::vcfFile = argv[optind++];
    opt::setsFile = argv[optind++];
    
    if (opt::vcfFile == "stdin" && opt::providedNumLines <= 0) {
        std::cerr << "If you want to read the VCF via a pipe, you need to specify the number of lines in the input via the -l option\n";
        std::cerr << "See the example above\n";
        die = true;
    }
    
    if (die) {
        std::cout << "\n" << DMIN_USAGE_MESSAGE;
        exit(EXIT_FAILURE);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorpd %xmm0, %xmm0
leaq 0x10(%rsp), %rax
movapd %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq $0x0, 0x8(%rsp)
leaq 0x88(%rsp), %r13
leaq 0xa8(%rsp), %r14
leaq 0x1ed81(%rip), %r12     # 0x37220
movl %ebp, %edi
movq %rbx, %rsi
leaq 0x1f2f3(%rip), %rdx     # 0x3779e
leaq 0x3815e(%rip), %rcx     # 0x50610
xorl %r8d, %r8d
callq 0x76b0
movl %eax, %r15d
shll $0x18, %eax
cmpl $0xff000000, %eax       # imm = 0xFF000000
je 0x18673
movq 0x38a96(%rip), %rax     # 0x50f68
movq (%rax), %rsi
testq %rsi, %rsi
leaq 0x20af2(%rip), %rax     # 0x38fd1
cmoveq %rax, %rsi
movq %r13, %rdi
leaq 0x7(%rsp), %rdx
callq 0x8102
movq %r14, %rdi
movq %r13, %rsi
pushq $0x8
popq %rdx
callq 0x76c0
movsbl %r15b, %r15d
movq %r13, %rdi
callq 0x7898
leal -0x63(%r15), %eax
cmpl $0x11, %eax
ja 0x1853b
movslq (%r12,%rax,4), %rcx
addq %r12, %rcx
leaq 0x394df(%rip), %rax     # 0x51a00
leaq 0x3953c(%rip), %rsi     # 0x51a64
leaq 0x68(%rsp), %r15
jmpq *%rcx
movb $0x1, 0x3952a(%rip)     # 0x51a60
jmp 0x18654
testl %r15d, %r15d
je 0x18661
cmpl $0x1, %r15d
je 0x1866a
cmpl $0x3f, %r15d
jne 0x18654
movb $0x1, %al
movq %rax, 0x8(%rsp)
jmp 0x18654
leaq 0x394d5(%rip), %rax     # 0x51a40
jmp 0x18628
movq %r14, %rdi
leaq 0x28(%rsp), %rsi
callq 0x7520
movq %r13, %rdi
leaq 0x28(%rsp), %rsi
pushq $0x2c
popq %rdx
callq 0x88f1
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x1455c
movq %r13, %rdi
callq 0xb80c
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rax
subq %rsi, %rax
cmpq $0x40, %rax
jne 0x18745
movq %r15, %rdi
callq 0x7590
movq %r15, %rdi
callq 0xaf68
cvttsd2si %xmm0, %eax
movl %eax, 0x38ead(%rip)     # 0x51480
movq %r15, %rdi
callq 0x7898
movq 0x10(%rsp), %rsi
addq $0x20, %rsi
leaq 0x48(%rsp), %rdi
callq 0x7590
leaq 0x48(%rsp), %r15
movq %r15, %rdi
callq 0xaf68
cvttsd2si %xmm0, %eax
movl %eax, 0x38e7f(%rip)     # 0x51484
movq %r15, %rdi
callq 0x7898
jmp 0x18654
movb $0x1, 0x39452(%rip)     # 0x51a68
jmp 0x18654
leaq 0x38e6d(%rip), %rsi     # 0x5148c
jmp 0x1864c
leaq 0x393f8(%rip), %rax     # 0x51a20
movq %r14, %rdi
movq %rax, %rsi
callq 0x7520
jmp 0x18654
leaq 0x38e4c(%rip), %rsi     # 0x51488
jmp 0x1864c
movb $0x1, 0x39424(%rip)     # 0x51a69
leaq 0x39420(%rip), %rsi     # 0x51a6c
movq %r14, %rdi
callq 0x7270
movq %r14, %rdi
callq 0x71d0
jmp 0x1849f
movb $0x1, 0x393f9(%rip)     # 0x51a61
jmp 0x18654
movb $0x1, 0x393ff(%rip)     # 0x51a70
jmp 0x18654
cmpb $0x0, 0x393ef(%rip)     # 0x51a69
je 0x186a2
cmpb $0x1, 0x393e5(%rip)     # 0x51a68
movq 0x8(%rsp), %r15
jne 0x186a7
movb $0x1, %r15b
movq 0x38954(%rip), %rdi     # 0x50fe8
leaq 0x1ef9e(%rip), %rsi     # 0x37639
callq 0x7400
jmp 0x186a7
movq 0x8(%rsp), %r15
movq 0x388f2(%rip), %r14     # 0x50fa0
movslq (%r14), %rax
subl %eax, %ebp
cmpl $0x2, %ebp
jl 0x18772
jne 0x1877b
testb $0x1, %r15b
jne 0x1878e
leal 0x1(%rax), %ecx
movl %ecx, (%r14)
movq (%rbx,%rax,8), %rsi
leaq 0x392e3(%rip), %rdi     # 0x519c0
callq 0x7800
movslq (%r14), %rax
leal 0x1(%rax), %ecx
movl %ecx, (%r14)
movq (%rbx,%rax,8), %rsi
leaq 0x392ea(%rip), %rdi     # 0x519e0
callq 0x7800
leaq 0x392be(%rip), %rdi     # 0x519c0
leaq 0x1eb8f(%rip), %rsi     # 0x37298
callq 0x813d
testb %al, %al
je 0x1871f
cmpl $0x0, 0x38d6f(%rip)     # 0x51488
jle 0x187b8
leaq 0x10(%rsp), %rdi
callq 0xb80c
leaq 0x28(%rsp), %rdi
callq 0x7898
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3889c(%rip), %rdi     # 0x50fe8
leaq 0x1eea4(%rip), %rsi     # 0x375f7
callq 0x7400
movq 0x38839(%rip), %rdi     # 0x50f98
leaq 0x1f0b8(%rip), %rsi     # 0x3781e
callq 0x7400
xorl %edi, %edi
callq 0x74f0
leaq 0x1e2c1(%rip), %rsi     # 0x36a3a
jmp 0x18782
leaq 0x1e2cb(%rip), %rsi     # 0x36a4d
movq 0x3885f(%rip), %rdi     # 0x50fe8
callq 0x7400
movq 0x38803(%rip), %rdi     # 0x50f98
leaq 0x1dc9e(%rip), %rsi     # 0x3643a
callq 0x7400
leaq 0x1f076(%rip), %rsi     # 0x3781e
movq %rax, %rdi
callq 0x7400
pushq $0x1
popq %rdi
callq 0x74f0
movq 0x38829(%rip), %rdi     # 0x50fe8
leaq 0x1eed2(%rip), %rsi     # 0x37698
callq 0x7400
movq 0x38816(%rip), %rdi     # 0x50fe8
leaq 0x1ef2f(%rip), %rsi     # 0x37708
callq 0x7400
movq 0x387b3(%rip), %rdi     # 0x50f98
leaq 0x1dc4e(%rip), %rsi     # 0x3643a
callq 0x7400
leaq 0x1f026(%rip), %rsi     # 0x3781e
movq %rax, %rdi
callq 0x7400
jmp 0x187b0
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0x18814
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x7898
jmp 0x18824
jmp 0x18821
jmp 0x18821
jmp 0x18833
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x71d0
jmp 0x18848
movq %rax, %rbx
jmp 0x18848
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x7898
leaq 0x10(%rsp), %rdi
callq 0xb80c
leaq 0x28(%rsp), %rdi
callq 0x7898
movq %rbx, %rdi
callq 0x7750