// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/symbol.c
// Function: lay_out_struct
static void lay_out_struct(struct symbol *sym, struct struct_union_info *info)
{
	unsigned long bit_size, align_bit_mask;
	unsigned long alignment;
	int base_size;

	bit_size = info->bit_size;
	base_size = sym->bit_size; 

	/*
	 * If the member is unsized, either it's a flexible array or
	 * it's invalid and a warning has already been issued.
	 */
	if (base_size < 0) {
		if (!is_array_type(sym))
			return;
		base_size = 0;
		info->flex_array = sym;
	}

	alignment = info->packed ? 1 : sym->ctype.alignment;
	align_bit_mask = bytes_to_bits(alignment) - 1;

	/*
	 * Bitfields have some very special rules..
	 */
	if (is_bitfield_type (sym)) {
		unsigned long bit_offset = bit_size & align_bit_mask;
		int room = bitfield_base_size(sym) - bit_offset;
		// Zero-width fields just fill up the unit.
		int width = base_size ? : (bit_offset ? room : 0);

		if (width > room && !info->packed) {
			bit_size = (bit_size + align_bit_mask) & ~align_bit_mask;
			bit_offset = 0;
		}
		sym->offset = bits_to_bytes(bit_size - bit_offset);
		sym->bit_offset = bit_offset;
		sym->ctype.base_type->bit_offset = bit_offset;
		info->bit_size = bit_size + width;
		// warning (sym->pos, "bitfield: offset=%d:%d  size=:%d", sym->offset, sym->bit_offset, width);

		if (info->packed && sym->type == SYM_NODE)
			sym->packed = 1;
		return;
	}

	/*
	 * Otherwise, just align it right and add it up..
	 */
	bit_size = (bit_size + align_bit_mask) & ~align_bit_mask;
	sym->offset = bits_to_bytes(bit_size);

	info->bit_size = bit_size + base_size;
	// warning (sym->pos, "regular: offset=%d", sym->offset);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jge 0x41852
movq -0x8(%rbp), %rdi
callq 0x41c60
cmpl $0x0, %eax
jne 0x4183f
jmp 0x41a04
movl $0x0, -0x2c(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x15(%rax)
je 0x41867
movl $0x1, %eax
movq %rax, -0x48(%rbp)
jmp 0x41873
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl %eax, %edi
callq 0x41c00
subl $0x1, %eax
cltq
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x40700
cmpl $0xb, %eax
jne 0x419c4
movq -0x18(%rbp), %rax
andq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x41ca0
cltq
subq -0x38(%rbp), %rax
movl %eax, -0x3c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x4c(%rbp)
cmpl $0x0, %eax
je 0x418d2
movl -0x4c(%rbp), %eax
movl %eax, -0x50(%rbp)
jmp 0x418ee
cmpq $0x0, -0x38(%rbp)
je 0x418e1
movl -0x3c(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x418e8
xorl %eax, %eax
movl %eax, -0x54(%rbp)
jmp 0x418e8
movl -0x54(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jle 0x41925
movq -0x10(%rbp), %rax
testb $0x1, 0x15(%rax)
jne 0x41925
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
movq -0x20(%rbp), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
subq -0x38(%rbp), %rax
movl %eax, %edi
callq 0x411d0
movslq %eax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x38(%rbp), %rax
movl %eax, %edx
movq -0x8(%rbp), %rax
movl 0x54(%rax), %ecx
andl $0xff, %edx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
orl %edx, %ecx
movl %ecx, 0x54(%rax)
movq -0x38(%rbp), %rax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movl 0x54(%rax), %ecx
andl $0xff, %edx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
orl %edx, %ecx
movl %ecx, 0x54(%rax)
movq -0x18(%rbp), %rcx
movslq -0x40(%rbp), %rax
addq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x15(%rax)
je 0x419c2
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0xff, %eax
cmpl $0x3, %eax
jne 0x419c2
movq -0x8(%rbp), %rax
movl 0x54(%rax), %ecx
andl $0xffdfffff, %ecx       # imm = 0xFFDFFFFF
orl $0x200000, %ecx         # imm = 0x200000
movl %ecx, 0x54(%rax)
jmp 0x41a04
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
movq -0x20(%rbp), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl %eax, %edi
callq 0x411d0
movslq %eax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x18(%rbp), %rcx
movslq -0x2c(%rbp), %rax
addq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)