// File: /workspace/github_cpp_makefile_star2_O3/CobaltXII[P]cxcc/./semantic/semantic_analyzer.hpp
// Function: semantic_analyzer_t::validate_function(function_t&, symbol_table_t&)
bool validate_function(function_t& function, symbol_table_t& global_symbols) {
		symbol_table_t symbols(&global_symbols);
		// Load the function parameters as symbols.
		for (int i = 0; i < function.parameters.size(); i++) {
			symbols.add_symbol(symbol_t(
				function.parameters[i].type,
				function.parameters[i].identifier
			));
		}
		// Add the function return value as a special symbol with the
		// identifier __return__.
		symbols.add_symbol(symbol_t(function.type, "__return__"));
		// Iterate through each statement in the function body.
		bool had_return_stmt = false;
		for (int i = 0; i < function.body.size(); i++) {
			statement_t* statement = function.body[i];
			if (!validate_statement(statement, symbols)) {
				return false;
			}
			if (statement->type == st_return) {
				had_return_stmt = true;
			}
		}
		// The function is invalid if it has no return statement.
		if (!had_return_stmt) {
			die("function '" + function.identifier + "' has no return statement", function);
			return false;
		}
		return true;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rsi, %r15
movq %rdi, 0x48(%rsp)
leaq 0x100(%rsp), %rcx
xorps %xmm0, %xmm0
movups %xmm0, (%rcx)
movq $0x0, 0x10(%rcx)
movq %rdx, -0x8(%rcx)
movb 0x20(%rdx), %al
movb %al, 0x18(%rcx)
movups 0x28(%rdx), %xmm0
movups %xmm0, 0x20(%rcx)
movq 0x38(%rdx), %rax
movq %rax, 0x30(%rcx)
movq 0x28(%rsi), %rax
cmpq %rax, 0x30(%rsi)
je 0x10237
movl $0x10, %r12d
xorl %r14d, %r14d
leaq 0x28(%rsp), %r13
leaq 0x188(%rsp), %rbp
movq -0x10(%rax,%r12), %rbx
leaq 0x38(%rsp), %rcx
movq %rcx, 0x28(%rsp)
movq -0x8(%rax,%r12), %rsi
movq (%rax,%r12), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x179ce
movq %rbp, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x11210
leaq 0x100(%rsp), %rdi
movq %rbp, %rsi
callq 0x105f4
leaq 0x1b0(%rsp), %rdi
callq 0x9730
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x101ee
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1020a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
incq %r14
movq 0x28(%r15), %rax
movq 0x30(%r15), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rdx, %rcx
addq $0x28, %r12
cmpq %r14, %rcx
ja 0x1017b
movq (%r15), %r12
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x97d5(%rip), %rsi      # 0x19a1f
leaq 0x97d8(%rip), %rdx      # 0x19a29
leaq 0x50(%rsp), %rdi
callq 0x8faa
leaq 0x138(%rsp), %rdi
leaq 0x50(%rsp), %rdx
movq %r12, %rsi
callq 0x11210
leaq 0x138(%rsp), %rsi
leaq 0x100(%rsp), %rdi
callq 0x105f4
leaq 0x160(%rsp), %rbx
movq %rbx, %rdi
callq 0x9730
movq -0x20(%rbx), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
movq 0x48(%rsp), %rbp
je 0x102bb
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x102d2
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x40(%r15), %rax
cmpq %rax, 0x48(%r15)
je 0x10330
xorl %r14d, %r14d
leaq 0xf8(%rsp), %r12
xorl %r13d, %r13d
movq (%rax,%r14,8), %rbx
movq %rbp, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x11280
testb %al, %al
je 0x10483
cmpl $0x3, (%rbx)
sete %al
orb %al, %r13b
incq %r14
movq 0x40(%r15), %rax
movq 0x48(%r15), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
ja 0x102ea
movb $0x1, %bl
testb $0x1, %r13b
jne 0x10485
leaq 0x8(%r15), %rdx
leaq 0x96a8(%rip), %rsi      # 0x199e3
leaq 0x70(%rsp), %rdi
callq 0xa256
leaq 0x96de(%rip), %rsi      # 0x19a2a
leaq 0x70(%rsp), %rdi
callq 0x33f0
leaq 0x18(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1037d
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x10383
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%r15), %rax
leaq 0x98(%rsp), %rdi
movq %rax, -0x8(%rdi)
leaq 0xa8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%r15), %rsi
movq 0x10(%r15), %rdx
addq %rsi, %rdx
callq 0x179ce
leaq 0x28(%r15), %rsi
leaq 0xb8(%rsp), %r12
movq %r12, %rdi
callq 0x10074
leaq 0x40(%r15), %rsi
leaq 0xd0(%rsp), %rdi
callq 0xb076
movups 0x58(%r15), %xmm0
leaq 0x90(%rsp), %rdx
movups %xmm0, 0x58(%rdx)
leaq 0x8(%rsp), %rsi
movq %rbp, %rdi
callq 0xffe6
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x10426
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq %r12, %rdi
callq 0x9730
movq 0x98(%rsp), %rdi
cmpq %r14, %rdi
je 0x1044b
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10462
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10483
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3280
xorl %ebx, %ebx
leaq 0x100(%rsp), %rdi
callq 0x1553e
movl %ebx, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
leaq 0x90(%rsp), %rdi
callq 0x978e
jmp 0x104ea
movq %rax, %r15
movq %r12, %rdi
callq 0x9730
jmp 0x104c8
movq %rax, %r15
movq 0x98(%rsp), %rdi
cmpq %r14, %rdi
je 0x104ea
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x104ea
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10506
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x10506
movq %rax, %r15
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10583
movq 0x80(%rsp), %rsi
jmp 0x1057b
jmp 0x1054d
movq %rax, %r15
leaq 0x138(%rsp), %rdi
callq 0xfecc
jmp 0x10538
movq %rax, %r15
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x10583
movq 0x60(%rsp), %rsi
jmp 0x1057b
jmp 0x1054d
jmp 0x1054d
movq %rax, %r15
jmp 0x10583
movq %rax, %r15
jmp 0x10567
movq %rax, %r15
leaq 0x188(%rsp), %rdi
callq 0xfecc
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x10583
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0x100(%rsp), %rdi
callq 0x1553e
movq %r15, %rdi
callq 0x33b0