// File: /workspace/github_c_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %rsi
movl $0x20, %edx
callq 0x8b99c
testq %rax, %rax
je 0x2fe8c
cmpq $0x20, %rax
jne 0x2fe93
movq %rbx, %rdi
callq 0x2f6ad
movl (%rsp), %eax
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
cmpl $0x18, %eax
jb 0x2fe98
leal -0x18(%rax), %r13d
movl 0x4(%rsp), %r12d
cmpl $0x1, %r13d
adcl $-0x18, %eax
cmpq %rax, 0x28(%rbx)
jae 0x2fd98
movl %eax, %r15d
shrl %r15d
addq %rax, %r15
movq 0x30(%rbx), %rdi
movq %r15, %rsi
callq 0x4860
testq %rax, %rax
je 0x2fe98
movq %rax, 0x30(%rbx)
movq %r15, 0x28(%rbx)
cmpl $0x2, %r12d
movl $0x1, %eax
cmovael %r12d, %eax
cmpq %rax, 0x40(%rbx)
jae 0x2fdd1
movl %eax, %r15d
shrl %r15d
addq %rax, %r15
movq 0x48(%rbx), %rdi
movq %r15, %rsi
callq 0x4860
testq %rax, %rax
je 0x2fe98
movq %rax, 0x48(%rbx)
movq %r15, 0x40(%rbx)
movl 0x8(%rsp), %eax
movl %eax, 0x10(%rbx)
movl 0xc(%rsp), %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
movq $-0x1, %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 %r13d, %edx
movq %rdx, 0x20(%rbx)
movq %r12, 0x38(%rbx)
testq %r12, %r12
setne %cl
testl $0xffffff, %esi         # imm = 0xFFFFFF
setne %dil
andb %cl, %dil
cmpl $0x1000000, %esi        # imm = 0x1000000
setb %cl
orb %dil, %cl
jne 0x2fe58
movq %rax, 0x18(%rbx)
movq 0x30(%rbx), %rsi
movq %r14, %rdi
callq 0x8b99c
cmpq 0x20(%rbx), %rax
jne 0x2fe98
movq 0x38(%rbx), %rdx
movq 0x48(%rbx), %rsi
movq %r14, %rdi
callq 0x8b99c
xorl %ecx, %ecx
cmpq 0x38(%rbx), %rax
sete %cl
leal -0x2(,%rcx,2), %ebp
jmp 0x2fe98
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x2fe98
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq