// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/src/params.cpp
// Function: ococo::params_t::parse_commandline(int, char const**)
void ococo::params_t::parse_commandline(int argc, const char **argv) {
    /* Parse cmd parameters */
    std::stringstream cmd;
    for (int32_t i = 0; i < argc; i++) {
        cmd << argv[i];
        if (i != argc - 1) {
            cmd << " ";
        }
    }
    command=cmd.str();


    if (argc == 1) {
        print_help();
        exit(1);
    }

    const struct option lopts[] = {
        {"version", no_argument, nullptr, 'v'},
        {"help", no_argument, nullptr, 'h'},
        //
        {"input", required_argument, nullptr, 'i'},
        {"fasta-ref", required_argument, nullptr, 'f'},
        {"stats-in", required_argument, nullptr, 's'},
        //
        {"fasta-cons", required_argument, nullptr, 'F'},
        {"stats-out", required_argument, nullptr, 'S'},
        {"vcf-cons", required_argument, nullptr, 'V'},
        {"pileup", required_argument, nullptr, 'P'},
        {"log", required_argument, nullptr, 'L'},
        {"verbose", no_argument, nullptr, 'W'},
        //
        {"counters", required_argument, nullptr, 'x'},
        {"mode", required_argument, nullptr, 'm'},
        {"strategy", required_argument, nullptr, 't'},
        {"min-MQ", required_argument, nullptr, 'q'},
        {"min-BQ", required_argument, nullptr, 'Q'},
        {"ref-weight", required_argument, nullptr, 'w'},
        {"min-cov", required_argument, nullptr, 'c'},
        {"min-coverage", required_argument, nullptr, 'c'},  // deprec
        {"maj-thres", required_argument, nullptr, 'M'},
        {"majority-threshold", required_argument, nullptr, 'M'},  // deprec
        //
        {nullptr, 0, nullptr, 0}};

    int c;
    using std::string;
    while ((c = getopt_long(argc, (char *const *)argv,
                            "vhi:f:s:F:S:V:P:L:W:x:m:t:q:Q:w:c:M:", lopts,
                            nullptr)) >= 0) {
        switch (c) {
            case 'v': {
                print_version();
                exit(0);
                break;
            }
            case 'h': {
                print_help();
                exit(0);
                break;
            }
            case 'i': {
                sam_fn = optarg;
                break;
            }
            case 'f': {
                fasta_in_fn = optarg;
                break;
            }
            case 's': {
                stats_in_fn = optarg;
                break;
            }
            case 'F': {
                fasta_out_fn = optarg;
                break;
            }
            case 'S': {
                stats_out_fn = optarg;
                break;
            }
            case 'V': {
                vcf_fn = optarg;
                break;
            }
            case 'P': {
                pileup_fn = optarg;
                break;
            }
            case 'L': {
                log_fn = optarg;
                break;
            }
            case 'W': {
                verbose = true;
                break;
            }
            case 'x': {
                counters_str = optarg;

                if (counters_str.compare("ococo16") == 0) {
                    counter_configuration = OCOCO16;
                    counters_str_descr =
                        "ococo16 (16 bits per position, 3bits per nucleotide "
                        "counter)";
                } else if (counters_str.compare("ococo32") == 0) {
                    counter_configuration = OCOCO32;
                    counters_str_descr =
                        "ococo32 (32 bits per position, 7bits per nucleotide "
                        "counter)";
                } else if (counters_str.compare("ococo64") == 0) {
                    counter_configuration = OCOCO64;
                    counters_str_descr =
                        "ococo64 (64 bits per position, 15bits per nucleotide "
                        "counter)";
                } else {
                    ococo::error(
                        "Unknown counter configuration '%s'. Possible modes "
                        "are 'ococo16', 'ococo32', and 'ococo64'.\n",
                        counters_str.c_str());
                    exit(1);
                }

                break;
            }
            case 'm': {
                mode_str = optarg;

                if (mode_str.compare("batch") == 0) {
                    mode = ococo::mode_t::BATCH;
                } else if (mode_str.compare("real-time") == 0) {
                    mode = ococo::mode_t::REALTIME;
                } else {
                    ococo::error(
                        "Unknown mode '%s'. Possible modes are 'batch' and "
                        "'real-time'.\n",
                        mode_str.c_str());
                    exit(1);
                }

                break;
            }
            case 't': {
                strategy_str = optarg;

                if (strategy_str.compare("stochastic") == 0) {
                    strategy = ococo::strategy_t::STOCHASTIC;
                } else if (strategy_str.compare("no-updates") == 0) {
                    strategy = ococo::strategy_t::NO_UPDATES;
                } else if (strategy_str.compare("majority") == 0) {
                    strategy = ococo::strategy_t::MAJORITY;
                } else {
                    ococo::error(
                        "Unknown strategy '%s'. Possible strategies are "
                        "'majority', 'stochastic', and 'no-updates'.\n",
                        strategy_str.c_str());
                    exit(1);
                }

                break;
            }
            case 'q': {
                min_mapq = atoi(optarg);
                break;
            }
            case 'Q': {
                min_baseq = atoi(optarg);
                break;
            }
            case 'w': {
                init_ref_weight = atoi(optarg);
                break;
            }
            case 'c': {
                min_coverage = atoi(optarg);
                break;
            }
            case 'M': {
                majority_threshold = atof(optarg);
                break;
            }
            case '?': {
                ococo::error("Unknown error");
                exit(1);
                break;
            }
        }
    }
    if (sam_fn.size()==0){
        ococo::error("SAM/BAM file must be specified (option '-i').\n");
        exit(1);
    }

    if(pileup_fn.size()!=0 && pileup_fn.compare(vcf_fn)==0){
        ococo::error("Pileup and VCF files cannot be the same (both currently '%s').\n", pileup_fn.c_str());
        exit(1);
    }

    ococo::info("Ococo starting: %s\n", counters_str_descr.c_str());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4f8, %rsp            # imm = 0x4F8
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, 0x88(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x4390
movq %rbx, (%rsp)
testl %ebx, %ebx
jle 0xcd89
leaq 0xb8(%rsp), %r12
movq (%rsp), %rax
leal -0x1(%rax), %r15d
movl %eax, %ebx
xorl %r13d, %r13d
movq (%r14,%r13,8), %rbp
testq %rbp, %rbp
je 0xcd49
movq %rbp, %rdi
callq 0x4230
movq %r12, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x45d0
jmp 0xcd68
movq 0xb8(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0xd8(%rsp,%rax), %esi
orl $0x1, %esi
callq 0x4930
cmpq %r13, %r15
je 0xcd81
movl $0x1, %edx
movq %r12, %rdi
leaq 0x42edd(%rip), %rsi     # 0x4fc59
callq 0x45d0
incq %r13
cmpq %r13, %rbx
jne 0xcd28
leaq 0xc0(%rsp), %rsi
leaq 0x230(%rsp), %rdi
callq 0x4870
movq 0x88(%rsp), %rbx
leaq 0x8(%rbx), %rdi
leaq 0x230(%rsp), %r12
movq %r12, %rsi
callq 0x4660
movq (%r12), %rdi
leaq 0x240(%rsp), %rax
cmpq %rax, %rdi
movq (%rsp), %r13
je 0xcddf
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x4540
cmpl $0x1, %r13d
je 0xd2fe
leaq 0x54ad0(%rip), %rsi     # 0x618c0
leaq 0x230(%rsp), %r12
movl $0x2c0, %edx            # imm = 0x2C0
movq %r12, %rdi
callq 0x4420
leaq 0x437dc(%rip), %rdx     # 0x505e8
movl %r13d, %edi
movq %r14, %rsi
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x48f0
testl %eax, %eax
js 0xd270
leaq 0x1c8(%rbx), %rcx
movq %rcx, 0x8(%rsp)
leaq 0x1e8(%rbx), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x30(%rbx), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x50(%rbx), %rcx
movq %rcx, 0x20(%rsp)
leaq 0x160(%rbx), %rcx
movq %rcx, 0x80(%rsp)
leaq 0x168(%rbx), %rcx
movq %rcx, 0x78(%rsp)
leaq 0x140(%rbx), %rcx
movq %rcx, 0x70(%rsp)
leaq 0x148(%rbx), %rcx
movq %rcx, 0x68(%rsp)
leaq 0xe0(%rbx), %rcx
movq %rcx, 0x60(%rsp)
leaq 0xe8(%rbx), %rcx
movq %rcx, 0x58(%rsp)
leaq 0x120(%rbx), %rcx
movq %rcx, 0x50(%rsp)
leaq 0x128(%rbx), %rcx
movq %rcx, 0x48(%rsp)
leaq 0x100(%rbx), %rcx
movq %rcx, 0x98(%rsp)
leaq 0x108(%rbx), %rcx
movq %rcx, 0x90(%rsp)
leaq 0xb8(%rbx), %rcx
movq %rcx, 0x40(%rsp)
leaq 0xc0(%rbx), %rcx
movq %rcx, 0x38(%rsp)
leaq 0x98(%rbx), %rcx
movq %rcx, 0xa0(%rsp)
leaq 0xa0(%rbx), %r15
leaq 0x78(%rbx), %rcx
movq %rcx, 0x30(%rsp)
leaq 0x80(%rbx), %rcx
movq %rcx, 0x28(%rsp)
leal -0x4c(%rax), %ecx
cmpl $0x2c, %ecx
ja 0xcf48
leaq 0x42d5e(%rip), %rdx     # 0x4fc80
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
movq %r15, %rcx
movq 0xa0(%rsp), %rbp
jmpq *%rax
movq 0x78(%rsp), %rcx
movq 0x80(%rsp), %rbp
jmp 0xd09b
movq 0x90(%rsp), %rcx
movq 0x98(%rsp), %rbp
cmpl $0x46, %eax
je 0xd09b
cmpl $0x3f, %eax
jne 0xd0c7
jmp 0xd315
movq 0x5503a(%rip), %rax     # 0x61fb0
movq (%rax), %rdi
callq 0x4840
movl %eax, 0x1b8(%rbx)
jmp 0xd0c7
movq 0x55020(%rip), %rax     # 0x61fb0
movq (%rax), %r12
movq 0x1f0(%rbx), %r13
movq %r12, %rdi
callq 0x4230
movq 0x10(%rsp), %rdi
xorl %esi, %esi
movq %r13, %rdx
movq (%rsp), %r13
movq %r12, %rcx
movq %rax, %r8
callq 0x4820
movq 0x10(%rsp), %r12
movq %r12, %rdi
leaq 0x42d86(%rip), %rsi     # 0x4fd50
callq 0x4160
testl %eax, %eax
je 0xd211
movq %r12, %rdi
leaq 0x43751(%rip), %rsi     # 0x50732
callq 0x4160
testl %eax, %eax
jne 0xd325
movl $0x1, 0x1a8(%rbx)
jmp 0xd0c7
movq 0x54fac(%rip), %rax     # 0x61fb0
movq (%rax), %rdi
callq 0x4840
movl %eax, 0x1bc(%rbx)
jmp 0xd0c7
movq 0x68(%rsp), %rcx
movq 0x70(%rsp), %rbp
jmp 0xd09b
movq 0x54f86(%rip), %rax     # 0x61fb0
movq (%rax), %rdi
callq 0x4840
movl %eax, 0x1b4(%rbx)
jmp 0xd0c7
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %rbp
jmp 0xd09b
movq 0x58(%rsp), %rcx
movq 0x60(%rsp), %rbp
jmp 0xd09b
movq 0x54f54(%rip), %rax     # 0x61fb0
movq (%rax), %rdi
callq 0x4680
movsd %xmm0, 0x1c0(%rbx)
jmp 0xd0c7
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %rbp
jmp 0xd09b
movq 0x54f2f(%rip), %rax     # 0x61fb0
movq (%rax), %rdi
callq 0x4840
movl %eax, 0x1b0(%rbx)
jmp 0xd0c7
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %rbp
movq 0x54f0e(%rip), %rax     # 0x61fb0
movq (%rax), %r13
movq (%rcx), %r12
movq %r13, %rdi
callq 0x4230
movq %rbp, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r13, %rcx
movq (%rsp), %r13
movq %rax, %r8
callq 0x4820
movl %r13d, %edi
movq %r14, %rsi
leaq 0x43514(%rip), %rdx     # 0x505e8
leaq 0x230(%rsp), %rcx
xorl %r8d, %r8d
callq 0x48f0
testl %eax, %eax
jns 0xcf13
jmp 0xd270
movb $0x1, 0xd8(%rbx)
jmp 0xd0c7
movq 0x54eaf(%rip), %rax     # 0x61fb0
movq (%rax), %r12
movq 0x38(%rbx), %r13
movq %r12, %rdi
callq 0x4230
movq 0x18(%rsp), %rdi
xorl %esi, %esi
movq %r13, %rdx
movq (%rsp), %r13
movq %r12, %rcx
movq 0x18(%rsp), %r12
movq %rax, %r8
callq 0x4820
movq %r12, %rdi
leaq 0x434d5(%rip), %rsi     # 0x5060d
callq 0x4160
movl $0x3c, %ebp
testl %eax, %eax
je 0xd220
movq %r12, %rdi
leaq 0x42bf4(%rip), %rsi     # 0x4fd48
callq 0x4160
testl %eax, %eax
je 0xd23a
movq %r12, %rdi
leaq 0x43524(%rip), %rsi     # 0x5068f
callq 0x4160
testl %eax, %eax
jne 0xd350
movl $0x3d, %ebp
movl $0x2, %eax
leaq 0x4350e(%rip), %rcx     # 0x50697
jmp 0xd246
movq 0x54e1b(%rip), %rax     # 0x61fb0
movq (%rax), %r12
movq 0x1d0(%rbx), %r13
movq %r12, %rdi
callq 0x4230
movq 0x8(%rsp), %rdi
xorl %esi, %esi
movq %r13, %rdx
movq (%rsp), %r13
movq %r12, %rcx
movq %rax, %r8
callq 0x4820
movq 0x8(%rsp), %r12
movq %r12, %rdi
leaq 0x435ad(%rip), %rsi     # 0x5077c
callq 0x4160
testl %eax, %eax
je 0xd22b
movq %r12, %rdi
leaq 0x435a5(%rip), %rsi     # 0x50787
callq 0x4160
testl %eax, %eax
je 0xd261
movq %r12, %rdi
leaq 0x42b61(%rip), %rsi     # 0x4fd56
callq 0x4160
testl %eax, %eax
jne 0xd364
movl $0x3, 0x1ac(%rbx)
jmp 0xd0c7
movl $0x0, 0x1a8(%rbx)
jmp 0xd0c7
xorl %eax, %eax
leaq 0x433ec(%rip), %rcx     # 0x50615
jmp 0xd246
movl $0x1, 0x1ac(%rbx)
jmp 0xd0c7
movl $0x1, %eax
leaq 0x4340c(%rip), %rcx     # 0x50652
movl %eax, 0x28(%rbx)
movq 0x58(%rbx), %rdx
movq 0x20(%rsp), %rdi
xorl %esi, %esi
movq %rbp, %r8
callq 0x4820
jmp 0xd0c7
movl $0x0, 0x1ac(%rbx)
jmp 0xd0c7
cmpq $0x0, 0x80(%rbx)
je 0xd305
cmpq $0x0, 0x148(%rbx)
je 0xd2a6
leaq 0x140(%rbx), %r14
leaq 0xe0(%rbx), %rsi
movq %r14, %rdi
callq 0x4060
testl %eax, %eax
je 0xd33d
movq 0x50(%rbx), %rsi
leaq 0x435ba(%rip), %rdi     # 0x5086b
xorl %eax, %eax
callq 0x4cae
movq 0x54ce1(%rip), %rsi     # 0x61fa0
leaq 0xa8(%rsp), %rdi
callq 0x43d0
leaq 0x128(%rsp), %rdi
callq 0x41a0
addq $0x4f8, %rsp            # imm = 0x4F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xc48c
jmp 0xd2f7
callq 0xd5f4
xorl %edi, %edi
callq 0x4630
callq 0xd5f4
jmp 0xd37a
leaq 0x434f0(%rip), %rdi     # 0x507fc
xorl %eax, %eax
callq 0x4b3a
jmp 0xd37a
leaq 0x434d2(%rip), %rdi     # 0x507ee
xorl %eax, %eax
callq 0x4b3a
jmp 0xd37a
movq 0x10(%rsp), %rax
movq (%rax), %rsi
leaq 0x43408(%rip), %rdi     # 0x5073c
xorl %eax, %eax
callq 0x4b3a
jmp 0xd37a
movq (%r14), %rsi
leaq 0x434e4(%rip), %rdi     # 0x5082b
xorl %eax, %eax
callq 0x4b3a
jmp 0xd37a
movq (%r12), %rsi
leaq 0x4337a(%rip), %rdi     # 0x506d5
xorl %eax, %eax
callq 0x4b3a
jmp 0xd37a
movq 0x8(%rsp), %rax
movq (%rax), %rsi
leaq 0x4341f(%rip), %rdi     # 0x50792
xorl %eax, %eax
callq 0x4b3a
movl $0x1, %edi
callq 0x4630
jmp 0xd38c
jmp 0xd38c
jmp 0xd38c
jmp 0xd38c
movq %rax, %rbx
movq 0x54c0a(%rip), %rsi     # 0x61fa0
leaq 0xa8(%rsp), %rdi
callq 0x43d0
leaq 0x128(%rsp), %rdi
callq 0x41a0
movq %rbx, %rdi
callq 0x4970