// File: /workspace/github_c_makefile_star2_O1/lengjingzju[P]json/json.c
// Function: json_parse_string
static int _json_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 escaped = 0;
    int len = 0, total = 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 (unlikely((ptr = (char *)_parse_alloc(parse_ptr, len + 1, mgr)) == NULL)) {
        JsonErr("malloc failed!\n");
        return -1;
    }

    if (likely(escaped != 1)) {
        memcpy(ptr, str, len);
        ptr[len] = '\0';
    } else {
        if (unlikely((len = _parse_strcpy(ptr, str, 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 %rcx, %r13
andq $0x0, 0x8(%rsp)
leaq 0x4(%rsp), %rsi
andl $0x0, (%rsi)
movq %rdx, %r15
movq %rdi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
callq 0x769c
pushq $-0x1
popq %rbx
testl %eax, %eax
js 0x1ab0
movl %eax, %r12d
movl %eax, %ebp
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x751f
leal 0x1(%r12), %edi
leaq 0xe7ee(%rip), %rax      # 0x10238
cmpq %rax, 0x38(%r14)
je 0x1a5a
movq %r13, %rsi
callq 0x3c99
jmp 0x1a5f
callq 0x1160
movq %rax, %r13
testq %rax, %rax
je 0x1ac1
movl 0x4(%rsp), %ebx
movq 0x8(%rsp), %rsi
movq %r13, %rdi
cmpl $0x1, %ebx
je 0x1ae9
movq %rbp, %rdx
callq 0x1150
movb $0x0, (%r13,%rbp)
addq %rbp, 0x10(%r14)
xorl %eax, %eax
testl %ebx, %ebx
setne %al
movl $0xef, %ecx
andl (%r15), %ecx
shll $0x4, %eax
orl %eax, %ecx
movl %r12d, %eax
shll $0x8, %eax
orl %ecx, %eax
movl %eax, (%r15)
movq %r13, 0x8(%r15)
movl %r12d, %ebx
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8994(%rip), %rdi      # 0xa45c
leaq 0x8bfa(%rip), %rsi      # 0xa6c9
movl $0xa14, %edx            # imm = 0xA14
xorl %eax, %eax
callq 0x10d0
leaq 0x8e7e(%rip), %rdi      # 0xa960
callq 0x1070
jmp 0x1ab0
movl %r12d, %edx
callq 0x779a
movl %eax, %r12d
testl %eax, %eax
jns 0x1a86
leaq 0x895d(%rip), %rdi      # 0xa45c
leaq 0x8bc3(%rip), %rsi      # 0xa6c9
movl $0xa1d, %edx            # imm = 0xA1D
xorl %eax, %eax
callq 0x10d0
leaq 0x8e23(%rip), %rdi      # 0xa93c
callq 0x1070
leaq 0xe713(%rip), %rax      # 0x10238
cmpq %rax, 0x38(%r14)
jne 0x1b33
movq %r13, %rdi
callq 0x1030
movq 0x30(%r14), %rsi
testq %rsi, %rsi
je 0x1b90
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 0x88f9(%rip), %rdi      # 0xa45c
leaq 0x8b5f(%rip), %rsi      # 0xa6c9
movl $0xa2b, %edx            # imm = 0xA2B
xorl %eax, %eax
callq 0x10d0
leaq 0x8b5f(%rip), %rdi      # 0xa6dc
leaq 0x8b67(%rip), %rsi      # 0xa6eb
movq %r15, %rdx
xorl %eax, %eax
callq 0x10d0
jmp 0x1bb6
leaq 0x88c5(%rip), %rdi      # 0xa45c
leaq 0x8b2b(%rip), %rsi      # 0xa6c9
movl $0xa2b, %edx            # imm = 0xA2B
xorl %eax, %eax
callq 0x10d0
leaq 0x8b3a(%rip), %rdi      # 0xa6eb
callq 0x1070
pushq $-0x1
popq %rbx
jmp 0x1ab0