// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_cbs.cpp
// Function: parseCbsOptions(int, char**)
void parseCbsOptions(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 's': arg >> opt::sampleNameFile; break;
            case 'm': arg >> opt::minScLength; break;
            case OPT_CBS: arg >> opt::undeterminedLociFile; break;
            case OPT_FEATURES: arg >> opt::featuresFile; break;
            case OPT_CHR_SIZES: arg >> opt::sizesFile; break;
            case OPT_GROUPS: arg >> opt::groupsFile; break;
            case OPT_PREPARE_GENOME: opt::bPrepareGenome = true; break;
            case 'h':
                std::cout << CBS_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 (die) {
        std::cout << "\n" << CBS_USAGE_MESSAGE;
        exit(EXIT_FAILURE);
    }
    
    // Parse the input filenames
    if (opt::bPrepareGenome)
        opt::genomeFile = argv[optind++];
    else if (!opt::undeterminedLociFile.empty()) {
        opt::vcfFile = argv[optind++];
    } else {
        std::cerr << "either the --cbs or the --prepare-genome option has to be selected" << std::endl;
        std::cout << CBS_USAGE_MESSAGE;
        exit(EXIT_FAILURE);
    }
    
}

// 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 0x63068(%rip), %r13     # 0x9d390
movl %ebp, %edi
movq %rbx, %rsi
leaq 0x63f0e(%rip), %rdx     # 0x9e242
leaq 0xa09b5(%rip), %rcx     # 0xdacf0
xorl %r8d, %r8d
callq 0x8790
movl %eax, %r15d
shll $0x18, %eax
cmpl $0xff000000, %eax       # imm = 0xFF000000
je 0x3a424
movq 0xa2c35(%rip), %rax     # 0xdcf90
movq (%rax), %rsi
testq %rsi, %rsi
leaq 0x5fab7(%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 %r15b, %r15d
movq %r12, %rdi
callq 0x8978
cmpl $0x4, %r15d
ja 0x3a3b6
movl %r15d, %eax
movslq (%r13,%rax,4), %rax
addq %r13, %rax
leaq 0xa3d65(%rip), %rsi     # 0xde110
jmpq *%rax
movb $0x1, 0xa3da0(%rip)     # 0xde154
jmp 0x3a40e
cmpl $0x3f, %r15d
je 0x3a41b
cmpl $0x6d, %r15d
je 0x3a3dc
cmpl $0x73, %r15d
je 0x3a3ff
cmpl $0x68, %r15d
jne 0x3a40e
jmp 0x3a485
leaq 0xa3d16(%rip), %rsi     # 0xde0f0
jmp 0x3a406
movq %r14, %rdi
leaq 0xa3d6a(%rip), %rsi     # 0xde150
callq 0x82e0
jmp 0x3a40e
leaq 0xa3cdc(%rip), %rsi     # 0xde0d0
jmp 0x3a406
leaq 0xa3cb3(%rip), %rsi     # 0xde0b0
jmp 0x3a406
leaq 0xa3d2a(%rip), %rsi     # 0xde130
movq %r14, %rdi
callq 0x8570
movq %r14, %rdi
callq 0x8220
jmp 0x3a328
movb $0x1, %al
movq %rax, 0x10(%rsp)
jmp 0x3a40e
movq 0xa2b95(%rip), %rax     # 0xdcfc0
movslq (%rax), %rcx
subl %ecx, %ebp
jle 0x3a49f
cmpl $0x1, %ebp
jne 0x3a4a8
testb $0x1, 0x10(%rsp)
jne 0x3a4bb
cmpb $0x0, 0xa3d0f(%rip)     # 0xde154
je 0x3a450
leaq 0xa3c42(%rip), %rdi     # 0xde090
jmp 0x3a465
cmpq $0x0, 0xa3cc0(%rip)     # 0xde118
je 0x3a4e5
leaq 0xa3c0b(%rip), %rdi     # 0xde070
leal 0x1(%rcx), %edx
movl %edx, (%rax)
movq (%rbx,%rcx,8), %rsi
callq 0x88f0
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa2b2c(%rip), %rdi     # 0xdcfb8
leaq 0x63e06(%rip), %rsi     # 0x9e299
callq 0x8480
xorl %edi, %edi
callq 0x8540
leaq 0x5be7c(%rip), %rsi     # 0x96322
jmp 0x3a4af
leaq 0x5be86(%rip), %rsi     # 0x96335
movq 0xa2b32(%rip), %rdi     # 0xdcfe8
callq 0x8480
movq 0xa2af6(%rip), %rdi     # 0xdcfb8
leaq 0x59484(%rip), %rsi     # 0x9394d
callq 0x8480
leaq 0x63dc4(%rip), %rsi     # 0x9e299
movq %rax, %rdi
callq 0x8480
pushq $0x1
popq %rdi
callq 0x8540
movq 0xa2afc(%rip), %rdi     # 0xdcfe8
leaq 0x63c1a(%rip), %rsi     # 0x9e10d
callq 0x8480
movq %rax, %rdi
callq 0x8230
movq 0xa2ab1(%rip), %rdi     # 0xdcfb8
leaq 0x63d8b(%rip), %rsi     # 0x9e299
jmp 0x3a4d8
jmp 0x3a512
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x8220
jmp 0x3a533
movq %rax, %rbx
jmp 0x3a533
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x8978
movq %rbx, %rdi
callq 0x8870