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

    /* Eat whitespace. */
    while (1) {
        ch = (unsigned char)*(json->ptr);
        token->type = ch2token[ch];
        if (token->type != T_WHITESPACE)
            break;
        json->ptr++;
    }

    /* Store location of new token. Required when throwing errors
     * for unexpected tokens (syntax errors). */
    token->index = json->ptr - json->data;

    /* 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->ptr++;
        return;
    }

    /* Process characters which triggered T_UNKNOWN
     *
     * 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_invalid_numbers && 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->ptr, "true", 4)) {
        token->type = T_BOOLEAN;
        token->value.boolean = 1;
        json->ptr += 4;
        return;
    } else if (!strncmp(json->ptr, "false", 5)) {
        token->type = T_BOOLEAN;
        token->value.boolean = 0;
        json->ptr += 5;
        return;
    } else if (!strncmp(json->ptr, "null", 4)) {
        token->type = T_NULL;
        json->ptr += 4;
        return;
    } else if (json->cfg->decode_invalid_numbers &&
               json_is_invalid_number(json)) {
        /* When decode_invalid_numbers is enabled, 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 0x8(%rdi), %r12
movq 0x18(%rdi), %rbp
movq %r12, %r15
movzbl (%r15), %eax
movl (%rbp,%rax,4), %ecx
movl %ecx, (%rbx)
cmpl $0xb, %ecx
jne 0x88b7f
incq %r15
movq %r15, 0x8(%r14)
incl %r12d
jmp 0x88b64
subl (%r14), %r12d
movl %r12d, 0x4(%rbx)
cmpl $0xa, %ecx
je 0x88dd0
cmpl $0xd, %ecx
je 0x88bb7
cmpl $0xc, %ecx
jne 0x88dc9
movl $0xc, (%rbx)
movl %r12d, 0x4(%rbx)
leaq 0x398ff(%rip), %rax     # 0xc24ad
movq %rax, 0x8(%rbx)
jmp 0x88dd0
cmpl $0x2d, %eax
je 0x88de5
cmpl $0x22, %eax
jne 0x88ddf
cmpb $0x22, (%r15)
jne 0x88f33
incq %r15
movq %r15, 0x8(%r14)
movq 0x10(%r14), %rax
andl $0x0, 0xc(%rax)
movzbl (%r15), %eax
cmpl $0x5c, %eax
je 0x88bfd
cmpl $0x22, %eax
je 0x88e99
testl %eax, %eax
jne 0x88c1e
jmp 0x88ec7
movzbl 0x1(%r15), %eax
movzbl 0x400(%rbp,%rax), %eax
cmpl $0x75, %eax
je 0x88c3f
testl %eax, %eax
je 0x88ef7
incq %r15
movq %r15, 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)
movq 0x8(%r14), %r15
incq %r15
movq %r15, 0x8(%r14)
jmp 0x88be2
leaq 0x2(%r15), %rdi
callq 0x892df
testl %eax, %eax
js 0x88db0
movl %eax, %r13d
andl $0xf800, %eax           # imm = 0xF800
cmpl $0xd800, %eax           # imm = 0xD800
jne 0x88cff
btl $0xa, %r13d
jb 0x88db0
cmpb $0x5c, 0x6(%r15)
jne 0x88db0
cmpb $0x75, 0x7(%r15)
jne 0x88db0
leaq 0x8(%r15), %rdi
callq 0x892df
movl %eax, %ecx
andl $0x8000fc00, %ecx       # imm = 0x8000FC00
cmpl $0xdc00, %ecx           # imm = 0xDC00
jne 0x88db0
shll $0xa, %r13d
andl $0xffc00, %r13d         # imm = 0xFFC00
andl $0x3ff, %eax            # imm = 0x3FF
addl %eax, %r13d
addl $0x10000, %r13d         # imm = 0x10000
pushq $0xc
popq %rax
movl %r13d, %ecx
shrl $0x12, %ecx
orb $-0x10, %cl
movb %cl, 0x4(%rsp)
movl %r13d, %ecx
shrl $0xc, %ecx
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x5(%rsp)
movl %r13d, %ecx
shrl $0x6, %ecx
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x6(%rsp)
andb $0x3f, %r13b
orb $-0x80, %r13b
movb %r13b, 0x7(%rsp)
movq %rax, %r15
pushq $0x4
jmp 0x88d72
cmpl $0x7f, %r13d
ja 0x88d12
movb %r13b, 0x4(%rsp)
pushq $0x6
popq %r15
pushq $0x1
jmp 0x88d72
cmpl $0x7ff, %r13d           # imm = 0x7FF
ja 0x88d3c
movl %r13d, %eax
shrl $0x6, %eax
orb $-0x40, %al
movb %al, 0x4(%rsp)
andb $0x3f, %r13b
orb $-0x80, %r13b
movb %r13b, 0x5(%rsp)
pushq $0x6
popq %r15
pushq $0x2
jmp 0x88d72
cmpl $0xffff, %r13d          # imm = 0xFFFF
ja 0x88da0
movl %r13d, %eax
shrl $0xc, %eax
orb $-0x20, %al
movb %al, 0x4(%rsp)
movl %r13d, %eax
shrl $0x6, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x5(%rsp)
andb $0x3f, %r13b
orb $-0x80, %r13b
movb %r13b, 0x6(%rsp)
pushq $0x6
popq %r15
pushq $0x3
popq %r13
movq 0x10(%r14), %r12
movslq 0xc(%r12), %rdi
addq (%r12), %rdi
movl %r13d, %edx
leaq 0x4(%rsp), %rsi
callq 0x26c50
addl %r13d, 0xc(%r12)
addq 0x8(%r14), %r15
movq %r15, 0x8(%r14)
jmp 0x88be2
pushq $0x6
popq %rax
cmpl $0x1fffff, %r13d        # imm = 0x1FFFFF
jbe 0x88cbe
movl $0xc, (%rbx)
subl (%r14), %r15d
movl %r15d, 0x4(%rbx)
leaq 0x39779(%rip), %rax     # 0xc253d
jmp 0x88bae
incq %r15
movq %r15, 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 0x88e29
cmpl $0x0, 0x53c(%rbp)
je 0x88e07
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x89281
movq %r14, %rdi
callq 0x89204
testl %eax, %eax
je 0x88dee
movl $0xc, (%rbx)
movl %r12d, 0x4(%rbx)
leaq 0x39697(%rip), %rax     # 0xc24bb
jmp 0x88bae
leaq 0x2eddd(%rip), %rsi     # 0xb7c0d
pushq $0x4
popq %rdx
movq %r15, %rdi
callq 0x26350
testl %eax, %eax
je 0x88ee0
leaq 0x3277b(%rip), %rsi     # 0xbb5c5
pushq $0x5
popq %rdx
movq %r15, %rdi
callq 0x26350
testl %eax, %eax
je 0x88f10
leaq 0x27873(%rip), %rsi     # 0xb06d7
pushq $0x4
popq %rdx
movq %r15, %rdi
callq 0x26350
testl %eax, %eax
je 0x88f24
cmpl $0x0, 0x53c(%rbp)
je 0x88b9d
movq %r14, %rdi
callq 0x89204
testl %eax, %eax
jne 0x88dee
jmp 0x88b9d
incq %r15
movq %r15, 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 0x88bae
movl $0xc, (%rbx)
subl (%r14), %r15d
movl %r15d, 0x4(%rbx)
leaq 0x39649(%rip), %rax     # 0xc2524
jmp 0x88bae
movl $0x6, (%rbx)
movl $0x1, 0x8(%rbx)
addq $0x4, 0x8(%r14)
jmp 0x88dd0
movl $0xc, (%rbx)
subl (%r14), %r15d
movl %r15d, 0x4(%rbx)
leaq 0x3964e(%rip), %rax     # 0xc2559
jmp 0x88bae
movl $0x6, (%rbx)
andl $0x0, 0x8(%rbx)
addq $0x5, 0x8(%r14)
jmp 0x88dd0
movl $0x7, (%rbx)
addq $0x4, %r15
jmp 0x88dcc
leaq 0x39590(%rip), %rdi     # 0xc24ca
leaq 0x3959b(%rip), %rsi     # 0xc24dc
leaq 0x395a0(%rip), %rcx     # 0xc24e8
movl $0x37b, %edx            # imm = 0x37B
callq 0x262d0