// File: /workspace/github_c_makefile_star2_O1/qq-smart[P]qq_sh_server/core/qq_json.c
// Function: parse_string
static const char *parse_string(cJSON *item,const char *str)
{
	const char *ptr=str+1;char *ptr2;char *out;int len=0;unsigned uc,uc2;
	if (*str!='\"') {ep=str;return 0;}	/* not a string! */
	
	while (*ptr!='\"' && *ptr && ++len) if (*ptr++ == '\\') ptr++;	/* Skip escaped quotes. */
	
	out=(char*)cJSON_malloc(len+1);	/* This is how long we need for the string, roughly. */
	if (!out) return 0;
	
	ptr=str+1;ptr2=out;
	while (*ptr!='\"' && *ptr)
	{
		if (*ptr!='\\') *ptr2++=*ptr++;
		else
		{
			ptr++;
			switch (*ptr)
			{
				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;
				case 'u':	 /* transcode utf16 to utf8. */
					uc=parse_hex4(ptr+1);ptr+=4;	/* get the unicode char. */

					if ((uc>=0xDC00 && uc<=0xDFFF) || uc==0)	break;	/* check for invalid.	*/

					if (uc>=0xD800 && uc<=0xDBFF)	/* UTF16 surrogate pairs.	*/
					{
						if (ptr[1]!='\\' || ptr[2]!='u')	break;	/* missing second-half of surrogate.	*/
						uc2=parse_hex4(ptr+3);ptr+=6;
						if (uc2<0xDC00 || uc2>0xDFFF)		break;	/* invalid second-half of surrogate.	*/
						uc=0x10000 + (((uc&0x3FF)<<10) | (uc2&0x3FF));
					}

					len=4;if (uc<0x80) len=1;else if (uc<0x800) len=2;else if (uc<0x10000) len=3; ptr2+=len;
					
					switch (len) {
						case 4: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6;
						case 3: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6;
						case 2: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6;
						case 1: *--ptr2 =(uc | firstByteMark[len]);
					}
					ptr2+=len;
					break;
				default:  *ptr2++=*ptr; break;
			}
			ptr++;
		}
	}
	*ptr2=0;
	if (*ptr=='\"') ptr++;
	item->valuestring=out;
	item->type=cJSON_String;
	return ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
cmpb $0x22, (%rsi)
jne 0x51e0
movq %rdi, %r14
incq %r15
movl $0x1, %edi
movq %r15, %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0x51ec
cmpl $0x22, %ecx
je 0x51ec
xorl %edx, %edx
cmpb $0x5c, %cl
sete %dl
addq %rdx, %rax
incq %rax
incq %rdi
jmp 0x51c1
movq %r15, 0xa149(%rip)      # 0xf330
jmp 0x53b8
callq *0x9fc6(%rip)           # 0xf1b8
testq %rax, %rax
je 0x53b8
movq %rax, %rbx
movq %r14, -0x30(%rbp)
leaq 0x56ff(%rip), %r13      # 0xa908
movq %rax, %r14
movzbl (%r15), %eax
cmpl $0x5c, %eax
je 0x5234
testl %eax, %eax
je 0x53bc
cmpl $0x22, %eax
je 0x53bc
movb %al, (%r14)
incq %r14
movq %r15, %rax
jmp 0x53ad
leaq 0x1(%r15), %rax
movb 0x1(%r15), %cl
movzbl %cl, %edx
leal -0x6e(%rdx), %esi
cmpl $0x7, %esi
ja 0x525a
movslq (%r13,%rsi,4), %rdx
addq %r13, %rdx
jmpq *%rdx
movb $0xa, (%r14)
jmp 0x53aa
cmpl $0x66, %edx
je 0x53a6
cmpl $0x62, %edx
jne 0x5271
movb $0x8, (%r14)
jmp 0x53aa
movb %cl, (%r14)
jmp 0x53aa
leaq 0x2(%r15), %rdi
callq 0x5755
movl %eax, %r12d
leaq 0x5(%r15), %rax
movl %r12d, %ecx
andl $0xfc00, %ecx           # imm = 0xFC00
cmpl $0xdc00, %ecx           # imm = 0xDC00
sete %dl
testl %r12d, %r12d
sete %sil
orb %dl, %sil
jne 0x53ad
cmpl $0xd800, %ecx           # imm = 0xD800
jne 0x5305
cmpb $0x5c, 0x6(%r15)
jne 0x53ad
cmpb $0x75, 0x7(%r15)
jne 0x53ad
leaq 0x8(%r15), %rdi
callq 0x5755
addq $0xb, %r15
leal -0xe000(%rax), %ecx
cmpl $0xfffffc00, %ecx       # imm = 0xFFFFFC00
jb 0x522c
shll $0xa, %r12d
andl $0xffc00, %r12d         # imm = 0xFFC00
andl $0x3ff, %eax            # imm = 0x3FF
addl %eax, %r12d
addl $0x10000, %r12d         # imm = 0x10000
movq %r15, %rax
movl $0x1, %edx
cmpl $0x80, %r12d
jb 0x5330
movl $0x2, %edx
cmpl $0x800, %r12d           # imm = 0x800
jb 0x5330
cmpl $0x10000, %r12d         # imm = 0x10000
movl $0x4, %edx
sbbl $0x0, %edx
movl %edx, %ecx
addq %rcx, %r14
decl %edx
leaq 0x55ea(%rip), %rsi      # 0xa928
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
movl %r12d, %edx
andb $0x3f, %dl
orb $-0x80, %dl
movb %dl, -0x1(%r14)
decq %r14
shrl $0x6, %r12d
movl %r12d, %edx
andb $0x3f, %dl
orb $-0x80, %dl
movb %dl, -0x1(%r14)
decq %r14
shrl $0x6, %r12d
movl %r12d, %edx
andb $0x3f, %dl
orb $-0x80, %dl
movb %dl, -0x1(%r14)
decq %r14
shrl $0x6, %r12d
leaq 0x55c6(%rip), %rdx      # 0xa950
orb (%rcx,%rdx), %r12b
movb %r12b, -0x1(%r14)
addq %rcx, %r14
decq %r14
jmp 0x53ad
movb $0xd, (%r14)
jmp 0x53aa
movb $0x9, (%r14)
jmp 0x53aa
movb $0xc, (%r14)
incq %r14
incq %rax
movq %rax, %r15
jmp 0x520c
xorl %eax, %eax
jmp 0x53db
movb $0x0, (%r14)
xorl %eax, %eax
cmpb $0x22, (%r15)
sete %al
addq %r15, %rax
movq -0x30(%rbp), %rcx
movq %rbx, 0x20(%rcx)
movl $0x4, 0x18(%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq