// File: /workspace/github_c_makefile_star2_O0/martincameron[P]towntalk/towntalk.c
// Function: parse_local_assignment
static struct element* parse_local_assignment( struct element *elem,
	struct function *func, struct variables *vars, struct local_variable *local, struct statement *prev, char *message ) {
	int idx;
	struct statement *stmt;
	struct expression expr;
	struct element *next = elem;
	struct structure *struc = local->type;
	char *field = strchr( next->str.string, '.' );
	if( struc && field ) {
		stmt = calloc( 1, sizeof( struct structure_statement ) );
		if( stmt ) {
			prev->next = stmt;
			expr.next = NULL;
			next = parse_expression( next->next->next, func, vars, &expr, message );
			if( expr.next ) {
				stmt->source = expr.next;
				( ( struct structure_statement * ) stmt )->structure = struc;
				idx = get_string_list_index( struc->fields, &field[ 1 ] );
				if( idx >= 0 ) {
					stmt->local = idx;
					expr.next = calloc( 1, sizeof( struct expression ) );
					if( expr.next ) {
						stmt->source->next = expr.next;
						expr.next->line = next->line;
						expr.next->index = local->index;
						expr.next->evaluate = evaluate_local;
						stmt->execute = execute_struct_assignment;
					} else {
						strcpy( message, OUT_OF_MEMORY );
					}
				} else {
					sprintf( message, "Field '%.64s' not declared on line %d.", elem->str.string, elem->line );
				}
			}
		} else {
			strcpy( message, OUT_OF_MEMORY );
		}
	} else if( field ) {
		sprintf( message, "Variable '%.64s' has no associated structure on line %d.", local->name, elem->line );
	} else {
		stmt = calloc( 1, sizeof( struct statement ) );
		if( stmt ) {
			prev->next = stmt;
			expr.next = NULL;
			next = parse_expression( next->next->next, func, vars, &expr, message );
			if( expr.next ) {
				stmt->source = expr.next;
				stmt->local = local->index;
				stmt->execute = execute_local_assignment;
			}
		} else {
			strcpy( message, OUT_OF_MEMORY );
		}
	}
	return next;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x2e, %esi
callq 0x30d0
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0xf094
cmpq $0x0, -0x78(%rbp)
je 0xf094
movl $0x1, %edi
movl $0x30, %esi
callq 0x3120
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0xf07f
movq -0x40(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
movq $0x0, -0x50(%rbp)
movq -0x68(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %r8
leaq -0x60(%rbp), %rcx
callq 0x60c0
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0xf07d
movq -0x50(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x70(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x70(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x78(%rbp), %rsi
addq $0x1, %rsi
callq 0xafd0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jl 0xf05a
movl -0x34(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, %edi
movl $0x20, %esi
callq 0x3120
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0xf048
movq -0x50(%rbp), %rcx
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x68(%rbp), %rax
movl 0x28(%rax), %ecx
movq -0x50(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movl (%rax), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x50(%rbp), %rax
leaq -0xa473(%rip), %rcx     # 0x4bc0
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rax
leaq 0x3ee(%rip), %rcx       # 0xf430
movq %rcx, 0x10(%rax)
jmp 0xf058
movq -0x30(%rbp), %rdi
movq 0x1210d(%rip), %rsi     # 0x21160
callq 0x3070
jmp 0xf07b
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movl 0x28(%rax), %ecx
leaq 0xcb57(%rip), %rsi      # 0x1bbcb
movb $0x0, %al
callq 0x31f0
jmp 0xf07d
jmp 0xf08f
movq -0x30(%rbp), %rdi
movq 0x120d6(%rip), %rsi     # 0x21160
callq 0x3070
jmp 0xf158
cmpq $0x0, -0x78(%rbp)
je 0xf0c1
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movl 0x28(%rax), %ecx
leaq 0xd1c2(%rip), %rsi      # 0x1c277
movb $0x0, %al
callq 0x31f0
jmp 0xf156
movl $0x1, %edi
movl $0x28, %esi
callq 0x3120
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0xf144
movq -0x40(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
movq $0x0, -0x50(%rbp)
movq -0x68(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %r8
leaq -0x60(%rbp), %rcx
callq 0x60c0
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0xf142
movq -0x50(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movl (%rax), %ecx
movq -0x40(%rbp), %rax
movl %ecx, (%rax)
movq -0x40(%rbp), %rax
leaq -0xa3ae(%rip), %rcx     # 0x4d90
movq %rcx, 0x10(%rax)
jmp 0xf154
movq -0x30(%rbp), %rdi
movq 0x12011(%rip), %rsi     # 0x21160
callq 0x3070
jmp 0xf156
jmp 0xf158
movq -0x68(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)