// File: /workspace/github_c_makefile_star2_O1/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 0x8d9e5
testq %rax, %rax
je 0x31067
cmpq $0x20, %rax
jne 0x3106e
movq %rbx, %rdi
callq 0x30842
movl (%rsp), %eax
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
cmpl $0x18, %eax
jb 0x31073
leal -0x18(%rax), %r13d
movl 0x4(%rsp), %r12d
cmpl $0x1, %r13d
adcl $-0x18, %eax
cmpq %rax, 0x28(%rbx)
jae 0x30f2d
movl %eax, %r15d
shrl %r15d
addq %rax, %r15
movq 0x30(%rbx), %rdi
movq %r15, %rsi
callq 0x4860
testq %rax, %rax
je 0x31073
movq %rax, 0x30(%rbx)
movq %r15, 0x28(%rbx)
cmpl $0x2, %r12d
movl $0x1, %eax
cmovael %r12d, %eax
cmpq %rax, 0x40(%rbx)
jae 0x30f66
movl %eax, %r15d
shrl %r15d
addq %rax, %r15
movq 0x48(%rbx), %rdi
movq %r15, %rsi
callq 0x4860
testq %rax, %rax
je 0x31073
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)
movq 0x18(%rbx), %rax
movw 0x18(%rsp), %ax
movq %rax, 0x18(%rbx)
movzwl 0x1a(%rsp), %ecx
shll $0x10, %ecx
movabsq $-0xffff0001, %rdx      # imm = 0xFFFFFFFF0000FFFF
andq %rax, %rdx
orq %rcx, %rdx
movq %rdx, 0x18(%rbx)
movl 0x1c(%rsp), %ecx
movq %rcx, %rax
shlq $0x28, %rax
movabsq $0xffffffffff, %rsi     # imm = 0xFFFFFFFFFF
andq %rdx, %rsi
orq %rax, %rsi
movq %rsi, 0x18(%rbx)
movb 0x1f(%rsp), %al
movzbl %al, %edi
movq %rdi, %rdx
shlq $0x20, %rdx
movabsq $-0xff00000001, %rax    # imm = 0xFFFFFF00FFFFFFFF
andq %rsi, %rax
orq %rax, %rdx
movq %rdx, 0x18(%rbx)
movl %r13d, %edx
movq %rdx, 0x20(%rbx)
movq %r12, 0x38(%rbx)
testq %r12, %r12
setne %sil
testl $0xffffff, %ecx         # imm = 0xFFFFFF
setne %cl
andb %sil, %cl
testb %dil, %dil
sete %sil
orb %cl, %sil
jne 0x31033
movq %rax, 0x18(%rbx)
movq 0x30(%rbx), %rsi
movq %r14, %rdi
callq 0x8d9e5
cmpq 0x20(%rbx), %rax
jne 0x31073
movq 0x38(%rbx), %rdx
movq 0x48(%rbx), %rsi
movq %r14, %rdi
callq 0x8d9e5
xorl %ecx, %ecx
cmpq 0x38(%rbx), %rax
sete %cl
leal -0x2(,%rcx,2), %ebp
jmp 0x31073
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x31073
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq