// File: /workspace/github_c_makefile_star2_O1/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 0xc298(%rip), %rsi      # 0x126fc
movq %rdi, 0x38(%rsp)
callq 0x84da
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 0x6559
movq %rax, %r15
movq %rbp, 0x20(%rsp)
movq %rax, 0x10(%r14)
movl 0x28(%rbx), %r14d
movl %r14d, (%rax)
movq %r12, 0x20(%rax)
cmpb $0x21, (%r13)
jne 0x64c1
leaq 0x1(%r13), %rax
cmpb $0x0, 0x1(%r13)
cmoveq %rax, %r13
cmpb $0x0, (%r13)
je 0x656a
movq 0x20(%r12), %rdi
incq %r13
movq %r13, %rsi
callq 0x852b
testl %eax, %eax
js 0x6595
movl %eax, 0x4(%r15)
movl %eax, 0x28(%r15)
movq 0x10(%rsp), %r14
testq %r14, %r14
je 0x6588
movq 0x8(%r14), %rax
cmpb $0x28, (%rax)
jne 0x6588
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 0x8314
movq 0x10(%rbx), %rax
movq %rax, 0x8(%r15)
cmpb $0x0, (%r12)
jne 0x65b5
cmpl $0x1, 0x1c(%rsp)
jne 0x65c7
leaq 0x2426(%rip), %rax      # 0x8975
movq %rax, 0x18(%r15)
movq 0x20(%r14), %r14
jmp 0x65b5
movq 0x12c10(%rip), %rsi     # 0x19170
movq %rbp, %rdi
callq 0x3070
jmp 0x65b0
movl $0x3, %eax
movl %eax, 0x4(%r15)
movl %eax, 0x28(%r15)
incq (%r12)
leaq -0x2aad(%rip), %rax     # 0x3ad5
movq %rax, 0x18(%r15)
jmp 0x65b0
leaq -0x2ac5(%rip), %rax     # 0x3aca
movq %rax, 0x18(%r15)
jmp 0x65b5
leaq 0xc163(%rip), %rsi      # 0x126ff
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 0xc279(%rip), %rsi      # 0x1284b
movq %r12, %rdi
xorl %eax, %eax
callq 0x3200
jmp 0x65b5