// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/parse.c
// Function: tokenchar
static int tokenchar(JanetParser *p, JanetParseState *state, uint8_t c) {
    Janet ret;
    double numval;
    int32_t blen;
    if (janet_is_symbol_char(c)) {
        push_buf(p, (uint8_t) c);
        if (c > 127) state->argn = 1; /* Use to indicate non ascii */
        return 1;
    }
    /* Token finished */
    blen = (int32_t) p->bufcount;
    int start_dig = p->buf[0] >= '0' && p->buf[0] <= '9';
    int start_num = start_dig || p->buf[0] == '-' || p->buf[0] == '+' || p->buf[0] == '.';
    if (p->buf[0] == ':') {
        /* Don't do full utf-8 check unless we have seen non ascii characters. */
        int valid = (!state->argn) || janet_valid_utf8(p->buf + 1, blen - 1);
        if (!valid) {
            p->error = "invalid utf-8 in keyword";
            return 0;
        }
        ret = janet_keywordv(p->buf + 1, blen - 1);
#ifdef JANET_INT_TYPES
    } else if (start_num && !janet_scan_numeric(p->buf, blen, &ret)) {
        (void) numval;
#else
    } else if (start_num && !janet_scan_number(p->buf, blen, &numval)) {
        ret = janet_wrap_number(numval);
#endif
    } else if (!check_str_const("nil", p->buf, blen)) {
        ret = janet_wrap_nil();
    } else if (!check_str_const("false", p->buf, blen)) {
        ret = janet_wrap_false();
    } else if (!check_str_const("true", p->buf, blen)) {
        ret = janet_wrap_true();
    } else {
        if (start_dig) {
            p->error = "symbol literal cannot start with a digit";
            return 0;
        } else {
            /* Don't do full utf-8 check unless we have seen non ascii characters. */
            int valid = (!state->argn) || janet_valid_utf8(p->buf, blen);
            if (!valid) {
                p->error = "invalid utf-8 in symbol";
                return 0;
            }
            ret = janet_symbolv(p->buf, blen);
        }
    }
    p->bufcount = 0;
    popstate(p, ret);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %rbx
movl %edx, %eax
shrl $0x5, %eax
leaq 0x2cc61(%rip), %rcx     # 0x63420
movl (%rcx,%rax,4), %eax
btl %edx, %eax
jae 0x367f0
movzbl %dl, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x374c3
pushq $0x1
popq %rax
testb %r14b, %r14b
jns 0x3694f
movl $0x1, 0x4(%r12)
jmp 0x3694f
movl 0x40(%rbx), %r14d
movq 0x18(%rbx), %r15
movzbl (%r15), %eax
leal -0x30(%rax), %r13d
cmpb $0xa, %r13b
jb 0x36844
leal -0x2d(%rax), %ecx
cmpl $0x2, %ecx
jb 0x36844
cmpl $0x2b, %eax
je 0x36844
cmpl $0x3a, %eax
jne 0x3685b
cmpl $0x0, 0x4(%r12)
je 0x36916
leaq 0x1(%r15), %rdi
decl %r14d
movl %r14d, %esi
callq 0x35a3a
testl %eax, %eax
jne 0x36919
leaq 0x2ced1(%rip), %rax     # 0x63713
jmp 0x368aa
leaq -0x30(%rbp), %rdx
movq %r15, %rdi
movl %r14d, %esi
callq 0x42aac
testl %eax, %eax
je 0x368b3
movq 0x18(%rbx), %r15
leaq 0x23e64(%rip), %rdi     # 0x5a6c6
movq %r15, %rsi
movl %r14d, %edx
callq 0x376bf
testl %eax, %eax
je 0x368bc
leaq 0x2e2f4(%rip), %rdi     # 0x64b6c
movq %r15, %rsi
movl %r14d, %edx
callq 0x376bf
testl %eax, %eax
je 0x368c8
leaq 0x2e2d6(%rip), %rdi     # 0x64b64
movq %r15, %rsi
movl %r14d, %edx
callq 0x376bf
testl %eax, %eax
je 0x368d4
cmpb $0x9, %r13b
ja 0x368e8
leaq 0x2ce82(%rip), %rax     # 0x6372c
movq %rax, 0x8(%rbx)
jmp 0x3694d
movq -0x30(%rbp), %rsi
jmp 0x36940
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
jmp 0x368e1
movabsq $-0x7000000000000, %rdi # imm = 0xFFF9000000000000
jmp 0x368e1
movabsq $-0x7000000000000, %rdi # imm = 0xFFF9000000000000
incq %rdi
callq 0x4b313
jmp 0x36939
cmpl $0x0, 0x4(%r12)
je 0x368ff
movq %r15, %rdi
movl %r14d, %esi
callq 0x35a3a
testl %eax, %eax
je 0x3695e
movq %r15, %rdi
movl %r14d, %esi
callq 0x437eb
movabsq $-0x5800000000000, %rsi # imm = 0xFFFA800000000000
jmp 0x36931
decl %r14d
incq %r15
movq %r15, %rdi
movl %r14d, %esi
callq 0x437eb
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4b366
movq %rax, %rsi
movq %rax, -0x30(%rbp)
andq $0x0, 0x40(%rbx)
movq %rbx, %rdi
callq 0x37070
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2cdf0(%rip), %rax     # 0x63755
jmp 0x368aa