// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x78, %rsp
movb %sil, %al
movq %rdi, 0x68(%rsp)
movb %al, 0x67(%rsp)
movq %rdx, 0x58(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x0, 0x48(%rsp)
movl $0x0, 0x44(%rsp)
movl $0x0, 0x40(%rsp)
movb $0x0, 0x3f(%rsp)
movq 0x68(%rsp), %rdi
xorl %esi, %esi
movl $0x80, %edx
leaq 0x50(%rsp), %rcx
callq 0xabb0
movq 0x50(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq %rax, %rcx
incq %rcx
movq %rcx, 0x50(%rsp)
movsbl (%rax), %eax
movl %eax, 0xc(%rsp)
movb %al, %cl
movb %cl, 0x3f(%rsp)
testl %eax, %eax
je 0xb11d
jmp 0xb003
movl 0xc(%rsp), %eax
subl $0x22, %eax
je 0xb01c
jmp 0xb00e
movl 0xc(%rsp), %eax
subl $0x5c, %eax
je 0xb042
jmp 0xb1ab
movq 0x50(%rsp), %rax
movq 0x48(%rsp), %rcx
subq %rcx, %rax
subq $0x1, %rax
addl 0x44(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x74(%rsp)
jmp 0xb265
movslq 0x40(%rsp), %rax
movq 0x50(%rsp), %rcx
movq 0x48(%rsp), %rdx
subq %rdx, %rcx
cmpq %rcx, %rax
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0xb089
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
movq 0x58(%rsp), %rax
movl $0x1, (%rax)
jmp 0xb118
movq 0x50(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq 0x48(%rsp), %rcx
subq %rcx, %rax
addl 0x44(%rsp), %eax
movl %eax, 0x44(%rsp)
movq 0x68(%rsp), %rdi
movl 0x44(%rsp), %esi
movl $0x80, %edx
leaq 0x50(%rsp), %rcx
callq 0xabb0
movl %eax, 0x40(%rsp)
cmpl $0x2, %eax
setl %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0xb10e
jmp 0xb0e1
leaq 0x590c(%rip), %rdi      # 0x109f4
leaq 0x5ca4(%rip), %rsi      # 0x10d93
movl $0x9e8, %edx            # imm = 0x9E8
movb $0x0, %al
callq 0x10c0
leaq 0x5c9f(%rip), %rdi      # 0x10da1
movb $0x0, %al
callq 0x10c0
jmp 0xb1b2
movq 0x50(%rsp), %rax
movq %rax, 0x48(%rsp)
jmp 0xb1ad
movq 0x50(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq 0x48(%rsp), %rcx
subq %rcx, %rax
addl 0x44(%rsp), %eax
movl %eax, 0x44(%rsp)
movq 0x68(%rsp), %rdi
movl 0x44(%rsp), %esi
movl $0x80, %edx
leaq 0x50(%rsp), %rcx
callq 0xabb0
movl %eax, 0x40(%rsp)
cmpl $0x1, %eax
setl %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0xb19f
jmp 0xb175
leaq 0x5878(%rip), %rdi      # 0x109f4
leaq 0x5c10(%rip), %rsi      # 0x10d93
movl $0x9f2, %edx            # imm = 0x9F2
movb $0x0, %al
callq 0x10c0
leaq 0x5c20(%rip), %rdi      # 0x10db6
movb $0x0, %al
callq 0x10c0
jmp 0xb1b2
movq 0x50(%rsp), %rax
movq %rax, 0x48(%rsp)
jmp 0xb1ad
jmp 0xb1ad
jmp 0xafdc
jmp 0xb1b4
movq 0x68(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0xb228
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x10f0
leaq 0x10(%rsp), %rdi
movq 0x68(%rsp), %rax
movq 0x30(%rax), %rsi
movq 0x68(%rsp), %rax
addq 0x10(%rax), %rsi
movl $0x1f, %edx
callq 0x1050
leaq 0x57fb(%rip), %rdi      # 0x109f4
leaq 0x5b93(%rip), %rsi      # 0x10d93
movl $0xa02, %edx            # imm = 0xA02
movb $0x0, %al
callq 0x10c0
leaq 0x10(%rsp), %rdx
leaq 0x5b57(%rip), %rdi      # 0x10d6f
leaq 0x5ba8(%rip), %rsi      # 0x10dc7
movb $0x0, %al
callq 0x10c0
jmp 0xb25b
jmp 0xb22a
leaq 0x57c3(%rip), %rdi      # 0x109f4
leaq 0x5b5b(%rip), %rsi      # 0x10d93
movl $0xa02, %edx            # imm = 0xA02
movb $0x0, %al
callq 0x10c0
leaq 0x5a1d(%rip), %rdi      # 0x10c68
leaq 0x5b75(%rip), %rsi      # 0x10dc7
movb $0x0, %al
callq 0x10c0
jmp 0xb25b
jmp 0xb25d
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
nop