// File: karel-brinda[P]ococo/ext/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x20(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
addl $-0x3, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x9, %eax
ja 0x12605
movq -0x28(%rbp), %rax
leaq 0x685d1(%rip), %rcx     # 0x7ab00
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x68818(%rip), %rdi     # 0x7ad57
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12615
leaq 0x68807(%rip), %rdi     # 0x7ad5b
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12615
leaq 0x6879e(%rip), %rdi     # 0x7ad07
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12615
leaq 0x687b9(%rip), %rdi     # 0x7ad37
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12615
movq -0x8(%rbp), %rax
movswl 0x8(%rax), %eax
cmpl $0x1, %eax
jne 0x125ab
leaq 0x687bf(%rip), %rdi     # 0x7ad5f
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x125bb
leaq 0x687b4(%rip), %rdi     # 0x7ad66
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12615
leaq 0x687a6(%rip), %rdi     # 0x7ad6a
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12615
leaq 0x68798(%rip), %rdi     # 0x7ad6e
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12615
leaq 0x6878b(%rip), %rdi     # 0x7ad73
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12615
leaq 0x6877d(%rip), %rdi     # 0x7ad77
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12615
leaq 0x6bcb5(%rip), %rdi     # 0x7e2c1
leaq -0x20(%rbp), %rsi
callq 0x127f0
movq -0x8(%rbp), %rax
movswl 0x8(%rax), %eax
cmpl $0x0, %eax
jl 0x12671
leaq 0x68754(%rip), %rdi     # 0x7ad7d
leaq -0x20(%rbp), %rsi
callq 0x127f0
movq -0x8(%rbp), %rax
movswl 0x8(%rax), %edi
leaq -0x20(%rbp), %rsi
callq 0x12830
movq -0x8(%rbp), %rax
movswl 0xa(%rax), %eax
cmpl $0x0, %eax
jl 0x1266f
movl $0x2e, %edi
leaq -0x20(%rbp), %rsi
callq 0x12940
movq -0x8(%rbp), %rax
movswl 0xa(%rax), %edi
leaq -0x20(%rbp), %rsi
callq 0x12830
jmp 0x12671
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x2c(%rbp)
subl $0x1, %eax
je 0x126a8
jmp 0x12682
movl -0x2c(%rbp), %eax
subl $0x2, %eax
je 0x126ba
jmp 0x1268c
movl -0x2c(%rbp), %eax
subl $0x3, %eax
jne 0x12706
jmp 0x12696
leaq 0x686ea(%rip), %rdi     # 0x7ad87
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12708
leaq 0x686e4(%rip), %rdi     # 0x7ad93
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12708
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x30(%rbp)
subl $0x4, %eax
je 0x126e2
jmp 0x126cb
movl -0x30(%rbp), %eax
addl $-0x9, %eax
subl $0x2, %eax
jb 0x126e2
jmp 0x126d8
movl -0x30(%rbp), %eax
subl $0xc, %eax
jne 0x126f4
jmp 0x126e2
leaq 0x6869e(%rip), %rdi     # 0x7ad87
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12704
leaq 0x686a9(%rip), %rdi     # 0x7ada4
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12708
jmp 0x12708
movq -0x8(%rbp), %rax
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x3, %eax
ja 0x12777
movq -0x38(%rbp), %rax
leaq 0x68402(%rip), %rcx     # 0x7ab28
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x6867f(%rip), %rdi     # 0x7adb5
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12779
leaq 0x68677(%rip), %rdi     # 0x7adbf
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12779
leaq 0x68676(%rip), %rdi     # 0x7add0
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12779
leaq 0x6866b(%rip), %rdi     # 0x7add7
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x12779
jmp 0x12779
movq -0x8(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x127cf
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x3c(%rbp)
subl $0x3, %eax
je 0x127ab
jmp 0x12794
movl -0x3c(%rbp), %eax
addl $-0x7, %eax
subl $0x2, %eax
jb 0x127ab
jmp 0x127a1
movl -0x3c(%rbp), %eax
subl $0xd, %eax
jne 0x127bd
jmp 0x127ab
leaq 0x68635(%rip), %rdi     # 0x7ade7
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x127cd
leaq 0x68629(%rip), %rdi     # 0x7aded
leaq -0x20(%rbp), %rsi
callq 0x127f0
jmp 0x127df
leaq 0x68617(%rip), %rdi     # 0x7aded
leaq -0x20(%rbp), %rsi
callq 0x127f0
leaq -0x20(%rbp), %rdi
callq 0x129c0
addq $0x40, %rsp
popq %rbp
retq
nop