// File: /workspace/github_c_makefile_star2_O2/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, %r13
xorl %esi, %esi
movabsq $0x100000000, %r15      # imm = 0x100000000
xorl %r12d, %r12d
xorl %eax, %eax
movb (%r13,%rsi), %cl
testb %cl, %cl
je 0x5cf7
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 0x5cc9
testl %eax, %eax
je 0x5d4c
testq %r13, %r13
je 0x5d65
movq %r8, -0x30(%rbp)
xorl %r15d, %r15d
movq %r13, %rbx
movzbl (%rbx), %r14d
testl %r14d, %r14d
je 0x5d81
movl %r15d, %r12d
incl %r12d
je 0x5d7e
leaq 0x3c6d(%rip), %rdi      # 0x998f
movl %r14d, %esi
pushq $0x8
popq %rdx
callq 0x2220
leal 0x2(%r15), %ecx
addl $0x6, %r15d
cmpb $0x20, %r14b
cmovbl %r15d, %r12d
testq %rax, %rax
cmovnel %ecx, %r12d
incq %rbx
movl %r12d, %r15d
jmp 0x5d0a
testq %r8, %r8
je 0x5e6d
addl $0x3, %esi
movq %r8, %rdi
callq 0x5298
jmp 0x5e84
testq %r8, %r8
je 0x5eb8
pushq $0x3
popq %rsi
movq %r8, %rdi
callq 0x5298
jmp 0x5ec1
xorl %r15d, %r15d
movq -0x30(%rbp), %rdi
addl $0x3, %r15d
testq %rdi, %rdi
je 0x5d98
movl %r15d, %esi
callq 0x5298
jmp 0x5da1
movslq %r15d, %rdi
callq *0x8417(%rip)           # 0xe1b8
movq %rax, %r14
testq %rax, %rax
je 0x5ed1
leaq 0x1(%r14), %r12
movb $0x22, (%r14)
leaq 0x3bdb(%rip), %r15      # 0x9997
leaq 0x3b65(%rip), %rbx      # 0x9928
movb (%r13), %al
testb %al, %al
je 0x5e64
cmpb $0x20, %al
jb 0x5ddf
cmpb $0x22, %al
je 0x5ddf
movzbl %al, %ecx
cmpl $0x5c, %ecx
jne 0x5e14
movb $0x5c, (%r12)
movzbl (%r13), %edx
leal -0x8(%rdx), %eax
cmpl $0x5, %eax
ja 0x5e02
movslq (%rbx,%rax,4), %rax
addq %rbx, %rax
jmpq *%rax
movb $0x62, 0x1(%r12)
jmp 0x5e58
cmpl $0x22, %edx
je 0x5e52
cmpl $0x5c, %edx
jne 0x5e1d
movb $0x5c, 0x1(%r12)
jmp 0x5e58
movb %al, (%r12)
incq %r12
jmp 0x5e5c
leaq 0x1(%r12), %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addq $0x6, %r12
jmp 0x5e5c
movb $0x74, 0x1(%r12)
jmp 0x5e58
movb $0x6e, 0x1(%r12)
jmp 0x5e58
movb $0x66, 0x1(%r12)
jmp 0x5e58
movb $0x72, 0x1(%r12)
jmp 0x5e58
movb $0x22, 0x1(%r12)
addq $0x2, %r12
incq %r13
jmp 0x5dc3
movw $0x22, (%r12)
jmp 0x5ed4
movabsq $0x300000000, %rdi      # imm = 0x300000000
addq %r12, %rdi
sarq $0x20, %rdi
callq *0x8334(%rip)           # 0xe1b8
movq %rax, %r14
testq %rax, %rax
je 0x5ed1
leaq 0x1(%r14), %rdi
movb $0x22, %bl
movb %bl, (%r14)
movq %r13, %rsi
callq 0x21e0
movq %r12, %rax
sarq $0x20, %rax
movb %bl, 0x1(%r14,%rax)
addq %r12, %r15
sarq $0x20, %r15
movb $0x0, 0x1(%r14,%r15)
jmp 0x5ed4
pushq $0x3
popq %rdi
callq *0x82f7(%rip)           # 0xe1b8
testq %rax, %rax
je 0x5ed1
movb $0x0, 0x2(%rax)
movw $0x2222, (%rax)         # imm = 0x2222
jmp 0x5ed7
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq