// File: /workspace/github_c_makefile_star2_O0/jtuu[P]quesler/src/scanner.c
// Function: scan_token
Token scan_token() {
    skip_whitespace();

    scanner.start = scanner.current;

    if (is_at_end()) {
        return make_token(TOKEN_EOF);
    }

    char c = advance();

    if (is_identifier_prefix(c)) {
        return identifier();
    }

    if (is_digit(c)) {
        return number();
    }

    switch (c) {
        case '(': return make_token(TOKEN_LEFT_PAREN);
        case ')': return make_token(TOKEN_RIGHT_PAREN);
        case '{': return make_token(TOKEN_LEFT_BRACE);
        case '}': return make_token(TOKEN_RIGHT_BRACE);
        case ';': return make_token(TOKEN_SEMICOLON);
        case ',': return make_token(TOKEN_COMMA);
        case '-': return make_token(TOKEN_MINUS);
        case '+': return make_token(TOKEN_PLUS);
        case '/': return make_token(TOKEN_SLASH);
        case '*': return make_token(TOKEN_STAR);
        case '^': return make_token(TOKEN_CARET);
        case '%': return make_token(TOKEN_PERCENT);
        case '!':
            return make_token(
                match('=') ? TOKEN_BANG_EQUAL : TOKEN_BANG);
        case '=':
            return make_token(
                match('=') ? TOKEN_EQUAL_EQUAL : TOKEN_EQUAL);
        case '<':
            if (match('=')) {
                return make_token(TOKEN_LESS_EQUAL);
            } else if (match('<')) {
                return make_token(TOKEN_LESS_LESS);
            } else {
                return make_token(TOKEN_LESS);
            }
            break;
        case '>':
            if (match('=')) {
                return make_token(TOKEN_GREATER_EQUAL);
            } else if (match('>')) {
                return make_token(TOKEN_GREATER_GREATER);
            } else {
                return make_token(TOKEN_GREATER);
            }
            break;
        case '"':
            return string();
        case '|':
            return make_token(
                match('|') ? TOKEN_PIPE_PIPE : TOKEN_PIPE);
        case '&':
            return make_token(
                match('&') ? TOKEN_AMP_AMP : TOKEN_AMP);
    }

    return error_token("Unexpected character");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x18(%rbp)
movq %rdi, -0x10(%rbp)
callq 0x8e10
movq 0x10c44(%rip), %rax     # 0x19760
movq %rax, 0x10c35(%rip)     # 0x19758
callq 0x8ec0
testb $0x1, %al
jne 0x8b2e
jmp 0x8b41
movq -0x18(%rbp), %rdi
movl $0x2a, %esi
callq 0x8ee0
jmp 0x8df7
callq 0x8f30
movb %al, -0x1(%rbp)
movsbl -0x1(%rbp), %edi
callq 0x8f60
testb $0x1, %al
jne 0x8b58
jmp 0x8b66
movq -0x18(%rbp), %rdi
callq 0x8fb0
jmp 0x8df7
movsbl -0x1(%rbp), %edi
callq 0x9020
testb $0x1, %al
jne 0x8b75
jmp 0x8b83
movq -0x18(%rbp), %rdi
callq 0x9050
jmp 0x8df7
movsbl -0x1(%rbp), %eax
addl $-0x21, %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x5c, %eax
ja 0x8de7
movq -0x20(%rbp), %rax
leaq 0x5398(%rip), %rcx      # 0xdf3c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x8ee0
jmp 0x8df7
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x8ee0
jmp 0x8df7
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0x8ee0
jmp 0x8df7
movq -0x18(%rbp), %rdi
movl $0x3, %esi
callq 0x8ee0
jmp 0x8df7
movq -0x18(%rbp), %rdi
movl $0x7, %esi
callq 0x8ee0
jmp 0x8df7
movq -0x18(%rbp), %rdi
movl $0x4, %esi
callq 0x8ee0
jmp 0x8df7
movq -0x18(%rbp), %rdi
movl $0x5, %esi
callq 0x8ee0
jmp 0x8df7
movq -0x18(%rbp), %rdi
movl $0x6, %esi
callq 0x8ee0
jmp 0x8df7
movq -0x18(%rbp), %rdi
movl $0x8, %esi
callq 0x8ee0
jmp 0x8df7
movq -0x18(%rbp), %rdi
movl $0x9, %esi
callq 0x8ee0
jmp 0x8df7
movq -0x18(%rbp), %rdi
movl $0xa, %esi
callq 0x8ee0
jmp 0x8df7
movq -0x18(%rbp), %rdi
movl $0xb, %esi
callq 0x8ee0
jmp 0x8df7
movl $0x3d, %edi
callq 0x90f0
movq -0x18(%rbp), %rdi
movb %al, %cl
movl $0xc, %esi
movl $0xd, %eax
testb $0x1, %cl
cmovnel %eax, %esi
callq 0x8ee0
jmp 0x8df7
movl $0x3d, %edi
callq 0x90f0
movq -0x18(%rbp), %rdi
movb %al, %cl
movl $0xe, %esi
movl $0xf, %eax
testb $0x1, %cl
cmovnel %eax, %esi
callq 0x8ee0
jmp 0x8df7
movl $0x3d, %edi
callq 0x90f0
testb $0x1, %al
jne 0x8cf2
jmp 0x8d05
movq -0x18(%rbp), %rdi
movl $0x14, %esi
callq 0x8ee0
jmp 0x8df7
movl $0x3c, %edi
callq 0x90f0
testb $0x1, %al
jne 0x8d15
jmp 0x8d28
movq -0x18(%rbp), %rdi
movl $0x15, %esi
callq 0x8ee0
jmp 0x8df7
movq -0x18(%rbp), %rdi
movl $0x13, %esi
callq 0x8ee0
jmp 0x8df7
movl $0x3d, %edi
callq 0x90f0
testb $0x1, %al
jne 0x8d4b
jmp 0x8d5e
movq -0x18(%rbp), %rdi
movl $0x11, %esi
callq 0x8ee0
jmp 0x8df7
movl $0x3e, %edi
callq 0x90f0
testb $0x1, %al
jne 0x8d6e
jmp 0x8d7e
movq -0x18(%rbp), %rdi
movl $0x12, %esi
callq 0x8ee0
jmp 0x8df7
movq -0x18(%rbp), %rdi
movl $0x10, %esi
callq 0x8ee0
jmp 0x8df7
movq -0x18(%rbp), %rdi
callq 0x9150
jmp 0x8df7
movl $0x7c, %edi
callq 0x90f0
movq -0x18(%rbp), %rdi
movb %al, %cl
movl $0x18, %esi
movl $0x19, %eax
testb $0x1, %cl
cmovnel %eax, %esi
callq 0x8ee0
jmp 0x8df7
movl $0x26, %edi
callq 0x90f0
movq -0x18(%rbp), %rdi
movb %al, %cl
movl $0x16, %esi
movl $0x17, %eax
testb $0x1, %cl
cmovnel %eax, %esi
callq 0x8ee0
jmp 0x8df7
movq -0x18(%rbp), %rdi
leaq 0x53a6(%rip), %rsi      # 0xe198
callq 0x91f0
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)