// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %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 $0x0, -0x38(%rbp)
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x30f0
xorl %eax, %eax
cmpq $0x0, -0x8(%rbp)
movb %al, -0x69(%rbp)
je 0xcdde
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x3b, %ecx
movb %al, -0x69(%rbp)
je 0xcdde
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x7b, %ecx
movb %al, -0x69(%rbp)
je 0xcdde
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x69(%rbp)
movb -0x69(%rbp), %al
testb $0x1, %al
jne 0xcdea
jmp 0xd04e
cmpq $0x0, -0x20(%rbp)
je 0xce08
movq -0x20(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0xce08
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
jne 0xce7a
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rsi
movl $0x3, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x7b80
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0xce4f
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0xce78
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x28(%rax), %ecx
leaq 0xef3a(%rip), %rsi      # 0x1bdab
movb $0x0, %al
callq 0x31f0
jmp 0xce7a
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xd01a
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x5b, %eax
jne 0xcf68
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %r8
leaq -0x58(%rbp), %rcx
callq 0x60c0
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xcf63
movl $0x1, %edi
movl $0x20, %esi
callq 0x3120
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0xcf51
movq -0x8(%rbp), %rax
movl 0x28(%rax), %ecx
movq -0x60(%rbp), %rax
movl %ecx, (%rax)
movq -0x48(%rbp), %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x60(%rbp), %rax
leaq 0x223(%rip), %rcx       # 0xd130
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x30(%rbp), %r9
callq *%rax
cmpl $0x0, %eax
je 0xcf46
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0xcf4f
movq -0x60(%rbp), %rdi
callq 0x3e60
jmp 0xcf61
movq -0x30(%rbp), %rdi
movq 0x14204(%rip), %rsi     # 0x21160
callq 0x3070
jmp 0xcf63
jmp 0xd018
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x3d, %eax
jne 0xcfe7
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %r8
leaq -0x58(%rbp), %rcx
callq 0x60c0
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xcfe5
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x30(%rbp), %r9
callq *%rax
cmpl $0x0, %eax
je 0xcfda
movq -0x68(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xcfe3
movq -0x48(%rbp), %rdi
callq 0x3e60
jmp 0xcfe5
jmp 0xd016
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x20(%rbp), %r8
movq -0x30(%rbp), %r9
xorl %ecx, %ecx
callq *%rax
cmpl $0x0, %eax
je 0xd014
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0xd016
jmp 0xd018
jmp 0xd01a
cmpq $0x0, -0x8(%rbp)
je 0xd049
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
jne 0xd049
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xd049
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0xcd98
cmpq $0x0, -0x8(%rbp)
je 0xd07d
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
jne 0xd07d
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xd07d
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)