// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movl $0x20, %edx
callq 0xd98c0
movq %rax, -0x48(%rbp)
cmpq $0x20, %rax
je 0x416db
cmpq $0x0, -0x48(%rbp)
jne 0x416cf
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x419bb
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x419bb
movq -0x18(%rbp), %rdi
callq 0x40be0
leaq -0x40(%rbp), %rdi
callq 0x45430
movl %eax, -0x4c(%rbp)
cmpl $0x18, -0x4c(%rbp)
jae 0x41702
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x419bb
movl -0x4c(%rbp), %eax
subl $0x18, %eax
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
addq $0x4, %rdi
callq 0x45430
movl %eax, -0x50(%rbp)
movq -0x18(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x58(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x41735
movl -0x4c(%rbp), %eax
movl %eax, -0x5c(%rbp)
jmp 0x4173f
movl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4173f
movq -0x58(%rbp), %rdi
movl -0x5c(%rbp), %eax
movl %eax, %eax
movl %eax, %esi
callq 0x44ba0
cmpl $0x0, %eax
je 0x41760
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x419bb
movq -0x18(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x68(%rbp)
cmpl $0x0, -0x50(%rbp)
je 0x4177a
movl -0x50(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0x41784
movl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x41784
movq -0x68(%rbp), %rdi
movl -0x6c(%rbp), %eax
movl %eax, %eax
movl %eax, %esi
callq 0x44ba0
cmpl $0x0, %eax
je 0x417a5
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x419bb
leaq -0x40(%rbp), %rdi
addq $0x8, %rdi
callq 0x453e0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
leaq -0x40(%rbp), %rdi
addq $0xc, %rdi
callq 0x45430
movl %eax, %eax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, (%rax)
jne 0x417ec
movq -0x18(%rbp), %rax
movq $-0x1, (%rax)
leaq -0x40(%rbp), %rdi
addq $0x10, %rdi
callq 0x453e0
movslq %eax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
leaq -0x40(%rbp), %rdi
addq $0x14, %rdi
callq 0x45440
movq -0x18(%rbp), %rax
movss %xmm0, 0x14(%rax)
leaq -0x40(%rbp), %rdi
addq $0x18, %rdi
callq 0x51ec0
movzwl %ax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, %ecx
movl %ecx, %edx
movq 0x18(%rax), %rcx
andq $0xffff, %rdx           # imm = 0xFFFF
andq $-0x10000, %rcx         # imm = 0xFFFF0000
orq %rdx, %rcx
movq %rcx, 0x18(%rax)
leaq -0x40(%rbp), %rdi
addq $0x1a, %rdi
callq 0x51ec0
movzwl %ax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, %ecx
movl %ecx, %edx
movq 0x18(%rax), %rcx
andq $0xffff, %rdx           # imm = 0xFFFF
shlq $0x10, %rdx
movabsq $-0xffff0001, %rsi      # imm = 0xFFFFFFFF0000FFFF
andq %rsi, %rcx
orq %rdx, %rcx
movq %rcx, 0x18(%rax)
leaq -0x40(%rbp), %rdi
addq $0x1c, %rdi
callq 0x45430
movl %eax, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
movq -0x18(%rbp), %rax
movl %ecx, %ecx
movl %ecx, %edx
movq 0x18(%rax), %rcx
andq $0xffffff, %rdx         # imm = 0xFFFFFF
shlq $0x28, %rdx
movabsq $0xffffffffff, %rsi     # imm = 0xFFFFFFFFFF
andq %rsi, %rcx
orq %rdx, %rcx
movq %rcx, 0x18(%rax)
movzbl -0x21(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, %ecx
movl %ecx, %edx
movq 0x18(%rax), %rcx
andq $0xff, %rdx
shlq $0x20, %rdx
movabsq $-0xff00000001, %rsi    # imm = 0xFFFFFF00FFFFFFFF
andq %rsi, %rcx
orq %rdx, %rcx
movq %rcx, 0x18(%rax)
movl -0x4c(%rbp), %eax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movl -0x50(%rbp), %eax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x4192b
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x28, %rax
cmpl $0x0, %eax
jne 0x4195c
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x20, %rax
andq $0xff, %rax
cmpl $0x0, %eax
je 0x4195c
movq -0x18(%rbp), %rax
movabsq $-0xff00000001, %rcx    # imm = 0xFFFFFF00FFFFFFFF
andq 0x18(%rax), %rcx
orq $0x0, %rcx
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
callq 0xd98c0
movq -0x18(%rbp), %rcx
cmpq 0x20(%rcx), %rax
je 0x41988
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x419bb
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdx
callq 0xd98c0
movq -0x18(%rbp), %rcx
cmpq 0x38(%rcx), %rax
je 0x419b4
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x419bb
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)