// File: /workspace/github_c_makefile_star2_O3/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
pushq %rax
movl %r9d, (%rsp)
cmpl %ecx, %esi
cmovll %esi, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jle 0x33cbb
movq %r8, %r12
movq %rdx, %r13
movq %rdi, %r14
movl %esi, 0x4(%rsp)
movl %ecx, %ebx
xorl %ebp, %ebp
leaq 0x75303(%rip), %r15     # 0xa8d3c
movq (%r14,%rbp,8), %rdi
movl $0x25, %esi
callq 0x3b290
testl %eax, %eax
jne 0x33b97
movq (%r13,%rbp,8), %rdi
leaq 0xa12c5(%rip), %rsi     # 0xd4d20
movl $0x11, %edx
callq 0x3b355
incl %eax
cmpl $0x11, %eax
ja 0x33b97
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq (%r13,%rbp,8), %rdi
leaq 0xa132b(%rip), %rsi     # 0xd4db0
movl $0x3, %edx
callq 0x3b355
cmpl $0x2, %eax
je 0x33bbb
cmpl $0x1, %eax
je 0x33ba8
testl %eax, %eax
jne 0x33b97
movq (%r14,%rbp,8), %rdi
cmpb $0x6f, (%rdi)
jne 0x33ac2
cmpb $0x6e, 0x1(%rdi)
jne 0x33ac2
cmpb $0x0, 0x2(%rdi)
je 0x33b97
leaq 0x770da(%rip), %rsi     # 0xaaba3
callq 0x4260
testl %eax, %eax
je 0x33b97
jmp 0x33bd2
movq (%r14,%rbp,8), %rdi
xorl %esi, %esi
movq %r12, %rdx
movl (%rsp), %ecx
callq 0x33910
testl %eax, %eax
jne 0x33b97
movq (%r14,%rbp,8), %rdi
movl $0x1, %esi
movq %r12, %rdx
movl (%rsp), %ecx
callq 0x33910
testl %eax, %eax
jne 0x33b97
movq (%r14,%rbp,8), %rdi
movl $0x5, %esi
jmp 0x33b88
movq (%r14,%rbp,8), %rdi
movq %r12, %rsi
movl (%rsp), %edx
callq 0x3395d
jmp 0x33b41
movq (%r14,%rbp,8), %rdi
leaq 0xa11a9(%rip), %rsi     # 0xd4ce0
movl $0x8, %edx
callq 0x3b355
cmpl $-0x1, %eax
jne 0x33b97
jmp 0x33bd2
movq (%r14,%rbp,8), %rdi
movl $0x4, %esi
jmp 0x33b88
movq (%r14,%rbp,8), %rdi
movl $0x1, %esi
jmp 0x33b88
movq (%r14,%rbp,8), %rdi
movl $0x2, %esi
jmp 0x33b88
movq (%r14,%rbp,8), %rdi
callq 0x3a938
jmp 0x33b93
movq (%r14,%rbp,8), %rdi
callq 0x3a8ed
jmp 0x33b93
movq (%r14,%rbp,8), %rdi
xorl %esi, %esi
movq %r12, %rdx
movl (%rsp), %ecx
callq 0x33910
testl %eax, %eax
je 0x33bd2
incq %rbp
cmpq %rbp, %rbx
jne 0x33a39
jmp 0x33cb6
movq (%r14,%rbp,8), %rax
movzbl (%rax), %ecx
cmpl $0x2d, %ecx
je 0x33bcc
cmpl $0x2b, %ecx
je 0x33bcc
jmp 0x33bd2
movq (%r14,%rbp,8), %rax
movzbl (%rax), %ecx
cmpl $0x79, %ecx
je 0x33bcc
cmpl $0x78, %ecx
jne 0x33bd2
cmpb $0x0, 0x1(%rax)
je 0x33b97
movl %ebp, %eax
jmp 0x33cbb
movl 0x4(%rsp), %eax
cmpl %eax, %ebp
jge 0x33cb6
movl %eax, %ebx
movq (%r14,%rbp,8), %rdi
callq 0x3a8ed
testl %eax, %eax
jne 0x33c06
movq (%r14,%rbp,8), %rdi
movl $0x25, %esi
callq 0x3b290
testl %eax, %eax
je 0x33bd2
incq %rbp
cmpq %rbp, %rbx
jne 0x33be7
jmp 0x33cb6
movl 0x4(%rsp), %eax
cmpl %eax, %ebp
jge 0x33cb6
movl %eax, %ebx
movq (%r14,%rbp,8), %rdi
callq 0x3a938
testl %eax, %eax
jne 0x33c40
movq (%r14,%rbp,8), %rdi
movl $0x25, %esi
callq 0x3b290
testl %eax, %eax
je 0x33bd2
incq %rbp
cmpq %rbp, %rbx
jne 0x33c21
jmp 0x33cb6
movl 0x4(%rsp), %eax
cmpl %eax, %ebp
jge 0x33cb6
movl %eax, %ebx
movq (%r14,%rbp,8), %rdi
callq 0x3a8ed
testl %eax, %eax
jne 0x33c77
movq (%r14,%rbp,8), %rdi
movl $0x25, %esi
callq 0x3b290
testl %eax, %eax
je 0x33bd2
incq %rbp
cmpq %rbp, %rbx
jne 0x33c54
jmp 0x33cb6
movl 0x4(%rsp), %eax
cmpl %eax, %ebp
jge 0x33cb6
movl %eax, %ebx
movq (%r14,%rbp,8), %rdi
callq 0x3a938
testl %eax, %eax
jne 0x33cae
movq (%r14,%rbp,8), %rdi
movl $0x25, %esi
callq 0x3b290
testl %eax, %eax
je 0x33bd2
incq %rbp
cmpq %rbp, %rbx
jne 0x33c8b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq