// File: /workspace/github_cpp_makefile_star2_O3/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
movl %edi, %ebp
leaq 0x70af1(%rip), %rdx     # 0xd3215
leaq 0x9dc75(%rip), %rcx     # 0x1003a0
movq $0x0, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
xorl %r8d, %r8d
callq 0x8770
movl %eax, %r14d
shll $0x18, %r14d
cmpl $0xff000000, %r14d      # imm = 0xFF000000
je 0x628eb
leaq 0x28(%rsp), %rbx
movq $0x0, 0x8(%rsp)
leaq 0x18(%rsp), %r15
leaq 0x38(%rsp), %r12
movq 0x9f80c(%rip), %rax     # 0x101f80
movq (%rax), %r13
testq %r13, %r13
leaq 0x6b24a(%rip), %rax     # 0xcd9cb
cmoveq %rax, %r13
movq %rbx, 0x18(%rsp)
movq %r13, %rdi
callq 0x81f0
leaq (%rax,%r13), %rdx
movq %r15, %rdi
movq %r13, %rsi
callq 0x28a52
movq %r12, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x87b0
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x627c8
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x8480
sarl $0x18, %r14d
cmpl $0x3e, %r14d
jg 0x62802
decl %r14d
cmpl $0x9, %r14d
ja 0x6289e
leaq 0x705da(%rip), %rcx     # 0xd2dc0
movslq (%rcx,%r14,4), %rax
addq %rcx, %rax
leaq 0xa0ad4(%rip), %rsi     # 0x1032c8
jmpq *%rax
movb $0x1, 0xa0ac8(%rip)     # 0x1032c5
jmp 0x6289e
cmpl $0x63, %r14d
jle 0x6282a
cmpl $0x64, %r14d
je 0x6283f
leaq 0xa0aa7(%rip), %rsi     # 0x1032bc
cmpl $0x6d, %r14d
je 0x62896
cmpl $0x73, %r14d
jne 0x6289e
leaq 0xa0a98(%rip), %rsi     # 0x1032c0
jmp 0x62896
cmpl $0x3f, %r14d
je 0x62848
cmpl $0x63, %r14d
jne 0x6289e
leaq 0x9fceb(%rip), %rsi     # 0x102528
jmp 0x62896
leaq 0x9fcde(%rip), %rsi     # 0x102524
jmp 0x62896
movb $0x1, %al
movq %rax, 0x8(%rsp)
jmp 0x6289e
movb $0x1, 0xa0a60(%rip)     # 0x1032b8
jmp 0x6289e
leaq 0x9fccf(%rip), %rsi     # 0x102530
jmp 0x62885
leaq 0x9fcc2(%rip), %rsi     # 0x10252c
jmp 0x62896
leaq 0x9fccd(%rip), %rsi     # 0x102540
jmp 0x62885
movb $0x1, 0xa0a48(%rip)     # 0x1032c4
jmp 0x6289e
leaq 0x9fcb3(%rip), %rsi     # 0x102538
movq %r12, %rdi
callq 0x82d0
jmp 0x6289e
leaq 0x9fc8a(%rip), %rsi     # 0x102520
movq %r12, %rdi
callq 0x82b0
movq %r12, %rdi
movq 0x9f6f0(%rip), %rsi     # 0x101f98
callq 0x8620
leaq 0xb0(%rsp), %rdi
callq 0x8190
movl %ebp, %edi
movq 0x10(%rsp), %rsi
leaq 0x7094d(%rip), %rdx     # 0xd3215
leaq 0x9dad1(%rip), %rcx     # 0x1003a0
xorl %r8d, %r8d
callq 0x8770
movl %eax, %r14d
shll $0x18, %r14d
cmpl $0xff000000, %r14d      # imm = 0xFF000000
jne 0x6276d
movq 0x9f6ce(%rip), %rbx     # 0x101fc0
subl (%rbx), %ebp
jle 0x62915
cmpl $0x1, %ebp
movq 0x8(%rsp), %rax
je 0x6292f
movq 0x9f6e1(%rip), %rdi     # 0x101fe8
leaq 0x695e7(%rip), %rsi     # 0xcbef5
movl $0x13, %edx
jmp 0x62928
movq 0x9f6cc(%rip), %rdi     # 0x101fe8
leaq 0x695bf(%rip), %rsi     # 0xcbee2
movl $0x12, %edx
callq 0x84e0
movb $0x1, %al
movsd 0x9fc09(%rip), %xmm0    # 0x102540
andpd 0x70471(%rip), %xmm0    # 0xd2db0
ucomisd 0x69dc9(%rip), %xmm0    # 0xcc710
ja 0x629df
movsd 0xa0973(%rip), %xmm0    # 0x1032c8
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x62a13
ucomisd 0x69da5(%rip), %xmm0    # 0xcc710
ja 0x62a13
testb $0x1, %al
jne 0x62a2b
movslq (%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, (%rbx)
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rbx
movq 0xa090f(%rip), %r14     # 0x1032a0
leaq 0xa0900(%rip), %r15     # 0x103298
movq %rbx, %rdi
callq 0x81f0
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x86c0
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x9f5ec(%rip), %rdi     # 0x101fb8
leaq 0x708e6(%rip), %rsi     # 0xd32b9
callq 0x8460
xorl %edi, %edi
callq 0x8530
movq 0x9f602(%rip), %rdi     # 0x101fe8
leaq 0x7076f(%rip), %rsi     # 0xd315c
movl $0x76, %edx
callq 0x84e0
movsd 0xa08c9(%rip), %xmm0    # 0x1032c8
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x62a13
ucomisd 0x69cff(%rip), %xmm0    # 0xcc710
jbe 0x62a2b
movq 0x9f5ce(%rip), %rdi     # 0x101fe8
leaq 0x707b2(%rip), %rsi     # 0xd31d3
movl $0x41, %edx
callq 0x84e0
movq 0x9f586(%rip), %rdi     # 0x101fb8
leaq 0x68a04(%rip), %rsi     # 0xcb43d
callq 0x8460
leaq 0x70874(%rip), %rsi     # 0xd32b9
movq %rax, %rdi
callq 0x8460
movl $0x1, %edi
callq 0x8530
jmp 0x62a59
movq %rax, %r14
movq 0x9f535(%rip), %rsi     # 0x101f98
leaq 0x38(%rsp), %rdi
callq 0x8620
leaq 0xb0(%rsp), %rdi
callq 0x8190
jmp 0x62a9b
movq %rax, %r14
jmp 0x62a9b
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x62a9b
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x8480
movq %r14, %rdi
callq 0x8840
nop