// File: /workspace/github_c_makefile_star2_O0/Oric4ever[P]lcc65/6502/build/../src/decl.c
// Function: type
static Type type(int lev, int *sclass) {
	int cls, cons, *p, sign, size, tt, type, vol;
	Type ty = 0;

	if (sclass == 0)
		cls = AUTO;
	else
		*sclass = 0;
	for (vol = cons = sign = size = type = 0;;) {
		p = &type;
		tt = t;
		switch (t) {
		case AUTO: case REGISTER: case STATIC:
		case EXTERN: case TYPEDEF:
			p = sclass ? sclass : &cls;
			break;
		case CONST:
			p = &cons;
			break;
		case VOLATILE:
			p = &vol;
			break;
		case SIGNED: case UNSIGNED:
			p = &sign;
			break;
		case LONG: case SHORT:
			p = &size;
			break;
		case VOID: case CHAR: case INT: case FLOAT: case DOUBLE:
			ty = tsym->type;
			break;
		case ENUM:
			ty = enumdecl();
			break;
		case STRUCT: case UNION:
			ty = structdcl(t);
			break;
		case ID:
			if (tsym && tsym->sclass == TYPEDEF
			&& type == 0 && size == 0 && sign == 0) {
				use(tsym, src);
				ty = tsym->type;
				t = tt = ty->op;
				break;
			}
			/* fall through */
		default:
			p = 0;
		}
		if (p == 0)
			break;
		if (*p)
			error("invalid use of `%k'\n", tt);
		*p = tt;
		if (t == tt)
			t = gettok();
	}
	if (sclass && *sclass
	&& (lev == 0
	||  lev == PARAM  && *sclass != REGISTER
	||  lev == GLOBAL && *sclass == REGISTER))
		error("invalid use of `%k'\n", *sclass);
	if (type == 0) {
		type = INT;
		ty = inttype;
	}
	if (size == SHORT && type != INT
	||  size == LONG  && type != INT && type != DOUBLE
	||  sign && type != INT && type != CHAR)
		error("invalid type specification\n");
	if (type == CHAR && sign)
		ty = sign == UNSIGNED ? unsignedchar : signedchar;
	else if (size == SHORT)
		ty = sign == UNSIGNED ? unsignedshort : shorttype;
	else if (size == LONG && type == DOUBLE)
		ty = longdouble;
	else if (size == LONG)
		ty = sign == UNSIGNED ? unsignedlong : longtype;
	else if (sign == UNSIGNED && type == INT)
		ty = unsignedtype;
	if (cons == CONST)
		ty = qual(CONST, ty);
	if (vol == VOLATILE)
		ty = qual(VOLATILE, ty);
	return ty;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x40(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x7f27
movl $0x43, -0x14(%rbp)
jmp 0x7f31
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x34(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x35c1d(%rip), %rax     # 0x3db80
movl (%rax), %ecx
movl %ecx, -0x2c(%rbp)
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x48(%rbp)
subl $0x52, %eax
ja 0x80a5
movq -0x48(%rbp), %rax
leaq 0x272ea(%rip), %rcx     # 0x2f270
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x0, -0x10(%rbp)
je 0x7fa0
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x7faa
leaq -0x14(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x7faa
movq -0x50(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x80ad
leaq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x80ad
leaq -0x34(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x80ad
leaq -0x24(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x80ad
leaq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x80ad
leaq 0x35afe(%rip), %rax     # 0x3daf0
movq (%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x80ad
callq 0x9510
movq %rax, -0x40(%rbp)
jmp 0x80ad
leaq 0x35b69(%rip), %rax     # 0x3db80
movl (%rax), %edi
callq 0x9a70
movq %rax, -0x40(%rbp)
jmp 0x80ad
leaq 0x35ac2(%rip), %rax     # 0x3daf0
cmpq $0x0, (%rax)
je 0x80a3
leaq 0x35ab5(%rip), %rax     # 0x3daf0
movq (%rax), %rax
movzbl 0x1a(%rax), %eax
cmpl $0x53, %eax
jne 0x80a3
cmpl $0x0, -0x30(%rbp)
jne 0x80a3
cmpl $0x0, -0x28(%rbp)
jne 0x80a3
cmpl $0x0, -0x24(%rbp)
jne 0x80a3
leaq 0x35a90(%rip), %rax     # 0x3daf0
movq (%rax), %rdi
leaq 0x35a6e(%rip), %rax     # 0x3dad8
movq (%rax), %rsi
leaq 0x35a64(%rip), %rax     # 0x3dad8
movq 0x8(%rax), %rdx
callq 0x252c0
leaq 0x35a6c(%rip), %rax     # 0x3daf0
movq (%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl (%rax), %ecx
movl %ecx, -0x2c(%rbp)
leaq 0x35ae1(%rip), %rax     # 0x3db80
movl %ecx, (%rax)
jmp 0x80ad
jmp 0x80a5
movq $0x0, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x80b6
jmp 0x80fc
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x80d0
movl -0x2c(%rbp), %esi
leaq 0x27834(%rip), %rdi     # 0x2f8fd
movb $0x0, %al
callq 0xd530
movl -0x2c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
leaq 0x35aa0(%rip), %rax     # 0x3db80
movl (%rax), %eax
cmpl -0x2c(%rbp), %eax
jne 0x80f7
callq 0x15170
movl %eax, %ecx
leaq 0x35a8b(%rip), %rax     # 0x3db80
movl %ecx, (%rax)
jmp 0x7f54
cmpq $0x0, -0x10(%rbp)
je 0x8144
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8144
cmpl $0x0, -0x4(%rbp)
je 0x8130
cmpl $0x4, -0x4(%rbp)
jne 0x8121
movq -0x10(%rbp), %rax
cmpl $0x4e, (%rax)
jne 0x8130
cmpl $0x3, -0x4(%rbp)
jne 0x8144
movq -0x10(%rbp), %rax
cmpl $0x4e, (%rax)
jne 0x8144
movq -0x10(%rbp), %rax
movl (%rax), %esi
leaq 0x277c0(%rip), %rdi     # 0x2f8fd
movb $0x0, %al
callq 0xd530
cmpl $0x0, -0x30(%rbp)
jne 0x815f
movl $0x5, -0x30(%rbp)
leaq 0x3c0a0(%rip), %rax     # 0x441f8
movq (%rax), %rax
movq %rax, -0x40(%rbp)
cmpl $0x4, -0x28(%rbp)
jne 0x816b
cmpl $0x5, -0x30(%rbp)
jne 0x818f
cmpl $0xe, -0x28(%rbp)
jne 0x817d
cmpl $0x5, -0x30(%rbp)
je 0x817d
cmpl $0x2, -0x30(%rbp)
jne 0x818f
cmpl $0x0, -0x24(%rbp)
je 0x819d
cmpl $0x5, -0x30(%rbp)
je 0x819d
cmpl $0x3, -0x30(%rbp)
je 0x819d
leaq 0x2777c(%rip), %rdi     # 0x2f912
movb $0x0, %al
callq 0xd530
cmpl $0x3, -0x30(%rbp)
jne 0x81da
cmpl $0x0, -0x24(%rbp)
je 0x81da
cmpl $0x6, -0x24(%rbp)
jne 0x81bf
leaq 0x3c06a(%rip), %rax     # 0x44220
movq (%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x81cd
leaq 0x3c052(%rip), %rax     # 0x44218
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x8280
cmpl $0x4, -0x28(%rbp)
jne 0x820e
cmpl $0x6, -0x24(%rbp)
jne 0x81f6
leaq 0x3c043(%rip), %rax     # 0x44230
movq (%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x8204
leaq 0x3c013(%rip), %rax     # 0x44210
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x827e
cmpl $0xe, -0x28(%rbp)
jne 0x822a
cmpl $0x2, -0x30(%rbp)
jne 0x822a
leaq 0x3bfdf(%rip), %rax     # 0x44200
movq (%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x827c
cmpl $0xe, -0x28(%rbp)
jne 0x825e
cmpl $0x6, -0x24(%rbp)
jne 0x8246
leaq 0x3bfeb(%rip), %rax     # 0x44228
movq (%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x8254
leaq 0x3bfbb(%rip), %rax     # 0x44208
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x827a
cmpl $0x6, -0x24(%rbp)
jne 0x8278
cmpl $0x5, -0x30(%rbp)
jne 0x8278
leaq 0x3bfc7(%rip), %rax     # 0x44238
movq (%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x827a
jmp 0x827c
jmp 0x827e
jmp 0x8280
cmpl $0xf, -0x18(%rbp)
jne 0x8298
movq -0x40(%rbp), %rsi
movl $0xf, %edi
callq 0x27a70
movq %rax, -0x40(%rbp)
cmpl $0x10, -0x34(%rbp)
jne 0x82b0
movq -0x40(%rbp), %rsi
movl $0x10, %edi
callq 0x27a70
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)