// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/decl.c
// Function: addmember
static void
addmember(struct structbuilder *b, struct qualtype mt, char *name, int align, unsigned long long width)
{
	struct type *t = b->type;
	struct member *m;
	size_t end;

	if (t->kind == TYPESTRUCT && t->flexible)
		error(&tok.loc, "struct has member '%s' after flexible array member", name);
	if (mt.type->incomplete) {
		if (mt.type->kind != TYPEARRAY)
			error(&tok.loc, "struct member '%s' has incomplete type", name);
		t->flexible = true;
	}
	if (mt.type->flexible) {
		if (t->kind == TYPESTRUCT)
			error(&tok.loc, "struct member '%s' contains flexible array member", name);
		t->flexible = true;
	}
	if (mt.type->kind == TYPEFUNC)
		error(&tok.loc, "struct member '%s' has function type", name);
	if (mt.type->prop & PROPVM)
		error(&tok.loc, "struct member '%s' has variably modified type", name);
	assert(mt.type->align > 0);
	if (name || width == -1) {
		m = xmalloc(sizeof(*m));
		m->type = mt.type;
		m->qual = mt.qual;
		m->name = name;
		m->next = NULL;
		*b->last = m;
		b->last = &m->next;
	} else {
		m = NULL;
	}
	if (width == -1) {
		m->bits.before = 0;
		m->bits.after = 0;
		if (align < mt.type->align) {
			if (align)
				error(&tok.loc, "specified alignment of struct member '%s' is less strict than is required by type", name);
			align = b->pack ? 1 : mt.type->align;
		}
		if (t->kind == TYPESTRUCT) {
			m->offset = ALIGNUP(t->size, align);
			t->size = m->offset + mt.type->size;
		} else {
			m->offset = 0;
			if (t->size < mt.type->size)
				t->size = mt.type->size;
		}
		b->bits = 0;
	} else {  /* bit-field */
		if (!(mt.type->prop & PROPINT))
			error(&tok.loc, "bit-field '%s' has invalid type", name);
		if (align)
			error(&tok.loc, "alignment specified for bit-field '%s'", name);
		if (b->pack)
			error(&tok.loc, "bit-field '%s' in packed struct is not supported", name);
		if (!width && name)
			error(&tok.loc, "bit-field '%s' with zero width must not have declarator", name);
		if (width > mt.type->size * 8)
			error(&tok.loc, "bit-field '%s' exceeds width of underlying type", name);
		align = mt.type->align;
		if (t->kind == TYPESTRUCT) {
			/* calculate end of the storage-unit for this bit-field */
			end = ALIGNUP(t->size, mt.type->size);
			if (!width || width > (end - t->size) * 8 + b->bits) {
				/* no room, allocate a new storage-unit */
				t->size = end;
				b->bits = 0;
			}
			if (m) {
				m->offset = ALIGNDOWN(t->size - !!b->bits, mt.type->size);
				m->bits.before = (t->size - m->offset) * 8 - b->bits;
				m->bits.after = mt.type->size * 8 - width - m->bits.before;
			}
			t->size += (width - b->bits + 7) / 8;
			b->bits = (b->bits - width) % 8;
		} else if (m) {
			m->offset = 0;
			m->bits.before = 0;
			m->bits.after = mt.type->size * 8 - width;
			if (t->size < mt.type->size)
				t->size = mt.type->size;
		}
	}
	if (m && t->align < align)
		t->align = align;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r14
movl %r8d, %ebp
movq %rcx, %r13
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, (%rsp)
movq (%rdi), %rbx
cmpl $0xf, (%rbx)
jne 0x57cf
cmpb $0x1, 0x3d(%rbx)
jne 0x57cf
leaq 0x1694e(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xd249(%rip), %rsi      # 0x12a0e
movq %r13, %rdx
xorl %eax, %eax
callq 0xd55c
cmpb $0x1, 0x3c(%r15)
jne 0x57fc
cmpl $0xd, (%r15)
je 0x57f8
leaq 0x16925(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xd253(%rip), %rsi      # 0x12a41
movq %r13, %rdx
xorl %eax, %eax
callq 0xd55c
movb $0x1, 0x3d(%rbx)
cmpb $0x1, 0x3d(%r15)
jne 0x5828
cmpl $0xf, (%rbx)
jne 0x5824
leaq 0x168f9(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xd24e(%rip), %rsi      # 0x12a68
movq %r13, %rdx
xorl %eax, %eax
callq 0xd55c
movb $0x1, 0x3d(%rbx)
cmpl $0xe, (%r15)
jne 0x584a
leaq 0x168d3(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xd25a(%rip), %rsi      # 0x12a9a
movq %r13, %rdx
xorl %eax, %eax
callq 0xd55c
testb $0x40, 0x4(%r15)
je 0x586d
leaq 0x168b0(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xd25c(%rip), %rsi      # 0x12abf
movq %r13, %rdx
xorl %eax, %eax
callq 0xd55c
cmpl $0x0, 0x8(%r15)
jle 0x5b2b
testq %r13, %r13
sete %al
cmpq $-0x1, %r14
setne %cl
testb %cl, %al
jne 0x593f
movl $0x30, %edi
callq 0xe142
movl %r12d, %ecx
movq %rax, %r12
addq $0x28, %rax
movq %r15, 0x8(%r12)
movl %ecx, 0x10(%r12)
movq %r13, (%r12)
movq $0x0, 0x28(%r12)
movq (%rsp), %rdx
movq 0x8(%rdx), %rcx
movq %r12, (%rcx)
movq %rax, 0x8(%rdx)
cmpq $-0x1, %r14
jne 0x5942
movl $0x0, 0x20(%r12)
cmpl %ebp, 0x8(%r15)
jle 0x590f
testl %ebp, %ebp
je 0x58fc
leaq 0x16821(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xd267(%rip), %rsi      # 0x12b59
movq %r13, %rdx
xorl %eax, %eax
callq 0xd55c
movl $0x1, %ebp
movq (%rsp), %rax
cmpb $0x0, 0x14(%rax)
jne 0x590f
movl 0x8(%r15), %ebp
cmpl $0xf, (%rbx)
jne 0x5af2
movq 0x10(%rbx), %rax
movslq %ebp, %rcx
addq %rcx, %rax
decq %rax
negl %ecx
movslq %ecx, %rcx
andq %rax, %rcx
movq %rcx, 0x18(%r12)
addq 0x10(%r15), %rcx
movq %rcx, 0x10(%rbx)
jmp 0x5b09
xorl %r12d, %r12d
testb $0x2, 0x4(%r15)
jne 0x5965
leaq 0x167b8(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xd250(%rip), %rsi      # 0x12bab
movq %r13, %rdx
xorl %eax, %eax
callq 0xd55c
testl %ebp, %ebp
je 0x5985
leaq 0x16798(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xd250(%rip), %rsi      # 0x12bcb
movq %r13, %rdx
xorl %eax, %eax
callq 0xd55c
movq (%rsp), %rax
cmpb $0x1, 0x14(%rax)
jne 0x59ab
leaq 0x16772(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xd251(%rip), %rsi      # 0x12bf2
movq %r13, %rdx
xorl %eax, %eax
callq 0xd55c
testq %r13, %r13
sete %al
testq %r14, %r14
setne %cl
orb %al, %cl
jne 0x59d7
leaq 0x16746(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xd256(%rip), %rsi      # 0x12c23
movq %r13, %rdx
xorl %eax, %eax
callq 0xd55c
movq 0x10(%r15), %rax
shlq $0x3, %rax
cmpq %r14, %rax
jae 0x5a00
leaq 0x1671d(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xd265(%rip), %rsi      # 0x12c5b
movq %r13, %rdx
xorl %eax, %eax
callq 0xd55c
movl 0x8(%r15), %ebp
cmpl $0xf, (%rbx)
jne 0x5a8d
movq 0x10(%rbx), %rax
movq 0x10(%r15), %rdx
leaq (%rax,%rdx), %rcx
decq %rcx
negq %rdx
andq %rcx, %rdx
testq %r14, %r14
je 0x5a3d
movq %rdx, %rsi
subq %rax, %rsi
movq (%rsp), %rcx
movl 0x10(%rcx), %ecx
leaq (%rcx,%rsi,8), %rsi
cmpq %r14, %rsi
jae 0x5a46
movq %rdx, 0x10(%rbx)
xorl %ecx, %ecx
movq %rdx, %rax
testq %r12, %r12
je 0x5ac7
cmpl $0x1, %ecx
movq %rax, %rdx
adcq $-0x1, %rdx
movq 0x10(%r15), %rsi
movq %rsi, %rdi
negq %rdi
andq %rdx, %rdi
movq %rdi, 0x18(%r12)
movq %rax, %r8
subq %rdi, %r8
shlq $0x3, %r8
movl %ecx, %edx
subq %rdx, %r8
movw %r8w, 0x20(%r12)
shll $0x3, %esi
subl %r14d, %esi
subl %r8d, %esi
movw %si, 0x22(%r12)
jmp 0x5ac9
testq %r12, %r12
je 0x5b1c
movq $0x0, 0x18(%r12)
movw $0x0, 0x20(%r12)
movq 0x10(%r15), %rax
leal (,%rax,8), %ecx
subl %r14d, %ecx
movw %cx, 0x22(%r12)
cmpq %rax, 0x10(%rbx)
jae 0x5b14
movq %rax, 0x10(%rbx)
jmp 0x5b14
movl %ecx, %edx
negq %rdx
addq %r14, %rdx
addq $0x7, %rdx
shrq $0x3, %rdx
addq %rax, %rdx
subl %r14d, %ecx
andl $0x7, %ecx
movq %rdx, 0x10(%rbx)
movq (%rsp), %rax
movl %ecx, 0x10(%rax)
testq %r12, %r12
jne 0x5b14
jmp 0x5b1c
movq $0x0, 0x18(%r12)
movq 0x10(%r15), %rax
cmpq %rax, 0x10(%rbx)
jae 0x5b09
movq %rax, 0x10(%rbx)
movq (%rsp), %rax
movl $0x0, 0x10(%rax)
cmpl %ebp, 0x8(%rbx)
jge 0x5b1c
movl %ebp, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xcfbb(%rip), %rdi      # 0x12aed
leaq 0xc9f2(%rip), %rsi      # 0x1252b
leaq 0xcfc0(%rip), %rcx      # 0x12b00
movl $0x2fb, %edx            # imm = 0x2FB
callq 0x30e0