// File: /workspace/github_c_makefile_star2_O1/gaultier[P]lox-c/lex.c
// Function: lex_scan_token
void lex_scan_token(Lex* lex, Token* token) {
    skip_whitespace(lex);
    const Lex start_lex = *lex;

    if (is_at_end(lex)) {
        init_token(lex, token, TOKEN_EOF, &start_lex);
        return;
    }

    const char c = advance(lex);

    if (isdigit(c)) {
        number(lex, token, &start_lex);
        return;
    }
    if (isalnum(c)) {
        identifier(lex, token, &start_lex);
        return;
    }

    switch (c) {
        case '{':
            init_token(lex, token, TOKEN_LEFT_BRACE, &start_lex);
            return;
        case '}':
            init_token(lex, token, TOKEN_RIGHT_BRACE, &start_lex);
            return;
        case '(':
            init_token(lex, token, TOKEN_LEFT_PAREN, &start_lex);
            return;
        case ')':
            init_token(lex, token, TOKEN_RIGHT_PAREN, &start_lex);
            return;
        case ';':
            init_token(lex, token, TOKEN_SEMICOLON, &start_lex);
            return;
        case ',':
            init_token(lex, token, TOKEN_COMMA, &start_lex);
            return;
        case '.':
            init_token(lex, token, TOKEN_DOT, &start_lex);
            return;
        case '-':
            init_token(lex, token, TOKEN_MINUS, &start_lex);
            return;
        case '+':
            init_token(lex, token, TOKEN_PLUS, &start_lex);
            return;
        case '*':
            init_token(lex, token, TOKEN_STAR, &start_lex);
            return;
        case '/':
            init_token(lex, token, TOKEN_SLASH, &start_lex);
            return;
        case '!':
            init_token(lex, token,
                       match(lex, '=') ? TOKEN_BANG_EQUAL : TOKEN_BANG,
                       &start_lex);
            return;
        case '=':
            init_token(lex, token,
                       match(lex, '=') ? TOKEN_EQUAL_EQUAL : TOKEN_EQUAL,
                       &start_lex);
            return;
        case '<':
            init_token(lex, token,
                       match(lex, '=') ? TOKEN_LESS_EQUAL : TOKEN_LESS,
                       &start_lex);
            return;
        case '>':
            init_token(lex, token,
                       match(lex, '=') ? TOKEN_GREATER_EQUAL : TOKEN_GREATER,
                       &start_lex);
            return;
        case '"':
            string(lex, token);
            return;
        default: {
            static char err[256] = "";
            memset(&err, 0, sizeof(err));

            snprintf(err, sizeof(err) - 1, "Unknown token `%c`", c);
            init_token_err(lex, token, err);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movq 0x8(%rdi), %r12
movq 0x20(%rdi), %rax
cmpq %r12, %rax
jne 0x2388
movq (%r14), %rbx
movq 0x10(%r14), %rdx
movq 0x18(%r14), %rax
movq 0x20(%r14), %rcx
cmpq %r12, %rcx
jne 0x2430
movq %rdx, (%rsi)
movq %rax, 0x8(%rsi)
movl $0x28, 0x20(%rsi)
addq %rcx, %rbx
movq %rbx, 0x10(%rsi)
movq $0x0, 0x18(%rsi)
jmp 0x2b32
movq (%r14), %rcx
leaq 0x18(%r14), %rdx
leaq 0x10(%r14), %r8
movzbl (%rcx,%rax), %edi
cmpl $0x1f, %edi
jg 0x23ad
cmpl $0x9, %edi
je 0x23bc
cmpl $0xa, %edi
je 0x23eb
cmpl $0xd, %edi
je 0x23bc
jmp 0x234e
cmpl $0x2f, %edi
je 0x23c8
cmpl $0x23, %edi
je 0x240a
cmpl $0x20, %edi
jne 0x234e
incq %rax
movq %rax, 0x20(%r14)
movq %rdx, %rdi
jmp 0x23fd
cmpb $0x2f, 0x1(%rcx,%rax)
jne 0x234e
cmpb $0xa, (%rcx,%rax)
je 0x2400
incq %rax
movq %rax, 0x20(%r14)
incq 0x18(%r14)
cmpq %rax, %r12
jne 0x23d3
jmp 0x242b
incq %rax
movq %rax, 0x20(%r14)
movq $0x1, 0x18(%r14)
movq %r8, %rdi
incq (%rdi)
cmpq %r12, %rax
jne 0x2393
jmp 0x234e
cmpb $0x21, 0x1(%rcx,%rax)
jne 0x234e
cmpb $0xa, (%rcx,%rax)
je 0x2400
incq %rax
movq %rax, 0x20(%r14)
incq 0x18(%r14)
cmpq %rax, %r12
jne 0x2415
movq %r12, %rax
jmp 0x2400
movq %rdx, 0x8(%rsp)
movq %rsi, 0x18(%rsp)
leaq 0x1(%rcx), %r15
movq %r15, 0x20(%r14)
movq %rax, %rbp
incq %rax
movq %rax, 0x18(%r14)
leaq (%rbx,%rcx), %rax
movq %rax, 0x10(%rsp)
movq %rcx, 0x20(%rsp)
movsbq (%rbx,%rcx), %r13
callq 0x1200
movq (%rax), %rax
movzwl (%rax,%r13,2), %ecx
btl $0xb, %ecx
jb 0x24dd
testb $0x8, %cl
jne 0x2507
movzbl %r13b, %eax
leal -0x21(%rax), %ecx
cmpl $0x1d, %ecx
ja 0x2644
leaq 0x4bda(%rip), %rax      # 0x706c
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0xc, %eax
cmpq %r12, %r15
je 0x2a73
cmpb $0x3d, (%rbx,%r15)
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdi
jne 0x2a82
leaq 0x2(%rdx), %rax
movq %rax, 0x20(%r14)
leaq 0x2(%rbp), %rax
movq %rax, 0x18(%r14)
movl $0xd, %eax
jmp 0x2a82
cmpq %r12, %r15
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %r8
je 0x2618
movsbq (%rbx,%r15), %rdx
testb $0x8, 0x1(%rax,%rdx,2)
jne 0x2580
xorl %ecx, %ecx
jmp 0x25b0
cmpq %r12, %r15
je 0x252a
movsbq (%rbx,%r15), %rcx
testb $0x8, (%rax,%rcx,2)
je 0x252a
incq %r15
movq %r15, 0x20(%r14)
incq 0x18(%r14)
cmpq %r15, %r12
jne 0x250c
movq %r12, %r15
subq 0x20(%rsp), %r15
movq 0x10(%rsp), %rbx
je 0x2b75
movzbl (%rbx), %eax
addl $-0x61, %eax
cmpl $0x16, %eax
ja 0x28fd
leaq 0x4ac0(%rip), %rcx      # 0x7010
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
incq %rbx
decq %r15
leaq 0x4f26(%rip), %rdi      # 0x748c
movl $0x2, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4849
movl $0x17, %ecx
jmp 0x28f9
movq 0x18(%r14), %rsi
incq %rsi
leaq 0x2(%rdi), %r15
movq %r15, 0x20(%r14)
movq %rsi, 0x18(%r14)
cmpq %r15, %r12
sete %cl
je 0x2618
movsbq (%rbx,%r15), %rdx
incq %rsi
incq %r15
testb $0x8, 0x1(%rax,%rdx,2)
jne 0x258b
decq %r15
cmpb $0x2e, %dl
setne %dl
orb %cl, %dl
jne 0x2618
movsbq 0x1(%rbx,%r15), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x2618
leaq 0x1(%r15), %rdx
movq %rdx, 0x20(%r14)
movq 0x18(%r14), %rcx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x18(%r14)
cmpq %r12, %rdx
je 0x2618
addq $0x2, %rcx
movl $0x1, %edx
subq %r12, %rdx
addq $0x2, %r15
movsbq -0x1(%rbx,%r15), %rsi
testb $0x8, 0x1(%rax,%rsi,2)
je 0x2618
movq %r15, 0x20(%r14)
movq %rcx, 0x18(%r14)
incq %rcx
leaq (%rdx,%r15), %rsi
incq %rsi
incq %r15
cmpq $0x2, %rsi
jne 0x25f0
movq 0x18(%rsp), %rcx
movq %r8, (%rcx)
movq %rbp, 0x8(%rcx)
movl $0x16, 0x20(%rcx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rcx)
movq 0x20(%r14), %rax
subq %rdi, %rax
movq %rax, 0x18(%rcx)
jmp 0x2b32
cmpl $0x7d, %eax
je 0x2b09
cmpl $0x7b, %eax
jne 0x266f
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
movq %rbp, 0x8(%rax)
movl $0x3, 0x20(%rax)
jmp 0x2b21
leaq 0xaaba(%rip), %r15      # 0xd130
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
xorl %esi, %esi
callq 0x1100
leaq 0x4dac(%rip), %rdx      # 0x7438
movl $0xff, %esi
movq %r15, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x10d0
movups 0x10(%r14), %xmm0
movq 0x18(%rsp), %rbx
movups %xmm0, (%rbx)
movl $0x27, 0x20(%rbx)
movq %r15, 0x10(%rbx)
movq %r15, %rdi
callq 0x10a0
movq %rax, 0x18(%rbx)
jmp 0x2b32
incq %rbx
decq %r15
leaq 0x4dd8(%rip), %rdi      # 0x74ac
movl $0x3, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4849
movl $0x23, %ecx
testb %al, %al
jne 0x2902
leaq 0x55f7(%rip), %rdi      # 0x7cef
movl $0x3, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4849
movl $0x24, %ecx
jmp 0x28f9
incq %rbx
decq %r15
leaq 0x4d78(%rip), %rdi      # 0x7497
movl $0x1, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4849
movl $0x1d, %ecx
jmp 0x28f9
incq %rbx
decq %r15
leaq 0x4d6d(%rip), %rdi      # 0x74b3
movl $0x4, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4849
movl $0x26, %ecx
jmp 0x28f9
incq %rbx
decq %r15
leaq 0x4d2c(%rip), %rdi      # 0x7499
movl $0x2, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4849
movl $0x1e, %ecx
jmp 0x28f9
incq %rbx
decq %r15
leaq 0x4d1c(%rip), %rdi      # 0x74b0
movl $0x2, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4849
movl $0x25, %ecx
jmp 0x28f9
incq %rbx
decq %r15
leaq 0x5539(%rip), %rdi      # 0x7cf4
movl $0x4, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4849
movl $0x1a, %ecx
testb %al, %al
jne 0x2902
leaq 0x4cb5(%rip), %rdi      # 0x7494
movl $0x2, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4849
movl $0x1b, %ecx
testb %al, %al
jne 0x2902
leaq 0x4cd6(%rip), %rdi      # 0x74d9
movl $0x2, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4849
movl $0x1c, %ecx
jmp 0x28f9
incq %rbx
decq %r15
leaq 0x54cb(%rip), %rdi      # 0x7cf5
movl $0x3, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4849
movl $0x19, %ecx
jmp 0x28f9
incq %rbx
decq %r15
leaq 0x4c3e(%rip), %rdi      # 0x748f
movl $0x4, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4849
movl $0x18, %ecx
jmp 0x28f9
incq %rbx
decq %r15
leaq 0x4c39(%rip), %rdi      # 0x74b1
movl $0x1, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4849
movl $0x1f, %ecx
jmp 0x28f9
incq %rbx
decq %r15
leaq 0x4c00(%rip), %rdi      # 0x749c
movl $0x4, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4849
movl $0x20, %ecx
jmp 0x28f9
incq %rbx
decq %r15
leaq 0x4be7(%rip), %rdi      # 0x74a7
movl $0x4, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4849
movl $0x22, %ecx
jmp 0x28f9
incq %rbx
decq %r15
leaq 0x4bbd(%rip), %rdi      # 0x74a1
movl $0x5, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4849
movl $0x21, %ecx
testb %al, %al
jne 0x2902
movl $0x14, %ecx
movq 0x18(%rsp), %rdx
movq 0x8(%rsp), %rax
movq %rax, (%rdx)
movq %rbp, 0x8(%rdx)
movl %ecx, 0x20(%rdx)
movq (%r14), %rax
movq 0x20(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x10(%rdx)
movq 0x20(%r14), %rax
subq %rcx, %rax
movq %rax, 0x18(%rdx)
jmp 0x2b32
movl $0x10, %eax
cmpq %r12, %r15
je 0x2a73
cmpb $0x3d, (%rbx,%r15)
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdi
jne 0x2a82
leaq 0x2(%rdx), %rax
movq %rax, 0x20(%r14)
leaq 0x2(%rbp), %rax
movq %rax, 0x18(%r14)
movl $0x11, %eax
jmp 0x2a82
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
movq %rbp, 0x8(%rax)
movl $0x9, 0x20(%rax)
jmp 0x2b21
movl $0x12, %eax
cmpq %r12, %r15
je 0x2a73
cmpb $0x3d, (%rbx,%r15)
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdi
jne 0x2a82
leaq 0x2(%rdx), %rax
movq %rax, 0x20(%r14)
leaq 0x2(%rbp), %rax
movq %rax, 0x18(%r14)
movl $0x13, %eax
jmp 0x2a82
movq %r14, %rdi
movq 0x18(%rsp), %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2b94
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
movq %rbp, 0x8(%rax)
movl $0x8, 0x20(%rax)
jmp 0x2b21
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
movq %rbp, 0x8(%rax)
movl $0x1, 0x20(%rax)
jmp 0x2b21
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
movq %rbp, 0x8(%rax)
movl $0x2, 0x20(%rax)
jmp 0x2b21
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
movq %rbp, 0x8(%rax)
movl $0xb, 0x20(%rax)
jmp 0x2b21
movl $0xe, %eax
cmpq %r12, %r15
jne 0x2b41
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rcx
movq %rsi, (%rcx)
movq %rbp, 0x8(%rcx)
movl %eax, 0x20(%rcx)
movq %rdi, 0x10(%rcx)
movq 0x20(%r14), %rax
subq %rdx, %rax
jmp 0x263b
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
movq %rbp, 0x8(%rax)
movl $0x6, 0x20(%rax)
jmp 0x2b21
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
movq %rbp, 0x8(%rax)
movl $0x7, 0x20(%rax)
jmp 0x2b21
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
movq %rbp, 0x8(%rax)
movl $0xa, 0x20(%rax)
jmp 0x2b21
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
movq %rbp, 0x8(%rax)
movl $0x5, 0x20(%rax)
jmp 0x2b21
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
movq %rbp, 0x8(%rax)
movl $0x4, 0x20(%rax)
movq 0x10(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq $0x1, 0x18(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x3d, (%rbx,%r15)
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdi
jne 0x2a82
leaq 0x2(%rdx), %rax
movq %rax, 0x20(%r14)
leaq 0x2(%rbp), %rax
movq %rax, 0x18(%r14)
movl $0xf, %eax
jmp 0x2a82
leaq 0x48cf(%rip), %rdi      # 0x744b
leaq 0x48d3(%rip), %rsi      # 0x7456
leaq 0x48d2(%rip), %rcx      # 0x745c
movl $0xb6, %edx
callq 0x10f0