// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/evaluate.c
// Function: evaluate_expression
struct symbol *evaluate_expression(struct expression *expr)
{
	if (!expr)
		return NULL;
	if (expr->ctype)
		return expr->ctype;

	switch (expr->type) {
	case EXPR_VALUE:
	case EXPR_FVALUE:
		expression_error(expr, "value expression without a type");
		return NULL;
	case EXPR_STRING:
		return evaluate_string(expr);
	case EXPR_SYMBOL:
		return evaluate_symbol_expression(expr);
	case EXPR_BINOP:
		evaluate_expression(expr->left);
		evaluate_expression(expr->right);
		if (!valid_subexpr_type(expr))
			return NULL;
		return evaluate_binop(expr);
	case EXPR_LOGICAL:
		return evaluate_logical(expr);
	case EXPR_COMMA:
		evaluate_expression(expr->left);
		if (!evaluate_expression(expr->right))
			return NULL;
		return evaluate_comma(expr);
	case EXPR_COMPARE:
		evaluate_expression(expr->left);
		evaluate_expression(expr->right);
		if (!valid_subexpr_type(expr))
			return NULL;
		return evaluate_compare(expr);
	case EXPR_ASSIGNMENT:
		evaluate_expression(expr->left);
		evaluate_expression(expr->right);
		if (!valid_subexpr_type(expr))
			return NULL;
		return evaluate_assignment(expr);
	case EXPR_PREOP:
		if (!evaluate_expression(expr->unop))
			return NULL;
		return evaluate_preop(expr);
	case EXPR_POSTOP:
		if (!evaluate_expression(expr->unop))
			return NULL;
		return evaluate_postop(expr);
	case EXPR_CAST:
	case EXPR_FORCE_CAST:
	case EXPR_IMPLIED_CAST:
		return evaluate_cast(expr);
	case EXPR_SIZEOF:
		return evaluate_sizeof(expr);
	case EXPR_PTRSIZEOF:
		return evaluate_ptrsizeof(expr);
	case EXPR_ALIGNOF:
		return evaluate_alignof(expr);
	case EXPR_DEREF:
		return evaluate_member_dereference(expr);
	case EXPR_CALL:
		return evaluate_call(expr);
	case EXPR_SELECT:
	case EXPR_CONDITIONAL:
		return evaluate_conditional_expression(expr);
	case EXPR_STATEMENT:
		expr->ctype = evaluate_statement(expr->statement);
		return expr->ctype;

	case EXPR_LABEL:
		expr->ctype = &ptr_ctype;
		check_label_declaration(expr->pos, expr->label_symbol);
		return &ptr_ctype;

	case EXPR_TYPE:
		/* Evaluate the type of the symbol .. */
		evaluate_symbol(expr->symbol);
		/* .. but the type of the _expression_ is a "type" */
		expr->ctype = &type_ctype;
		return &type_ctype;

	case EXPR_OFFSETOF:
		return evaluate_offsetof(expr);

	case EXPR_GENERIC:
		return evaluate_generic_selection(expr);

	/* These can not exist as stand-alone expressions */
	case EXPR_INITIALIZER:
	case EXPR_IDENTIFIER:
	case EXPR_INDEX:
	case EXPR_POS:
		expression_error(expr, "internal front-end error: initializer in expression");
		return NULL;
	case EXPR_SLICE:
		expression_error(expr, "internal front-end error: SLICE re-evaluated");
		return NULL;
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x4bb90
movq $0x0, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x4bbac
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x1e, %eax
ja 0x4beff
movq -0x18(%rbp), %rax
leaq 0x1faa9(%rip), %rcx     # 0x6b678
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
leaq 0x1fe43(%rip), %rsi     # 0x6ba26
movb $0x0, %al
callq 0x17030
movq $0x0, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4c5a0
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4c7f0
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x4bb70
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x4bb70
movq -0x10(%rbp), %rdi
callq 0x4c960
cmpl $0x0, %eax
jne 0x4bc50
movq $0x0, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4c9b0
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4cd60
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x4bb70
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x4bb70
cmpq $0x0, %rax
jne 0x4bca1
movq $0x0, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4ce40
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x4bb70
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x4bb70
movq -0x10(%rbp), %rdi
callq 0x4c960
cmpl $0x0, %eax
jne 0x4bce8
movq $0x0, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4cef0
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x4bb70
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x4bb70
movq -0x10(%rbp), %rdi
callq 0x4c960
cmpl $0x0, %eax
jne 0x4bd2f
movq $0x0, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4d3a0
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x4bb70
cmpq $0x0, %rax
jne 0x4bd61
movq $0x0, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4d480
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x4bb70
cmpq $0x0, %rax
jne 0x4bd93
movq $0x0, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4d6f0
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4d850
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4df20
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4e250
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4e380
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4e400
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4e780
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4eaa0
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x4f0b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rax
leaq 0x46ac1(%rip), %rcx     # 0x92918
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rsi
movq 0x8(%rax), %rdi
callq 0x4f400
leaq 0x46aa1(%rip), %rax     # 0x92918
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x4f490
movq -0x10(%rbp), %rax
leaq 0x45740(%rip), %rcx     # 0x915d8
movq %rcx, 0x10(%rax)
leaq 0x45735(%rip), %rax     # 0x915d8
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4f610
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
callq 0x4fa90
movq %rax, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
leaq 0x1fb74(%rip), %rsi     # 0x6ba46
movb $0x0, %al
callq 0x17030
movq $0x0, -0x8(%rbp)
jmp 0x4bf07
movq -0x10(%rbp), %rdi
leaq 0x1fb8c(%rip), %rsi     # 0x6ba7a
movb $0x0, %al
callq 0x17030
movq $0x0, -0x8(%rbp)
jmp 0x4bf07
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)