// File: /workspace/github_cpp_makefile_star2_O1/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 0x254f5(%rip), %rdx     # 0x4177e
leaq 0x3a340(%rip), %rcx     # 0x565d0
movq %rsi, 0x8(%rsp)
xorl %r8d, %r8d
callq 0x76b0
movl %eax, %r14d
shll $0x18, %r14d
cmpl $0xff000000, %r14d      # imm = 0xFF000000
je 0x1c59a
leaq 0x40(%rsp), %rbx
movq $0x0, (%rsp)
leaq 0x30(%rsp), %r15
leaq 0xc8(%rsp), %r12
movq 0x3ac86(%rip), %rax     # 0x56f58
movq (%rax), %r13
testq %r13, %r13
leaq 0x26cd2(%rip), %rax     # 0x42fb1
cmoveq %rax, %r13
movq %rbx, 0x30(%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 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1c326
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x7420
sarl $0x18, %r14d
cmpl $0x62, %r14d
jle 0x1c368
addl $-0x63, %r14d
cmpl $0x11, %r14d
ja 0x1c54d
leaq 0x24ebb(%rip), %rax     # 0x41200
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
leaq 0x3b67d(%rip), %rax     # 0x579d0
leaq 0x3b6da(%rip), %rsi     # 0x57a34
jmpq *%rcx
movb $0x1, 0x3b6cd(%rip)     # 0x57a30
jmp 0x1c54d
testl %r14d, %r14d
je 0x1c53d
cmpl $0x1, %r14d
je 0x1c546
cmpl $0x3f, %r14d
jne 0x1c54d
movb $0x1, %al
movq %rax, (%rsp)
jmp 0x1c54d
movb $0x1, 0x3b6a2(%rip)     # 0x57a39
leaq 0x3b69e(%rip), %rsi     # 0x57a3c
jmp 0x1c3d0
leaq 0x3b669(%rip), %rax     # 0x57a10
jmp 0x1c3b0
leaq 0x3b640(%rip), %rax     # 0x579f0
movq %r12, %rdi
movq %rax, %rsi
callq 0x7540
jmp 0x1c54d
leaq 0x3b095(%rip), %rsi     # 0x5745c
jmp 0x1c3d0
leaq 0x3b088(%rip), %rsi     # 0x57458
movq %r12, %rdi
callq 0x7250
jmp 0x1c54d
movb $0x1, 0x3b654(%rip)     # 0x57a38
jmp 0x1c54d
movq %r12, %rdi
leaq 0x90(%rsp), %rsi
callq 0x7540
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
leaq 0x90(%rsp), %rsi
movl $0x2c, %edx
callq 0x91a9
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movapd 0x10(%rsp), %xmm0
movq 0x20(%rsp), %rax
movups 0xb0(%rsp), %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0xc0(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movaps 0x30(%rsp), %xmm1
movapd %xmm0, 0x30(%rsp)
movq %rax, 0x40(%rsp)
movups %xmm1, 0xb0(%rsp)
movq $0x0, 0xc0(%rsp)
movq %r15, %rdi
callq 0xd250
movq %r14, %rdi
callq 0xd250
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rax, %rcx
cmpq $0x40, %rcx
jne 0x1c72c
leaq 0x80(%rsp), %rcx
movq %rcx, 0x70(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xdfb6
leaq 0x70(%rsp), %rdi
callq 0xc76a
cvttsd2si %xmm0, %eax
movl %eax, 0x3af8b(%rip)     # 0x57450
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x1c4e7
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x7420
movq 0x10(%rsp), %rax
leaq 0x60(%rsp), %rcx
movq %rcx, 0x50(%rsp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0xdfb6
leaq 0x50(%rsp), %rdi
callq 0xc76a
cvttsd2si %xmm0, %eax
movl %eax, 0x3af35(%rip)     # 0x57454
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x1c54d
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x7420
jmp 0x1c54d
movb $0x1, 0x3b4ed(%rip)     # 0x57a31
jmp 0x1c54d
movb $0x1, 0x3b4f3(%rip)     # 0x57a40
movq %r12, %rdi
movq 0x3aa29(%rip), %rsi     # 0x56f80
callq 0x75d0
leaq 0x140(%rsp), %rdi
callq 0x7130
movl %ebp, %edi
movq 0x8(%rsp), %rsi
leaq 0x25207(%rip), %rdx     # 0x4177e
leaq 0x3a052(%rip), %rcx     # 0x565d0
xorl %r8d, %r8d
callq 0x76b0
movl %eax, %r14d
shll $0x18, %r14d
cmpl $0xff000000, %r14d      # imm = 0xFF000000
jne 0x1c2cb
cmpb $0x0, 0x3b498(%rip)     # 0x57a39
je 0x1c5cd
cmpb $0x1, 0x3b48e(%rip)     # 0x57a38
movq (%rsp), %r14
jne 0x1c5d1
movb $0x1, %r14b
movq 0x3aa2e(%rip), %rdi     # 0x56fe8
leaq 0x25058(%rip), %rsi     # 0x41619
movl $0x5e, %edx
callq 0x74b0
jmp 0x1c5d1
movq (%rsp), %r14
movq 0x3a9c8(%rip), %rbx     # 0x56fa0
subl (%rbx), %ebp
cmpl $0x2, %ebp
jge 0x1c5ed
movl $0x12, %edx
leaq 0x2444f(%rip), %rsi     # 0x40a3a
jmp 0x1c5fb
je 0x1c60a
movl $0x13, %edx
leaq 0x24452(%rip), %rsi     # 0x40a4d
movb $0x1, %r14b
movq 0x3a9e3(%rip), %rdi     # 0x56fe8
callq 0x74b0
testb $0x1, %r14b
jne 0x1c75e
movq %r14, %r13
movslq (%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, (%rbx)
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %r14
movq 0x3b369(%rip), %r15     # 0x57998
leaq 0x3b35a(%rip), %r12     # 0x57990
movq %r14, %rdi
callq 0x7190
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r14, %rcx
movq %rax, %r8
callq 0x7640
movq %r13, %r12
movslq (%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, (%rbx)
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rbx
movq 0x3b34c(%rip), %r14     # 0x579b8
leaq 0x3b33d(%rip), %r15     # 0x579b0
movq %rbx, %rdi
callq 0x7190
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x7640
leaq 0x3b2fb(%rip), %rdi     # 0x57990
leaq 0x24bdc(%rip), %rsi     # 0x41278
callq 0x70f0
testl %eax, %eax
jne 0x1c6e1
cmpl $0x0, 0x3adac(%rip)     # 0x57458
jg 0x1c6e1
movq 0x3a933(%rip), %rdi     # 0x56fe8
leaq 0x24fbc(%rip), %rsi     # 0x41678
movl $0x6f, %edx
callq 0x74b0
movb $0x1, %r12b
movq 0x3a918(%rip), %rdi     # 0x56fe8
leaq 0x25011(%rip), %rsi     # 0x416e8
movl $0x16, %edx
callq 0x74b0
testb $0x1, %r12b
jne 0x1c78b
leaq 0x10(%rsp), %rdi
callq 0xd250
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x1c71a
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 0x3a8b5(%rip), %rdi     # 0x56fe8
leaq 0x24e9d(%rip), %rsi     # 0x415d7
movl $0x41, %edx
callq 0x74b0
movq 0x3a84d(%rip), %rdi     # 0x56f98
leaq 0x250ac(%rip), %rsi     # 0x417fe
callq 0x7400
xorl %edi, %edi
callq 0x7510
movq 0x3a833(%rip), %rdi     # 0x56f98
leaq 0x23cce(%rip), %rsi     # 0x4043a
movl $0x1, %edx
callq 0x74b0
movq 0x3a81b(%rip), %rdi     # 0x56f98
leaq 0x2507a(%rip), %rsi     # 0x417fe
callq 0x7400
jmp 0x1c7b6
movq 0x3a806(%rip), %rdi     # 0x56f98
leaq 0x23ca1(%rip), %rsi     # 0x4043a
movl $0x1, %edx
callq 0x74b0
movq 0x3a7ee(%rip), %rdi     # 0x56f98
leaq 0x2504d(%rip), %rsi     # 0x417fe
callq 0x7400
movl $0x1, %edi
callq 0x7510
movq %rax, %r14
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x1c809
movq 0x60(%rsp), %rsi
jmp 0x1c7f6
movq %rax, %r14
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x1c809
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x7420
jmp 0x1c809
jmp 0x1c806
jmp 0x1c806
jmp 0x1c82c
movq %rax, %r14
movq 0x3a770(%rip), %rsi     # 0x56f80
leaq 0xc8(%rsp), %rdi
callq 0x75d0
leaq 0x140(%rsp), %rdi
callq 0x7130
jmp 0x1c84b
movq %rax, %r14
jmp 0x1c84b
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1c84b
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x7420
leaq 0x10(%rsp), %rdi
callq 0xd250
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x1c87a
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x7420
movq %r14, %rdi
callq 0x7740