// File: /workspace/github_c_makefile_star2_O2/lucvoo[P]sparse-dev/evaluate.c
// Function: evaluate_arguments
int evaluate_arguments(struct symbol_list *argtypes, struct expression_list *head)
{
	struct expression *expr;
	struct symbol *argtype;
	int i = 1;

	PREPARE_PTR_LIST(argtypes, argtype);
	FOR_EACH_PTR (head, expr) {
		struct expression **p = THIS_ADDRESS(expr);
		struct symbol *ctype, *target;
		ctype = evaluate_expression(expr);

		if (!ctype)
			return 0;

		target = argtype;
		if (!target) {
			struct symbol *type;
			int class = classify_type(ctype, &type);
			if (is_int(class)) {
				*p = cast_to(expr, integer_promotion(type));
			} else if (class & TYPE_FLOAT) {
				if (type->rank < 0)
					*p = cast_to(expr, &double_ctype);
			} else if (class & TYPE_PTR) {
				if (expr->ctype == &null_ctype)
					*p = cast_to(expr, &ptr_ctype);
				else
					degenerate(expr);
			}
		} else if (!target->forced_arg){
			static char where[30];
			examine_symbol_type(target);
			sprintf(where, "argument %d", i);
			compatible_argument_type(expr, target, p, where);
		}

		i++;
		NEXT_PTR_LIST(argtype);
	} END_FOR_EACH_PTR(expr);
	FINISH_PTR_LIST(argtype);
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbp
pushq $0x1
popq %rax
testq %rdi, %rdi
je 0x2ce60
movq %rbp, %r15
cmpb $0x0, (%r15)
jg 0x2ce6a
movq 0x10(%r15), %r15
cmpq %rbp, %r15
jne 0x2ce4d
xorl %ebx, %ebx
jmp 0x2ce65
xorl %ebx, %ebx
xorl %r15d, %r15d
xorl %r12d, %r12d
jmp 0x2ce74
movq 0x18(%r15), %r12
andq $-0x4, %r12
movl %eax, %ebx
testq %rsi, %rsi
je 0x2d0de
pushq $0x1
popq %rax
movq %rsi, %rdx
movl %eax, 0x14(%rsp)
movq %rsi, 0x48(%rsp)
movq %rbp, 0x30(%rsp)
leaq 0x18(%rdx), %rax
movq %rax, 0x40(%rsp)
xorl %r14d, %r14d
movq %rdx, 0x8(%rsp)
movl (%rdx), %eax
movsbq %al, %rcx
cmpq %rcx, %r14
jge 0x2d0c5
movq 0x40(%rsp), %rcx
movq (%rcx,%r14,8), %r13
cmpw $0x100, %ax             # imm = 0x100
setb %al
testq %r13, %r13
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x2d03b
movq %r13, %rdi
callq 0x2d0ed
testq %rax, %rax
je 0x2d0dc
movq 0x40(%rsp), %rcx
movq %r14, 0x28(%rsp)
leaq (%rcx,%r14,8), %rcx
movq %rcx, 0x18(%rsp)
testq %r12, %r12
je 0x2cfe6
movq %r12, %r14
testb $0x2, 0x56(%r12)
jne 0x2cfc3
movq %r14, %rdi
callq 0x267cd
leaq 0x5d033(%rip), %rdi     # 0x89f50
leaq 0x16026(%rip), %rsi     # 0x42f4a
movl 0x14(%rsp), %edx
xorl %eax, %eax
callq 0xe2d0
movq %r14, %rdi
leaq 0x20(%rsp), %rsi
callq 0x2f4dd
movq 0x20(%rsp), %rax
cmpb $0x8, (%rax)
jne 0x2cfac
testb $0x40, 0x56(%rax)
je 0x2cfac
movq 0x98(%rax), %rax
movq %rax, 0x38(%rsp)
testq %rax, %rax
je 0x2cfac
movq 0x38(%rsp), %r14
xorl %ebp, %ebp
movl (%r14), %eax
movsbq %al, %rcx
cmpq %rcx, %rbp
jge 0x2cf9c
movq 0x18(%r14,%rbp,8), %rdi
cmpw $0x100, %ax             # imm = 0x100
jb 0x2cf80
testq %rdi, %rdi
je 0x2cf97
movq 0x18(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x30d43
testl %eax, %eax
jne 0x2d09a
incq %rbp
jmp 0x2cf64
movq 0x10(%r14), %r14
cmpq 0x38(%rsp), %r14
movq 0x30(%rsp), %rbp
jne 0x2cf62
movq %r13, %rdi
movq %r12, %rsi
movq 0x18(%rsp), %rdx
leaq 0x5cf92(%rip), %rcx     # 0x89f50
callq 0x30c8b
incl 0x14(%rsp)
movq 0x8(%rsp), %rdx
movq 0x28(%rsp), %r14
movsbl (%r15), %eax
cmpl %eax, %ebx
jl 0x2d02d
movq 0x10(%r15), %r15
xorl %ebx, %ebx
cmpq %rbp, %r15
jne 0x2cfd1
jmp 0x2d028
movq %rax, %rdi
leaq 0x20(%rsp), %rsi
callq 0x2f4dd
movl %eax, %ecx
andl $0x9, %ecx
cmpl $0x1, %ecx
jne 0x2d043
movq 0x20(%rsp), %rdi
callq 0x2f685
movq %r13, %rdi
movq %rax, %rsi
callq 0x2f54c
movq 0x18(%rsp), %rcx
movq %rax, (%rcx)
movq 0x8(%rsp), %rdx
movq 0x28(%rsp), %r14
incl 0x14(%rsp)
xorl %r12d, %r12d
jmp 0x2d03b
movslq %ebx, %rax
movq 0x18(%r15,%rax,8), %r12
andq $-0x4, %r12
incl %ebx
incq %r14
jmp 0x2cea2
testb $0x8, %al
movq 0x28(%rsp), %r14
jne 0x2d06c
testb $0x10, %al
movq 0x8(%rsp), %rdx
je 0x2d024
leaq 0x3993c(%rip), %rax     # 0x66998
cmpq %rax, 0x10(%r13)
je 0x2d0a4
movq %r13, %rdi
callq 0x2f6c0
jmp 0x2d0bb
movq 0x20(%rsp), %rax
testb $0x2, 0x57(%rax)
movq 0x8(%rsp), %rdx
je 0x2d024
movq %r13, %rdi
leaq 0x39212(%rip), %rsi     # 0x66298
callq 0x2f54c
movq 0x8(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %rax, (%rcx)
jmp 0x2d024
movq 0x30(%rsp), %rbp
jmp 0x2cfc3
movq %r13, %rdi
leaq 0x3948a(%rip), %rsi     # 0x66538
callq 0x2f54c
movq 0x18(%rsp), %rcx
movq %rax, (%rcx)
movq 0x8(%rsp), %rdx
jmp 0x2d024
movq 0x10(%rdx), %rdx
movq 0x48(%rsp), %rsi
cmpq %rsi, %rdx
jne 0x2ce91
pushq $0x1
popq %rax
jmp 0x2d0de
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq