// File: /workspace/github_cpp_makefile_star2_O3/pranavmodx[P]modlang/main.cpp
// Function: main
int main(int argc, char *argv[])
{
	if (argc < 2) {
		std::cout << "error: file name not specified" << std::endl;
		exit(1);
	}

	std::string filename(argv[1]);
	std::string input = readFile(filename);

	if (input.empty())
		return 0;

	Lexer lexer;
	Parser parser;
	Evaluator evaluator;

	Environment *env = new Environment();

	lexer.New(input);
	parser.New(lexer);

	Program *program = parser.ParseProgram();

	if (!parser.Errors().empty())
	{
		std::cout << "error: " << std::endl;

		for (auto error : parser.Errors())
			std::cout << error << std::endl;

		return 0;
	}

	Object *obj = evaluator.Eval(program, env);
	if (obj->type() != NULL_OBJ)
		std::cout << obj->inspect() << std::endl;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
cmpl $0x1, %edi
jle 0xbc84
movq 0x8(%rsi), %rsi
leaq 0x98(%rsp), %rbx
leaq 0xb8(%rsp), %rdx
movq %rbx, %rdi
callq 0xbd76
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0xb7cc
cmpq $0x0, 0x38(%rsp)
je 0xbc34
leaq 0x78(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
leaq 0xb8(%rsp), %rdi
callq 0x13840
movl $0x40, %edi
callq 0x51f0
movq %rax, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x30(%rax)
addq $0x30, %rax
movq %rax, (%rbx)
movq $0x1, 0x8(%rbx)
movups %xmm0, 0x10(%rbx)
movl $0x3f800000, 0x20(%rbx) # imm = 0x3F800000
movups %xmm0, 0x28(%rbx)
leaq 0x68(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xce3e
leaq 0xb8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x13d10
leaq 0xb8(%rsp), %rdi
callq 0x15e70
movq %rax, %r14
leaq 0x10(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x16a02
leaq 0x10(%rsp), %rdi
movq (%rdi), %r15
movq 0x8(%rdi), %r12
callq 0xbe14
cmpq %r12, %r15
je 0xbb31
movq 0x2959c(%rip), %rbx     # 0x34fd0
leaq 0x1d69a(%rip), %rsi     # 0x290d5
movl $0x7, %edx
movq %rbx, %rdi
callq 0x5240
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq 0x2956a(%rip), %rdi     # 0x34fd0
callq 0x5030
movq %rax, %rdi
callq 0x5160
leaq 0x50(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x16a02
movq 0x50(%rsp), %r13
movq 0x58(%rsp), %r12
cmpq %r12, %r13
je 0xbb1d
leaq 0x20(%rsp), %rbp
leaq 0x10(%rsp), %rbx
movq 0x29527(%rip), %r14     # 0x34fd0
movq %rbp, 0x10(%rsp)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0xc1a4
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %rdi
callq 0x5240
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5160
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0xbb14
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5200
addq $0x20, %r13
cmpq %r12, %r13
jne 0xbaa9
leaq 0x50(%rsp), %rdi
callq 0xbe14
leaq 0x78(%rsp), %r13
jmp 0xbc10
leaq 0xf(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1f0ca
movq %rax, %rbx
movq (%rax), %rax
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq *(%rax)
movq 0x18(%rsp), %rdx
cmpq 0x29dbb(%rip), %rdx     # 0x35918
jne 0xbb80
movq 0x10(%rsp), %r14
testq %rdx, %rdx
je 0xbb8a
movq 0x29da0(%rip), %rsi     # 0x35910
movq %r14, %rdi
callq 0x5210
testl %eax, %eax
setne %bpl
jmp 0xbb8c
movb $0x1, %bpl
movq 0x10(%rsp), %r14
jmp 0xbb8c
xorl %ebp, %ebp
leaq 0x20(%rsp), %r15
cmpq %r15, %r14
je 0xbba6
movq 0x20(%rsp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x5200
testb %bpl, %bpl
je 0xbc10
movq (%rbx), %rax
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq *0x8(%rax)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x29406(%rip), %rdi     # 0x34fd0
callq 0x5240
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5160
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0xbc10
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5200
leaq 0xb8(%rsp), %rdi
callq 0xbe72
movq 0x68(%rsp), %rdi
cmpq %r13, %rdi
je 0xbc34
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5200
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbc4f
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5200
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbc70
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x5200
xorl %eax, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x29345(%rip), %rdi     # 0x34fd0
leaq 0x1d424(%rip), %rsi     # 0x290b6
callq 0x51e0
movq %rax, %rdi
callq 0x5110
movl $0x1, %edi
callq 0x5260
jmp 0xbcdb
jmp 0xbcdb
jmp 0xbcdb
jmp 0xbcdb
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0xbd09
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5200
jmp 0xbd09
jmp 0xbcdb
movq %rax, %rbx
jmp 0xbd16
movq %rax, %rbx
jmp 0xbd4d
jmp 0xbcdb
movq %rax, %rbx
jmp 0xbd09
movq %rax, %rbx
jmp 0xbcff
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0xbcff
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5200
leaq 0x50(%rsp), %rdi
callq 0xbe14
leaq 0xb8(%rsp), %rdi
callq 0xbe72
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xbd32
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5200
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbd4d
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5200
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbd6e
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x5200
movq %rbx, %rdi
callq 0x53b0