// File: /workspace/github_c_makefile_star2_O1/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), %r15
addq 0x10(%rdi), %r15
movq %r15, %rax
negq %rax
movl %r15d, %r11d
notl %r11d
movq %r11, %rsi
shlq $0x20, %rsi
movb $0x1, %r14b
movabsq $0x100000000, %rdi      # imm = 0x100000000
movq %r15, %r8
leaq 0x1(%r8), %r10
leaq (%rax,%r8), %r9
movq %r8, %r13
shlq $0x20, %r13
addq %rsi, %r13
addl %r11d, %r8d
movl %r8d, %ebp
movq %r10, %r8
movzbl -0x1(%r8), %r10d
testl %r10d, %r10d
je 0x5909
incq %r9
addq %rdi, %r13
incl %ebp
cmpl $0x22, %r10d
je 0x588a
incq %r8
cmpl $0x5c, %r10d
jne 0x5860
xorl %r14d, %r14d
jmp 0x5845
movq %rdx, 0x8(%rsp)
movslq %r9d, %rdi
leaq 0xa99f(%rip), %rax      # 0x10238
cmpq %rax, 0x38(%rbx)
je 0x58a9
movq %rcx, %rsi
callq 0x3c99
jmp 0x58ae
callq 0x1160
movq %rax, %r12
testq %rax, %rax
je 0x5904
testb $0x1, %r14b
je 0x59a4
movq %r13, %r14
sarq $0x20, %r14
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1150
movb $0x0, (%r12,%r14)
xorl %eax, %eax
movq 0x8(%rsp), %rdx
sarq $0x20, %r13
addq %r13, 0x10(%rbx)
movl $0xef, %ecx
andl (%rdx), %ecx
orl %eax, %ecx
movl %ebp, %eax
shll $0x8, %eax
orl %ecx, %eax
movl %eax, (%rdx)
movq %r12, 0x8(%rdx)
jmp 0x5993
callq 0x26ca
movq 0x30(%rbx), %rsi
testq %rsi, %rsi
je 0x5968
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
addq 0x10(%rbx), %rsi
movl $0x1f, %edx
movq %r14, %rdi
callq 0x1050
leaq 0x4b21(%rip), %rdi      # 0xa45c
leaq 0x4ef4(%rip), %rsi      # 0xa836
movl $0xcbc, %edx            # imm = 0xCBC
xorl %eax, %eax
callq 0x10d0
leaq 0x4d87(%rip), %rdi      # 0xa6dc
leaq 0x4d8f(%rip), %rsi      # 0xa6eb
movq %r14, %rdx
xorl %eax, %eax
callq 0x10d0
jmp 0x598e
leaq 0x4aed(%rip), %rdi      # 0xa45c
leaq 0x4ec0(%rip), %rsi      # 0xa836
movl $0xcbc, %edx            # imm = 0xCBC
xorl %eax, %eax
callq 0x10d0
leaq 0x4d62(%rip), %rdi      # 0xa6eb
callq 0x1070
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x779a
testl %eax, %eax
js 0x59c1
movl %eax, %ebp
movl $0x10, %eax
jmp 0x58dc
leaq 0x38(%rbx), %rdi
movq %r12, %rsi
callq 0x2677
jmp 0x5909