// File: /workspace/github_c_makefile_star2_O3/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 0x4e44b
movq %rsi, %r15
movq %rdi, %r14
movl $0x20, %edi
callq 0x69d0
testq %rax, %rax
je 0x4e44b
movq %rax, %rbx
movq %r15, %rdi
callq 0x6dd0
movq %rax, (%rbx)
testq %rax, %rax
je 0x4e0e7
movq %rax, %r12
movq %rax, %rdi
movl $0x3d, %esi
callq 0x6270
testq %rax, %rax
je 0x4e0f4
movq %rax, %r15
incq %r15
movb $0x0, (%rax)
jmp 0x4e0fb
movq %rbx, %rdi
callq 0x68a0
jmp 0x4e44b
leaq 0x4b009(%rip), %r15     # 0x99104
leaq 0x4a432(%rip), %rsi     # 0x98534
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e3c1
leaq 0x4a425(%rip), %rsi     # 0x9853e
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e3c1
leaq 0x4a418(%rip), %rsi     # 0x98548
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e3ca
leaq 0x4a40b(%rip), %rsi     # 0x98552
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e3ca
leaq 0x4a3fe(%rip), %rsi     # 0x9855c
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e3d3
leaq 0x4a3f6(%rip), %rsi     # 0x9856b
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e3d3
leaq 0x4a3ee(%rip), %rsi     # 0x9857a
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e3dc
leaq 0x4a3ec(%rip), %rsi     # 0x9858f
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e3dc
leaq 0x4a3ea(%rip), %rsi     # 0x985a4
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e3e5
leaq 0x4a3dd(%rip), %rsi     # 0x985ae
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e3e5
leaq 0x4a3d0(%rip), %rsi     # 0x985b8
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e3ee
leaq 0x4a3c0(%rip), %rsi     # 0x985bf
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e3ee
leaq 0x4a3b0(%rip), %rsi     # 0x985c6
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e3f7
leaq 0x4a3a4(%rip), %rsi     # 0x985d1
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e3f7
leaq 0x4a398(%rip), %rsi     # 0x985dc
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e400
leaq 0x4a38b(%rip), %rsi     # 0x985e6
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e400
leaq 0x4a37e(%rip), %rsi     # 0x985f0
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e409
leaq 0x4a370(%rip), %rsi     # 0x985f9
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e409
leaq 0x4a362(%rip), %rsi     # 0x98602
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e412
leaq 0x4a354(%rip), %rsi     # 0x9860b
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e412
leaq 0x4a346(%rip), %rsi     # 0x98614
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e456
leaq 0x4a339(%rip), %rsi     # 0x9861e
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e456
leaq 0x45c5c(%rip), %rsi     # 0x93f58
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e45f
leaq 0x4a315(%rip), %rsi     # 0x98628
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e45f
leaq 0x4a306(%rip), %rsi     # 0x98630
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e46c
leaq 0x4a303(%rip), %rsi     # 0x98644
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e46c
leaq 0x4a300(%rip), %rsi     # 0x98658
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e475
leaq 0x4a2f2(%rip), %rsi     # 0x98661
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e475
leaq 0x4a2e4(%rip), %rsi     # 0x9866a
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
je 0x4e3a9
leaq 0x4a2e1(%rip), %rsi     # 0x9867a
movq %r12, %rdi
callq 0x6a50
testl %eax, %eax
jne 0x4e47e
movl $0x12, 0x8(%rbx)
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6a60
movl %eax, 0x10(%rbx)
jmp 0x4e424
movl $0x0, 0x8(%rbx)
jmp 0x4e419
movl $0x2, 0x8(%rbx)
jmp 0x4e419
movl $0x3, 0x8(%rbx)
jmp 0x4e419
movl $0x4, 0x8(%rbx)
jmp 0x4e419
movl $0x7, 0x8(%rbx)
jmp 0x4e419
movl $0xb, 0x8(%rbx)
jmp 0x4e419
movl $0x8, 0x8(%rbx)
jmp 0x4e419
movl $0xc, 0x8(%rbx)
jmp 0x4e419
movl $0x11, 0x8(%rbx)
jmp 0x4e419
movl $0x10, 0x8(%rbx)
movq %r15, %rdi
callq 0x6bd0
movl %eax, 0x10(%rbx)
movq $0x0, 0x18(%rbx)
movq (%r14), %rax
testq %rax, %rax
je 0x4e446
movq %rax, %rcx
movq 0x18(%rax), %rax
testq %rax, %rax
jne 0x4e434
movq %rbx, 0x18(%rcx)
jmp 0x4e449
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 0x4e466
movl $0x6, 0x8(%rbx)
movq %r15, 0x10(%rbx)
jmp 0x4e424
movl $0xa, 0x8(%rbx)
jmp 0x4e419
movl $0x65, 0x8(%rbx)
jmp 0x4e419
movq %r12, %rdi
movq %rbx, %rsi
callq 0x75b6
jmp 0x4e44b