// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/vcf.c
// Function: bcf_fmt_array
int bcf_fmt_array(kstring_t *s, int n, int type, void *data)
{
    int j = 0;
    uint32_t e = 0;
    if (n == 0) {
        return kputc_('.', s) >= 0 ? 0 : -1;
    }

    if (type == BCF_BT_CHAR)
    {
        char *p = (char *)data;

        // Note bcf_str_missing is already accounted for in n==0 above.
        if (n >= 8) {
            char *p_end = memchr(p, 0, n);
            e |= kputsn(p, p_end ? p_end-p : n, s) < 0;
        } else {
            for (j = 0; j < n && *p; ++j, ++p)
               e |= kputc(*p, s) < 0;
        }
    }
    else
    {
        #define BRANCH(type_t, convert, is_missing, is_vector_end, kprint) { \
            uint8_t *p = (uint8_t *) data; \
            for (j=0; j<n; j++, p += sizeof(type_t))    \
            { \
                type_t v = convert(p); \
                if ( is_vector_end ) break; \
                if ( j ) e |= kputc_(',', s) < 0; \
                e |= (is_missing ? kputc('.', s) : kprint) < 0; \
            } \
        }
        switch (type) {
            case BCF_BT_INT8:  BRANCH(int8_t,  le_to_i8, v==bcf_int8_missing,  v==bcf_int8_vector_end,  kputw(v, s)); break;
            case BCF_BT_INT16: BRANCH(int16_t, le_to_i16, v==bcf_int16_missing, v==bcf_int16_vector_end, kputw(v, s)); break;
            case BCF_BT_INT32: BRANCH(int32_t, le_to_i32, v==bcf_int32_missing, v==bcf_int32_vector_end, kputw(v, s)); break;
            case BCF_BT_FLOAT: BRANCH(uint32_t, le_to_u32, v==bcf_float_missing, v==bcf_float_vector_end, kputd(le_to_float(p), s)); break;
            default: hts_log_error("Unexpected type %d", type); exit(1); break;
        }
        #undef BRANCH
    }
    return e == 0 ? 0 : -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x44e42
movq -0x10(%rbp), %rsi
movl $0x2e, %edi
callq 0x452d0
movl %eax, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovgel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x452b7
cmpl $0x7, -0x18(%rbp)
jne 0x44f37
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpl $0x8, -0x14(%rbp)
jl 0x44ec2
movq -0x30(%rbp), %rdi
movslq -0x14(%rbp), %rdx
xorl %esi, %esi
callq 0x4530
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x44e90
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x88(%rbp)
jmp 0x44e9b
movslq -0x14(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x43970
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x44f32
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %ecx
xorl %eax, %eax
cmpl -0x14(%rbp), %ecx
movb %al, -0x89(%rbp)
jge 0x44eec
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x89(%rbp)
movb -0x89(%rbp), %al
testb $0x1, %al
jne 0x44ef8
jmp 0x44f30
movq -0x30(%rbp), %rax
movsbl (%rax), %edi
movq -0x10(%rbp), %rsi
callq 0x40b10
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x44ec9
jmp 0x44f32
jmp 0x452a4
movl -0x18(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x98(%rbp)
subl $0x4, %eax
ja 0x4527b
movq -0x98(%rbp), %rax
leaq 0xc2004(%rip), %rcx     # 0x106f60
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x45022
movq -0x40(%rbp), %rdi
callq 0x45340
movb %al, -0x41(%rbp)
movsbl -0x41(%rbp), %eax
cmpl $-0x7f, %eax
jne 0x44f9a
jmp 0x45022
cmpl $0x0, -0x24(%rbp)
je 0x44fbf
movq -0x10(%rbp), %rsi
movl $0x2c, %edi
callq 0x452d0
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movsbl -0x41(%rbp), %eax
cmpl $-0x80, %eax
jne 0x44fde
movq -0x10(%rbp), %rsi
movl $0x2e, %edi
callq 0x40b10
movl %eax, -0x9c(%rbp)
jmp 0x44ff1
movsbl -0x41(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x3bac0
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x44f74
jmp 0x452a2
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x450e9
movq -0x50(%rbp), %rdi
callq 0x45390
movw %ax, -0x52(%rbp)
movswl -0x52(%rbp), %eax
cmpl $0xffff8001, %eax       # imm = 0xFFFF8001
jne 0x4505f
jmp 0x450e9
cmpl $0x0, -0x24(%rbp)
je 0x45084
movq -0x10(%rbp), %rsi
movl $0x2c, %edi
callq 0x452d0
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movswl -0x52(%rbp), %eax
cmpl $0xffff8000, %eax       # imm = 0xFFFF8000
jne 0x450a5
movq -0x10(%rbp), %rsi
movl $0x2e, %edi
callq 0x40b10
movl %eax, -0xa0(%rbp)
jmp 0x450b8
movswl -0x52(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x3bac0
movl %eax, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x50(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x50(%rbp)
jmp 0x45036
jmp 0x452a2
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x451aa
movq -0x60(%rbp), %rdi
callq 0x453e0
movl %eax, -0x64(%rbp)
cmpl $0x80000001, -0x64(%rbp) # imm = 0x80000001
jne 0x45123
jmp 0x451aa
cmpl $0x0, -0x24(%rbp)
je 0x45148
movq -0x10(%rbp), %rsi
movl $0x2c, %edi
callq 0x452d0
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
cmpl $0x80000000, -0x64(%rbp) # imm = 0x80000000
jne 0x45167
movq -0x10(%rbp), %rsi
movl $0x2e, %edi
callq 0x40b10
movl %eax, -0xa4(%rbp)
jmp 0x45179
movl -0x64(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x3bac0
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x60(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x60(%rbp)
jmp 0x450fd
jmp 0x452a2
movq -0x20(%rbp), %rax
movq %rax, -0x70(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x45279
movq -0x70(%rbp), %rdi
callq 0x45430
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
cmpl 0xe0465(%rip), %eax     # 0x125644
jne 0x451e6
jmp 0x45279
cmpl $0x0, -0x24(%rbp)
je 0x4520b
movq -0x10(%rbp), %rsi
movl $0x2c, %edi
callq 0x452d0
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x74(%rbp), %eax
cmpl 0xe042c(%rip), %eax     # 0x125640
jne 0x4522c
movq -0x10(%rbp), %rsi
movl $0x2e, %edi
callq 0x40b10
movl %eax, -0xa8(%rbp)
jmp 0x45248
movq -0x70(%rbp), %rdi
callq 0x45440
cvtss2sd %xmm0, %xmm0
movq -0x10(%rbp), %rdi
callq 0xd58f0
movl %eax, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x70(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x70(%rbp)
jmp 0x451be
jmp 0x452a2
movl -0x18(%rbp), %ecx
movl $0x1, %edi
leaq 0xc2a78(%rip), %rsi     # 0x107d02
leaq 0xc2a7f(%rip), %rdx     # 0x107d10
movb $0x0, %al
callq 0x9d90
movl $0x1, %edi
callq 0x45d0
jmp 0x452a4
movl -0x28(%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 $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)