// File: /workspace/github_cpp_makefile_star2_O1/philpoore[P]Math/./src/Lexer.cpp
// Function: Lexer::tokenize()
vector<Token> Lexer::tokenize() {
    vector<Token> tokens;

    while (i < size) {
        char a = peek();
        if (a == 'i' && peek(1) == 'f') {  // if
            Token t = createToken(TOKEN_IF);
            t.source = "if";
            tokens.push_back(t);
            advance(2);
            continue;
        } else if (peekStr(0, 4) == "else") {  // else
            Token t = createToken(TOKEN_ELSE);
            t.source = "else";
            tokens.push_back(t);
            advance(4);
            continue;
        } else if (isalpha(a)) {
            // idents
            string ident = "";
            Token t = createToken(TOKEN_IDENT);
            while (isalpha(a) || isdigit(a)) {
                ident += a;
                advance();
                a = peek();
            }
            t.source = ident;
            tokens.push_back(t);
            continue;
        } else if (isdigit(a)) {
            Token t = createToken(TOKEN_NUMBER_LITERAL);
            // number literal
            string number = "";
            while (isdigit(a)) {
                number += a;
                advance();
                a = peek();
            }

            // decimal point
            if (a == '.') {
                number += a;
                advance();
                a = peek();
                while (isdigit(a)) {
                    number += a;
                    advance();
                    a = peek();
                }
            }

            t.source = number;
            tokens.push_back(t);
            continue;
        } else if (isspace(a)) {
            string whitespace;

            Token t = createToken(TOKEN_WHITESPACE);
            while (isspace(a)) {
                whitespace += a;
                if (a == '\n') {
                    advanceRow();
                }
                advance();
                a = peek();
            }
            t.source = whitespace;
            tokens.push_back(t);
            continue;
        } else if (a == '*' && peek(1) == '*') {
            Token t = createToken(TOKEN_EXP);
            t.source = "**";
            tokens.push_back(t);
            advance(2);
            continue;
        } else {
            TokenType tt =
                tokenTypeMap.count(a) ? tokenTypeMap.at(a) : (TokenType)a;
            Token t = createToken(tt);
            t.source = a;
            tokens.push_back(t);
            advance();
        }
    }

    Token t = createToken(TOKEN_EOF);
    tokens.push_back(t);

    return tokens;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, -0x68(%rbp)
movq $0x0, 0x10(%rdi)
movl 0x20(%rsi), %eax
leaq -0x48(%rbp), %rbx
cmpl 0x24(%rsi), %eax
jge 0x7fdf
leaq -0x50(%rbp), %r12
leaq -0x60(%rbp), %r13
leaq -0x88(%rbp), %r15
cltq
movq (%r14), %rsi
movb (%rsi,%rax), %cl
movb %cl, -0x29(%rbp)
cmpb $0x69, %cl
jne 0x7ac9
cmpb $0x66, 0x1(%rsi,%rax)
jne 0x7ac9
movl $0x10e, -0x60(%rbp)     # imm = 0x10E
movq %rbx, -0x58(%rbp)
xorl %eax, %eax
movq %rax, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
movq %rax, -0x38(%rbp)
movq 0x28(%r14), %rax
movq %rax, -0x38(%rbp)
movl $0x2, %r8d
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x58ac(%rip), %rcx      # 0xd344
callq 0x32f0
movq -0x68(%rbp), %rdi
movq %r13, %rsi
callq 0xaf80
addl $0x2, 0x2c(%r14)
addl $0x2, 0x20(%r14)
movq -0x58(%rbp), %rdi
cmpq %rbx, %rdi
je 0x7c91
movq -0x48(%rbp), %rsi
jmp 0x7c18
addq %rax, %rsi
movq %r12, -0x60(%rbp)
leaq 0x4(%rsi), %rdx
movq %r13, %rdi
callq 0xb59a
movq %r13, %rdi
leaq 0x5861(%rip), %rsi      # 0xd347
callq 0x30c0
movl %eax, %r13d
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x7b03
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x3240
testl %r13d, %r13d
je 0x7c22
movsbl -0x29(%rbp), %r12d
movl %r12d, %edi
callq 0x3310
testl %eax, %eax
je 0x7ca4
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
movq %r15, %rdi
leaq 0x5977(%rip), %rdx      # 0xd4ad
movq %rdx, %rsi
callq 0xb59a
movl $0x101, -0x60(%rbp)     # imm = 0x101
movq %rbx, -0x58(%rbp)
xorl %eax, %eax
movq %rax, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
movq %rax, -0x38(%rbp)
movq 0x28(%r14), %rax
movq %rax, -0x38(%rbp)
movb -0x29(%rbp), %bl
movsbl %bl, %r12d
movl %r12d, %edi
callq 0x3310
testl %eax, %eax
setne %al
addl $-0x30, %r12d
cmpl $0xa, %r12d
setb %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x7bca
movsbl %bl, %esi
movq %r15, %rdi
callq 0x31e0
incl 0x2c(%r14)
movslq 0x20(%r14), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x20(%r14)
movq (%r14), %rcx
movb 0x1(%rcx,%rax), %bl
movb %bl, -0x29(%rbp)
movsbl %bl, %r12d
movl %r12d, %edi
callq 0x3310
testl %eax, %eax
setne %al
addl $-0x30, %r12d
cmpl $0xa, %r12d
setb %cl
orb %al, %cl
jne 0x7b85
leaq -0x58(%rbp), %rdi
movq %r15, %rsi
callq 0x3150
movq -0x68(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xaf80
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rbx
cmpq %rbx, %rdi
leaq -0x50(%rbp), %r12
je 0x7c00
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3240
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
leaq -0x60(%rbp), %r13
je 0x7c91
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3240
jmp 0x7c91
movl $0x10f, -0x60(%rbp)     # imm = 0x10F
movq %rbx, -0x58(%rbp)
xorl %eax, %eax
movq %rax, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
movq %rax, -0x38(%rbp)
movq 0x28(%r14), %rax
movq %rax, -0x38(%rbp)
movl $0x4, %r8d
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x56ef(%rip), %rcx      # 0xd347
callq 0x32f0
movq -0x68(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xaf80
addl $0x4, 0x2c(%r14)
addl $0x4, 0x20(%r14)
movq -0x58(%rbp), %rdi
cmpq %rbx, %rdi
leaq -0x50(%rbp), %r12
je 0x7c8d
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3240
leaq -0x60(%rbp), %r13
movl 0x20(%r14), %eax
cmpl 0x24(%r14), %eax
jl 0x7a4b
jmp 0x7fdf
leal -0x30(%r12), %eax
cmpl $0x9, %eax
ja 0x7dd7
movl $0x102, -0x60(%rbp)     # imm = 0x102
movq %rbx, -0x58(%rbp)
xorl %eax, %eax
movq %rax, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
movq %rax, -0x38(%rbp)
movq 0x28(%r14), %rax
movq %rax, -0x38(%rbp)
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
movq %r15, %rdi
leaq 0x57c5(%rip), %rdx      # 0xd4ad
movq %rdx, %rsi
callq 0xb59a
movsbl -0x29(%rbp), %eax
movl %eax, %ecx
addl $-0x30, %ecx
cmpl $0x9, %ecx
leaq -0x50(%rbp), %r12
leaq -0x60(%rbp), %r13
ja 0x7d36
movsbl %al, %esi
movq %r15, %rdi
callq 0x31e0
incl 0x2c(%r14)
movslq 0x20(%r14), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x20(%r14)
movq (%r14), %rcx
movsbl 0x1(%rcx,%rax), %eax
movb %al, -0x29(%rbp)
movl %eax, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x7d06
cmpb $0x2e, %al
jne 0x7d9a
movsbl %al, %esi
movq %r15, %rdi
callq 0x31e0
incl 0x2c(%r14)
movslq 0x20(%r14), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x20(%r14)
movq (%r14), %rcx
movsbl 0x1(%rcx,%rax), %eax
movb %al, -0x29(%rbp)
movl %eax, %ecx
addl $-0x30, %ecx
cmpl $0x9, %ecx
ja 0x7d9a
movsbl %al, %esi
movq %r15, %rdi
callq 0x31e0
incl 0x2c(%r14)
movslq 0x20(%r14), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x20(%r14)
movq (%r14), %rcx
movsbl 0x1(%rcx,%rax), %eax
movb %al, -0x29(%rbp)
movl %eax, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x7d6a
leaq -0x58(%rbp), %rdi
movq %r15, %rsi
callq 0x3150
movq -0x68(%rbp), %rdi
movq %r13, %rsi
callq 0xaf80
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x7ab3
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3240
jmp 0x7ab3
movl %r12d, %edi
callq 0x3070
testl %eax, %eax
je 0x7ebd
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
xorl %eax, %eax
movq %rax, -0x80(%rbp)
movb %al, -0x78(%rbp)
movl $0x111, -0x60(%rbp)     # imm = 0x111
movq %rbx, -0x58(%rbp)
movq %rax, -0x50(%rbp)
movb %al, -0x48(%rbp)
movq %rax, -0x38(%rbp)
movq 0x28(%r14), %rax
movq %rax, -0x38(%rbp)
movb -0x29(%rbp), %bl
movsbl %bl, %edi
callq 0x3070
testl %eax, %eax
leaq -0x50(%rbp), %r12
leaq -0x60(%rbp), %r13
je 0x7e73
movsbl %bl, %esi
movq %r15, %rdi
callq 0x31e0
cmpb $0xa, -0x29(%rbp)
jne 0x7e4d
movl $0x1, 0x2c(%r14)
incl 0x28(%r14)
incl 0x2c(%r14)
movslq 0x20(%r14), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x20(%r14)
movq (%r14), %rcx
movb 0x1(%rcx,%rax), %bl
movb %bl, -0x29(%rbp)
movsbl %bl, %edi
callq 0x3070
testl %eax, %eax
jne 0x7e30
leaq -0x58(%rbp), %rdi
movq %r15, %rsi
callq 0x3150
movq -0x68(%rbp), %rdi
movq %r13, %rsi
callq 0xaf80
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rbx
cmpq %rbx, %rdi
je 0x7ea4
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3240
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
jne 0x7c14
jmp 0x7c91
cmpb $0x2a, %r12b
jne 0x7f28
movslq 0x20(%r14), %rax
movq (%r14), %rcx
cmpb $0x2a, 0x1(%rcx,%rax)
jne 0x7f28
movl $0x109, -0x60(%rbp)     # imm = 0x109
movq %rbx, -0x58(%rbp)
xorl %eax, %eax
movq %rax, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
movq %rax, -0x38(%rbp)
movq 0x28(%r14), %rax
movq %rax, -0x38(%rbp)
movl $0x2, %r8d
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x5383(%rip), %rcx      # 0xd28a
callq 0x32f0
movq -0x68(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xaf80
addl $0x2, 0x2c(%r14)
addl $0x2, 0x20(%r14)
jmp 0x7c74
movq 0xa311(%rip), %rcx      # 0x12240
leaq 0xa302(%rip), %rax      # 0x12238
testq %rcx, %rcx
je 0x7f59
leaq 0xa2f6(%rip), %rax      # 0x12238
xorl %edx, %edx
cmpb %r12b, 0x20(%rcx)
setl %dl
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0x7f42
leaq 0xa2d8(%rip), %rcx      # 0x12238
cmpq %rcx, %rax
je 0x7f7e
cmpb 0x20(%rax), %r12b
jl 0x7f7e
leaq 0xa2be(%rip), %rdi      # 0x12230
leaq -0x29(%rbp), %rsi
callq 0xafec
movl (%rax), %r12d
movl %r12d, -0x60(%rbp)
movq %rbx, -0x58(%rbp)
xorl %eax, %eax
movq %rax, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
movq %rax, -0x38(%rbp)
testl %r12d, %r12d
js 0x8034
movq 0x28(%r14), %rax
movq %rax, -0x38(%rbp)
movsbl -0x29(%rbp), %r8d
movq -0x50(%rbp), %rdx
movl $0x1, %ecx
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
callq 0x3390
leaq -0x50(%rbp), %r12
leaq -0x60(%rbp), %r13
movq -0x68(%rbp), %rdi
movq %r13, %rsi
callq 0xaf80
incl 0x2c(%r14)
incl 0x20(%r14)
jmp 0x7ab3
leaq -0x60(%rbp), %rsi
movl $0x112, (%rsi)          # imm = 0x112
movq %rbx, 0x8(%rsi)
xorl %eax, %eax
movq %rax, 0x10(%rsi)
movb $0x0, 0x18(%rsi)
movq %rax, 0x28(%rsi)
movq 0x28(%r14), %rax
movq %rax, 0x28(%rsi)
movq -0x68(%rbp), %rdi
callq 0xaf80
movq -0x58(%rbp), %rdi
cmpq %rbx, %rdi
je 0x8021
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3240
movq -0x68(%rbp), %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x54b9(%rip), %rdi      # 0xd4f4
leaq 0x54c7(%rip), %rsi      # 0xd509
leaq 0x54d0(%rip), %rcx      # 0xd519
movl $0x24, %edx
callq 0x3170
jmp 0x807a
jmp 0x8068
jmp 0x8068
jmp 0x8068
movq %rax, %r14
jmp 0x80a0
jmp 0x80b3
jmp 0x8081
jmp 0x807a
jmp 0x8068
movq %rax, %r14
movq -0x58(%rbp), %rdi
cmpq %rbx, %rdi
jne 0x80ad
jmp 0x80eb
jmp 0x80b3
jmp 0x8081
movq %rax, %r14
jmp 0x80eb
jmp 0x80b3
movq %rax, %r14
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x80a0
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3240
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x80eb
movq -0x48(%rbp), %rsi
jmp 0x80e3
movq %rax, %r14
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x80cf
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3240
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x80eb
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3240
movq -0x68(%rbp), %rdi
callq 0xb03c
movq %r14, %rdi
callq 0x3370