// File: /workspace/github_c_makefile_star2_O3/martincameron[P]towntalk/towntalk.c
// Function: evaluate_call_expression
static enum result evaluate_call_expression( struct expression *this,
	struct variables *vars, struct variable *result ) {
	int idx, count;
	enum result ret = OKAY;
	struct statement *stmt;
	struct variables call_vars;
	struct expression *parameter = this->parameters;
	call_vars.parent = vars;
	call_vars.line = this->line;
	call_vars.func = ( ( struct function_expression * ) this )->function;
	count = sizeof( struct variable ) * call_vars.func->num_variables;
	if( ( size_t ) &this < call_vars.func->env->stack_limit ) {
		return throw( vars, this, 0, "Stack overflow." );
	}
	call_vars.locals = alloca( count );
	call_vars.exception = vars->exception;
	memset( call_vars.locals, 0, count );
	idx = 0, count = call_vars.func->num_parameters;
	while( idx < count ) {
		ret = parameter->evaluate( parameter, vars, &call_vars.locals[ idx++ ] );
		if( ret ) {
			parameter = parameter->next;
		} else {
			break;
		}
	}
	while( ret ) {
		stmt = call_vars.func->statements;
		while( stmt && ( ret = stmt->execute( stmt, &call_vars, result ) ) == OKAY ) {
			stmt = stmt->next;
		}
		if( stmt ) {
			if( ret == RETURN ) {
				ret = OKAY;
			} else if( ret == AGAIN ) {
				continue;
			} else if( ret ) {
				ret = throw( vars, this, ret, "Unhandled 'break' or 'continue'." );
			}
		}
		break;
	}
	idx = 0, count = call_vars.func->num_variables;
	while( idx < count ) {
		dispose_temporary( &call_vars.locals[ idx++ ] );
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, -0x30(%rbp)
movq %rsi, %rbx
leaq -0x60(%rbp), %rax
movq %rdi, (%rax)
movq 0x8(%rdi), %r12
movq %rsi, -0x58(%rbp)
movl (%rdi), %ecx
movl %ecx, -0x38(%rbp)
movq 0x20(%rdi), %r14
movq %r14, -0x40(%rbp)
movq 0x40(%r14), %rcx
cmpq %rax, (%rcx)
jbe 0x7433
movq %rdi, %rsi
leaq 0xae42(%rip), %rcx      # 0x12263
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3c96
jmp 0x753a
movl 0x20(%r14), %eax
shll $0x4, %eax
movslq %eax, %rdx
movq %rsp, %r13
subq %rdx, %r13
movq %r13, %rsp
movq %r13, -0x48(%rbp)
movq 0x8(%rbx), %rax
movq %rax, -0x50(%rbp)
movq %r13, %rdi
xorl %esi, %esi
callq 0x30f0
movslq 0x1c(%r14), %r14
testq %r14, %r14
jle 0x748e
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq *0x18(%r12)
testl %eax, %eax
je 0x7507
movq 0x10(%r12), %r12
addq $0x10, %r13
decq %r14
jne 0x7465
movl %eax, %r15d
jmp 0x7494
movl $0x1, %r15d
movq -0x40(%rbp), %rax
movq 0x58(%rax), %r12
testq %r12, %r12
movq -0x30(%rbp), %r14
je 0x750a
leaq 0xac84(%rip), %r13      # 0x12130
movq %r12, %rdi
leaq -0x58(%rbp), %rsi
movq %r14, %rdx
callq *0x10(%r12)
movl %eax, %r15d
cmpl $0x5, %eax
ja 0x74f1
movl %r15d, %eax
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movq 0x20(%r12), %r12
testq %r12, %r12
jne 0x74ac
jmp 0x750a
movq -0x40(%rbp), %rax
movq 0x58(%rax), %r12
testq %r12, %r12
jne 0x74ac
movl $0x5, %r15d
jmp 0x750a
movq -0x60(%rbp), %rsi
leaq 0xb4be(%rip), %rcx      # 0x129ba
movq %rbx, %rdi
movl %r15d, %edx
callq 0x3c96
xorl %r15d, %r15d
movq -0x40(%rbp), %rax
movslq 0x20(%rax), %rbx
testq %rbx, %rbx
jle 0x753a
shlq $0x4, %rbx
xorl %r14d, %r14d
movq -0x48(%rbp), %rax
movq 0x8(%rax,%r14), %rdi
testq %rdi, %rdi
je 0x7531
callq 0x394d
addq $0x10, %r14
cmpq %r14, %rbx
jne 0x751e
movl %r15d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %r15d
jmp 0x750a