// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_filter.cpp
// Function: parseFilterOptions(int, char**)
void parseFilterOptions(int argc, char** argv) {
    
    bool die = false;
    for (char c; (c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1;)
    {
        std::istringstream arg(optarg != NULL ? optarg : "");
        switch (c) 
        {
            case 'd': arg >> opt::max_overall_depth; break;
            case 'm': arg >> opt::min_overall_depth; break;
            case 'c': arg >> opt::min_copies; break;
            case 's': arg >> opt::min_depth_in_any_individual; break;
            case '?': die = true; break;
            case OPT_TRIALLELIC: opt::bBiallelicFilter = false; break;
            case OPT_ALLOW_MISSING_GENOTYPES: opt::bAllowMissingGenotpyes = true; break;
            case OPT_MAX_NUM_HET: arg >> opt::max_het_indiv; break;
            case OPT_MQSB: arg >> opt::min_MQSB; break;
            case OPT_FS: arg >> opt::max_FS; break;
            case OPT_STATS: opt::bStats = true; break;
            case OPT_SUBS: arg >> opt::subsample; break;
            case OPT_MIN_F: arg >> opt::min_F; break;
            case OPT_OVERALL_Q: arg >> opt::min_overall_quality; break;
            case OPT_HELP:
                std::cout << FILTER_USAGE_MESSAGE;
                exit(EXIT_SUCCESS);
        }
    }
    if (argc - optind < 1) {
        std::cerr << "missing arguments\n";
        die = true;
    } 
    else if (argc - optind > 1) 
    {
        std::cerr << "too many arguments\n";
        die = true;
    }
    
    if (opt::min_F < -1 || opt::min_F > 1) {
        std::cerr << "The values of the inbreeding coefficient F range between -1 and 1 (negative values are likely variant calling errors)\n";
        die = true;
    }
    
    if (opt::min_MQSB < 0 || opt::min_MQSB > 1) {
        std::cerr << "The MQSB p-values range between 0 and 1 (try a value like 0.001)\n";
        die = true;
    }
    
    
    
    
    if (die) {
        std::cout << "\n" << FILTER_USAGE_MESSAGE;
        exit(EXIT_FAILURE);
    }
    
    // Parse the input filenames
    opt::vcfFile = argv[optind++];
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rsi, %rbx
movl %edi, %ebp
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %r12
leaq 0x38(%rsp), %r13
leaq 0x53171(%rip), %r14     # 0xa1500
movl %ebp, %edi
movq %rbx, %rsi
leaq 0x535ba(%rip), %rdx     # 0xa1955
leaq 0x8d01e(%rip), %rcx     # 0xdb3c0
xorl %r8d, %r8d
callq 0x8790
movl %eax, %r15d
shll $0x18, %eax
cmpl $0xff000000, %eax       # imm = 0xFF000000
je 0x4e4c6
movq 0x8ebce(%rip), %rax     # 0xdcf90
movq (%rax), %rsi
testq %rsi, %rsi
leaq 0x4ba50(%rip), %rax     # 0x99e1f
cmoveq %rax, %rsi
movq %r12, %rdi
leaq 0xf(%rsp), %rdx
callq 0x21904
movq %r13, %rdi
movq %r12, %rsi
pushq $0x8
popq %rdx
callq 0x87e0
movsbl %r15b, %r15d
movq %r12, %rdi
callq 0x8978
leal -0x1(%r15), %eax
cmpl $0x9, %eax
ja 0x4e41f
movslq (%r14,%rax,4), %rax
addq %r14, %rax
leaq 0x8fee7(%rip), %rsi     # 0xde2f8
jmpq *%rax
movb $0x1, 0x8fedb(%rip)     # 0xde2f5
jmp 0x4e4b0
cmpl $0x3f, %r15d
je 0x4e4bd
cmpl $0x63, %r15d
je 0x4e46c
cmpl $0x64, %r15d
je 0x4e498
leaq 0x8feb0(%rip), %rsi     # 0xde2ec
cmpl $0x6d, %r15d
je 0x4e4a8
cmpl $0x73, %r15d
jne 0x4e4b0
leaq 0x8fea1(%rip), %rsi     # 0xde2f0
jmp 0x4e4a8
movb $0x1, 0x8fe90(%rip)     # 0xde2e8
jmp 0x4e4b0
leaq 0x8f0ff(%rip), %rsi     # 0xdd560
jmp 0x4e48e
leaq 0x8f0f2(%rip), %rsi     # 0xdd55c
jmp 0x4e4a8
leaq 0x8f0e5(%rip), %rsi     # 0xdd558
jmp 0x4e4a8
leaq 0x8f0f4(%rip), %rsi     # 0xdd570
jmp 0x4e48e
movb $0x1, 0x8fe6f(%rip)     # 0xde2f4
jmp 0x4e4b0
leaq 0x8f0da(%rip), %rsi     # 0xdd568
movq %r13, %rdi
callq 0x8300
jmp 0x4e4b0
leaq 0x8f0b5(%rip), %rsi     # 0xdd554
jmp 0x4e4a8
leaq 0x8f0a8(%rip), %rsi     # 0xdd550
movq %r13, %rdi
callq 0x82e0
movq %r13, %rdi
callq 0x8220
jmp 0x4e38f
movb $0x1, %al
movq %rax, 0x10(%rsp)
jmp 0x4e4b0
movq 0x8eaf3(%rip), %r14     # 0xdcfc0
subl (%r14), %ebp
jle 0x4e4e5
cmpl $0x1, %ebp
movq 0x10(%rsp), %rax
je 0x4e4fa
leaq 0x47e52(%rip), %rsi     # 0x96335
jmp 0x4e4ec
leaq 0x47e36(%rip), %rsi     # 0x96322
movq 0x8eaf5(%rip), %rdi     # 0xdcfe8
callq 0x8480
movb $0x1, %al
movsd 0x8f06e(%rip), %xmm0    # 0xdd570
andpd 0x52fe6(%rip), %xmm0    # 0xa14f0
ucomisd 0x490de(%rip), %xmm0    # 0x975f0
jbe 0x4e529
movq 0x8eacd(%rip), %rdi     # 0xdcfe8
leaq 0x5337a(%rip), %rsi     # 0xa189c
callq 0x8480
movb $0x1, %al
movsd 0x8fdc7(%rip), %xmm0    # 0xde2f8
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x4e58e
ucomisd 0x490ad(%rip), %xmm0    # 0x975f0
ja 0x4e58e
testb $0x1, %al
jne 0x4e5a1
movslq (%r14), %rax
leal 0x1(%rax), %ecx
movl %ecx, (%r14)
movq (%rbx,%rax,8), %rsi
leaq 0x8fd6b(%rip), %rdi     # 0xde2c8
callq 0x88f0
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8ea3d(%rip), %rdi     # 0xdcfb8
leaq 0x53477(%rip), %rsi     # 0xa19f9
callq 0x8480
xorl %edi, %edi
callq 0x8540
movq 0x8ea53(%rip), %rdi     # 0xdcfe8
leaq 0x53377(%rip), %rsi     # 0xa1913
callq 0x8480
movq 0x8ea10(%rip), %rdi     # 0xdcfb8
leaq 0x4539e(%rip), %rsi     # 0x9394d
callq 0x8480
leaq 0x5343e(%rip), %rsi     # 0xa19f9
movq %rax, %rdi
callq 0x8480
pushq $0x1
popq %rdi
callq 0x8540
jmp 0x4e5cd
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x8220
jmp 0x4e5ee
movq %rax, %rbx
jmp 0x4e5ee
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x8978
movq %rbx, %rdi
callq 0x8870