// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/test-vcf-api.c
// Function: test_invalid_end_tag
void test_invalid_end_tag(void)
{
    static const char vcf_data[] = "data:,"
        "##fileformat=VCFv4.1\n"
        "##contig=<ID=X,length=155270560>\n"
        "##INFO=<ID=END,Number=1,Type=Integer,Description=\"End coordinate of this variant\">\n"
        "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\n"
        "X\t86470037\trs59780433a\tTTTCA\tTGGTT,T\t.\t.\tEND=85725113\n"
        "X\t86470038\trs59780433b\tT\tTGGTT,T\t.\t.\tEND=86470047\n";

    htsFile *fp;
    bcf_hdr_t *hdr;
    bcf1_t *rec;
    int ret;
    int32_t tmpi;
    enum htsLogLevel logging = hts_get_log_level();

    // Silence warning messages
    hts_set_log_level(HTS_LOG_ERROR);

    fp = hts_open(vcf_data, "r");
    if (!fp) error("Failed to open vcf data : %s", strerror(errno));
    rec = bcf_init1();
    if (!rec) error("Failed to allocate BCF record : %s", strerror(errno));

    hdr = bcf_hdr_read(fp);
    if (!hdr) error("Failed to read BCF header : %s", strerror(errno));

    check0(bcf_read(fp, hdr, rec));
    // rec->rlen should ignore the bogus END tag value on the first read
    if (rec->rlen != 5) {
        error("Incorrect rlen - expected 5 got %"PRIhts_pos"\n", rec->rlen);
    }

    check0(bcf_read(fp, hdr, rec));
    // While on the second it should use it
    if (rec->rlen != 10) {
        error("Incorrect rlen - expected 10 got %"PRIhts_pos"\n", rec->rlen);
    }

    // Try to break it - will change rlen
    tmpi = 85725113;
    check0(bcf_update_info_int32(hdr, rec, "END", &tmpi, 1));

    if (rec->rlen != 1) {
        error("Incorrect rlen - expected 1 got %"PRIhts_pos"\n", rec->rlen);
    }

    ret = bcf_read(fp, hdr, rec);
    if (ret != -1) {
        error("Unexpected return code %d from bcf_read at EOF", ret);
    }

    bcf_destroy1(rec);
    bcf_hdr_destroy(hdr);
    ret = hts_close(fp);
    if (ret != 0) {
        error("Unexpected return code %d from hts_close", ret);
    }

    hts_set_log_level(logging);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
callq 0x13c8a
movl %eax, %ebx
movl $0x1, %edi
callq 0x13c83
leaq 0xa43fd(%rip), %rdi     # 0xac5b0
leaq 0xa738a(%rip), %rsi     # 0xaf544
callq 0xbbc0
testq %rax, %rax
je 0x82d1
movq %rax, %r14
callq 0x31d1e
testq %rax, %rax
je 0x82e6
movq %rax, %r15
movq %r14, %rdi
callq 0x30c97
testq %rax, %rax
je 0x82fb
movq %rax, %r12
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x322f9
testl %eax, %eax
jne 0x82c1
movq 0x8(%r15), %rsi
cmpq $0x5, %rsi
jne 0x8313
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x322f9
testl %eax, %eax
jne 0x82c1
movq 0x8(%r15), %rsi
cmpq $0xa, %rsi
jne 0x831c
leaq 0x4(%rsp), %rcx
movl $0x51c0fb9, (%rcx)      # imm = 0x51C0FB9
leaq 0xa3b5d(%rip), %rdx     # 0xabda7
movq %r12, %rdi
movq %r15, %rsi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x8325
movq 0x8(%r15), %rsi
cmpq $0x1, %rsi
jne 0x8335
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x322f9
cmpl $-0x1, %eax
jne 0x8343
movq %r15, %rdi
callq 0x31ec9
movq %r12, %rdi
callq 0x30af4
movq %r14, %rdi
callq 0xce22
testl %eax, %eax
jne 0x834c
movl %ebx, %edi
callq 0x13c83
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xa1dc1(%rip), %rdi     # 0xaa089
leaq 0xa3a76(%rip), %rsi     # 0xabd45
jmp 0x833c
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa3a02(%rip), %rdi     # 0xabce6
jmp 0x830e
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa3a0a(%rip), %rdi     # 0xabd03
jmp 0x830e
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa3a18(%rip), %rdi     # 0xabd26
movq %rax, %rsi
jmp 0x833c
leaq 0xa3a42(%rip), %rdi     # 0xabd5c
jmp 0x833c
leaq 0xa3a5e(%rip), %rdi     # 0xabd81
jmp 0x833c
leaq 0xa1d5d(%rip), %rdi     # 0xaa089
leaq 0xa3a78(%rip), %rsi     # 0xabdab
jmp 0x833c
leaq 0xa3aa2(%rip), %rdi     # 0xabdde
xorl %eax, %eax
callq 0x602c
leaq 0xa3ab9(%rip), %rdi     # 0xabe03
jmp 0x8353
leaq 0xa3adf(%rip), %rdi     # 0xabe32
movl %eax, %esi
xorl %eax, %eax
callq 0x602c