// File: /workspace/github_c_makefile_star2_O3/Oric4ever[P]lcc65/6502/build/../src/decl.c
// Function: compound
void compound(int loop, struct swtch *swp, int lev) {
	Symbol p;
	Code cp;
	int i, j, nregs;

	walk(0, 0, 0);
	cp = code(Blockbeg);
	enterscope();
	cp->u.block.bnumber = ++bnumber;
	cp->u.block.level = level;
	autos = registers = 0;
	if (level == LOCAL && isstruct(freturn(cfunc->type))) {
		retv = genident(AUTO, ptr(freturn(cfunc->type)), level);
		retv->defined = 1;
		retv->initialized = 1;
		registers = append(retv, registers);	/* insures that retv is the 1st local */
	}
	if (level == LOCAL && events.entry)
		apply(events.entry, (Generic)cfunc, (Generic)0);
	expect('{');
	while (kind[t] == CHAR || kind[t] == STATIC
	|| (t == ID && tsym && tsym->sclass == TYPEDEF && (level < LOCAL || getchr() != ':')))
		decl(dcllocal, 0);
	nregs = length(registers);
	cp->u.block.locals = (Symbol *)list_to_a(registers, (Generic *)talloc((nregs + length(autos) + 1)*sizeof(Symbol)));
	list_to_a(autos, (Generic *)&cp->u.block.locals[nregs]);
	while (kind[t] == IF || kind[t] == ID)
		statement(loop, swp, lev);
	walk(0, 0, 0);
	foreach(identifiers, level, checkref, (Generic)0);
	for (i = nregs; p = cp->u.block.locals[i]; i++) {
		for (j = i; j > nregs && cp->u.block.locals[j-1]->ref < p->ref; j--)
			cp->u.block.locals[j] = cp->u.block.locals[j-1];
		cp->u.block.locals[j] = p;
	}
	cp->u.block.identifiers = identifiers;
	cp->u.block.types = types;
	code(Blockend);
	if (level > LOCAL) {
		exitscope();
		expect('}');
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, 0xc(%rsp)
movq %rsi, %r14
movl %edi, %r15d
xorl %r12d, %r12d
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x394a
xorl %edi, %edi
callq 0x3468
movq %rax, %rbx
callq 0x16f5b
leaq 0x2ac50(%rip), %rax     # 0x2fd60
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movw %cx, 0x20(%rbx)
leaq 0x2ac0f(%rip), %rax     # 0x2fd30
movl (%rax), %eax
movw %ax, 0x22(%rbx)
movq %r12, 0x2575a(%rip)     # 0x2a888
movq %r12, 0x2575b(%rip)     # 0x2a890
cmpl $0x5, %eax
jne 0x51ed
movq 0x25733(%rip), %rax     # 0x2a878
movq 0x20(%rax), %rdi
callq 0x195c1
movl (%rax), %ebp
movq 0x25721(%rip), %rax     # 0x2a878
movq 0x20(%rax), %rdi
callq 0x195c1
cmpl $0xf, %ebp
jb 0x5169
movq 0x10(%rax), %rax
cmpl $0x9, (%rax)
je 0x519e
movq 0x25703(%rip), %rax     # 0x2a878
movq 0x20(%rax), %rdi
callq 0x195c1
movl (%rax), %ebp
movq 0x256f1(%rip), %rax     # 0x2a878
movq 0x20(%rax), %rdi
callq 0x195c1
cmpl $0xf, %ebp
jb 0x5199
movq 0x10(%rax), %rax
cmpl $0xa, (%rax)
jne 0x51ed
movq 0x256d3(%rip), %rax     # 0x2a878
movq 0x20(%rax), %rdi
callq 0x195c1
movq %rax, %rdi
callq 0x188cc
leaq 0x2ab73(%rip), %rcx     # 0x2fd30
movl (%rcx), %edx
movl $0x43, %edi
movq %rax, %rsi
callq 0x17456
movq %rax, 0x256c5(%rip)     # 0x2a898
orb $0x21, 0x1b(%rax)
movq 0x256aa(%rip), %rsi     # 0x2a888
movq %rax, %rdi
callq 0x16a18
movq %rax, 0x2569b(%rip)     # 0x2a888
leaq 0x2ab3c(%rip), %rax     # 0x2fd30
cmpl $0x5, (%rax)
sete %al
leaq 0x277ff(%rip), %rcx     # 0x2ca00
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x521f
movq 0x25660(%rip), %rsi     # 0x2a878
xorl %edx, %edx
callq 0x1021b
movl $0x7b, %edi
callq 0x9869
leaq 0x277b0(%rip), %r13     # 0x2c9e0
leaq 0x24349(%rip), %rbp     # 0x29580
leaq 0xcce(%rip), %r12       # 0x5f0c
movl (%r13), %eax
movzbl (%rbp,%rax), %ecx
cmpl $0x3, %ecx
je 0x5281
cmpl $0x51, %ecx
je 0x5281
cmpl $0x20, %eax
jne 0x528d
leaq 0x276f3(%rip), %rax     # 0x2c950
movq (%rax), %rax
testq %rax, %rax
je 0x528d
cmpb $0x53, 0x1a(%rax)
jne 0x528d
leaq 0x2aabe(%rip), %rax     # 0x2fd30
cmpl $0x5, (%rax)
jl 0x5281
callq 0xe128
cmpl $0x3a, %eax
je 0x528d
movq %r12, %rdi
xorl %esi, %esi
callq 0x541a
jmp 0x523e
movq 0x255f4(%rip), %rdi     # 0x2a888
callq 0x16a95
movl %eax, %r12d
movq 0x255e5(%rip), %rax     # 0x2a888
movq %rax, 0x10(%rsp)
movq 0x255e1(%rip), %rdi     # 0x2a890
callq 0x16a95
movl %r12d, 0x8(%rsp)
addl %r12d, %eax
leal 0x8(,%rax,8), %edi
leaq 0x254ae(%rip), %rax     # 0x2a778
movq (%rax), %rax
movl %edi, (%rax)
movq 0x8(%rax), %rsi
movslq %edi, %rcx
addq %rsi, %rcx
cmpq 0x10(%rax), %rcx
jae 0x52e5
movq %rcx, 0x8(%rax)
jmp 0x52f4
leaq 0x2548c(%rip), %rsi     # 0x2a778
callq 0x17800
movq %rax, %rsi
movq 0x10(%rsp), %rdi
callq 0x16aab
movq %rax, 0x28(%rbx)
movq 0x25587(%rip), %rdi     # 0x2a890
movslq 0x8(%rsp), %r12
leaq (%rax,%r12,8), %rsi
callq 0x16aab
movl (%r13), %eax
movzbl (%rbp,%rax), %eax
cmpl $0x4d, %eax
je 0x532a
cmpl $0x20, %eax
jne 0x533b
movl %r15d, %edi
movq %r14, %rsi
movl 0xc(%rsp), %edx
callq 0x154ec
jmp 0x5317
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x394a
leaq 0x24f9b(%rip), %r14     # 0x2a2e8
movq (%r14), %rdi
leaq 0x2a9d9(%rip), %rax     # 0x2fd30
movl (%rax), %esi
leaq 0x1144(%rip), %rdx      # 0x64a4
xorl %ecx, %ecx
callq 0x17170
movq 0x28(%rbx), %rdx
movq (%rdx,%r12,8), %rax
testq %rax, %rax
movl 0x8(%rsp), %r9d
je 0x53c3
movq %r12, %rcx
movl %ecx, %esi
cmpq %r12, %rcx
jle 0x53ab
movl 0x1c(%rax), %edi
movq %rcx, %rsi
movq 0x28(%rbx), %rdx
movq -0x8(%rdx,%rsi,8), %r8
cmpl %edi, 0x1c(%r8)
jge 0x53ab
movq %r8, (%rdx,%rsi,8)
decq %rsi
cmpq %r12, %rsi
jg 0x5389
movq 0x28(%rbx), %rdx
movl %r9d, %esi
movslq %esi, %rsi
movq %rax, (%rdx,%rsi,8)
movq 0x28(%rbx), %rdx
movq 0x8(%rdx,%rcx,8), %rax
incq %rcx
testq %rax, %rax
jne 0x537c
movq (%r14), %rax
movq %rax, 0x30(%rbx)
leaq 0x2533f(%rip), %rax     # 0x2a710
movq (%rax), %rax
movq %rax, 0x38(%rbx)
movl $0x1, %edi
callq 0x3468
leaq 0x2a947(%rip), %rax     # 0x2fd30
cmpl $0x6, (%rax)
jl 0x540b
callq 0x16f80
movl $0x7d, %edi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9869
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq