// File: /workspace/github_c_makefile_star2_O1/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, %r13
movq %rdi, %rbx
movq %rdx, %rdi
callq 0x1727c
movq %rax, %r14
movl (%rax), %eax
movq %rbx, %r12
cmpq $0x1f, %rax
ja 0x248be
leaq (%rbx,%r13), %r15
leaq 0x1378e(%rip), %rcx     # 0x37cd8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq %rbx, %r12
jmpq *%rax
leaq 0x138d4(%rip), %rdx     # 0x37e31
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2e42e
leaq (%rbx,%rax), %rbp
movq 0x88(%r14), %rcx
movq 0x18(%rcx), %rcx
testq %rcx, %rcx
je 0x24598
subq %rax, %r13
leaq 0x12535(%rip), %rdx     # 0x36abd
movq %rbp, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2e42e
addq %rax, %rbp
movq %r15, %rsi
subq %rbp, %rsi
movq 0x88(%r14), %rax
movq 0x20(%rax), %rcx
leaq 0x1135d(%rip), %rdx     # 0x3590d
movq %rbp, %rdi
xorl %eax, %eax
callq 0x2e42e
movq %rax, %r12
addq %rbp, %r12
cmpq $0x0, 0x40(%r14)
je 0x248d3
cmpq $0x0, 0x48(%r14)
je 0x248be
xorl %r13d, %r13d
movq %r15, %rsi
subq %r12, %rsi
movq 0x40(%r14), %rax
movq (%rax,%r13,8), %rdx
movq %r12, %rdi
callq 0x24514
addq %rax, %r12
incq %r13
cmpq 0x48(%r14), %r13
jb 0x245d9
jmp 0x248be
movl 0x4(%r14), %ecx
leaq 0x13813(%rip), %rdx     # 0x37e1e
jmp 0x247e5
movq 0x88(%r14), %rcx
leaq 0x1380e(%rip), %rdx     # 0x37e2c
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2e42e
jmp 0x248b8
movq 0x88(%r14), %rdi
callq 0x1d603
leaq 0x137c8(%rip), %rdx     # 0x37e0b
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rcx
xorl %eax, %eax
callq 0x2e42e
jmp 0x24883
leaq 0x137bc(%rip), %rdx     # 0x37e1b
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2e42e
movq %rax, %r13
addq %rbx, %r13
cmpq $0x0, 0x70(%r14)
je 0x2469e
xorl %r12d, %r12d
movq %r15, %rsi
subq %r13, %rsi
movq 0x68(%r14), %rax
movq (%rax,%r12,8), %rdx
movq %r13, %rdi
callq 0x24514
addq %rax, %r13
incq %r12
cmpq 0x70(%r14), %r12
jb 0x2467c
subq %r13, %r15
leaq 0xabcd(%rip), %rdx      # 0x2f275
movq %r13, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2e42e
movq %rax, %r12
addq %r13, %r12
jmp 0x248be
leaq 0x1374e(%rip), %rdx     # 0x37e15
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2e42e
movq %rax, %r12
addq %rbx, %r12
cmpq $0x0, 0x70(%r14)
je 0x248be
xorl %r13d, %r13d
movq %r15, %rsi
subq %r12, %rsi
movq 0x68(%r14), %rax
movq (%rax,%r13,8), %rdx
movq %r12, %rdi
callq 0x24514
movq %rax, %rbp
addq %r12, %rbp
movq %r15, %rsi
subq %rbp, %rsi
movq %rbp, %rdi
leaq 0xab61(%rip), %rdx      # 0x2f275
xorl %eax, %eax
callq 0x2e42e
movq %rax, %r12
addq %rbp, %r12
incq %r13
cmpq 0x70(%r14), %r13
jb 0x246e8
jmp 0x248be
leaq 0x14723(%rip), %rdx     # 0x38e59
jmp 0x248ab
leaq 0xbf28(%rip), %rdx      # 0x3066a
jmp 0x248ab
leaq 0x1243f(%rip), %rdx     # 0x36b8d
jmp 0x248ab
leaq 0xb189(%rip), %rdx      # 0x2f8e3
jmp 0x248ab
leaq 0x136b2(%rip), %rdx     # 0x37e18
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2e42e
movq %rax, %r12
addq %rbx, %r12
cmpq $0x0, 0x70(%r14)
je 0x248be
xorl %r13d, %r13d
movq %r15, %rsi
subq %r12, %rsi
movq 0x68(%r14), %rax
movq (%rax,%r13,8), %rdx
movq %r12, %rdi
callq 0x24514
movq %rax, %rbp
addq %r12, %rbp
movq %r15, %rsi
subq %rbp, %rsi
movq %rbp, %rdi
leaq 0xaac2(%rip), %rdx      # 0x2f275
xorl %eax, %eax
callq 0x2e42e
movq %rax, %r12
addq %rbp, %r12
incq %r13
cmpq 0x70(%r14), %r13
jb 0x24787
jmp 0x248be
leaq 0x1363e(%rip), %rdx     # 0x37e13
jmp 0x248ab
movl 0x4(%r14), %ecx
leaq 0x13640(%rip), %rdx     # 0x37e25
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2e42e
jmp 0x248b8
leaq 0x1305f(%rip), %rdx     # 0x3785d
jmp 0x248ab
leaq 0x10e2b(%rip), %rdx     # 0x35635
jmp 0x248ab
leaq 0x135f0(%rip), %rdx     # 0x37e06
jmp 0x248ab
leaq 0x119e6(%rip), %rdx     # 0x36208
jmp 0x248ab
leaq 0xbe21(%rip), %rdx      # 0x3064f
jmp 0x248ab
leaq 0xb04e(%rip), %rdx      # 0x2f885
jmp 0x248ab
leaq 0xd4a6(%rip), %rdx      # 0x31ce6
jmp 0x248ab
leaq 0xbde7(%rip), %rdx      # 0x30630
jmp 0x248ab
leaq 0xbe6c(%rip), %rdx      # 0x306be
jmp 0x248ab
leaq 0x135be(%rip), %rdx     # 0x37e19
jmp 0x248ab
leaq 0xc27e(%rip), %rdx      # 0x30ae2
jmp 0x248ab
leaq 0x135a5(%rip), %rdx     # 0x37e12
jmp 0x24876
leaq 0x13592(%rip), %rdx     # 0x37e08
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2e42e
leaq (%rbx,%rax), %r15
subq %rax, %r13
movq 0x68(%r14), %rax
movq (%rax), %rdx
movq %r15, %rdi
movq %r13, %rsi
callq 0x24514
movq %rax, %r12
addq %r15, %r12
jmp 0x248be
leaq 0xbe11(%rip), %rdx      # 0x306bc
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2e42e
movq %rax, %r12
addq %rbx, %r12
subq %rbx, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x30(%r14)
je 0x248be
cmpq $0x0, 0x38(%r14)
je 0x248be
xorl %r13d, %r13d
movq %r15, %rsi
subq %r12, %rsi
movq 0x30(%r14), %rax
movq (%rax,%r13,8), %rdx
movq %r12, %rdi
callq 0x24514
addq %rax, %r12
incq %r13
cmpq 0x38(%r14), %r13
jb 0x248e4
jmp 0x248be
leaq 0x134d7(%rip), %rdi     # 0x37de6
jmp 0x24918
leaq 0x134db(%rip), %rdi     # 0x37df3
xorl %eax, %eax
callq 0x13a00