// File: /workspace/github_c_makefile_star2_O3/qq-smart[P]qq_sh_server/core/qq_json.c
// Function: print_string_ptr
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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r8
movq %rdi, %rbx
movb (%rdi), %al
movq %rdi, %r15
testb %al, %al
je 0x62ed
xorl %ecx, %ecx
movl %eax, %edx
movq %rbx, %r15
cmpb $0x20, %dl
setb %sil
cmpb $0x22, %dl
sete %dil
cmpb $0x5c, %dl
sete %dl
orb %dil, %dl
orb %sil, %dl
movzbl %dl, %edx
orl %edx, %ecx
movb 0x1(%r15), %dl
incq %r15
testb %dl, %dl
jne 0x6261
testl %ecx, %ecx
je 0x62ed
testb %al, %al
je 0x6346
movq %r8, -0x30(%rbp)
leaq 0x1(%rbx), %r14
xorl %r12d, %r12d
movl %r12d, %r15d
incl %r15d
je 0x634e
movzbl %al, %r13d
movl $0x8, %edx
leaq 0x46ce(%rip), %rdi      # 0xa98c
movl %r13d, %esi
callq 0x2210
leal 0x2(%r12), %ecx
addl $0x6, %r12d
cmpb $0x20, %r13b
cmovbl %r12d, %r15d
testq %rax, %rax
cmovnel %ecx, %r15d
movb (%r14), %al
incq %r14
movl %r15d, %r12d
testb %al, %al
jne 0x62a2
jmp 0x6351
subq %rbx, %r15
testq %r8, %r8
je 0x6303
leal 0x3(%r15), %esi
movq %r8, %rdi
callq 0x5741
jmp 0x6310
leal 0x3(%r15), %eax
movslq %eax, %rdi
callq *0x8ea8(%rip)           # 0xf1b8
movq %rax, %r14
testq %rax, %rax
je 0x644c
leaq 0x1(%r14), %rdi
movb $0x22, %r12b
movb %r12b, (%r14)
movq %rbx, %rsi
callq 0x21e0
movslq %r15d, %rax
movb %r12b, 0x1(%r14,%rax)
incl %eax
cltq
leaq (%r14,%rax), %r12
incq %r12
jmp 0x6445
movl $0x3, %r15d
jmp 0x6359
xorl %r15d, %r15d
addl $0x3, %r15d
movq -0x30(%rbp), %r8
testq %r8, %r8
je 0x636b
movq %r8, %rdi
movl %r15d, %esi
callq 0x5741
jmp 0x6374
movslq %r15d, %rdi
callq *0x8e44(%rip)           # 0xf1b8
movq %rax, %r14
testq %rax, %rax
je 0x644c
leaq 0x1(%r14), %r12
movb $0x22, (%r14)
movb (%rbx), %al
testb %al, %al
je 0x643d
incq %rbx
leaq 0x45f8(%rip), %r15      # 0xa994
leaq 0x4585(%rip), %r13      # 0xa928
cmpb $0x20, %al
jb 0x63b3
cmpb $0x22, %al
je 0x63b3
movzbl %al, %ecx
cmpl $0x5c, %ecx
jne 0x63e8
movb $0x5c, (%r12)
movzbl -0x1(%rbx), %edx
leal -0x8(%rdx), %eax
cmpl $0x5, %eax
ja 0x63d6
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movb $0x62, 0x1(%r12)
jmp 0x642c
cmpl $0x22, %edx
je 0x6426
cmpl $0x5c, %edx
jne 0x63f1
movb $0x5c, 0x1(%r12)
jmp 0x642c
movb %al, (%r12)
incq %r12
jmp 0x6430
leaq 0x1(%r12), %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addq $0x6, %r12
jmp 0x6430
movb $0x74, 0x1(%r12)
jmp 0x642c
movb $0x6e, 0x1(%r12)
jmp 0x642c
movb $0x66, 0x1(%r12)
jmp 0x642c
movb $0x72, 0x1(%r12)
jmp 0x642c
movb $0x22, 0x1(%r12)
addq $0x2, %r12
movb (%rbx), %al
incq %rbx
testb %al, %al
jne 0x63a3
movb $0x22, (%r12)
incq %r12
movb $0x0, (%r12)
jmp 0x644f
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)