// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
movb (%rdi), %cl
testb %cl, %cl
je 0xbfb1
xorl %eax, %eax
movq %rbx, %r15
cmpb $0x20, %cl
setb %dl
cmpb $0x22, %cl
sete %sil
cmpb $0x5c, %cl
sete %cl
orb %sil, %cl
orb %dl, %cl
movzbl %cl, %ecx
orl %ecx, %eax
movb 0x1(%r15), %cl
incq %r15
testb %cl, %cl
jne 0xbf82
testl %eax, %eax
sete %al
jmp 0xbfb6
movb $0x1, %al
movq %rbx, %r15
testb %al, %al
je 0xbfd0
subq %rbx, %r15
testq %r8, %r8
je 0xc031
leal 0x3(%r15), %esi
movq %r8, %rdi
callq 0xb45c
jmp 0xc03e
movb (%rbx), %al
testb %al, %al
je 0xc074
movq %r8, (%rsp)
leaq 0x1(%rbx), %r13
leaq 0x28cc(%rip), %r15      # 0xe8b5
xorl %r14d, %r14d
movl %r14d, %ebp
incl %ebp
je 0xc07b
movzbl %al, %r12d
movl $0x8, %edx
movq %r15, %rdi
movl %r12d, %esi
callq 0x33c0
leal 0x2(%r14), %ecx
addl $0x6, %r14d
cmpb $0x20, %r12b
cmovbl %r14d, %ebp
testq %rax, %rax
cmovnel %ecx, %ebp
movb (%r13), %al
incq %r13
movl %ebp, %r14d
testb %al, %al
jne 0xbfec
jmp 0xc07d
leal 0x3(%r15), %eax
movslq %eax, %rdi
callq *0x7302(%rip)           # 0x13340
movq %rax, %r14
testq %rax, %rax
je 0xc176
leaq 0x1(%r14), %rdi
movb $0x22, %bpl
movb %bpl, (%r14)
movq %rbx, %rsi
callq 0x3310
movslq %r15d, %rax
movb %bpl, 0x1(%r14,%rax)
incl %eax
cltq
leaq (%r14,%rax), %r12
incq %r12
jmp 0xc16f
movl $0x3, %ebp
jmp 0xc084
xorl %ebp, %ebp
addl $0x3, %ebp
movq (%rsp), %r8
testq %r8, %r8
je 0xc095
movq %r8, %rdi
movl %ebp, %esi
callq 0xb45c
jmp 0xc09e
movslq %ebp, %rdi
callq *0x72a2(%rip)           # 0x13340
movq %rax, %r14
testq %rax, %rax
je 0xc176
leaq 0x1(%r14), %r12
movb $0x22, (%r14)
movb (%rbx), %al
testb %al, %al
je 0xc167
incq %rbx
leaq 0x27f7(%rip), %r15      # 0xe8bd
leaq 0x27ab(%rip), %r13      # 0xe878
cmpb $0x20, %al
jb 0xc0dd
cmpb $0x22, %al
je 0xc0dd
movzbl %al, %ecx
cmpl $0x5c, %ecx
jne 0xc112
movb $0x5c, (%r12)
movzbl -0x1(%rbx), %edx
leal -0x8(%rdx), %eax
cmpl $0x5, %eax
ja 0xc100
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movb $0x62, 0x1(%r12)
jmp 0xc156
cmpl $0x22, %edx
je 0xc150
cmpl $0x5c, %edx
jne 0xc11b
movb $0x5c, 0x1(%r12)
jmp 0xc156
movb %al, (%r12)
incq %r12
jmp 0xc15a
leaq 0x1(%r12), %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3090
addq $0x6, %r12
jmp 0xc15a
movb $0x74, 0x1(%r12)
jmp 0xc156
movb $0x6e, 0x1(%r12)
jmp 0xc156
movb $0x66, 0x1(%r12)
jmp 0xc156
movb $0x72, 0x1(%r12)
jmp 0xc156
movb $0x22, 0x1(%r12)
addq $0x2, %r12
movb (%rbx), %al
incq %rbx
testb %al, %al
jne 0xc0cd
movb $0x22, (%r12)
incq %r12
movb $0x0, (%r12)
jmp 0xc179
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop