// File: /workspace/github_c_makefile_star2_O0/martincameron[P]towntalk/towntalk.c
// Function: evaluate_thiscall_expression
static enum result evaluate_thiscall_expression( struct expression *this,
	struct variables *vars, struct variable *result ) {
	int idx, count;
	struct array *arr;
	struct variable obj = { 0 };
	struct string *function = NULL;
	struct function_expression call_expr = { 0 };
	struct value_expression obj_expr = { 0 };
	struct structure *struc = ( struct structure * ) ( ( struct value_expression * ) this )->str;
	enum result ret = this->parameters->evaluate( this->parameters, vars, &obj );
	if( ret ) {
		ret = is_instance( &obj, struc, vars, this );
		if( ret ) {
			arr = ( struct array * ) obj.string_value;
			idx = this->index >> 8;
			count = this->index & 0xFF;
			if( arr->string_values ) {
				function = arr->string_values[ idx ];
			}
			if( function && function->type == FUNCTION ) {
				obj_expr.str = obj.string_value;
				obj_expr.expr.evaluate = evaluate_string_literal_expression;
				obj_expr.expr.next = this->parameters->next;
				call_expr.expr.line = this->line;
				call_expr.function = ( struct function * ) function;
				call_expr.expr.parameters = &obj_expr.expr;
				if( call_expr.function->num_parameters == count ) {
					function->reference_count++;
					ret = evaluate_call_expression( &call_expr.expr, vars, result );
					function->reference_count--;
				} else {
					ret = throw( vars, this, count, "Incorrect number of parameters to function." );
				}
			} else {
				ret = throw( vars, this, arr->number_values[ idx ], "Not a function reference." );
			}
		}
		dispose_temporary( &obj );
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x30f0
movq $0x0, -0x40(%rbp)
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x30f0
leaq -0x98(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x30f0
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x10(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq *%rax
movl %eax, -0xa4(%rbp)
cmpl $0x0, -0xa4(%rbp)
je 0xb242
movq -0xa0(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rcx
leaq -0x38(%rbp), %rdi
callq 0x4f10
movl %eax, -0xa4(%rbp)
cmpl $0x0, -0xa4(%rbp)
je 0xb239
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
sarl $0x8, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
andl $0xff, %eax
movl %eax, -0x20(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0xb150
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0xb20e
movq -0x40(%rbp), %rax
movsbl 0x14(%rax), %eax
cmpl $0x6, %eax
jne 0xb20e
movq -0x30(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x73cb(%rip), %rax     # 0x3db0
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x68(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x98(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movl 0x1c(%rax), %eax
cmpl -0x20(%rbp), %eax
jne 0xb1ef
movq -0x40(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
leaq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x9810
movl %eax, -0xa4(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
jmp 0xb20c
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl -0x20(%rbp), %edx
leaq 0x10981(%rip), %rcx     # 0x1bb82
callq 0x4330
movl %eax, -0xa4(%rbp)
jmp 0xb237
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x10982(%rip), %rcx     # 0x1bbae
callq 0x4330
movl %eax, -0xa4(%rbp)
jmp 0xb239
leaq -0x38(%rbp), %rdi
callq 0x3ce0
movl -0xa4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)