// File: /workspace/github_c_makefile_star2_O0/anuwu[P]ERPLAG-Compiler/erplag.c
// Function: main
int main(int argc, char **argv)
{
	FILE *fpIn ;
	char *outputFile ;
	checkCommand (argc, argv, &outputFile) ;
 
 	if (!(fpIn = fopen (argv[1], "r")))
 	{
 		errFatal () ;
		#if defined __linux__ || defined __MACH__
 			printf ("Source file " ANSI_BOLD "%s" ANSI_RESET " does not exist\n", argv[1]) ;
		#endif
		#ifdef _WIN64
			printf ("Source file %s does not exist\n", argv[1]) ;
		#endif
 		exit (1) ;
 	}


	treeNode *root = parse (fpIn) ;
	if (root->syntax_error)
		exit (1) ;

	astNode *astRoot ;
	astRoot = applyASTRule (root) ;
	deletePT (root) ;
	
	realBase = fillSymbolTable (astRoot,0);

	if (!realBase->semanticError)
	{
		if (realPresent)
		{
			errCodegen () ;
			#if defined __linux__ || defined __MACH__
				printf ("Variables or static values of type " ANSI_BOLD ANSI_GREEN "real" ANSI_RESET " found in source file, which is not handled by the present version of the compiler.\n") ;
			#endif
			#ifdef _WIN64
				printf ("Variables or static values of type \"real\" found in source file, which is not handled by the present version of the compiler.\n") ;
			#endif
			exit (1) ;
		}

		int len ;
		if (!(fpOut = fopen (outputFile, "w")))
		{
			errFatal () ;
			#if defined __linux__ || defined __MACH__
				printf ("Error creating asm file " ANSI_BOLD "%s" ANSI_RESET "\n", outputFile) ;
			#endif
			#ifdef _WIN64
				printf ("Error creating asm file %s\n", outputFile) ;
			#endif
			exit (1) ;
		}

		preamble () ;
		codeGeneration (astRoot) ;
		postamble () ;
	}
	else
		exit (1) ;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x1250
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x16028(%rip), %rsi     # 0x174ed
callq 0x10f0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x14fb
movb $0x0, %al
callq 0x14c80
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x13bc1(%rip), %rdi     # 0x150ab
movb $0x0, %al
callq 0x1090
movl $0x1, %edi
callq 0x1130
movq -0x18(%rbp), %rdi
callq 0xfcd0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, 0x24(%rax)
je 0x151c
movl $0x1, %edi
callq 0x1130
movq -0x28(%rbp), %rdi
callq 0x6ef0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x10270
movq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x137b0
movq %rax, %rcx
leaq 0x35ac1(%rip), %rax     # 0x37008
movq %rcx, (%rax)
leaq 0x35ab7(%rip), %rax     # 0x37008
movq (%rax), %rax
cmpl $0x0, 0xd8(%rax)
jne 0x15e5
leaq 0x35a9c(%rip), %rax     # 0x37004
cmpl $0x0, (%rax)
je 0x158c
movb $0x0, %al
callq 0x14d50
leaq 0x13b57(%rip), %rdi     # 0x150d2
movb $0x0, %al
callq 0x1090
movl $0x1, %edi
callq 0x1130
movq -0x20(%rbp), %rdi
leaq 0x16095(%rip), %rsi     # 0x1762c
callq 0x10f0
movq %rax, 0x1bd85(%rip)     # 0x1d328
cmpq $0x0, %rax
jne 0x15cc
movb $0x0, %al
callq 0x14c80
movq -0x20(%rbp), %rsi
leaq 0x13ba0(%rip), %rdi     # 0x1515b
movb $0x0, %al
callq 0x1090
movl $0x1, %edi
callq 0x1130
movb $0x0, %al
callq 0x4b60
movq -0x30(%rbp), %rdi
callq 0x49b0
movb $0x0, %al
callq 0x5050
jmp 0x15ef
movl $0x1, %edi
callq 0x1130
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)