// File: /workspace/github_c_makefile_star2_O2/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 -0x38(%rbp), %rax
movq %rdi, (%rax)
movq 0x8(%rdi), %r12
movq %rsi, -0x60(%rbp)
movl (%rdi), %ecx
movl %ecx, -0x40(%rbp)
movq 0x20(%rdi), %r15
movq %r15, -0x48(%rbp)
movq 0x40(%r15), %rcx
cmpq %rax, (%rcx)
jbe 0x6f2c
movq %rdi, %rsi
leaq 0xa396(%rip), %rcx      # 0x112a3
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3bb2
movl %r15d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x20(%r15), %eax
shll $0x4, %eax
movslq %eax, %rdx
movq %rsp, %r13
subq %rdx, %r13
movq %r13, %rsp
movq %r13, -0x50(%rbp)
movq 0x8(%rbx), %rax
movq %rax, -0x58(%rbp)
xorl %r14d, %r14d
movq %r13, %rdi
xorl %esi, %esi
callq 0x30f0
movl 0x1c(%r15), %eax
testl %eax, %eax
cmovgl %eax, %r14d
pushq $0x1
popq %r15
subq $0x1, %r14
jb 0x6f8f
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq *0x18(%r12)
testl %eax, %eax
je 0x6f8c
movl %eax, %r15d
movq 0x10(%r12), %r12
addq $0x10, %r13
jmp 0x6f66
xorl %r15d, %r15d
leaq 0xa19a(%rip), %r14      # 0x11130
xorl %r12d, %r12d
testl %r15d, %r15d
je 0x6ff8
movq -0x48(%rbp), %r13
addq $0x58, %r13
movq (%r13), %r13
testq %r13, %r13
je 0x6ffb
movq %r13, %rdi
leaq -0x60(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq *0x10(%r13)
movl %eax, %r15d
cmpl $0x5, %eax
ja 0x6fe2
movl %r15d, %eax
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
addq $0x20, %r13
pushq $0x1
popq %r15
jmp 0x6fa6
pushq $0x1
popq %r15
jmp 0x6ffb
movq -0x38(%rbp), %rsi
leaq 0xaa0d(%rip), %rcx      # 0x119fa
movq %rbx, %rdi
movl %r15d, %edx
callq 0x3bb2
xorl %r15d, %r15d
movq -0x48(%rbp), %rax
movl 0x20(%rax), %ebx
testl %ebx, %ebx
cmovlel %r12d, %ebx
shlq $0x4, %rbx
cmpq %r12, %rbx
je 0x6f1a
movq -0x50(%rbp), %rdi
addq %r12, %rdi
callq 0x3988
addq $0x10, %r12
jmp 0x700c