// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/lua/src/lua_cjson.c
// Function: json_next_token
static void json_next_token(json_parse_t *json, json_token_t *token)
{
    json_token_type_t *ch2token = json->cfg->ch2token;
    int ch;

    /* Eat whitespace. FIXME: UGLY */
    token->type = ch2token[(unsigned char)json->data[json->index]];
    while (token->type == T_WHITESPACE)
        token->type = ch2token[(unsigned char)json->data[++json->index]];

    token->index = json->index;

    /* Don't advance the pointer for an error or the end */
    if (token->type == T_ERROR) {
        json_set_token_error(token, json, "invalid token");
        return;
    }

    if (token->type == T_END) {
        return;
    }

    /* Found a known single character token, advance index and return */
    if (token->type != T_UNKNOWN) {
        json->index++;
        return;
    }

    /* Process characters which triggered T_UNKNOWN */
    ch = json->data[json->index];

    /* Must use strncmp() to match the front of the JSON string.
     * JSON identifier must be lowercase.
     * When strict_numbers if disabled, either case is allowed for
     * Infinity/NaN (since we are no longer following the spec..) */
    if (ch == '"') {
        json_next_string_token(json, token);
        return;
    } else if (ch == '-' || ('0' <= ch && ch <= '9')) {
        if (json->cfg->decode_refuse_badnum && json_is_invalid_number(json)) {
            json_set_token_error(token, json, "invalid number");
            return;
        }
        json_next_number_token(json, token);
        return;
    } else if (!strncmp(&json->data[json->index], "true", 4)) {
        token->type = T_BOOLEAN;
        token->value.boolean = 1;
        json->index += 4;
        return;
    } else if (!strncmp(&json->data[json->index], "false", 5)) {
        token->type = T_BOOLEAN;
        token->value.boolean = 0;
        json->index += 5;
        return;
    } else if (!strncmp(&json->data[json->index], "null", 4)) {
        token->type = T_NULL;
        json->index += 4;
        return;
    } else if (!json->cfg->decode_refuse_badnum &&
               json_is_invalid_number(json)) {
        /* When refuse_badnum is disabled, only attempt to process
         * numbers we know are invalid JSON (Inf, NaN, hex)
         * This is required to generate an appropriate token error,
         * otherwise all bad tokens will register as "invalid number"
         */
        json_next_number_token(json, token);
        return;
    }

    /* Token starts with t/f/n but isn't recognised above. */
    json_set_token_error(token, json, "invalid token");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %r13
movq 0x18(%rdi), %rbp
movslq 0x8(%rdi), %r15
movzbl (%r13,%r15), %eax
movl (%rbp,%rax,4), %eax
movl %eax, (%rbx)
cmpl $0xb, %eax
jne 0x70e84
incq %r15
movl %r15d, 0x8(%r14)
jmp 0x70e6a
movl %r15d, 0x4(%rbx)
cmpl $0xa, %eax
je 0x710c3
cmpl $0xd, %eax
je 0x70eb9
cmpl $0xc, %eax
jne 0x710bc
movl $0xc, (%rbx)
movl %r15d, 0x4(%rbx)
leaq 0x2755c(%rip), %rax     # 0x9840c
movq %rax, 0x8(%rbx)
jmp 0x710c3
leaq (%r15,%r13), %r12
movzbl (%r12), %eax
cmpl $0x2d, %eax
je 0x710d8
cmpl $0x22, %eax
jne 0x710d2
incl %r15d
movl %r15d, 0x8(%r14)
movq 0x10(%r14), %rax
andl $0x0, 0xc(%rax)
movslq %r15d, %rcx
movzbl (%r13,%rcx), %eax
cmpl $0x5c, %eax
je 0x70f03
cmpl $0x22, %eax
je 0x7118f
testl %eax, %eax
jne 0x70f25
jmp 0x711bd
movzbl 0x1(%r13,%rcx), %eax
movzbl 0x400(%rbp,%rax), %eax
cmpl $0x75, %eax
je 0x70f45
testl %eax, %eax
je 0x711ea
incq %rcx
movl %ecx, 0x8(%r14)
movq 0x10(%r14), %rcx
movq (%rcx), %rdx
movslq 0xc(%rcx), %rsi
leal 0x1(%rsi), %edi
movl %edi, 0xc(%rcx)
movb %al, (%rdx,%rsi)
movl 0x8(%r14), %r12d
incl %r12d
jmp 0x71087
addq %rcx, %r13
leaq 0x2(%r13), %rdi
callq 0x715bb
testl %eax, %eax
js 0x710a6
movl %eax, %ecx
andl $0xf800, %eax           # imm = 0xF800
cmpl $0xd800, %eax           # imm = 0xD800
jne 0x70ffe
btl $0xa, %ecx
jb 0x710a6
cmpb $0x5c, 0x6(%r13)
jne 0x710a6
cmpb $0x75, 0x7(%r13)
jne 0x710a6
addq $0x8, %r13
movq %r13, %rdi
movq %rcx, %r12
callq 0x715bb
movl %eax, %ecx
andl $0x8000fc00, %ecx       # imm = 0x8000FC00
cmpl $0xdc00, %ecx           # imm = 0xDC00
jne 0x710a6
movq %r12, %rcx
shll $0xa, %ecx
andl $0xffc00, %ecx          # imm = 0xFFC00
andl $0x3ff, %eax            # imm = 0x3FF
addl %eax, %ecx
addl $0x10000, %ecx          # imm = 0x10000
pushq $0xc
popq %r12
movl %ecx, %eax
shrl $0x12, %eax
orb $-0x10, %al
movb %al, 0x4(%rsp)
movl %ecx, %eax
shrl $0xc, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x5(%rsp)
movl %ecx, %eax
shrl $0x6, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x6(%rsp)
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x7(%rsp)
pushq $0x4
jmp 0x71064
cmpl $0x7f, %ecx
ja 0x7100f
movb %cl, 0x4(%rsp)
pushq $0x6
popq %r12
pushq $0x1
jmp 0x71064
cmpl $0x7ff, %ecx            # imm = 0x7FF
ja 0x71034
movl %ecx, %eax
shrl $0x6, %eax
orb $-0x40, %al
movb %al, 0x4(%rsp)
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x5(%rsp)
pushq $0x6
popq %r12
pushq $0x2
jmp 0x71064
cmpl $0xffff, %ecx           # imm = 0xFFFF
ja 0x71096
movl %ecx, %eax
shrl $0xc, %eax
orb $-0x20, %al
movb %al, 0x4(%rsp)
movl %ecx, %eax
shrl $0x6, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x5(%rsp)
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x6(%rsp)
pushq $0x6
popq %r12
pushq $0x3
popq %r15
movq 0x10(%r14), %r13
movslq 0xc(%r13), %rdi
addq (%r13), %rdi
movl %r15d, %edx
leaq 0x4(%rsp), %rsi
callq 0x1fbd0
addl %r15d, 0xc(%r13)
addl 0x8(%r14), %r12d
movl %r12d, 0x8(%r14)
movq (%r14), %r13
movl %r12d, %r15d
jmp 0x70ee3
pushq $0x6
popq %r12
cmpl $0x1fffff, %ecx         # imm = 0x1FFFFF
jbe 0x70fcb
movl $0xc, (%rbx)
movl %r15d, 0x4(%rbx)
leaq 0x2738b(%rip), %rax     # 0x98442
jmp 0x70eb0
incl %r15d
movl %r15d, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addb $-0x30, %al
cmpb $0x9, %al
ja 0x7110b
cmpl $0x0, 0x540(%rbp)
je 0x71176
movq %r14, %rdi
callq 0x714d1
testl %eax, %eax
je 0x71176
movl $0xc, (%rbx)
movl %r15d, 0x4(%rbx)
leaq 0x27314(%rip), %rax     # 0x9841a
jmp 0x70eb0
leaq 0x20280(%rip), %rsi     # 0x91392
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x1f340
testl %eax, %eax
je 0x711d3
leaq 0x2696c(%rip), %rsi     # 0x97a98
pushq $0x5
popq %rdx
movq %r12, %rdi
callq 0x1f340
testl %eax, %eax
je 0x71200
leaq 0x1af29(%rip), %rsi     # 0x8c06f
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x1f340
testl %eax, %eax
je 0x71214
cmpl $0x0, 0x540(%rbp)
jne 0x70e9f
movq %r14, %rdi
callq 0x714d1
testl %eax, %eax
je 0x70e9f
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x71556
incl %r15d
movl %r15d, 0x8(%r14)
movq 0x10(%r14), %rax
movq (%rax), %rcx
movslq 0xc(%rax), %rax
movb $0x0, (%rcx,%rax)
movl $0x4, (%rbx)
movq 0x10(%r14), %rax
movl 0xc(%rax), %ecx
movl %ecx, 0x10(%rbx)
movq (%rax), %rax
jmp 0x70eb0
movl $0xc, (%rbx)
movl %r15d, 0x4(%rbx)
leaq 0x2725b(%rip), %rax     # 0x98429
jmp 0x70eb0
movl $0x6, (%rbx)
movl $0x1, 0x8(%rbx)
addl $0x4, 0x8(%r14)
jmp 0x710c3
movl $0xc, (%rbx)
movl %r15d, 0x4(%rbx)
leaq 0x27263(%rip), %rax     # 0x9845e
jmp 0x70eb0
movl $0x6, (%rbx)
andl $0x0, 0x8(%rbx)
addl $0x5, 0x8(%r14)
jmp 0x710c3
movl $0x7, (%rbx)
addl $0x4, %r15d
jmp 0x710bf