// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/symbol.c
// Function: examine_struct_union_type
static struct symbol * examine_struct_union_type(struct symbol *sym, int advance)
{
	struct struct_union_info info = {
		.packed = sym->packed,
		.max_align = 1,
		.bit_size = 0,
		.align_size = 1
	};
	unsigned long bit_size, bit_align;
	void (*fn)(struct symbol *, struct struct_union_info *);
	struct symbol *member;

	fn = advance ? lay_out_struct : lay_out_union;
	FOR_EACH_PTR(sym->symbol_list, member) {
		if (member->ctype.base_type == &autotype_ctype) {
			sparse_error(member->pos, "member '%s' has __auto_type", show_ident(member->ident));
			member->ctype.base_type = &incomplete_ctype;
		}
		if (info.flex_array)
			sparse_error(info.flex_array->pos, "flexible array member '%s' is not last", show_ident(info.flex_array->ident));
		examine_symbol_type(member);
		if (!member->ident)
			examine_anonymous_member(member);

		if (member->ctype.alignment > info.max_align && !sym->packed) {
			// Unnamed bitfields do not affect alignment.
			if (member->ident || !is_bitfield_type(member))
				info.max_align = member->ctype.alignment;
		}

		if (has_flexible_array(member))
			info.has_flex_array = 1;
		if (has_flexible_array(member) && Wflexible_array_nested)
			warning(member->pos, "nested flexible array");
		fn(member, &info);
	} END_FOR_EACH_PTR(member);

	if (!sym->ctype.alignment)
		sym->ctype.alignment = info.max_align;
	bit_size = info.bit_size;
	if (info.align_size) {
		bit_align = bytes_to_bits(sym->ctype.alignment)-1;
		bit_size = (bit_size + bit_align) & ~bit_align;
	}
	if (info.flex_array) {
		info.has_flex_array = 1;
	}
	if (info.has_flex_array && (!is_union_type(sym) || Wflexible_array_union))
		sym->has_flex_array = 1;
	sym->bit_size = bit_size;
	return sym;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq $0x1, 0x10(%rsp)
xorl %eax, %eax
movq %rax, 0x18(%rsp)
movl $0x1, 0x20(%rsp)
movb $0x0, 0x24(%rsp)
movl 0x54(%rdi), %ecx
shrl $0x15, %ecx
andb $0x1, %cl
movb %cl, 0x25(%rsp)
movq %rax, 0x28(%rsp)
testl %esi, %esi
leaq 0xed7(%rip), %rax       # 0x2c60e
leaq 0xd84(%rip), %r14       # 0x2c4c2
cmoveq %rax, %r14
movq %rdi, 0x8(%rsp)
movq 0x98(%rdi), %rax
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x2b8c8
leaq 0x10(%rsp), %r12
movq 0x30(%rsp), %r13
movzwl (%r13), %eax
testb %al, %al
jle 0x2b8b9
xorl %ebx, %ebx
movq 0x18(%r13,%rbx,8), %rbp
movzwl %ax, %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0x2b78e
testq %rbp, %rbp
je 0x2b8a6
leaq 0x412e3(%rip), %rax     # 0x6ca78
cmpq %rax, 0x60(%rbp)
jne 0x2b7c4
movq 0x18(%rbp), %rdi
callq 0x2de35
movq 0x4(%rbp), %rdi
leaq 0x1c04e(%rip), %rsi     # 0x477fd
movq %rax, %rdx
xorl %eax, %eax
callq 0x11a80
leaq 0x40f38(%rip), %rax     # 0x6c6f8
movq %rax, 0x60(%rbp)
movq 0x28(%rsp), %r15
testq %r15, %r15
je 0x2b7ec
movq 0x18(%r15), %rdi
callq 0x2de35
movq 0x4(%r15), %rdi
leaq 0x1c037(%rip), %rsi     # 0x47819
movq %rax, %rdx
xorl %eax, %eax
callq 0x11a80
movq %rbp, %rdi
callq 0x2b0b8
cmpq $0x0, 0x18(%rbp)
jne 0x2b803
movq %rbp, %rdi
callq 0x2c670
movq 0x70(%rbp), %rax
cmpq 0x10(%rsp), %rax
jbe 0x2b849
movq 0x8(%rsp), %rcx
testb $0x20, 0x56(%rcx)
jne 0x2b849
cmpq $0x0, 0x18(%rbp)
jne 0x2b844
movzbl (%rbp), %ecx
movq %rbp, %rdx
cmpl $0x3, %ecx
jne 0x2b833
movq 0x60(%rbp), %rdx
movzbl (%rdx), %ecx
cmpl $0x9, %ecx
jne 0x2b83f
movq 0x60(%rdx), %rcx
movzbl (%rcx), %ecx
cmpl $0xb, %ecx
je 0x2b849
movq %rax, 0x10(%rsp)
movzbl (%rbp), %eax
movq %rbp, %rcx
cmpl $0x3, %eax
jne 0x2b859
movq 0x60(%rbp), %rcx
testb $0x40, 0x55(%rcx)
je 0x2b868
movb $0x1, 0x24(%rsp)
movzbl (%rbp), %eax
movq %rbp, %rcx
cmpl $0x3, %eax
jne 0x2b874
movq 0x60(%rbp), %rcx
testb $0x40, 0x55(%rcx)
je 0x2b898
leaq 0x3b57f(%rip), %rax     # 0x66e00
cmpl $0x0, (%rax)
je 0x2b898
movq 0x4(%rbp), %rdi
leaq 0x1bfaf(%rip), %rsi     # 0x47840
xorl %eax, %eax
callq 0x118fc
movq %rbp, %rdi
movq %r12, %rsi
callq *%r14
movzwl (%r13), %eax
incq %rbx
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %rbx
jl 0x2b775
movq 0x10(%r13), %r13
cmpq 0x30(%rsp), %r13
jne 0x2b766
movq 0x8(%rsp), %rax
movq 0x70(%rax), %rcx
testq %rcx, %rcx
jne 0x2b8e4
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x70(%rax)
movq 0x18(%rsp), %rsi
cmpl $0x0, 0x20(%rsp)
je 0x2b905
leaq 0x38e09(%rip), %rdx     # 0x64700
imull (%rdx), %ecx
decl %ecx
addq %rcx, %rsi
notq %rcx
andq %rcx, %rsi
cmpq $0x0, 0x28(%rsp)
je 0x2b914
movb $0x1, 0x24(%rsp)
jmp 0x2b91b
cmpb $0x0, 0x24(%rsp)
je 0x2b94e
movq 0x8(%rsp), %rax
movzbl (%rax), %ecx
cmpl $0x3, %ecx
jne 0x2b934
movq 0x8(%rsp), %rax
movq 0x60(%rax), %rcx
movzbl (%rcx), %ecx
cmpl $0x8, %ecx
jne 0x2b945
leaq 0x3b4c8(%rip), %rcx     # 0x66e08
cmpl $0x0, (%rcx)
je 0x2b94e
movq 0x8(%rsp), %rax
orb $0x40, 0x55(%rax)
movq 0x8(%rsp), %rax
movl %esi, 0x50(%rax)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq