// File: /workspace/github_c_makefile_star2_O2/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 %rsi, %r9
movq %rsp, %rcx
movq %rdi, 0x10(%rsp)
movq %rdi, (%rcx)
movslq %edx, %r15
addq %rsi, %r15
pushq $0x2
popq %rcx
pushq $-0x1
popq %rdx
movabsq $0x100000000, %rbx      # imm = 0x100000000
movabsq $-0x100000000, %rsi     # imm = 0xFFFFFFFF00000000
leaq 0x2573(%rip), %r8       # 0x8438
movq %r9, %r12
xorl %eax, %eax
movq %rdx, %rbp
xorl %r13d, %r13d
leaq (%r12,%rax), %rdx
cmpq %r15, %rdx
jae 0x608a
addq %rbx, %r13
leaq 0x1(%rcx), %r14
incq %rbp
incq %rax
cmpb $0x5c, -0x2(%r12,%rcx)
movq %r14, %rcx
jne 0x5ed0
leaq (%r12,%rax), %r9
incq %r9
movb -0x2(%r12,%r14), %dl
movzbl %dl, %eax
leal -0x6e(%rax), %ecx
cmpl $0x8, %ecx
movq %r9, 0x8(%rsp)
jbe 0x5f4b
cmpl $0xa, %eax
je 0x5fae
cmpl $0xd, %eax
je 0x5fef
cmpl $0x22, %eax
je 0x5f62
cmpl $0x27, %eax
je 0x5f62
cmpl $0x2f, %eax
je 0x5f62
cmpl $0x5c, %eax
je 0x5f62
movb $0x8, %dl
cmpl $0x62, %eax
je 0x5f62
cmpl $0x66, %eax
jne 0x60bc
movb $0xc, %dl
jmp 0x5f62
movslq (%r8,%rcx,4), %rax
addq %r8, %rax
jmpq *%rax
movb $0xa, %dl
jmp 0x5f62
movb $0x9, %dl
jmp 0x5f62
movb $0xd, %dl
jmp 0x5f62
movb $0xb, %dl
movq (%rsp), %rbp
addq %rsi, %r13
sarq $0x20, %r13
movq %rsi, %r14
movq %rbp, %rdi
movq %r12, %rsi
movl %edx, %r12d
movq %r13, %rdx
callq 0x1140
movq %r14, %rsi
leaq 0x1(,%r13), %rax
addq %rbp, %rax
movq %rax, (%rsp)
movb %r12b, -0x1(%rax)
pushq $0x2
popq %rcx
pushq $-0x1
popq %rdx
leaq 0x2494(%rip), %r8       # 0x8438
movq 0x8(%rsp), %r9
jmp 0x5ec5
movq (%rsp), %rbp
addq %rsi, %r13
sarq $0x20, %r13
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r8, %r12
movq %r9, %r14
callq 0x1140
movq %r14, %r9
movq %r12, %r8
movabsq $-0x100000000, %rsi     # imm = 0xFFFFFFFF00000000
pushq $-0x1
popq %rdx
pushq $0x2
popq %rcx
addq %rbp, %r13
movq %r13, (%rsp)
jmp 0x5ec5
movq (%rsp), %rbp
addq %rsi, %r13
sarq $0x20, %r13
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x1140
movq 0x8(%rsp), %r9
leaq 0x2424(%rip), %r8       # 0x8438
movabsq $-0x100000000, %rsi     # imm = 0xFFFFFFFF00000000
pushq $-0x1
popq %rdx
pushq $0x2
popq %rcx
addq %rbp, %r13
movq %r13, (%rsp)
leaq (%r12,%r14), %rax
cmpb $0xa, -0x1(%r12,%r14)
cmoveq %rax, %r9
jmp 0x5ec5
addq %r12, %rbp
movq (%rsp), %rdi
movq %rdi, 0x8(%rsp)
addq %rsi, %r13
sarq $0x20, %r13
movq %r12, %rsi
movq %r13, %rdx
callq 0x1140
addq 0x8(%rsp), %r13
movq %r13, (%rsp)
movq %rbp, %rdi
movq %r15, %rsi
movq %rsp, %rdx
callq 0x6117
testl %eax, %eax
je 0x60ee
movl %eax, %eax
addq %rax, %rbp
movq %rbp, %r9
pushq $0x2
popq %rcx
pushq $-0x1
popq %rdx
jmp 0x5eb4
movq (%rsp), %r14
sarq $0x20, %r13
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x1140
leaq (%r14,%r13), %rax
movb $0x0, (%r14,%r13)
subl 0x10(%rsp), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2399(%rip), %rdi      # 0x845c
leaq 0x2654(%rip), %rsi      # 0x871e
movl $0x9b2, %edx            # imm = 0x9B2
xorl %eax, %eax
callq 0x10c0
movsbl (%r12,%r14), %esi
leaq 0x2665(%rip), %rdi      # 0x8747
xorl %eax, %eax
callq 0x10c0
pushq $-0x1
popq %rax
jmp 0x60ad
leaq 0x2367(%rip), %rdi      # 0x845c
leaq 0x2622(%rip), %rsi      # 0x871e
movl $0x9ab, %edx            # imm = 0x9AB
xorl %eax, %eax
callq 0x10c0
movsbl -0x1(%r12,%r14), %esi
leaq 0x2617(%rip), %rdi      # 0x872c
jmp 0x60e2