// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq 0x8(%rdi), %r13
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, (%rsp)
movaps %xmm0, 0x20(%rsp)
xorl %ebx, %ebx
movq %r13, %rdi
xorl %ecx, %ecx
callq 0x4478
testl %eax, %eax
je 0xdaef
movq 0x10(%r13), %rbx
movq %rsp, %rdx
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %ecx
callq 0x4478
testl %eax, %eax
je 0xda43
cmpq $0x0, 0x8(%rsp)
je 0xd9ee
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %esi
leaq 0x56f7(%rip), %rdi      # 0x130d2
movl $0x4, %edx
callq 0x3110
testq %rax, %rax
je 0xdabb
movq 0x10(%rbx), %rdi
leaq 0x20(%rsp), %rdx
movq %r12, %rsi
movl $0x1, %ecx
callq 0x4478
testl %eax, %eax
je 0xda4a
movl %eax, %ebx
movq 0x18(%rsp), %r13
cmpq $0x2, (%r13)
jb 0xda51
movl 0x10(%r13), %edi
callq 0x3690
testq %rax, %rax
je 0xdaff
movq %rax, %r13
movq 0x8(%rax), %rdi
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rsi
movslq 0x10(%rax), %rdx
callq 0x3180
jmp 0xda89
xorl %ebx, %ebx
jmp 0xdae0
xorl %ebx, %ebx
jmp 0xdad1
movl $0x0, 0x28(%r13)
movq 0x18(%r13), %rdi
testq %rdi, %rdi
je 0xda6f
callq 0x394d
movq $0x0, 0x18(%r13)
movq 0x20(%r13), %rdi
testq %rdi, %rdi
je 0xda85
callq 0x394d
movq $0x0, 0x20(%r13)
incq (%r13)
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0xda9a
movq %rax, 0x18(%r13)
incq (%rax)
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xdaab
movq %rdi, 0x20(%r13)
incq (%rdi)
movq %r13, 0x8(%r14)
testq %rdi, %rdi
je 0xdad1
callq 0x394d
jmp 0xdad1
leaq 0x5614(%rip), %rcx      # 0x130d6
xorl %ebx, %ebx
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x3c96
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xdae0
callq 0x394d
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xdaef
callq 0x394d
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0xb66a(%rip), %rcx      # 0x19170
xorl %ebx, %ebx
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x3c96
movq 0x28(%rsp), %rdi
jmp 0xdaaf