// File: /workspace/github_c_makefile_star2_O3/martincameron[P]towntalk/towntalk.c
// Function: parse_struct_expression
static struct element* parse_struct_expression( struct element *elem,
	struct function *func, struct variables *vars, struct structure *struc, struct expression *prev, char *message ) {
	int idx, count;
	struct element *next = elem->next;
	char *field = field_end( elem->str.string, "!." );
	struct expression param = { 0 }, *expr = calloc( 1, sizeof( struct value_expression ) );
	if( expr ) {
		prev->next = expr;
		expr->line = elem->line;
		( ( struct value_expression * ) expr )->str = &struc->str;
		if( field[ 0 ] == '!' && !field[ 1 ] ) {
			field++;
		}
		if( field[ 0 ] ) {
			idx = get_string_list_index( struc->fields, &field[ 1 ] );
			if( idx >= 0 ) {
				expr->index = idx;
				( ( struct value_expression * ) expr )->num = idx;
				if( next && next->str.string[ 0 ] == '(' ) {
					parse_expressions( next->child, func, vars, 0, &param, &count, message );
					expr->parameters = param.next;
					if( message[ 0 ] == 0 ) {
						if( count == 1 ) {
							expr->evaluate = evaluate_member_expression;
							next = next->next;
						} else {
							sprintf( message, "Wrong number of arguments to struct expression on line %d.", next->line );
						}
					}
				} else {
					expr->evaluate = evaluate_number_literal_expression;
				}
			} else {
				sprintf( message, "Field '%.64s' not declared on line %d.", elem->str.string, elem->line );
			}
		} else {
			idx = ARRAY + 1;
			expr->index = idx;
			( ( struct value_expression * ) expr )->num = idx;
			struc->str.reference_count++;
			expr->evaluate = evaluate_string_literal_expression;
		}
	} else {
		strcpy( message, OUT_OF_MEMORY );
	}
	return next;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r9, %rbp
movq %r8, %r14
movq %rcx, %r12
movq %rdx, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movq 0x20(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0xc390(%rip), %rsi      # 0x12701
movq %rdi, 0x38(%rsp)
callq 0x8312
movq %rax, %r13
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movl $0x1, %edi
movl $0x30, %esi
callq 0x3130
testq %rax, %rax
je 0x6464
movq %rax, %r15
movq %rbp, 0x20(%rsp)
movq %rax, 0x10(%r14)
movl 0x28(%rbx), %r14d
movl %r14d, (%rax)
movq %r12, 0x20(%rax)
movzbl (%r13), %eax
testl %eax, %eax
je 0x6475
cmpl $0x21, %eax
jne 0x63d7
cmpb $0x0, 0x1(%r13)
je 0x6475
movq 0x20(%r12), %rdi
incq %r13
movq %r13, %rsi
callq 0x8363
testl %eax, %eax
js 0x64a0
movl %eax, 0x4(%r15)
movl %eax, 0x28(%r15)
movq 0x10(%rsp), %r14
testq %r14, %r14
je 0x6493
movq 0x8(%r14), %rax
cmpb $0x28, (%rax)
jne 0x6493
movq 0x18(%r14), %rdi
movq 0x20(%rsp), %r12
movq %r12, (%rsp)
leaq 0x40(%rsp), %rbx
leaq 0x1c(%rsp), %r9
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x8142
movq 0x10(%rbx), %rax
movq %rax, 0x8(%r15)
cmpb $0x0, (%r12)
jne 0x64c0
cmpl $0x1, 0x1c(%rsp)
jne 0x64d2
leaq 0x2352(%rip), %rax      # 0x87ac
movq %rax, 0x18(%r15)
movq 0x20(%r14), %r14
jmp 0x64c0
movq 0x12d05(%rip), %rsi     # 0x19170
movq %rbp, %rdi
callq 0x3070
jmp 0x64bb
movl $0x3, %eax
movl %eax, 0x4(%r15)
movl %eax, 0x28(%r15)
incq (%r12)
leaq -0x29e8(%rip), %rax     # 0x3aa5
movq %rax, 0x18(%r15)
jmp 0x64bb
leaq -0x2a00(%rip), %rax     # 0x3a9a
movq %rax, 0x18(%r15)
jmp 0x64c0
leaq 0xc25d(%rip), %rsi      # 0x12704
movq 0x20(%rsp), %rdi
movq 0x38(%rsp), %rdx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x3200
movq 0x10(%rsp), %r14
movq %r14, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x28(%r14), %edx
leaq 0xc36d(%rip), %rsi      # 0x1284a
movq %r12, %rdi
xorl %eax, %eax
callq 0x3200
jmp 0x64c0