// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x6b0, %rsp            # imm = 0x6B0
movq %rdi, -0x660(%rbp)
movq %rdi, %rax
movq %rax, -0x658(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x6eb0
movq -0x10(%rbp), %rsi
leaq -0x238(%rbp), %rdi
movl $0x8, %edx
callq 0x5580
jmp 0x6484
movq -0x238(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x238(%rbp,%rax), %rdi
callq 0x5030
movb %al, -0x661(%rbp)
jmp 0x64a4
movb -0x661(%rbp), %al
testb $0x1, %al
jne 0x64b0
jmp 0x6504
movq 0x4db09(%rip), %rax     # 0x53fc0
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x32cec(%rip), %rsi     # 0x391b1
movb $0x0, %al
callq 0x55e0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x54f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x694d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x6941
leaq -0x3d0(%rbp), %rdi
callq 0x52f0
jmp 0x6512
leaq -0x3c0(%rbp), %rax
movq %rax, -0x678(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x5450
movq %rax, -0x670(%rbp)
jmp 0x6535
movq -0x670(%rbp), %rsi
movq -0x678(%rbp), %rdi
callq 0x50b0
jmp 0x654a
leaq 0x32c7b(%rip), %rsi     # 0x391cc
leaq -0x3f0(%rbp), %rdi
movl $0x10, %edx
callq 0x6ed0
jmp 0x6564
leaq -0x410(%rbp), %rdi
leaq -0x3d0(%rbp), %rsi
callq 0x53c0
jmp 0x6579
leaq -0x410(%rbp), %rdi
movq %rdi, -0x680(%rbp)
callq 0x5370
movq %rax, -0x4a8(%rbp)
leaq -0x4a0(%rbp), %rdi
leaq -0x4a8(%rbp), %rsi
callq 0x6f70
movq -0x680(%rbp), %rdi
callq 0x5230
movq %rax, -0x4b8(%rbp)
leaq -0x4b0(%rbp), %rdi
leaq -0x4b8(%rbp), %rsi
callq 0x6f70
movq -0x4a0(%rbp), %rsi
movq -0x4b0(%rbp), %rdx
leaq -0x498(%rbp), %rdi
leaq -0x3f0(%rbp), %rcx
xorl %r9d, %r9d
movl %r9d, %r8d
callq 0x6fb0
jmp 0x65f5
jmp 0x65f7
leaq -0x540(%rbp), %rdi
callq 0x70f0
jmp 0x6605
leaq -0x498(%rbp), %rdi
leaq -0x540(%rbp), %rsi
callq 0x70c0
movb %al, -0x681(%rbp)
jmp 0x6620
leaq -0x540(%rbp), %rdi
callq 0x7170
movb -0x681(%rbp), %al
testb $0x1, %al
jne 0x663b
jmp 0x674d
leaq -0x498(%rbp), %rdi
callq 0x71d0
movq %rax, -0x690(%rbp)
jmp 0x6650
movq -0x690(%rbp), %rsi
leaq -0x560(%rbp), %rdi
callq 0x71f0
jmp 0x6665
leaq -0x28(%rbp), %rdi
leaq -0x560(%rbp), %rsi
callq 0x71a0
jmp 0x6677
leaq -0x560(%rbp), %rdi
callq 0x5260
leaq -0x5e8(%rbp), %rdi
leaq -0x498(%rbp), %rsi
xorl %edx, %edx
callq 0x7220
jmp 0x669a
leaq -0x5e8(%rbp), %rdi
callq 0x7170
jmp 0x65f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x6935
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x6929
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x691d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x6911
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x540(%rbp), %rdi
callq 0x7170
jmp 0x6911
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x560(%rbp), %rdi
callq 0x5260
jmp 0x6911
leaq -0x609(%rbp), %rdi
movq %rdi, -0x698(%rbp)
callq 0x56e0
movq -0x698(%rbp), %rdx
leaq 0x32a28(%rip), %rsi     # 0x39196
leaq -0x608(%rbp), %rdi
callq 0x6b50
jmp 0x677c
leaq -0x28(%rbp), %rdi
leaq -0x608(%rbp), %rsi
callq 0x71a0
jmp 0x678e
leaq -0x608(%rbp), %rdi
callq 0x5260
leaq -0x609(%rbp), %rdi
callq 0x5460
leaq -0x628(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x6970
jmp 0x67b8
movq -0x10(%rbp), %rax
movq %rax, -0x6a8(%rbp)
leaq -0x649(%rbp), %rdi
movq %rdi, -0x6a0(%rbp)
callq 0x56e0
movq -0x6a8(%rbp), %rsi
movq -0x6a0(%rbp), %rdx
leaq -0x648(%rbp), %rdi
callq 0x6b50
jmp 0x67f2
movq -0x660(%rbp), %rdi
leaq -0x628(%rbp), %rsi
leaq -0x648(%rbp), %rdx
callq 0x5970
jmp 0x680e
leaq -0x648(%rbp), %rdi
callq 0x5260
leaq -0x649(%rbp), %rdi
callq 0x5460
leaq -0x628(%rbp), %rdi
callq 0x72a0
leaq -0x498(%rbp), %rdi
callq 0x7170
leaq -0x410(%rbp), %rdi
callq 0x5260
leaq -0x3f0(%rbp), %rdi
callq 0x7300
leaq -0x3d0(%rbp), %rdi
callq 0x5320
leaq -0x238(%rbp), %rdi
callq 0x50c0
leaq -0x28(%rbp), %rdi
callq 0x72a0
movq -0x658(%rbp), %rax
addq $0x6b0, %rsp            # imm = 0x6B0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x68b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x608(%rbp), %rdi
callq 0x5260
leaq -0x609(%rbp), %rdi
callq 0x5460
jmp 0x6911
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x68f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x648(%rbp), %rdi
callq 0x5260
leaq -0x649(%rbp), %rdi
callq 0x5460
leaq -0x628(%rbp), %rdi
callq 0x72a0
leaq -0x498(%rbp), %rdi
callq 0x7170
leaq -0x410(%rbp), %rdi
callq 0x5260
leaq -0x3f0(%rbp), %rdi
callq 0x7300
leaq -0x3d0(%rbp), %rdi
callq 0x5320
leaq -0x238(%rbp), %rdi
callq 0x50c0
leaq -0x28(%rbp), %rdi
callq 0x72a0
movq -0x240(%rbp), %rdi
callq 0x56d0
nopw %cs:(%rax,%rax)
nopl (%rax)