// File: /workspace/github_c_makefile_star2_O1/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 0x23da0(%rip), %r15     # 0x2b9e0
movl (%r15), %eax
xorl %r14d, %r14d
cmpl $0x29, %eax
jg 0x7c9f
cmpl $0x20, %eax
je 0x7cb2
cmpl $0x28, %eax
jne 0x805d
callq 0xe1c6
movl %eax, (%r15)
movl %eax, %ecx
leaq 0x20916(%rip), %rdx     # 0x28580
cmpb $0x3, (%rdx,%rcx)
jne 0x7d16
leaq 0x21afd(%rip), %rax     # 0x29778
movq (%rax), %rax
movl $0x28, (%rax)
movq 0x8(%rax), %r14
leaq 0x28(%r14), %rcx
cmpq 0x10(%rax), %rcx
jae 0x7db8
movq %rcx, 0x8(%rax)
jmp 0x7dcc
cmpl $0x2a, %eax
je 0x7cce
cmpl $0x5b, %eax
je 0x7ef4
jmp 0x805d
leaq 0x23c8f(%rip), %rax     # 0x2b948
movq (%rax), %rsi
testq %r12, %r12
je 0x7d9a
movq %rsi, (%r12)
jmp 0x7da8
callq 0xe1c6
movl %eax, %r13d
movl %eax, (%r15)
leal -0xf(%r13), %eax
cmpl $0x1, %eax
ja 0x7d88
leaq 0x21a8b(%rip), %r14     # 0x29778
movq (%r14), %rax
movl $0x28, (%rax)
movq 0x8(%rax), %rbp
leaq 0x28(%rbp), %rcx
cmpq 0x10(%rax), %rcx
movq %r12, 0x10(%rsp)
jae 0x7e11
movq %rcx, 0x8(%rax)
jmp 0x7e25
cmpl $0x20, %eax
sete %cl
leaq 0x23c2d(%rip), %rax     # 0x2b950
movq (%rax), %rax
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x7d3d
cmpb $0x53, 0x1a(%rax)
je 0x7c74
movq %r12, %rdi
movl %ebx, %esi
callq 0x7c26
movq %rax, %r14
movl $0x29, %edi
callq 0x983d
orq %r14, %r12
jne 0x7ef4
leaq 0x21a14(%rip), %rax     # 0x29778
movq (%rax), %rax
movl $0x28, (%rax)
movq 0x8(%rax), %r14
leaq 0x28(%r14), %rcx
cmpq 0x10(%rax), %rcx
jae 0x803a
movq %rcx, 0x8(%rax)
jmp 0x804e
movq %r12, %rdi
movl %ebx, %esi
callq 0x7c26
movq %rax, %r12
jmp 0x7eb1
leaq 0x16daa(%rip), %rdi     # 0x1eb4b
xorl %eax, %eax
callq 0x9720
callq 0xe1c6
movl %eax, (%r15)
xorl %r14d, %r14d
jmp 0x7ef4
leaq 0x219b9(%rip), %rsi     # 0x29778
movl $0x28, %edi
callq 0x17978
movq %rax, %r14
movl $0xb, (%r14)
movq $0x0, 0x10(%r14)
movl %ebx, %edi
callq 0x806f
movq %rax, 0x18(%r14)
leaq 0x214fb(%rip), %rax     # 0x292e8
movq (%rax), %rdi
leaq 0x26f39(%rip), %rax     # 0x2ed30
movl (%rax), %esi
leaq -0x407(%rip), %rdx      # 0x79f9
xorl %ecx, %ecx
callq 0x172b1
callq 0x170c3
jmp 0x7ef4
leaq 0x21960(%rip), %rsi     # 0x29778
movl $0x28, %edi
callq 0x17978
movq %rax, %rbp
movl %r13d, (%rbp)
movq $0x0, 0x10(%rbp)
callq 0xe1c6
movq %rbp, %r12
movl %eax, %ebp
movl %eax, (%r15)
leal -0xf(%rbp), %eax
movq %r12, 0x8(%rsp)
cmpl $0x1, %eax
ja 0x7e9c
movq 0x8(%rsp), %r13
movq (%r14), %rax
movl $0x28, (%rax)
movq 0x8(%rax), %r12
leaq 0x28(%r12), %rcx
cmpq 0x10(%rax), %rcx
jae 0x7e6e
movq %rcx, 0x8(%rax)
jmp 0x7e7e
movl $0x28, %edi
movq %r14, %rsi
callq 0x17978
movq %rax, %r12
movl %ebp, (%r12)
movq %r13, 0x10(%r12)
callq 0xe1c6
movl %eax, %ebp
movl %eax, (%r15)
addl $-0xf, %eax
movq %r12, %r13
cmpl $0x2, %eax
jb 0x7e50
movq 0x10(%rsp), %rdi
movl %ebx, %esi
callq 0x7c26
movq 0x8(%rsp), %rcx
movq %rax, 0x10(%rcx)
leaq 0x218c0(%rip), %rax     # 0x29778
movq (%rax), %rax
movl $0x28, (%rax)
movq 0x8(%rax), %r14
leaq 0x28(%r14), %rcx
cmpq 0x10(%rax), %rcx
jae 0x7ed5
movq %rcx, 0x8(%rax)
jmp 0x7ee9
leaq 0x2189c(%rip), %rsi     # 0x29778
movl $0x28, %edi
callq 0x17978
movq %rax, %r14
movl $0x7, (%r14)
movq %r12, 0x10(%r14)
leaq 0x20685(%rip), %r13     # 0x28580
leaq 0x21876(%rip), %r12     # 0x29778
movl (%r15), %eax
cmpl $0x5b, %eax
je 0x7f40
cmpl $0x28, %eax
jne 0x805d
callq 0xe1c6
movl %eax, (%r15)
movq (%r12), %rax
movl $0x28, (%rax)
movq 0x8(%rax), %rbp
leaq 0x28(%rbp), %rcx
cmpq 0x10(%rax), %rcx
jae 0x7fca
movq %rcx, 0x8(%rax)
jmp 0x7fda
callq 0xe1c6
movl %eax, (%r15)
movl %eax, %eax
cmpb $0x20, (%r13,%rax)
jne 0x7f7e
movl $0x5d, %edi
movl $0x1, %esi
callq 0xb2c3
movl %eax, %ebp
testl %eax, %eax
jg 0x7f8a
leaq 0x16bf9(%rip), %rdi     # 0x1eb67
movl %ebp, %esi
xorl %eax, %eax
callq 0x9720
movl $0x1, %ebp
jmp 0x7f8a
movl $0x5d, %edi
callq 0x983d
xorl %ebp, %ebp
movq (%r12), %rcx
movl $0x28, (%rcx)
movq 0x8(%rcx), %rax
leaq 0x28(%rax), %rdx
cmpq 0x10(%rcx), %rdx
jae 0x7fa8
movq %rdx, 0x8(%rcx)
jmp 0x7fb5
movl $0x28, %edi
movq %r12, %rsi
callq 0x17978
movl $0xc, (%rax)
movq %r14, 0x10(%rax)
movl %ebp, 0x8(%rax)
movq %rax, %r14
jmp 0x7f02
movl $0x28, %edi
movq %r12, %rsi
callq 0x17978
movq %rax, %rbp
movl $0xb, (%rbp)
movq %r14, 0x10(%rbp)
movl %ebx, %edi
callq 0x806f
movq %rax, 0x18(%rbp)
testl %ebx, %ebx
jne 0x800c
testb $0x1, 0x218a9(%rip)     # 0x298a4
jne 0x800c
movb $0x1, 0x218a0(%rip)     # 0x298a4
movq %rbp, %r14
jmp 0x7f02
leaq 0x212d5(%rip), %rax     # 0x292e8
movq (%rax), %rdi
leaq 0x26d13(%rip), %rax     # 0x2ed30
movl (%rax), %esi
leaq -0x62d(%rip), %rdx      # 0x79f9
xorl %ecx, %ecx
callq 0x172b1
callq 0x170c3
movq %rbp, %r14
jmp 0x7f02
leaq 0x21737(%rip), %rsi     # 0x29778
movl $0x28, %edi
callq 0x17978
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