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

	enterscope();
	if (kind[t] == CHAR || kind[t] == STATIC
	|| t == ID && tsym && tsym->sclass == TYPEDEF) {
		int sclass, n = 0;
		Type last = 0, ty;
		List list = 0;
		for (;;) {
			Symbol p;
			char *id = 0;
			n++;
			if (last && t == ELLIPSIS) {
				if (last == voidtype)
					error("illegal formal parameter types\n");
				list = append(voidtype, list);
				t = gettok();
				break;
			}
			if (t == ID && (tsym == 0 || tsym->sclass != TYPEDEF)
			||  t != ID && t != REGISTER && kind[t] != CHAR)
				error("missing parameter type\n");
			ty = dclr(type(PARAM, &sclass), &id, lev + 1);
			if (Aflag >= 1 && !hasproto(ty))
				warning("missing prototype\n");
			if (ty == voidtype && (last || id))
				error("illegal formal parameter types\n");
			if (id == 0)
				id = stringd(n);
			if (ty == voidtype)
				list = append(voidtype, list);
			else {
				p = dclparam(sclass, id, ty, &src);
				list = append(p->type, list);
			}
			last = ty;
			if (t != ',')
				break;
			t = gettok();
		}
		proto = (Type *)list_to_a(list, (Generic *)alloc((n + 1)*sizeof (Type)));
	} else if (t == ID) {
		for (;;) {
			if (t != ID) {
				error("expecting an identifier\n");
				break;
			}
			dclparam(0, token, (Type)0, &src);
			t = gettok();
			if (t != ',')
				break;
			t = gettok();
		}
	}
	if (t != ')') {
		static char follow[] = { CHAR, STATIC, IF, ')', 0 };
		expect(')');
		skipto('{', follow);
	}
	if (t == ')')
		t = gettok();
	return proto;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebp
callq 0x16f5b
leaq 0x248db(%rip), %r14     # 0x2c9e0
movl (%r14), %eax
leaq 0x21471(%rip), %rcx     # 0x29580
movzbl (%rcx,%rax), %ecx
cmpl $0x3, %ecx
je 0x8121
cmpl $0x51, %ecx
jne 0x8346
leaq 0x8(%rsp), %rcx
movq $0x0, (%rcx)
incl %ebp
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %ebx, %ebx
cmpl $0x4e, %eax
je 0x8175
cmpl $0x20, %eax
jne 0x8158
leaq 0x24808(%rip), %rax     # 0x2c950
movq (%rax), %rax
testq %rax, %rax
je 0x8167
cmpb $0x53, 0x1a(%rax)
jne 0x8167
jmp 0x8175
movl %eax, %eax
leaq 0x2141f(%rip), %rcx     # 0x29580
cmpb $0x3, (%rcx,%rax)
je 0x8175
leaq 0x16a38(%rip), %rdi     # 0x1eba6
xorl %eax, %eax
callq 0x974c
movl $0x4, %edi
leaq 0x14(%rsp), %rsi
callq 0x6b8e
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
movl %ebp, %edx
callq 0x79a0
movq %rax, %r13
leaq 0x248bb(%rip), %rax     # 0x2ca58
cmpl $0x0, (%rax)
jle 0x81bc
movq %r13, %rdi
callq 0x195fb
testl %eax, %eax
jne 0x81bc
leaq 0x1622a(%rip), %rdi     # 0x1e3df
xorl %eax, %eax
callq 0x9bfd
leal 0x1(%r12), %r15d
leaq 0x2ae18(%rip), %rcx     # 0x32fe0
cmpq (%rcx), %r13
jne 0x81fb
cmpq $0x0, 0x8(%rsp)
setne %al
orb %al, %r14b
testb $0x1, %r14b
leaq 0x247fc(%rip), %r14     # 0x2c9e0
je 0x820c
leaq 0x16999(%rip), %rdi     # 0x1eb86
xorl %eax, %eax
callq 0x974c
leaq 0x2ade5(%rip), %rcx     # 0x32fe0
movq 0x8(%rsp), %rsi
testq %rsi, %rsi
leaq 0x247d6(%rip), %r14     # 0x2c9e0
jne 0x8223
movl %r15d, %edi
callq 0x16d50
leaq 0x2adc5(%rip), %rcx     # 0x32fe0
movq %rax, %rsi
movq %rax, 0x8(%rsp)
movq (%rcx), %rdi
cmpq %rdi, %r13
je 0x8242
movl 0x14(%rsp), %edi
movq %r13, %rdx
leaq 0x246ff(%rip), %rcx     # 0x2c938
callq 0x7ab1
movq 0x20(%rax), %rdi
movq %rbx, %rsi
callq 0x16a18
movq %rax, %rbx
cmpl $0x2c, (%r14)
jne 0x82bc
callq 0xe195
movl %eax, (%r14)
movq $0x0, 0x8(%rsp)
testq %r13, %r13
setne %r14b
cmpl $0x40, %eax
sete %cl
movl %r15d, %r12d
testb %cl, %r14b
je 0x8137
leaq 0x2ad5c(%rip), %rcx     # 0x32fe0
movq (%rcx), %rdi
cmpq %rdi, %r13
jne 0x82a0
leaq 0x168f3(%rip), %rdi     # 0x1eb86
xorl %eax, %eax
movq %rcx, %r14
callq 0x974c
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x16a18
movq %rax, %rbx
callq 0xe195
leaq 0x24729(%rip), %r14     # 0x2c9e0
movl %eax, (%r14)
jmp 0x82bf
movl %r12d, %r15d
leal 0x10(,%r15,8), %edi
leaq 0x224a2(%rip), %rax     # 0x2a770
movq (%rax), %rax
movl %edi, (%rax)
movq 0x8(%rax), %rsi
movslq %edi, %rcx
addq %rsi, %rcx
cmpq 0x10(%rax), %rcx
jae 0x82e9
movq %rcx, 0x8(%rax)
jmp 0x82f8
leaq 0x22480(%rip), %rsi     # 0x2a770
callq 0x17800
movq %rax, %rsi
movq %rbx, %rdi
callq 0x16aab
movq %rax, %rbx
movl (%r14), %eax
cmpl $0x29, %eax
je 0x832c
movl $0x29, %edi
callq 0x9869
leaq 0x20e31(%rip), %rsi     # 0x2914d
movl $0x7b, %edi
callq 0x9aa0
cmpl $0x29, (%r14)
jne 0x8334
callq 0xe195
movl %eax, (%r14)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x20, %eax
sete %dl
leaq 0x245fd(%rip), %rcx     # 0x2c950
movq (%rcx), %rcx
testq %rcx, %rcx
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x8371
cmpb $0x53, 0x1a(%rcx)
jne 0x8376
jmp 0x8121
cmpl $0x20, %eax
jne 0x83c5
leaq 0x245cb(%rip), %rax     # 0x2c948
movq (%rax), %rsi
leaq 0x245b1(%rip), %rcx     # 0x2c938
xorl %ebx, %ebx
xorl %edi, %edi
xorl %edx, %edx
callq 0x7ab1
callq 0xe195
movl %eax, (%r14)
cmpl $0x2c, %eax
jne 0x8306
callq 0xe195
movl %eax, (%r14)
cmpl $0x20, %eax
je 0x8376
leaq 0x16807(%rip), %rdi     # 0x1ebbe
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x974c
jmp 0x8303
xorl %ebx, %ebx
jmp 0x8303