// File: /workspace/github_c_makefile_star2_O2/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 0x1156f
movl %eax, %ebx
pushq $0x1
popq %rdi
callq 0x11568
leaq 0x7e994(%rip), %rdi     # 0x865b0
leaq 0x818ec(%rip), %rsi     # 0x8950f
callq 0xa70f
testq %rax, %rax
je 0x7d35
movq %rax, %r14
callq 0x2849e
testq %rax, %rax
je 0x7d4a
movq %rax, %r15
movq %r14, %rdi
callq 0x27ba6
testq %rax, %rax
je 0x7d5f
movq %rax, %r12
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x288ae
testl %eax, %eax
jne 0x7d25
movq 0x8(%r15), %rsi
cmpq $0x5, %rsi
jne 0x7d77
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x288ae
testl %eax, %eax
jne 0x7d25
movq 0x8(%r15), %rsi
cmpq $0xa, %rsi
jne 0x7d80
leaq 0x4(%rsp), %rcx
movl $0x51c0fb9, (%rcx)      # imm = 0x51C0FB9
leaq 0x7e0f4(%rip), %rdx     # 0x85da7
pushq $0x1
popq %r8
movq %r12, %rdi
movq %r15, %rsi
movl %r8d, %r9d
callq 0x30f42
testl %eax, %eax
jne 0x7d89
movq 0x8(%r15), %rsi
cmpq $0x1, %rsi
jne 0x7d99
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x288ae
cmpl $-0x1, %eax
jne 0x7da7
movq %r15, %rdi
callq 0x28630
movq %r12, %rdi
callq 0x27a34
movq %r14, %rdi
callq 0xb8e5
testl %eax, %eax
jne 0x7db0
movl %ebx, %edi
callq 0x11568
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x7c35d(%rip), %rdi     # 0x84089
leaq 0x7e012(%rip), %rsi     # 0x85d45
jmp 0x7da0
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0x7df9e(%rip), %rdi     # 0x85ce6
jmp 0x7d72
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0x7dfa6(%rip), %rdi     # 0x85d03
jmp 0x7d72
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0x7dfb4(%rip), %rdi     # 0x85d26
movq %rax, %rsi
jmp 0x7da0
leaq 0x7dfde(%rip), %rdi     # 0x85d5c
jmp 0x7da0
leaq 0x7dffa(%rip), %rdi     # 0x85d81
jmp 0x7da0
leaq 0x7c2f9(%rip), %rdi     # 0x84089
leaq 0x7e014(%rip), %rsi     # 0x85dab
jmp 0x7da0
leaq 0x7e03e(%rip), %rdi     # 0x85dde
xorl %eax, %eax
callq 0x5abc
leaq 0x7e055(%rip), %rdi     # 0x85e03
jmp 0x7db7
leaq 0x7e07b(%rip), %rdi     # 0x85e32
movl %eax, %esi
xorl %eax, %eax
callq 0x5abc