// File: /workspace/github_cpp_makefile_star2_O3/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 0xf9f8
movq %rsi, %r15
movq %rdi, %r14
movl $0x20, %edi
callq 0x4700
testq %rax, %rax
je 0xf9f8
movq %rax, %rbx
movq %r15, %rdi
callq 0x49c0
movq %rax, (%rbx)
testq %rax, %rax
je 0xf644
movq %rax, %r12
movq %rax, %rdi
movl $0x3d, %esi
callq 0x4200
testq %rax, %rax
je 0xf651
movq %rax, %r15
incq %r15
movb $0x0, (%rax)
jmp 0xf658
movq %rbx, %rdi
callq 0x4610
jmp 0xf9f8
leaq 0x437f4(%rip), %r15     # 0x52e4c
leaq 0x4163f(%rip), %rsi     # 0x50c9e
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf96e
leaq 0x41632(%rip), %rsi     # 0x50ca8
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf96e
leaq 0x41625(%rip), %rsi     # 0x50cb2
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf977
leaq 0x41618(%rip), %rsi     # 0x50cbc
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf977
leaq 0x4160b(%rip), %rsi     # 0x50cc6
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf980
leaq 0x41603(%rip), %rsi     # 0x50cd5
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf980
leaq 0x415fb(%rip), %rsi     # 0x50ce4
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf989
leaq 0x415f9(%rip), %rsi     # 0x50cf9
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf989
leaq 0x415f7(%rip), %rsi     # 0x50d0e
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf992
leaq 0x415ea(%rip), %rsi     # 0x50d18
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf992
leaq 0x415dd(%rip), %rsi     # 0x50d22
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf99b
leaq 0x415cd(%rip), %rsi     # 0x50d29
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf99b
leaq 0x415bd(%rip), %rsi     # 0x50d30
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf9a4
leaq 0x415b1(%rip), %rsi     # 0x50d3b
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf9a4
leaq 0x415a5(%rip), %rsi     # 0x50d46
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf9ad
leaq 0x41598(%rip), %rsi     # 0x50d50
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf9ad
leaq 0x4158b(%rip), %rsi     # 0x50d5a
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf9b6
leaq 0x4157d(%rip), %rsi     # 0x50d63
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf9b6
leaq 0x4156f(%rip), %rsi     # 0x50d6c
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf9bf
leaq 0x41561(%rip), %rsi     # 0x50d75
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf9bf
leaq 0x41553(%rip), %rsi     # 0x50d7e
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa03
leaq 0x41546(%rip), %rsi     # 0x50d88
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa03
leaq 0x40cd6(%rip), %rsi     # 0x5052f
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa0c
leaq 0x41522(%rip), %rsi     # 0x50d92
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa0c
leaq 0x41513(%rip), %rsi     # 0x50d9a
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa19
leaq 0x41510(%rip), %rsi     # 0x50dae
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa19
leaq 0x4150d(%rip), %rsi     # 0x50dc2
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa22
leaq 0x414ff(%rip), %rsi     # 0x50dcb
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa22
leaq 0x414f1(%rip), %rsi     # 0x50dd4
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa2b
leaq 0x414ea(%rip), %rsi     # 0x50de4
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa2b
leaq 0x414e3(%rip), %rsi     # 0x50df4
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa34
leaq 0x414d8(%rip), %rsi     # 0x50e00
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xfa34
leaq 0x414cd(%rip), %rsi     # 0x50e0c
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
je 0xf962
leaq 0x414c6(%rip), %rsi     # 0x50e18
movq %r12, %rdi
callq 0x4750
testl %eax, %eax
jne 0xfa4c
movl $0x1, 0x8(%rbx)
jmp 0xfa13
movl $0x0, 0x8(%rbx)
jmp 0xf9c6
movl $0x2, 0x8(%rbx)
jmp 0xf9c6
movl $0x3, 0x8(%rbx)
jmp 0xf9c6
movl $0x4, 0x8(%rbx)
jmp 0xf9c6
movl $0x7, 0x8(%rbx)
jmp 0xf9c6
movl $0xb, 0x8(%rbx)
jmp 0xf9c6
movl $0x8, 0x8(%rbx)
jmp 0xf9c6
movl $0xc, 0x8(%rbx)
jmp 0xf9c6
movl $0x11, 0x8(%rbx)
jmp 0xf9c6
movl $0x10, 0x8(%rbx)
movq %r15, %rdi
callq 0x4840
movl %eax, 0x10(%rbx)
movq $0x0, 0x18(%rbx)
movq (%r14), %rax
testq %rax, %rax
je 0xf9f3
movq %rax, %rcx
movq 0x18(%rax), %rax
testq %rax, %rax
jne 0xf9e1
movq %rbx, 0x18(%rcx)
jmp 0xf9f6
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 0xfa13
movl $0x6, 0x8(%rbx)
movq %r15, 0x10(%rbx)
jmp 0xf9d1
movl $0xa, 0x8(%rbx)
jmp 0xf9c6
movl $0x65, 0x8(%rbx)
jmp 0xf9c6
movl $0x12, 0x8(%rbx)
jmp 0xfa3b
movl $0x13, 0x8(%rbx)
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4760
movl %eax, 0x10(%rbx)
jmp 0xf9d1
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4d68
jmp 0xf9f8