// File: /workspace/github_c_makefile_star2_O3/lengjingzju[P]json/json.c
// Function: json_sax_parse_string
static inline int _json_sax_parse_string(json_parse_t *parse_ptr, char end_ch, json_string_t *jstr, json_mem_mgr_t *mgr)
{
    char *ptr = NULL, *str = NULL;
    int len = 0, total = 0;
    int escaped = 0;

    memset(jstr, 0, sizeof(json_string_t));
    if (unlikely((total = _parse_strlen(parse_ptr, end_ch, &escaped)) < 0)) {
        return -1;
    }
    len = total;
    _get_parse_ptr(parse_ptr, 0, total, &str);

    if (likely(escaped != 1)) {
        if (!(parse_ptr->fd >= 0 && mgr == &parse_ptr->mem->key_mgr)) {
            jstr->escaped = escaped != 0;
            jstr->alloced = 0;
            jstr->len = len;
            jstr->str = str;
        } else {
            if (unlikely((ptr = (char *)json_malloc(len+1)) == NULL)) {
                JsonErr("malloc failed!\n");
                return -1;
            }
            memcpy(ptr, str, len);
            ptr[len] = '\0';

            jstr->escaped = escaped != 0;
            jstr->alloced = 1;
            jstr->len = len;
            jstr->str = ptr;
        }
    } else {
        if (unlikely((ptr = (char *)json_malloc(len+1)) == NULL)) {
            JsonErr("malloc failed!\n");
            return -1;
        }
        if (unlikely((len = _parse_strcpy(ptr, str, len)) < 0)) {
            JsonErr("_parse_strcpy failed!\n");
            json_free(ptr);
            goto err;
        }

        jstr->escaped = 1;
        jstr->alloced = 1;
        jstr->len = len;
        jstr->str = ptr;
    }
    _UPDATE_PARSE_OFFSET(total);

    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 %rcx, %rbp
andq $0x0, (%rsp)
leaq 0xc(%rsp), %rsi
andl $0x0, (%rsi)
movq %rdx, %r15
movq %rdi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
callq 0x761f
movl %eax, %r12d
pushq $-0x1
popq %rax
testl %r12d, %r12d
js 0x1d31
movl %r12d, %r13d
movq %rsp, %rcx
movq %r14, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x7498
movl 0xc(%rsp), %ebx
cmpl $0x1, %ebx
je 0x1d40
cmpl $0x0, (%r14)
js 0x1cb4
movq 0x38(%r14), %rax
addq $0x28, %rax
cmpq %rbp, %rax
je 0x1cd9
xorl %eax, %eax
testl %ebx, %ebx
setne %al
shll $0x4, %eax
movl $0xcf, %ecx
andl (%r15), %ecx
orl %eax, %ecx
movl %r12d, %eax
shll $0x8, %eax
orl %ecx, %eax
movl %eax, (%r15)
movq (%rsp), %rbp
jmp 0x1d26
leal 0x1(%r12), %edi
callq 0x1150
testq %rax, %rax
je 0x1d7c
movq %rax, %rbp
movq (%rsp), %rsi
movq %rax, %rdi
movq %r13, %rdx
callq 0x1140
movb $0x0, (%rbp,%r13)
xorl %eax, %eax
testl %ebx, %ebx
setne %al
shll $0x4, %eax
movl $0xcf, %ecx
andl (%r15), %ecx
orl %eax, %ecx
movl %r12d, %eax
shll $0x8, %eax
addl %ecx, %eax
addl $0x20, %eax
movl %eax, (%r15)
movq %rbp, 0x8(%r15)
addq %r13, 0x10(%r14)
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r12d, %edi
incl %edi
callq 0x1150
testq %rax, %rax
je 0x1da7
movq %rax, %rbp
movq (%rsp), %rsi
movq %rax, %rdi
movl %r12d, %edx
callq 0x7726
testl %eax, %eax
js 0x1dbc
movl %eax, %r12d
movzbl (%r15), %eax
movl %r12d, %ecx
shll $0x8, %ecx
orl %eax, %ecx
orl $0x30, %ecx
movl %ecx, (%r15)
jmp 0x1d26
leaq 0x86d9(%rip), %rdi      # 0xa45c
leaq 0x8add(%rip), %rsi      # 0xa867
movl $0xe74, %edx            # imm = 0xE74
xorl %eax, %eax
callq 0x10c0
leaq 0x8bc3(%rip), %rdi      # 0xa960
callq 0x1060
pushq $-0x1
popq %rax
jmp 0x1d31
leaq 0x86ae(%rip), %rdi      # 0xa45c
leaq 0x8ab2(%rip), %rsi      # 0xa867
movl $0xe81, %edx            # imm = 0xE81
jmp 0x1d8f
leaq 0x8699(%rip), %rdi      # 0xa45c
leaq 0x8a9d(%rip), %rsi      # 0xa867
movl $0xe85, %edx            # imm = 0xE85
xorl %eax, %eax
callq 0x10c0
leaq 0x8b5f(%rip), %rdi      # 0xa93c
callq 0x1060
movq %rbp, %rdi
callq 0x1030
movq 0x30(%r14), %rsi
testq %rsi, %rsi
je 0x1e46
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r15
movaps %xmm0, 0x10(%r15)
addq 0x10(%r14), %rsi
pushq $0x1f
popq %rdx
movq %r15, %rdi
callq 0x1050
leaq 0x8646(%rip), %rdi      # 0xa45c
leaq 0x8a4a(%rip), %rsi      # 0xa867
movl $0xe93, %edx            # imm = 0xE93
xorl %eax, %eax
callq 0x10c0
leaq 0x88ac(%rip), %rdi      # 0xa6dc
leaq 0x88b4(%rip), %rsi      # 0xa6eb
movq %r15, %rdx
xorl %eax, %eax
callq 0x10c0
jmp 0x1da2
leaq 0x860f(%rip), %rdi      # 0xa45c
leaq 0x8a13(%rip), %rsi      # 0xa867
movl $0xe93, %edx            # imm = 0xE93
xorl %eax, %eax
callq 0x10c0
leaq 0x8884(%rip), %rdi      # 0xa6eb
jmp 0x1d9d