// File: /workspace/github_cpp_makefile_star2_O1/Silica[P]PSL/PSL.cpp
// Function: main
int main(int argc, char **argv)
{
	if (argc < 2)
		return 0;

	using namespace PSL;
	PSLVM p;
	if (PSLVM::error e = p.loadScript(argv[1]))
	{
		if (e == PSLVM::FOPEN_ERROR)
		{
			string input = argv[1];
			for (int i = 2; i < argc; ++i)
			{
				input += ' ';
				input += argv[i];
			}
			input += ';';
			p.loadString(input);
			variable v = p.run();
			printf("%s", v.toString().c_str());
			return 0;
		}
		else
		{
			printf(" - compile error\n");
		}
	}
	else
	{
		printf(" - compiled\n");

		if (argc > 2)
			p.writeCompiledCode(argv[2]);

#ifdef PSL_DEBUG
		variable r;
		while (!(r = p.stepExec())) if (getch() == 'q')break;
#endif
		variable v = p.run(argv[1]);
	}

	#ifdef _WIN32
	printf("end - press any key\n");
	getch();
	#endif
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
cmpl $0x2, %edi
jl 0xc65b
movq %rsi, %r14
movl %edi, %ebp
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0xcb90
leaq 0x1c2b4(%rip), %rbx     # 0x286f2
movl $0x6, %edi
movq %rbx, %rsi
callq 0xc180
movq 0x8(%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0xc75c
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc6fc
movl %eax, %r15d
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xc47a
callq 0xfbc0
testl %r15d, %r15d
je 0xc5c2
cmpl $0x1, %r15d
jne 0xc645
movq 0x8(%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0xc75c
cmpl $0x2, %ebp
je 0xc4d9
cmpl $0x4, %ebp
movl $0x3, %r12d
cmovgel %ebp, %r12d
movl $0x2, %r13d
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x20, %esi
callq 0xc7dc
movq (%r14,%r13,8), %rsi
movq %r15, %rdi
callq 0xc872
incq %r13
cmpq %r13, %r12
jne 0xc4b8
leaq 0x8(%rsp), %rdi
movl $0x3b, %esi
callq 0xc7dc
leaq 0x1bf25(%rip), %rsi     # 0x28414
leaq 0x10(%rsp), %rdi
callq 0xc75c
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0xc940
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc51c
callq 0xfbc0
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0xca22
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0xc998
movq 0x10(%rsp), %r14
incl 0x8(%r14)
movq %r14, %rdi
callq 0xfc04
movq 0x18(%rsp), %rdi
callq 0xfc04
movq (%r14), %rsi
movq (%rsi), %rax
leaq 0x10(%rsp), %rdi
callq *0xf8(%rax)
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xc582
movq 0x8(%rax), %rcx
movq 0x18(%rax), %rdx
movb $0x0, (%rcx,%rdx)
movq 0x8(%rax), %rbx
leaq 0x1be96(%rip), %rdi     # 0x2841f
movq %rbx, %rsi
xorl %eax, %eax
callq 0xc050
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc5a2
callq 0xfbc0
movq %r14, %rdi
callq 0xfc04
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xc651
callq 0xfbc0
jmp 0xc651
leaq 0x1c4cc(%rip), %rdi     # 0x28a95
callq 0xc240
cmpl $0x2, %ebp
je 0xc5ff
movq 0x10(%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0xc75c
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xca92
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xc5ff
callq 0xfbc0
movq 0x8(%r14), %rsi
leaq 0x10(%rsp), %rdi
callq 0xcaf2
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0xc998
movq 0x8(%rsp), %rbx
incl 0x8(%rbx)
movq %rbx, %rdi
callq 0xfc04
movq 0x10(%rsp), %rdi
callq 0xfc04
movq %rbx, %rdi
callq 0xfc04
jmp 0xc651
leaq 0x1c455(%rip), %rdi     # 0x28aa1
callq 0xc240
leaq 0x20(%rsp), %rdi
callq 0x12de0
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc6d8
jmp 0xc6d3
jmp 0xc6c5
movq %rax, %rbx
movq %r14, %rdi
callq 0xfc04
jmp 0xc6db
jmp 0xc6c5
jmp 0xc6c5
jmp 0xc6c5
movq %rax, %rbx
movq 0x18(%rsp), %rdi
callq 0xfc04
jmp 0xc6db
jmp 0xc6c5
jmp 0xc6d8
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc6db
callq 0xfbc0
jmp 0xc6db
jmp 0xc6d8
jmp 0xc6d8
jmp 0xc6c5
jmp 0xc6c5
jmp 0xc6c5
movq %rax, %rbx
movq 0x10(%rsp), %rdi
callq 0xfc04
jmp 0xc6ea
movq %rax, %rdi
callq 0xde83
jmp 0xc6d3
jmp 0xc6d3
jmp 0xc6d8
movq %rax, %rbx
jmp 0xc6ea
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xc6ea
callq 0xfbc0
leaq 0x20(%rsp), %rdi
callq 0x12de0
movq %rbx, %rdi
callq 0xc290