// File: /workspace/github_c_makefile_star2_O1/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 0x44a9
testl %eax, %eax
je 0xde50
movq 0x10(%r12), %r12
movq %rsp, %rdx
movq %r12, %rdi
movq %r15, %rsi
movl $0x1, %ecx
callq 0x44a9
testl %eax, %eax
je 0xdd79
cmpq $0x0, 0x8(%rsp)
je 0xdd22
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %esi
leaq 0x53c5(%rip), %rdi      # 0x130d4
movl $0x4, %edx
callq 0x3110
testq %rax, %rax
je 0xddc6
movq 0x10(%r12), %rdi
leaq 0x20(%rsp), %rdx
movq %r15, %rsi
movl $0x1, %ecx
callq 0x44a9
testl %eax, %eax
je 0xdd80
movl %eax, %ebp
movq 0x18(%rsp), %r12
cmpq $0x2, (%r12)
jb 0xdd87
movl 0x10(%r12), %edi
callq 0x36a0
testq %rax, %rax
je 0xddde
movq %rax, %r12
movq 0x8(%rax), %rdi
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rsi
movslq 0x10(%rax), %rdx
callq 0x3180
jmp 0xddf7
xorl %ebp, %ebp
jmp 0xde41
xorl %ebp, %ebp
jmp 0xde32
movl $0x0, 0x28(%r12)
movq 0x18(%r12), %rdi
testq %rdi, %rdi
je 0xdda8
callq 0x3979
movq $0x0, 0x18(%r12)
movq 0x20(%r12), %rdi
testq %rdi, %rdi
je 0xddc0
callq 0x3979
movq $0x0, 0x20(%r12)
incq (%r12)
jmp 0xddf7
leaq 0x530b(%rip), %rcx      # 0x130d8
xorl %ebp, %ebp
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3cc3
jmp 0xde32
movq 0xb38b(%rip), %rcx      # 0x19170
xorl %r12d, %r12d
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3cc3
xorl %ebp, %ebp
testl %ebp, %ebp
je 0xde23
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0xde0d
movq %rax, 0x18(%r12)
incq (%rax)
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0xde1f
movq %rax, 0x20(%r12)
incq (%rax)
movq %r12, 0x8(%rbx)
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xde32
callq 0x3979
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xde41
callq 0x3979
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xde50
callq 0x3979
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq