// File: /workspace/github_c_makefile_star2_O0/martincameron[P]towntalk/towntalk.c
// Function: parse_struct_declaration
static struct element* parse_struct_declaration( struct element *elem,
	struct function *func, struct variables *vars, struct statement *prev, char *message ) {
	struct string_list *field, *tail;
	struct environment *env = func->env;
	struct element *child, *next = elem->next;
	int qlen = qualify_name( func, next->str.string, next->str.length, NULL );
	struct structure *struc = calloc( 1, sizeof( struct structure ) + sizeof( char ) * ( qlen + 1 ) );
	if( struc ) {
		struc->str.reference_count = 1;
		struc->str.string = ( char * ) &struc[ 1 ];
		qualify_name( func, next->str.string, next->str.length, struc->str.string );
		struc->str.length = qlen;
		struc->str.type = STRUCT;
		tail = add_decl( &struc->str, next->line, env, message );
		if( tail ) {
			next = next->next;
			if( next && next->str.string[ 0 ] == '(' ) {
				child = next->child;
				if( child && child->next == NULL ) {
					struc->super = ( struct structure * ) find_decl( func, child->str.string, STRUCT, NULL );
				}
				if( struc->super && struc->super != struc ) {
					field = struc->super->fields;
					while( field && message[ 0 ] == 0 ) {
						if( append_string_list( &struc->fields, &struc->fields_tail, field->str ) ) {
							struc->length++;
						} else {
							strcpy( message, OUT_OF_MEMORY );
						}
						field = field->next;
					}
					next = next->next;
				} else {
					sprintf( message, "Invalid parent structure on line %d.", next->line );
				}
			}
		}
		if( message[ 0 ] == 0 ) {
			if( next && next->str.string[ 0 ] == '{' ) {
				child = next->child;
				while( child && message[ 0 ] == 0 ) {
					if( add_structure_field( struc, child, message ) ) {
						child = child->next;
						if( child && ( child->str.string[ 0 ] == ',' || child->str.string[ 0 ] == ';' ) ) {
							child = child->next;
						}
					}
				}
				next = next->next;
				if( next && next->str.string[ 0 ] == ';' ) {
					next = next->next;
				}
			} else {
				sprintf( message, "Expected '{' after 'struct' on line %d.", elem->line );
			}
		}
		unref_string( &struc->str );
	} else {
		strcpy( message, OUT_OF_MEMORY );
	}
	return next;
}

// 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 -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x50(%rbp), %rax
movl 0x10(%rax), %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0xa730
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x0, %rsi
addq $0x38, %rsi
movl $0x1, %edi
callq 0x3120
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0xcb3f
movq -0x60(%rbp), %rax
movq $0x1, (%rax)
movq -0x60(%rbp), %rcx
addq $0x38, %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x50(%rbp), %rax
movl 0x10(%rax), %edx
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rcx
callq 0xa730
movl -0x54(%rbp), %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x60(%rbp), %rax
movb $0x3, 0x14(%rax)
movq -0x60(%rbp), %rdi
movq -0x50(%rbp), %rax
movl 0x28(%rax), %esi
movq -0x40(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x4720
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0xca2f
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0xca2d
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
jne 0xca2d
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0xc95f
movq -0x48(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0xc95f
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0x3, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x7b80
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x60(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0xca12
movq -0x60(%rbp), %rax
movq 0x30(%rax), %rax
cmpq -0x60(%rbp), %rax
je 0xca12
movq -0x60(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x30(%rbp)
movb %al, -0x61(%rbp)
je 0xc9ac
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0xc9b5
jmp 0xca04
movq -0x60(%rbp), %rdi
addq $0x20, %rdi
movq -0x60(%rbp), %rsi
addq $0x28, %rsi
movq -0x30(%rbp), %rax
movq (%rax), %rdx
callq 0xa7f0
cmpq $0x0, %rax
je 0xc9e6
movq -0x60(%rbp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
jmp 0xc9f6
movq -0x28(%rbp), %rdi
movq 0x1476f(%rip), %rsi     # 0x21160
callq 0x3070
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0xc990
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0xca2b
movq -0x28(%rbp), %rdi
movq -0x50(%rbp), %rax
movl 0x28(%rax), %edx
leaq 0xf617(%rip), %rsi      # 0x1c03b
movb $0x0, %al
callq 0x31f0
jmp 0xca2d
jmp 0xca2f
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xcb34
cmpq $0x0, -0x50(%rbp)
je 0xcb19
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x7b, %eax
jne 0xcb19
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x48(%rbp)
movb %al, -0x62(%rbp)
je 0xca86
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x62(%rbp)
movb -0x62(%rbp), %al
testb $0x1, %al
jne 0xca8f
jmp 0xcae8
movq -0x60(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0xcc60
cmpl $0x0, %eax
je 0xcae6
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0xcae4
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
je 0xcad8
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
jne 0xcae4
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0xcae6
jmp 0xca6a
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0xcb17
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
jne 0xcb17
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0xcb32
movq -0x28(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x28(%rax), %edx
leaq 0xf535(%rip), %rsi      # 0x1c060
movb $0x0, %al
callq 0x31f0
jmp 0xcb34
movq -0x60(%rbp), %rdi
callq 0x3c20
jmp 0xcb4f
movq -0x28(%rbp), %rdi
movq 0x14616(%rip), %rsi     # 0x21160
callq 0x3070
movq -0x50(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)