// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x18c41(%rip), %rbx     # 0x1c108
movl (%rbx), %r13d
cmpl $0x4, %r13d
jne 0x36d5
movl %edx, %r12d
movl %esi, %ebp
movq %rdi, %r14
movq 0x20(%rbx), %rdi
callq 0x36eb
movq %rax, %r15
callq 0x9c1e
cmpl $0x2, %r12d
je 0x353d
testl %r12d, %r12d
jne 0x3595
pushq $0x60
popq %rdi
callq 0xa28d
testb %al, %al
je 0x3595
leaq 0xdb0c(%rip), %rsi      # 0x1101f
movq %r15, %rdi
callq 0x3140
movl %eax, %r12d
leaq 0xdafe(%rip), %rsi      # 0x11023
pushq $0x4
popq %rdi
callq 0xa26e
movq %rax, %rdi
callq 0x36eb
testl %r12d, %r12d
jne 0x3595
movq %rax, %r15
leaq 0xdafb(%rip), %rsi      # 0x1103f
movq %r15, %rdi
callq 0x3140
testl %eax, %eax
je 0x35c9
leaq 0xdb17(%rip), %rsi      # 0x1106e
movq %r15, %rdi
callq 0x3140
testl %eax, %eax
je 0x368a
leaq 0xdb0c(%rip), %rsi      # 0x1107a
movq %r15, %rdi
callq 0x3140
testl %eax, %eax
je 0x36a1
leaq 0xdb00(%rip), %rsi      # 0x11085
movq %r15, %rdi
callq 0x3140
testl %eax, %eax
je 0x36a5
pushq $0x42
popq %rdi
callq 0xa28d
testb %al, %al
je 0x36d5
pushq $0x1
popq %rbp
testl %ebp, %ebp
jle 0x36d5
movl (%rbx), %eax
cmpl $0x43, %eax
je 0x35c0
cmpl $0x42, %eax
jne 0x35c2
incl %ebp
jmp 0x35c2
decl %ebp
callq 0x9c1e
jmp 0x35a8
pushq $0x42
popq %rdi
callq 0xa28d
testb %al, %al
je 0x368e
leaq 0x18ac0(%rip), %rdi     # 0x1c0a0
xorl %esi, %esi
callq 0x6f2d
movq %rax, %r12
testq %rax, %rax
je 0x3659
cmpq $0x7fffffff, %r12       # imm = 0x7FFFFFFF
ja 0x3659
movq %r12, %rax
shrq %rax
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
andq %rax, %rcx
movq %r12, %rax
subq %rcx, %rax
movabsq $0x3333333333333333, %rcx # imm = 0x3333333333333333
movq %rax, %rdx
andq %rcx, %rdx
shrq $0x2, %rax
andq %rcx, %rax
addq %rdx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rax, %rcx
movabsq $0xf0f0f0f0f0f0f0f, %rax # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rax, %rcx
shrq $0x38, %rcx
cmpl $0x2, %ecx
jb 0x366e
leaq 0x8(%rbx), %rdi
leaq 0xd9e3(%rip), %rsi      # 0x11047
movq %r12, %rdx
xorl %eax, %eax
callq 0xc536
testq %r14, %r14
je 0x3677
movl %r12d, 0x4(%r14)
leaq 0xd9e0(%rip), %rsi      # 0x1105e
pushq $0x43
popq %rdi
callq 0xa26e
pushq $0x1
jmp 0x36a7
pushq $0x2
jmp 0x36a7
pushq $0x1
popq %r12
testq %r14, %r14
je 0x36a9
movl $0x10, 0x4(%r14)
jmp 0x36a9
pushq $0x4
jmp 0x36a7
pushq $0x8
popq %r12
testl %ebp, %r12d
jne 0x36cd
addq $0x8, %rbx
leaq 0xd9d3(%rip), %rsi      # 0x1108c
leaq 0xd97a(%rip), %rdx      # 0x1103a
movq %rbx, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0xc536
testq %r14, %r14
je 0x36d5
orl %r12d, (%r14)
cmpl $0x4, %r13d
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq