// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_variant_sharing.cpp
// Function: parseVariantSharingOptions(int, char**)
void parseVariantSharingOptions(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 '?': die = true; break;
            case OPT_POP: arg >> opt::populationsFile; break;
            case OPT_INDIV: arg >> opt::individualsFile; break;    
            case 'h':
                std::cout << SHARING_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;
    }
    
    // Make sure we have INDIVIDUALS_FILE or POPULATIONS_FILE if calculating statistics
    if (opt::populationsFile.empty() && opt::individualsFile.empty()) {
        std::cerr << "You should provide an INDIVIDUALS_FILE or POPULATIONS_FILE (most likely sample_individuals_All.txt)\n";
        die = true;
    }
    
    if (die) {
        std::cout << "\n" << SHARING_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), %r14
leaq 0x8f57b(%rip), %r15     # 0xde328
movl %ebp, %edi
movq %rbx, %rsi
leaq 0x438cd(%rip), %rdx     # 0x92686
leaq 0x8c7e0(%rip), %rcx     # 0xdb5a0
xorl %r8d, %r8d
callq 0x8790
movl %eax, %r13d
shll $0x18, %eax
cmpl $0xff000000, %eax       # imm = 0xFF000000
je 0x4ee5d
movq 0x8e1b0(%rip), %rax     # 0xdcf90
movq (%rax), %rsi
testq %rsi, %rsi
leaq 0x4b032(%rip), %rax     # 0x99e1f
cmoveq %rax, %rsi
movq %r12, %rdi
leaq 0xf(%rsp), %rdx
callq 0x21904
movq %r14, %rdi
movq %r12, %rsi
pushq $0x8
popq %rdx
callq 0x87e0
movsbl %r13b, %r13d
movq %r12, %rdi
callq 0x8978
movq %r15, %rsi
cmpl $0x2, %r13d
je 0x4ee48
cmpl $0x3, %r13d
je 0x4ee41
cmpl $0x3f, %r13d
je 0x4ee38
cmpl $0x68, %r13d
jne 0x4ee50
jmp 0x4eed1
movb $0x1, %al
movq %rax, 0x10(%rsp)
jmp 0x4ee50
leaq 0x8f500(%rip), %rsi     # 0xde348
movq %r14, %rdi
callq 0x8570
movq %r14, %rdi
callq 0x8220
jmp 0x4edad
movq 0x8e15c(%rip), %r14     # 0xdcfc0
subl (%r14), %ebp
jle 0x4ee7c
cmpl $0x1, %ebp
movq 0x10(%rsp), %rcx
je 0x4ee91
leaq 0x474bb(%rip), %rsi     # 0x96335
jmp 0x4ee83
leaq 0x4749f(%rip), %rsi     # 0x96322
movq 0x8e15e(%rip), %rdi     # 0xdcfe8
callq 0x8480
movb $0x1, %cl
movq 0x8f498(%rip), %rax     # 0xde330
orq 0x8f4b1(%rip), %rax     # 0xde350
je 0x4eeeb
testb $0x1, %cl
jne 0x4eefe
movslq (%r14), %rax
leal 0x1(%rax), %ecx
movl %ecx, (%r14)
movq (%rbx,%rax,8), %rsi
leaq 0x8f44e(%rip), %rdi     # 0xde308
callq 0x88f0
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8e0e0(%rip), %rdi     # 0xdcfb8
leaq 0x536dd(%rip), %rsi     # 0xa25bc
callq 0x8480
xorl %edi, %edi
callq 0x8540
movq 0x8e0f6(%rip), %rdi     # 0xdcfe8
leaq 0x53648(%rip), %rsi     # 0xa2541
callq 0x8480
movq 0x8e0b3(%rip), %rdi     # 0xdcfb8
leaq 0x44a41(%rip), %rsi     # 0x9394d
callq 0x8480
leaq 0x536a4(%rip), %rsi     # 0xa25bc
movq %rax, %rdi
callq 0x8480
pushq $0x1
popq %rdi
callq 0x8540
jmp 0x4ef2a
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x8220
jmp 0x4ef4b
movq %rax, %rbx
jmp 0x4ef4b
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x8978
movq %rbx, %rdi
callq 0x8870
nop