// File: /workspace/github_c_makefile_star2_O2/lh3[P]bgt/vcf.c
// Function: bcf_fmt_array
void bcf_fmt_array(kstring_t *s, int n, int type, void *data)
{
	int j = 0;
	if (n == 0) {
		kputc('.', s);
		return;
	}
	if (type == BCF_BT_INT8) {
		bcf_fmt_array_aux(int8_t, s, n, data, bcf_int8_missing, bcf_int8_end, &j);
	} else if (type == BCF_BT_CHAR) { // TODO: htslib has bcf_str_missing, but I don't know how to use that
		char *p = (char*)data;
		for (j = 0; j < n && *p; ++j, ++p) kputc(*p, s);
	} else if (type == BCF_BT_INT32) {
		bcf_fmt_array_aux(int32_t, s, n, data, bcf_int32_missing, bcf_int32_end, &j);
	} else if (type == BCF_BT_FLOAT) {
		float *p = (float*)data;
		for (j = 0; j < n && *(uint32_t*)p != bcf_float_end; ++j, ++p) {
			if (j) kputc(',', s);
			if (*(uint32_t*)p == bcf_float_missing) kputc('.', s);
			else ksprintf(s, "%g", *p);
		}
	} else if (type == BCF_BT_INT16) {
		bcf_fmt_array_aux(int16_t, s, n, data, bcf_int16_missing, bcf_int16_end, &j);
	}
	if (n && j == 0) kputc('.', s); // no actual value; write an empty array "."
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0xb280
decl %edx
cmpl $0x6, %edx
ja 0xb280
movq %rcx, %r15
movl %esi, %r14d
leaq 0xe07f(%rip), %rax      # 0x19164
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
xorl %r13d, %r13d
testl %r14d, %r14d
cmovlel %r13d, %r14d
pushq $0x2e
popq %rbp
pushq $0x2c
popq %r12
cmpl %r13d, %r14d
je 0xb26c
movb (%r15,%r13), %al
cmpb $-0x7f, %al
je 0xb269
testl %r13d, %r13d
je 0xb128
movl %r12d, %edi
movq %rbx, %rsi
callq 0xacb6
movb (%r15,%r13), %al
movl %eax, %ecx
negb %cl
jno 0xb13a
movl %ebp, %edi
movq %rbx, %rsi
callq 0xacb6
jmp 0xb145
movsbl %al, %edi
movq %rbx, %rsi
callq 0xab44
incq %r13
jmp 0xb0ff
xorl %r13d, %r13d
testl %r14d, %r14d
cmovlel %r13d, %r14d
pushq $0x2e
popq %rbp
pushq $0x2c
popq %r12
cmpl %r13d, %r14d
je 0xb26c
movl (%r15,%r13,4), %edi
cmpl $0x80000001, %edi       # imm = 0x80000001
je 0xb269
testl %r13d, %r13d
je 0xb188
movl %r12d, %edi
movq %rbx, %rsi
callq 0xacb6
movl (%r15,%r13,4), %edi
movl %edi, %eax
negl %eax
jno 0xb19a
movl %ebp, %edi
movq %rbx, %rsi
callq 0xacb6
jmp 0xb1a2
movq %rbx, %rsi
callq 0xab44
incq %r13
jmp 0xb15b
xorl %r13d, %r13d
testl %r14d, %r14d
cmovlel %r13d, %r14d
pushq $0x2e
popq %rbp
pushq $0x2c
popq %r12
cmpl %r13d, %r14d
je 0xb26c
movzwl (%r15,%r13,2), %eax
cmpw $0x8001, %ax            # imm = 0x8001
je 0xb269
testl %r13d, %r13d
je 0xb1e5
movl %r12d, %edi
movq %rbx, %rsi
callq 0xacb6
movzwl (%r15,%r13,2), %eax
movl %eax, %ecx
negw %cx
jno 0xb1f8
movl %ebp, %edi
movq %rbx, %rsi
callq 0xacb6
jmp 0xb203
movswl %ax, %edi
movq %rbx, %rsi
callq 0xab44
incq %r13
jmp 0xb1b8
xorl %r13d, %r13d
testl %r14d, %r14d
cmovlel %r13d, %r14d
pushq $0x2e
popq %rbp
pushq $0x2c
popq %r12
cmpl %r13d, %r14d
je 0xb26c
movl (%r15,%r13,4), %eax
cmpl 0x1615c(%rip), %eax     # 0x21384
je 0xb269
testl %r13d, %r13d
je 0xb23e
movl %r12d, %edi
movq %rbx, %rsi
callq 0xacb6
movl (%r15,%r13,4), %eax
cmpl 0x1613c(%rip), %eax     # 0x21380
jne 0xb252
movl %ebp, %edi
movq %rbx, %rsi
callq 0xacb6
jmp 0xb264
movd %eax, %xmm0
cvtss2sd %xmm0, %xmm0
movq %rbx, %rdi
movb $0x1, %al
callq 0xb2c3
incq %r13
jmp 0xb219
movl %r13d, %r14d
testl %r14d, %r14d
je 0xb280
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x2e
popq %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xacb6
xorl %r12d, %r12d
testl %r14d, %r14d
cmovlel %r12d, %r14d
cmpl %r12d, %r14d
je 0xb26c
movsbl (%r15,%r12), %edi
testl %edi, %edi
je 0xb2be
movq %rbx, %rsi
callq 0xacb6
incq %r12
jmp 0xb2a3
movl %r12d, %r14d
jmp 0xb26c