// File: /workspace/github_c_makefile_star2_O1/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 0x769c
movl %eax, %r12d
pushq $-0x1
popq %rax
testl %r12d, %r12d
js 0x1cac
movl %r12d, %r13d
movq %rsp, %rcx
movq %r14, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x751f
movl 0xc(%rsp), %ebx
cmpl $0x1, %ebx
je 0x1cbb
cmpl $0x0, (%r14)
js 0x1c2f
movq 0x38(%r14), %rax
addq $0x28, %rax
cmpq %rbp, %rax
je 0x1c54
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 0x1ca1
leal 0x1(%r12), %edi
callq 0x1160
testq %rax, %rax
je 0x1cf7
movq %rax, %rbp
movq (%rsp), %rsi
movq %rax, %rdi
movq %r13, %rdx
callq 0x1150
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 0x1160
testq %rax, %rax
je 0x1d22
movq %rax, %rbp
movq (%rsp), %rsi
movq %rax, %rdi
movl %r12d, %edx
callq 0x779a
testl %eax, %eax
js 0x1d37
movl %eax, %r12d
movzbl (%r15), %eax
movl %r12d, %ecx
shll $0x8, %ecx
orl %eax, %ecx
orl $0x30, %ecx
movl %ecx, (%r15)
jmp 0x1ca1
leaq 0x875e(%rip), %rdi      # 0xa45c
leaq 0x8b62(%rip), %rsi      # 0xa867
movl $0xe74, %edx            # imm = 0xE74
xorl %eax, %eax
callq 0x10d0
leaq 0x8c48(%rip), %rdi      # 0xa960
callq 0x1070
pushq $-0x1
popq %rax
jmp 0x1cac
leaq 0x8733(%rip), %rdi      # 0xa45c
leaq 0x8b37(%rip), %rsi      # 0xa867
movl $0xe81, %edx            # imm = 0xE81
jmp 0x1d0a
leaq 0x871e(%rip), %rdi      # 0xa45c
leaq 0x8b22(%rip), %rsi      # 0xa867
movl $0xe85, %edx            # imm = 0xE85
xorl %eax, %eax
callq 0x10d0
leaq 0x8be4(%rip), %rdi      # 0xa93c
callq 0x1070
movq %rbp, %rdi
callq 0x1030
movq 0x30(%r14), %rsi
testq %rsi, %rsi
je 0x1dc5
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r15
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
addq 0x10(%r14), %rsi
pushq $0x1f
popq %rdx
movq %r15, %rdi
callq 0x1050
leaq 0x86c7(%rip), %rdi      # 0xa45c
leaq 0x8acb(%rip), %rsi      # 0xa867
movl $0xe93, %edx            # imm = 0xE93
xorl %eax, %eax
callq 0x10d0
leaq 0x892d(%rip), %rdi      # 0xa6dc
leaq 0x8935(%rip), %rsi      # 0xa6eb
movq %r15, %rdx
xorl %eax, %eax
callq 0x10d0
jmp 0x1d1d
leaq 0x8690(%rip), %rdi      # 0xa45c
leaq 0x8a94(%rip), %rsi      # 0xa867
movl $0xe93, %edx            # imm = 0xE93
xorl %eax, %eax
callq 0x10d0
leaq 0x8905(%rip), %rdi      # 0xa6eb
jmp 0x1d18