// File: /workspace/github_c_makefile_star2_O3/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 0x761f
pushq $-0x1
popq %rbx
testl %eax, %eax
js 0x1b39
movl %eax, %r12d
movl %eax, %ebp
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x7498
leal 0x1(%r12), %edi
leaq 0xe755(%rip), %rax      # 0x10228
cmpq %rax, 0x38(%r14)
je 0x1ae3
movq %r13, %rsi
callq 0x4033
jmp 0x1ae8
callq 0x1150
movq %rax, %r13
testq %rax, %rax
je 0x1b4a
movl 0x4(%rsp), %ebx
movq 0x8(%rsp), %rsi
movq %r13, %rdi
cmpl $0x1, %ebx
je 0x1b72
movq %rbp, %rdx
callq 0x1140
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 0x890b(%rip), %rdi      # 0xa45c
leaq 0x8b71(%rip), %rsi      # 0xa6c9
movl $0xa14, %edx            # imm = 0xA14
xorl %eax, %eax
callq 0x10c0
leaq 0x8df5(%rip), %rdi      # 0xa960
callq 0x1060
jmp 0x1b39
movl %r12d, %edx
callq 0x7726
movl %eax, %r12d
testl %eax, %eax
jns 0x1b0f
leaq 0x88d4(%rip), %rdi      # 0xa45c
leaq 0x8b3a(%rip), %rsi      # 0xa6c9
movl $0xa1d, %edx            # imm = 0xA1D
xorl %eax, %eax
callq 0x10c0
leaq 0x8d9a(%rip), %rdi      # 0xa93c
callq 0x1060
leaq 0xe67a(%rip), %rax      # 0x10228
cmpq %rax, 0x38(%r14)
jne 0x1bbc
movq %r13, %rdi
callq 0x1030
movq 0x30(%r14), %rsi
testq %rsi, %rsi
je 0x1c15
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 0x8874(%rip), %rdi      # 0xa45c
leaq 0x8ada(%rip), %rsi      # 0xa6c9
movl $0xa2b, %edx            # imm = 0xA2B
xorl %eax, %eax
callq 0x10c0
leaq 0x8ada(%rip), %rdi      # 0xa6dc
leaq 0x8ae2(%rip), %rsi      # 0xa6eb
movq %r15, %rdx
xorl %eax, %eax
callq 0x10c0
jmp 0x1c3b
leaq 0x8840(%rip), %rdi      # 0xa45c
leaq 0x8aa6(%rip), %rsi      # 0xa6c9
movl $0xa2b, %edx            # imm = 0xA2B
xorl %eax, %eax
callq 0x10c0
leaq 0x8ab5(%rip), %rdi      # 0xa6eb
callq 0x1060
pushq $-0x1
popq %rbx
jmp 0x1b39