// File: /workspace/github_cpp_makefile_star2_O3/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
movl %edi, %ebp
leaq 0x89077(%rip), %rdx     # 0xcf30e
leaq 0xb9932(%rip), %rcx     # 0xffbd0
movq $0x0, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
xorl %r8d, %r8d
callq 0x8770
movl %eax, %r14d
shll $0x18, %r14d
cmpl $0xff000000, %r14d      # imm = 0xFF000000
jne 0x46303
movq 0xbbcf5(%rip), %rax     # 0x101fc0
movslq (%rax), %rcx
subl %ecx, %ebp
jle 0x464d3
cmpl $0x1, %ebp
jne 0x464e1
testb $0x1, 0x8(%rsp)
jne 0x464f9
cmpb $0x0, 0xbce33(%rip)     # 0x103124
je 0x4647f
leaq 0xbcd62(%rip), %r14     # 0x103060
jmp 0x46494
leaq 0x28(%rsp), %rbx
movq $0x0, 0x8(%rsp)
leaq 0x18(%rsp), %r15
leaq 0x38(%rsp), %r12
movq 0xbbc5e(%rip), %rax     # 0x101f80
movq (%rax), %r13
testq %r13, %r13
leaq 0x8769c(%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 0x46376
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x8480
sarl $0x18, %r14d
cmpl $0x3e, %r14d
jg 0x463a9
cmpl $0x4, %r14d
ja 0x463fc
movl %r14d, %eax
leaq 0x88b88(%rip), %rcx     # 0xcef18
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
leaq 0xbcd42(%rip), %rsi     # 0x1030e0
jmpq *%rax
movb $0x1, 0xbcd7d(%rip)     # 0x103124
jmp 0x463fc
cmpl $0x6c, %r14d
jle 0x463c8
cmpl $0x6d, %r14d
je 0x4644e
cmpl $0x73, %r14d
jne 0x463fc
leaq 0xbcd3a(%rip), %rsi     # 0x103100
jmp 0x463f4
cmpl $0x3f, %r14d
jne 0x4645f
movb $0x1, %al
movq %rax, 0x8(%rsp)
jmp 0x463fc
leaq 0xbccde(%rip), %rsi     # 0x1030c0
jmp 0x463f4
leaq 0xbccb5(%rip), %rsi     # 0x1030a0
jmp 0x463f4
leaq 0xbcc8c(%rip), %rsi     # 0x103080
movq %r12, %rdi
callq 0x8560
movq %r12, %rdi
movq 0xbbb92(%rip), %rsi     # 0x101f98
callq 0x8620
leaq 0xb0(%rsp), %rdi
callq 0x8190
movl %ebp, %edi
movq 0x10(%rsp), %rsi
leaq 0x88ee8(%rip), %rdx     # 0xcf30e
leaq 0xb97a3(%rip), %rcx     # 0xffbd0
xorl %r8d, %r8d
callq 0x8770
movl %eax, %r14d
shll $0x18, %r14d
cmpl $0xff000000, %r14d      # imm = 0xFF000000
jne 0x4631b
jmp 0x462c4
movq %r12, %rdi
leaq 0xbccc8(%rip), %rsi     # 0x103120
callq 0x82b0
jmp 0x463fc
cmpl $0x68, %r14d
jne 0x463fc
movq 0xbbb4c(%rip), %rdi     # 0x101fb8
leaq 0x88ef2(%rip), %rsi     # 0xcf365
callq 0x8460
xorl %edi, %edi
callq 0x8530
cmpq $0x0, 0xbcc61(%rip)     # 0x1030e8
je 0x46525
leaq 0xbcbac(%rip), %r14     # 0x103040
leal 0x1(%rcx), %edx
movl %edx, (%rax)
movq 0x10(%rsp), %rax
movq (%rax,%rcx,8), %rbx
movq 0x8(%r14), %r15
movq %rbx, %rdi
callq 0x81f0
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %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
leaq 0x85a08(%rip), %rsi     # 0xcbee2
movl $0x12, %edx
jmp 0x464ed
leaq 0x85a0d(%rip), %rsi     # 0xcbef5
movl $0x13, %edx
movq 0xbbaf4(%rip), %rdi     # 0x101fe8
callq 0x84e0
movq 0xbbab8(%rip), %rdi     # 0x101fb8
leaq 0x84f36(%rip), %rsi     # 0xcb43d
callq 0x8460
leaq 0x88e52(%rip), %rsi     # 0xcf365
movq %rax, %rdi
callq 0x8460
movl $0x1, %edi
callq 0x8530
movq 0xbbabc(%rip), %rdi     # 0x101fe8
leaq 0x88ca6(%rip), %rsi     # 0xcf1d9
callq 0x8460
movq %rax, %rdi
callq 0x8200
movq 0xbba71(%rip), %rdi     # 0x101fb8
leaq 0x88e17(%rip), %rsi     # 0xcf365
jmp 0x46516
jmp 0x46552
movq %rax, %r14
movq 0xbba3c(%rip), %rsi     # 0x101f98
leaq 0x38(%rsp), %rdi
callq 0x8620
leaq 0xb0(%rsp), %rdi
callq 0x8190
jmp 0x46594
movq %rax, %r14
jmp 0x46594
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x46594
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x8480
movq %r14, %rdi
callq 0x8840