// File: /workspace/github_c_makefile_star2_O1/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
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), %rbx
movq %rbx, -0x40(%rbp)
movq 0x40(%rbx), %rcx
cmpq %rax, (%rcx)
jbe 0x756e
movq %rdi, %rdx
leaq 0xad02(%rip), %rcx      # 0x1225b
xorl %r13d, %r13d
movq %rsi, %rdi
movq %rdx, %rsi
xorl %edx, %edx
callq 0x3cc3
jmp 0x768c
movq %rdx, %r14
movl 0x20(%rbx), %eax
shll $0x4, %eax
movslq %eax, %rdx
movq %rsp, %rdi
subq %rdx, %rdi
movq %rdi, %rsp
movq %rdi, -0x48(%rbp)
movq %rsi, -0x30(%rbp)
movq 0x8(%rsi), %rax
movq %rax, -0x50(%rbp)
xorl %esi, %esi
callq 0x30f0
movslq 0x1c(%rbx), %rbx
testq %rbx, %rbx
jle 0x75d7
shlq $0x4, %rbx
xorl %r15d, %r15d
xorl %r13d, %r13d
movq -0x48(%rbp), %rdx
addq %r13, %rdx
movq %r12, %rdi
movq -0x30(%rbp), %rsi
callq *0x18(%r12)
testl %eax, %eax
je 0x75dd
movq 0x10(%r12), %r12
addq $0x10, %r13
cmpq %r13, %rbx
jne 0x75ad
movl %eax, %r15d
jmp 0x75dd
movl $0x1, %r15d
leaq -0x58(%rbp), %r12
xorl %r13d, %r13d
testl %r15d, %r15d
je 0x765c
movq -0x40(%rbp), %rax
movq 0x58(%rax), %r13
testq %r13, %r13
sete %bl
je 0x7622
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq *0x10(%r13)
cmpl $0x1, %eax
jne 0x761f
movq 0x20(%r13), %r13
testq %r13, %r13
sete %bl
jne 0x75f9
movl $0x1, %r15d
jmp 0x7622
movl %eax, %r15d
testb %bl, %bl
jne 0x7659
cmpl $0x5, %r15d
je 0x75e1
testl %r15d, %r15d
je 0x7659
movl $0x1, %r13d
cmpl $0x2, %r15d
je 0x765c
movq -0x60(%rbp), %rsi
leaq 0xb373(%rip), %rcx      # 0x129bb
movq -0x30(%rbp), %rdi
movl %r15d, %edx
callq 0x3cc3
xorl %r13d, %r13d
jmp 0x765c
movl %r15d, %r13d
movq -0x40(%rbp), %rax
movslq 0x20(%rax), %rbx
testq %rbx, %rbx
jle 0x768c
shlq $0x4, %rbx
xorl %r14d, %r14d
movq -0x48(%rbp), %rax
movq 0x8(%rax,%r14), %rdi
testq %rdi, %rdi
je 0x7683
callq 0x3979
addq $0x10, %r14
cmpq %r14, %rbx
jne 0x7670
movl %r13d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq