// File: /workspace/github_c_makefile_star2_O2/lengjingzju[P]json/json.c
// Function: json_parse_string_rapid
static int _json_parse_string_rapid(json_parse_t *parse_ptr, char end_ch UNUSED_END_CH, json_string_t *jstr, json_mem_mgr_t *mgr)
{
    char *str = NULL, *bak = NULL, *ptr= NULL;
    char c = '\0';
    int len = 0, total = 0;
    int escaped = 0;

    memset(jstr, 0, sizeof(json_string_t));
    str = parse_ptr->str + parse_ptr->offset;
    bak = str;

    while (1) {
        switch ((c = *str++)) {
        case '\"':
#if JSON_PARSE_SPECIAL_QUOTES
        case '\'':
        case ':':
            if (c == end_ch)
#endif
            {
                goto next;
            }
#if JSON_PARSE_SPECIAL_QUOTES
            if (c == '\"' && !escaped)
                escaped = -1;
            break;
#endif

        case '\0':
            goto err;
        case '\\':
            ++str;
            escaped = 1;
            break;
#if !JSON_PARSE_SPECIAL_CHAR
        case '\b': case '\f': case '\n': case '\r': case '\t': case '\v':
            JsonErr("tab and linebreak can't be existed in string in standard json!\n");
            goto err;
#endif
        default:
            break;
        }
    }

next:
    total = (int)(str - bak - 1);
    len = total;
    if (unlikely((ptr = (char *)_parse_alloc(parse_ptr, len + 1, mgr)) == NULL)) {
        JsonErr("malloc failed!\n");
        goto err;
    }

    if (likely(escaped != 1)) {
        memcpy(ptr, bak, len);
        ptr[len] = '\0';
    } else {
        if (unlikely((len = _parse_strcpy(ptr, bak, len)) < 0)) {
            JsonErr("_parse_strcpy failed!\n");
            if (parse_ptr->mem == &s_invalid_json_mem)
                json_free(ptr);
            goto err;
        }
    }
    _UPDATE_PARSE_OFFSET(total);

    jstr->escaped = escaped != 0;
    jstr->len = len;
    jstr->str = ptr;
    return len;
err:
    JsonPareseErr("parse string failed!");
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
movq 0x30(%rdi), %r12
addq 0x10(%rdi), %r12
movq %r12, %rax
negq %rax
movl %r12d, %r14d
notl %r14d
movq %r14, %rsi
shlq $0x20, %rsi
movb $0x1, %r11b
movabsq $0x100000000, %rdi      # imm = 0x100000000
movq %r12, %r8
leaq 0x1(%r8), %r10
leaq (%rax,%r8), %r9
movq %r8, %r15
shlq $0x20, %r15
addq %rsi, %r15
addl %r14d, %r8d
movl %r8d, %ebp
movq %r10, %r8
movzbl -0x1(%r8), %r10d
testl %r10d, %r10d
je 0x45c9
incq %r9
addq %rdi, %r15
incl %ebp
cmpl $0x22, %r10d
je 0x453d
incq %r8
cmpl $0x5c, %r10d
jne 0x4513
xorl %r11d, %r11d
jmp 0x44f8
movq %rdx, 0x8(%rsp)
movl %r11d, %r14d
movslq %r9d, %rsi
movq %rbx, %rdi
movq %rcx, %rdx
callq 0x5e62
testq %rax, %rax
je 0x45a3
movq %rax, %r13
testb $0x1, %r14b
je 0x465c
sarq $0x20, %r15
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1140
movb $0x0, (%r13,%r15)
xorl %eax, %eax
addq %r15, 0x10(%rbx)
movl $0xef, %ecx
movq 0x8(%rsp), %rdx
andl (%rdx), %ecx
orl %eax, %ecx
movl %ebp, %eax
shll $0x8, %eax
orl %ecx, %eax
movl %eax, (%rdx)
movq %r13, 0x8(%rdx)
jmp 0x464b
leaq 0x3eb2(%rip), %rdi      # 0x845c
leaq 0x4285(%rip), %rsi      # 0x8836
movl $0xca6, %edx            # imm = 0xCA6
xorl %eax, %eax
callq 0x10c0
leaq 0x439c(%rip), %rdi      # 0x8960
callq 0x1060
movq 0x30(%rbx), %rsi
testq %rsi, %rsi
je 0x4622
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, 0x10(%r14)
addq 0x10(%rbx), %rsi
pushq $0x1f
popq %rdx
movq %r14, %rdi
callq 0x1050
leaq 0x3e67(%rip), %rdi      # 0x845c
leaq 0x423a(%rip), %rsi      # 0x8836
movl $0xcbc, %edx            # imm = 0xCBC
xorl %eax, %eax
callq 0x10c0
leaq 0x40cd(%rip), %rdi      # 0x86dc
leaq 0x40d5(%rip), %rsi      # 0x86eb
movq %r14, %rdx
xorl %eax, %eax
callq 0x10c0
jmp 0x4648
leaq 0x3e33(%rip), %rdi      # 0x845c
leaq 0x4206(%rip), %rsi      # 0x8836
movl $0xcbc, %edx            # imm = 0xCBC
xorl %eax, %eax
callq 0x10c0
leaq 0x40a8(%rip), %rdi      # 0x86eb
callq 0x1060
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x5e82
testl %eax, %eax
js 0x467b
movl %eax, %ebp
sarq $0x20, %r15
pushq $0x10
popq %rax
jmp 0x457f
leaq 0x3dda(%rip), %rdi      # 0x845c
leaq 0x41ad(%rip), %rsi      # 0x8836
movl $0xcaf, %edx            # imm = 0xCAF
xorl %eax, %eax
callq 0x10c0
leaq 0x42a0(%rip), %rdi      # 0x893c
callq 0x1060
leaq 0x9b80(%rip), %rax      # 0xe228
cmpq %rax, 0x38(%rbx)
jne 0x45c9
movq %r13, %rdi
callq 0x1030
jmp 0x45c9