// File: /workspace/github_c_makefile_star2_O1/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 0x13dc
movl %edi, %r15d
leal -0x4(%r15), %eax
cmpl $-0x3, %eax
jbe 0x13ec
movq %rdx, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq 0x8(%rsi), %r12
movq %r12, %rdi
callq 0x10a0
cmpl $0x5, %eax
jl 0x13bc
leal -0x1(%rax), %ebx
cmpb $0x70, (%r12,%rbx)
jne 0x13bc
movl $0xfffffffc, %ecx       # imm = 0xFFFFFFFC
leal (%rcx,%rax), %r14d
addl $0x2, %r14d
cmpb $0x72, (%r12,%r14)
jne 0x13bc
leal (%rcx,%rax), %r13d
incl %r13d
cmpb $0x65, (%r12,%r13)
jne 0x13bc
addl %eax, %ecx
cmpb $0x2e, (%r12,%rcx)
jne 0x13bc
cmpl $0x3, %r15d
je 0x135d
cmpl $0x2, %r15d
jne 0x13ad
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,%r14)
movb $0x61, (%r15,%r13)
jmp 0x13ad
movq -0x38(%rbp), %rax
movq 0x10(%rax), %r14
movq %r14, %rdi
callq 0x10a0
movl $0xfffffffc, %edx       # imm = 0xFFFFFFFC
cmpl $0x5, %eax
jl 0x13cc
leal (%rdx,%rax), %ecx
addl $0x3, %ecx
cmpb $0x6d, (%r14,%rcx)
jne 0x13cc
leal (%rdx,%rax), %ecx
addl $0x2, %ecx
cmpb $0x73, (%r14,%rcx)
jne 0x13cc
leal (%rdx,%rax), %ecx
incl %ecx
cmpb $0x61, (%r14,%rcx)
jne 0x13cc
addl %edx, %eax
cmpb $0x2e, (%r14,%rax)
jne 0x13cc
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 0xf17f
leaq 0xec85(%rip), %rdi      # 0x1004f
jmp 0x13fa
xorl %eax, %eax
callq 0xf17f
leaq 0xecb5(%rip), %rdi      # 0x1008f
jmp 0x13fa
xorl %eax, %eax
callq 0xf17f
leaq 0xecf9(%rip), %rdi      # 0x100e3
jmp 0x13fa
xorl %eax, %eax
callq 0xf17f
leaq 0xeccb(%rip), %rdi      # 0x100c5
callq 0x1070
movl $0x1, %edi
callq 0x1160