// File: /workspace/github_c_makefile_star2_O1/lengjingzju[P]json/json.c
// Function: parse_strlen
static int _parse_strlen(json_parse_t *parse_ptr, char end_ch UNUSED_END_CH, int *escaped)
{
#define PARSE_READ_SIZE    128
    char *str = NULL, *bak = NULL;
    int total = 0, rsize = 0;
    char c = '\0';

    _get_parse_ptr(parse_ptr, 0, PARSE_READ_SIZE, &str);
    bak = str;

    while (1) {
        switch ((c = *str++)) {
        case '\"':
#if JSON_PARSE_SPECIAL_QUOTES
        case '\'':
        case ':':
            if (c == end_ch)
#endif
            {
                total += (int)(str - bak - 1);
                return total;
            }
#if JSON_PARSE_SPECIAL_QUOTES
            if (c == '\"' && !*escaped)
                *escaped = -1;
            break;
#endif
        case '\\':
            if (likely(rsize != (str - bak))) {
                ++str;
                *escaped = 1;
            } else {
                --str;
                total += (int)(str - bak);
                if (unlikely((rsize = _get_parse_ptr(parse_ptr, total, PARSE_READ_SIZE, &str)) < 2)) {
                    JsonErr("last char is slash!\n");
                    goto err;
                }
                bak = str;
            }
            break;
        case '\0':
            --str;
            total += (int)(str - bak);
            if (unlikely((rsize = _get_parse_ptr(parse_ptr, total, PARSE_READ_SIZE, &str)) < 1)) {
                JsonErr("No more string!\n");
                goto err;
            }
            bak = str;
            break;
#if !JSON_PARSE_SPECIAL_CHAR
        case '\b': case '\f': case '\n': case '\r': case '\t': case '\v':
            JsonErr("tab and linebreak can't be existed in string in standard json!\n");
            goto err;
#endif
        default:
            break;
        }
    }

err:
    JsonPareseErr("str format err!");
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq $0x0, (%r15)
xorl %ebp, %ebp
movl $0x80, %edx
xorl %esi, %esi
movq %r15, %rcx
callq 0x751f
leaq 0x32ab(%rip), %r12      # 0xa97f
leaq 0x3294(%rip), %r13      # 0xa96f
xorl %eax, %eax
movq 0x8(%rsp), %rcx
movl %eax, %edx
movq %rcx, %rax
leaq 0x1(%rax), %rsi
movzbl (%rax), %edi
cmpl $0x5c, %edi
je 0x7701
testl %edi, %edi
je 0x7716
movq %rsi, %rax
cmpl $0x22, %edi
jne 0x76e7
jmp 0x775e
subq %rcx, %rsi
cmpq %rdx, %rsi
je 0x7737
addq $0x2, %rax
movl $0x1, (%r14)
jmp 0x76e7
movq %rax, 0x8(%rsp)
subl %ecx, %eax
addl %eax, %ebp
movl $0x80, %edx
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rcx
callq 0x751f
testl %eax, %eax
jg 0x76dd
jmp 0x777a
movq %rax, 0x8(%rsp)
subl %ecx, %eax
addl %eax, %ebp
movl $0x80, %edx
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rcx
callq 0x751f
cmpl $0x2, %eax
jge 0x76dd
movl $0x9e8, %esi            # imm = 0x9E8
jmp 0x7782
movq %rsi, 0x8(%rsp)
notl %ecx
addl %ecx, %esi
addl %esi, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x9f2, %esi            # imm = 0x9F2
movq %r13, %r12
leaq 0x14(%rsp), %r14
movq %rbx, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0x294b
movl (%r14), %ebp
jmp 0x7769