// File: /workspace/github_c_makefile_star2_O0/System-Glitch[P]ESGILinter-C/src/parsing_functions.c
// Function: check_function_call_parameters
void check_function_call_parameters(scope_t *scope, function_t *call, function_t *function, int line_index, messages_t *messages) {
	field_t *field            = NULL;
	field_t *param            = NULL;
	invalid_call_t *error     = NULL;
	type_t type;

	if(function != NULL && call->params->size != function->params->size && messages->invalid_calls != NULL) {
		error = malloc(sizeof(invalid_call_t));
		error->name = strduplicate(function->name);
		error->more = call->params->size - function->params->size;
		arraylist_add(messages->invalid_calls, error);
	}

	for(size_t i = 0 ; i < call->params->size ; i++) {

		field = arraylist_get(call->params, i);

		type = parse_expression(field->name, line_index, scope, messages);
		if(!strcmp(type.name, "NULL")) {
			type = parse_operation(field->name, line_index, scope, messages);
		}

		if(function != NULL && i < function->params->size) {
			param = arraylist_get(function->params, i);
			if(strcmp(type.name, "NULL") && !type_equals(&type, &(param->type))) {
				arraylist_add(messages->invalid_params, field_init(strduplicate(field->name), strduplicate(field->type.name), field->type.is_pointer, field->line));
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xff58
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x20(%rcx), %rcx
cmpq 0x8(%rcx), %rax
je 0xff58
movq -0x28(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xff58
movl $0x10, %edi
callq 0x2110
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0xa550
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x20(%rcx), %rcx
subq 0x8(%rcx), %rax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0x8730
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jae 0x100cb
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x58(%rbp), %rsi
callq 0x8890
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl -0x1c(%rbp), %esi
movq -0x8(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x10120
movq %rax, -0x68(%rbp)
movq %rdx, -0x60(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rdi
leaq 0x48db(%rip), %rsi      # 0x148a0
callq 0x20f0
cmpl $0x0, %eax
jne 0xfffe
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl -0x1c(%rbp), %esi
movq -0x8(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x8fe0
movq %rax, -0x78(%rbp)
movq %rdx, -0x70(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x100b8
movq -0x58(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x20(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jae 0x100b8
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x58(%rbp), %rsi
callq 0x8890
movq %rax, -0x38(%rbp)
movq -0x50(%rbp), %rdi
leaq 0x4861(%rip), %rsi      # 0x148a0
callq 0x20f0
cmpl $0x0, %eax
je 0x100b6
movq -0x38(%rbp), %rsi
addq $0x10, %rsi
leaq -0x50(%rbp), %rdi
callq 0x8080
cmpb $0x0, %al
jne 0x100b6
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0xa550
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xa550
movq -0x88(%rbp), %rdi
movq %rax, %rsi
movq -0x30(%rbp), %rax
movb 0x18(%rax), %al
movq -0x30(%rbp), %rcx
movl 0x20(%rcx), %ecx
movsbl %al, %edx
callq 0x7600
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x8730
jmp 0x100b8
jmp 0x100ba
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0xff60
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)