// File: /workspace/github_c_makefile_star2_O3/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 %rdx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
movq 0x30(%rdi), %r12
addq 0x10(%rdi), %r12
movq %r12, %rax
negq %rax
movl %r12d, %edx
notl %edx
movq %rdx, %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 %edx, %r8d
movl %r8d, %ebp
movq %r10, %r8
movzbl -0x1(%r8), %r10d
testl %r10d, %r10d
je 0x5c2c
incq %r9
addq %rdi, %r15
incl %ebp
cmpl $0x22, %r10d
je 0x5bb5
incq %r8
cmpl $0x5c, %r10d
jne 0x5b8b
xorl %r11d, %r11d
jmp 0x5b70
movl %r11d, 0xc(%rsp)
movslq %r9d, %rdi
leaq 0xa664(%rip), %rax      # 0x10228
cmpq %rax, 0x38(%rbx)
je 0x5bd4
movq %rcx, %rsi
callq 0x4033
jmp 0x5bd9
callq 0x1150
movq %rax, %r13
testq %rax, %rax
je 0x5c27
testb $0x1, 0xc(%rsp)
je 0x5cc3
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
andl (%r14), %ecx
orl %eax, %ecx
movl %ebp, %eax
shll $0x8, %eax
orl %ecx, %eax
movl %eax, (%r14)
movq %r13, 0x8(%r14)
jmp 0x5cb2
callq 0x274e
movq 0x30(%rbx), %rsi
testq %rsi, %rsi
je 0x5c87
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, 0x10(%r14)
addq 0x10(%rbx), %rsi
movl $0x1f, %edx
movq %r14, %rdi
callq 0x1050
leaq 0x4802(%rip), %rdi      # 0xa45c
leaq 0x4bd5(%rip), %rsi      # 0xa836
movl $0xcbc, %edx            # imm = 0xCBC
xorl %eax, %eax
callq 0x10c0
leaq 0x4a68(%rip), %rdi      # 0xa6dc
leaq 0x4a70(%rip), %rsi      # 0xa6eb
movq %r14, %rdx
xorl %eax, %eax
callq 0x10c0
jmp 0x5cad
leaq 0x47ce(%rip), %rdi      # 0xa45c
leaq 0x4ba1(%rip), %rsi      # 0xa836
movl $0xcbc, %edx            # imm = 0xCBC
xorl %eax, %eax
callq 0x10c0
leaq 0x4a43(%rip), %rdi      # 0xa6eb
callq 0x1060
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 %r13, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x7726
testl %eax, %eax
js 0x5ce4
movl %eax, %ebp
sarq $0x20, %r15
movl $0x10, %eax
jmp 0x5c06
leaq 0x38(%rbx), %rdi
movq %r13, %rsi
callq 0x26fb
jmp 0x5c2c