// File: /workspace/github_c_makefile_star2_O1/lengjingzju[P]json/json.c
// Function: parse_strcpy
static int _parse_strcpy(char *ptr, const char *str, int nsize)
{
    const char *bak = ptr, *last = str, *end = str + nsize;
    char ch = '\0';
    int size = 0, seq_len = 0;

    while (str < end) {
        if (unlikely(*str++ == '\\')) {
            switch ((*str++)) {
            case 'b' : ch = '\b'; break;
            case 'f' : ch = '\f'; break;
            case 'n' : ch = '\n'; break;
            case 'r' : ch = '\r'; break;
            case 't' : ch = '\t'; break;
            case 'v' : ch = '\v'; break;
            case '\"': ch = '\"'; break;
            case '\'': ch = '\''; break;
            case '\\': ch = '\\'; break;
            case '/' : ch = '/' ; break;
#if JSON_PARSE_SPECIAL_CHAR
            case '\r':
                size = (int)(str - last - 2);
                memcpy(ptr, last, size);
                ptr += size;
                if (*str == '\n')
                    ++str;
                last = str;
                continue;

            case '\n':
                size = (int)(str - last - 2);
                memcpy(ptr, last, size);
                ptr += size;
                last = str;
                continue;
#endif
            case 'u' :
                str -= 2;
                size = (int)(str - last);
                memcpy(ptr, last, size);
                ptr += size;
                if (unlikely((seq_len = utf16_literal_to_utf8((unsigned char*)str,
                    (unsigned char*)end, (unsigned char**)&ptr)) == 0)) {
                    JsonErr("invalid utf16 code(\\u%c)!\n", str[2]);
                    return -1;
                }
                str += seq_len;
                last = str;
                continue;
            default :
                JsonErr("invalid escape character(\\%c)!\n", str[1]);
                return -1;
            }

            size = (int)(str - last - 2);
            memcpy(ptr, last, size);
            ptr += size;
            *ptr++ = ch;
            last = str;
        }
    }

    size = (int)(str - last);
    memcpy(ptr, last, size);
    ptr += size;
    *ptr = '\0';
    return (int)(ptr - bak);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rdi, (%rsp)
testl %edx, %edx
jle 0x794f
movslq %edx, %r14
addq %rsi, %r14
leaq 0x2c5c(%rip), %rbp      # 0xa420
movq %rsp, %r15
movq %rsi, %r13
cmpb $0x5c, (%r13)
je 0x77e4
incq %r13
movq %r13, %r12
movq %r12, %r13
cmpq %r14, %r12
jb 0x77ca
jmp 0x7952
leaq 0x2(%r13), %r12
movb 0x1(%r13), %cl
movzbl %cl, %eax
cmpl $0x61, %eax
jle 0x780a
leal -0x6e(%rax), %ecx
cmpl $0x8, %ecx
ja 0x783f
movslq (%rbp,%rcx,4), %rax
addq %rbp, %rax
jmpq *%rax
movb $0xa, %cl
jmp 0x785d
cmpl $0x26, %eax
jg 0x782b
cmpl $0xa, %eax
je 0x78ea
cmpl $0xd, %eax
je 0x7911
cmpl $0x22, %eax
je 0x785d
jmp 0x7985
cmpl $0x27, %eax
je 0x785d
cmpl $0x2f, %eax
je 0x785d
cmpl $0x5c, %eax
je 0x785d
jmp 0x7985
movb $0x8, %cl
cmpl $0x62, %eax
je 0x785d
cmpl $0x66, %eax
jne 0x7985
movb $0xc, %cl
jmp 0x785d
movb $0xb, %cl
jmp 0x785d
movb $0x9, %cl
jmp 0x785d
movb $0xd, %cl
movb %cl, 0x8(%rsp)
movl %r12d, %eax
subl %esi, %eax
movq (%rsp), %rdi
movq %rdi, 0x10(%rsp)
addl $-0x2, %eax
movslq %eax, %r13
movq %r13, %rdx
callq 0x1150
movq 0x10(%rsp), %rax
addq %r13, %rax
incq %rax
movq %rax, (%rsp)
movb 0x8(%rsp), %cl
movb %cl, -0x1(%rax)
movq %r12, %rsi
jmp 0x77d7
movl %r13d, %eax
subl %esi, %eax
movq (%rsp), %rdi
movq %rdi, 0x8(%rsp)
movslq %eax, %rdx
movq %rdx, 0x10(%rsp)
callq 0x1150
movq 0x8(%rsp), %rax
addq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x79c3
testl %eax, %eax
je 0x79b9
movl %eax, %eax
addq %rax, %r13
movq %r13, %r12
movq %r13, %rsi
jmp 0x77d7
movl %r12d, %eax
subl %esi, %eax
movq (%rsp), %r13
addl $-0x2, %eax
movslq %eax, %rdx
movq %rdx, 0x8(%rsp)
movq %r13, %rdi
callq 0x1150
addq 0x8(%rsp), %r13
movq %r13, (%rsp)
jmp 0x7893
movl %r12d, %eax
subl %esi, %eax
movq (%rsp), %rdi
movq %rdi, 0x8(%rsp)
addl $-0x2, %eax
movslq %eax, %rdx
movq %rdx, 0x10(%rsp)
callq 0x1150
movq 0x8(%rsp), %rax
addq 0x10(%rsp), %rax
movq %rax, (%rsp)
cmpb $0xa, 0x2(%r13)
leaq 0x3(%r13), %rax
cmoveq %rax, %r12
jmp 0x7893
movq %rsi, %r12
subl %esi, %r12d
movq (%rsp), %r14
movslq %r12d, %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x1150
leaq (%r14,%r15), %rax
movq %rax, (%rsp)
movb $0x0, (%r14,%r15)
subl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2ad0(%rip), %rdi      # 0xa45c
leaq 0x2d8b(%rip), %rsi      # 0xa71e
movl $0x9b2, %edx            # imm = 0x9B2
xorl %eax, %eax
callq 0x10d0
movsbl 0x3(%r13), %esi
leaq 0x2d9c(%rip), %rdi      # 0xa747
xorl %eax, %eax
callq 0x10d0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x7976
movq %r12, %rdi
callq 0x2a0a
jmp 0x79b2