// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hts.c
// Function: hts_set_opt
int hts_set_opt(htsFile *fp, enum hts_fmt_option opt, ...) {
    int r;
    va_list args;

    switch (opt) {
    case HTS_OPT_NTHREADS: {
        va_start(args, opt);
        int nthreads = va_arg(args, int);
        va_end(args);
        return hts_set_threads(fp, nthreads);
    }

    case HTS_OPT_BLOCK_SIZE: {
        hFILE *hf = hts_hfile(fp);

        if (hf) {
            va_start(args, opt);
            if (hfile_set_blksize(hf, va_arg(args, int)) != 0)
                hts_log_warning("Failed to change block size");
            va_end(args);
        }
        else {
            // To do - implement for vcf/bcf.
            hts_log_warning("Cannot change block size for this format");
        }

        return 0;
    }

    case HTS_OPT_THREAD_POOL: {
        va_start(args, opt);
        htsThreadPool *p = va_arg(args, htsThreadPool *);
        va_end(args);
        return hts_set_thread_pool(fp, p);
    }

    case HTS_OPT_CACHE_SIZE: {
        va_start(args, opt);
        int cache_size = va_arg(args, int);
        va_end(args);
        hts_set_cache_size(fp, cache_size);
        return 0;
    }

    case FASTQ_OPT_CASAVA:
    case FASTQ_OPT_RNUM:
    case FASTQ_OPT_NAME2:
        if (fp->format.format == fastq_format ||
            fp->format.format == fasta_format)
            return fastq_state_set(fp, opt);
        return 0;

    case FASTQ_OPT_AUX:
        if (fp->format.format == fastq_format ||
            fp->format.format == fasta_format) {
            va_start(args, opt);
            char *list = va_arg(args, char *);
            va_end(args);
            return fastq_state_set(fp, opt, list);
        }
        return 0;

    case FASTQ_OPT_BARCODE:
        if (fp->format.format == fastq_format ||
            fp->format.format == fasta_format) {
            va_start(args, opt);
            char *bc = va_arg(args, char *);
            va_end(args);
            return fastq_state_set(fp, opt, bc);
        }
        return 0;

    // Options below here flow through to cram_set_voption
    case HTS_OPT_COMPRESSION_LEVEL: {
        va_start(args, opt);
        int level = va_arg(args, int);
        va_end(args);
        if (fp->is_bgzf)
            fp->fp.bgzf->compress_level = level;
        else if (fp->format.format == cram)
            return cram_set_option(fp->fp.cram, opt, level);
        return 0;
    }

    case HTS_OPT_FILTER: {
        va_start(args, opt);
        char *expr = va_arg(args, char *);
        va_end(args);
        return hts_set_filter_expression(fp, expr);
    }

    case HTS_OPT_PROFILE: {
        va_start(args, opt);
        enum hts_profile_option prof = va_arg(args, int);
        va_end(args);
        if (fp->is_bgzf) {
            switch (prof) {
#ifdef HAVE_LIBDEFLATE
            case HTS_PROFILE_FAST:    fp->fp.bgzf->compress_level =  2; break;
            case HTS_PROFILE_NORMAL:  fp->fp.bgzf->compress_level = -1; break;
            case HTS_PROFILE_SMALL:   fp->fp.bgzf->compress_level = 10; break;
            case HTS_PROFILE_ARCHIVE: fp->fp.bgzf->compress_level = 12; break;
#else
            case HTS_PROFILE_FAST:    fp->fp.bgzf->compress_level =  1; break;
            case HTS_PROFILE_NORMAL:  fp->fp.bgzf->compress_level = -1; break;
            case HTS_PROFILE_SMALL:   fp->fp.bgzf->compress_level =  8; break;
            case HTS_PROFILE_ARCHIVE: fp->fp.bgzf->compress_level =  9; break;
#endif
            }
        } // else CRAM manages this in its own way
        break;
    }

    default:
        break;
    }

    if (fp->format.format != cram)
        return 0;

    va_start(args, opt);
    r = cram_set_voption(fp->fp.cram, opt, args);
    va_end(args);

    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
testb %al, %al
je 0x1bfc7
movaps %xmm0, -0x100(%rbp)
movaps %xmm1, -0xf0(%rbp)
movaps %xmm2, -0xe0(%rbp)
movaps %xmm3, -0xd0(%rbp)
movaps %xmm4, -0xc0(%rbp)
movaps %xmm5, -0xb0(%rbp)
movaps %xmm6, -0xa0(%rbp)
movaps %xmm7, -0x90(%rbp)
movq %r9, -0x108(%rbp)
movq %r8, -0x110(%rbp)
movq %rcx, -0x118(%rbp)
movq %rdx, -0x120(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x134(%rbp)
subl $0x64, %eax
je 0x1c57b
jmp 0x1bffe
movl -0x134(%rbp), %eax
subl $0x65, %eax
je 0x1c0c6
jmp 0x1c00f
movl -0x134(%rbp), %eax
subl $0x66, %eax
je 0x1c266
jmp 0x1c020
movl -0x134(%rbp), %eax
subl $0x67, %eax
je 0x1c309
jmp 0x1c031
movl -0x134(%rbp), %eax
subl $0x68, %eax
je 0x1c166
jmp 0x1c042
movl -0x134(%rbp), %eax
subl $0x69, %eax
je 0x1c66f
jmp 0x1c053
movl -0x134(%rbp), %eax
subl $0x6a, %eax
je 0x1c712
jmp 0x1c064
movl -0x134(%rbp), %eax
subl $0x3e8, %eax            # imm = 0x3E8
je 0x1c3ad
jmp 0x1c077
movl -0x134(%rbp), %eax
subl $0x3e9, %eax            # imm = 0x3E9
je 0x1c3e3
jmp 0x1c08a
movl -0x134(%rbp), %eax
subl $0x3ea, %eax            # imm = 0x3EA
je 0x1c3ad
jmp 0x1c09d
movl -0x134(%rbp), %eax
subl $0x3eb, %eax            # imm = 0x3EB
je 0x1c4af
jmp 0x1c0b0
movl -0x134(%rbp), %eax
subl $0x3ec, %eax            # imm = 0x3EC
je 0x1c3ad
jmp 0x1c844
leaq -0x30(%rbp), %rax
leaq -0x130(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
leaq -0x30(%rbp), %rax
movq %rax, -0x140(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x138(%rbp)
cmpl $0x28, %eax
ja 0x1c125
movq -0x140(%rbp), %rcx
movl -0x138(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x148(%rbp)
jmp 0x1c142
movq -0x140(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x34(%rbp)
leaq -0x30(%rbp), %rax
movq -0x10(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x1d900
movl %eax, -0x4(%rbp)
jmp 0x1c89e
movq -0x10(%rbp), %rdi
callq 0x1d990
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x1c240
leaq -0x30(%rbp), %rax
leaq -0x130(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq -0x40(%rbp), %rax
movq %rax, -0x160(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0x158(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x14c(%rbp)
cmpl $0x28, %eax
ja 0x1c1e8
movq -0x158(%rbp), %rcx
movl -0x14c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x168(%rbp)
jmp 0x1c205
movq -0x158(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x168(%rbp)
movq -0x160(%rbp), %rdi
movq -0x168(%rbp), %rax
movslq (%rax), %rsi
callq 0x13b00
cmpl $0x0, %eax
je 0x1c23a
movl $0x3, %edi
leaq 0xd42e9(%rip), %rsi     # 0xf0515
leaq 0xd42ee(%rip), %rdx     # 0xf0521
movb $0x0, %al
callq 0x1b030
leaq -0x30(%rbp), %rax
jmp 0x1c25a
movl $0x3, %edi
leaq 0xd42c9(%rip), %rsi     # 0xf0515
leaq 0xd42ea(%rip), %rdx     # 0xf053d
movb $0x0, %al
callq 0x1b030
movl $0x0, -0x4(%rbp)
jmp 0x1c89e
leaq -0x30(%rbp), %rax
leaq -0x130(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
leaq -0x30(%rbp), %rax
movq %rax, -0x178(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x16c(%rbp)
cmpl $0x28, %eax
ja 0x1c2c5
movq -0x178(%rbp), %rcx
movl -0x16c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x180(%rbp)
jmp 0x1c2e2
movq -0x178(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x180(%rbp)
movq -0x180(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
leaq -0x30(%rbp), %rax
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x1da60
movl %eax, -0x4(%rbp)
jmp 0x1c89e
leaq -0x30(%rbp), %rax
leaq -0x130(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
leaq -0x30(%rbp), %rax
movq %rax, -0x190(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x184(%rbp)
cmpl $0x28, %eax
ja 0x1c368
movq -0x190(%rbp), %rcx
movl -0x184(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x198(%rbp)
jmp 0x1c385
movq -0x190(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x198(%rbp)
movq -0x198(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4c(%rbp)
leaq -0x30(%rbp), %rax
movq -0x10(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x1db00
movl $0x0, -0x4(%rbp)
jmp 0x1c89e
movq -0x10(%rbp), %rax
cmpl $0x11, 0x4c(%rax)
je 0x1c3c1
movq -0x10(%rbp), %rax
cmpl $0x10, 0x4c(%rax)
jne 0x1c3d7
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movb $0x0, %al
callq 0x3c260
movl %eax, -0x4(%rbp)
jmp 0x1c89e
movl $0x0, -0x4(%rbp)
jmp 0x1c89e
movq -0x10(%rbp), %rax
cmpl $0x11, 0x4c(%rax)
je 0x1c3fb
movq -0x10(%rbp), %rax
cmpl $0x10, 0x4c(%rax)
jne 0x1c4a3
leaq -0x30(%rbp), %rax
leaq -0x130(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
leaq -0x30(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x19c(%rbp)
cmpl $0x28, %eax
ja 0x1c45a
movq -0x1a8(%rbp), %rcx
movl -0x19c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x1b0(%rbp)
jmp 0x1c477
movq -0x1a8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x1b0(%rbp)
movq -0x1b0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
leaq -0x30(%rbp), %rax
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x58(%rbp), %rdx
movb $0x0, %al
callq 0x3c260
movl %eax, -0x4(%rbp)
jmp 0x1c89e
movl $0x0, -0x4(%rbp)
jmp 0x1c89e
movq -0x10(%rbp), %rax
cmpl $0x11, 0x4c(%rax)
je 0x1c4c7
movq -0x10(%rbp), %rax
cmpl $0x10, 0x4c(%rax)
jne 0x1c56f
leaq -0x30(%rbp), %rax
leaq -0x130(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
leaq -0x30(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x1b4(%rbp)
cmpl $0x28, %eax
ja 0x1c526
movq -0x1c0(%rbp), %rcx
movl -0x1b4(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x1c8(%rbp)
jmp 0x1c543
movq -0x1c0(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
leaq -0x30(%rbp), %rax
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x60(%rbp), %rdx
movb $0x0, %al
callq 0x3c260
movl %eax, -0x4(%rbp)
jmp 0x1c89e
movl $0x0, -0x4(%rbp)
jmp 0x1c89e
leaq -0x30(%rbp), %rax
leaq -0x130(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
leaq -0x30(%rbp), %rax
movq %rax, -0x1d8(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x1cc(%rbp)
cmpl $0x28, %eax
ja 0x1c5da
movq -0x1d8(%rbp), %rcx
movl -0x1cc(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x1e0(%rbp)
jmp 0x1c5f7
movq -0x1d8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x64(%rbp)
leaq -0x30(%rbp), %rax
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1c63a
movl -0x64(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movl (%rax), %ecx
andl $0x1ff, %edx            # imm = 0x1FF
shll $0x14, %edx
andl $0xe00fffff, %ecx       # imm = 0xE00FFFFF
orl %edx, %ecx
movl %ecx, (%rax)
jmp 0x1c663
movq -0x10(%rbp), %rax
cmpl $0x6, 0x4c(%rax)
jne 0x1c661
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movl -0x14(%rbp), %esi
movl -0x64(%rbp), %edx
movb $0x0, %al
callq 0x79f60
movl %eax, -0x4(%rbp)
jmp 0x1c89e
jmp 0x1c663
movl $0x0, -0x4(%rbp)
jmp 0x1c89e
leaq -0x30(%rbp), %rax
leaq -0x130(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
leaq -0x30(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x1e4(%rbp)
cmpl $0x28, %eax
ja 0x1c6ce
movq -0x1f0(%rbp), %rcx
movl -0x1e4(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x1f8(%rbp)
jmp 0x1c6eb
movq -0x1f0(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x1f8(%rbp)
movq -0x1f8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x70(%rbp)
leaq -0x30(%rbp), %rax
movq -0x10(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x1db40
movl %eax, -0x4(%rbp)
jmp 0x1c89e
leaq -0x30(%rbp), %rax
leaq -0x130(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
leaq -0x30(%rbp), %rax
movq %rax, -0x208(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x1fc(%rbp)
cmpl $0x28, %eax
ja 0x1c771
movq -0x208(%rbp), %rcx
movl -0x1fc(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x210(%rbp)
jmp 0x1c78e
movq -0x208(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x210(%rbp)
movq -0x210(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x74(%rbp)
leaq -0x30(%rbp), %rax
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1c842
movl -0x74(%rbp), %eax
movq %rax, -0x218(%rbp)
subq $0x3, %rax
ja 0x1c840
movq -0x218(%rbp), %rax
leaq 0xd320f(%rip), %rcx     # 0xef9e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movl (%rax), %ecx
andl $0xe00fffff, %ecx       # imm = 0xE00FFFFF
orl $0x100000, %ecx         # imm = 0x100000
movl %ecx, (%rax)
jmp 0x1c840
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movl (%rax), %ecx
andl $0xe00fffff, %ecx       # imm = 0xE00FFFFF
orl $0x1ff00000, %ecx       # imm = 0x1FF00000
movl %ecx, (%rax)
jmp 0x1c840
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movl (%rax), %ecx
andl $0xe00fffff, %ecx       # imm = 0xE00FFFFF
orl $0x800000, %ecx         # imm = 0x800000
movl %ecx, (%rax)
jmp 0x1c840
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movl (%rax), %ecx
andl $0xe00fffff, %ecx       # imm = 0xE00FFFFF
orl $0x900000, %ecx         # imm = 0x900000
movl %ecx, (%rax)
jmp 0x1c842
jmp 0x1c846
jmp 0x1c846
movq -0x10(%rbp), %rax
cmpl $0x6, 0x4c(%rax)
je 0x1c859
movl $0x0, -0x4(%rbp)
jmp 0x1c89e
leaq -0x30(%rbp), %rax
leaq -0x130(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movl -0x14(%rbp), %esi
leaq -0x30(%rbp), %rdx
callq 0x7a000
movl %eax, -0x18(%rbp)
leaq -0x30(%rbp), %rax
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopw (%rax,%rax)