// File: /workspace/github_cpp_makefile_star2_O3/millanek[P]evo/evo_codingStats_from_alignment.cpp
// Function: parseCodingStatsOptions(int, char**)
void parseCodingStatsOptions(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 'p': arg >> opt::ploidy; break;
            case 'a': arg >> opt::alignmentFile; break;
            case 'l': arg >> opt::alignmentListFile; break;
            case 't': arg >> opt::tStVratio; break;
            case 'n': opt::nonCodingNull = true; break;
            case OPT_DXY_MATRIX: arg >> opt::genomeWide_DxyMatrixFile; break;
            case OPT_PN_GROUPS: arg >> opt::pNgroupsFile; break;
            case 'h':
                std::cout << CODINGSTATS_USAGE_MESSAGE;
                exit(EXIT_SUCCESS);
        }
    }
    
    if (opt::alignmentFile == "" && opt::alignmentListFile == "") {
        std::cerr << "Either -a or -l options must be specified\n";
        die = true;
    }
    
    if (opt::alignmentFile != "" && opt::alignmentListFile != "") {
        std::cerr << "The -a and -l options can't both be specified\n";
        die = true;
    }
    
    if (opt::ploidy != 'h' && opt::ploidy != 'd') {
        std::cerr << "The -p (--ploidy) option can only have the values 'h' or 'd'\n";
        std::cerr << "At the moment I don't support other than haploid and diploid species\n";
        die = true;
    }
    
    if (opt::tStVratio <= 0) {
        std::cerr << "The tS/tV ratio must be positive\n";
        die = true;
    }
    
    
    if (argc - optind < 0) {
        std::cerr << "missing arguments\n";
        die = true;
    }
    else if (argc - optind > 0)
    {
        std::cerr << "too many arguments\n";
        die = true;
    }
    
    if (die) {
        std::cout << "\n" << CODINGSTATS_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, %r15
leaq 0x89d6d(%rip), %rdx     # 0xcc393
leaq 0xbd403(%rip), %rcx     # 0xffa30
movq $0x0, 0x10(%rsp)
movl %edi, 0xc(%rsp)
xorl %r8d, %r8d
callq 0x8770
movl %eax, %r14d
shll $0x18, %r14d
cmpl $0xff000000, %r14d      # imm = 0xFF000000
jne 0x42677
leaq 0xc08e7(%rip), %rdi     # 0x102f40
leaq 0x8b36b(%rip), %rsi     # 0xcd9cb
callq 0x8160
testl %eax, %eax
je 0x427fc
movq 0x10(%rsp), %rbx
jmp 0x42832
leaq 0x28(%rsp), %rbx
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %r12
leaq 0x38(%rsp), %r13
movq 0xbf8ea(%rip), %rax     # 0x101f80
movq (%rax), %rbp
testq %rbp, %rbp
leaq 0x8b328(%rip), %rax     # 0xcd9cb
cmoveq %rax, %rbp
movq %rbx, 0x18(%rsp)
movq %rbp, %rdi
callq 0x81f0
leaq (%rax,%rbp), %rdx
movq %r12, %rdi
movq %rbp, %rsi
callq 0x28a52
movq %r13, %rdi
movq %r12, %rsi
movl $0x8, %edx
callq 0x87b0
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x426ea
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x8480
sarl $0x18, %r14d
cmpl $0x60, %r14d
jg 0x4270e
testl %r14d, %r14d
je 0x42730
cmpl $0x1, %r14d
je 0x42739
cmpl $0x3f, %r14d
jne 0x4275b
movb $0x1, %al
movq %rax, 0x10(%rsp)
jmp 0x4275b
leal -0x6c(%r14), %eax
cmpl $0x8, %eax
ja 0x42742
leaq 0x8ba16(%rip), %rcx     # 0xce134
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xc0832(%rip), %rsi     # 0x102f60
jmp 0x42753
leaq 0xc0869(%rip), %rsi     # 0x102fa0
jmp 0x42753
leaq 0xc0840(%rip), %rsi     # 0x102f80
jmp 0x42753
leaq 0xc07f7(%rip), %rsi     # 0x102f40
cmpl $0x61, %r14d
jne 0x427d8
movq %r13, %rdi
callq 0x8560
movq %r13, %rdi
movq 0xbf833(%rip), %rsi     # 0x101f98
callq 0x8620
leaq 0xb0(%rsp), %rdi
callq 0x8190
movl 0xc(%rsp), %edi
movq %r15, %rsi
leaq 0x89c0e(%rip), %rdx     # 0xcc393
leaq 0xbd2a4(%rip), %rcx     # 0xffa30
xorl %r8d, %r8d
callq 0x8770
movl %eax, %r14d
shll $0x18, %r14d
cmpl $0xff000000, %r14d      # imm = 0xFF000000
jne 0x4268f
jmp 0x42652
movq %r13, %rdi
leaq 0xbfd11(%rip), %rsi     # 0x1024c8
callq 0x82d0
jmp 0x4275b
movq %r13, %rdi
leaq 0xbfcf8(%rip), %rsi     # 0x1024c0
callq 0x85a0
jmp 0x4275b
movb $0x1, 0xc07ea(%rip)     # 0x102fc0
jmp 0x4275b
cmpl $0x68, %r14d
jne 0x4275b
movq 0xbf7cf(%rip), %rdi     # 0x101fb8
leaq 0x8bb69(%rip), %rsi     # 0xce359
callq 0x8460
xorl %edi, %edi
callq 0x8530
leaq 0xc075d(%rip), %rdi     # 0x102f60
leaq 0x8b1c1(%rip), %rsi     # 0xcd9cb
callq 0x8160
testl %eax, %eax
movq 0x10(%rsp), %rbx
jne 0x42832
movq 0xbf7c9(%rip), %rdi     # 0x101fe8
leaq 0x8b1a6(%rip), %rsi     # 0xcd9cc
movl $0x2a, %edx
callq 0x84e0
movb $0x1, %bl
leaq 0xc0707(%rip), %rdi     # 0x102f40
leaq 0x8b18b(%rip), %rsi     # 0xcd9cb
callq 0x8160
testl %eax, %eax
je 0x4287a
leaq 0xc0710(%rip), %rdi     # 0x102f60
leaq 0x8b174(%rip), %rsi     # 0xcd9cb
callq 0x8160
testl %eax, %eax
je 0x4287a
movq 0xbf781(%rip), %rdi     # 0x101fe8
leaq 0x8b189(%rip), %rsi     # 0xcd9f7
movl $0x2e, %edx
callq 0x84e0
movb $0x1, %bl
movzbl 0xbfc3f(%rip), %eax     # 0x1024c0
cmpl $0x64, %eax
je 0x428bc
cmpl $0x68, %eax
je 0x428bc
movq 0xbf756(%rip), %r14     # 0x101fe8
leaq 0x89a6e(%rip), %rsi     # 0xcc307
movl $0x3d, %edx
movq %r14, %rdi
callq 0x84e0
leaq 0x89a98(%rip), %rsi     # 0xcc345
movl $0x45, %edx
movq %r14, %rdi
callq 0x84e0
movb $0x1, %bl
xorpd %xmm0, %xmm0
ucomisd 0xbfc00(%rip), %xmm0    # 0x1024c8
jb 0x428e4
movq 0xbf717(%rip), %rdi     # 0x101fe8
leaq 0x8ba1a(%rip), %rsi     # 0xce2f2
movl $0x21, %edx
callq 0x84e0
movb $0x1, %bl
movq 0xbf6d5(%rip), %rax     # 0x101fc0
movl 0xc(%rsp), %ecx
cmpl %ecx, (%rax)
jg 0x4290c
jne 0x4291a
testb $0x1, %bl
jne 0x42932
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x895cf(%rip), %rsi     # 0xcbee2
movl $0x12, %edx
jmp 0x42926
leaq 0x895d4(%rip), %rsi     # 0xcbef5
movl $0x13, %edx
movq 0xbf6bb(%rip), %rdi     # 0x101fe8
callq 0x84e0
movq 0xbf67f(%rip), %rdi     # 0x101fb8
leaq 0x88afd(%rip), %rsi     # 0xcb43d
callq 0x8460
leaq 0x8ba0d(%rip), %rsi     # 0xce359
movq %rax, %rdi
callq 0x8460
movl $0x1, %edi
callq 0x8530
jmp 0x42960
movq %rax, %r14
movq 0xbf62e(%rip), %rsi     # 0x101f98
leaq 0x38(%rsp), %rdi
callq 0x8620
leaq 0xb0(%rsp), %rdi
callq 0x8190
jmp 0x429a2
movq %rax, %r14
jmp 0x429a2
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x429a2
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x8480
movq %r14, %rdi
callq 0x8840