// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
movl %edx, %ebp
movl %esi, 0x8(%rsp)
movq %rdi, %r15
addq $0x10, %r15
movq $-0x8, %r12
xorl %r13d, %r13d
movq %r15, %rax
movq (%rax), %rax
decq %r13
addq $0x8, %r12
testq %rax, %rax
jne 0xb52b
cmpl $-0x1, %r13d
je 0xb630
testq %r14, %r14
je 0xb64b
movslq 0xc(%r14), %rbx
movq %r14, %rdi
movl $0x1, %esi
callq 0xb2da
testq %rax, %rax
je 0xb7e6
movq %rbx, 0x18(%rsp)
movb $0x5b, (%rax)
incl 0xc(%r14)
movq (%r15), %r12
testq %r12, %r12
je 0xb608
incl 0x8(%rsp)
xorl %r13d, %r13d
testl %ebp, %ebp
sete %r13b
movl $0x2, %ebx
subl %r13d, %ebx
xorl $0x3, %r13d
movq %r12, %rdi
movl 0x8(%rsp), %esi
movl %ebp, %edx
movq %r14, %rcx
callq 0x9fd7
movq (%r14), %rdi
movl $0x0, %eax
testq %rdi, %rdi
je 0xb5c5
movslq 0xc(%r14), %r15
addq %r15, %rdi
callq 0x3170
addl %r15d, %eax
movl %eax, 0xc(%r14)
cmpq $0x0, (%r12)
je 0xb608
movq %r14, %rdi
movl %r13d, %esi
callq 0xb2da
testq %rax, %rax
je 0xb7e6
movb $0x2c, (%rax)
testl %ebp, %ebp
je 0xb5f5
movb $0x20, 0x1(%rax)
addq $0x2, %rax
jmp 0xb5f8
incq %rax
movb $0x0, (%rax)
addl %ebx, 0xc(%r14)
movq (%r12), %r12
testq %r12, %r12
jne 0xb598
movq %r14, %rdi
movl $0x2, %esi
callq 0xb2da
testq %rax, %rax
je 0xb7e6
movw $0x5d, (%rax)
movq 0x18(%rsp), %rax
addq (%r14), %rax
jmp 0xb7e8
testq %r14, %r14
je 0xb6e7
movq %r14, %rdi
movl $0x3, %esi
callq 0xb2da
jmp 0xb6f2
movq %r12, %rdi
callq *0x7cec(%rip)           # 0x13340
testq %rax, %rax
je 0xb7e6
movq %rax, %r14
movq %r13, %rbx
notq %rbx
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x31d0
movq (%r15), %r15
testq %r15, %r15
movl %ebp, 0x18(%rsp)
movq %r14, 0x10(%rsp)
je 0xb709
incl 0x8(%rsp)
cmpl $0x1, %ebp
movl $0x3, %eax
sbbq $0x0, %rax
movq %rax, 0x20(%rsp)
movl $0x5, %ebp
movq %r15, %rdi
movl 0x8(%rsp), %esi
movl 0x18(%rsp), %edx
xorl %ecx, %ecx
callq 0x9fd7
movq %rax, (%r14)
testq %rax, %rax
je 0xb7be
movq %rax, %r12
movq %rax, %rdi
callq 0x3170
addl 0x20(%rsp), %ebp
addl %eax, %ebp
testq %r12, %r12
je 0xb6e2
addq $0x8, %r14
movq (%r15), %r15
testq %r15, %r15
jne 0xb6a2
movslq %ebp, %rdi
jmp 0xb70e
movl $0x3, %edi
callq *0x7c4e(%rip)           # 0x13340
testq %rax, %rax
je 0xb7e6
movb $0x0, 0x2(%rax)
movw $0x5d5b, (%rax)         # imm = 0x5D5B
jmp 0xb7e8
movl $0x5, %edi
callq *0x7c2c(%rip)           # 0x13340
testq %rax, %rax
je 0xb7be
movq $-0x2, %rcx
subq %r13, %rcx
movw $0x5b, (%rax)
movq %rax, 0x8(%rsp)
movq %rax, %r12
incq %r12
movl %ecx, %r15d
xorl %r14d, %r14d
movq 0x10(%rsp), %r13
movq (%r13,%r14,8), %r13
movq %r13, %rdi
callq 0x3170
movq %rax, %rbp
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x32c0
addq %rbp, %r12
cmpq %r14, %r15
jne 0xb76f
movq 0x10(%rsp), %r13
jmp 0xb794
movb $0x2c, (%r12)
cmpl $0x0, 0x18(%rsp)
je 0xb787
movb $0x20, 0x1(%r12)
addq $0x2, %r12
jmp 0xb78a
incq %r12
movq 0x10(%rsp), %r13
movb $0x0, (%r12)
movq (%r13,%r14,8), %rdi
callq *0x7ba9(%rip)           # 0x13348
incq %r14
cmpq %r14, %rbx
jne 0xb742
movq %r13, %rdi
callq *0x7b98(%rip)           # 0x13348
movw $0x5d, (%r12)
movq 0x8(%rsp), %rax
jmp 0xb7e8
movq 0x10(%rsp), %r15
movq %r15, %r14
movq (%r14), %rdi
testq %rdi, %rdi
je 0xb7d4
callq *0x7b74(%rip)           # 0x13348
addq $0x8, %r14
decq %rbx
jne 0xb7c6
movq %r15, %rdi
callq *0x7b62(%rip)           # 0x13348
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq