// File: /workspace/github_c_makefile_star2_O3/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
movl (%rdi), %eax
andl $0x3f, %eax
leaq 0x52f88(%rip), %rcx     # 0x6c6f8
cmpl $0x3, %eax
jne 0x198c8
xorl %ebp, %ebp
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x10(%rbx), %rdi
movl $0x12, %esi
callq 0x2afd5
testq %rax, %rax
je 0x1989b
movq %rax, %r15
movl (%rax), %eax
btl $0x9, %eax
jae 0x1989b
cmpb $0xf, %al
jne 0x197f5
movq 0x40(%r15), %rcx
movl (%rcx), %eax
testb $0x1, %al
je 0x19849
movl 0x58(%rcx), %esi
andl %r13d, %esi
jne 0x1988f
movl 0x5c(%rcx), %edx
addl 0x60(%rcx), %r12d
orl %edx, %r13d
testb $0x4, %dl
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
cmovnel %esi, %ebp
btl $0xb, %edx
movl $0x3, %esi
cmovbl %esi, %ebp
testl $0x120, %edx            # imm = 0x120
je 0x19825
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x19849
testl $0x3c1, %r13d           # imm = 0x3C1
jne 0x1989b
orl $0x3, %r13d
movq %r15, %rdx
addq $0x60, %rdx
movq 0x60(%r15), %rax
movq %rax, (%r14)
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x1b7b3
movq 0x8(%rbx), %rbx
jmp 0x1987f
btl $0x9, %edx
jae 0x19849
testl %ebp, %ebp
je 0x19844
incl %ebp
cmpl $0x3, %r12d
je 0x19973
orl $0x400, %r13d           # imm = 0x400
jmp 0x19849
movl $0x1, %ebp
movq 0x8(%rbx), %rbx
movq 0x28(%rcx), %rcx
testq %rcx, %rcx
je 0x1986a
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 0x1987f
movq 0x60(%r15), %rax
movq %rax, (%r14)
movq 0x68(%r15), %rax
orq %rax, 0x8(%r14)
movl (%rbx), %eax
andl $0x3f, %eax
cmpl $0x3, %eax
je 0x19781
jmp 0x1989b
movq (%rbx), %rdi
movq 0x10(%rbx), %rdx
callq 0x1e00f
testb $0x2, %r13b
jne 0x198cb
testl $0x3c1, %r13d           # imm = 0x3C1
je 0x198c1
movslq %r12d, %rax
leaq 0x3ef3c(%rip), %rcx     # 0x587f0
movq (%rcx,%rax,8), %rax
movslq %ebp, %rcx
movq (%rax,%rcx,8), %rcx
jmp 0x198c8
leaq 0x52e30(%rip), %rcx     # 0x6c6f8
movq %rcx, (%r14)
movq 0x8(%r14), %rax
btl $0x19, %eax
jae 0x19961
andq $-0x2000001, %rax       # imm = 0xFDFFFFFF
movq %rax, 0x8(%r14)
movq (%r14), %rax
movzbl (%rax), %ecx
cmpl $0x3, %ecx
jne 0x198f5
movq 0x60(%rax), %rax
movzbl (%rax), %ecx
cmpl $0x9, %ecx
jne 0x19901
movq 0x60(%rax), %rax
movzbl (%rax), %ecx
cmpl $0xb, %ecx
je 0x19926
movq 0x60(%rax), %rax
cmpq 0x46677(%rip), %rax     # 0x5ff88
je 0x19926
movq (%rbx), %rdi
leaq 0x2b939(%rip), %rsi     # 0x45256
xorl %eax, %eax
callq 0x11a80
jmp 0x19961
movq (%rbx), %rdi
movl $0x2, %esi
callq 0x2b00b
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 0x2baa9
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %r15
leaq 0x4a67b(%rip), %rdi     # 0x63ff8
callq 0x2de35
leaq 0x2b8de(%rip), %rsi     # 0x45267
leaq 0x31395(%rip), %rdx     # 0x4ad25
movq %r15, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x11a80
movl $0x3, %r12d
jmp 0x1989b