// File: /workspace/github_cpp_makefile_star2_O1/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 $0x18, %rsp
movq %rcx, %r14
movl %edx, 0x4(%rsp)
movl %esi, %ebp
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 0xb6ad
cmpl $-0x1, %r13d
je 0xb7b6
testq %r14, %r14
je 0xb7d1
movslq 0xc(%r14), %rbx
movq %r14, %rdi
movl $0x1, %esi
callq 0xb45c
testq %rax, %rax
je 0xb991
movq %rbx, 0x8(%rsp)
movb $0x5b, (%rax)
incl 0xc(%r14)
movq (%r15), %r12
testq %r12, %r12
je 0xb78e
incl %ebp
xorl %r13d, %r13d
cmpl $0x0, 0x4(%rsp)
sete %r13b
movl $0x2, %r15d
subl %r13d, %r15d
xorl $0x3, %r13d
movq %r12, %rdi
movl %ebp, %esi
movl 0x4(%rsp), %edx
movq %r14, %rcx
callq 0xa040
movq (%r14), %rdi
movl $0x0, %eax
testq %rdi, %rdi
je 0xb748
movslq 0xc(%r14), %rbx
addq %rbx, %rdi
callq 0x3170
addl %ebx, %eax
movl %eax, 0xc(%r14)
cmpq $0x0, (%r12)
je 0xb785
movq %r14, %rdi
movl %r13d, %esi
callq 0xb45c
testq %rax, %rax
je 0xb991
movb $0x2c, (%rax)
cmpl $0x0, 0x4(%rsp)
je 0xb77b
movb $0x20, 0x1(%rax)
addq $0x2, %rax
jmp 0xb77e
incq %rax
movb $0x0, (%rax)
addl %r15d, 0xc(%r14)
movq (%r12), %r12
testq %r12, %r12
jne 0xb71c
movq %r14, %rdi
movl $0x2, %esi
callq 0xb45c
testq %rax, %rax
je 0xb991
movw $0x5d, (%rax)
movq 0x8(%rsp), %rax
addq (%r14), %rax
jmp 0xb993
testq %r14, %r14
je 0xb86f
movq %r14, %rdi
movl $0x3, %esi
callq 0xb45c
jmp 0xb87a
movq %r12, %rdi
callq *0x7b66(%rip)           # 0x13340
testq %rax, %rax
je 0xb991
movq %rax, %r14
xorl %ebx, %ebx
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x31d0
movq (%r15), %r15
testq %r15, %r15
movq %r14, 0x8(%rsp)
je 0xb891
incl %ebp
cmpl $0x1, 0x4(%rsp)
movl $0x3, %eax
sbbq $0x0, %rax
movq %rax, 0x10(%rsp)
movl $0x5, %r12d
movq %r15, %rdi
movl %ebp, %esi
movl 0x4(%rsp), %edx
xorl %ecx, %ecx
callq 0xa040
movq %rax, (%r14)
testq %rax, %rax
je 0xb84b
movq %rax, %rdi
callq 0x3170
addl 0x10(%rsp), %r12d
addl %eax, %r12d
jmp 0xb850
movl $0x1, %ebx
movq (%r15), %r15
testl %ebx, %ebx
sete %al
testq %r15, %r15
je 0xb865
addq $0x8, %r14
testl %ebx, %ebx
je 0xb821
movslq %r12d, %rdi
testl %ebx, %ebx
sete %bl
jmp 0xb89a
movl $0x3, %edi
callq *0x7ac6(%rip)           # 0x13340
testq %rax, %rax
je 0xb993
movb $0x0, 0x2(%rax)
movw $0x5d5b, (%rax)         # imm = 0x5D5B
jmp 0xb993
movb $0x1, %bl
movl $0x5, %edi
movb $0x1, %al
testb %al, %al
je 0xb8a6
callq *0x7a9c(%rip)           # 0x13340
jmp 0xb8a8
xorl %eax, %eax
movq %r13, %r15
notq %r15
testq %rax, %rax
setne %cl
testb %bl, %cl
je 0xb962
movq $-0x2, %rcx
subq %r13, %rcx
movw $0x5b, (%rax)
movq %rax, 0x10(%rsp)
leaq 0x1(%rax), %r12
movl %ecx, %ebx
cmpq $0x1, %r15
adcq $0x0, %r15
xorl %r14d, %r14d
movq 0x8(%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, %rbx
jne 0xb913
movq 0x8(%rsp), %r13
jmp 0xb938
movb $0x2c, (%r12)
cmpl $0x0, 0x4(%rsp)
je 0xb92b
movb $0x20, 0x1(%r12)
addq $0x2, %r12
jmp 0xb92e
incq %r12
movq 0x8(%rsp), %r13
movb $0x0, (%r12)
movq (%r13,%r14,8), %rdi
callq *0x7a05(%rip)           # 0x13348
incq %r14
cmpq %r14, %r15
jne 0xb8e6
movq %r13, %rdi
callq *0x79f4(%rip)           # 0x13348
movw $0x5d, (%r12)
movq 0x10(%rsp), %rax
jmp 0xb993
cmpq $0x1, %r15
adcq $0x0, %r15
xorl %ebx, %ebx
movq 0x8(%rsp), %r14
movq (%r14,%rbx,8), %rdi
testq %rdi, %rdi
je 0xb980
callq *0x79c8(%rip)           # 0x13348
incq %rbx
cmpq %rbx, %r15
jne 0xb971
movq %r14, %rdi
callq *0x79b7(%rip)           # 0x13348
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq