// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x14(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x6, %eax
ja 0x4a67a
movq -0x40(%rbp), %rax
leaq 0xbcb0f(%rip), %rcx     # 0x106fd0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x30(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x7, %eax
jne 0x4a4e0
movl $0x2e, %eax
movl %eax, -0x44(%rbp)
jmp 0x4a4ea
movq -0x30(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x452d0
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x4a6a0
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $-0x7f, %eax
je 0x4a55e
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $-0x80, %eax
jne 0x4a537
movq -0x10(%rbp), %rsi
movl $0x2e, %edi
callq 0x452d0
movl %eax, -0x48(%rbp)
jmp 0x4a54a
movq -0x30(%rbp), %rax
movsbl (%rax), %edi
movq -0x10(%rbp), %rsi
callq 0x3bac0
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x4a6a0
movq -0x30(%rbp), %rdi
callq 0x45390
cwtl
movl %eax, -0x34(%rbp)
cmpl $0xffff8001, -0x34(%rbp) # imm = 0xFFFF8001
je 0x4a5b8
cmpl $0xffff8000, -0x34(%rbp) # imm = 0xFFFF8000
jne 0x4a595
movq -0x10(%rbp), %rsi
movl $0x2e, %edi
callq 0x452d0
movl %eax, -0x4c(%rbp)
jmp 0x4a5a4
movl -0x34(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x3bac0
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x4a6a0
movq -0x30(%rbp), %rdi
callq 0x453e0
movl %eax, -0x34(%rbp)
cmpl $0x80000001, -0x34(%rbp) # imm = 0x80000001
je 0x4a611
cmpl $0x80000000, -0x34(%rbp) # imm = 0x80000000
jne 0x4a5ee
movq -0x10(%rbp), %rsi
movl $0x2e, %edi
callq 0x452d0
movl %eax, -0x50(%rbp)
jmp 0x4a5fd
movl -0x34(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x3bac0
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x4a6a0
movq -0x30(%rbp), %rdi
callq 0x45430
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl 0xdb019(%rip), %eax     # 0x125644
je 0x4a678
movl -0x34(%rbp), %eax
cmpl 0xdb00a(%rip), %eax     # 0x125640
jne 0x4a64b
movq -0x10(%rbp), %rsi
movl $0x2e, %edi
callq 0x452d0
movl %eax, -0x54(%rbp)
jmp 0x4a664
movq -0x30(%rbp), %rdi
callq 0x45440
cvtss2sd %xmm0, %xmm0
movq -0x10(%rbp), %rdi
callq 0xd58f0
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x4a6a0
movl -0x14(%rbp), %ecx
movl $0x1, %edi
leaq 0xbea2d(%rip), %rsi     # 0x1090b6
leaq 0xbd680(%rip), %rdx     # 0x107d10
movb $0x0, %al
callq 0x9d90
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4a6b3
movl -0x24(%rbp), %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)