// File: /workspace/github_c_makefile_star2_O1/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 0x27beb
movq %rsi, %r14
movq %rdi, %rbx
movsbl (%rsi), %esi
callq 0x2e1b2
movsbl 0x10(%r14), %esi
movq %rbx, %rdi
callq 0x2e1b2
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x2e1f0
movq $0x0, (%rsp)
cmpq $0x0, 0x20(%r14)
je 0x27916
xorl %eax, %eax
movq 0x18(%r14), %rcx
movq (%rcx,%rax,8), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x2e1f0
movq 0x18(%r14), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x8(%rax)
je 0x278b9
xorl %r15d, %r15d
movq (%rax), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x27c12
incq %r15
movq 0x18(%r14), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpq 0x8(%rax), %r15
jb 0x27895
movq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0x28288
movq 0x18(%r14), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rax
xorl %esi, %esi
cmpq $0x0, 0x18(%rax)
setne %sil
movq %rbx, %rdi
callq 0x2e4c2
movq 0x18(%r14), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rsi
testq %rsi, %rsi
je 0x27901
movq %rbx, %rdi
callq 0x28288
movq (%rsp), %rax
incq %rax
movq %rax, (%rsp)
cmpq 0x20(%r14), %rax
jb 0x2786b
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x28288
movq 0x70(%r14), %rsi
movq %rbx, %rdi
callq 0x2e1f0
movl (%r14), %eax
addl $-0x14, %eax
cmpl $0x9, %eax
ja 0x27b92
leaq 0x106a8(%rip), %rcx     # 0x37fec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x68(%r14), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x28288
movq 0x88(%r14), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x27c12
movq 0x78(%r14), %rsi
movq %rbx, %rdi
callq 0x2e1f0
movq $0x0, (%rsp)
cmpq $0x0, 0x78(%r14)
je 0x27bdf
xorl %eax, %eax
movq 0x88(%r14), %rcx
movq (%rcx,%rax,8), %r15
movslq (%r15), %rsi
movq %rbx, %rdi
callq 0x2e1f0
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0x2e1f0
movl 0x10(%r15), %esi
movq %rbx, %rdi
callq 0x2e4c2
movq 0x18(%r15), %rsi
movq %rbx, %rdi
callq 0x27c12
xorl %esi, %esi
cmpq $0x0, 0x28(%r15)
setne %sil
movq %rbx, %rdi
callq 0x2e4c2
movq 0x28(%r15), %rsi
testq %rsi, %rsi
je 0x279f5
movq %rbx, %rdi
callq 0x28288
movq (%rsp), %rax
incq %rax
movq %rax, (%rsp)
cmpq 0x78(%r14), %rax
jb 0x27997
jmp 0x27bdf
movq 0x88(%r14), %rsi
movq %rbx, %rdi
callq 0x27c12
movq 0x38(%r14), %rsi
movq %rbx, %rdi
callq 0x2e1f0
movq $0x0, (%rsp)
cmpq $0x0, 0x38(%r14)
je 0x27aa7
xorl %eax, %eax
movq 0x30(%r14), %rcx
movq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x28288
movq (%rsp), %rax
incq %rax
movq %rax, (%rsp)
cmpq 0x38(%r14), %rax
jb 0x27a37
jmp 0x27aa7
movq 0x88(%r14), %rsi
movq %rbx, %rdi
callq 0x27c12
movq 0x48(%r14), %rsi
movq %rbx, %rdi
callq 0x2e1f0
movq $0x0, (%rsp)
cmpq $0x0, 0x48(%r14)
je 0x27aa7
xorl %eax, %eax
movq 0x40(%r14), %rcx
movq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x28288
movq (%rsp), %rax
incq %rax
movq %rax, (%rsp)
cmpq 0x48(%r14), %rax
jb 0x27a86
movq 0x68(%r14), %rax
movq (%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x28288
movq 0x78(%r14), %rsi
movq %rbx, %rdi
callq 0x2e1f0
movq $0x0, (%rsp)
cmpq $0x0, 0x78(%r14)
je 0x27bdf
xorl %eax, %eax
movq 0x88(%r14), %rcx
movq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x27c12
movq (%rsp), %rax
incq %rax
movq %rax, (%rsp)
cmpq 0x78(%r14), %rax
jb 0x27ae2
jmp 0x27bdf
movq 0x80(%r14), %rdi
testq %rdi, %rdi
je 0x27bc6
callq 0x2d71f
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2e1f0
movq %rsp, %rsi
movq $0x0, (%rsi)
movq 0x80(%r14), %rdi
callq 0x2d753
testl %eax, %eax
je 0x27bd0
movq %rsp, %r15
leaq 0x3a6a5(%rip), %r12     # 0x621f8
movq (%rsp), %rsi
cmpq $0x7, %rsi
ja 0x27b66
orq $0x40000000, %rsi       # imm = 0x40000000
jmp 0x27b71
movq (%r12), %rax
movq (%rax,%rsi,8), %rax
movslq (%rax), %rsi
movq %rbx, %rdi
callq 0x2e1f0
incq (%rsp)
movq 0x80(%r14), %rdi
movq %r15, %rsi
callq 0x2d753
testl %eax, %eax
jne 0x27b53
jmp 0x27bd0
movq $0x0, (%rsp)
cmpq $0x0, 0x70(%r14)
je 0x27bdf
xorl %eax, %eax
movq 0x68(%r14), %rcx
movq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x28288
movq (%rsp), %rax
incq %rax
movq %rax, (%rsp)
cmpq 0x70(%r14), %rax
jb 0x27ba3
jmp 0x27bdf
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2e1f0
movq 0x88(%r14), %rsi
movq %rbx, %rdi
callq 0x2e249
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x105f1(%rip), %rdi     # 0x381e3
xorl %eax, %eax
callq 0x13a00
movq %r14, %rdi
callq 0x23e44
leaq 0x105f7(%rip), %rdi     # 0x381ff
movq %rax, %rsi
xorl %eax, %eax
callq 0x13a00