// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0x1, %edi
je 0x13d2
movl %edi, %r15d
movq %rdx, -0x30(%rbp)
leal -0x4(%r15), %eax
cmpl $-0x3, %eax
jbe 0x13e2
movq %rsi, -0x38(%rbp)
movq 0x8(%rsi), %r12
movq %r12, %rdi
callq 0x10a0
cmpl $0x5, %eax
jl 0x13b2
leal -0x1(%rax), %ebx
cmpb $0x70, (%r12,%rbx)
jne 0x13b2
movl $0xfffffffc, %ecx       # imm = 0xFFFFFFFC
leal (%rcx,%rax), %r13d
addl $0x2, %r13d
cmpb $0x72, (%r12,%r13)
jne 0x13b2
leal (%rcx,%rax), %r14d
incl %r14d
cmpb $0x65, (%r12,%r14)
jne 0x13b2
addl %eax, %ecx
cmpb $0x2e, (%r12,%rcx)
jne 0x13b2
cmpl $0x2, %r15d
jne 0x1353
incl %eax
movq %rax, %rdi
callq 0x1120
movq %rax, %r15
movq -0x30(%rbp), %rax
movq %r15, (%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x1050
movb $0x6d, (%r15,%rbx)
movb $0x73, (%r15,%r13)
movb $0x61, (%r15,%r14)
jmp 0x13a3
movq -0x38(%rbp), %rax
movq 0x10(%rax), %r14
movq %r14, %rdi
callq 0x10a0
movl $0xfffffffc, %edx       # imm = 0xFFFFFFFC
cmpl $0x5, %eax
jl 0x13c2
leal (%rdx,%rax), %ecx
addl $0x3, %ecx
cmpb $0x6d, (%r14,%rcx)
jne 0x13c2
leal (%rdx,%rax), %ecx
addl $0x2, %ecx
cmpb $0x73, (%r14,%rcx)
jne 0x13c2
leal (%rdx,%rax), %ecx
incl %ecx
cmpb $0x61, (%r14,%rcx)
jne 0x13c2
addl %edx, %eax
cmpb $0x2e, (%r14,%rax)
jne 0x13c2
movq -0x30(%rbp), %rax
movq %r14, (%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
callq 0xe903
leaq 0xdc8f(%rip), %rdi      # 0xf04f
jmp 0x13f0
xorl %eax, %eax
callq 0xe903
leaq 0xdcbf(%rip), %rdi      # 0xf08f
jmp 0x13f0
xorl %eax, %eax
callq 0xe903
leaq 0xdd03(%rip), %rdi      # 0xf0e3
jmp 0x13f0
xorl %eax, %eax
callq 0xe903
leaq 0xdcd5(%rip), %rdi      # 0xf0c5
callq 0x1070
movl $0x1, %edi
callq 0x1160