// File: /workspace/github_c_makefile_star2_O0/martincameron[P]towntalk/towntalk.c
// Function: parse_struct_assignment
static struct element* parse_struct_assignment( struct element *elem,
	struct function *func, struct variables *vars, struct statement *prev, char *message ) {
	char *field;
	int idx, count;
	struct expression expr;
	struct structure *struc;
	struct element *next = elem;
	struct statement *stmt = calloc( 1, sizeof( struct structure_statement ) );
	if( stmt ) {
		prev->next = stmt;
		struc = ( struct structure * ) find_decl( func, next->str.string, STRUCT, "!." );
		field = field_end( next->str.string, "!." );
		if( struc && field[ 0 ] ) {
			( ( struct structure_statement * ) stmt )->structure = struc;
			idx = get_string_list_index( struc->fields, &field[ 1 ] );
			if( idx >= 0 ) {
				stmt->local = idx;
				next = next->next;
				expr.next = NULL;
				parse_expressions( next->child, func, vars, 0, &expr, &count, message );
				stmt->source = expr.next;
				if( message[ 0 ] == 0 ) {
					if( count == 1 ) {
						expr.next = NULL;
						next = parse_expression( next->next->next, func, vars, &expr, message );
						if( expr.next ) {
							expr.next->next = stmt->source;
							stmt->source = expr.next;
							stmt->execute = execute_struct_assignment;
						}
					} else {
						sprintf( message, "Invalid structure assignment on line %d.", next->line );
					}
				}
			} else {
				sprintf( message, "Field '%.64s' not declared on line %d.", next->str.string, next->line );
			}
		} else {
			sprintf( message, "Undeclared structure or field '%.64s' on line %d.", next->str.string, next->line );
		}
	} 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 -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movl $0x1, %edi
movl $0x30, %esi
callq 0x3120
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0xeebd
movq -0x70(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0x3, %edx
leaq 0xce9f(%rip), %rcx      # 0x1bbc8
callq 0x7b80
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xce87(%rip), %rsi      # 0x1bbc8
callq 0xaf10
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0xee9a
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xee9a
movq -0x60(%rbp), %rcx
movq -0x70(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x30(%rbp), %rsi
addq $0x1, %rsi
callq 0xafd0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jl 0xee77
movl -0x34(%rbp), %ecx
movq -0x70(%rbp), %rax
movl %ecx, (%rax)
movq -0x68(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x68(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %rax
xorl %ecx, %ecx
leaq -0x58(%rbp), %r8
leaq -0x38(%rbp), %r9
movq %rax, (%rsp)
callq 0xac40
movq -0x48(%rbp), %rcx
movq -0x70(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xee75
cmpl $0x1, -0x38(%rbp)
jne 0xee5a
movq $0x0, -0x48(%rbp)
movq -0x68(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %r8
leaq -0x58(%rbp), %rcx
callq 0x60c0
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0xee58
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rcx
movq -0x70(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x70(%rbp), %rax
leaq 0x5dc(%rip), %rcx       # 0xf430
movq %rcx, 0x10(%rax)
jmp 0xee73
movq -0x28(%rbp), %rdi
movq -0x68(%rbp), %rax
movl 0x28(%rax), %edx
leaq 0xd3b0(%rip), %rsi      # 0x1c21c
movb $0x0, %al
callq 0x31f0
jmp 0xee75
jmp 0xee98
movq -0x28(%rbp), %rdi
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x68(%rbp), %rax
movl 0x28(%rax), %ecx
leaq 0xcd3a(%rip), %rsi      # 0x1bbcb
movb $0x0, %al
callq 0x31f0
jmp 0xeebb
movq -0x28(%rbp), %rdi
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x68(%rbp), %rax
movl 0x28(%rax), %ecx
leaq 0xd391(%rip), %rsi      # 0x1c245
movb $0x0, %al
callq 0x31f0
jmp 0xeecd
movq -0x28(%rbp), %rdi
movq 0x12298(%rip), %rsi     # 0x21160
callq 0x3070
movq -0x68(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)