// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movq -0x8(%rbp), %rdx
movslq 0x8(%rdx), %rdx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
cmpl $0xb, (%rax)
jne 0xa900f
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movq -0x8(%rbp), %rsi
movl 0x8(%rsi), %edx
addl $0x1, %edx
movl %edx, 0x8(%rsi)
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
jmp 0xa8fdc
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
cmpl $0xc, (%rax)
jne 0xa903f
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq 0x436df(%rip), %rdx     # 0xec714
callq 0xa9380
jmp 0xa9221
movq -0x10(%rbp), %rax
cmpl $0xa, (%rax)
jne 0xa904d
jmp 0xa9221
movq -0x10(%rbp), %rax
cmpl $0xd, (%rax)
je 0xa9068
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0xa9221
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x22, -0x1c(%rbp)
jne 0xa9096
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xa93c0
jmp 0xa9221
cmpl $0x2d, -0x1c(%rbp)
je 0xa90ac
movl $0x30, %eax
cmpl -0x1c(%rbp), %eax
jg 0xa90f6
cmpl $0x39, -0x1c(%rbp)
jg 0xa90f6
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
cmpl $0x0, 0x540(%rax)
je 0xa90e4
movq -0x8(%rbp), %rdi
callq 0xa9580
cmpl $0x0, %eax
je 0xa90e4
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq 0x43648(%rip), %rdx     # 0xec722
callq 0xa9380
jmp 0xa9221
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xa96c0
jmp 0xa9221
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movslq 0x8(%rax), %rax
addq %rax, %rdi
leaq 0x3c31b(%rip), %rsi     # 0xe542a
movl $0x4, %edx
callq 0x1f340
cmpl $0x0, %eax
jne 0xa9145
movq -0x10(%rbp), %rax
movl $0x6, (%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x4, %ecx
movl %ecx, 0x8(%rax)
jmp 0xa9221
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movslq 0x8(%rax), %rax
addq %rax, %rdi
leaq 0x42b0a(%rip), %rsi     # 0xebc68
movl $0x5, %edx
callq 0x1f340
cmpl $0x0, %eax
jne 0xa9194
movq -0x10(%rbp), %rax
movl $0x6, (%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x5, %ecx
movl %ecx, 0x8(%rax)
jmp 0xa9221
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movslq 0x8(%rax), %rax
addq %rax, %rdi
leaq 0x36f2a(%rip), %rsi     # 0xe00d7
movl $0x4, %edx
callq 0x1f340
cmpl $0x0, %eax
jne 0xa91d5
movq -0x10(%rbp), %rax
movl $0x7, (%rax)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x4, %ecx
movl %ecx, 0x8(%rax)
jmp 0xa9221
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
cmpl $0x0, 0x540(%rax)
jne 0xa9203
movq -0x8(%rbp), %rdi
callq 0xa9580
cmpl $0x0, %eax
je 0xa9203
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xa96c0
jmp 0xa9221
jmp 0xa9205
jmp 0xa9207
jmp 0xa9209
jmp 0xa920b
jmp 0xa920d
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq 0x434f8(%rip), %rdx     # 0xec714
callq 0xa9380
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)