// File: /workspace/github_c_makefile_star2_O2/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 0x5cd1
movl %eax, %r12d
pushq $-0x1
popq %rax
testl %r12d, %r12d
js 0x5871
movl %r12d, %r13d
movq %rsp, %rcx
movq %r14, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x5b5b
movl 0xc(%rsp), %ebx
cmpl $0x1, %ebx
je 0x5880
cmpl $0x0, (%r14)
js 0x57f4
movq 0x38(%r14), %rax
addq $0x28, %rax
cmpq %rbp, %rax
je 0x5819
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 0x5866
leal 0x1(%r12), %edi
callq 0x1150
testq %rax, %rax
je 0x58bc
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 0x58e7
movq %rax, %rbp
movq (%rsp), %rsi
movq %rax, %rdi
movl %r12d, %edx
callq 0x5e82
testl %eax, %eax
js 0x58fc
movl %eax, %r12d
movzbl (%r15), %eax
movl %r12d, %ecx
shll $0x8, %ecx
orl %eax, %ecx
orl $0x30, %ecx
movl %ecx, (%r15)
jmp 0x5866
leaq 0x2b99(%rip), %rdi      # 0x845c
leaq 0x2f9d(%rip), %rsi      # 0x8867
movl $0xe74, %edx            # imm = 0xE74
xorl %eax, %eax
callq 0x10c0
leaq 0x3083(%rip), %rdi      # 0x8960
callq 0x1060
pushq $-0x1
popq %rax
jmp 0x5871
leaq 0x2b6e(%rip), %rdi      # 0x845c
leaq 0x2f72(%rip), %rsi      # 0x8867
movl $0xe81, %edx            # imm = 0xE81
jmp 0x58cf
leaq 0x2b59(%rip), %rdi      # 0x845c
leaq 0x2f5d(%rip), %rsi      # 0x8867
movl $0xe85, %edx            # imm = 0xE85
xorl %eax, %eax
callq 0x10c0
leaq 0x301f(%rip), %rdi      # 0x893c
callq 0x1060
movq %rbp, %rdi
callq 0x1030
movq 0x30(%r14), %rsi
testq %rsi, %rsi
je 0x5986
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 0x2b06(%rip), %rdi      # 0x845c
leaq 0x2f0a(%rip), %rsi      # 0x8867
movl $0xe93, %edx            # imm = 0xE93
xorl %eax, %eax
callq 0x10c0
leaq 0x2d6c(%rip), %rdi      # 0x86dc
leaq 0x2d74(%rip), %rsi      # 0x86eb
movq %r15, %rdx
xorl %eax, %eax
callq 0x10c0
jmp 0x58e2
leaq 0x2acf(%rip), %rdi      # 0x845c
leaq 0x2ed3(%rip), %rsi      # 0x8867
movl $0xe93, %edx            # imm = 0xE93
xorl %eax, %eax
callq 0x10c0
leaq 0x2d44(%rip), %rdi      # 0x86eb
jmp 0x58dd