// File: /workspace/github_c_makefile_star2_O2/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)
andq $0x0, 0x18(%rsp)
movl $0x1, 0x20(%rsp)
movb $0x0, 0x24(%rsp)
movl 0x54(%rdi), %eax
shrl $0x15, %eax
andb $0x1, %al
movb %al, 0x25(%rsp)
andq $0x0, 0x28(%rsp)
testl %esi, %esi
leaq 0xded(%rip), %rax       # 0x27bf6
leaq 0xcb2(%rip), %r14       # 0x27ac2
cmoveq %rax, %r14
movq %rdi, 0x8(%rsp)
movq 0x98(%rdi), %rax
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x26f5d
leaq 0x10(%rsp), %r12
movq 0x30(%rsp), %rbx
xorl %r13d, %r13d
movl (%rbx), %eax
movsbq %al, %rcx
cmpq %rcx, %r13
jge 0x26f4e
movq 0x18(%rbx,%r13,8), %rbp
cmpw $0x100, %ax             # imm = 0x100
jb 0x26e5e
testq %rbp, %rbp
je 0x26f46
leaq 0x3fc13(%rip), %rax     # 0x66a78
cmpq %rax, 0x60(%rbp)
jne 0x26e94
movq 0x18(%rbp), %rdi
callq 0x2936d
movq 0x4(%rbp), %rdi
leaq 0x19b4e(%rip), %rsi     # 0x409cd
movq %rax, %rdx
xorl %eax, %eax
callq 0x1120e
leaq 0x3f868(%rip), %rax     # 0x666f8
movq %rax, 0x60(%rbp)
movq 0x28(%rsp), %r15
testq %r15, %r15
je 0x26ebc
movq 0x18(%r15), %rdi
callq 0x2936d
movq 0x4(%r15), %rdi
leaq 0x19b37(%rip), %rsi     # 0x409e9
movq %rax, %rdx
xorl %eax, %eax
callq 0x1120e
movq %rbp, %rdi
callq 0x267cd
cmpq $0x0, 0x18(%rbp)
jne 0x26ed3
movq %rbp, %rdi
callq 0x27c4b
movq 0x70(%rbp), %r15
cmpq 0x10(%rsp), %r15
jbe 0x26f02
movq 0x8(%rsp), %rax
testb $0x20, 0x56(%rax)
jne 0x26f02
cmpq $0x0, 0x18(%rbp)
jne 0x26efd
movq %rbp, %rdi
callq 0x2731e
cmpl $0xb, %eax
je 0x26f02
movq %r15, 0x10(%rsp)
movq %rbp, %rdi
callq 0x27aaf
testl %eax, %eax
je 0x26f13
movb $0x1, 0x24(%rsp)
movq %rbp, %rdi
callq 0x27aaf
testl %eax, %eax
je 0x26f3d
leaq 0x39eda(%rip), %rax     # 0x60e00
cmpl $0x0, (%rax)
je 0x26f3d
movq 0x4(%rbp), %rdi
leaq 0x19ada(%rip), %rsi     # 0x40a10
xorl %eax, %eax
callq 0x1108a
movq %rbp, %rdi
movq %r12, %rsi
callq *%r14
incq %r13
jmp 0x26e3b
movq 0x10(%rbx), %rbx
cmpq 0x30(%rsp), %rbx
jne 0x26e38
movq 0x8(%rsp), %rax
movq 0x70(%rax), %rcx
testq %rcx, %rcx
jne 0x26f79
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x70(%rax)
movq 0x18(%rsp), %rsi
cmpl $0x0, 0x20(%rsp)
je 0x26f9a
leaq 0x37774(%rip), %rdx     # 0x5e700
imull (%rdx), %ecx
decl %ecx
addq %rcx, %rsi
notq %rcx
andq %rcx, %rsi
cmpq $0x0, 0x28(%rsp)
je 0x26fa9
movb $0x1, 0x24(%rsp)
jmp 0x26fb0
cmpb $0x0, 0x24(%rsp)
je 0x26fe3
movq 0x8(%rsp), %rax
movzbl (%rax), %ecx
cmpl $0x3, %ecx
jne 0x26fc9
movq 0x8(%rsp), %rax
movq 0x60(%rax), %rcx
movzbl (%rcx), %ecx
cmpl $0x8, %ecx
jne 0x26fda
leaq 0x39e33(%rip), %rcx     # 0x60e08
cmpl $0x0, (%rcx)
je 0x26fe3
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