// File: /workspace/github_c_makefile_star2_O0/zhou-lab[P]tbmate/htslib/hts.c
// Function: hts_parse_format
int hts_parse_format(htsFormat *format, const char *str) {
    char fmt[8];
    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, "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 {
        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 -0x20(%rbp), %rdx
movl $0x2c, %esi
movl $0x8, %ecx
callq 0xf740
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movw $0x0, 0xa(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x8(%rax)
leaq -0x20(%rbp), %rdi
leaq 0x672cb(%rip), %rsi     # 0x76895
callq 0x3620
cmpl $0x0, %eax
jne 0xf603
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 0xf71e
leaq -0x20(%rbp), %rdi
leaq 0x6728b(%rip), %rsi     # 0x76899
callq 0x3620
cmpl $0x0, %eax
jne 0xf647
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 0xf71c
leaq -0x20(%rbp), %rdi
leaq 0x6724b(%rip), %rsi     # 0x7689d
callq 0x3620
cmpl $0x0, %eax
jne 0xf68b
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 0xf71a
leaq -0x20(%rbp), %rdi
leaq 0x67269(%rip), %rsi     # 0x768ff
callq 0x3620
cmpl $0x0, %eax
jne 0xf6cc
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 0xf718
leaq -0x20(%rbp), %rdi
leaq 0x6722d(%rip), %rsi     # 0x76904
callq 0x3620
cmpl $0x0, %eax
jne 0xf70d
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 0xf716
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xf72e
jmp 0xf718
jmp 0xf71a
jmp 0xf71c
jmp 0xf71e
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xf3c0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)