// File: /workspace/github_c_makefile_star2_O2/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 %rcx, %r14
movl %edx, %ebp
movq %rsi, %r12
leaq 0x40(%rsp), %r15
movq %rdi, (%rsp)
movq (%rdi), %r13
cmpl $0xf, (%r13)
jne 0x54eb
cmpb $0x1, 0x3d(%r13)
jne 0x54eb
leaq 0x16c32(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc52d(%rip), %rsi      # 0x11a0e
movq %r12, %rdx
xorl %eax, %eax
callq 0xc536
movq (%r15), %rbx
cmpb $0x1, 0x3c(%rbx)
jne 0x551a
cmpl $0xd, (%rbx)
je 0x5515
leaq 0x16c08(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc536(%rip), %rsi      # 0x11a41
movq %r12, %rdx
xorl %eax, %eax
callq 0xc536
movb $0x1, 0x3d(%r13)
cmpb $0x1, 0x3d(%rbx)
jne 0x5548
cmpl $0xf, (%r13)
jne 0x5543
leaq 0x16bda(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc52f(%rip), %rsi      # 0x11a68
movq %r12, %rdx
xorl %eax, %eax
callq 0xc536
movb $0x1, 0x3d(%r13)
cmpl $0xe, (%rbx)
jne 0x5569
leaq 0x16bb4(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc53b(%rip), %rsi      # 0x11a9a
movq %r12, %rdx
xorl %eax, %eax
callq 0xc536
testb $0x40, 0x4(%rbx)
je 0x558b
leaq 0x16b92(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc53e(%rip), %rsi      # 0x11abf
movq %r12, %rdx
xorl %eax, %eax
callq 0xc536
cmpl $0x0, 0x8(%rbx)
jle 0x582a
testq %r12, %r12
sete %al
cmpq $-0x1, %r14
setne %cl
testb %cl, %al
jne 0x5624
pushq $0x30
popq %rdi
callq 0xd0e3
movq %r15, %rcx
movq %rax, %r15
movq %rbx, 0x8(%rax)
movl 0x8(%rcx), %eax
andq $0x0, 0x28(%r15)
leaq 0x28(%r15), %rcx
movl %eax, 0x10(%r15)
movq %r12, (%r15)
movq (%rsp), %rdx
movq 0x8(%rdx), %rax
movq %r15, (%rax)
movq %rcx, 0x8(%rdx)
cmpq $-0x1, %r14
jne 0x5627
andl $0x0, 0x20(%r15)
cmpl %ebp, 0x8(%rbx)
jle 0x57cc
testl %ebp, %ebp
je 0x560e
leaq 0x16b0f(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc555(%rip), %rsi      # 0x11b59
movq %r12, %rdx
xorl %eax, %eax
callq 0xc536
movq (%rsp), %rax
cmpb $0x0, 0x14(%rax)
je 0x57c9
pushq $0x1
popq %rbp
jmp 0x57cc
xorl %r15d, %r15d
testb $0x2, 0x4(%rbx)
jne 0x5649
leaq 0x16ad4(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc56c(%rip), %rsi      # 0x11bab
movq %r12, %rdx
xorl %eax, %eax
callq 0xc536
testl %ebp, %ebp
je 0x5669
leaq 0x16ab4(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc56c(%rip), %rsi      # 0x11bcb
movq %r12, %rdx
xorl %eax, %eax
callq 0xc536
movq (%rsp), %rax
cmpb $0x1, 0x14(%rax)
jne 0x568f
leaq 0x16a8e(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc56d(%rip), %rsi      # 0x11bf2
movq %r12, %rdx
xorl %eax, %eax
callq 0xc536
testq %r12, %r12
sete %al
testq %r14, %r14
setne %cl
orb %al, %cl
jne 0x56bb
leaq 0x16a62(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc572(%rip), %rsi      # 0x11c23
movq %r12, %rdx
xorl %eax, %eax
callq 0xc536
movq 0x10(%rbx), %rax
shlq $0x3, %rax
cmpq %r14, %rax
jae 0x56e4
leaq 0x16a39(%rip), %rdi     # 0x1c108
addq $0x8, %rdi
leaq 0xc581(%rip), %rsi      # 0x11c5b
movq %r12, %rdx
xorl %eax, %eax
callq 0xc536
movl 0x8(%rbx), %ebp
cmpl $0xf, (%r13)
jne 0x576b
movq 0x10(%r13), %rax
movq 0x10(%rbx), %rdx
leaq (%rax,%rdx), %rcx
decq %rcx
negq %rdx
andq %rcx, %rdx
testq %r14, %r14
je 0x571e
movq %rdx, %rsi
subq %rax, %rsi
movq (%rsp), %rcx
movl 0x10(%rcx), %ecx
leaq (%rcx,%rsi,8), %rsi
cmpq %r14, %rsi
jae 0x5727
movq %rdx, 0x10(%r13)
xorl %ecx, %ecx
movq %rdx, %rax
testq %r15, %r15
je 0x579e
cmpl $0x1, %ecx
movq %rax, %rdx
adcq $-0x1, %rdx
movq 0x10(%rbx), %rsi
movq %rsi, %rdi
negq %rdi
andq %rdx, %rdi
movq %rdi, 0x18(%r15)
movq %rax, %r8
subq %rdi, %r8
shlq $0x3, %r8
movl %ecx, %edx
subq %rdx, %r8
movw %r8w, 0x20(%r15)
shll $0x3, %esi
subl %r14d, %esi
subl %r8d, %esi
movw %si, 0x22(%r15)
jmp 0x57a0
testq %r15, %r15
je 0x581b
andq $0x0, 0x18(%r15)
andw $0x0, 0x20(%r15)
movq 0x10(%rbx), %rax
leal (,%rax,8), %ecx
subl %r14d, %ecx
movw %cx, 0x22(%r15)
cmpq %rax, 0x10(%r13)
jae 0x5811
movq %rax, 0x10(%r13)
jmp 0x5811
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(%r13)
movq (%rsp), %rax
movl %ecx, 0x10(%rax)
testq %r15, %r15
jne 0x5811
jmp 0x581b
movl 0x8(%rbx), %ebp
cmpl $0xf, (%r13)
jne 0x57f6
movq 0x10(%r13), %rax
movslq %ebp, %rcx
addq %rcx, %rax
decq %rax
negl %ecx
movslq %ecx, %rcx
andq %rax, %rcx
movq %rcx, 0x18(%r15)
addq 0x10(%rbx), %rcx
movq %rcx, 0x10(%r13)
jmp 0x5809
andq $0x0, 0x18(%r15)
movq 0x10(%rbx), %rax
cmpq %rax, 0x10(%r13)
jae 0x5809
movq %rax, 0x10(%r13)
movq (%rsp), %rax
andl $0x0, 0x10(%rax)
cmpl %ebp, 0x8(%r13)
jge 0x581b
movl %ebp, 0x8(%r13)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc2bc(%rip), %rdi      # 0x11aed
leaq 0xbcf3(%rip), %rsi      # 0x1152b
leaq 0xc2c1(%rip), %rcx      # 0x11b00
movl $0x2fb, %edx            # imm = 0x2FB
callq 0x30e0