// File: /workspace/github_c_makefile_star2_O2/oridb[P]mc/parse/type.c
// Function: tyidfmt
size_t
tyidfmt(char *buf, size_t sz, Type *ty)
{
	size_t i;
	char *p, *end;

	ty = tysearch(ty);
	p = buf;
	end = buf + sz;
	switch (ty->type) {
	case Ntypes:
	case Tybad:	die("invalid type");	break;
	case Tyvar:	die("tyvar has no idstr");	break;
	case Tyvoid:	p += bprintf(p, end - p, "v");	break;
	case Tychar:	p += bprintf(p, end - p, "c");	break;
	case Tybool:	p += bprintf(p, end - p, "t");	break;
	case Tyint8:	p += bprintf(p, end - p, "b");	break;
	case Tyint16:	p += bprintf(p, end - p, "s");	break;
	case Tyint:	p += bprintf(p, end - p, "i");	break;
	case Tyint32:	p += bprintf(p, end - p, "w");	break;
	case Tyint64:	p += bprintf(p, end - p, "q");	break;

	case Tybyte:	p += bprintf(p, end - p, "H");	break;
	case Tyuint8:	p += bprintf(p, end - p, "B");	break;
	case Tyuint16:	p += bprintf(p, end - p, "S");	break;
	case Tyuint:	p += bprintf(p, end - p, "I");	break;
	case Tyuint32:	p += bprintf(p, end - p, "W");	break;
	case Tyuint64:	p += bprintf(p, end - p, "Q");	break;
	case Tyflt32:	p += bprintf(p, end - p, "f");	break;
	case Tyflt64:	p += bprintf(p, end - p, "d");	break;
	case Tyvalist:	p += bprintf(p, end - p, "V");	break;
	case Typtr:
		p += bprintf(p, end - p, "$p");
		p += tyidfmt(p, end - p, ty->sub[0]);
		break;
	case Tyarray:
		p += bprintf(p, end - p, "$a%lld", (vlong)arraysz(ty->asize));
		p += tyidfmt(p, end - p, ty->sub[0]);
		break;
	case Tyslice:
		p += bprintf(p, end - p, "$s");
		p += tyidfmt(p, end - p, ty->sub[0]);
		break;
	case Tycode:
		p += bprintf(p, end - p, "$F");
		for (i = 0; i < ty->nsub; i++) {
			p += tyidfmt(p, end - p, ty->sub[i]);
			p += bprintf(p, end - p, "$");
		}
		break;
	case Tyfunc:
		p += bprintf(p, end - p, "$f");
		for (i = 0; i < ty->nsub; i++) {
			p += tyidfmt(p, end - p, ty->sub[i]);
			p += bprintf(p, end - p, "$");
		}
		break;
	case Tytuple:
		p += bprintf(p, end - p, "$e");
		for (i = 0; i < ty->nsub; i++) {
			p += tyidfmt(p, end - p, ty->sub[i]);
		}
		p += bprintf(p, end - p, "$");
		break;
	case Tystruct:	p += bprintf(p, end - p, "$t%lld", ty->tid);	break;
	case Tyunion:	p += bprintf(p, end - p, "$u%lld", ty->tid);	break;
	case Typaram:	p += bprintf(p, end - p, "$r%s", ty->pname);	break;
	case Tyunres:
	case Tyname:
		p += bprintf(p, end - p, "$n");
		if (ty->name->name.ns)
			p += bprintf(p, end - p, "%s", ty->name->name.ns);
		p += bprintf(p, end - p, "$%s", ty->name->name.name);
		if (ty->arg)
			for (i = 0; i < ty->narg; i++)
				p += tyidfmt(p, end - p, ty->arg[i]);
		else if (ty->gparam)
			for (i = 0; i < ty->ngparam; i++)
				p += tyidfmt(p, end - p, ty->gparam[i]);
		break;
	case Tygeneric:
		break;
	}
	return p - buf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %rbx
movq %rdx, %rdi
callq 0x1589c
movq %rax, %r14
movl (%rax), %eax
movq %rbx, %r15
cmpq $0x1f, %rax
ja 0x219d2
leaq (%rbx,%r12), %rbp
leaq 0x12631(%rip), %rcx     # 0x33cb8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq %rbx, %r15
jmpq *%rax
leaq 0x12777(%rip), %rdx     # 0x33e11
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x2a9bf
leaq (%rbx,%rax), %r13
movq 0x88(%r14), %rdx
movq 0x18(%rdx), %rcx
testq %rcx, %rcx
je 0x216dc
subq %rax, %r12
leaq 0x113d8(%rip), %rdx     # 0x32a9d
movq %r13, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x2a9bf
addq %rax, %r13
movq 0x88(%r14), %rdx
movq %rbp, %rsi
subq %r13, %rsi
movq 0x20(%rdx), %rcx
leaq 0x10200(%rip), %rdx     # 0x318ed
movq %r13, %rdi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r15
addq %r13, %r15
cmpq $0x0, 0x40(%r14)
je 0x219e7
xorl %r12d, %r12d
cmpq 0x48(%r14), %r12
jae 0x219d2
movq %rbp, %rsi
subq %r15, %rsi
movq 0x40(%r14), %rax
movq (%rax,%r12,8), %rdx
movq %r15, %rdi
callq 0x21651
addq %rax, %r15
incq %r12
jmp 0x2170b
movl 0x4(%r14), %ecx
leaq 0x126c0(%rip), %rdx     # 0x33dfe
jmp 0x218f9
movq 0x88(%r14), %rcx
leaq 0x126bb(%rip), %rdx     # 0x33e0c
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x2a9bf
jmp 0x219cc
movq 0x88(%r14), %rdi
callq 0x1b58b
leaq 0x12675(%rip), %rdx     # 0x33deb
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rcx
xorl %eax, %eax
callq 0x2a9bf
jmp 0x21997
leaq 0x12669(%rip), %rdx     # 0x33dfb
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r12
addq %rbx, %r12
movq %rbp, %rsi
subq %r12, %rsi
cmpq 0x70(%r14), %r15
jae 0x217cc
movq 0x68(%r14), %rax
movq (%rax,%r15,8), %rdx
movq %r12, %rdi
callq 0x21651
addq %rax, %r12
incq %r15
jmp 0x217a8
leaq 0x9aa2(%rip), %rdx      # 0x2b275
movq %r12, %rdi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r15
addq %r12, %r15
jmp 0x219d2
leaq 0x12606(%rip), %rdx     # 0x33df5
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r15
addq %rbx, %r15
xorl %r12d, %r12d
cmpq 0x70(%r14), %r12
jae 0x219d2
movq %rbp, %rsi
subq %r15, %rsi
movq 0x68(%r14), %rax
movq (%rax,%r12,8), %rdx
movq %r15, %rdi
callq 0x21651
movq %rax, %r13
addq %r15, %r13
movq %rbp, %rsi
subq %r13, %rsi
movq %r13, %rdi
leaq 0x9a3a(%rip), %rdx      # 0x2b275
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r15
addq %r13, %r15
incq %r12
jmp 0x21805
leaq 0x135f9(%rip), %rdx     # 0x34e4d
jmp 0x219bf
leaq 0xae0a(%rip), %rdx      # 0x2c66a
jmp 0x219bf
leaq 0x11301(%rip), %rdx     # 0x32b6d
jmp 0x219bf
leaq 0xa06b(%rip), %rdx      # 0x2b8e3
jmp 0x219bf
leaq 0x12574(%rip), %rdx     # 0x33df8
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r15
addq %rbx, %r15
xorl %r12d, %r12d
cmpq 0x70(%r14), %r12
jae 0x219d2
movq %rbp, %rsi
subq %r15, %rsi
movq 0x68(%r14), %rax
movq (%rax,%r12,8), %rdx
movq %r15, %rdi
callq 0x21651
movq %rax, %r13
addq %r15, %r13
movq %rbp, %rsi
subq %r13, %rsi
movq %r13, %rdi
leaq 0x99a5(%rip), %rdx      # 0x2b275
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r15
addq %r13, %r15
incq %r12
jmp 0x2189a
leaq 0x1250a(%rip), %rdx     # 0x33df3
jmp 0x219bf
movl 0x4(%r14), %ecx
leaq 0x1250c(%rip), %rdx     # 0x33e05
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x2a9bf
jmp 0x219cc
leaq 0x11f2b(%rip), %rdx     # 0x3383d
jmp 0x219bf
leaq 0xfcf7(%rip), %rdx      # 0x31615
jmp 0x219bf
leaq 0x124bc(%rip), %rdx     # 0x33de6
jmp 0x219bf
leaq 0x108b2(%rip), %rdx     # 0x321e8
jmp 0x219bf
leaq 0xad0d(%rip), %rdx      # 0x2c64f
jmp 0x219bf
leaq 0x9f3a(%rip), %rdx      # 0x2b885
jmp 0x219bf
leaq 0xc3a2(%rip), %rdx      # 0x2dcf6
jmp 0x219bf
leaq 0xacd3(%rip), %rdx      # 0x2c630
jmp 0x219bf
leaq 0xad58(%rip), %rdx      # 0x2c6be
jmp 0x219bf
leaq 0x1248a(%rip), %rdx     # 0x33df9
jmp 0x219bf
leaq 0xb17a(%rip), %rdx      # 0x2caf2
jmp 0x219bf
leaq 0x12471(%rip), %rdx     # 0x33df2
jmp 0x2198a
leaq 0x1245e(%rip), %rdx     # 0x33de8
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x2a9bf
leaq (%rbx,%rax), %r13
subq %rax, %r12
movq 0x68(%r14), %rax
movq (%rax), %rdx
movq %r13, %rdi
movq %r12, %rsi
callq 0x21651
movq %rax, %r15
addq %r13, %r15
jmp 0x219d2
leaq 0xacfd(%rip), %rdx      # 0x2c6bc
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r15
addq %rbx, %r15
subq %rbx, %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x30(%r14)
je 0x219d2
xorl %r12d, %r12d
cmpq 0x38(%r14), %r12
jae 0x219d2
movq %rbp, %rsi
subq %r15, %rsi
movq 0x30(%r14), %rax
movq (%rax,%r12,8), %rdx
movq %r15, %rdi
callq 0x21651
addq %rax, %r15
incq %r12
jmp 0x219f1
leaq 0x123aa(%rip), %rdi     # 0x33dc6
jmp 0x21a25
leaq 0x123ae(%rip), %rdi     # 0x33dd3
xorl %eax, %eax
callq 0x1205c