// File: /workspace/github_c_makefile_star2_O1/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 0x2e1d5
movsbl %al, %esi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x22d38
movq %rax, %rbx
movb $0x1, 0x94(%rax)
movq %r14, %rdi
callq 0x2e1d5
cmpb $0x2, %al
jne 0x25fe5
movb $0x1, 0x92(%rbx)
movq %r14, %rdi
callq 0x2e209
movq %rax, %r15
movq %rax, 0x20(%rbx)
leaq (,%rax,8), %rdi
callq 0x4280
movq %rax, 0x18(%rbx)
testq %r15, %r15
je 0x260bc
xorl %r15d, %r15d
movl $0x20, %edi
callq 0x2d348
movq 0x18(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
movq %r14, %rdi
callq 0x2e209
movq 0x18(%rbx), %rcx
movq (%rcx,%r15,8), %r12
movq %rax, 0x8(%r12)
leaq (,%rax,8), %rdi
callq 0x4280
movq %rax, (%r12)
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rsi
cmpq $0x0, 0x8(%rsi)
je 0x26083
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x25aa0
movq 0x18(%rbx), %rcx
movq (%rcx,%r15,8), %rcx
movq (%rcx), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rsi
cmpq 0x8(%rsi), %r12
jb 0x2605b
addq $0x10, %rsi
movq %r14, %rdi
callq 0x2637c
movq %r14, %rdi
callq 0x2e4cb
testl %eax, %eax
je 0x260af
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rsi
addq $0x18, %rsi
movq %r14, %rdi
callq 0x2637c
incq %r15
cmpq 0x20(%rbx), %r15
jb 0x26011
movq %rbx, %rsi
addq $0x28, %rsi
movq %r14, %rdi
callq 0x2637c
movq %r14, %rdi
callq 0x2e209
movq %rax, 0x70(%rbx)
testq %rax, %rax
je 0x260ec
shlq $0x3, %rax
movq %rax, %rdi
callq 0x2d348
movq %rax, 0x68(%rbx)
movl (%rbx), %eax
addl $-0x14, %eax
cmpl $0x9, %eax
ja 0x2612e
leaq 0x11e73(%rip), %rcx     # 0x37f70
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x68(%rbx), %rsi
movq %r14, %rdi
callq 0x2637c
movq %r14, %rdi
callq 0x25aa0
movq %rax, 0x88(%rbx)
movq $0x1, 0x78(%rbx)
jmp 0x2636a
cmpq $0x0, 0x70(%rbx)
je 0x2636a
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x68(%rbx), %rsi
addq %r15, %rsi
movq %r14, %rdi
callq 0x2637c
incq %r12
addq $0x8, %r15
cmpq 0x70(%rbx), %r12
jb 0x2613f
jmp 0x2636a
movq %r14, %rdi
callq 0x25aa0
jmp 0x26363
movq %r14, %rdi
callq 0x25aa0
movq %rax, 0x88(%rbx)
movq %r14, %rdi
callq 0x2e209
movq %rax, 0x48(%rbx)
leaq (,%rax,8), %rdi
callq 0x2d348
movq %rax, 0x40(%rbx)
cmpq $0x0, 0x48(%rbx)
je 0x26219
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x40(%rbx), %rsi
addq %r15, %rsi
movq %r14, %rdi
callq 0x2637c
incq %r12
addq $0x8, %r15
cmpq 0x48(%rbx), %r12
jb 0x261a6
jmp 0x26219
movq %r14, %rdi
callq 0x25aa0
movq %rax, 0x88(%rbx)
movq %r14, %rdi
callq 0x2e209
movq %rax, 0x38(%rbx)
leaq (,%rax,8), %rdi
callq 0x2d348
movq %rax, 0x30(%rbx)
cmpq $0x0, 0x38(%rbx)
je 0x26219
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x30(%rbx), %rsi
addq %r15, %rsi
movq %r14, %rdi
callq 0x2637c
incq %r12
addq $0x8, %r15
cmpq 0x38(%rbx), %r12
jb 0x261fd
movq 0x68(%rbx), %rsi
movq %r14, %rdi
callq 0x2637c
jmp 0x2636a
movq %r14, %rdi
callq 0x2e209
movq %rax, 0x78(%rbx)
leaq (,%rax,8), %rdi
callq 0x2d348
movq %rax, 0x88(%rbx)
cmpq $0x0, 0x78(%rbx)
je 0x2636a
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x25aa0
movq 0x88(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq 0x78(%rbx), %r15
jb 0x26258
jmp 0x2636a
movq %r14, %rdi
callq 0x2e209
movq %rax, 0x78(%rbx)
leaq (,%rax,8), %rdi
callq 0x2d348
movq %rax, 0x88(%rbx)
cmpq $0x0, 0x78(%rbx)
je 0x2636a
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x2e209
movq %rax, %r13
movq %r14, %rdi
callq 0x2e209
movq %rax, (%rsp)
movq %r14, %rdi
callq 0x2e4cb
movl %eax, %ebp
movq %r14, %rdi
callq 0x25aa0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movq %rax, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x1e3de
movq %rax, %r12
movl %r13d, (%rax)
leaq 0x3af89(%rip), %rax     # 0x61278
movl (%rax), %eax
decl %eax
movl %eax, 0x4(%r12)
movq %r14, %rdi
callq 0x2e4cb
testl %eax, %eax
je 0x26311
leaq 0x28(%r12), %rsi
movq %r14, %rdi
callq 0x2637c
movq (%rsp), %rax
movq %rax, 0x8(%r12)
movl %ebp, 0x10(%r12)
movq 0x88(%rbx), %rax
movq %r12, (%rax,%r15,8)
incq %r15
cmpq 0x78(%rbx), %r15
jb 0x262a7
jmp 0x2636a
movq %r14, %rdi
callq 0x2e209
testq %rax, %rax
je 0x2635b
movq %rax, %r15
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x28106
decq %r15
jne 0x26349
movq %r14, %rdi
callq 0x2e2b1
movq %rax, 0x88(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq