// File: /workspace/github_c_makefile_star2_O3/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 0x276f0
movq %rsi, %r14
movq %rdi, %rbx
movsbl (%rsi), %esi
callq 0x2dd32
movsbl 0x10(%r14), %esi
movq %rbx, %rdi
callq 0x2dd32
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x2dd70
cmpq $0x0, 0x20(%r14)
je 0x2745d
xorl %r15d, %r15d
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x2dd70
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rax
cmpq $0x0, 0x8(%rax)
je 0x2740e
xorl %r12d, %r12d
movq (%rax), %rax
movq (%rax,%r12,8), %rsi
movq %rbx, %rdi
callq 0x27717
incq %r12
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rax
cmpq 0x8(%rax), %r12
jb 0x273ee
movq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0x27d89
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rax
xorl %esi, %esi
cmpq $0x0, 0x18(%rax)
setne %sil
movq %rbx, %rdi
callq 0x2e042
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rax
movq 0x18(%rax), %rsi
testq %rsi, %rsi
je 0x2744e
movq %rbx, %rdi
callq 0x27d89
incq %r15
cmpq 0x20(%r14), %r15
jb 0x273c8
jmp 0x27460
xorl %r15d, %r15d
movq %r15, (%rsp)
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x27d89
movq 0x70(%r14), %rsi
movq %rbx, %rdi
callq 0x2dd70
movl (%r14), %eax
addl $-0x14, %eax
cmpl $0x9, %eax
ja 0x276a6
leaq 0x10b2a(%rip), %rcx     # 0x37fbc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x68(%r14), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x27d89
movq 0x88(%r14), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x27717
movq 0x78(%r14), %rsi
movq %rbx, %rdi
callq 0x2dd70
cmpq $0x0, 0x78(%r14)
je 0x276e4
xorl %r15d, %r15d
movq 0x88(%r14), %rax
movq (%rax,%r15,8), %r12
movslq (%r12), %rsi
movq %rbx, %rdi
callq 0x2dd70
movq 0x8(%r12), %rsi
movq %rbx, %rdi
callq 0x2dd70
movl 0x10(%r12), %esi
movq %rbx, %rdi
callq 0x2e042
movq 0x18(%r12), %rsi
movq %rbx, %rdi
callq 0x27717
xorl %esi, %esi
cmpq $0x0, 0x28(%r12)
setne %sil
movq %rbx, %rdi
callq 0x2e042
movq 0x28(%r12), %rsi
testq %rsi, %rsi
je 0x27542
movq %rbx, %rdi
callq 0x27d89
incq %r15
cmpq 0x78(%r14), %r15
jb 0x274de
jmp 0x276e4
movq 0x88(%r14), %rsi
movq %rbx, %rdi
callq 0x27717
movq 0x38(%r14), %rsi
movq %rbx, %rdi
callq 0x2dd70
cmpq $0x0, 0x38(%r14)
je 0x275ce
xorl %r15d, %r15d
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x27d89
incq %r15
cmpq 0x38(%r14), %r15
jb 0x27575
jmp 0x275ce
movq 0x88(%r14), %rsi
movq %rbx, %rdi
callq 0x27717
movq 0x48(%r14), %rsi
movq %rbx, %rdi
callq 0x2dd70
cmpq $0x0, 0x48(%r14)
je 0x275ce
xorl %r15d, %r15d
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x27d89
incq %r15
cmpq 0x48(%r14), %r15
jb 0x275b5
movq 0x68(%r14), %rax
movq (%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x27d89
movq 0x78(%r14), %rsi
movq %rbx, %rdi
callq 0x2dd70
cmpq $0x0, 0x78(%r14)
je 0x276e4
xorl %r15d, %r15d
movq 0x88(%r14), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x27717
incq %r15
cmpq 0x78(%r14), %r15
jb 0x27602
jmp 0x276e4
movq 0x80(%r14), %rdi
testq %rdi, %rdi
je 0x276cb
callq 0x2d21c
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2dd70
movq %rsp, %rsi
movq $0x0, (%rsi)
movq 0x80(%r14), %rdi
callq 0x2d2a6
testl %eax, %eax
je 0x276d5
movq %rsp, %r15
leaq 0x3ab91(%rip), %r12     # 0x621f8
movq (%rsp), %rsi
cmpq $0x7, %rsi
ja 0x2767a
orq $0x40000000, %rsi       # imm = 0x40000000
jmp 0x27685
movq (%r12), %rax
movq (%rax,%rsi,8), %rax
movslq (%rax), %rsi
movq %rbx, %rdi
callq 0x2dd70
incq (%rsp)
movq 0x80(%r14), %rdi
movq %r15, %rsi
callq 0x2d2a6
testl %eax, %eax
jne 0x27667
jmp 0x276d5
cmpq $0x0, 0x70(%r14)
je 0x276e4
xorl %r15d, %r15d
movq 0x68(%r14), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x27d89
incq %r15
cmpq 0x70(%r14), %r15
jb 0x276b0
jmp 0x276e4
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2dd70
movq 0x88(%r14), %rsi
movq %rbx, %rdi
callq 0x2ddc9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x10abc(%rip), %rdi     # 0x381b3
xorl %eax, %eax
callq 0x13844
movq %r14, %rdi
callq 0x2398e
leaq 0x10ac2(%rip), %rdi     # 0x381cf
movq %rax, %rsi
xorl %eax, %eax
callq 0x13844