// File: /workspace/github_cpp_makefile_star2_O3/JayWalker512[P]JayParser/main.cpp
// Function: main
int main (int argc, const char *argv[])
{
	Log *log = Log::init();
	
	if (argc != 2)
		log->add(new Error(FATAL + FILEERR + 1, "Invalid argument count. Expecting program file name."));
	else
	{
		std::ifstream inputFile(argv[1], std::ios::binary);
		
		if (!inputFile.is_open())
			log->add(new Error(FATAL + FILEERR + 2, "Can't open the file."));
		else
		{
			// Everything's looking good, starting the VM
			VM vm(&inputFile);
			vm.parse();
		}
	}
	
	Log::init()->displayLastError();
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x402a0, %rsp          # imm = 0x402A0
movq %rsi, %r14
movl %edi, %r15d
callq 0x2638
movq %rax, %rbx
cmpl $0x2, %r15d
jne 0x243b
movq 0x8(%r14), %rsi
leaq -0x268(%rbp), %rdi
movl $0x4, %edx
callq 0x21f0
leaq -0x1f0(%rbp), %rdi
callq 0x2040
testb %al, %al
je 0x24b9
leaq -0x402b8(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x2cf4
leaq -0x402b8(%rbp), %rdi
callq 0x2d82
leaq -0x402b8(%rbp), %rdi
callq 0x2d7c
jmp 0x2580
movl $0x28, %edi
callq 0x2120
movq %rax, %r14
leaq -0x50(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1bad(%rip), %rsi      # 0x4004
leaq 0x1bda(%rip), %rdx      # 0x4038
leaq -0x60(%rbp), %rdi
callq 0x2c54
movl $0x80ffff01, (%r14)     # imm = 0x80FFFF01
leaq 0x8(%r14), %rdi
movq %r14, %rax
addq $0x18, %rax
movq %rax, 0x8(%r14)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
movb $0x1, %r12b
callq 0x2bb6
movq %r14, -0x402b8(%rbp)
movq 0x30(%rbx), %rax
movq 0x40(%rbx), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x2530
movq %r14, (%rax)
addq $0x8, 0x30(%rbx)
jmp 0x2542
movl $0x28, %edi
callq 0x2120
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1b64(%rip), %rsi      # 0x4039
leaq 0x1b71(%rip), %rdx      # 0x404d
leaq -0x40(%rbp), %rdi
callq 0x2c54
movl $0x80ffff02, (%r14)     # imm = 0x80FFFF02
leaq 0x8(%r14), %rdi
movq %r14, %rax
addq $0x18, %rax
movq %rax, 0x8(%r14)
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
addq %rsi, %rdx
movb $0x1, %r12b
callq 0x2bb6
movq %r14, -0x402b8(%rbp)
movq 0x30(%rbx), %rax
movq 0x40(%rbx), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x2559
movq %r14, (%rax)
addq $0x8, 0x30(%rbx)
jmp 0x256b
xorl %r12d, %r12d
leaq -0x402b8(%rbp), %rsi
movq %rbx, %rdi
callq 0x29a4
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x258c
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2130
jmp 0x258c
xorl %r12d, %r12d
leaq -0x402b8(%rbp), %rsi
movq %rbx, %rdi
callq 0x29a4
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x2580
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2130
leaq -0x268(%rbp), %rdi
callq 0x2050
callq 0x2638
movq %rax, %rdi
callq 0x269e
xorl %eax, %eax
addq $0x402a0, %rsp          # imm = 0x402A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x25e5
movq %rax, %rbx
leaq -0x402b8(%rbp), %rdi
callq 0x2d7c
jmp 0x25f2
jmp 0x25c3
movq %rax, %rbx
jmp 0x25f2
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x25e0
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2130
testb %r12b, %r12b
je 0x25f2
movl $0x28, %esi
movq %r14, %rdi
callq 0x2130
leaq -0x268(%rbp), %rdi
callq 0x2050
jmp 0x262f
movq %rax, %rbx
jmp 0x2622
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x261d
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2130
testb %r12b, %r12b
je 0x262f
movl $0x28, %esi
movq %r14, %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x21d0
nop