// File: /workspace/github_cpp_makefile_star2_O2/tsoding[P]wcc/src/./wcc_alexer.cpp
// Function: Alexer::tokenize()
void Alexer::tokenize()
{
    auto source = input.trim_begin();
    while (source.count > 0) {
        if (is_symbol_start(*source.data)) {
            String_View token_text = chop_while(&source, is_symbol);

            if (token_text == "while"_sv) {
                tokens.push(Token {Token_Type::While, token_text});
            } else if (token_text == "func"_sv) {
                tokens.push(Token {Token_Type::Func, token_text});
            } else if (token_text == "local"_sv) {
                tokens.push(Token {Token_Type::Local, token_text});
            } else if (token_text == "if"_sv) {
                tokens.push(Token {Token_Type::If, token_text});
            } else if (token_text == "else"_sv) {
                tokens.push(Token {Token_Type::Else, token_text});
            } else if (token_text == "return"_sv) {
                tokens.push(Token {Token_Type::Return, token_text});
            } else if (token_text == "true"_sv) {
                tokens.push(Token {Token_Type::True, token_text});
            } else if (token_text == "false"_sv) {
                tokens.push(Token {Token_Type::False, token_text});
            } else {
                tokens.push(Token {Token_Type::Symbol, token_text});
            }
        } else if (isdigit(*source.data)) {
            String_View token_text = chop_while(&source, isdigit);
            tokens.push(Token {Token_Type::Number_Literal, token_text});
        } else {
            switch (*source.data) {
            case '(':
                tokens.push(Token {Token_Type::Open_Paren, chop_off(&source, 1)});
                break;
            case ')':
                tokens.push(Token {Token_Type::Closed_Paren, chop_off(&source, 1)});
                break;
            case ':':
                tokens.push(Token {Token_Type::Colon, chop_off(&source, 1)});
                break;
            case '{':
                tokens.push(Token {Token_Type::Open_Curly, chop_off(&source, 1)});
                break;
            case '}':
                tokens.push(Token {Token_Type::Closed_Curly, chop_off(&source, 1)});
                break;
            case '=':
                if (source.count > 1 && source.data[1] == '=') {
                    tokens.push(Token {Token_Type::Equals_Equals, chop_off(&source, 2)});
                } else {
                    tokens.push(Token {Token_Type::Equals, chop_off(&source, 1)});
                }
                break;
            case '>':
                tokens.push(Token {Token_Type::Greater, chop_off(&source, 1)});
                break;
            case '<':
                if (source.count > 1 && source.data[1] == '=') {
                    tokens.push(Token {Token_Type::Less_Equals, chop_off(&source, 2)});
                } else {
                    reporter.fail(static_cast<size_t>(source.data - input.data), "Unexpected character `", *source.data, "`");
                }
                break;
            case '&':
                if (source.count > 1 && source.data[1] == '&') {
                    tokens.push(Token {Token_Type::And, chop_off(&source, 2)});
                } else {
                    reporter.fail(static_cast<size_t>(source.data - input.data), "Unexpected character `", *source.data, "`");
                }
                break;
            case ',':
                tokens.push(Token {Token_Type::Comma, chop_off(&source, 1)});
                break;
            case '+':
                if (source.count > 1 && source.data[1] == '=') {
                    tokens.push(Token {Token_Type::Plus_Equals, chop_off(&source, 2)});
                } else {
                    tokens.push(Token {Token_Type::Plus, chop_off(&source, 1)});
                }
                break;
            case '*':
                tokens.push(Token {Token_Type::Asterisk, chop_off(&source, 1)});
                break;
            case '/':
                if (source.count > 1 && source.data[1] == '/') {
                    chop_while(&source, is_not_newline);
                } else {
                    reporter.fail(static_cast<size_t>(source.data - input.data), "Unexpected character `", *source.data, "`");
                }
                break;
            case '%':
                tokens.push(Token {Token_Type::Rem, chop_off(&source, 1)});
                break;
            case '-':
                if (source.count > 1 && source.data[1] == '=') {
                    tokens.push(Token {Token_Type::Minus_Equals, chop_off(&source, 2)});
                } else {
                    tokens.push(Token {Token_Type::Minus, chop_off(&source, 1)});
                }
                break;
            case ';':
                tokens.push(Token {Token_Type::Semicolon, chop_off(&source, 1)});
                break;

            default: {
                assert(input.data <= source.data);
                reporter.fail(static_cast<size_t>(source.data - input.data), "Unexpected character `", *source.data, "`");
            }
            }
        }
        source = source.trim_begin();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
movq %rdi, %rbx
callq 0x5d8c
movq %rax, %r12
movq %rdx, %r13
leaq -0x38(%rbp), %r14
movq %rax, (%r14)
movq %rbx, -0x40(%rbp)
leaq 0x10(%rbx), %r15
movq %r13, -0x30(%rbp)
testq %r12, %r12
je 0x2bd9
movsbl (%r13), %ebx
movl %ebx, %edi
callq 0x23fb
testb %al, %al
je 0x24da
movq %r14, %rdi
leaq -0x7a(%rip), %rsi       # 0x241c
callq 0x5dd2
movq %rax, -0x50(%rbp)
movq %rdx, -0x48(%rbp)
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
pushq $0x5
popq %rsi
leaq 0x6479(%rip), %rdx      # 0x892d
callq 0x5b90
testb %al, %al
je 0x251a
movl $0xc, -0x2f0(%rbp)
leaq -0x2e8(%rbp), %rax
leaq -0x2f0(%rbp), %rcx
jmp 0x2ba3
leal -0x30(%rbx), %eax
cmpl $0x9, %eax
ja 0x254a
movq %r14, %rdi
movq 0xbaec(%rip), %rsi      # 0xdfd8
callq 0x5e87
movl $0xb, -0x218(%rbp)
movq %rax, -0x210(%rbp)
movq %rdx, -0x208(%rbp)
movq %rdx, 0x10(%rsp)
movups -0x218(%rbp), %xmm0
jmp 0x2bb6
movq %rbx, %rdi
pushq $0x4
popq %rsi
leaq 0x640c(%rip), %rdx      # 0x8933
callq 0x5b90
testb %al, %al
je 0x25a7
andl $0x0, -0x2d8(%rbp)
leaq -0x2d0(%rbp), %rax
leaq -0x2d8(%rbp), %rcx
jmp 0x2ba3
movzbl %bl, %eax
leal -0x25(%rax), %ecx
cmpl $0x19, %ecx
ja 0x260d
leaq 0x5b14(%rip), %rdx      # 0x8074
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movl $0x15, -0xb0(%rbp)
decq %r12
movq %r13, %rax
incq %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x1, -0xa8(%rbp)
movq %r13, -0xa0(%rbp)
movq %r13, 0x10(%rsp)
movups -0xb0(%rbp), %xmm0
jmp 0x2bb6
movq %rbx, %rdi
pushq $0x5
popq %rsi
leaq 0x66db(%rip), %rdx      # 0x8c8f
callq 0x5b90
testb %al, %al
je 0x25da
movl $0x8, -0x2c0(%rbp)
leaq -0x2b8(%rbp), %rax
leaq -0x2c0(%rbp), %rcx
jmp 0x2ba3
movq %rbx, %rdi
pushq $0x2
popq %rsi
leaq 0x73c1(%rip), %rdx      # 0x99a8
callq 0x5b90
testb %al, %al
je 0x265d
movl $0x16, -0x2a8(%rbp)
leaq -0x2a0(%rbp), %rax
leaq -0x2a8(%rbp), %rcx
jmp 0x2ba3
cmpl $0x7b, %eax
je 0x2a3f
cmpl $0x7d, %eax
jne 0x2c55
movl $0x7, -0x1a0(%rbp)
decq %r12
movq %r13, %rax
incq %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x1, -0x198(%rbp)
movq %r13, -0x190(%rbp)
movq %r13, 0x10(%rsp)
movups -0x1a0(%rbp), %xmm0
jmp 0x2bb6
movq %rbx, %rdi
pushq $0x4
popq %rsi
leaq 0x62ce(%rip), %rdx      # 0x8938
callq 0x5b90
testb %al, %al
je 0x2690
movl $0x17, -0x290(%rbp)
leaq -0x288(%rbp), %rax
leaq -0x290(%rbp), %rcx
jmp 0x2ba3
movq %rbx, %rdi
pushq $0x6
popq %rsi
leaq 0x62a0(%rip), %rdx      # 0x893d
callq 0x5b90
testb %al, %al
je 0x2b2b
movl $0x19, -0x278(%rbp)
leaq -0x270(%rbp), %rax
leaq -0x278(%rbp), %rcx
jmp 0x2ba3
movl $0xd, -0x158(%rbp)
decq %r12
movq %r13, %rax
incq %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x1, -0x150(%rbp)
movq %r13, -0x148(%rbp)
movq %r13, 0x10(%rsp)
movups -0x158(%rbp), %xmm0
jmp 0x2bb6
cmpq $0x1, %r12
je 0x2a7d
cmpb $0x3d, 0x1(%r13)
jne 0x2a7d
movl $0xa, -0x188(%rbp)
addq $-0x2, %r12
movq %r13, %rax
addq $0x2, %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x2, -0x180(%rbp)
movq %r13, -0x178(%rbp)
movq %r13, 0x10(%rsp)
movups -0x188(%rbp), %xmm0
jmp 0x2bb6
movl $0x13, -0x68(%rbp)
decq %r12
movq %r13, %rax
incq %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x1, -0x60(%rbp)
movq %r13, -0x58(%rbp)
movq %r13, 0x10(%rsp)
movups -0x68(%rbp), %xmm0
jmp 0x2bb6
movl $0x18, -0xc8(%rbp)
decq %r12
movq %r13, %rax
incq %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x1, -0xc0(%rbp)
movq %r13, -0xb8(%rbp)
movq %r13, 0x10(%rsp)
movups -0xc8(%rbp), %xmm0
jmp 0x2bb6
movl $0x4, -0x1d0(%rbp)
decq %r12
movq %r13, %rax
incq %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x1, -0x1c8(%rbp)
movq %r13, -0x1c0(%rbp)
movq %r13, 0x10(%rsp)
movups -0x1d0(%rbp), %xmm0
jmp 0x2bb6
cmpq $0x1, %r12
je 0x2c2d
cmpb $0x26, 0x1(%r13)
jne 0x2c2d
movl $0x14, -0x128(%rbp)
addq $-0x2, %r12
movq %r13, %rax
addq $0x2, %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x2, -0x120(%rbp)
movq %r13, -0x118(%rbp)
movq %r13, 0x10(%rsp)
movups -0x128(%rbp), %xmm0
jmp 0x2bb6
movl $0x3, -0x1e8(%rbp)
decq %r12
movq %r13, %rax
incq %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x1, -0x1e0(%rbp)
movq %r13, -0x1d8(%rbp)
movq %r13, 0x10(%rsp)
movups -0x1e8(%rbp), %xmm0
jmp 0x2bb6
cmpq $0x1, %r12
je 0x2abb
cmpb $0x3d, 0x1(%r13)
jne 0x2abb
movl $0x10, -0x98(%rbp)
addq $-0x2, %r12
movq %r13, %rax
addq $0x2, %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x2, -0x90(%rbp)
movq %r13, -0x88(%rbp)
movq %r13, 0x10(%rsp)
movups -0x98(%rbp), %xmm0
jmp 0x2bb6
movl $0x5, -0x110(%rbp)
decq %r12
movq %r13, %rax
incq %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x1, -0x108(%rbp)
movq %r13, -0x100(%rbp)
movq %r13, 0x10(%rsp)
movups -0x110(%rbp), %xmm0
jmp 0x2bb6
movl $0x2, -0x200(%rbp)
decq %r12
movq %r13, %rax
incq %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x1, -0x1f8(%rbp)
movq %r13, -0x1f0(%rbp)
movq %r13, 0x10(%rsp)
movups -0x200(%rbp), %xmm0
jmp 0x2bb6
cmpq $0x1, %r12
je 0x2c0c
cmpb $0x2f, 0x1(%r13)
jne 0x2c0c
movq %r14, %rdi
leaq -0x59d(%rip), %rsi      # 0x23ee
callq 0x5dd2
jmp 0x2bc2
cmpq $0x1, %r12
je 0x2aed
cmpb $0x3d, 0x1(%r13)
jne 0x2aed
movl $0x11, -0xf8(%rbp)
addq $-0x2, %r12
movq %r13, %rax
addq $0x2, %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x2, -0xf0(%rbp)
movq %r13, -0xe8(%rbp)
movq %r13, 0x10(%rsp)
movups -0xf8(%rbp), %xmm0
jmp 0x2bb6
cmpq $0x1, %r12
je 0x2beb
cmpb $0x3d, 0x1(%r13)
jne 0x2beb
movl $0xe, -0x140(%rbp)
addq $-0x2, %r12
movq %r13, %rax
addq $0x2, %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x2, -0x138(%rbp)
movq %r13, -0x130(%rbp)
movq %r13, 0x10(%rsp)
movups -0x140(%rbp), %xmm0
jmp 0x2bb6
movl $0x6, -0x1b8(%rbp)
decq %r12
movq %r13, %rax
incq %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x1, -0x1b0(%rbp)
movq %r13, -0x1a8(%rbp)
movq %r13, 0x10(%rsp)
movups -0x1b8(%rbp), %xmm0
jmp 0x2bb6
movl $0x9, -0x170(%rbp)
decq %r12
movq %r13, %rax
incq %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x1, -0x168(%rbp)
movq %r13, -0x160(%rbp)
movq %r13, 0x10(%rsp)
movups -0x170(%rbp), %xmm0
jmp 0x2bb6
movl $0x12, -0x80(%rbp)
decq %r12
movq %r13, %rax
incq %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x1, -0x78(%rbp)
movq %r13, -0x70(%rbp)
movq %r13, 0x10(%rsp)
movups -0x80(%rbp), %xmm0
jmp 0x2bb6
movl $0xf, -0xe0(%rbp)
decq %r12
movq %r13, %rax
incq %rax
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
movq $0x1, -0xd8(%rbp)
movq %r13, -0xd0(%rbp)
movq %r13, 0x10(%rsp)
movups -0xe0(%rbp), %xmm0
jmp 0x2bb6
movq %rbx, %rdi
pushq $0x4
popq %rsi
leaq 0x5898(%rip), %rdx      # 0x83d0
callq 0x5b90
testb %al, %al
je 0x2b5b
movl $0x1a, -0x260(%rbp)
leaq -0x258(%rbp), %rax
leaq -0x260(%rbp), %rcx
jmp 0x2ba3
movq %rbx, %rdi
pushq $0x5
popq %rsi
leaq 0x586d(%rip), %rdx      # 0x83d5
callq 0x5b90
testb %al, %al
je 0x2b8b
movl $0x1b, -0x248(%rbp)
leaq -0x240(%rbp), %rax
leaq -0x248(%rbp), %rcx
jmp 0x2ba3
movl $0x1, -0x230(%rbp)
leaq -0x228(%rbp), %rax
leaq -0x230(%rbp), %rcx
movups -0x50(%rbp), %xmm0
movups %xmm0, (%rax)
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rsp)
movups (%rcx), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0x5e40
movq %r14, %rdi
callq 0x5d8c
movq %rax, %r12
movq %rdx, %r13
movq %rax, -0x38(%rbp)
jmp 0x246f
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x40(%rbp), %rdi
movq 0x8(%rdi), %rax
subq %rax, %r13
addq $0x28, %rdi
leaq 0x5d43(%rip), %rdx      # 0x8944
leaq 0x5a8d(%rip), %r8       # 0x8695
pushq $0x3c
jmp 0x2c4c
movq -0x40(%rbp), %rdi
movq 0x8(%rdi), %rax
subq %rax, %r13
addq $0x28, %rdi
leaq 0x5d22(%rip), %rdx      # 0x8944
leaq 0x5a6c(%rip), %r8       # 0x8695
pushq $0x2f
jmp 0x2c4c
movq -0x40(%rbp), %rdi
movq 0x8(%rdi), %rax
subq %rax, %r13
addq $0x28, %rdi
leaq 0x5d01(%rip), %rdx      # 0x8944
leaq 0x5a4b(%rip), %r8       # 0x8695
pushq $0x26
popq %rcx
movq %r13, %rsi
callq 0x5ef4
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
cmpq %r13, %rax
jbe 0x2c81
leaq 0x5cf2(%rip), %rdi      # 0x895b
leaq 0x5d05(%rip), %rsi      # 0x8975
leaq 0x5d13(%rip), %rcx      # 0x898a
movl $0xb2, %edx
callq 0x1090
movq -0x40(%rbp), %rdi
addq $0x28, %rdi
subq %rax, %r13
leaq 0x5cb1(%rip), %rdx      # 0x8944
leaq 0x59fb(%rip), %r8       # 0x8695
movq %r13, %rsi
movl %ebx, %ecx
callq 0x5ef4