// File: fgheng[P]keysound/src/cJSON.cc
// Function: parse_string(cJSON*, char const*)
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
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
je 0xffc7
movq -0x18(%rbp), %rax
movq %rax, 0x11cae(%rip)     # 0x21c68
movq $0x0, -0x8(%rbp)
jmp 0x103be
jmp 0xffc9
movq -0x20(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x22, %ecx
movb %al, -0x3d(%rbp)
je 0xfffa
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x3d(%rbp)
je 0xfffa
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
setne %al
movb %al, -0x3d(%rbp)
movb -0x3d(%rbp), %al
testb $0x1, %al
jne 0x10003
jmp 0x10028
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x10026
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xffc9
movq 0xf381(%rip), %rax      # 0x1f3b0
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdi
callq *%rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x10052
movq $0x0, -0x8(%rbp)
jmp 0x103be
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x22, %ecx
movb %al, -0x3e(%rbp)
je 0x10084
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
setne %al
movb %al, -0x3e(%rbp)
movb -0x3e(%rbp), %al
testb $0x1, %al
jne 0x10090
jmp 0x10380
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
je 0x100c3
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb (%rax), %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, (%rax)
jmp 0x1037b
movq -0x20(%rbp), %rax
incq %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
addl $-0x62, %eax
movl %eax, %ecx
movq %rcx, -0x48(%rbp)
subl $0x13, %eax
ja 0x10358
movq -0x48(%rbp), %rax
leaq 0x6806(%rip), %rcx      # 0x168f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movb $0x8, (%rax)
jmp 0x1036f
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movb $0xc, (%rax)
jmp 0x1036f
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movb $0xa, (%rax)
jmp 0x1036f
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movb $0xd, (%rax)
jmp 0x1036f
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movb $0x9, (%rax)
jmp 0x1036f
movq -0x20(%rbp), %rdi
addq $0x1, %rdi
callq 0x10ad0
movl %eax, -0x38(%rbp)
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
cmpl $0xdc00, -0x38(%rbp)    # imm = 0xDC00
jb 0x1019c
cmpl $0xdfff, -0x38(%rbp)    # imm = 0xDFFF
jbe 0x101a2
cmpl $0x0, -0x38(%rbp)
jne 0x101a7
jmp 0x1036f
cmpl $0xd800, -0x38(%rbp)    # imm = 0xD800
jb 0x10229
cmpl $0xdbff, -0x38(%rbp)    # imm = 0xDBFF
ja 0x10229
movq -0x20(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x5c, %eax
jne 0x101d3
movq -0x20(%rbp), %rax
movsbl 0x2(%rax), %eax
cmpl $0x75, %eax
je 0x101d8
jmp 0x1036f
movq -0x20(%rbp), %rdi
addq $0x3, %rdi
callq 0x10ad0
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x20(%rbp)
cmpl $0xdc00, -0x3c(%rbp)    # imm = 0xDC00
jb 0x10206
cmpl $0xdfff, -0x3c(%rbp)    # imm = 0xDFFF
jbe 0x1020b
jmp 0x1036f
movl -0x38(%rbp), %eax
andl $0x3ff, %eax            # imm = 0x3FF
shll $0xa, %eax
movl -0x3c(%rbp), %ecx
andl $0x3ff, %ecx            # imm = 0x3FF
orl %ecx, %eax
addl $0x10000, %eax          # imm = 0x10000
movl %eax, -0x38(%rbp)
movl $0x4, -0x34(%rbp)
cmpl $0x80, -0x38(%rbp)
jae 0x10242
movl $0x1, -0x34(%rbp)
jmp 0x10268
cmpl $0x800, -0x38(%rbp)     # imm = 0x800
jae 0x10254
movl $0x2, -0x34(%rbp)
jmp 0x10266
cmpl $0x10000, -0x38(%rbp)   # imm = 0x10000
jae 0x10264
movl $0x3, -0x34(%rbp)
jmp 0x10266
jmp 0x10268
movslq -0x34(%rbp), %rcx
movq -0x28(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl -0x34(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x3, %eax
ja 0x10345
movq -0x50(%rbp), %rax
leaq 0x66b2(%rip), %rcx      # 0x16948
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x38(%rbp), %eax
orl $0x80, %eax
andl $0xbf, %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, -0x1(%rax)
movl -0x38(%rbp), %eax
shrl $0x6, %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
orl $0x80, %eax
andl $0xbf, %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, -0x1(%rax)
movl -0x38(%rbp), %eax
shrl $0x6, %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
orl $0x80, %eax
andl $0xbf, %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, -0x1(%rax)
movl -0x38(%rbp), %eax
shrl $0x6, %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movslq -0x34(%rbp), %rdx
leaq 0x662d(%rip), %rcx      # 0x16958
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, -0x1(%rax)
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
jmp 0x1036f
movq -0x20(%rbp), %rax
movb (%rax), %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x10066
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x1039f
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movl $0x4, 0x18(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)