// File: /workspace/github_c_makefile_star2_O3/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, %r15
movq %rdi, %rbx
movl %edx, %eax
shrl $0x5, %eax
leaq 0x2dd2f(%rip), %rcx     # 0x67400
movl (%rcx,%rax,4), %eax
btl %edx, %eax
jae 0x39703
movzbl %dl, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3a723
movl $0x1, %eax
testb %r14b, %r14b
jns 0x39912
movl $0x1, 0x4(%r15)
jmp 0x39912
movq 0x18(%rbx), %r14
movq 0x40(%rbx), %r12
movzbl (%r14), %eax
leal -0x30(%rax), %r13d
cmpb $0xa, %r13b
jb 0x3975b
leal -0x2d(%rax), %ecx
cmpl $0x2, %ecx
jb 0x3975b
cmpl $0x2b, %eax
je 0x3975b
cmpl $0x3a, %eax
jne 0x39772
cmpl $0x0, 0x4(%r15)
je 0x398d4
leaq 0x1(%r14), %rdi
leal -0x1(%r12), %r15d
movl %r15d, %esi
callq 0x38a86
testl %eax, %eax
jne 0x398d9
leaq 0x2df9d(%rip), %rax     # 0x676f3
jmp 0x3988d
leaq -0x30(%rbp), %rdx
movq %r14, %rdi
movl %r12d, %esi
callq 0x462cb
testl %eax, %eax
je 0x397a5
movq 0x18(%rbx), %r14
testl %r12d, %r12d
jle 0x397ae
movl %r12d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
leaq 0x24f3e(%rip), %rdx     # 0x5e6c6
movb (%r14,%rcx), %sil
cmpb (%rcx,%rdx), %sil
jne 0x397c9
cmpq $0x3, %rcx
je 0x397b2
incq %rcx
cmpq %rcx, %rax
jne 0x39788
movq %r12, %rax
jmp 0x397b7
movq -0x30(%rbp), %rsi
jmp 0x39900
xorl %eax, %eax
jmp 0x397bc
movl $0x3, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq 0x24f03(%rip), %rcx     # 0x5e6c6
cmpb $0x0, (%rax,%rcx)
je 0x397fc
testl %r12d, %r12d
jle 0x3980b
movl %r12d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
leaq 0x2f36d(%rip), %rdx     # 0x68b4c
movb (%r14,%rcx), %sil
cmpb (%rcx,%rdx), %sil
jne 0x39826
cmpq $0x5, %rcx
je 0x3980f
incq %rcx
cmpq %rcx, %rax
jne 0x397df
movq %r12, %rax
jmp 0x39814
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
jmp 0x398cd
xorl %eax, %eax
jmp 0x39819
movl $0x5, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq 0x2f32c(%rip), %rcx     # 0x68b4c
cmpb $0x0, (%rax,%rcx)
je 0x39859
testl %r12d, %r12d
jle 0x39865
movl %r12d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
leaq 0x2f308(%rip), %rdx     # 0x68b44
movb (%r14,%rcx), %sil
cmpb (%rcx,%rdx), %sil
jne 0x39880
cmpq $0x4, %rcx
je 0x39869
incq %rcx
cmpq %rcx, %rax
jne 0x3983c
movq %r12, %rax
jmp 0x3986e
movabsq $-0x7000000000000, %rdi # imm = 0xFFF9000000000000
jmp 0x398cd
xorl %eax, %eax
jmp 0x39873
movl $0x4, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq 0x2f2ca(%rip), %rcx     # 0x68b44
cmpb $0x0, (%rax,%rcx)
je 0x398c0
cmpb $0x9, %r13b
ja 0x39893
leaq 0x2de7f(%rip), %rax     # 0x6770c
movq %rax, 0x8(%rbx)
jmp 0x39910
cmpl $0x0, 0x4(%r15)
je 0x398a9
movq %r14, %rdi
movl %r12d, %esi
callq 0x38a86
testl %eax, %eax
je 0x39921
movq %r14, %rdi
movl %r12d, %esi
callq 0x4709e
movabsq $-0x5800000000000, %rsi # imm = 0xFFFA800000000000
jmp 0x398f1
movabsq $-0x7000000000000, %rdi # imm = 0xFFF9000000000000
incq %rdi
callq 0x4ece6
jmp 0x398f9
leal -0x1(%r12), %r15d
incq %r14
movq %r14, %rdi
movl %r15d, %esi
callq 0x4709e
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4ed39
movq %rax, %rsi
movq %rax, -0x30(%rbp)
movq $0x0, 0x40(%rbx)
movq %rbx, %rdi
callq 0x3a244
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2de0d(%rip), %rax     # 0x67735
jmp 0x3988d