// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/lang.c
// Function: check_parameters
int check_parameters(char *params[MAXPARAMS], int paramcount, char* grammar[MAXPARAMS], int grammarcount, variableptr variables, int variablecount)
{
 /*!Last Changed 21.12.2006 added check_parameter_type and matrix type*/
	/*!Last Changed 07.05.2005*/
	/*!Last Changed 12.10.2004*/
	int i = 0, res, j, k, res2;
	while (i < paramcount && i < grammarcount)
	 {
		 if (char_count(params[i], '%') == 0)
			 {
	  	 res = listindex(grammar[i], possibleparametertypes, 17);
		  	switch (res)
					{
					 case -1:res2 = listindex(grammar[i], doublevalues, 3);
							       switch (res2)
														 {
														  case 0:if (strcmp(params[i], "on") != 0 && strcmp(params[i], "off") != 0)
														 									 return i;
														 								break;
														 	case 1:if (strcmp(params[i], "+") != 0 && strcmp(params[i], "-") != 0)
														 									 return i;
														 		      break;
														 	case 2:if (strcmp(params[i], "x") != 0 && strcmp(params[i], "y") != 0)
														 									 return i;
														 		      break;
														 }
							       break;
				  case  1:if (!isfloat(params[i]))
															 return i;
							       break;
			   case  2:if (!isinteger(params[i]))
															 return i;
														break;
		 	  case  4:for (j = i; j < paramcount; j++)
															 if (!isinteger(params[j]) && char_count(params[j], '%') == 0)
																	 return j;
														return -1;
							       break;
		 			case  5:for (j = i; j < paramcount; j++)
															 if (!isfloat(params[j]) && char_count(params[j], '%') == 0)
																	 return j;
														return -1;
														break;
		 			case  7:for (j = i; j < paramcount; j++)
															 if (!isinteger(params[j]) && char_count(params[j], '%') == 0)
																	 return j;
														return -1;
														break;
		 	  case  8:for (j = i; j < paramcount; j++)
															 if (!isfloat(params[j]) && char_count(params[j], '%') == 0)
																	 return j;
														return -1;
														break;
		 			case  9:if (!check_parameter_type(params[i], STRING_TYPE, variables, variablecount)) 
                return i;
														break;
		 	  case 10:if (!check_parameter_type(params[i], REAL_TYPE, variables, variablecount)) 
                return i;
              break;
		 			case 11:if (!check_parameter_type(params[i], INTEGER_TYPE, variables, variablecount)) 
                return i;
              break;
		 	  case 12:if (!check_parameter_type(params[i], FILE_TYPE, variables, variablecount)) 
                return i;
              break;
		 			case 13:if (listindex(params[i], operandtype, 8) == -1)
															 return i;
														break;
						case 14:if (!check_parameter_type(params[i], INTEGER_TYPE, variables, variablecount) && !check_parameter_type(params[i], REAL_TYPE, variables, variablecount) && !check_parameter_type(params[i], MATRIX_TYPE, variables, variablecount)) 
                return i;
              break;
						case 15:k = return_variable_index(params[i], variables, variablecount);
							       if (k == -1)
															 return i;
														break;
      case 16:if (!check_parameter_type(params[i], MATRIX_TYPE, variables, variablecount)) 
                return i;
              break;
		 	 }
			 }
			i++;
	 }
	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, 0x8(%rsp)
cmpl %ecx, %esi
cmovll %esi, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jle 0x332fa
movq %r8, %r12
movq %rdx, %r13
movq %rdi, %r14
movl %esi, 0xc(%rsp)
movl %ecx, %ebx
xorl %ebp, %ebp
leaq 0x72c67(%rip), %r15     # 0xa5cb4
movq (%r14,%rbp,8), %rdi
movl $0x25, %esi
callq 0x3a200
testl %eax, %eax
jne 0x331ab
movq (%r13,%rbp,8), %rdi
leaq 0x9ecb1(%rip), %rsi     # 0xd1d20
movl $0x11, %edx
callq 0x3a2c5
incl %eax
cmpl $0x11, %eax
ja 0x331ab
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq (%r13,%rbp,8), %rdi
leaq 0x9ed17(%rip), %rsi     # 0xd1db0
movl $0x3, %edx
callq 0x3a2c5
cmpl $0x2, %eax
je 0x331e3
cmpl $0x1, %eax
je 0x331bc
testl %eax, %eax
jne 0x331ab
movq (%r14,%rbp,8), %rdi
movq %rdi, 0x10(%rsp)
leaq 0x75b8b(%rip), %rsi     # 0xa8c58
callq 0x4260
testl %eax, %eax
je 0x331ab
movq 0x10(%rsp), %rdi
leaq 0x74a0d(%rip), %rsi     # 0xa7af3
jmp 0x33208
movq (%r14,%rbp,8), %rdi
xorl %esi, %esi
movq %r12, %rdx
movl 0x8(%rsp), %ecx
callq 0x32f2a
testl %eax, %eax
jne 0x331ab
movq (%r14,%rbp,8), %rdi
movl $0x1, %esi
movq %r12, %rdx
movl 0x8(%rsp), %ecx
callq 0x32f2a
testl %eax, %eax
jne 0x331ab
movq (%r14,%rbp,8), %rdi
movl $0x5, %esi
jmp 0x3319b
movq (%r14,%rbp,8), %rdi
movq %r12, %rsi
movl 0x8(%rsp), %edx
callq 0x32f77
jmp 0x33154
movq (%r14,%rbp,8), %rdi
leaq 0x9eb96(%rip), %rsi     # 0xd1ce0
movl $0x8, %edx
callq 0x3a2c5
cmpl $-0x1, %eax
jne 0x331ab
jmp 0x33211
movq (%r14,%rbp,8), %rdi
movl $0x4, %esi
jmp 0x3319b
movq (%r14,%rbp,8), %rdi
movl $0x1, %esi
jmp 0x3319b
movq (%r14,%rbp,8), %rdi
movl $0x2, %esi
jmp 0x3319b
movq (%r14,%rbp,8), %rdi
callq 0x3992c
jmp 0x331a7
movq (%r14,%rbp,8), %rdi
callq 0x398e1
jmp 0x331a7
movq (%r14,%rbp,8), %rdi
xorl %esi, %esi
movq %r12, %rdx
movl 0x8(%rsp), %ecx
callq 0x32f2a
testl %eax, %eax
je 0x33211
incq %rbp
cmpq %rbp, %rbx
jne 0x3304d
jmp 0x332f5
movq (%r14,%rbp,8), %rdi
movq %rdi, 0x10(%rsp)
leaq 0x72fcb(%rip), %rsi     # 0xa6197
callq 0x4260
testl %eax, %eax
je 0x331ab
movq 0x10(%rsp), %rdi
leaq 0x72dd1(%rip), %rsi     # 0xa5fb2
jmp 0x33208
movq (%r14,%rbp,8), %rdi
movq %rdi, 0x10(%rsp)
leaq 0x6fca1(%rip), %rsi     # 0xa2e94
callq 0x4260
testl %eax, %eax
je 0x331ab
movq 0x10(%rsp), %rdi
leaq 0x6f7c1(%rip), %rsi     # 0xa29c9
callq 0x4260
testl %eax, %eax
je 0x331ab
movl %ebp, %eax
jmp 0x332fa
movl 0xc(%rsp), %eax
cmpl %eax, %ebp
jge 0x332f5
movl %eax, %ebx
movq (%r14,%rbp,8), %rdi
callq 0x3992c
testl %eax, %eax
jne 0x33245
movq (%r14,%rbp,8), %rdi
movl $0x25, %esi
callq 0x3a200
testl %eax, %eax
je 0x33211
incq %rbp
cmpq %rbp, %rbx
jne 0x33226
jmp 0x332f5
movl 0xc(%rsp), %eax
cmpl %eax, %ebp
jge 0x332f5
movl %eax, %ebx
movq (%r14,%rbp,8), %rdi
callq 0x398e1
testl %eax, %eax
jne 0x3327f
movq (%r14,%rbp,8), %rdi
movl $0x25, %esi
callq 0x3a200
testl %eax, %eax
je 0x33211
incq %rbp
cmpq %rbp, %rbx
jne 0x33260
jmp 0x332f5
movl 0xc(%rsp), %eax
cmpl %eax, %ebp
jge 0x332f5
movl %eax, %ebx
movq (%r14,%rbp,8), %rdi
callq 0x398e1
testl %eax, %eax
jne 0x332b6
movq (%r14,%rbp,8), %rdi
movl $0x25, %esi
callq 0x3a200
testl %eax, %eax
je 0x33211
incq %rbp
cmpq %rbp, %rbx
jne 0x33293
jmp 0x332f5
movl 0xc(%rsp), %eax
cmpl %eax, %ebp
jge 0x332f5
movl %eax, %ebx
movq (%r14,%rbp,8), %rdi
callq 0x3992c
testl %eax, %eax
jne 0x332ed
movq (%r14,%rbp,8), %rdi
movl $0x25, %esi
callq 0x3a200
testl %eax, %eax
je 0x33211
incq %rbp
cmpq %rbp, %rbx
jne 0x332ca
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq