// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x68, %rsp
movb %sil, %al
movq %rdi, 0x58(%rsp)
movb %al, 0x57(%rsp)
movq %rdx, 0x48(%rsp)
movq %rcx, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
movl $0x0, 0x28(%rsp)
movl $0x0, 0x24(%rsp)
movq 0x48(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x10f0
movq 0x58(%rsp), %rdi
leaq 0x2c(%rsp), %rdx
movsbl 0x57(%rsp), %esi
callq 0xaf80
movl %eax, 0x24(%rsp)
cmpl $0x0, %eax
setl %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x6771
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
jmp 0x69ca
movl 0x24(%rsp), %eax
movl %eax, 0x28(%rsp)
movq 0x58(%rsp), %rdi
movslq 0x24(%rsp), %rdx
xorl %esi, %esi
leaq 0x30(%rsp), %rcx
callq 0xabb0
movq 0x58(%rsp), %rdi
movl 0x28(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
movq 0x40(%rsp), %rdx
callq 0xb270
movq %rax, 0x38(%rsp)
cmpq $0x0, %rax
sete %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x67fc
jmp 0x67c7
leaq 0xa226(%rip), %rdi      # 0x109f4
leaq 0xa570(%rip), %rsi      # 0x10d45
movl $0xa14, %edx            # imm = 0xA14
movb $0x0, %al
callq 0x10c0
leaq 0xa21e(%rip), %rdi      # 0x10a06
movb $0x0, %al
callq 0x10c0
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
jmp 0x69ca
cmpl $0x1, 0x2c(%rsp)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x6839
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movslq 0x28(%rsp), %rdx
callq 0x1150
movq 0x38(%rsp), %rax
movslq 0x28(%rsp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x68b1
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl 0x28(%rsp), %edx
callq 0xb2d0
movl %eax, 0x28(%rsp)
cmpl $0x0, %eax
setl %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x68af
jmp 0x6869
leaq 0xa184(%rip), %rdi      # 0x109f4
leaq 0xa4ce(%rip), %rsi      # 0x10d45
movl $0xa1d, %edx            # imm = 0xA1D
movb $0x0, %al
callq 0x10c0
leaq 0xa4ce(%rip), %rdi      # 0x10d58
movb $0x0, %al
callq 0x10c0
movq 0x58(%rsp), %rax
leaq 0xfa3b(%rip), %rcx      # 0x162d8
cmpq %rcx, 0x38(%rax)
jne 0x68ad
movq 0x38(%rsp), %rdi
callq 0x1030
jmp 0x691d
jmp 0x68b1
movslq 0x24(%rsp), %rcx
movq 0x58(%rsp), %rax
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
cmpl $0x0, 0x2c(%rsp)
setne %al
andb $0x1, %al
movzbl %al, %edx
movq 0x48(%rsp), %rax
movl (%rax), %ecx
andl $0x1, %edx
shll $0x4, %edx
andl $-0x11, %ecx
orl %edx, %ecx
movl %ecx, (%rax)
movl 0x28(%rsp), %edx
movq 0x48(%rsp), %rax
movl (%rax), %ecx
andl $0xffffff, %edx         # imm = 0xFFFFFF
shll $0x8, %edx
andl $0xff, %ecx
orl %edx, %ecx
movl %ecx, (%rax)
movq 0x38(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x8(%rax)
movl 0x28(%rsp), %eax
movl %eax, 0x64(%rsp)
jmp 0x69ca
jmp 0x691f
movq 0x58(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0x698d
movq %rsp, %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x10f0
movq %rsp, %rdi
movq 0x58(%rsp), %rax
movq 0x30(%rax), %rsi
movq 0x58(%rsp), %rax
addq 0x10(%rax), %rsi
movl $0x1f, %edx
callq 0x1050
leaq 0xa094(%rip), %rdi      # 0x109f4
leaq 0xa3de(%rip), %rsi      # 0x10d45
movl $0xa2b, %edx            # imm = 0xA2B
movb $0x0, %al
callq 0x10c0
movq %rsp, %rdx
leaq 0xa3f2(%rip), %rdi      # 0x10d6f
leaq 0xa3fa(%rip), %rsi      # 0x10d7e
movb $0x0, %al
callq 0x10c0
jmp 0x69c0
jmp 0x698f
leaq 0xa05e(%rip), %rdi      # 0x109f4
leaq 0xa3a8(%rip), %rsi      # 0x10d45
movl $0xa2b, %edx            # imm = 0xA2B
movb $0x0, %al
callq 0x10c0
leaq 0xa2b8(%rip), %rdi      # 0x10c68
leaq 0xa3c7(%rip), %rsi      # 0x10d7e
movb $0x0, %al
callq 0x10c0
jmp 0x69c0
jmp 0x69c2
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)