// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/htslib/hts.c
// Function: hts_format_description
char *hts_format_description(const htsFormat *format)
{
    kstring_t str = { 0, 0, NULL };

    switch (format->format) {
    case sam:   kputs("SAM", &str); break;
    case bam:   kputs("BAM", &str); break;
    case cram:  kputs("CRAM", &str); break;
    case vcf:   kputs("VCF", &str); break;
    case bcf:
        if (format->version.major == 1) kputs("Legacy BCF", &str);
        else kputs("BCF", &str);
        break;
    case bai:   kputs("BAI", &str); break;
    case crai:  kputs("CRAI", &str); break;
    case csi:   kputs("CSI", &str); break;
    case tbi:   kputs("Tabix", &str); break;
    default:    kputs("unknown", &str); break;
    }

    if (format->version.major >= 0) {
        kputs(" version ", &str);
        kputw(format->version.major, &str);
        if (format->version.minor >= 0) {
            kputc('.', &str);
            kputw(format->version.minor, &str);
        }
    }

    switch (format->compression) {
    case custom: kputs(" compressed", &str); break;
    case gzip:   kputs(" gzip-compressed", &str); break;
    case bgzf:
        switch (format->format) {
        case bam:
        case bcf:
        case csi:
        case tbi:
            // These are by definition BGZF, so just use the generic term
            kputs(" compressed", &str);
            break;
        default:
            kputs(" BGZF-compressed", &str);
            break;
        }
        break;
    default: break;
    }

    switch (format->category) {
    case sequence_data: kputs(" sequence", &str); break;
    case variant_data:  kputs(" variant calling", &str); break;
    case index_file:    kputs(" index", &str); break;
    case region_list:   kputs(" genomic region", &str); break;
    default: break;
    }

    if (format->compression == no_compression)
        switch (format->format) {
        case sam:
        case crai:
        case vcf:
        case bed:
            kputs(" text", &str);
            break;

        default:
            kputs(" data", &str);
            break;
        }
    else
        kputs(" data", &str);

    return ks_release(&str);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl 0x4(%rdi), %eax
addl $-0x3, %eax
cmpl $0x9, %eax
ja 0x469cb
leaq 0x407ff(%rip), %rcx     # 0x87160
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x40eb7(%rip), %rdi     # 0x87828
jmp 0x469d2
leaq 0x40a36(%rip), %rdi     # 0x873b0
jmp 0x469d2
leaq 0x40a12(%rip), %rdi     # 0x87395
jmp 0x469d2
leaq 0x40a15(%rip), %rdi     # 0x873a1
jmp 0x469d2
cmpw $0x1, 0x8(%rbx)
leaq 0x40a0b(%rip), %rax     # 0x873a5
leaq 0x40a0b(%rip), %rdi     # 0x873ac
cmoveq %rax, %rdi
jmp 0x469d2
leaq 0x40a0b(%rip), %rdi     # 0x873b9
jmp 0x469d2
leaq 0x409bd(%rip), %rdi     # 0x87374
jmp 0x469d2
leaq 0x409f4(%rip), %rdi     # 0x873b4
jmp 0x469d2
leaq 0x409f4(%rip), %rdi     # 0x873bd
jmp 0x469d2
leaq 0x3b9fa(%rip), %rdi     # 0x823cc
movq %rsp, %rsi
callq 0x46b34
cmpw $0x0, 0x8(%rbx)
js 0x46a84
leaq 0x409d7(%rip), %rdi     # 0x873c3
movq %rsp, %r14
movq %r14, %rsi
callq 0x46b34
movswl 0x8(%rbx), %edi
movq %r14, %rsi
callq 0x46bcd
cmpw $0x0, 0xa(%rbx)
js 0x46a84
movq (%rsp), %r14
leaq 0x1(%r14), %r15
cmpq 0x8(%rsp), %r15
jae 0x46a20
movq 0x10(%rsp), %rax
jmp 0x46a6d
movq %r15, %rax
shrq %rax
orq %r15, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0x6c80
testq %rax, %rax
je 0x46a78
movq %rax, 0x10(%rsp)
movq %r15, (%rsp)
movw $0x2e, (%rax,%r14)
movswl 0xa(%rbx), %edi
movq %rsp, %rsi
callq 0x46bcd
movl 0xc(%rbx), %eax
cmpl $0x3, %eax
je 0x46abc
cmpl $0x2, %eax
je 0x46a9f
cmpl $0x1, %eax
jne 0x46ad4
leaq 0x4093c(%rip), %rdi     # 0x873d9
jmp 0x46acc
movl 0x4(%rbx), %eax
addl $-0x4, %eax
cmpl $0x8, %eax
ja 0x46ac5
movl %eax, %eax
leaq 0x4085d(%rip), %rcx     # 0x87310
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
jmp 0x46acc
leaq 0x4090a(%rip), %rdi     # 0x873cd
jmp 0x46acc
leaq 0x4091e(%rip), %rdi     # 0x873ea
movq %rsp, %rsi
callq 0x46b34
movl (%rbx), %eax
decl %eax
cmpl $0x3, %eax
ja 0x46af5
movl %eax, %eax
leaq 0x4084e(%rip), %rcx     # 0x87334
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
movq %rsp, %rsi
callq 0x46b34
leaq 0x40930(%rip), %rdi     # 0x8742c
cmpl $0x0, 0xc(%rbx)
jne 0x46b1b
movl 0x4(%rbx), %eax
cmpl $0xd, %eax
ja 0x46b1b
movl $0x2188, %ecx           # imm = 0x2188
btl %eax, %ecx
jae 0x46b1b
leaq 0x4090b(%rip), %rdi     # 0x87426
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x46b34
movq 0x10(%rbx), %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq