// File: /workspace/github_cpp_makefile_star2_O3/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 $0x248, %rsp            # imm = 0x248
movl %edi, %ebp
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
xorl %ecx, %ecx
movq %rcx, -0x8(%rax)
movb $0x0, (%rax)
movq $0x0, (%rsp)
movq %rcx, 0x20(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
leaq 0x25c24(%rip), %rdx     # 0x4280e
leaq 0x3aa0f(%rip), %rcx     # 0x57600
movq %rsi, 0x8(%rsp)
xorl %r8d, %r8d
callq 0x76b0
movl %eax, %r14d
shll $0x18, %r14d
cmpl $0xff000000, %r14d      # imm = 0xFF000000
je 0x1cef1
leaq 0x80(%rsp), %rbx
movq $0x0, (%rsp)
leaq 0x70(%rsp), %r15
leaq 0xc8(%rsp), %r12
movq 0x3b322(%rip), %rax     # 0x57f58
movq (%rax), %r13
testq %r13, %r13
leaq 0x273fe(%rip), %rax     # 0x44041
cmoveq %rax, %r13
movq %rbx, 0x70(%rsp)
movq %r13, %rdi
callq 0x7190
leaq (%rax,%r13), %rdx
movq %r15, %rdi
movq %r13, %rsi
callq 0x88ba
movq %r12, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x76c0
movq 0x70(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1cc8d
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x7420
sarl $0x18, %r14d
cmpl $0x62, %r14d
jle 0x1cccf
addl $-0x63, %r14d
cmpl $0x11, %r14d
ja 0x1cea4
leaq 0x255e4(%rip), %rax     # 0x42290
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
leaq 0x3bd16(%rip), %rax     # 0x589d0
leaq 0x3bd73(%rip), %rsi     # 0x58a34
jmpq *%rcx
movb $0x1, 0x3bd66(%rip)     # 0x58a30
jmp 0x1cea4
testl %r14d, %r14d
je 0x1ce94
cmpl $0x1, %r14d
je 0x1ce9d
cmpl $0x3f, %r14d
jne 0x1cea4
movb $0x1, %al
movq %rax, (%rsp)
jmp 0x1cea4
movb $0x1, 0x3bd3b(%rip)     # 0x58a39
leaq 0x3bd37(%rip), %rsi     # 0x58a3c
jmp 0x1cd37
leaq 0x3bd02(%rip), %rax     # 0x58a10
jmp 0x1cd17
leaq 0x3bcd9(%rip), %rax     # 0x589f0
movq %r12, %rdi
movq %rax, %rsi
callq 0x7540
jmp 0x1cea4
leaq 0x3b72e(%rip), %rsi     # 0x5845c
jmp 0x1cd37
leaq 0x3b721(%rip), %rsi     # 0x58458
movq %r12, %rdi
callq 0x7250
jmp 0x1cea4
movb $0x1, 0x3bced(%rip)     # 0x58a38
jmp 0x1cea4
movq %r12, %rdi
leaq 0x90(%rsp), %rsi
callq 0x7540
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
leaq 0x90(%rsp), %rsi
movl $0x2c, %edx
callq 0x91c1
movq 0x20(%rsp), %rax
movapd 0xb0(%rsp), %xmm0
movq 0xc0(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movaps 0x10(%rsp), %xmm1
movapd %xmm0, 0x10(%rsp)
movaps %xmm1, 0x70(%rsp)
movq %rax, 0x80(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0xb0(%rsp)
movq $0x0, 0xc0(%rsp)
movq %r15, %rdi
callq 0xd1ac
movq %r14, %rdi
callq 0xd1ac
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rax, %rcx
cmpq $0x40, %rcx
jne 0x1d023
leaq 0x60(%rsp), %rcx
movq %rcx, 0x50(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0xdf1c
leaq 0x50(%rsp), %rdi
callq 0xc6c7
cvttsd2si %xmm0, %eax
movl %eax, 0x3b62e(%rip)     # 0x58450
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x1ce3e
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x7420
movq 0x10(%rsp), %rax
leaq 0x40(%rsp), %rcx
movq %rcx, 0x30(%rsp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0xdf1c
leaq 0x30(%rsp), %rdi
callq 0xc6c7
cvttsd2si %xmm0, %eax
movl %eax, 0x3b5de(%rip)     # 0x58454
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x1cea4
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x7420
jmp 0x1cea4
movb $0x1, 0x3bb96(%rip)     # 0x58a31
jmp 0x1cea4
movb $0x1, 0x3bb9c(%rip)     # 0x58a40
movq %r12, %rdi
movq 0x3b0d2(%rip), %rsi     # 0x57f80
callq 0x75d0
leaq 0x140(%rsp), %rdi
callq 0x7130
movl %ebp, %edi
movq 0x8(%rsp), %rsi
leaq 0x25940(%rip), %rdx     # 0x4280e
leaq 0x3a72b(%rip), %rcx     # 0x57600
xorl %r8d, %r8d
callq 0x76b0
movl %eax, %r14d
shll $0x18, %r14d
cmpl $0xff000000, %r14d      # imm = 0xFF000000
jne 0x1cc2f
cmpb $0x0, 0x3bb41(%rip)     # 0x58a39
je 0x1cf24
cmpb $0x1, 0x3bb37(%rip)     # 0x58a38
movq (%rsp), %r14
jne 0x1cf28
movb $0x1, %r14b
movq 0x3b0d7(%rip), %rdi     # 0x57fe8
leaq 0x25791(%rip), %rsi     # 0x426a9
movl $0x5e, %edx
callq 0x74b0
jmp 0x1cf28
movq (%rsp), %r14
movq 0x3b071(%rip), %rbx     # 0x57fa0
movslq (%rbx), %rax
subl %eax, %ebp
cmpl $0x2, %ebp
jl 0x1d055
jne 0x1d063
testb $0x1, %r14b
jne 0x1d07b
leal 0x1(%rax), %ecx
movl %ecx, (%rbx)
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %r14
movq 0x3ba36(%rip), %r15     # 0x58998
leaq 0x3ba27(%rip), %r12     # 0x58990
movq %r14, %rdi
callq 0x7190
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r14, %rcx
movq %rax, %r8
callq 0x7640
movslq (%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, (%rbx)
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rbx
movq 0x3ba1c(%rip), %r14     # 0x589b8
leaq 0x3ba0d(%rip), %r15     # 0x589b0
movq %rbx, %rdi
callq 0x7190
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x7640
leaq 0x3b9cb(%rip), %rdi     # 0x58990
leaq 0x2533c(%rip), %rsi     # 0x42308
callq 0x70f0
testl %eax, %eax
jne 0x1cfe2
cmpl $0x0, 0x3b47c(%rip)     # 0x58458
jle 0x1d0b0
leaq 0x10(%rsp), %rdi
callq 0xd1ac
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x1d011
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x7420
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3afbe(%rip), %rdi     # 0x57fe8
leaq 0x25636(%rip), %rsi     # 0x42667
movl $0x41, %edx
callq 0x74b0
movq 0x3af56(%rip), %rdi     # 0x57f98
leaq 0x25845(%rip), %rsi     # 0x4288e
callq 0x7400
xorl %edi, %edi
callq 0x7510
movl $0x12, %edx
leaq 0x24a41(%rip), %rsi     # 0x41aa2
jmp 0x1d06f
movl $0x13, %edx
leaq 0x24a46(%rip), %rsi     # 0x41ab5
movq 0x3af72(%rip), %rdi     # 0x57fe8
callq 0x74b0
movq 0x3af16(%rip), %rdi     # 0x57f98
leaq 0x243b1(%rip), %rsi     # 0x4143a
movl $0x1, %edx
callq 0x74b0
movq 0x3aefe(%rip), %rdi     # 0x57f98
leaq 0x257ed(%rip), %rsi     # 0x4288e
callq 0x7400
movl $0x1, %edi
callq 0x7510
movq 0x3af31(%rip), %rdi     # 0x57fe8
leaq 0x2564a(%rip), %rsi     # 0x42708
movl $0x6f, %edx
callq 0x74b0
movq 0x3af19(%rip), %rdi     # 0x57fe8
leaq 0x256a2(%rip), %rsi     # 0x42778
movl $0x16, %edx
callq 0x74b0
movq 0x3aeb1(%rip), %rdi     # 0x57f98
leaq 0x2434c(%rip), %rsi     # 0x4143a
movl $0x1, %edx
callq 0x74b0
movq 0x3ae99(%rip), %rdi     # 0x57f98
leaq 0x25788(%rip), %rsi     # 0x4288e
callq 0x7400
jmp 0x1d0a6
movq %rax, %r14
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x1d150
movq 0x40(%rsp), %rsi
jmp 0x1d13d
movq %rax, %r14
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x1d150
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x7420
jmp 0x1d150
jmp 0x1d14d
jmp 0x1d14d
jmp 0x1d173
movq %rax, %r14
movq 0x3ae29(%rip), %rsi     # 0x57f80
leaq 0xc8(%rsp), %rdi
callq 0x75d0
leaq 0x140(%rsp), %rdi
callq 0x7130
jmp 0x1d195
movq %rax, %r14
jmp 0x1d195
movq %rax, %r14
movq 0x70(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1d195
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x7420
leaq 0x10(%rsp), %rdi
callq 0xd1ac
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x1d1c4
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x7420
movq %r14, %rdi
callq 0x7740