// File: /workspace/github_c_makefile_star2_O0/Oric4ever[P]lcc65/6502/build/../src/decl.c
// Function: structdcl
static Type structdcl(int op) {
	char *tag;
	Type ty;
	Symbol p;
	Coordinate pos;

	t = gettok();
	if (t == ID) {
		tag = token;
		pos = src;
		t = gettok();
	} else
		tag = string("");
	if (t == '{') {
		static char follow[] = { IF, ',', 0 };
		ty = newstruct(op, tag);
		if (*tag)
			ty->u.sym->src = pos;
		t = gettok();
		if (kind[t] == CHAR || t == ID && tsym
		&& tsym->sclass == TYPEDEF)
			fields(ty);
		else
			error("invalid %k field declarations\n", op);
		test('}', follow);
		ty->u.sym->defined = 1;
	} else if (*tag && (p = lookup(tag, types)) && p->type->op == op) {
		if (t == ';' && p->scope < level)
			ty = newstruct(op, tag);
		if (xref)
			use(p, pos);
		ty = p->type;
	} else {
		if (*tag == 0)
			error("missing %k tag\n", op);
		ty = newstruct(op, tag);
		if (*tag && xref)
			use(ty->u.sym, pos);
	}
	return ty;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
callq 0x15170
movl %eax, %ecx
leaq 0x340f7(%rip), %rax     # 0x3db80
movl %ecx, (%rax)
leaq 0x340ee(%rip), %rax     # 0x3db80
cmpl $0x20, (%rax)
jne 0x9acd
leaq 0x3404a(%rip), %rax     # 0x3dae8
movq (%rax), %rax
movq %rax, -0x10(%rbp)
leaq 0x3402c(%rip), %rax     # 0x3dad8
movq (%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
callq 0x15170
movl %eax, %ecx
leaq 0x340b7(%rip), %rax     # 0x3db80
movl %ecx, (%rax)
jmp 0x9add
leaq 0x27069(%rip), %rdi     # 0x30b3d
callq 0x237e0
movq %rax, -0x10(%rbp)
leaq 0x3409c(%rip), %rax     # 0x3db80
cmpl $0x7b, (%rax)
jne 0x9bbb
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x28e10
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x9b1e
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x30(%rbp), %rcx
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x30(%rax)
callq 0x15170
movl %eax, %ecx
leaq 0x34054(%rip), %rax     # 0x3db80
movl %ecx, (%rax)
leaq 0x3404b(%rip), %rax     # 0x3db80
movl (%rax), %eax
movl %eax, %ecx
leaq 0x2fe50(%rip), %rax     # 0x39990
movsbl (%rax,%rcx), %eax
cmpl $0x3, %eax
je 0x9b75
leaq 0x34030(%rip), %rax     # 0x3db80
cmpl $0x20, (%rax)
jne 0x9b80
leaq 0x33f94(%rip), %rax     # 0x3daf0
cmpq $0x0, (%rax)
je 0x9b80
leaq 0x33f87(%rip), %rax     # 0x3daf0
movq (%rax), %rax
movzbl 0x1a(%rax), %eax
cmpl $0x53, %eax
jne 0x9b80
movq -0x18(%rbp), %rdi
callq 0x9cc0
jmp 0x9b91
movl -0x4(%rbp), %esi
leaq 0x25e6c(%rip), %rdi     # 0x2f9f6
movb $0x0, %al
callq 0xd530
movl $0x7d, %edi
leaq 0x2f599(%rip), %rsi     # 0x39136
callq 0xdb30
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movb 0x1b(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x1b(%rax)
jmp 0x9caf
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x9c51
movq -0x10(%rbp), %rdi
leaq 0x3198a(%rip), %rax     # 0x3b560
movq (%rax), %rsi
callq 0x24670
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x9c51
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl (%rax), %eax
cmpl -0x4(%rbp), %eax
jne 0x9c51
leaq 0x33f82(%rip), %rax     # 0x3db80
cmpl $0x3b, (%rax)
jne 0x9c26
movq -0x20(%rbp), %rax
movzwl 0x18(%rax), %eax
leaq 0x3737e(%rip), %rcx     # 0x40f90
cmpl (%rcx), %eax
jge 0x9c26
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x28e10
movq %rax, -0x18(%rbp)
leaq 0x33fd7(%rip), %rax     # 0x3dc04
cmpl $0x0, (%rax)
je 0x9c43
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x252c0
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x9cad
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x9c6e
movl -0x4(%rbp), %esi
leaq 0x25dae(%rip), %rdi     # 0x2fa15
movb $0x0, %al
callq 0xd530
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x28e10
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x9cab
leaq 0x33f73(%rip), %rax     # 0x3dc04
cmpl $0x0, (%rax)
je 0x9cab
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x252c0
jmp 0x9cad
jmp 0x9caf
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)