// File: /workspace/github_cpp_makefile_star2_O2/fgheng[P]keysound/src/cJSON.cc
// Function: print_array(cJSON*, int, int, printbuffer*)
static char *print_array(cJSON *item,int depth,int fmt,printbuffer *p)
{
	char **entries;
	char *out=0,*ptr,*ret;int len=5;
	cJSON *child=item->child;
	int numentries=0,i=0,fail=0;
	size_t tmplen=0;

	/* How many entries in the array? */
	while (child) numentries++,child=child->next;
	/* Explicitly handle numentries==0 */
	if (!numentries)
	{
		if (p)	out=ensure(p,3);
		else	out=(char*)cJSON_malloc(3);
		if (out) strcpy(out,"[]");
		return out;
	}

	if (p)
	{
		/* Compose the output array. */
		i=p->offset;
		ptr=ensure(p,1);if (!ptr) return 0;	*ptr='[';	p->offset++;
		child=item->child;
		while (child && !fail)
		{
			print_value(child,depth+1,fmt,p);
			p->offset=update(p);
			if (child->next) {len=fmt?2:1;ptr=ensure(p,len+1);if (!ptr) return 0;*ptr++=',';if(fmt)*ptr++=' ';*ptr=0;p->offset+=len;}
			child=child->next;
		}
		ptr=ensure(p,2);if (!ptr) return 0;	*ptr++=']';*ptr=0;
		out=(p->buffer)+i;
	}
	else
	{
		/* Allocate an array to hold the values for each */
		entries=(char**)cJSON_malloc(numentries*sizeof(char*));
		if (!entries) return 0;
		memset(entries,0,numentries*sizeof(char*));
		/* Retrieve all the results: */
		child=item->child;
		while (child && !fail)
		{
			ret=print_value(child,depth+1,fmt,0);
			entries[i++]=ret;
			if (ret) len+=strlen(ret)+2+(fmt?1:0); else fail=1;
			child=child->next;
		}

		/* If we didn't fail, try to malloc the output string */
		if (!fail)	out=(char*)cJSON_malloc(len);
		/* If that fails, we fail. */
		if (!out) fail=1;

		/* Handle failure. */
		if (fail)
		{
			for (i=0;i<numentries;i++) if (entries[i]) cJSON_free(entries[i]);
			cJSON_free(entries);
			return 0;
		}

		/* Compose the output array. */
		*out='[';
		ptr=out+1;*ptr=0;
		for (i=0;i<numentries;i++)
		{
			tmplen=strlen(entries[i]);memcpy(ptr,entries[i],tmplen);ptr+=tmplen;
			if (i!=numentries-1) {*ptr++=',';if(fmt)*ptr++=' ';*ptr=0;}
			cJSON_free(entries[i]);
		}
		cJSON_free(entries);
		*ptr++=']';*ptr++=0;
	}
	return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r15
movl %edx, 0xc(%rsp)
movl %esi, %ebp
movq %rdi, %r14
addq $0x10, %r14
pushq $-0x8
popq %r12
xorl %ebx, %ebx
movq %r14, %rax
movq (%rax), %rax
decq %rbx
addq $0x8, %r12
testq %rax, %rax
jne 0x9d1a
cmpl $-0x1, %ebx
je 0x9dd6
testq %r15, %r15
je 0x9def
movslq 0xc(%r15), %rbx
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0x9ad3
testq %rax, %rax
je 0x9f83
movb $0x5b, (%rax)
incl 0xc(%r15)
incl %ebp
xorl %r13d, %r13d
cmpl $0x0, 0xc(%rsp)
sete %r13b
pushq $0x2
popq %r12
subl %r13d, %r12d
xorl $0x3, %r13d
movq (%r14), %r14
testq %r14, %r14
je 0x9e84
movq %r14, %rdi
movl %ebp, %esi
movl 0xc(%rsp), %edx
movq %r15, %rcx
callq 0x8e1b
movq %r15, %rdi
callq 0xa6fe
movl %eax, 0xc(%r15)
cmpq $0x0, (%r14)
je 0x9d73
movq %r15, %rdi
movl %r13d, %esi
callq 0x9ad3
testq %rax, %rax
je 0x9f83
movb $0x2c, (%rax)
cmpl $0x0, 0xc(%rsp)
je 0x9dca
movb $0x20, 0x1(%rax)
addq $0x2, %rax
jmp 0x9dcd
incq %rax
movb $0x0, (%rax)
addl %r12d, 0xc(%r15)
jmp 0x9d73
testq %r15, %r15
je 0x9f45
pushq $0x3
popq %rsi
movq %r15, %rdi
callq 0x9ad3
jmp 0x9f4e
movq %r12, %rdi
callq *0x8528(%rip)           # 0x12320
testq %rax, %rax
je 0x9f83
movq %rax, %r15
pushq $-0x2
popq %rax
subq %rbx, %rax
movq %rax, 0x20(%rsp)
notq %rbx
xorl %r13d, %r13d
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x31b0
incl %ebp
cmpl $0x1, 0xc(%rsp)
pushq $0x3
popq %rax
sbbq $0x0, %rax
movq %rax, 0x18(%rsp)
pushq $0x5
popq %rax
movl %eax, 0x10(%rsp)
movb $0x1, %r12b
testb $0x1, %r12b
je 0x9ea8
movq (%r14), %r14
testq %r14, %r14
je 0x9ea8
xorl %r12d, %r12d
movq %r14, %rdi
movl %ebp, %esi
movl 0xc(%rsp), %edx
xorl %ecx, %ecx
callq 0x8e1b
movq %rax, (%r15,%r13,8)
incq %r13
testq %rax, %rax
je 0x9e3f
movq %rax, %rdi
callq 0x3150
movl 0x10(%rsp), %ecx
addl 0x18(%rsp), %ecx
addl %eax, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x9e3c
pushq $0x2
popq %rsi
movq %r15, %rdi
callq 0x9ad3
testq %rax, %rax
je 0x9f83
movw $0x5d, (%rax)
addq (%r15), %rbx
movq %rbx, %rax
jmp 0x9f85
testb $0x1, %r12b
je 0x9f5e
movslq 0x10(%rsp), %rdi
callq *0x8463(%rip)           # 0x12320
testq %rax, %rax
setne %cl
testb %cl, %r12b
je 0x9f5e
movw $0x5b, (%rax)
movq %rax, 0x18(%rsp)
movq %rax, %r14
incq %r14
movl 0x20(%rsp), %eax
movq %rax, 0x10(%rsp)
xorl %r12d, %r12d
subq $0x1, %rbx
jb 0x9f94
movq (%r15,%r12,8), %r13
movq %r13, %rdi
callq 0x3150
movq %rax, %rbp
movq %r14, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x3280
addq %rbp, %r14
cmpq %r12, 0x10(%rsp)
je 0x9f36
movb $0x2c, (%r14)
cmpl $0x0, 0xc(%rsp)
je 0x9f2f
movb $0x20, 0x1(%r14)
addq $0x2, %r14
jmp 0x9f32
incq %r14
movb $0x0, (%r14)
movq (%r15,%r12,8), %rdi
callq *0x83e8(%rip)           # 0x12328
incq %r12
jmp 0x9ee8
pushq $0x3
popq %rdi
callq *0x83d2(%rip)           # 0x12320
testq %rax, %rax
je 0x9f83
movb $0x0, 0x2(%rax)
movw $0x5d5b, (%rax)         # imm = 0x5D5B
jmp 0x9f85
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x9f7a
movq (%r15,%r14,8), %rdi
testq %rdi, %rdi
je 0x9f75
callq *0x83b3(%rip)           # 0x12328
incq %r14
jmp 0x9f61
movq %r15, %rdi
callq *0x83a5(%rip)           # 0x12328
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq *0x838b(%rip)           # 0x12328
movw $0x5d, (%r14)
movq 0x18(%rsp), %rax
jmp 0x9f85