// File: /workspace/github_c_makefile_star2_O2/martincameron[P]towntalk/towntalk.c
// Function: evaluate_elem_expression
static enum result evaluate_elem_expression( struct expression *this,
	struct variables *vars, struct variable *result ) {
	struct expression *parameter = this->parameters;
	struct variable elem = { 0, NULL }, child = { 0, NULL }, next = { 0, NULL };
	struct element *value;
	enum result ret = evaluate_element( parameter, vars, &elem, 0 );
	if( ret ) {
		parameter = parameter->next;
		ret = evaluate_element( parameter, vars, &child, 1 );
		if( ret ) {
			if( !child.string_value || strchr( "([{", elem.string_value->string[ 0 ] ) ) {
				parameter = parameter->next;
				ret = evaluate_element( parameter, vars, &next, 1 );
				if( ret ) {
					if( elem.string_value->reference_count > 1 ) {
						value = new_element( elem.string_value->length );
						if( value ) {
							memcpy( value->str.string, elem.string_value->string,
								sizeof( char ) * elem.string_value->length );
						} else {
							ret = throw_out_of_memory( vars, this );
						}
					} else { /* Re-use element. */
						value = ( struct element * ) elem.string_value;
						value->line = 0;
						if( value->child ) {
							unref_string( &value->child->str );
							value->child = NULL;
						}
						if( value->next ) {
							unref_string( &value->next->str );
							value->next = NULL;
						}
						value->str.reference_count++;
					}
					if( ret ) {
						if( child.string_value ) {
							value->child = ( struct element * ) child.string_value;
							child.string_value->reference_count++;
						}
						if( next.string_value ) {
							value->next = ( struct element * ) next.string_value;
							next.string_value->reference_count++;
						}
						result->string_value = &value->str;
					}
					dispose_temporary( &next );
				}
			} else {
				ret = throw( vars, this, 0, "Parent elements must have value '()', '[]' or '{}'." );
			}
			dispose_temporary( &child );
		}
		dispose_temporary( &elem );
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x8(%rdi), %r12
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, (%rsp)
movaps %xmm0, 0x20(%rsp)
xorl %ebp, %ebp
movq %r12, %rdi
xorl %ecx, %ecx
callq 0x42ce
testl %eax, %eax
je 0xcf21
movq 0x10(%r12), %r12
movq %rsp, %rdx
pushq $0x1
popq %rcx
movq %r12, %rdi
movq %r15, %rsi
callq 0x42ce
testl %eax, %eax
je 0xce86
cmpq $0x0, 0x8(%rsp)
je 0xce31
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %esi
leaq 0x52f2(%rip), %rdi      # 0x12112
pushq $0x4
popq %rdx
callq 0x3110
testq %rax, %rax
je 0xcef9
movq 0x10(%r12), %rdi
leaq 0x20(%rsp), %rdx
pushq $0x1
popq %rcx
movq %r15, %rsi
callq 0x42ce
testl %eax, %eax
je 0xce8d
movl %eax, %ebp
movq 0x18(%rsp), %r12
cmpq $0x2, (%r12)
jb 0xce91
movl 0x10(%r12), %edi
callq 0x3638
testq %rax, %rax
je 0xcf30
movq %rax, %r12
movq 0x8(%rax), %rdi
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rsi
movslq 0x10(%rax), %rdx
callq 0x3180
jmp 0xcec5
xorl %ebp, %ebp
jmp 0xcf17
xorl %ebp, %ebp
jmp 0xcf0f
andl $0x0, 0x28(%r12)
movq 0x18(%r12), %rdi
testq %rdi, %rdi
je 0xceac
callq 0x38b2
andq $0x0, 0x18(%r12)
movq 0x20(%r12), %rdi
testq %rdi, %rdi
je 0xcec1
callq 0x38b2
andq $0x0, 0x20(%r12)
incq (%r12)
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0xced7
movq %rax, 0x18(%r12)
incq (%rax)
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0xcee9
movq %rax, 0x20(%r12)
incq (%rax)
movq %r12, 0x8(%rbx)
leaq 0x20(%rsp), %rdi
callq 0x3988
jmp 0xcf0f
leaq 0x5216(%rip), %rcx      # 0x12116
xorl %ebp, %ebp
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3bb2
movq %rsp, %rdi
callq 0x3988
leaq 0x10(%rsp), %rdi
callq 0x3988
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %r14, %rsi
callq 0x4c90
xorl %ebp, %ebp
jmp 0xceed