// File: /workspace/github_c_makefile_star2_O0/Encryptr[P]O-plus-plus/opp/opp.c
// Function: opp_init_module
void opp_init_module(const char* fname, struct Opp_Options* opts)
{
	Opp_Stats stats = {0};
	struct Opp_Scan scan = {0};

	opp_init_file(fname, &scan);

	START_CLOCK();
	struct Opp_Parser* parser = opp_parser_init(&scan);
	opp_parser_begin(parser);
	END_CLOCK();
	GET_TIME(S_PARSER);

	START_CLOCK();
	struct Opp_Analize* ctx = opp_init_analize(parser, opts);
	analize_tree(ctx);
	END_CLOCK();
	GET_TIME(S_ANALIZE);

	START_CLOCK();
	struct Opp_Context* context = opp_init_compile(parser, opts);
	opp_compile(context);
	END_CLOCK();
	GET_TIME(S_COMPILER);

	START_CLOCK();
	context->oppir = init_oppir();
	oppir_get_opcodes(context->oppir, &context->ir);
	oppir_eval(context->oppir);
	OppIO io = { .file = fopen("out.o", "wb") };
	oppir_emit_obj(context->oppir, &io);
	END_CLOCK();
	GET_TIME(S_IR);
	fclose(io.file);


	if (opts->run_output) 
		system("gcc ./stdlib/testing.o out.o");

	if (opts->debug)
		opp_debug_info(&stats, context);

	oppir_free(context->oppir);
	opp_free_compiler(context);
	opp_free_analize(ctx);
	opp_free_parser(parser);
	opp_free_lex(&scan, false);
}

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xc0(%rsp)
movq %rsi, 0xb8(%rsp)
leaq 0x88(%rsp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x10f0
leaq 0x38(%rsp), %rdi
xorl %esi, %esi
movl $0x50, %edx
callq 0x10f0
movq 0xc0(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x1310
callq 0x1070
movq %rax, 0x88(%rsp)
leaq 0x38(%rsp), %rdi
callq 0xe420
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
callq 0xebb0
callq 0x1070
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rax
subq 0x88(%rsp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x11a9a(%rip), %xmm1    # 0x13008
divsd %xmm1, %xmm0
movsd %xmm0, 0x98(%rsp)
callq 0x1070
movq %rax, 0x88(%rsp)
movq 0x30(%rsp), %rdi
movq 0xb8(%rsp), %rsi
callq 0x1fc0
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
callq 0x20b0
callq 0x1070
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rax
subq 0x88(%rsp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x11a35(%rip), %xmm1    # 0x13008
divsd %xmm1, %xmm0
movsd %xmm0, 0xa0(%rsp)
callq 0x1070
movq %rax, 0x88(%rsp)
movq 0x30(%rsp), %rdi
movq 0xb8(%rsp), %rsi
callq 0x54d0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
callq 0x5910
callq 0x1070
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rax
subq 0x88(%rsp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x119d0(%rip), %xmm1    # 0x13008
divsd %xmm1, %xmm0
movsd %xmm0, 0xa8(%rsp)
callq 0x1070
movq %rax, 0x88(%rsp)
movb $0x0, %al
callq 0x90e0
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x60(%rax)
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rdi
movq 0x20(%rsp), %rsi
addq $0x48, %rsi
callq 0x9480
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rdi
callq 0x94b0
movq $0x0, 0x8(%rsp)
leaq 0x119c1(%rip), %rdi     # 0x1305b
leaq 0x119a0(%rip), %rsi     # 0x13041
callq 0x11c0
movq %rax, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rdi
leaq 0x8(%rsp), %rsi
callq 0x9720
callq 0x1070
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rax
subq 0x88(%rsp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x11917(%rip), %xmm1    # 0x13008
divsd %xmm1, %xmm0
movsd %xmm0, 0xb0(%rsp)
movq 0x10(%rsp), %rdi
callq 0x1080
movq 0xb8(%rsp), %rax
testb $0x1, 0x1(%rax)
je 0x1722
leaq 0x11927(%rip), %rdi     # 0x13044
callq 0x10b0
movq 0xb8(%rsp), %rax
testb $0x1, 0x5(%rax)
je 0x1742
movq 0x20(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0x1790
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rdi
callq 0x9350
movq 0x20(%rsp), %rdi
callq 0x55e0
movq 0x28(%rsp), %rdi
callq 0x20a0
movq 0x30(%rsp), %rdi
callq 0xe650
leaq 0x38(%rsp), %rdi
xorl %esi, %esi
callq 0x116f0
addq $0xc8, %rsp
retq
nopw %cs:(%rax,%rax)