// File: /workspace/github_c_makefile_star2_O0/anuwu[P]ERPLAG-Compiler/erplag.c
// Function: checkCommand
void checkCommand (int argc, char **argv, char **outputFile)
{
	if (argc == 1)
	{
		errFatal () ;
		printf ("No source file\n") ;
		exit (1) ;
	}

	if (argc != 2 && argc != 3)
	{
		errFatal () ;
		printf ("Incorrect number of arguments\n") ;
		exit (1) ;
	}

	int len = strlen (argv[1]) ;
	if (!(len > 4 && argv[1][len-1] == 'p' && argv[1][len-2] == 'r' && argv[1][len-3] == 'e' && argv[1][len-4] == '.'))
	{
		errFatal () ;
		#if defined __linux__ || defined __MACH__
			printf ("Unsupported source format. Use file with " ANSI_BOLD ".erp" ANSI_RESET " extension\n") ;
		#endif
		#ifdef _WIN64
			printf ("Unsupported source format. Use file with .erp extension\n") ;
		#endif
		exit (1) ;
	}

	if (argc == 2)
	{
		*outputFile = (char *) malloc (sizeof(char) * (len + 1)) ;
		strcpy (*outputFile, argv[1]) ;

		(*outputFile)[len - 1] = 'm' ;
		(*outputFile)[len - 2] = 's' ;
		(*outputFile)[len - 3] = 'a' ;
	}
	else if (argc == 3)
	{
		len = strlen (argv[2]) ;
		if (!(len > 4 && argv[2][len-1] == 'm' && argv[2][len-2] == 's' && argv[2][len-3] == 'a' && argv[2][len-4] == '.'))
		{
			errFatal () ;
			#if defined __linux__ || defined __MACH__
				printf ("Unsupported output format. Use " ANSI_BOLD ".asm" ANSI_RESET " extension\n") ;
			#endif
			#ifdef _WIN64
				printf ("Unsupported output format. Use .asm extension\n") ;
			#endif
			exit (1) ;
		}

		*outputFile = argv[2] ;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpl $0x1, -0x4(%rbp)
jne 0x1288
movb $0x0, %al
callq 0x14c80
leaq 0x13d8d(%rip), %rdi     # 0x15004
movb $0x0, %al
callq 0x1090
movl $0x1, %edi
callq 0x1130
cmpl $0x2, -0x4(%rbp)
je 0x12b3
cmpl $0x3, -0x4(%rbp)
je 0x12b3
movb $0x0, %al
callq 0x14c80
leaq 0x13d72(%rip), %rdi     # 0x15014
movb $0x0, %al
callq 0x1090
movl $0x1, %edi
callq 0x1130
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1080
movl %eax, -0x1c(%rbp)
cmpl $0x4, -0x1c(%rbp)
jle 0x1331
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x70, %eax
jne 0x1331
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x72, %eax
jne 0x1331
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
subl $0x3, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x65, %eax
jne 0x1331
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
subl $0x4, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2e, %eax
je 0x1350
movb $0x0, %al
callq 0x14c80
leaq 0x13cf4(%rip), %rdi     # 0x15033
movb $0x0, %al
callq 0x1090
movl $0x1, %edi
callq 0x1130
cmpl $0x2, -0x4(%rbp)
jne 0x13c7
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x0, %rdi
callq 0x10e0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x1040
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb $0x6d, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl -0x1c(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movb $0x73, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl -0x1c(%rbp), %ecx
subl $0x3, %ecx
movslq %ecx, %rcx
movb $0x61, (%rax,%rcx)
jmp 0x147f
cmpl $0x3, -0x4(%rbp)
jne 0x147d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1080
movl %eax, -0x1c(%rbp)
cmpl $0x4, -0x1c(%rbp)
jle 0x144f
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x6d, %eax
jne 0x144f
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x73, %eax
jne 0x144f
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
subl $0x3, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x61, %eax
jne 0x144f
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
subl $0x4, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2e, %eax
je 0x146e
movb $0x0, %al
callq 0x14c80
leaq 0x13c17(%rip), %rdi     # 0x15074
movb $0x0, %al
callq 0x1090
movl $0x1, %edi
callq 0x1130
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x147f
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)