// File: /workspace/github_cpp_makefile_star2_O2/fgheng[P]keysound/src/cJSON.cc
// Function: print_string_ptr(char const*, printbuffer*)
static char *print_string_ptr(const char *str,printbuffer *p)
{
	const char *ptr;char *ptr2,*out;int len=0,flag=0;unsigned char token;

	for (ptr=str;*ptr;ptr++) flag|=((*ptr>0 && *ptr<32)||(*ptr=='\"')||(*ptr=='\\'))?1:0;
	if (!flag)
	{
		len=ptr-str;
		if (p) out=ensure(p,len+3);
		else		out=(char*)cJSON_malloc(len+3);
		if (!out) return 0;
		ptr2=out;*ptr2++='\"';
		strcpy(ptr2,str);
		ptr2[len]='\"';
		ptr2[len+1]=0;
		return out;
	}

	if (!str)
	{
		if (p)	out=ensure(p,3);
		else	out=(char*)cJSON_malloc(3);
		if (!out) return 0;
		strcpy(out,"\"\"");
		return out;
	}
	ptr=str;while ((token=*ptr) && ++len) {if (strchr("\"\\\b\f\n\r\t",token)) len++; else if (token<32) len+=5;ptr++;}

	if (p)	out=ensure(p,len+3);
	else	out=(char*)cJSON_malloc(len+3);
	if (!out) return 0;

	ptr2=out;ptr=str;
	*ptr2++='\"';
	while (*ptr)
	{
		if ((unsigned char)*ptr>31 && *ptr!='\"' && *ptr!='\\') *ptr2++=*ptr++;
		else
		{
			*ptr2++='\\';
			switch (token=*ptr++)
			{
				case '\\':	*ptr2++='\\';	break;
				case '\"':	*ptr2++='\"';	break;
				case '\b':	*ptr2++='b';	break;
				case '\f':	*ptr2++='f';	break;
				case '\n':	*ptr2++='n';	break;
				case '\r':	*ptr2++='r';	break;
				case '\t':	*ptr2++='t';	break;
				default: sprintf(ptr2,"u%04x",token);ptr2+=5;	break;	/* escape and print */
			}
		}
	}
	*ptr2++='\"';*ptr2++=0;
	return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r8
movq %rdi, %r14
xorl %esi, %esi
movabsq $0x100000000, %r15      # imm = 0x100000000
xorl %r12d, %r12d
xorl %eax, %eax
movb (%r14,%rsi), %cl
testb %cl, %cl
je 0xa510
cmpb $0x20, %cl
setb %dl
cmpb $0x22, %cl
sete %dil
cmpb $0x5c, %cl
sete %cl
orb %dil, %cl
orb %dl, %cl
movzbl %cl, %ecx
orl %ecx, %eax
addq %r15, %r12
incq %rsi
jmp 0xa4e3
testl %eax, %eax
je 0xa566
testq %r14, %r14
je 0xa57f
movq %r8, (%rsp)
xorl %r15d, %r15d
pushq $0x8
popq %r13
movq %r14, %rbx
movzbl (%rbx), %ebp
testl %ebp, %ebp
je 0xa59b
movl %r15d, %r12d
incl %r12d
je 0xa598
leaq 0x242b(%rip), %rdi      # 0xc968
movl %ebp, %esi
movq %r13, %rdx
callq 0x3370
leal 0x2(%r15), %ecx
addl $0x6, %r15d
cmpb $0x20, %bpl
cmovbl %r15d, %r12d
testq %rax, %rax
cmovnel %ecx, %r12d
incq %rbx
movl %r12d, %r15d
jmp 0xa527
testq %r8, %r8
je 0xa685
addl $0x3, %esi
movq %r8, %rdi
callq 0x9ad3
jmp 0xa69c
testq %r8, %r8
je 0xa6d1
pushq $0x3
popq %rsi
movq %r8, %rdi
callq 0x9ad3
jmp 0xa6da
xorl %r15d, %r15d
movq (%rsp), %rdi
addl $0x3, %r15d
testq %rdi, %rdi
je 0xa5b2
movl %r15d, %esi
callq 0x9ad3
jmp 0xa5bb
movslq %r15d, %rdi
callq *0x7d65(%rip)           # 0x12320
movq %rax, %rbx
testq %rax, %rax
je 0xa6ea
leaq 0x1(%rbx), %r12
movb $0x22, (%rbx)
leaq 0x239b(%rip), %r15      # 0xc970
leaq 0x234c(%rip), %r13      # 0xc928
movb (%r14), %al
testb %al, %al
je 0xa67c
cmpb $0x20, %al
jb 0xa5f7
cmpb $0x22, %al
je 0xa5f7
movzbl %al, %ecx
cmpl $0x5c, %ecx
jne 0xa62c
movb $0x5c, (%r12)
movzbl (%r14), %edx
leal -0x8(%rdx), %eax
cmpl $0x5, %eax
ja 0xa61a
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movb $0x62, 0x1(%r12)
jmp 0xa670
cmpl $0x22, %edx
je 0xa66a
cmpl $0x5c, %edx
jne 0xa635
movb $0x5c, 0x1(%r12)
jmp 0xa670
movb %al, (%r12)
incq %r12
jmp 0xa674
leaq 0x1(%r12), %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3080
addq $0x6, %r12
jmp 0xa674
movb $0x74, 0x1(%r12)
jmp 0xa670
movb $0x6e, 0x1(%r12)
jmp 0xa670
movb $0x66, 0x1(%r12)
jmp 0xa670
movb $0x72, 0x1(%r12)
jmp 0xa670
movb $0x22, 0x1(%r12)
addq $0x2, %r12
incq %r14
jmp 0xa5dc
movw $0x22, (%r12)
jmp 0xa6ec
movabsq $0x300000000, %rdi      # imm = 0x300000000
addq %r12, %rdi
sarq $0x20, %rdi
callq *0x7c84(%rip)           # 0x12320
movq %rax, %rbx
testq %rax, %rax
je 0xa6ea
leaq 0x1(%rbx), %rdi
movb $0x22, %bpl
movb %bpl, (%rbx)
movq %r14, %rsi
callq 0x32d0
movq %r12, %rax
sarq $0x20, %rax
movb %bpl, 0x1(%rbx,%rax)
addq %r12, %r15
sarq $0x20, %r15
movb $0x0, 0x1(%rbx,%r15)
jmp 0xa6ec
pushq $0x3
popq %rdi
callq *0x7c46(%rip)           # 0x12320
testq %rax, %rax
je 0xa6ea
movb $0x0, 0x2(%rax)
movw $0x2222, (%rax)         # imm = 0x2222
jmp 0xa6ef
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq