// File: /workspace/github_c_makefile_star2_O1/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 0xeb8(%rip), %rax       # 0x2cb3c
leaq 0xd75(%rip), %r14       # 0x2ca00
cmoveq %rax, %r14
movq %rdi, 0x8(%rsp)
movq 0x98(%rdi), %rax
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x2be01
leaq 0x10(%rsp), %r12
movq 0x30(%rsp), %r13
movzwl (%r13), %eax
testb %al, %al
jle 0x2bdf2
xorl %ebx, %ebx
movq 0x18(%r13,%rbx,8), %rbp
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x2bcda
testq %rbp, %rbp
je 0x2bdde
leaq 0x41d97(%rip), %rax     # 0x6da78
cmpq %rax, 0x60(%rbp)
jne 0x2bd10
movq 0x18(%rbp), %rdi
callq 0x2e465
movq 0x4(%rbp), %rdi
leaq 0x1cb82(%rip), %rsi     # 0x4887d
movq %rax, %rdx
xorl %eax, %eax
callq 0x11a38
leaq 0x419ec(%rip), %rax     # 0x6d6f8
movq %rax, 0x60(%rbp)
movq 0x28(%rsp), %r15
testq %r15, %r15
je 0x2bd38
movq 0x18(%r15), %rdi
callq 0x2e465
movq 0x4(%r15), %rdi
leaq 0x1cb6b(%rip), %rsi     # 0x48899
movq %rax, %rdx
xorl %eax, %eax
callq 0x11a38
movq %rbp, %rdi
callq 0x2b5f4
cmpq $0x0, 0x18(%rbp)
jne 0x2bd4f
movq %rbp, %rdi
callq 0x2cb99
movq 0x70(%rbp), %rax
cmpq 0x10(%rsp), %rax
jbe 0x2bd8c
movq 0x8(%rsp), %rcx
testb $0x20, 0x56(%rcx)
jne 0x2bd8c
cmpq $0x0, 0x18(%rbp)
jne 0x2bd87
cmpb $0x3, (%rbp)
movq %rbp, %rcx
jne 0x2bd79
movq 0x60(%rbp), %rcx
cmpb $0x9, (%rcx)
jne 0x2bd82
movq 0x60(%rcx), %rcx
cmpb $0xb, (%rcx)
je 0x2bd8c
movq %rax, 0x10(%rsp)
cmpb $0x3, (%rbp)
movq %rbp, %rax
jne 0x2bd99
movq 0x60(%rbp), %rax
testb $0x40, 0x55(%rax)
je 0x2bda4
movb $0x1, 0x24(%rsp)
cmpb $0x3, (%rbp)
movq %rbp, %rax
jne 0x2bdb1
movq 0x60(%rbp), %rax
testb $0x40, 0x55(%rax)
je 0x2bdd5
leaq 0x3c042(%rip), %rax     # 0x67e00
cmpl $0x0, (%rax)
je 0x2bdd5
movq 0x4(%rbp), %rdi
leaq 0x1caf2(%rip), %rsi     # 0x488c0
xorl %eax, %eax
callq 0x118b4
movq %rbp, %rdi
movq %r12, %rsi
callq *%r14
incq %rbx
movl (%r13), %eax
movsbq %al, %rcx
cmpq %rcx, %rbx
jl 0x2bcc2
movq 0x10(%r13), %r13
cmpq 0x30(%rsp), %r13
jne 0x2bcb3
movq 0x8(%rsp), %rax
cmpq $0x0, 0x70(%rax)
jne 0x2be1b
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rax, 0x70(%rcx)
movq 0x18(%rsp), %rdx
cmpl $0x0, 0x20(%rsp)
je 0x2be44
leaq 0x398d2(%rip), %rcx     # 0x65700
movl (%rcx), %ecx
movq 0x8(%rsp), %rax
imull 0x70(%rax), %ecx
decl %ecx
addq %rcx, %rdx
notq %rcx
andq %rcx, %rdx
cmpq $0x0, 0x28(%rsp)
je 0x2be51
movb $0x1, 0x24(%rsp)
cmpb $0x0, 0x24(%rsp)
je 0x2be85
movq 0x8(%rsp), %rcx
cmpb $0x3, (%rcx)
jne 0x2be6b
movq 0x8(%rsp), %rax
movq 0x60(%rax), %rcx
cmpb $0x8, (%rcx)
jne 0x2be7c
leaq 0x3bf91(%rip), %rcx     # 0x67e08
cmpl $0x0, (%rcx)
je 0x2be85
movq 0x8(%rsp), %rax
orb $0x40, 0x55(%rax)
movq 0x8(%rsp), %rax
movl %edx, 0x50(%rax)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq