// File: /workspace/github_c_makefile_star2_O0/mahrr[P]raven/src/lexer.c
// Function: lexer_next
Token lexer_next(Lexer *lexer) {
#define New_Token(type) (new_token(lexer, type))

    skip_whitespace(lexer);

    lexer->start = lexer->current;

    if (at_end(lexer)) return New_Token(TOKEN_EOF);

    char c = advance(lexer);
    switch (c) {
    // One-Character Tokens
    case '+': return New_Token(TOKEN_PLUS);
    case '*': return New_Token(TOKEN_STAR);
    case '/': return New_Token(TOKEN_SLASH);
    case '%': return New_Token(TOKEN_PERCENT);
    case ',': return New_Token(TOKEN_COMMA);
    case '(': return New_Token(TOKEN_LEFT_PAREN);
    case ')': return New_Token(TOKEN_RIGHT_PAREN);
    case '[': return New_Token(TOKEN_LEFT_BRACKET);
    case ']': return New_Token(TOKEN_RIGHT_BRACKET);
    case '{': return New_Token(TOKEN_LEFT_BRACE);
    case ';': return New_Token(TOKEN_SEMICOLON);
    case '\\': return New_Token(TOKEN_BACK_SLASH);

    // Possible Two-Charachter Tokens
    case '-':
        if (match(lexer, '>')) return New_Token(TOKEN_ARROW);
        return New_Token(TOKEN_MINUS);

    case '=':
        if (match(lexer, '=')) return New_Token(TOKEN_EQUAL_EQUAL);
        return New_Token(TOKEN_EQUAL);

    case '<':
        if (match(lexer, '=')) return New_Token(TOKEN_LESS_EQUAL);
        return New_Token(TOKEN_LESS);

    case '>':
        if (match(lexer, '=')) return New_Token(TOKEN_GREATER_EQUAL);
        return New_Token(TOKEN_GREATER);

    case ':':
        if (match(lexer, ':')) return New_Token(TOKEN_COLON_COLON);
        return New_Token(TOKEN_COLON);

    case '.':
        if (match(lexer, '.')) return New_Token(TOKEN_DOT_DOT);
        return New_Token(TOKEN_DOT);

    case '!':
        if (match(lexer, '=')) return New_Token(TOKEN_BANG_EQUAL);
        break;

    // Strings
    case '}':
        if (match(lexer, '}')) return string_interpolated(lexer);
        return New_Token(TOKEN_RIGHT_BRACE);
    case '\'':
        return string(lexer);
    case '"':
        return string_interpolated(lexer);

    default:
        if (isalpha(c) || c == '_') return identifier(lexer);
        if (isdigit(c)) return number(lexer);
    }

    return error_token(lexer, "Unexpected symbol");
#undef New_Token
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x20(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0xbe10
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
callq 0xbec0
testb $0x1, %al
jne 0xba0c
jmp 0xba23
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x36, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x8(%rbp), %rdi
callq 0xbf30
movb %al, -0x9(%rbp)
movsbl -0x9(%rbp), %eax
addl $-0x21, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x5c, %eax
ja 0xbd87
movq -0x28(%rbp), %rax
leaq 0x33f0(%rip), %rcx      # 0xee40
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x10, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x12, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x13, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x14, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x25, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x28, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x29, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x2c, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x2d, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x2a, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x26, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x2e, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x8(%rbp), %rdi
movl $0x3e, %esi
callq 0xbf80
testb $0x1, %al
jne 0xbb81
jmp 0xbb98
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x24, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x11, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0xbf80
testb $0x1, %al
jne 0xbbc3
jmp 0xbbda
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x20, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x1f, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0xbf80
testb $0x1, %al
jne 0xbc05
jmp 0xbc1c
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x1c, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x1b, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0xbf80
testb $0x1, %al
jne 0xbc47
jmp 0xbc5e
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x1e, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x1d, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x8(%rbp), %rdi
movl $0x3a, %esi
callq 0xbf80
testb $0x1, %al
jne 0xbc89
jmp 0xbca0
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x1a, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x27, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x8(%rbp), %rdi
movl $0x2e, %esi
callq 0xbf80
testb $0x1, %al
jne 0xbccb
jmp 0xbce2
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x19, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x15, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0xbf80
testb $0x1, %al
jne 0xbd0d
jmp 0xbd24
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x21, %edx
callq 0xbee0
jmp 0xbdfe
jmp 0xbdea
movq -0x8(%rbp), %rdi
movl $0x7d, %esi
callq 0xbf80
testb $0x1, %al
jne 0xbd3d
jmp 0xbd4f
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xbfe0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x2b, %edx
callq 0xbee0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xc0f0
jmp 0xbdfe
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xbfe0
jmp 0xbdfe
callq 0x2210
movq (%rax), %rax
movsbl -0x9(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0xbdad
movsbl -0x9(%rbp), %eax
cmpl $0x5f, %eax
jne 0xbdbc
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xc190
jmp 0xbdfe
callq 0x2210
movq (%rax), %rax
movsbl -0x9(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0xbde8
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xc240
jmp 0xbdfe
jmp 0xbdea
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq 0x3283(%rip), %rdx      # 0xf07c
callq 0xc4e0
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)