// File: /workspace/github_c_makefile_star2_O2/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 $0x38, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rsp), %r12
andq $0x0, (%r12)
xorl %ebp, %ebp
movl $0x80, %edx
xorl %esi, %esi
movq %r12, %rcx
callq 0x5b5b
leaq 0x2c78(%rip), %r14      # 0x897f
leaq 0x2c61(%rip), %r13      # 0x896f
xorl %eax, %eax
movq 0x8(%rsp), %rcx
movl %eax, %edx
movq %rcx, %rax
leaq 0x1(%rax), %rsi
movq %rsi, 0x8(%rsp)
movzbl (%rax), %edi
cmpl $0x5c, %edi
je 0x5d39
testl %edi, %edi
je 0x5d53
movq %rsi, %rax
cmpl $0x22, %edi
jne 0x5d1a
jmp 0x5d9f
subq %rcx, %rsi
cmpq %rdx, %rsi
je 0x5d74
addq $0x2, %rax
movq %rax, 0x8(%rsp)
movl $0x1, (%r15)
jmp 0x5d1a
movq %rax, 0x8(%rsp)
subl %ecx, %eax
addl %eax, %ebp
movl $0x80, %edx
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rcx
callq 0x5b5b
testl %eax, %eax
jg 0x5d10
jmp 0x5db6
movq %rax, 0x8(%rsp)
subl %ecx, %eax
addl %eax, %ebp
movl $0x80, %edx
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rcx
callq 0x5b5b
cmpl $0x2, %eax
jge 0x5d10
movl $0x9e8, %edx            # imm = 0x9E8
jmp 0x5dbe
notl %ecx
addl %ecx, %esi
addl %esi, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x9f2, %edx            # imm = 0x9F2
movq %r13, %r14
leaq 0x2697(%rip), %rdi      # 0x845c
leaq 0x2934(%rip), %rsi      # 0x8700
xorl %eax, %eax
callq 0x10c0
movq %r14, %rdi
callq 0x1060
movq 0x30(%rbx), %rsi
testq %rsi, %rsi
je 0x5e34
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, 0x10(%r14)
addq 0x10(%rbx), %rsi
pushq $0x1f
popq %rdx
movq %r14, %rdi
callq 0x1050
leaq 0x2655(%rip), %rdi      # 0x845c
leaq 0x28f2(%rip), %rsi      # 0x8700
movl $0xa02, %edx            # imm = 0xA02
xorl %eax, %eax
callq 0x10c0
leaq 0x28bb(%rip), %rdi      # 0x86dc
leaq 0x28e6(%rip), %rsi      # 0x870e
movq %r14, %rdx
xorl %eax, %eax
callq 0x10c0
jmp 0x5e5a
leaq 0x2621(%rip), %rdi      # 0x845c
leaq 0x28be(%rip), %rsi      # 0x8700
movl $0xa02, %edx            # imm = 0xA02
xorl %eax, %eax
callq 0x10c0
leaq 0x28b9(%rip), %rdi      # 0x870e
callq 0x1060
pushq $-0x1
popq %rbp
jmp 0x5da5