// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/hts.c
// Function: hts_opt_add
int hts_opt_add(hts_opt **opts, const char *c_arg) {
    hts_opt *o, *t;
    char *val;

    if (!c_arg)
        return -1;

    if (!(o =  malloc(sizeof(*o))))
        return -1;

    if (!(o->arg = strdup(c_arg))) {
        free(o);
        return -1;
    }

    if (!(val = strchr(o->arg, '=')))
        val = "1"; // assume boolean
    else
        *val++ = '\0';

    if (strcmp(o->arg, "decode_md") == 0 ||
        strcmp(o->arg, "DECODE_MD") == 0)
        o->opt = CRAM_OPT_DECODE_MD, o->val.i = atoi(val);

    else if (strcmp(o->arg, "verbosity") == 0 ||
             strcmp(o->arg, "VERBOSITY") == 0)
        o->opt = CRAM_OPT_VERBOSITY, o->val.i = atoi(val);

    else if (strcmp(o->arg, "seqs_per_slice") == 0 ||
             strcmp(o->arg, "SEQS_PER_SLICE") == 0)
        o->opt = CRAM_OPT_SEQS_PER_SLICE, o->val.i = atoi(val);

    else if (strcmp(o->arg, "slices_per_container") == 0 ||
             strcmp(o->arg, "SLICES_PER_CONTAINER") == 0)
        o->opt = CRAM_OPT_SLICES_PER_CONTAINER, o->val.i = atoi(val);

    else if (strcmp(o->arg, "embed_ref") == 0 ||
             strcmp(o->arg, "EMBED_REF") == 0)
        o->opt = CRAM_OPT_EMBED_REF, o->val.i = atoi(val);

    else if (strcmp(o->arg, "no_ref") == 0 ||
             strcmp(o->arg, "NO_REF") == 0)
        o->opt = CRAM_OPT_NO_REF, o->val.i = atoi(val);

    else if (strcmp(o->arg, "ignore_md5") == 0 ||
             strcmp(o->arg, "IGNORE_MD5") == 0)
        o->opt = CRAM_OPT_IGNORE_MD5, o->val.i = atoi(val);

    else if (strcmp(o->arg, "use_bzip2") == 0 ||
             strcmp(o->arg, "USE_BZIP2") == 0)
        o->opt = CRAM_OPT_USE_BZIP2, o->val.i = atoi(val);

    else if (strcmp(o->arg, "use_rans") == 0 ||
             strcmp(o->arg, "USE_RANS") == 0)
        o->opt = CRAM_OPT_USE_RANS, o->val.i = atoi(val);

    else if (strcmp(o->arg, "use_lzma") == 0 ||
             strcmp(o->arg, "USE_LZMA") == 0)
        o->opt = CRAM_OPT_USE_LZMA, o->val.i = atoi(val);

    else if (strcmp(o->arg, "reference") == 0 ||
             strcmp(o->arg, "REFERENCE") == 0)
        o->opt = CRAM_OPT_REFERENCE, o->val.s = val;

    else if (strcmp(o->arg, "version") == 0 ||
             strcmp(o->arg, "VERSION") == 0)
        o->opt = CRAM_OPT_VERSION, o->val.s =val;

    else if (strcmp(o->arg, "multi_seq_per_slice") == 0 ||
             strcmp(o->arg, "MULTI_SEQ_PER_SLICE") == 0)
        o->opt = CRAM_OPT_MULTI_SEQ_PER_SLICE, o->val.i = atoi(val);

    else if (strcmp(o->arg, "nthreads") == 0 ||
             strcmp(o->arg, "NTHREADS") == 0)
        o->opt = HTS_OPT_NTHREADS, o->val.i = atoi(val);

    else if (strcmp(o->arg, "required_fields") == 0 ||
             strcmp(o->arg, "REQUIRED_FIELDS") == 0)
        o->opt = CRAM_OPT_REQUIRED_FIELDS, o->val.i = strtol(val, NULL, 0);

    else if (strcmp(o->arg, "lossy_names") == 0 ||
             strcmp(o->arg, "LOSSY_NAMES") == 0)
        o->opt = CRAM_OPT_LOSSY_NAMES, o->val.i = strtol(val, NULL, 0);

    else if (strcmp(o->arg, "name_prefix") == 0 ||
             strcmp(o->arg, "NAME_PREFIX") == 0)
        o->opt = CRAM_OPT_PREFIX, o->val.s = val;

    else {
        fprintf(stderr, "Unknown option '%s'\n", o->arg);
        free(o->arg);
        free(o);
        return -1;
    }

    o->next = NULL;

    // Append; assumes small list.
    if (*opts) {
        t = *opts;
        while (t->next)
            t = t->next;
        t->next = o;
    } else {
        *opts = o;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0xfa97
movq %rsi, %r15
movq %rdi, %r14
movl $0x20, %edi
callq 0x4700
testq %rax, %rax
je 0xfa97
movq %rax, %rbx
movq %r15, %rdi
callq 0x49c0
movq %rax, (%rbx)
testq %rax, %rax
je 0xf6e0
movq %rax, %rdi
movl $0x3d, %esi
callq 0x4200
testq %rax, %rax
je 0xf6ed
movq %rax, %r15
incq %r15
movb $0x0, (%rax)
jmp 0xf6f4
movq %rbx, %rdi
callq 0x4610
jmp 0xfa97
leaq 0x454b0(%rip), %r15     # 0x54ba4
movq (%rbx), %r12
leaq 0x4356c(%rip), %rsi     # 0x52c6a
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa0d
leaq 0x4355f(%rip), %rsi     # 0x52c74
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa0d
leaq 0x43552(%rip), %rsi     # 0x52c7e
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa16
leaq 0x43545(%rip), %rsi     # 0x52c88
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa16
leaq 0x43538(%rip), %rsi     # 0x52c92
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa1f
leaq 0x43530(%rip), %rsi     # 0x52ca1
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa1f
leaq 0x43528(%rip), %rsi     # 0x52cb0
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa28
leaq 0x43526(%rip), %rsi     # 0x52cc5
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa28
leaq 0x43524(%rip), %rsi     # 0x52cda
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa31
leaq 0x43517(%rip), %rsi     # 0x52ce4
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa31
leaq 0x4350a(%rip), %rsi     # 0x52cee
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa3a
leaq 0x434fa(%rip), %rsi     # 0x52cf5
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa3a
leaq 0x434ea(%rip), %rsi     # 0x52cfc
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa43
leaq 0x434de(%rip), %rsi     # 0x52d07
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa43
leaq 0x434d2(%rip), %rsi     # 0x52d12
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa4c
leaq 0x434c5(%rip), %rsi     # 0x52d1c
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa4c
leaq 0x434b8(%rip), %rsi     # 0x52d26
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa55
leaq 0x434aa(%rip), %rsi     # 0x52d2f
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa55
leaq 0x4349c(%rip), %rsi     # 0x52d38
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa5e
leaq 0x4348e(%rip), %rsi     # 0x52d41
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa5e
leaq 0x43480(%rip), %rsi     # 0x52d4a
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfaa2
leaq 0x43473(%rip), %rsi     # 0x52d54
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfaa2
leaq 0x42c37(%rip), %rsi     # 0x5252f
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfaab
leaq 0x4344f(%rip), %rsi     # 0x52d5e
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfaab
leaq 0x43440(%rip), %rsi     # 0x52d66
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfab8
leaq 0x4343d(%rip), %rsi     # 0x52d7a
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfab8
leaq 0x4343a(%rip), %rsi     # 0x52d8e
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfac1
leaq 0x4342c(%rip), %rsi     # 0x52d97
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfac1
leaq 0x4341e(%rip), %rsi     # 0x52da0
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfaca
leaq 0x43417(%rip), %rsi     # 0x52db0
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfaca
leaq 0x43410(%rip), %rsi     # 0x52dc0
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfad3
leaq 0x43405(%rip), %rsi     # 0x52dcc
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfad3
leaq 0x433fa(%rip), %rsi     # 0x52dd8
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa01
leaq 0x433f3(%rip), %rsi     # 0x52de4
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
jne 0xfaeb
movl $0x1, 0x8(%rbx)
jmp 0xfab2
movl $0x0, 0x8(%rbx)
jmp 0xfa65
movl $0x2, 0x8(%rbx)
jmp 0xfa65
movl $0x3, 0x8(%rbx)
jmp 0xfa65
movl $0x4, 0x8(%rbx)
jmp 0xfa65
movl $0x7, 0x8(%rbx)
jmp 0xfa65
movl $0xb, 0x8(%rbx)
jmp 0xfa65
movl $0x8, 0x8(%rbx)
jmp 0xfa65
movl $0xc, 0x8(%rbx)
jmp 0xfa65
movl $0x11, 0x8(%rbx)
jmp 0xfa65
movl $0x10, 0x8(%rbx)
movq %r15, %rdi
callq 0x4840
movl %eax, 0x10(%rbx)
movq $0x0, 0x18(%rbx)
movq (%r14), %rax
testq %rax, %rax
je 0xfa92
movq %rax, %rcx
movq 0x18(%rax), %rax
testq %rax, %rax
jne 0xfa80
movq %rbx, 0x18(%rcx)
jmp 0xfa95
movq %rbx, (%r14)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x9, 0x8(%rbx)
jmp 0xfab2
movl $0x6, 0x8(%rbx)
movq %r15, 0x10(%rbx)
jmp 0xfa70
movl $0xa, 0x8(%rbx)
jmp 0xfa65
movl $0x65, 0x8(%rbx)
jmp 0xfa65
movl $0x12, 0x8(%rbx)
jmp 0xfada
movl $0x13, 0x8(%rbx)
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4760
movl %eax, 0x10(%rbx)
jmp 0xfa70
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4d68
jmp 0xfa97