// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 {
        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 0x4e239
movq %rsi, %r15
movq %rdi, %r14
movl $0x20, %edi
callq 0x69d0
testq %rax, %rax
je 0x4e239
movq %rax, %rbx
movq %r15, %rdi
callq 0x6dd0
movq %rax, (%rbx)
testq %rax, %rax
je 0x4ded2
movq %rax, %rdi
movl $0x3d, %esi
callq 0x6270
testq %rax, %rax
je 0x4dedf
movq %rax, %r15
incq %r15
movb $0x0, (%rax)
jmp 0x4dee6
movq %rbx, %rdi
callq 0x68a0
jmp 0x4e239
leaq 0x4b016(%rip), %r15     # 0x98efc
movq (%rbx), %r12
leaq 0x4a550(%rip), %rsi     # 0x98440
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1af
leaq 0x4a543(%rip), %rsi     # 0x9844a
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1af
leaq 0x4a536(%rip), %rsi     # 0x98454
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1b8
leaq 0x4a529(%rip), %rsi     # 0x9845e
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1b8
leaq 0x4a51c(%rip), %rsi     # 0x98468
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1c1
leaq 0x4a514(%rip), %rsi     # 0x98477
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1c1
leaq 0x4a50c(%rip), %rsi     # 0x98486
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1ca
leaq 0x4a50a(%rip), %rsi     # 0x9849b
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1ca
leaq 0x4a508(%rip), %rsi     # 0x984b0
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1d3
leaq 0x4a4fb(%rip), %rsi     # 0x984ba
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1d3
leaq 0x4a4ee(%rip), %rsi     # 0x984c4
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1dc
leaq 0x4a4de(%rip), %rsi     # 0x984cb
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1dc
leaq 0x4a4ce(%rip), %rsi     # 0x984d2
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1e5
leaq 0x4a4c2(%rip), %rsi     # 0x984dd
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1e5
leaq 0x4a4b6(%rip), %rsi     # 0x984e8
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1ee
leaq 0x4a4a9(%rip), %rsi     # 0x984f2
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1ee
leaq 0x4a49c(%rip), %rsi     # 0x984fc
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1f7
leaq 0x4a48e(%rip), %rsi     # 0x98505
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e1f7
leaq 0x4a480(%rip), %rsi     # 0x9850e
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e200
leaq 0x4a472(%rip), %rsi     # 0x98517
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e200
leaq 0x4a464(%rip), %rsi     # 0x98520
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e244
leaq 0x4a457(%rip), %rsi     # 0x9852a
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e244
leaq 0x45d9e(%rip), %rsi     # 0x93e88
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e24d
leaq 0x4a433(%rip), %rsi     # 0x98534
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e24d
leaq 0x4a424(%rip), %rsi     # 0x9853c
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e25a
leaq 0x4a421(%rip), %rsi     # 0x98550
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e25a
leaq 0x4a41e(%rip), %rsi     # 0x98564
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e263
leaq 0x4a410(%rip), %rsi     # 0x9856d
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e263
leaq 0x4a402(%rip), %rsi     # 0x98576
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e197
leaq 0x4a3ff(%rip), %rsi     # 0x98586
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
jne 0x4e26c
movl $0x12, 0x8(%rbx)
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6a60
movl %eax, 0x10(%rbx)
jmp 0x4e212
movl $0x0, 0x8(%rbx)
jmp 0x4e207
movl $0x2, 0x8(%rbx)
jmp 0x4e207
movl $0x3, 0x8(%rbx)
jmp 0x4e207
movl $0x4, 0x8(%rbx)
jmp 0x4e207
movl $0x7, 0x8(%rbx)
jmp 0x4e207
movl $0xb, 0x8(%rbx)
jmp 0x4e207
movl $0x8, 0x8(%rbx)
jmp 0x4e207
movl $0xc, 0x8(%rbx)
jmp 0x4e207
movl $0x11, 0x8(%rbx)
jmp 0x4e207
movl $0x10, 0x8(%rbx)
movq %r15, %rdi
callq 0x6bd0
movl %eax, 0x10(%rbx)
movq $0x0, 0x18(%rbx)
movq (%r14), %rax
testq %rax, %rax
je 0x4e234
movq %rax, %rcx
movq 0x18(%rax), %rax
testq %rax, %rax
jne 0x4e222
movq %rbx, 0x18(%rcx)
jmp 0x4e237
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 0x4e254
movl $0x6, 0x8(%rbx)
movq %r15, 0x10(%rbx)
jmp 0x4e212
movl $0xa, 0x8(%rbx)
jmp 0x4e207
movl $0x65, 0x8(%rbx)
jmp 0x4e207
movq %r12, %rdi
movq %rbx, %rsi
callq 0x75f7
jmp 0x4e239