// File: /workspace/github_c_makefile_star2_O3/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 0x78e0
movslq %edx, %r14
addq %rsi, %r14
leaq 0x2cd0(%rip), %rbp      # 0xa420
movq %rsp, %r12
movq %rsi, %r15
movq %r15, %r13
cmpb $0x5c, (%r15)
je 0x776f
incq %r13
movq %r13, %r15
cmpq %r14, %r15
jb 0x7756
jmp 0x78da
leaq 0x2(%r13), %r15
movb 0x1(%r13), %cl
movzbl %cl, %eax
cmpl $0x61, %eax
jle 0x7795
leal -0x6e(%rax), %ecx
cmpl $0x8, %ecx
ja 0x77ca
movslq (%rbp,%rcx,4), %rax
addq %rbp, %rax
jmpq *%rax
movb $0xa, %cl
jmp 0x77e8
cmpl $0x26, %eax
jg 0x77b6
cmpl $0xa, %eax
je 0x7875
cmpl $0xd, %eax
je 0x789c
cmpl $0x22, %eax
je 0x77e8
jmp 0x7911
cmpl $0x27, %eax
je 0x77e8
cmpl $0x2f, %eax
je 0x77e8
cmpl $0x5c, %eax
je 0x77e8
jmp 0x7911
movb $0x8, %cl
cmpl $0x62, %eax
je 0x77e8
cmpl $0x66, %eax
jne 0x7911
movb $0xc, %cl
jmp 0x77e8
movb $0xb, %cl
jmp 0x77e8
movb $0x9, %cl
jmp 0x77e8
movb $0xd, %cl
movb %cl, 0x8(%rsp)
movl %r15d, %eax
subl %esi, %eax
movq (%rsp), %rdi
movq %rdi, 0x10(%rsp)
addl $-0x2, %eax
movslq %eax, %r13
movq %r13, %rdx
callq 0x1140
movq 0x10(%rsp), %rax
addq %r13, %rax
incq %rax
movq %rax, (%rsp)
movb 0x8(%rsp), %cl
movb %cl, -0x1(%rax)
movq %r15, %rsi
jmp 0x7765
movl %r13d, %eax
subl %esi, %eax
movq (%rsp), %rdi
movq %rdi, 0x8(%rsp)
movslq %eax, %rdx
movq %rdx, 0x10(%rsp)
callq 0x1140
movq 0x8(%rsp), %rax
addq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x794f
testl %eax, %eax
je 0x7945
movl %eax, %eax
addq %rax, %r13
movq %r13, %r15
movq %r13, %rsi
jmp 0x7765
movl %r15d, %eax
subl %esi, %eax
movq (%rsp), %r13
addl $-0x2, %eax
movslq %eax, %rdx
movq %rdx, 0x8(%rsp)
movq %r13, %rdi
callq 0x1140
addq 0x8(%rsp), %r13
movq %r13, (%rsp)
jmp 0x781e
movl %r15d, %eax
subl %esi, %eax
movq (%rsp), %rdi
movq %rdi, 0x8(%rsp)
addl $-0x2, %eax
movslq %eax, %rdx
movq %rdx, 0x10(%rsp)
callq 0x1140
movq 0x8(%rsp), %rax
addq 0x10(%rsp), %rax
movq %rax, (%rsp)
cmpb $0xa, 0x2(%r13)
leaq 0x3(%r13), %rax
cmoveq %rax, %r15
jmp 0x781e
movq (%rsp), %r14
jmp 0x78e6
movq %rbx, %r14
movq %rsi, %r15
subl %esi, %r15d
movslq %r15d, %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x1140
leaq (%r14,%r15), %rax
movb $0x0, (%r14,%r15)
subl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2b44(%rip), %rdi      # 0xa45c
leaq 0x2dff(%rip), %rsi      # 0xa71e
movl $0x9b2, %edx            # imm = 0x9B2
xorl %eax, %eax
callq 0x10c0
movsbl 0x3(%r13), %esi
leaq 0x2e10(%rip), %rdi      # 0xa747
xorl %eax, %eax
callq 0x10c0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x7902
movq %r15, %rdi
callq 0x2da1
jmp 0x793e