// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0xf, (%rax)
jne 0x63da
movq -0x28(%rbp), %rax
testb $0x1, 0x3d(%rax)
je 0x63da
movq -0x10(%rbp), %rdx
leaq 0x1bde0(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x12767(%rip), %rsi     # 0x18b3a
movb $0x0, %al
callq 0x11190
movq -0x40(%rbp), %rax
movq (%rax), %rax
testb $0x1, 0x3c(%rax)
je 0x6418
movq -0x40(%rbp), %rax
movq (%rax), %rax
cmpl $0xd, (%rax)
je 0x6410
movq -0x10(%rbp), %rdx
leaq 0x1bdaa(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x12764(%rip), %rsi     # 0x18b6d
movb $0x0, %al
callq 0x11190
movq -0x28(%rbp), %rax
movb $0x1, 0x3d(%rax)
movq -0x40(%rbp), %rax
movq (%rax), %rax
testb $0x1, 0x3d(%rax)
je 0x6453
movq -0x28(%rbp), %rax
cmpl $0xf, (%rax)
jne 0x644b
movq -0x10(%rbp), %rdx
leaq 0x1bd6f(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x12750(%rip), %rsi     # 0x18b94
movb $0x0, %al
callq 0x11190
movq -0x28(%rbp), %rax
movb $0x1, 0x3d(%rax)
movq -0x40(%rbp), %rax
movq (%rax), %rax
cmpl $0xe, (%rax)
jne 0x647c
movq -0x10(%rbp), %rdx
leaq 0x1bd3e(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x12751(%rip), %rsi     # 0x18bc6
movb $0x0, %al
callq 0x11190
movq -0x40(%rbp), %rax
movq (%rax), %rax
movl 0x4(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x64ab
movq -0x10(%rbp), %rdx
leaq 0x1bd0f(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x12747(%rip), %rsi     # 0x18beb
movb $0x0, %al
callq 0x11190
movq -0x40(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, 0x8(%rax)
jle 0x64ba
jmp 0x64d9
leaq 0x12758(%rip), %rdi     # 0x18c19
leaq 0x1218f(%rip), %rsi     # 0x18657
movl $0x2fb, %edx            # imm = 0x2FB
leaq 0x12758(%rip), %rcx     # 0x18c2c
callq 0x30f0
cmpq $0x0, -0x10(%rbp)
jne 0x64e7
cmpq $-0x1, -0x20(%rbp)
jne 0x6549
movl $0x30, %edi
callq 0x127c0
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x30(%rbp)
movq (%rax), %rdx
movq -0x30(%rbp), %rcx
movq %rdx, 0x8(%rcx)
movl 0x8(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x30(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rcx
addq $0x28, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x6551
movq $0x0, -0x30(%rbp)
cmpq $-0x1, -0x20(%rbp)
jne 0x665b
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %rax
movw $0x0, 0x20(%rax)
movq -0x30(%rbp), %rax
movw $0x0, 0x22(%rax)
movl -0x14(%rbp), %eax
movq (%rcx), %rcx
cmpl 0x8(%rcx), %eax
jge 0x65c9
cmpl $0x0, -0x14(%rbp)
je 0x65a2
movq -0x10(%rbp), %rdx
leaq 0x1bc18(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x126ea(%rip), %rsi     # 0x18c85
movb $0x0, %al
callq 0x11190
movq -0x8(%rbp), %rax
testb $0x1, 0x14(%rax)
je 0x65b6
movl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x65c3
movq -0x40(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x28(%rbp), %rax
cmpl $0xf, (%rax)
jne 0x6615
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x10(%rcx), %rdx
movslq -0x14(%rbp), %rcx
addq %rcx, %rdx
subq $0x1, %rdx
xorl %ecx, %ecx
subl -0x14(%rbp), %ecx
movslq %ecx, %rcx
andq %rcx, %rdx
movq -0x30(%rbp), %rcx
movq %rdx, 0x18(%rcx)
movq -0x30(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq (%rax), %rax
addq 0x10(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x664b
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rcx), %rcx
cmpq 0x10(%rcx), %rax
jae 0x6649
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x664b
movq -0x8(%rbp), %rax
movl $0x0, 0x10(%rax)
jmp 0x68ee
movq -0x40(%rbp), %rax
movq (%rax), %rax
movl 0x4(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x668a
movq -0x10(%rbp), %rdx
leaq 0x1bb30(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x12654(%rip), %rsi     # 0x18cd7
movb $0x0, %al
callq 0x11190
cmpl $0x0, -0x14(%rbp)
je 0x66ad
movq -0x10(%rbp), %rdx
leaq 0x1bb0d(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x12651(%rip), %rsi     # 0x18cf7
movb $0x0, %al
callq 0x11190
movq -0x8(%rbp), %rax
testb $0x1, 0x14(%rax)
je 0x66d4
movq -0x10(%rbp), %rdx
leaq 0x1bae6(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x12651(%rip), %rsi     # 0x18d1e
movb $0x0, %al
callq 0x11190
cmpq $0x0, -0x20(%rbp)
jne 0x66ff
cmpq $0x0, -0x10(%rbp)
je 0x66ff
movq -0x10(%rbp), %rdx
leaq 0x1babb(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x12657(%rip), %rsi     # 0x18d4f
movb $0x0, %al
callq 0x11190
movq -0x40(%rbp), %rcx
movq -0x20(%rbp), %rax
movq (%rcx), %rcx
movq 0x10(%rcx), %rcx
shlq $0x3, %rcx
cmpq %rcx, %rax
jbe 0x6734
movq -0x10(%rbp), %rdx
leaq 0x1ba86(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x1265a(%rip), %rsi     # 0x18d87
movb $0x0, %al
callq 0x11190
movq -0x40(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x28(%rbp), %rax
cmpl $0xf, (%rax)
jne 0x6889
movq -0x40(%rbp), %rcx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rcx), %rdx
addq 0x10(%rdx), %rax
subq $0x1, %rax
movq (%rcx), %rdx
xorl %ecx, %ecx
subq 0x10(%rdx), %rcx
andq %rcx, %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x679f
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rdx
subq 0x10(%rdx), %rcx
shlq $0x3, %rcx
movq -0x8(%rbp), %rdx
movl 0x10(%rdx), %edx
addq %rdx, %rcx
cmpq %rcx, %rax
jbe 0x67b6
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x10(%rax)
cmpq $0x0, -0x30(%rbp)
je 0x684d
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x10(%rcx), %rdx
movq -0x8(%rbp), %rcx
cmpl $0x0, 0x10(%rcx)
setne %cl
xorb $-0x1, %cl
xorb $-0x1, %cl
andb $0x1, %cl
movzbl %cl, %ecx
movslq %ecx, %rcx
subq %rcx, %rdx
movq (%rax), %rsi
xorl %ecx, %ecx
subq 0x10(%rsi), %rcx
andq %rcx, %rdx
movq -0x30(%rbp), %rcx
movq %rdx, 0x18(%rcx)
movq -0x28(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x30(%rbp), %rdx
subq 0x18(%rdx), %rcx
shlq $0x3, %rcx
movq -0x8(%rbp), %rdx
movl 0x10(%rdx), %edx
subq %rdx, %rcx
movw %cx, %dx
movq -0x30(%rbp), %rcx
movw %dx, 0x20(%rcx)
movq (%rax), %rax
movq 0x10(%rax), %rax
shlq $0x3, %rax
subq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movswq 0x20(%rcx), %rcx
subq %rcx, %rax
movw %ax, %cx
movq -0x30(%rbp), %rax
movw %cx, 0x22(%rax)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
subq %rax, %rcx
addq $0x7, %rcx
shrq $0x3, %rcx
movq -0x28(%rbp), %rax
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
subq -0x20(%rbp), %rax
andq $0x7, %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10(%rax)
jmp 0x68ec
cmpq $0x0, -0x30(%rbp)
je 0x68ea
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x30(%rbp), %rax
movw $0x0, 0x20(%rax)
movq (%rcx), %rax
movq 0x10(%rax), %rax
shlq $0x3, %rax
subq -0x20(%rbp), %rax
movw %ax, %dx
movq -0x30(%rbp), %rax
movw %dx, 0x22(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rcx), %rcx
cmpq 0x10(%rcx), %rax
jae 0x68e8
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x68ea
jmp 0x68ec
jmp 0x68ee
cmpq $0x0, -0x30(%rbp)
je 0x690b
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
cmpl -0x14(%rbp), %eax
jge 0x690b
movl -0x14(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x8(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)