// File: /workspace/github_c_makefile_star2_O1/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, 0x10(%rsp)
callq 0x1709e
leaq 0x23953(%rip), %rdi     # 0x2b9e0
movl (%rdi), %eax
leaq 0x204ea(%rip), %rcx     # 0x28580
movzbl (%rcx,%rax), %ecx
cmpl $0x3, %ecx
je 0x80a8
cmpl $0x51, %ecx
jne 0x82dc
incl 0x10(%rsp)
movl $0x8, %ebp
movl $0x1, %r15d
xorl %r13d, %r13d
xorl %r14d, %r14d
movq $0x0, 0x8(%rsp)
testq %r13, %r13
setne %cl
movl (%rdi), %eax
cmpl $0x40, %eax
sete %r12b
andb %cl, %r12b
cmpb $0x1, %r12b
jne 0x8115
leaq 0x29efb(%rip), %rax     # 0x31fe0
cmpq (%rax), %r13
jne 0x80ff
leaq 0x16a95(%rip), %rdi     # 0x1eb86
xorl %eax, %eax
callq 0x9720
leaq 0x29ee1(%rip), %rax     # 0x31fe0
movq (%rax), %rdi
movq %r14, %rsi
callq 0x16aec
movq %rax, %r14
movq %r13, %rbx
jmp 0x8225
movl %eax, %eax
cmpq $0x4e, %rax
je 0x815d
cmpl $0x20, %eax
jne 0x8142
leaq 0x23827(%rip), %rcx     # 0x2b950
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x814f
cmpb $0x53, 0x1a(%rcx)
jne 0x814f
cmpq $0x20, %rax
je 0x815d
cmpl $0x4e, %eax
je 0x815d
leaq 0x20437(%rip), %rcx     # 0x28580
cmpb $0x3, (%rcx,%rax)
je 0x815d
leaq 0x16a50(%rip), %rdi     # 0x1eba6
xorl %eax, %eax
callq 0x9720
movl $0x4, %edi
leaq 0x14(%rsp), %rsi
callq 0x6b79
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
movl 0x10(%rsp), %edx
callq 0x793a
movq %rax, %rbx
leaq 0x238d1(%rip), %rax     # 0x2ba58
cmpl $0x0, (%rax)
jle 0x81a6
movq %rbx, %rdi
callq 0x1980d
testl %eax, %eax
jne 0x81a6
leaq 0x16240(%rip), %rdi     # 0x1e3df
xorl %eax, %eax
callq 0x9be3
leaq 0x29e33(%rip), %rax     # 0x31fe0
cmpq (%rax), %rbx
jne 0x81ce
orq 0x8(%rsp), %r13
je 0x81ce
leaq 0x169c6(%rip), %rdi     # 0x1eb86
xorl %eax, %eax
callq 0x9720
leaq 0x29e12(%rip), %rax     # 0x31fe0
cmpq $0x0, 0x8(%rsp)
jne 0x81ea
movl %r15d, %edi
callq 0x16e2f
movq %rax, 0x8(%rsp)
leaq 0x29df6(%rip), %rax     # 0x31fe0
movq (%rax), %rdi
cmpq %rdi, %rbx
je 0x820e
movl 0x14(%rsp), %edi
movq 0x8(%rsp), %rsi
movq %rbx, %rdx
leaq 0x23733(%rip), %rcx     # 0x2b938
callq 0x7a46
movq 0x20(%rax), %rdi
movq %r14, %rsi
callq 0x16aec
movq %rax, %r14
leaq 0x237c0(%rip), %rdi     # 0x2b9e0
cmpl $0x2c, (%rdi)
jne 0x8239
xorb $0x1, %r12b
callq 0xe1c6
leaq 0x237ab(%rip), %rdi     # 0x2b9e0
movl %eax, (%rdi)
jmp 0x823c
xorl %r12d, %r12d
addl $0x8, %ebp
incl %r15d
movq %rbx, %r13
testb %r12b, %r12b
jne 0x80bd
leaq 0x2151b(%rip), %rax     # 0x29770
movq (%rax), %rax
movl %ebp, (%rax)
movq 0x8(%rax), %rsi
movslq %ebp, %rcx
addq %rsi, %rcx
cmpq 0x10(%rax), %rcx
jae 0x8270
movq %rcx, 0x8(%rax)
jmp 0x8281
leaq 0x214f9(%rip), %rsi     # 0x29770
movl %ebp, %edi
callq 0x17978
movq %rax, %rsi
movq %r14, %rdi
callq 0x16b7f
movq %rax, %rbx
leaq 0x2374d(%rip), %rdi     # 0x2b9e0
cmpl $0x29, (%rdi)
je 0x82ba
movl $0x29, %edi
callq 0x983d
leaq 0x1fea4(%rip), %rsi     # 0x2814d
movl $0x7b, %edi
callq 0x9a79
leaq 0x23726(%rip), %rdi     # 0x2b9e0
cmpl $0x29, (%rdi)
jne 0x82ca
movq %rdi, %r14
callq 0xe1c6
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 0x23667(%rip), %rcx     # 0x2b950
movq (%rcx), %rcx
testq %rcx, %rcx
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x8306
cmpb $0x53, 0x1a(%rcx)
je 0x80a8
cmpl $0x20, %eax
jne 0x8370
cmpl $0x20, (%rdi)
movq %rdi, %r12
jne 0x8358
leaq 0x2362e(%rip), %r15     # 0x2b948
leaq 0x23617(%rip), %r14     # 0x2b938
xorl %ebx, %ebx
movq (%r15), %rsi
xorl %edi, %edi
xorl %edx, %edx
movq %r14, %rcx
callq 0x7a46
callq 0xe1c6
movl %eax, (%r12)
cmpl $0x2c, %eax
movq %r12, %rdi
jne 0x8293
movq %rdi, %r12
callq 0xe1c6
movl %eax, (%r12)
cmpl $0x20, %eax
je 0x8323
leaq 0x1685f(%rip), %rdi     # 0x1ebbe
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x9720
movq %r12, %rdi
jmp 0x8293
xorl %ebx, %ebx
jmp 0x8293
nop