// File: /workspace/github_c_makefile_star2_O2/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 %r12d, %r12d
pushq $0x12
popq %rbp
movl $0x0, (%rsp)
movl $0x0, 0x4(%rsp)
movl %r12d, %r13d
orl $0x3, %r13d
movl (%rbx), %eax
andl $0x3f, %eax
cmpl $0x3, %eax
jne 0x17813
movq 0x10(%rbx), %rdi
movl %ebp, %esi
callq 0x266e9
testq %rax, %rax
je 0x17813
movq %rax, %r15
movl (%rax), %eax
btl $0x9, %eax
jae 0x17813
cmpb $0xf, %al
je 0x17755
testw $0x3c1, %r12w           # imm = 0x3C1
jne 0x17813
movq %r15, %rdx
addq $0x60, %rdx
movq 0x60(%r15), %rax
movq %rax, (%r14)
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x194b8
movq 0x8(%rbx), %rbx
movl %r13d, %r12d
jmp 0x176f2
movq 0x40(%r15), %rcx
movl (%rcx), %eax
testb $0x1, %al
jne 0x17765
movl 0x4(%rsp), %esi
jmp 0x177c0
movl 0x58(%rcx), %esi
andl %r12d, %esi
jne 0x17807
movl 0x5c(%rcx), %edx
movl (%rsp), %esi
addl 0x60(%rcx), %esi
movl %esi, (%rsp)
orl %edx, %r12d
testb $0x4, %dl
movl 0x4(%rsp), %esi
pushq $-0x2
popq %rdi
cmovnel %edi, %esi
btl $0xb, %edx
pushq $0x3
popq %rdi
cmovbl %edi, %esi
testw $0x120, %dx             # imm = 0x120
je 0x177a3
pushq $-0x1
popq %rsi
jmp 0x177c0
btl $0x9, %edx
jae 0x177c0
testl %esi, %esi
je 0x17803
incl %esi
cmpl $0x3, (%rsp)
je 0x178c0
orl $0x400, %r12d           # imm = 0x400
movl %esi, 0x4(%rsp)
movq 0x8(%rbx), %rbx
movq 0x28(%rcx), %rcx
testq %rcx, %rcx
je 0x177e5
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq *%rcx
movq %rax, %rbx
movq 0x40(%r15), %rax
movl (%rax), %eax
btl $0x9, %eax
jae 0x176eb
movq 0x60(%r15), %rax
movq %rax, (%r14)
movq 0x68(%r15), %rax
orq %rax, 0x8(%r14)
jmp 0x176eb
pushq $0x1
jmp 0x177a0
movq (%rbx), %rdi
movq 0x10(%rbx), %rdx
callq 0x1b81f
testb $0x2, %r12b
jne 0x17845
testw $0x3c1, %r12w           # imm = 0x3C1
je 0x1783b
movslq (%rsp), %rax
leaq 0x3afc4(%rip), %rcx     # 0x527f0
movq (%rcx,%rax,8), %rax
movslq 0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rax
jmp 0x17842
leaq 0x4eeb6(%rip), %rax     # 0x666f8
movq %rax, (%r14)
movq 0x8(%r14), %rax
btl $0x19, %eax
jae 0x178ae
andq $-0x2000001, %rax       # imm = 0xFDFFFFFF
movq %rax, 0x8(%r14)
movq (%r14), %rdi
callq 0x19e3c
movq (%rbx), %rdi
testl %eax, %eax
je 0x178a0
pushq $0x2
popq %rsi
callq 0x2671f
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 0x270f4
jmp 0x178ae
leaq 0x26a0f(%rip), %rsi     # 0x3e2b6
xorl %eax, %eax
callq 0x1120e
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %esi, 0x4(%rsp)
movq (%rbx), %rdi
leaq 0x4672a(%rip), %rdx     # 0x5dff8
movl $0x400, %esi            # imm = 0x400
callq 0x1b81f
pushq $0x3
popq %rax
movl %eax, (%rsp)
jmp 0x17813