// File: /workspace/github_c_makefile_star2_O0/martincameron[P]towntalk/towntalk.c
// Function: parse_global_assignment
static struct element* parse_global_assignment( struct element *elem,
	struct function *func, struct variables *vars, struct global_variable *global, struct statement *prev, char *message ) {
	int idx;
	struct statement *stmt;
	struct expression expr;
	struct element *next = elem;
	struct structure *struc = global->type;
	char *field = field_end( next->str.string, "!." );
	if( field[ 0 ] == '!' && !field[ 1 ] ) {
		field++;
	}
	if( struc && field[ 0 ] ) {
		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 value_expression ) );
					if( expr.next ) {
						stmt->source->next = expr.next;
						expr.next->line = next->line;
						expr.next->evaluate = evaluate_global;
						( ( struct value_expression * ) expr.next )->str = &global->str;
						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[ 0 ] ) {
		sprintf( message, "Variable '%.64s' has no associated structure on line %d.", global->str.string, elem->line );
	} else {
		stmt = calloc( 1, sizeof( struct global_assignment_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 global_assignment_statement * ) stmt )->destination = &global->value;
				stmt->execute = execute_global_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 0x28(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xca12(%rip), %rsi      # 0x1bbc8
callq 0xaf10
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x21, %eax
jne 0xf1e1
movq -0x78(%rbp), %rax
cmpb $0x0, 0x1(%rax)
jne 0xf1e1
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0xf34c
movq -0x78(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xf34c
movl $0x1, %edi
movl $0x30, %esi
callq 0x3120
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0xf337
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 0xf335
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 0xf312
movl -0x34(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, %edi
movl $0x30, %esi
callq 0x3120
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0xf300
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 -0x50(%rbp), %rax
leaq -0xa5af(%rip), %rcx     # 0x4d30
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x40(%rbp), %rax
leaq 0x136(%rip), %rcx       # 0xf430
movq %rcx, 0x10(%rax)
jmp 0xf310
movq -0x30(%rbp), %rdi
movq 0x11e55(%rip), %rsi     # 0x21160
callq 0x3070
jmp 0xf333
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movl 0x28(%rax), %ecx
leaq 0xc89f(%rip), %rsi      # 0x1bbcb
movb $0x0, %al
callq 0x31f0
jmp 0xf335
jmp 0xf347
movq -0x30(%rbp), %rdi
movq 0x11e1e(%rip), %rsi     # 0x21160
callq 0x3070
jmp 0xf416
movq -0x78(%rbp), %rax
cmpb $0x0, (%rax)
je 0xf37b
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movl 0x28(%rax), %ecx
leaq 0xcf08(%rip), %rsi      # 0x1c277
movb $0x0, %al
callq 0x31f0
jmp 0xf414
movl $0x1, %edi
movl $0x30, %esi
callq 0x3120
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0xf402
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 0xf400
movq -0x50(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rcx
addq $0x18, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x40(%rbp), %rax
leaq 0x184(%rip), %rcx       # 0xf580
movq %rcx, 0x10(%rax)
jmp 0xf412
movq -0x30(%rbp), %rdi
movq 0x11d53(%rip), %rsi     # 0x21160
callq 0x3070
jmp 0xf414
jmp 0xf416
movq -0x68(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)