// File: /workspace/github_c_makefile_star2_O3/Oric4ever[P]lcc65/6502/build/../src/decl.c
// Function: dclr1
static Type dclr1(char **id, int lev) {
	Type ty = 0;

	switch (t) {
	case ID:
		if (id)
			*id = token;
		else
			error("extraneous identifier `%s'\n", token);
		t = gettok();
		break;
	case '*':
		t = gettok();
		if (t == CONST || t == VOLATILE) {
			Type ty1;
			ty1 = ty = tnode(t, 0);
			while ((t = gettok()) == CONST || t == VOLATILE)
				ty1 = tnode(t, ty1);
			ty->type = dclr1(id, lev);
			ty = ty1;
		} else
			ty = dclr1(id, lev);
		ty = tnode(POINTER, ty);
		break;
	case '(':
		t = gettok();
		if (kind[t] == CHAR || t == ID && tsym && tsym->sclass == TYPEDEF) {
			ty = tnode(FUNCTION, ty);
			ty->u.proto = parameters(lev);
			{ foreach(identifiers, level, checkparam, (Generic)0); exitscope(); }
		} else {
			ty = dclr1(id, lev);
			expect(')');
			if (ty == 0 && id == 0)
				return tnode(FUNCTION, ty);
		}
		break;
	case '[':
		break;
	default:
		return ty;
	}
	while (t == '(' || t == '[')
		if (t == '(') {
			t = gettok();
			ty = tnode(FUNCTION, ty);
			ty->u.proto = parameters(lev);
			if (lev == 0 && funcdclr == 0)
				funcdclr++;
			else
				{ foreach(identifiers, level, checkparam, (Generic)0); exitscope(); }
		} else {
			int n = 0;
			t = gettok();
			if (kind[t] == ID) {
				n = intexpr(']', 1);
				if (n <= 0) {
					error("`%d' is an illegal array size\n", n);
					n = 1;
				}
			} else
				expect(']');
			ty = tnode(ARRAY, ty);
			ty->size = n;
		}
	return ty;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r12
leaq 0x24d26(%rip), %r15     # 0x2c9e0
movl (%r15), %eax
xorl %r14d, %r14d
cmpl $0x29, %eax
jg 0x7d19
cmpl $0x20, %eax
je 0x7d2c
cmpl $0x28, %eax
jne 0x80d7
callq 0xe195
movl %eax, (%r15)
movl %eax, %ecx
leaq 0x2189c(%rip), %rdx     # 0x29580
cmpb $0x3, (%rdx,%rcx)
jne 0x7d90
leaq 0x22a83(%rip), %rax     # 0x2a778
movq (%rax), %rax
movl $0x28, (%rax)
movq 0x8(%rax), %r14
leaq 0x28(%r14), %rcx
cmpq 0x10(%rax), %rcx
jae 0x7e32
movq %rcx, 0x8(%rax)
jmp 0x7e46
cmpl $0x2a, %eax
je 0x7d48
cmpl $0x5b, %eax
je 0x7f6e
jmp 0x80d7
leaq 0x24c15(%rip), %rax     # 0x2c948
movq (%rax), %rsi
testq %r12, %r12
je 0x7e14
movq %rsi, (%r12)
jmp 0x7e22
callq 0xe195
movl %eax, %r13d
movl %eax, (%r15)
leal -0xf(%r13), %eax
cmpl $0x1, %eax
ja 0x7e02
leaq 0x22a11(%rip), %r14     # 0x2a778
movq (%r14), %rax
movl $0x28, (%rax)
movq 0x8(%rax), %rbp
leaq 0x28(%rbp), %rcx
cmpq 0x10(%rax), %rcx
movq %r12, 0x10(%rsp)
jae 0x7e8b
movq %rcx, 0x8(%rax)
jmp 0x7e9f
cmpl $0x20, %eax
sete %cl
leaq 0x24bb3(%rip), %rax     # 0x2c950
movq (%rax), %rax
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x7db7
cmpb $0x53, 0x1a(%rax)
je 0x7cee
movq %r12, %rdi
movl %ebx, %esi
callq 0x7ca0
movq %rax, %r14
movl $0x29, %edi
callq 0x9869
orq %r14, %r12
jne 0x7f6e
leaq 0x2299a(%rip), %rax     # 0x2a778
movq (%rax), %rax
movl $0x28, (%rax)
movq 0x8(%rax), %r14
leaq 0x28(%r14), %rcx
cmpq 0x10(%rax), %rcx
jae 0x80b4
movq %rcx, 0x8(%rax)
jmp 0x80c8
movq %r12, %rdi
movl %ebx, %esi
callq 0x7ca0
movq %rax, %r12
jmp 0x7f2b
leaq 0x16d30(%rip), %rdi     # 0x1eb4b
xorl %eax, %eax
callq 0x974c
callq 0xe195
movl %eax, (%r15)
xorl %r14d, %r14d
jmp 0x7f6e
leaq 0x2293f(%rip), %rsi     # 0x2a778
movl $0x28, %edi
callq 0x17800
movq %rax, %r14
movl $0xb, (%r14)
movq $0x0, 0x10(%r14)
movl %ebx, %edi
callq 0x80e9
movq %rax, 0x18(%r14)
leaq 0x22481(%rip), %rax     # 0x2a2e8
movq (%rax), %rdi
leaq 0x27ebf(%rip), %rax     # 0x2fd30
movl (%rax), %esi
leaq -0x41b(%rip), %rdx      # 0x7a5f
xorl %ecx, %ecx
callq 0x17170
callq 0x16f80
jmp 0x7f6e
leaq 0x228e6(%rip), %rsi     # 0x2a778
movl $0x28, %edi
callq 0x17800
movq %rax, %rbp
movl %r13d, (%rbp)
movq $0x0, 0x10(%rbp)
callq 0xe195
movq %rbp, %r12
movl %eax, %ebp
movl %eax, (%r15)
leal -0xf(%rbp), %eax
movq %r12, 0x8(%rsp)
cmpl $0x1, %eax
ja 0x7f16
movq 0x8(%rsp), %r13
movq (%r14), %rax
movl $0x28, (%rax)
movq 0x8(%rax), %r12
leaq 0x28(%r12), %rcx
cmpq 0x10(%rax), %rcx
jae 0x7ee8
movq %rcx, 0x8(%rax)
jmp 0x7ef8
movl $0x28, %edi
movq %r14, %rsi
callq 0x17800
movq %rax, %r12
movl %ebp, (%r12)
movq %r13, 0x10(%r12)
callq 0xe195
movl %eax, %ebp
movl %eax, (%r15)
addl $-0xf, %eax
movq %r12, %r13
cmpl $0x2, %eax
jb 0x7eca
movq 0x10(%rsp), %rdi
movl %ebx, %esi
callq 0x7ca0
movq 0x8(%rsp), %rcx
movq %rax, 0x10(%rcx)
leaq 0x22846(%rip), %rax     # 0x2a778
movq (%rax), %rax
movl $0x28, (%rax)
movq 0x8(%rax), %r14
leaq 0x28(%r14), %rcx
cmpq 0x10(%rax), %rcx
jae 0x7f4f
movq %rcx, 0x8(%rax)
jmp 0x7f63
leaq 0x22822(%rip), %rsi     # 0x2a778
movl $0x28, %edi
callq 0x17800
movq %rax, %r14
movl $0x7, (%r14)
movq %r12, 0x10(%r14)
leaq 0x2160b(%rip), %r13     # 0x29580
leaq 0x227fc(%rip), %r12     # 0x2a778
movl (%r15), %eax
cmpl $0x5b, %eax
je 0x7fba
cmpl $0x28, %eax
jne 0x80d7
callq 0xe195
movl %eax, (%r15)
movq (%r12), %rax
movl $0x28, (%rax)
movq 0x8(%rax), %rbp
leaq 0x28(%rbp), %rcx
cmpq 0x10(%rax), %rcx
jae 0x8044
movq %rcx, 0x8(%rax)
jmp 0x8054
callq 0xe195
movl %eax, (%r15)
movl %eax, %eax
cmpb $0x20, (%r13,%rax)
jne 0x7ff8
movl $0x5d, %edi
movl $0x1, %esi
callq 0xb2a5
movl %eax, %ebp
testl %eax, %eax
jg 0x8004
leaq 0x16b7f(%rip), %rdi     # 0x1eb67
movl %ebp, %esi
xorl %eax, %eax
callq 0x974c
movl $0x1, %ebp
jmp 0x8004
movl $0x5d, %edi
callq 0x9869
xorl %ebp, %ebp
movq (%r12), %rcx
movl $0x28, (%rcx)
movq 0x8(%rcx), %rax
leaq 0x28(%rax), %rdx
cmpq 0x10(%rcx), %rdx
jae 0x8022
movq %rdx, 0x8(%rcx)
jmp 0x802f
movl $0x28, %edi
movq %r12, %rsi
callq 0x17800
movl $0xc, (%rax)
movq %r14, 0x10(%rax)
movl %ebp, 0x8(%rax)
movq %rax, %r14
jmp 0x7f7c
movl $0x28, %edi
movq %r12, %rsi
callq 0x17800
movq %rax, %rbp
movl $0xb, (%rbp)
movq %r14, 0x10(%rbp)
movl %ebx, %edi
callq 0x80e9
movq %rax, 0x18(%rbp)
testl %ebx, %ebx
jne 0x8086
testb $0x1, 0x2282f(%rip)     # 0x2a8a4
jne 0x8086
movb $0x1, 0x22826(%rip)     # 0x2a8a4
movq %rbp, %r14
jmp 0x7f7c
leaq 0x2225b(%rip), %rax     # 0x2a2e8
movq (%rax), %rdi
leaq 0x27c99(%rip), %rax     # 0x2fd30
movl (%rax), %esi
leaq -0x641(%rip), %rdx      # 0x7a5f
xorl %ecx, %ecx
callq 0x17170
callq 0x16f80
movq %rbp, %r14
jmp 0x7f7c
leaq 0x226bd(%rip), %rsi     # 0x2a778
movl $0x28, %edi
callq 0x17800
movq %rax, %r14
movl $0xb, (%r14)
movq $0x0, 0x10(%r14)
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq