// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_read1_core
static inline int bcf_read1_core(BGZF *fp, bcf1_t *v)
{
    uint8_t x[32];
    ssize_t ret;
    uint32_t shared_len, indiv_len;
    if ((ret = bgzf_read(fp, x, 32)) != 32) {
        if (ret == 0) return -1;
        return -2;
    }
    bcf_clear1(v);
    shared_len = le_to_u32(x);
    if (shared_len < 24) return -2;
    shared_len -= 24; // to exclude six 32-bit integers
    indiv_len = le_to_u32(x + 4);
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    // ks_resize() normally allocates 1.5 * requested size to allow for growth
    if ((uint64_t) shared_len + indiv_len > FUZZ_ALLOC_LIMIT / 3 * 2) return -2;
#endif
    if (ks_resize(&v->shared, shared_len ? shared_len : 1) != 0) return -2;
    if (ks_resize(&v->indiv, indiv_len ? indiv_len : 1) != 0) return -2;
    v->rid  = le_to_i32(x + 8);
    v->pos  = le_to_u32(x + 12);
    if ( v->pos==UINT32_MAX ) v->pos = -1;  // this is for telomere coordinate, e.g. MT:0
    v->rlen = le_to_i32(x + 16);
    v->qual = le_to_float(x + 20);
    v->n_info = le_to_u16(x + 24);
    v->n_allele = le_to_u16(x + 26);
    v->n_sample = le_to_u32(x + 28) & 0xffffff;
    v->n_fmt = x[31];
    v->shared.l = shared_len;
    v->indiv.l = indiv_len;
    // silent fix of broken BCFs produced by earlier versions of bcf_subset, prior to and including bd6ed8b4
    if ( (!v->indiv.l || !v->n_sample) && v->n_fmt ) v->n_fmt = 0;

    if (bgzf_read(fp, v->shared.s, v->shared.l) != v->shared.l) return -2;
    if (bgzf_read(fp, v->indiv.s, v->indiv.l) != v->indiv.l) return -2;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %rsi
pushq $0x20
popq %rdx
callq 0x6af65
testq %rax, %rax
je 0x2659d
cmpq $0x20, %rax
jne 0x265a1
movq %rbx, %rdi
callq 0x25fcb
movl (%rsp), %esi
pushq $-0x2
popq %rbp
cmpl $0x18, %esi
jb 0x265a4
leal -0x18(%rsi), %r12d
movl 0x4(%rsp), %r15d
leaq 0x20(%rbx), %rdi
cmpl $0x1, %r12d
adcl $-0x18, %esi
callq 0x2811b
testl %eax, %eax
jne 0x265a4
leaq 0x38(%rbx), %rdi
cmpl $0x2, %r15d
pushq $0x1
popq %rsi
cmovael %r15d, %esi
callq 0x2811b
testl %eax, %eax
jne 0x265a4
movl 0x8(%rsp), %eax
movl %eax, 0x10(%rbx)
movl 0xc(%rsp), %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
pushq $-0x1
popq %rcx
cmovneq %rax, %rcx
movq %rcx, (%rbx)
movslq 0x10(%rsp), %rax
movq %rax, 0x8(%rbx)
movss 0x14(%rsp), %xmm0
movss %xmm0, 0x14(%rbx)
movl 0x18(%rsp), %ecx
movl 0x1c(%rsp), %esi
movq %rsi, %rax
shlq $0x28, %rax
orq %rcx, %rax
movl %esi, %ecx
shrl $0x18, %ecx
shlq $0x20, %rcx
orq %rax, %rcx
movq %rcx, 0x18(%rbx)
movl %r12d, %edx
movq %rdx, 0x20(%rbx)
movq %r15, 0x38(%rbx)
testq %r15, %r15
setne %cl
testl $0xffffff, %esi         # imm = 0xFFFFFF
setne %dil
andb %cl, %dil
cmpl $0x1000000, %esi        # imm = 0x1000000
setb %cl
orb %dil, %cl
jne 0x26569
movq %rax, 0x18(%rbx)
movq 0x30(%rbx), %rsi
movq %r14, %rdi
callq 0x6af65
cmpq 0x20(%rbx), %rax
jne 0x265a4
movq 0x38(%rbx), %rdx
movq 0x48(%rbx), %rsi
movq %r14, %rdi
callq 0x6af65
xorl %ecx, %ecx
cmpq 0x38(%rbx), %rax
sete %cl
leal -0x2(,%rcx,2), %ebp
jmp 0x265a4
pushq $-0x1
jmp 0x265a3
pushq $-0x2
popq %rbp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq