// File: /workspace/github_cpp_makefile_star2_O1/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 0xf472
movq 0x13b7c(%rip), %rdi     # 0x22fd8
leaq 0xc257(%rip), %rsi      # 0x1b6ba
movl $0x29, %edx
callq 0x3280
jmp 0xf550
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 0xf69c
leaq -0x40(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x1a546
addl $-0x3, %r14d
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf4c1
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x3230
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x12a0c
leaq -0x98(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xf6da
leaq -0x98(%rbp), %rdi
callq 0x12235
movq %rax, %r14
leaq -0x98(%rbp), %rdi
callq 0xf780
movq %r14, %rdi
callq 0x187c8
movq 0x10(%rbx), %rsi
leaq -0x60(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0xf69c
leaq -0x60(%rbp), %rsi
movq %r14, %rdi
callq 0xda84
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf539
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x3230
testq %r14, %r14
je 0xf547
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
leaq -0x40(%rbp), %rdi
callq 0xf780
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 0xf5c8
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x3230
jmp 0xf5c8
jmp 0xf5c2
movq %rdx, %r14
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0xf780
jmp 0xf5c8
jmp 0xf5c2
movq %rdx, %r14
movq %rax, %rbx
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf5d1
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x3230
jmp 0xf5d1
movq %rdx, %r14
movq %rax, %rbx
jmp 0xf5d1
movq %rdx, %r14
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0xf780
cmpl $0x2, %r14d
jne 0xf5fc
movq %rbx, %rdi
callq 0x30e0
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x139eb(%rip), %rdi     # 0x22fd8
callq 0x3280
movq %rax, %rdi
callq 0x3110
jmp 0xf651
cmpl $0x1, %r14d
jne 0xf68b
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 0x139ad(%rip), %rdi     # 0x22fd8
callq 0x3280
movq %rax, %rdi
callq 0x3110
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf651
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3230
callq 0x33a0
movl $0x1, %eax
jmp 0xf552
movq %rax, %rbx
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf67c
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3230
callq 0x33a0
jmp 0xf68b
movq %rax, %rbx
callq 0x33a0
movq %rbx, %rdi
callq 0x33f0
movq %rax, %rdi
callq 0x4a22
nop