// File: /workspace/github_c_makefile_star2_O0/michaelforney[P]cproc/attr.c
// Function: parseattr
static bool
parseattr(struct attr *a, enum attrkind allowed, enum attrprefix prefix)
{
	char *name, *prefixname = "";
	enum attrkind kind;
	int paren;

	if (tok.kind != TIDENT)
		return false;
	name = strip(tok.lit);
	next();
	if (!prefix) {
		if (consume(TCOLONCOLON)) {
			if (strcmp(name, "gnu") == 0)
				prefix = PREFIXGNU;
			else
				prefix = 0;
			name = strip(expect(TIDENT, "after attribute prefix"));
		} else {
			prefix = PREFIXNONE;
		}
	}
	kind = 0;
	switch (prefix) {
	case PREFIXGNU:
		prefixname = "GNU ";
		if (strcmp(name, "aligned") == 0) {
			kind = ATTRALIGNED;
			if (consume(TLPAREN)) {
				unsigned long long i;

				i = intconstexpr(&filescope, false);
				if (!i || i & i - 1 || i > INT_MAX)
					error(&tok.loc, "invalid alignment %llu", i);
				if (a)
					a->align = i;
				expect(TRPAREN, "after alignment");
			} else {
				if (a)
					a->align = 16;
			}
		} else if (strcmp(name, "constructor") == 0) {
			kind = ATTRCONSTRUCTOR;
		} else if (strcmp(name, "destructor") == 0) {
			kind = ATTRDESTRUCTOR;
		} else if (strcmp(name, "packed") == 0) {
			kind = ATTRPACKED;
		}
		break;
	}
	if (kind) {
		if (!(kind & allowed))
			error(&tok.loc, "%sattribute '%s' is not supported here", prefixname, name);
		if (a)
			a->kind |= kind;
	} else if (consume(TLPAREN)) {
		/* skip arguments */
		for (paren = 1; paren > 0; next()) {
			switch (tok.kind) {
			case TLPAREN: ++paren; break;
			case TRPAREN: --paren; break;
			}
		}
	}
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
leaq 0x1754a(%rip), %rax     # 0x1aaf3
movq %rax, -0x28(%rbp)
leaq 0x1ebf4(%rip), %rax     # 0x221a8
cmpl $0x4, (%rax)
je 0x35c2
movb $0x0, -0x1(%rbp)
jmp 0x3825
leaq 0x1ebdf(%rip), %rax     # 0x221a8
movq 0x20(%rax), %rdi
callq 0x3830
movq %rax, -0x20(%rbp)
callq 0xd540
cmpl $0x0, -0x18(%rbp)
jne 0x363e
movl $0x60, %edi
callq 0xd910
testb $0x1, %al
jne 0x35f1
jmp 0x3635
movq -0x20(%rbp), %rdi
leaq 0x14a23(%rip), %rsi     # 0x1801f
callq 0x3160
cmpl $0x0, %eax
jne 0x360f
movl $0x2, -0x18(%rbp)
jmp 0x3616
movl $0x0, -0x18(%rbp)
movl $0x4, %edi
leaq 0x14a01(%rip), %rsi     # 0x18023
callq 0xd8d0
movq %rax, %rdi
callq 0x3830
movq %rax, -0x20(%rbp)
jmp 0x363c
movl $0x1, -0x18(%rbp)
jmp 0x363e
movl $0x0, -0x2c(%rbp)
movl -0x18(%rbp), %eax
subl $0x2, %eax
jne 0x3780
jmp 0x3653
leaq 0x149e0(%rip), %rax     # 0x1803a
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x149d6(%rip), %rsi     # 0x1803f
callq 0x3160
cmpl $0x0, %eax
jne 0x3720
movl $0x1, -0x2c(%rbp)
movl $0x42, %edi
callq 0xd910
testb $0x1, %al
jne 0x368e
jmp 0x370a
leaq 0x1eaab(%rip), %rdi     # 0x22140
xorl %esi, %esi
callq 0x90c0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x36c6
movq -0x38(%rbp), %rax
movq -0x38(%rbp), %rcx
subq $0x1, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
jne 0x36c6
cmpq $0x7fffffff, -0x38(%rbp) # imm = 0x7FFFFFFF
jbe 0x36e3
movq -0x38(%rbp), %rdx
leaq 0x1ead7(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x1496b(%rip), %rsi     # 0x18047
movb $0x0, %al
callq 0x11190
cmpq $0x0, -0x10(%rbp)
je 0x36f7
movq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movl $0x43, %edi
leaq 0x1495b(%rip), %rsi     # 0x1805e
callq 0xd8d0
jmp 0x371e
cmpq $0x0, -0x10(%rbp)
je 0x371c
movq -0x10(%rbp), %rax
movl $0x10, 0x4(%rax)
jmp 0x371e
jmp 0x377e
movq -0x20(%rbp), %rdi
leaq 0x14943(%rip), %rsi     # 0x1806e
callq 0x3160
cmpl $0x0, %eax
jne 0x373e
movl $0x2, -0x2c(%rbp)
jmp 0x377c
movq -0x20(%rbp), %rdi
leaq 0x14931(%rip), %rsi     # 0x1807a
callq 0x3160
cmpl $0x0, %eax
jne 0x375c
movl $0x4, -0x2c(%rbp)
jmp 0x377a
movq -0x20(%rbp), %rdi
leaq 0x1491e(%rip), %rsi     # 0x18085
callq 0x3160
cmpl $0x0, %eax
jne 0x3778
movl $0x8, -0x2c(%rbp)
jmp 0x377a
jmp 0x377c
jmp 0x377e
jmp 0x3780
cmpl $0x0, -0x2c(%rbp)
je 0x37c6
movl -0x2c(%rbp), %eax
andl -0x14(%rbp), %eax
cmpl $0x0, %eax
jne 0x37b2
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0x1ea08(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0x148e1(%rip), %rsi     # 0x1808c
movb $0x0, %al
callq 0x11190
cmpq $0x0, -0x10(%rbp)
je 0x37c4
movl -0x2c(%rbp), %ecx
movq -0x10(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x3821
movl $0x42, %edi
callq 0xd910
testb $0x1, %al
jne 0x37d6
jmp 0x381f
movl $0x1, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jle 0x381d
leaq 0x1e9be(%rip), %rax     # 0x221a8
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
subl $0x42, %eax
je 0x3800
jmp 0x37f6
movl -0x3c(%rbp), %eax
subl $0x43, %eax
je 0x380b
jmp 0x3814
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x3814
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x3816
callq 0xd540
jmp 0x37dd
jmp 0x381f
jmp 0x3821
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq