// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/6/typeinfo.c
// Function: tydescsub
Blob *
tydescsub(Type *ty)
{
	Blob **sub, *sz, *bt, *b;
	size_t i, nsub;
	char buf[512];
	uint8_t tt;
	Node *len;
	int isextern;

	sub = NULL;
	nsub = 0;
	/* names are pulled out of line */
	tt = ty->type;
	/* tyvars can get tagged, but aren't desired */
	if (ty->type == Tyvar)
		return NULL;

	ty = tydedup(ty);
	if (ty->type == Tyname)
		tt |= Tdindirect;
	sz = mkblobi(Btimin, 0);
	bt = mkblobi(Bti8, tt);
	lappend(&sub, &nsub, bt);
	switch (ty->type) {
	case Ntypes: case Tyvar: case Tybad: case Typaram:
	case Tygeneric: case Tycode: case Tyunres:
		die("invalid type in tydesc");
		break;

		/* atomic types -- nothing else to do */
	case Tyvoid: case Tychar: case Tybool: case Tyint8:
	case Tyint16: case Tyint: case Tyint32: case Tyint64:
	case Tybyte: case Tyuint8: case Tyuint16:
	case Tyuint: case Tyuint32: case Tyuint64:
	case Tyflt32: case Tyflt64: case Tyvalist:
		break;

	case Typtr:
		lappend(&sub, &nsub, tydescsub(ty->sub[0]));
		break;
	case Tyslice:
		lappend(&sub, &nsub, tydescsub(ty->sub[0]));
		break;
	case Tyarray:
		encodetypeinfo(&sub, &nsub, ty);
		ty->asize = fold(ty->asize, 1);
		len = ty->asize;
		if (len) {
			assert(len->type == Nexpr);
			len = len->expr.args[0];
			assert(len->type == Nlit && len->lit.littype == Lint);
			lappend(&sub, &nsub, mkblobi(Btimin, len->lit.intval));
		} else {
			lappend(&sub, &nsub, mkblobi(Btimin, 0));
		}

		lappend(&sub, &nsub, tydescsub(ty->sub[0]));
		break;
	case Tyfunc:
		lappend(&sub, &nsub, mkblobi(Btimin, ty->nsub));
		for (i = 0; i < ty->nsub; i++)
			lappend(&sub, &nsub, tydescsub(ty->sub[i]));
		break;
	case Tytuple:
		encodetypeinfo(&sub, &nsub, ty);
		lappend(&sub, &nsub, mkblobi(Btimin, ty->nsub));
		for (i = 0; i < ty->nsub; i++)
			lappend(&sub, &nsub, tydescsub(ty->sub[i]));
		break;
	case Tystruct:
		encodetypeinfo(&sub, &nsub, ty);
		lappend(&sub, &nsub, mkblobi(Btimin, ty->nmemb));
		for (i = 0; i < ty->nmemb; i++)
			structmemb(&sub, &nsub, ty->sdecls[i]);
		break;
	case Tyunion:
		encodetypeinfo(&sub, &nsub, ty);
		lappend(&sub, &nsub, mkblobi(Btimin, ty->nmemb));
		for (i = 0; i < ty->nmemb; i++)
			unionmemb(&sub, &nsub, ty->udecls[i]);
		break;
	case Tyname:
		i = bprintf(buf, sizeof buf, "%s", Symprefix);
		tydescid(buf + i, sizeof buf - i, ty);
		isextern = ty->isimport || ty->vis != Visintern;
		lappend(&sub, &nsub, mkblobref(buf, 0, isextern));
		break;
	}
	b = mkblobseq(sub, nsub);
	sz->ival = blobsz(b);
	linsert(&b->seq.sub, &b->seq.nsub, 0, sz);
	return b;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movb %al, -0x241(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x19, (%rax)
jne 0x1b831
movq $0x0, -0x8(%rbp)
jmp 0x1bd3a
movq -0x10(%rbp), %rdi
callq 0x36b70
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1c, (%rax)
jne 0x1b859
movzbl -0x241(%rbp), %eax
orl $0x80, %eax
movb %al, -0x241(%rbp)
xorl %eax, %eax
movl %eax, -0x264(%rbp)
movl %eax, %esi
movl $0x4, %edi
callq 0x6480
movl -0x264(%rbp), %edi
movq %rax, -0x20(%rbp)
movzbl -0x241(%rbp), %eax
movl %eax, %esi
callq 0x6480
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x48290
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x260(%rbp)
subq $0x1f, %rax
ja 0x1bcec
movq -0x260(%rbp), %rax
leaq 0x32ca1(%rip), %rcx     # 0x4e560
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x32e5f(%rip), %rdi     # 0x4e72e
movb $0x0, %al
callq 0x1df20
jmp 0x1bcec
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rdi
callq 0x1b7f0
movq %rax, %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x48290
jmp 0x1bcec
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rdi
callq 0x1b7f0
movq %rax, %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x48290
jmp 0x1bcec
movq -0x10(%rbp), %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1bd50
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movl $0x1, %esi
callq 0x1f390
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x88(%rax)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x250(%rbp)
cmpq $0x0, -0x250(%rbp)
je 0x1ba1e
movq -0x250(%rbp), %rax
cmpl $0x8, 0x8(%rax)
jne 0x1b988
jmp 0x1b9a7
leaq 0x32db6(%rip), %rdi     # 0x4e745
leaq 0x32dc2(%rip), %rsi     # 0x4e758
movl $0x9a, %edx
leaq 0x32dc1(%rip), %rcx     # 0x4e763
callq 0x6160
movq -0x250(%rbp), %rax
movq 0x50(%rax), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
movq -0x250(%rbp), %rax
cmpl $0x9, 0x8(%rax)
jne 0x1b9d8
movq -0x250(%rbp), %rax
cmpl $0x2, 0x18(%rax)
jne 0x1b9d8
jmp 0x1b9f7
leaq 0x32d9c(%rip), %rdi     # 0x4e77b
leaq 0x32d72(%rip), %rsi     # 0x4e758
movl $0x9c, %edx
leaq 0x32d71(%rip), %rcx     # 0x4e763
callq 0x6160
movq -0x250(%rbp), %rax
movq 0x30(%rax), %rsi
movl $0x4, %edi
callq 0x6480
movq %rax, %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x48290
jmp 0x1ba3c
movl $0x4, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x6480
movq %rax, %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x48290
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rdi
callq 0x1b7f0
movq %rax, %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x48290
jmp 0x1bcec
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rsi
movl $0x4, %edi
callq 0x6480
movq %rax, %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x48290
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jae 0x1bacc
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1b7f0
movq %rax, %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x48290
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1ba8b
jmp 0x1bcec
movq -0x10(%rbp), %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1bd50
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rsi
movl $0x4, %edi
callq 0x6480
movq %rax, %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x48290
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jae 0x1bb4d
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1b7f0
movq %rax, %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x48290
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1bb0c
jmp 0x1bcec
movq -0x10(%rbp), %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1bd50
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rsi
movl $0x4, %edi
callq 0x6480
movq %rax, %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x48290
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x78(%rcx), %rax
jae 0x1bbc9
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1bde0
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1bb8d
jmp 0x1bcec
movq -0x10(%rbp), %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1bd50
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rsi
movl $0x4, %edi
callq 0x6480
movq %rax, %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x48290
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x78(%rcx), %rax
jae 0x1bc45
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1be40
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1bc09
jmp 0x1bcec
leaq -0x240(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
leaq 0x36e3e(%rip), %rdx     # 0x52a9b
leaq 0x39bc1(%rip), %rcx     # 0x55825
movb $0x0, %al
callq 0x4a230
movq %rax, -0x38(%rbp)
leaq -0x240(%rbp), %rdi
addq -0x38(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
subq -0x38(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x7b70
movq -0x10(%rbp), %rax
movsbl 0x94(%rax), %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x265(%rbp)
jne 0x1bcb5
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
setne %al
movb %al, -0x265(%rbp)
movb -0x265(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x254(%rbp)
leaq -0x240(%rbp), %rdi
movl -0x254(%rbp), %edx
xorl %eax, %eax
movl %eax, %esi
callq 0x65a0
movq %rax, %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x48290
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x6550
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x1b540
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
addq $0x8, %rdi
movq -0x30(%rbp), %rsi
addq $0x20, %rsi
movq -0x20(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x48370
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
nopw (%rax,%rax)