// File: /workspace/github_c_makefile_star2_O1/generot[P]VM-0/src/lang/util.cc
// Function: lex_file(char*)
lexer lex_file(char *filename) {
    token_vector tokens;

    fstream file(filename, ios::in);

    if(file.fail())
        ISSUE_ERROR("File \"%s\" does not exist.", filename);

    stringstream strm;

    strm << file.rdbuf();

    regex reg(LEX_REG);
    string str = strm.str();
    sregex_token_iterator it(str.begin(), str.end(), reg);

    while(it != sregex_token_iterator()) {
        tokens.push_back(string(*it));
        it++;
    }
    
    tokens.push_back("eof");

    return lexer(tokens, string(filename));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5d8, %rsp            # imm = 0x5D8
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x3c8(%rsp), %rdi
movl $0x8, %edx
callq 0x4400
movq 0x3c8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x3e8(%rsp,%rax)
jne 0x547a
leaq 0x240(%rsp), %rdi
callq 0x4210
leaq 0x250(%rsp), %rdi
leaq 0x3e0(%rsp), %rsi
callq 0x4070
leaq 0x11fe0(%rip), %rsi     # 0x17150
leaq 0x110(%rsp), %rdi
movl $0x10, %edx
callq 0x5652
leaq 0x258(%rsp), %rsi
leaq 0xb8(%rsp), %rdi
callq 0x4490
movq %r14, 0x20(%rsp)
movq %rbx, 0x28(%rsp)
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x130(%rsp), %rdi
leaq 0x110(%rsp), %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x56ba
leaq 0xa0(%rsp), %r13
leaq 0x40(%rsp), %r14
leaq 0x130(%rsp), %r15
leaq 0x30(%rsp), %r12
leaq 0x1b8(%rsp), %rbp
xorps %xmm0, %xmm0
movups %xmm0, 0x89(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movups %xmm0, (%r13)
movb $0x0, 0x10(%r13)
movq %r15, %rdi
movq %r12, %rsi
callq 0x12f1a
movl %eax, %ebx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x524e
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x42d0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x5265
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x42d0
testb %bl, %bl
jne 0x5316
movq 0x1a8(%rsp), %rax
cmpb $0x1, 0x10(%rax)
jne 0x5291
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r14, 0x30(%rsp)
movq %r12, %rdi
callq 0x12fe2
jmp 0x52a4
movq %r14, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movb $0x0, 0x40(%rsp)
movq %rsp, %rdi
movq %r12, %rsi
callq 0x13056
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x52c6
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x42d0
movq %rbp, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x57a2
movq 0x1f8(%rsp), %rdi
testq %rdi, %rdi
je 0x52f0
movq 0x208(%rsp), %rsi
subq %rdi, %rsi
callq 0x42d0
movq 0x1d8(%rsp), %rdi
testq %rdi, %rdi
je 0x51f1
movq 0x1e8(%rsp), %rsi
subq %rdi, %rsi
callq 0x42d0
jmp 0x51f1
leaq 0x30(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x11df5(%rip), %rsi     # 0x1711a
leaq 0x11df1(%rip), %rdx     # 0x1711d
callq 0x59ce
movq %rsp, %rdi
leaq 0x30(%rsp), %rsi
callq 0x13056
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x5355
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x42d0
leaq 0xf8(%rsp), %rdi
movq %rsp, %rsi
callq 0x558a
movq 0x28(%rsp), %rbx
movq 0x20(%rsp), %rsi
leaq 0xd8(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x5614
leaq 0xf8(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
movq %rbx, %rdi
callq 0x4a5c
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x53ba
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x42d0
leaq 0xf8(%rsp), %rdi
callq 0x57d8
movq 0x170(%rsp), %rdi
testq %rdi, %rdi
je 0x53e4
movq 0x180(%rsp), %rsi
subq %rdi, %rsi
callq 0x42d0
movq 0x150(%rsp), %rdi
testq %rdi, %rdi
je 0x5401
movq 0x160(%rsp), %rsi
subq %rdi, %rsi
callq 0x42d0
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5422
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x42d0
leaq 0x110(%rsp), %rdi
callq 0x5834
movq 0x1bb42(%rip), %rsi     # 0x20f78
leaq 0x240(%rsp), %rdi
callq 0x4240
leaq 0x2c0(%rsp), %rdi
callq 0x40d0
leaq 0x3c8(%rsp), %rdi
callq 0x4080
movq %rsp, %rdi
callq 0x57d8
movq %rbx, %rax
addq $0x5d8, %rsp            # imm = 0x5D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x45ac
movq %rax, %rbx
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x54ab
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0x54ab
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x57d8
jmp 0x5511
jmp 0x54ff
jmp 0x54e3
jmp 0x54ff
movq %rax, %rbx
jmp 0x551e
movq %rax, %rbx
jmp 0x553f
jmp 0x54cc
movq %rax, %rbx
jmp 0x554c
movq %rax, %rbx
jmp 0x556d
movq %rax, %rbx
jmp 0x557a
jmp 0x54ff
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x5511
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0x5511
movq %rax, %rbx
jmp 0x5511
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x5770
leaq 0x130(%rsp), %rdi
callq 0x5770
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x553f
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x42d0
leaq 0x110(%rsp), %rdi
callq 0x5834
movq 0x1ba25(%rip), %rsi     # 0x20f78
leaq 0x240(%rsp), %rdi
callq 0x4240
leaq 0x2c0(%rsp), %rdi
callq 0x40d0
leaq 0x3c8(%rsp), %rdi
callq 0x4080
movq %rsp, %rdi
callq 0x57d8
movq %rbx, %rdi
callq 0x44e0