// File: /workspace/github_c_makefile_star2_O1/martincameron[P]towntalk/towntalk.c
// Function: parse_variable_declaration
static struct element* parse_variable_declaration( struct element *elem, struct function *func, struct variables *vars, struct statement *prev,
	int (*add)( struct element *elem, struct function *func, struct structure *type, struct expression *initializer, struct statement *prev, char *message ),
	char *message ) {
	struct structure *type = NULL;
	struct expression expr = { 0 }, *array_expr;
	struct element *next;
	while( elem && elem->str.string[ 0 ] != ';' && elem->str.string[ 0 ] != '{' && message[ 0 ] == 0 ) {
		if( prev && prev->next ) {
			prev = prev->next;
		}
		if( elem->str.string[ 0 ] == '(' ) {
			type = ( struct structure * ) find_decl( func, elem->child->str.string, STRUCT, NULL );
			if( type ) {
				elem = elem->next;
			} else {
				sprintf( message, "Structure '%.64s' not declared on line %d.", elem->child->str.string, elem->child->line );
			}
		}
		if( message[ 0 ] == 0 ) {
			if( elem->str.string[ 0 ] == '[' ) {
				parse_expression( elem->child->next, func, vars, &expr, message );
				if( message[ 0 ] == 0 ) {
					array_expr = calloc( 1, sizeof( struct expression ) );
					if( array_expr ) {
						array_expr->line = elem->line;
						array_expr->parameters = expr.next;
						array_expr->evaluate = evaluate_array_expression;
						if( add( elem->child, func, type, array_expr, prev, message ) ) {
							elem = elem->next;
						} else {
							dispose_expressions( array_expr );
						}
					} else {
						strcpy( message, OUT_OF_MEMORY );
					}
				}
			} else if( elem->next->str.string[ 0 ] == '=' ) {
				next = parse_expression( elem->next->next, func, vars, &expr, message );
				if( message[ 0 ] == 0 ) {
					if( add( elem, func, type, expr.next, prev, message ) ) {
						elem = next;
					} else {
						dispose_expressions( expr.next );
					}
				}
			} else {
				if( add( elem, func, type, NULL, prev, message ) ) {
					elem = elem->next;
				}
			}
		}
		if( elem && elem->str.string[ 0 ] == ',' && message[ 0 ] == 0 ) {
			elem = elem->next;
		}
	}
	if( elem && elem->str.string[ 0 ] == ';' && message[ 0 ] == 0 ) {
		elem = elem->next;
	}
	return elem;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, (%rsp)
movq %rdx, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
testq %rdi, %rdi
je 0x9abe
movq %r9, %rbx
movq %rcx, %r13
movq %rsi, %r12
movq %rdi, %r15
xorl %r14d, %r14d
movq 0x8(%r15), %rax
movzbl (%rax), %eax
cmpl $0x3b, %eax
je 0x9ac7
cmpl $0x7b, %eax
je 0x9ad0
cmpb $0x0, (%rbx)
jne 0x9ac3
testq %r13, %r13
je 0x990f
movq 0x20(%r13), %rcx
testq %rcx, %rcx
cmovneq %rcx, %r13
jmp 0x9912
xorl %r13d, %r13d
cmpb $0x28, %al
jne 0x995a
movq 0x18(%r15), %rax
movq 0x8(%rax), %rsi
movq %r12, %rdi
movl $0x3, %edx
xorl %ecx, %ecx
callq 0x6103
testq %rax, %rax
je 0x993b
movq %rax, %r14
movq 0x20(%r15), %r15
jmp 0x995a
movq 0x18(%r15), %rax
movq 0x8(%rax), %rdx
movl 0x28(%rax), %ecx
movq %rbx, %rdi
leaq 0x8f8f(%rip), %rsi      # 0x128df
xorl %eax, %eax
callq 0x3200
xorl %r14d, %r14d
cmpb $0x0, (%rbx)
je 0x998a
movq %r15, %rbp
testq %rbp, %rbp
je 0x9a12
movq 0x8(%rbp), %rax
cmpb $0x2c, (%rax)
jne 0x9a14
cmpb $0x0, (%rbx)
jne 0x9a14
movq 0x20(%rbp), %rbp
jmp 0x9a14
movq 0x8(%r15), %rax
cmpb $0x5b, (%rax)
jne 0x9a25
movq 0x18(%r15), %rax
movq 0x20(%rax), %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %rbx, %r8
callq 0x4f9b
cmpb $0x0, (%rbx)
jne 0x995f
movl $0x1, %edi
movl $0x20, %esi
callq 0x3130
testq %rax, %rax
je 0x9aaa
movq %rax, %rbp
movl 0x28(%r15), %eax
movl %eax, (%rbp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rbp)
leaq 0x15c(%rip), %rax       # 0x9b47
movq %rax, 0x18(%rbp)
movq 0x18(%r15), %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq %r13, %r8
movq %rbx, %r9
callq *(%rsp)
testl %eax, %eax
jne 0x9aa1
movq %rbp, %rdi
jmp 0x9a7b
xorl %ebp, %ebp
movq %rbp, %r15
testq %rbp, %rbp
jne 0x98db
jmp 0x9abe
movq 0x20(%r15), %rax
movq 0x8(%rax), %rcx
cmpb $0x3d, (%rcx)
jne 0x9a85
movq 0x20(%rax), %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %rbx, %r8
callq 0x4f9b
cmpb $0x0, (%rbx)
jne 0x995f
movq %rax, %rbp
movq 0x20(%rsp), %rcx
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r13, %r8
movq %rbx, %r9
callq *(%rsp)
testl %eax, %eax
jne 0x9962
movq 0x20(%rsp), %rdi
callq 0x3b29
jmp 0x995f
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
movq %r13, %r8
movq %rbx, %r9
callq *(%rsp)
testl %eax, %eax
je 0x995f
movq 0x20(%r15), %rbp
jmp 0x9962
movq 0xf6bf(%rip), %rsi      # 0x19170
movq %rbx, %rdi
callq 0x3070
jmp 0x995f
xorl %r15d, %r15d
jmp 0x9ad0
cmpb $0x3b, %al
jne 0x9ad0
cmpb $0x0, (%rbx)
jne 0x9ad0
movq 0x20(%r15), %r15
movq %r15, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq