// File: /workspace/github_c_makefile_star2_O2/oridb[P]mc/parse/use.c
// Function: tyunpickle
static Type *
tyunpickle(FILE *fd)
{
	size_t i, j, n;
	Type *ty;
	Ty t;

	t = rdbyte(fd);
	ty = mktype(Zloc, t);
	ty->isimport = 1;
	if (rdbyte(fd) == Vishidden)
		ty->ishidden = 1;
	ty->nspec = rdint(fd);
	ty->spec = malloc(ty->nspec * sizeof(Traitspec*));
	for (i = 0; i < ty->nspec; i++) {
		ty->spec[i] = zalloc(sizeof(Traitspec));
		n = rdint(fd);
		ty->spec[i]->ntrait = n;
		ty->spec[i]->trait = malloc(n * sizeof(Node*));
		for (j = 0; j < ty->spec[i]->ntrait; j++)
			ty->spec[i]->trait[j] = unpickle(fd);
		rdtype(fd, &ty->spec[i]->param);
		if (rdbool(fd))
			rdtype(fd, &ty->spec[i]->aux);
	}
	rdtype(fd, &ty->seqaux);
	ty->nsub = rdint(fd);
	if (ty->nsub > 0)
		ty->sub = zalloc(ty->nsub * sizeof(Type *));
	switch (ty->type) {
	case Tyunres:
		ty->name = unpickle(fd);
		break;
	case Typaram:
		n = rdint(fd);
		for (i = 0; i < n; i++)
			rdtrait(fd, NULL, ty);
		ty->pname = rdstr(fd);
		break;
	case Tystruct:
		ty->nmemb = rdint(fd);
		ty->sdecls = zalloc(ty->nmemb * sizeof(Node *));
		for (i = 0; i < ty->nmemb; i++)
			ty->sdecls[i] = unpickle(fd);
		break;
	case Tyunion:
		ty->nmemb = rdint(fd);
		ty->udecls = zalloc(ty->nmemb * sizeof(Node *));
		for (i = 0; i < ty->nmemb; i++)
			ty->udecls[i] = rducon(fd, ty);
		break;
	case Tyarray:
		rdtype(fd, &ty->sub[0]);
		ty->asize = unpickle(fd);
		ty->nmemb = 1;
		break;
	case Tyslice:
		rdtype(fd, &ty->sub[0]);
		break;
	case Tyname:
		ty->name = unpickle(fd);
		ty->narg = rdint(fd);
		ty->arg = zalloc(ty->narg * sizeof(Type *));
		for (i = 0; i < ty->narg; i++)
			rdtype(fd, &ty->arg[i]);
		rdtype(fd, &ty->sub[0]);
		break;
	case Tygeneric:
		ty->name = unpickle(fd);
		ty->ngparam = rdint(fd);
		ty->gparam = zalloc(ty->ngparam * sizeof(Type *));
		for (i = 0; i < ty->ngparam; i++)
			rdtype(fd, &ty->gparam[i]);
		rdtype(fd, &ty->sub[0]);
		break;
	default:
		for (i = 0; i < ty->nsub; i++)
			rdtype(fd, &ty->sub[i]);
		break;
	}
	return ty;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x2a812
movsbl %al, %esi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1fdc2
movq %rax, %rbx
movb $0x1, 0x94(%rax)
movq %r14, %rdi
callq 0x2a812
cmpb $0x2, %al
jne 0x22cdb
movb $0x1, 0x92(%rbx)
movq %r14, %rdi
callq 0x2a844
movq %rax, %r12
movq %rax, 0x20(%rbx)
leaq (,%rax,8), %rdi
callq 0x4280
movq %rax, 0x18(%rbx)
xorl %r13d, %r13d
pushq $0x20
popq %r15
cmpq %r12, %r13
jae 0x22da8
movq %r15, %rdi
callq 0x29a78
movq 0x18(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
movq %r14, %rdi
callq 0x2a844
movq 0x18(%rbx), %rbp
movq (%rbp,%r13,8), %r12
movq %rax, 0x8(%r12)
leaq (,%rax,8), %rdi
callq 0x4280
movq %rax, (%r12)
xorl %r12d, %r12d
movq (%rbp,%r13,8), %rsi
cmpq 0x8(%rsi), %r12
jae 0x22d70
movq %r14, %rdi
callq 0x227cd
movq 0x18(%rbx), %rcx
movq (%rcx,%r13,8), %rcx
movq (%rcx), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
movq 0x18(%rbx), %rbp
jmp 0x22d45
addq $0x10, %rsi
movq %r14, %rdi
callq 0x23046
movq %r14, %rdi
callq 0x2aa5c
testl %eax, %eax
je 0x22d9c
movq 0x18(%rbx), %rax
movq (%rax,%r13,8), %rsi
addq $0x18, %rsi
movq %r14, %rdi
callq 0x23046
incq %r13
movq 0x20(%rbx), %r12
jmp 0x22d02
movq %rbx, %rsi
addq $0x28, %rsi
movq %r14, %rdi
callq 0x23046
movq %r14, %rdi
callq 0x2a844
movq %rax, 0x70(%rbx)
testq %rax, %rax
je 0x22dd8
shlq $0x3, %rax
movq %rax, %rdi
callq 0x29a78
movq %rax, 0x68(%rbx)
movl (%rbx), %eax
addl $-0x14, %eax
cmpl $0x9, %eax
ja 0x22e03
leaq 0x11167(%rip), %rcx     # 0x33f50
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x68(%rbx), %rsi
movq %r14, %rdi
callq 0x23046
jmp 0x23034
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpq 0x70(%rbx), %r12
jae 0x23034
movq 0x68(%rbx), %rsi
addq %r15, %rsi
movq %r14, %rdi
callq 0x23046
incq %r12
addq $0x8, %r15
jmp 0x22e09
movq %r14, %rdi
callq 0x227cd
jmp 0x2302d
movq 0x68(%rbx), %rsi
movq %r14, %rdi
callq 0x23046
movq %r14, %rdi
callq 0x227cd
movq %rax, 0x88(%rbx)
movq $0x1, 0x78(%rbx)
jmp 0x23034
movq %r14, %rdi
callq 0x227cd
movq %rax, 0x88(%rbx)
movq %r14, %rdi
callq 0x2a844
movq %rax, 0x48(%rbx)
leaq (,%rax,8), %rdi
callq 0x29a78
movq %rax, 0x40(%rbx)
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpq 0x48(%rbx), %r12
jae 0x22df2
movq 0x40(%rbx), %rsi
addq %r15, %rsi
movq %r14, %rdi
callq 0x23046
incq %r12
addq $0x8, %r15
jmp 0x22e92
movq %r14, %rdi
callq 0x227cd
movq %rax, 0x88(%rbx)
movq %r14, %rdi
callq 0x2a844
movq %rax, 0x38(%rbx)
leaq (,%rax,8), %rdi
callq 0x29a78
movq %rax, 0x30(%rbx)
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpq 0x38(%rbx), %r12
jae 0x22df2
movq 0x30(%rbx), %rsi
addq %r15, %rsi
movq %r14, %rdi
callq 0x23046
incq %r12
addq $0x8, %r15
jmp 0x22ee6
movq %r14, %rdi
callq 0x2a844
movq %rax, 0x78(%rbx)
leaq (,%rax,8), %rdi
callq 0x29a78
movq %rax, 0x88(%rbx)
xorl %r15d, %r15d
cmpq 0x78(%rbx), %r15
jae 0x23034
movq %r14, %rdi
callq 0x227cd
movq 0x88(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
jmp 0x22f2b
movq %r14, %rdi
callq 0x2a844
movq %rax, 0x78(%rbx)
leaq (,%rax,8), %rdi
callq 0x29a78
movq %rax, 0x88(%rbx)
xorl %r15d, %r15d
cmpq 0x78(%rbx), %r15
jae 0x23034
movq %r14, %rdi
callq 0x2a844
movq %rax, %r13
movq %r14, %rdi
callq 0x2a844
movq %rax, (%rsp)
movq %r14, %rdi
callq 0x2aa5c
movl %eax, %ebp
movq %r14, %rdi
callq 0x227cd
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movq %rax, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x1be63
movq %rax, %r12
movl %r13d, (%rax)
leaq 0x3b2b6(%rip), %rax     # 0x5e278
movl (%rax), %eax
decl %eax
movl %eax, 0x4(%r12)
movq %r14, %rdi
callq 0x2aa5c
testl %eax, %eax
je 0x22fe4
leaq 0x28(%r12), %rsi
movq %r14, %rdi
callq 0x23046
movq (%rsp), %rax
movq %rax, 0x8(%r12)
movl %ebp, 0x10(%r12)
movq 0x88(%rbx), %rax
movq %r12, (%rax,%r15,8)
incq %r15
jmp 0x22f70
movq %r14, %rdi
callq 0x2a844
movq %rax, %r15
subq $0x1, %r15
jb 0x23025
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x24c2c
jmp 0x23010
movq %r14, %rdi
callq 0x2a8d3
movq %rax, 0x88(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq