// File: /workspace/github_cpp_makefile_star2_O1/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 0xbc9e
movq 0x8(%rsi), %rsi
leaq 0x98(%rsp), %rbx
leaq 0xb8(%rsp), %rdx
movq %rbx, %rdi
callq 0xbd90
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0xb7ec
cmpq $0x0, 0x38(%rsp)
je 0xbc4e
leaq 0x78(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
leaq 0xb8(%rsp), %rdi
callq 0x13828
movl $0x40, %edi
callq 0x51f0
movq %rax, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x30(%rax)
movaps %xmm0, 0x10(%rax)
addq $0x30, %rax
movq %rax, (%rbx)
movq $0x1, 0x8(%rbx)
movl $0x3f800000, 0x20(%rbx) # imm = 0x3F800000
movups %xmm0, 0x28(%rbx)
leaq 0x68(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xce56
leaq 0xb8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x13d26
leaq 0xb8(%rsp), %rdi
callq 0x15ea8
movq %rax, %r14
leaq 0x10(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x16a90
leaq 0x10(%rsp), %rdi
movq (%rdi), %r15
movq 0x8(%rdi), %r12
callq 0xbe2e
cmpq %r12, %r15
je 0xbb54
movq 0x2a579(%rip), %rbx     # 0x35fd0
leaq 0x1e677(%rip), %rsi     # 0x2a0d5
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 0x2a547(%rip), %rdi     # 0x35fd0
callq 0x5030
movq %rax, %rdi
callq 0x5160
leaq 0x50(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x16a90
movq 0x50(%rsp), %r13
movq 0x58(%rsp), %r12
cmpq %r12, %r13
je 0xbb40
leaq 0x20(%rsp), %rbp
leaq 0x10(%rsp), %rbx
movq 0x2a504(%rip), %r14     # 0x35fd0
movq %rbp, 0x10(%rsp)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0xc1b6
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 0xbb37
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5200
addq $0x20, %r13
cmpq %r12, %r13
jne 0xbacc
leaq 0x50(%rsp), %rdi
callq 0xbe2e
leaq 0x78(%rsp), %r13
jmp 0xbc2a
leaq 0xf(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1f2c8
movq %rax, %rbx
movq (%rax), %rax
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq *(%rax)
movq 0x18(%rsp), %rdx
movb $0x1, %bpl
cmpq 0x2ad95(%rip), %rdx     # 0x36918
jne 0xbba5
testq %rdx, %rdx
je 0xbba3
movq 0x2ad7f(%rip), %rsi     # 0x36910
movq 0x10(%rsp), %rdi
callq 0x5210
testl %eax, %eax
setne %bpl
jmp 0xbba5
xorl %ebp, %ebp
leaq 0x20(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0xbbc0
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5200
testb %bpl, %bpl
je 0xbc2a
movq (%rbx), %rax
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq *0x8(%rax)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x2a3ec(%rip), %rdi     # 0x35fd0
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 %r14, %rdi
je 0xbc2a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5200
leaq 0xb8(%rsp), %rdi
callq 0xbe8a
movq 0x68(%rsp), %rdi
cmpq %r13, %rdi
je 0xbc4e
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5200
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbc69
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5200
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbc8a
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 0x2a32b(%rip), %rdi     # 0x35fd0
leaq 0x1e40a(%rip), %rsi     # 0x2a0b6
callq 0x51e0
movq %rax, %rdi
callq 0x5110
movl $0x1, %edi
callq 0x5260
jmp 0xbcf5
jmp 0xbcf5
jmp 0xbcf5
jmp 0xbcf5
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xbd23
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5200
jmp 0xbd23
jmp 0xbcf5
movq %rax, %rbx
jmp 0xbd30
movq %rax, %rbx
jmp 0xbd67
jmp 0xbcf5
movq %rax, %rbx
jmp 0xbd23
movq %rax, %rbx
jmp 0xbd19
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0xbd19
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5200
leaq 0x50(%rsp), %rdi
callq 0xbe2e
leaq 0xb8(%rsp), %rdi
callq 0xbe8a
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xbd4c
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5200
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbd67
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5200
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbd88
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x5200
movq %rbx, %rdi
callq 0x53b0