// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/test/test-vcf-api.c
// Function: test_open_format
void test_open_format(void) {
    char mode[5];
    int ret;
    strcpy(mode, "r");
    ret = vcf_open_mode(mode+1, "mode1.bcf", NULL);
    if (strncmp(mode, "rb", 2) || ret)
        error("Mode '%s' does not match the expected value '%s'", mode, "rb");
    mode[1] = 0;
    ret = vcf_open_mode(mode+1, "mode1.vcf", NULL);
    if (strncmp(mode, "r", 1) || ret)
        error("Mode '%s' does not match the expected value '%s'", mode, "r");
    mode[1] = 0;
    ret = vcf_open_mode(mode+1, "mode1.vcf.gz", NULL);
    if (strncmp(mode, "rz", 2) || ret)
        error("Mode '%s' does not match the expected value '%s'", mode, "rz");
    mode[1] = 0;
    ret = vcf_open_mode(mode+1, "mode1.vcf.bgz", NULL);
    if (strncmp(mode, "rz", 2) || ret)
        error("Mode '%s' does not match the expected value '%s'", mode, "rz");
    mode[1] = 0;
    ret = vcf_open_mode(mode+1, "mode1.xcf", NULL);
    if (!ret)
        error("Expected failure for wrong extension 'xcf'");
    mode[1] = 0;
    ret = vcf_open_mode(mode+1, "mode1.vcf.gbz", NULL);
    if (!ret)
        error("Expected failure for wrong extension 'vcf.gbz'");
    mode[1] = 0;
    ret = vcf_open_mode(mode+1, "mode1.bvcf.bgz", NULL);
    if (!ret)
        error("Expected failure for wrong extension 'vcf.bvcf.bgz'");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq -0x5(%rbp), %rdi
leaq 0x1030f7(%rip), %rsi    # 0x10b79a
callq 0x4450
leaq -0x5(%rbp), %rdi
addq $0x1, %rdi
leaq 0xff774(%rip), %rsi     # 0x107e2b
xorl %eax, %eax
movl %eax, %edx
callq 0x4ae70
movl %eax, -0xc(%rbp)
leaq -0x5(%rbp), %rdi
leaq 0xfeffd(%rip), %rsi     # 0x1076cb
movl $0x2, %edx
callq 0x41f0
cmpl $0x0, %eax
jne 0x86e3
cmpl $0x0, -0xc(%rbp)
je 0x86fc
leaq -0x5(%rbp), %rsi
leaq 0xff747(%rip), %rdi     # 0x107e35
leaq 0xfefd6(%rip), %rdx     # 0x1076cb
movb $0x0, %al
callq 0x5ae0
movb $0x0, -0x4(%rbp)
leaq -0x5(%rbp), %rdi
addq $0x1, %rdi
leaq 0xff757(%rip), %rsi     # 0x107e66
xorl %eax, %eax
movl %eax, %edx
callq 0x4ae70
movl %eax, -0xc(%rbp)
leaq -0x5(%rbp), %rdi
leaq 0x103074(%rip), %rsi    # 0x10b79a
movl $0x1, %edx
callq 0x41f0
cmpl $0x0, %eax
jne 0x873b
cmpl $0x0, -0xc(%rbp)
je 0x8754
leaq -0x5(%rbp), %rsi
leaq 0xff6ef(%rip), %rdi     # 0x107e35
leaq 0x10304d(%rip), %rdx    # 0x10b79a
movb $0x0, %al
callq 0x5ae0
movb $0x0, -0x4(%rbp)
leaq -0x5(%rbp), %rdi
addq $0x1, %rdi
leaq 0xff709(%rip), %rsi     # 0x107e70
xorl %eax, %eax
movl %eax, %edx
callq 0x4ae70
movl %eax, -0xc(%rbp)
leaq -0x5(%rbp), %rdi
leaq 0xff6ff(%rip), %rsi     # 0x107e7d
movl $0x2, %edx
callq 0x41f0
cmpl $0x0, %eax
jne 0x8793
cmpl $0x0, -0xc(%rbp)
je 0x87ac
leaq -0x5(%rbp), %rsi
leaq 0xff697(%rip), %rdi     # 0x107e35
leaq 0xff6d8(%rip), %rdx     # 0x107e7d
movb $0x0, %al
callq 0x5ae0
movb $0x0, -0x4(%rbp)
leaq -0x5(%rbp), %rdi
addq $0x1, %rdi
leaq 0xff6c1(%rip), %rsi     # 0x107e80
xorl %eax, %eax
movl %eax, %edx
callq 0x4ae70
movl %eax, -0xc(%rbp)
leaq -0x5(%rbp), %rdi
leaq 0xff6a7(%rip), %rsi     # 0x107e7d
movl $0x2, %edx
callq 0x41f0
cmpl $0x0, %eax
jne 0x87eb
cmpl $0x0, -0xc(%rbp)
je 0x8804
leaq -0x5(%rbp), %rsi
leaq 0xff63f(%rip), %rdi     # 0x107e35
leaq 0xff680(%rip), %rdx     # 0x107e7d
movb $0x0, %al
callq 0x5ae0
movb $0x0, -0x4(%rbp)
leaq -0x5(%rbp), %rdi
addq $0x1, %rdi
leaq 0xff677(%rip), %rsi     # 0x107e8e
xorl %eax, %eax
movl %eax, %edx
callq 0x4ae70
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x8837
leaq 0xff668(%rip), %rdi     # 0x107e98
movb $0x0, %al
callq 0x5ae0
movb $0x0, -0x4(%rbp)
leaq -0x5(%rbp), %rdi
addq $0x1, %rdi
leaq 0xff679(%rip), %rsi     # 0x107ec3
xorl %eax, %eax
movl %eax, %edx
callq 0x4ae70
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x886a
leaq 0xff66e(%rip), %rdi     # 0x107ed1
movb $0x0, %al
callq 0x5ae0
movb $0x0, -0x4(%rbp)
leaq -0x5(%rbp), %rdi
addq $0x1, %rdi
leaq 0xff683(%rip), %rsi     # 0x107f00
xorl %eax, %eax
movl %eax, %edx
callq 0x4ae70
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x889d
leaq 0xff679(%rip), %rdi     # 0x107f0f
movb $0x0, %al
callq 0x5ae0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)