// File: /workspace/github_c_makefile_star2_O1/lucvoo[P]sparse-dev/parse.c
// Function: declaration_specifiers
static struct token *declaration_specifiers(struct token *token, struct decl_state *ctx)
{
	int seen = 0;
	int class = CInt;
	int rank = 0;

	while (token_type(token) == TOKEN_IDENT) {
		struct symbol *s = lookup_symbol(token->ident,
						 NS_TYPEDEF | NS_SYMBOL);
		if (!s || !(s->namespace & NS_TYPEDEF))
			break;
		if (s->type != SYM_KEYWORD) {
			if (seen & Set_Any)
				break;
			seen |= Set_S | Set_T;
			ctx->ctype.base_type = s->ctype.base_type;
			apply_ctype(token->pos, &ctx->ctype, &s->ctype);
			token = token->next;
			continue;
		}
		if (s->op->type & KW_SPECIFIER) {
			if (seen & s->op->test) {
				specifier_conflict(token->pos,
						   seen & s->op->test,
						   token->ident);
				break;
			}
			seen |= s->op->set;
			class += s->op->class;
			if (s->op->set & Set_Int128)
				rank = 3;
			else if (s->op->set & Set_Char)
				rank = -2;
			if (s->op->set & (Set_Short|Set_Float)) {
				rank = -1;
			} else if (s->op->set & Set_Long && rank++) {
				if (class == CReal) {
					specifier_conflict(token->pos,
							   Set_Vlong,
							   &double_ident);
					break;
				}
				seen |= Set_Vlong;
			}
		}
		token = token->next;
		if (s->op->declarator)	// Note: this eats attributes
			token = s->op->declarator(token, s, ctx);
		if (s->op->type & KW_EXACT) {
			ctx->ctype.base_type = s->ctype.base_type;
			ctx->ctype.modifiers |= s->ctype.modifiers;
		}
	}

	if (!(seen & Set_S)) {	/* not set explicitly? */
		struct symbol *base = &incomplete_ctype;
		if (seen & Set_Any)
			base = types[class][rank];
		ctx->ctype.base_type = base;
	}

	if (ctx->ctype.modifiers & MOD_BITWISE) {
		struct symbol *type;
		ctx->ctype.modifiers &= ~MOD_BITWISE;
		if (!is_int_type(ctx->ctype.base_type)) {
			sparse_error(token->pos, "invalid modifier");
			return token;
		}
		type = alloc_symbol(token->pos, SYM_BASETYPE);
		*type = *ctx->ctype.base_type;
		type->ctype.modifiers &= ~MOD_SPECIFIER;
		type->ctype.base_type = ctx->ctype.base_type;
		type->type = SYM_RESTRICT;
		ctx->ctype.base_type = type;
		create_fouled(type);
	}
	return token;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %r15d, %r15d
movl $0x0, 0x4(%rsp)
xorl %r12d, %r12d
movl (%rbx), %eax
andl $0x3f, %eax
cmpl $0x3, %eax
jne 0x199a7
movq 0x10(%rbx), %rdi
movl $0x12, %esi
callq 0x2b511
movb $0x1, %r13b
testq %rax, %rax
je 0x198f7
movq %rax, %rbp
movl (%rax), %eax
btl $0x9, %eax
jae 0x198f7
cmpb $0xf, %al
jne 0x198b4
movq 0x40(%rbp), %rax
testb $0x1, (%rax)
jne 0x198e3
movq 0x8(%rbx), %rbx
movq 0x28(%rax), %rax
testq %rax, %rax
je 0x19899
movq %rbx, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq *%rax
movq %rax, %rbx
movq 0x40(%rbp), %rax
testb $0x2, 0x1(%rax)
je 0x198de
movq 0x60(%rbp), %rax
movq %rax, (%r14)
movq 0x68(%rbp), %rax
orq %rax, 0x8(%r14)
jmp 0x198de
testl $0x3c1, %r15d           # imm = 0x3C1
jne 0x198f7
orl $0x3, %r15d
movq %rbp, %rdx
addq $0x60, %rdx
movq 0x60(%rbp), %rax
movq %rax, (%r14)
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x1b893
movq 0x8(%rbx), %rbx
xorl %r13d, %r13d
jmp 0x198f7
movl 0x58(%rax), %esi
andl %r15d, %esi
je 0x19905
movq (%rbx), %rdi
movq 0x10(%rbx), %rdx
callq 0x1df09
testb %r13b, %r13b
je 0x1983a
jmp 0x199a7
movl 0x5c(%rax), %ecx
orl %ecx, %r15d
movl 0x4(%rsp), %edx
addl 0x60(%rax), %edx
movl %edx, 0x4(%rsp)
testb $0x4, %cl
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
cmovnel %edx, %r12d
btl $0xb, %ecx
movl %r12d, %edx
movl $0x3, %esi
cmovbl %esi, %edx
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testl $0x120, %ecx            # imm = 0x120
jne 0x1987e
btl $0x9, %ecx
jb 0x19951
movl %edx, %r12d
jmp 0x1987e
leal 0x1(%rdx), %r12d
testl %edx, %edx
je 0x1987e
cmpl $0x3, 0x4(%rsp)
jne 0x1999b
movq (%rbx), %rbp
leaq 0x4b68a(%rip), %rdi     # 0x64ff8
callq 0x2e465
movq %rbp, %rdi
leaq 0x2c92a(%rip), %rsi     # 0x462a7
leaq 0x32431(%rip), %rdx     # 0x4bdb5
movq %rax, %rcx
xorl %eax, %eax
callq 0x11a38
movl $0x3, 0x4(%rsp)
jmp 0x198f7
orl $0x400, %r15d           # imm = 0x400
jmp 0x1987e
testb $0x2, %r15b
jne 0x199d9
testl $0x3c1, %r15d           # imm = 0x3C1
je 0x199cf
movslq 0x4(%rsp), %rax
leaq 0x3fe1e(%rip), %rcx     # 0x597e0
movq (%rcx,%rax,8), %rax
movslq %r12d, %rcx
movq (%rax,%rcx,8), %rax
jmp 0x199d6
leaq 0x53d22(%rip), %rax     # 0x6d6f8
movq %rax, (%r14)
movq 0x8(%r14), %rax
btl $0x19, %eax
jae 0x19a62
andq $-0x2000001, %rax       # imm = 0xFDFFFFFF
movq %rax, 0x8(%r14)
movq (%r14), %rax
cmpb $0x3, (%rax)
jne 0x199f9
movq 0x60(%rax), %rax
cmpb $0x9, (%rax)
jne 0x19a02
movq 0x60(%rax), %rax
cmpb $0xb, (%rax)
je 0x19a27
movq 0x60(%rax), %rax
cmpq 0x4756e(%rip), %rax     # 0x60f80
je 0x19a27
movq (%rbx), %rdi
leaq 0x2c878(%rip), %rsi     # 0x46296
xorl %eax, %eax
callq 0x11a38
jmp 0x19a62
movq (%rbx), %rdi
movl $0x2, %esi
callq 0x2b547
movq %rax, %r15
movq (%r14), %rsi
movl $0xe0, %edx
movq %rax, %rdi
callq 0xe1e0
andb $0x1f, 0x69(%r15)
movq (%r14), %rax
movq %rax, 0x60(%r15)
movb $0xd, (%r15)
movq %r15, (%r14)
movq %r15, %rdi
callq 0x2bfd5
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq