// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hts.c
// Function: hts_parse_format
int hts_parse_format(htsFormat *format, const char *str) {
    char fmt[9];
    const char *cp = scan_keyword(str, ',', fmt, sizeof fmt);

    format->version.minor = 0; // unknown
    format->version.major = 0; // unknown

    if (strcmp(fmt, "sam") == 0) {
        format->category          = sequence_data;
        format->format            = sam;
        format->compression       = no_compression;
        format->compression_level = 0;
    } else if (strcmp(fmt, "sam.gz") == 0) {
        format->category          = sequence_data;
        format->format            = sam;
        format->compression       = bgzf;
        format->compression_level = -1;
    } else if (strcmp(fmt, "bam") == 0) {
        format->category          = sequence_data;
        format->format            = bam;
        format->compression       = bgzf;
        format->compression_level = -1;
    } else if (strcmp(fmt, "cram") == 0) {
        format->category          = sequence_data;
        format->format            = cram;
        format->compression       = custom;
        format->compression_level = -1;
    } else if (strcmp(fmt, "vcf") == 0) {
        format->category          = variant_data;
        format->format            = vcf;
        format->compression       = no_compression;
        format->compression_level = 0;
    } else if (strcmp(fmt, "bcf") == 0) {
        format->category          = variant_data;
        format->format            = bcf;
        format->compression       = bgzf;
        format->compression_level = -1;
    } else if (strcmp(fmt, "fastq") == 0 || strcmp(fmt, "fq") == 0) {
        format->category          = sequence_data;
        format->format            = fastq_format;
        format->compression       = no_compression;
        format->compression_level = 0;
    } else if (strcmp(fmt, "fastq.gz") == 0 || strcmp(fmt, "fq.gz") == 0) {
        format->category          = sequence_data;
        format->format            = fastq_format;
        format->compression       = bgzf;
        format->compression_level = 0;
    } else if (strcmp(fmt, "fasta") == 0 || strcmp(fmt, "fa") == 0) {
        format->category          = sequence_data;
        format->format            = fasta_format;
        format->compression       = no_compression;
        format->compression_level = 0;
    } else if (strcmp(fmt, "fasta.gz") == 0 || strcmp(fmt, "fa.gz") == 0) {
        format->category          = sequence_data;
        format->format            = fasta_format;
        format->compression       = bgzf;
        format->compression_level = 0;
    } else {
        return -1;
    }

    return hts_parse_opt_list(format, cp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x21(%rbp), %rdx
movl $0x2c, %esi
movl $0x9, %ecx
callq 0x1ce30
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movw $0x0, 0xa(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x8(%rax)
leaq -0x21(%rbp), %rdi
leaq 0xd611f(%rip), %rsi     # 0xf2c29
callq 0x4690
cmpl $0x0, %eax
jne 0x1cb43
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movl $0x3, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x10(%rax)
jmp 0x1ce10
leaq -0x21(%rbp), %rdi
leaq 0xd3928(%rip), %rsi     # 0xf0476
callq 0x4690
cmpl $0x0, %eax
jne 0x1cb87
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movl $0x3, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x2, 0xc(%rax)
movq -0x10(%rbp), %rax
movw $0xffff, 0x10(%rax)     # imm = 0xFFFF
jmp 0x1ce0e
leaq -0x21(%rbp), %rdi
leaq 0xd38eb(%rip), %rsi     # 0xf047d
callq 0x4690
cmpl $0x0, %eax
jne 0x1cbcb
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movl $0x4, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x2, 0xc(%rax)
movq -0x10(%rbp), %rax
movw $0xffff, 0x10(%rax)     # imm = 0xFFFF
jmp 0x1ce0c
leaq -0x21(%rbp), %rdi
leaq 0xd3c34(%rip), %rsi     # 0xf080a
callq 0x4690
cmpl $0x0, %eax
jne 0x1cc0f
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movl $0x6, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x3, 0xc(%rax)
movq -0x10(%rbp), %rax
movw $0xffff, 0x10(%rax)     # imm = 0xFFFF
jmp 0x1ce0a
leaq -0x21(%rbp), %rdi
leaq 0xd3a33(%rip), %rsi     # 0xf064d
callq 0x4690
cmpl $0x0, %eax
jne 0x1cc53
movq -0x10(%rbp), %rax
movl $0x2, (%rax)
movq -0x10(%rbp), %rax
movl $0x8, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x10(%rax)
jmp 0x1ce08
leaq -0x21(%rbp), %rdi
leaq 0xd39f4(%rip), %rsi     # 0xf0652
callq 0x4690
cmpl $0x0, %eax
jne 0x1cc97
movq -0x10(%rbp), %rax
movl $0x2, (%rax)
movq -0x10(%rbp), %rax
movl $0x9, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x2, 0xc(%rax)
movq -0x10(%rbp), %rax
movw $0xffff, 0x10(%rax)     # imm = 0xFFFF
jmp 0x1ce06
leaq -0x21(%rbp), %rdi
leaq 0xd37df(%rip), %rsi     # 0xf0481
callq 0x4690
cmpl $0x0, %eax
je 0x1ccc1
leaq -0x21(%rbp), %rdi
leaq 0xd37d0(%rip), %rsi     # 0xf0487
callq 0x4690
cmpl $0x0, %eax
jne 0x1ccf0
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movl $0x11, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x10(%rax)
jmp 0x1ce04
leaq -0x21(%rbp), %rdi
leaq 0xd378f(%rip), %rsi     # 0xf048a
callq 0x4690
cmpl $0x0, %eax
je 0x1cd1a
leaq -0x21(%rbp), %rdi
leaq 0xd3783(%rip), %rsi     # 0xf0493
callq 0x4690
cmpl $0x0, %eax
jne 0x1cd49
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movl $0x11, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x2, 0xc(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x10(%rax)
jmp 0x1ce02
leaq -0x21(%rbp), %rdi
leaq 0xd3745(%rip), %rsi     # 0xf0499
callq 0x4690
cmpl $0x0, %eax
je 0x1cd73
leaq -0x21(%rbp), %rdi
leaq 0xd3736(%rip), %rsi     # 0xf049f
callq 0x4690
cmpl $0x0, %eax
jne 0x1cd9f
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movl $0x10, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x10(%rax)
jmp 0x1ce00
leaq -0x21(%rbp), %rdi
leaq 0xd36f8(%rip), %rsi     # 0xf04a2
callq 0x4690
cmpl $0x0, %eax
je 0x1cdc9
leaq -0x21(%rbp), %rdi
leaq 0xd36ec(%rip), %rsi     # 0xf04ab
callq 0x4690
cmpl $0x0, %eax
jne 0x1cdf5
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movl $0x10, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x2, 0xc(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x10(%rax)
jmp 0x1cdfe
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1ce20
jmp 0x1ce00
jmp 0x1ce02
jmp 0x1ce04
jmp 0x1ce06
jmp 0x1ce08
jmp 0x1ce0a
jmp 0x1ce0c
jmp 0x1ce0e
jmp 0x1ce10
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x1c900
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)