// File: /workspace/github_cpp_makefile_star2_O3/RuiDGPires[P]CrimLang/src/main.cpp
// Function: main
int main(int argc, char *argv[]){
	if (argc < 3) {std::cout << "Invalid number of command line arguments\n"; return 0;}

	crl::Pproc_lib p;
	p.libc = argc - 3;
	if (argc > 3)
		p.libv = &argv[3];
	else
		p.libv = NULL;
	
	
	try{
		std::vector<crl::Token> vec = crl::tokenize(argv[1]);
		crl::preprocess(vec, p);
		//print_token_vec(vec);
		crl::Ast *ast = crl::generate_ast(vec);
		//std::cout << ast->to_string() << std::endl;
		crl::semantic_check(ast);
		generate_cas(ast, argv[2]);
		delete ast;
	}catch(std::string &e){
		std::cout << e << std::endl;
		return 1;
	}catch(crl::CL_Exception &e){
		std::cout << e.what() << std::endl;
		return 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
cmpl $0x2, %edi
jg 0xf3ee
movq 0x13c00(%rip), %rdi     # 0x22fd8
leaq 0xc2db(%rip), %rsi      # 0x1b6ba
movl $0x29, %edx
callq 0x3280
jmp 0xf4cc
movq %rsi, %rbx
movl %edi, %r14d
leaq 0x18(%rsi), %rax
xorl %r15d, %r15d
cmpl $0x3, %edi
cmovneq %rax, %r15
movq 0x8(%rsi), %rsi
leaq -0x80(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0xf618
leaq -0x40(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x1a488
addl $-0x3, %r14d
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf43d
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x3230
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x128f8
leaq -0x98(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xf656
leaq -0x98(%rbp), %rdi
callq 0x120fe
movq %rax, %r14
leaq -0x98(%rbp), %rdi
callq 0xf6fc
movq %r14, %rdi
callq 0x186b5
movq 0x10(%rbx), %rsi
leaq -0x60(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0xf618
leaq -0x60(%rbp), %rsi
movq %r14, %rdi
callq 0xda72
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf4b5
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x3230
testq %r14, %r14
je 0xf4c3
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
leaq -0x40(%rbp), %rdi
callq 0xf6fc
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r14
movq %rax, %rbx
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf544
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x3230
jmp 0xf544
jmp 0xf53e
movq %rdx, %r14
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0xf6fc
jmp 0xf544
jmp 0xf53e
movq %rdx, %r14
movq %rax, %rbx
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf54d
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x3230
jmp 0xf54d
movq %rdx, %r14
movq %rax, %rbx
jmp 0xf54d
movq %rdx, %r14
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0xf6fc
cmpl $0x2, %r14d
jne 0xf578
movq %rbx, %rdi
callq 0x30e0
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x13a6f(%rip), %rdi     # 0x22fd8
callq 0x3280
movq %rax, %rdi
callq 0x3110
jmp 0xf5cd
cmpl $0x1, %r14d
jne 0xf607
movq %rbx, %rdi
callq 0x30e0
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x52c6
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x13a31(%rip), %rdi     # 0x22fd8
callq 0x3280
movq %rax, %rdi
callq 0x3110
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf5cd
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3230
callq 0x33a0
movl $0x1, %eax
jmp 0xf4ce
movq %rax, %rbx
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf5f8
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3230
callq 0x33a0
jmp 0xf607
movq %rax, %rbx
callq 0x33a0
movq %rbx, %rdi
callq 0x33f0
movq %rax, %rdi
callq 0x4a30
nop