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

	if (!ty) {
		die("trying to pickle null type\n");
		return;
	}
	wrbyte(fd, ty->type);
	wrbyte(fd, ty->vis);
	wrint(fd, ty->nspec);
	for (i = 0; i < ty->nspec; i++) {
		wrint(fd, ty->spec[i]->ntrait);
		for (j = 0; j < ty->spec[i]->ntrait; j++)
			pickle(fd, ty->spec[i]->trait[j]);
		wrtype(fd, ty->spec[i]->param);
		wrbool(fd, ty->spec[i]->aux != NULL);
		if (ty->spec[i]->aux)
			wrtype(fd, ty->spec[i]->aux);
	}
	wrtype(fd, ty->seqaux);
	wrint(fd, ty->nsub);
	switch (ty->type) {
	case Tyunres:
		pickle(fd, ty->name);
		break;
	case Typaram:
		/* tid is generated; don't write */
		if (ty->trneed) {
			wrint(fd, bscount(ty->trneed));
			for (i = 0; bsiter(ty->trneed, &i); i++) {
				if (i < Ntraits)
					wrint(fd, i | Builtinmask);
				else
					wrint(fd, traittab[i]->uid);
			}
		} else {
			wrint(fd, 0);
		}
		wrstr(fd, ty->pname);	break;
	case Tystruct:
		wrint(fd, ty->nmemb);
		for (i = 0; i < ty->nmemb; i++)
			pickle(fd, ty->sdecls[i]);
		break;
	case Tyunion:
		wrint(fd, ty->nmemb);
		for (i = 0; i < ty->nmemb; i++)
			wrucon(fd, ty->udecls[i]);
		break;
	case Tyarray:
		wrtype(fd, ty->sub[0]);
		pickle(fd, ty->asize);
		break;
	case Tyslice:	wrtype(fd, ty->sub[0]);	break;
	case Tyvar:	die("Attempting to pickle %s. This will not work.\n", tystr(ty));	break;
	case Tyname:
		pickle(fd, ty->name);
		wrint(fd, ty->narg);
		for (i = 0; i < ty->narg; i++)
			wrtype(fd, ty->arg[i]);
		wrtype(fd, ty->sub[0]);
		break;
	case Tygeneric:
		pickle(fd, ty->name);
		wrint(fd, ty->ngparam);
		for (i = 0; i < ty->ngparam; i++)
			wrtype(fd, ty->gparam[i]);
		wrtype(fd, ty->sub[0]);
		break;
	default:
		for (i = 0; i < ty->nsub; i++)
			wrtype(fd, ty->sub[i]);
		break;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x24733
movq %rsi, %r14
movq %rdi, %rbx
movsbl (%rsi), %esi
callq 0x2a7ef
movsbl 0x10(%r14), %esi
movq %rbx, %rdi
callq 0x2a7ef
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x2a82d
xorl %r15d, %r15d
cmpq 0x20(%r14), %r15
jae 0x244d3
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x2a82d
xorl %r12d, %r12d
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rax
cmpq 0x8(%rax), %r12
jae 0x2448b
movq (%rax), %rax
movq (%rax,%r12,8), %rsi
movq %rbx, %rdi
callq 0x2475a
incq %r12
jmp 0x24469
movq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0x24da7
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rax
xorl %esi, %esi
cmpq $0x0, 0x18(%rax)
setne %sil
movq %rbx, %rdi
callq 0x2aa53
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rax
movq 0x18(%rax), %rsi
testq %rsi, %rsi
je 0x244cb
movq %rbx, %rdi
callq 0x24da7
incq %r15
jmp 0x24448
movq %r15, (%rsp)
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x24da7
movq 0x70(%r14), %rsi
movq %rbx, %rdi
callq 0x2a82d
movl (%r14), %eax
addl $-0x14, %eax
cmpl $0x9, %eax
ja 0x246f0
leaq 0xfac7(%rip), %rcx      # 0x33fcc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x68(%r14), %rax
movq (%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x24da7
movq 0x78(%r14), %rsi
movq %rbx, %rdi
callq 0x2a82d
xorl %r15d, %r15d
cmpq 0x78(%r14), %r15
jae 0x24727
movq 0x88(%r14), %rax
movq (%rax,%r15,8), %r12
movslq (%r12), %rsi
movq %rbx, %rdi
callq 0x2a82d
movq 0x8(%r12), %rsi
movq %rbx, %rdi
callq 0x2a82d
movl 0x10(%r12), %esi
movq %rbx, %rdi
callq 0x2aa53
movq 0x18(%r12), %rsi
movq %rbx, %rdi
callq 0x2475a
xorl %esi, %esi
cmpq $0x0, 0x28(%r12)
setne %sil
movq %rbx, %rdi
callq 0x2aa53
movq 0x28(%r12), %rsi
testq %rsi, %rsi
je 0x245a5
movq %rbx, %rdi
callq 0x24da7
incq %r15
jmp 0x24537
movq 0x88(%r14), %rsi
movq %rbx, %rdi
callq 0x2475a
movq 0x38(%r14), %rsi
movq %rbx, %rdi
callq 0x2a82d
xorl %r15d, %r15d
cmpq 0x38(%r14), %r15
jae 0x2450e
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x24da7
incq %r15
jmp 0x245c8
movq 0x88(%r14), %rsi
movq %rbx, %rdi
callq 0x2475a
movq 0x48(%r14), %rsi
movq %rbx, %rdi
callq 0x2a82d
xorl %r15d, %r15d
cmpq 0x48(%r14), %r15
jae 0x2450e
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x24da7
incq %r15
jmp 0x24605
movq 0x78(%r14), %rsi
movq %rbx, %rdi
callq 0x2a82d
xorl %r15d, %r15d
cmpq 0x78(%r14), %r15
jae 0x24727
movq 0x88(%r14), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x2475a
incq %r15
jmp 0x24633
movq 0x68(%r14), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x24da7
movq 0x88(%r14), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2475a
movq 0x80(%r14), %rdi
testq %rdi, %rdi
je 0x2470e
callq 0x29dea
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2a82d
xorl %eax, %eax
movq %rsp, %r15
leaq 0x3ab4e(%rip), %r12     # 0x5f1f8
movq %rax, (%rsp)
movq 0x80(%r14), %rdi
movq %r15, %rsi
callq 0x29e1a
testl %eax, %eax
je 0x24718
movq (%rsp), %rsi
cmpq $0x7, %rsi
ja 0x246d4
orq $0x40000000, %rsi       # imm = 0x40000000
jmp 0x246df
movq (%r12), %rax
movq (%rax,%rsi,8), %rax
movslq (%rax), %rsi
movq %rbx, %rdi
callq 0x2a82d
movq (%rsp), %rax
incq %rax
jmp 0x246aa
xorl %r15d, %r15d
cmpq 0x70(%r14), %r15
jae 0x24727
movq 0x68(%r14), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x24da7
incq %r15
jmp 0x246f3
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2a82d
movq 0x88(%r14), %rsi
movq %rbx, %rdi
callq 0x2a882
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xfa89(%rip), %rdi      # 0x341c3
xorl %eax, %eax
callq 0x1205c
movq %r14, %rdi
callq 0x21009
leaq 0xfa8f(%rip), %rdi      # 0x341df
movq %rax, %rsi
xorl %eax, %eax
callq 0x1205c