// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_fmt_array1
static inline int bcf_fmt_array1(kstring_t *s, int type, void *data) {
    uint32_t e = 0;
    uint8_t *p = (uint8_t *)data;
    int32_t v;

    // helps gcc more than clang here. In billions of cycles:
    //          bcf_fmt_array1  bcf_fmt_array
    // gcc7:    23.2            24.3
    // gcc13:   21.6            23.0
    // clang13: 27.1            27.8
    switch (type) {
    case BCF_BT_CHAR:
        e |= kputc_(*p == bcf_str_missing ? '.' : *p, s) < 0;
        break;

    case BCF_BT_INT8:
        if (*(int8_t *)p != bcf_int8_vector_end) {
            e |= ((*(int8_t *)p == bcf_int8_missing)
                  ? kputc_('.', s)
                  : kputw(*(int8_t *)p, s)) < 0;
        }
        break;
    case BCF_BT_INT16:
        v = le_to_i16(p);
        if (v != bcf_int16_vector_end) {
            e |= (v == bcf_int16_missing
                  ? kputc_('.', s)
                  : kputw(v, s)) < 0;
        }
        break;

    case BCF_BT_INT32:
        v = le_to_i32(p);
        if (v != bcf_int32_vector_end) {
            e |= (v == bcf_int32_missing
                  ? kputc_('.', s)
                  : kputw(v, s)) < 0;
        }
        break;

    case BCF_BT_FLOAT:
        v = le_to_u32(p);
        if (v != bcf_float_vector_end) {
            e |= (v == bcf_float_missing
                  ? kputc_('.', s)
                  : kputd(le_to_float(p), s)) < 0;
        }
        break;

    default:
        hts_log_error("Unexpected type %d", type);
        return -1;
    }

    return e == 0 ? 0 : -1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ecx
leal -0x1(%rcx), %eax
cmpl $0x6, %eax
ja 0x3bc8a
movq %rdi, %rbx
leaq 0x722ad(%rip), %rsi     # 0xadf04
movslq (%rsi,%rax,4), %rax
addq %rsi, %rax
jmpq *%rax
movzbl (%rdx), %eax
cmpl $0x81, %eax
je 0x3be64
cmpl $0x80, %eax
je 0x3bdb3
movsbl %al, %ebp
testb %bpl, %bpl
jns 0x3bd8b
jmp 0x3bd33
leaq 0x743a5(%rip), %rsi     # 0xb0036
leaq 0x72ffb(%rip), %rdx     # 0xaec93
movl $0x1, %edi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x9774
movl (%rdx), %edi
cmpl $0x80000001, %edi       # imm = 0x80000001
je 0x3be64
movl %edi, %ebp
negl %ebp
jo 0x3bdb3
testl %edi, %edi
jns 0x3bd8d
movq (%rbx), %rax
addq $0x3, %rax
cmpq %rax, 0x8(%rbx)
jae 0x3bd79
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %r14d, %r14d
testq %rcx, %rcx
cmoveq %rdx, %r14
addq %rax, %r14
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x4860
testq %rax, %rax
je 0x3be64
movq %rax, 0x10(%rbx)
movq %r14, 0x8(%rbx)
jmp 0x3bd79
movzwl (%rdx), %eax
cmpl $0x8001, %eax           # imm = 0x8001
je 0x3be64
cmpl $0x8000, %eax           # imm = 0x8000
je 0x3bdb3
movswl %ax, %ebp
testw %bp, %bp
jns 0x3bd8b
movq (%rbx), %rax
addq $0x3, %rax
cmpq %rax, 0x8(%rbx)
jae 0x3bd77
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %r14d, %r14d
testq %rcx, %rcx
cmoveq %rdx, %r14
addq %rax, %r14
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x4860
testq %rax, %rax
je 0x3be64
movq %rax, 0x10(%rbx)
movq %r14, 0x8(%rbx)
negl %ebp
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
movb $0x2d, (%rcx,%rax)
movl %ebp, %edi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x41f37
movl (%rdx), %eax
cmpl 0x93773(%rip), %eax     # 0xcf514
je 0x3be64
cmpl 0x93763(%rip), %eax     # 0xcf510
jne 0x3be69
movq (%rbx), %rax
incq %rax
cmpq %rax, 0x8(%rbx)
jae 0x3bdf2
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %r14d, %r14d
testq %rcx, %rcx
cmoveq %rdx, %r14
addq %rax, %r14
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x4860
testq %rax, %rax
je 0x3be64
movq %rax, 0x10(%rbx)
movq %r14, 0x8(%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
movb $0x2e, (%rcx,%rax)
jmp 0x3be64
movzbl (%rdx), %eax
cmpb $0x7, %al
movl $0x2e, %ebp
cmovnel %eax, %ebp
movq (%rbx), %rax
incq %rax
cmpq %rax, 0x8(%rbx)
jae 0x3be52
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %r14d, %r14d
testq %rcx, %rcx
cmoveq %rdx, %r14
addq %rax, %r14
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x4860
testq %rax, %rax
je 0x3be64
movq %rax, 0x10(%rbx)
movq %r14, 0x8(%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
movb %bpl, (%rcx,%rax)
popq %rbx
popq %r14
popq %rbp
retq
cvtss2sd (%rdx), %xmm0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x8aea4