// File: /workspace/github_c_makefile_star2_O3/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 0x17094
movq %rax, %r14
movl (%rax), %eax
movq %rbx, %r12
cmpq $0x1f, %rax
ja 0x24446
leaq (%rbx,%r13), %r15
leaq 0x13bd6(%rip), %rcx     # 0x37ca8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq %rbx, %r12
jmpq *%rax
leaq 0x13d1c(%rip), %rdx     # 0x37e01
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
leaq (%rbx,%rax), %rbp
movq 0x88(%r14), %rdx
movq 0x18(%rdx), %rcx
testq %rcx, %rcx
je 0x24127
subq %rax, %r13
leaq 0x129bd(%rip), %rdx     # 0x36acd
movq %rbp, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
addq %rax, %rbp
movq 0x88(%r14), %rdx
movq %r15, %rsi
subq %rbp, %rsi
movq 0x20(%rdx), %rcx
leaq 0x117e5(%rip), %rdx     # 0x3591d
movq %rbp, %rdi
xorl %eax, %eax
callq 0x2dfae
movq %rax, %r12
addq %rbp, %r12
cmpq $0x0, 0x40(%r14)
je 0x2445b
cmpq $0x0, 0x48(%r14)
je 0x24446
xorl %r13d, %r13d
movq %r15, %rsi
subq %r12, %rsi
movq 0x40(%r14), %rax
movq (%rax,%r13,8), %rdx
movq %r12, %rdi
callq 0x2409c
addq %rax, %r12
incq %r13
cmpq 0x48(%r14), %r13
jb 0x24161
jmp 0x24446
movl 0x4(%r14), %ecx
leaq 0x13c5b(%rip), %rdx     # 0x37dee
jmp 0x2436d
movq 0x88(%r14), %rcx
leaq 0x13c56(%rip), %rdx     # 0x37dfc
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
jmp 0x24440
movq 0x88(%r14), %rdi
callq 0x1d3b3
leaq 0x13c10(%rip), %rdx     # 0x37ddb
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rcx
xorl %eax, %eax
callq 0x2dfae
jmp 0x2440b
leaq 0x13c04(%rip), %rdx     # 0x37deb
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
movq %rax, %r13
addq %rbx, %r13
cmpq $0x0, 0x70(%r14)
je 0x24226
xorl %r12d, %r12d
movq %r15, %rsi
subq %r13, %rsi
movq 0x68(%r14), %rax
movq (%rax,%r12,8), %rdx
movq %r13, %rdi
callq 0x2409c
addq %rax, %r13
incq %r12
cmpq 0x70(%r14), %r12
jb 0x24204
subq %r13, %r15
leaq 0xb045(%rip), %rdx      # 0x2f275
movq %r13, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2dfae
movq %rax, %r12
addq %r13, %r12
jmp 0x24446
leaq 0x13b96(%rip), %rdx     # 0x37de5
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
movq %rax, %r12
addq %rbx, %r12
cmpq $0x0, 0x70(%r14)
je 0x24446
xorl %r13d, %r13d
movq %r15, %rsi
subq %r12, %rsi
movq 0x68(%r14), %rax
movq (%rax,%r13,8), %rdx
movq %r12, %rdi
callq 0x2409c
movq %rax, %rbp
addq %r12, %rbp
movq %r15, %rsi
subq %rbp, %rsi
movq %rbp, %rdi
leaq 0xafd9(%rip), %rdx      # 0x2f275
xorl %eax, %eax
callq 0x2dfae
movq %rax, %r12
addq %rbp, %r12
incq %r13
cmpq 0x70(%r14), %r13
jb 0x24270
jmp 0x24446
leaq 0x14b6b(%rip), %rdx     # 0x38e29
jmp 0x24433
leaq 0xc3a0(%rip), %rdx      # 0x3066a
jmp 0x24433
leaq 0x128c7(%rip), %rdx     # 0x36b9d
jmp 0x24433
leaq 0xb601(%rip), %rdx      # 0x2f8e3
jmp 0x24433
leaq 0x13afa(%rip), %rdx     # 0x37de8
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
movq %rax, %r12
addq %rbx, %r12
cmpq $0x0, 0x70(%r14)
je 0x24446
xorl %r13d, %r13d
movq %r15, %rsi
subq %r12, %rsi
movq 0x68(%r14), %rax
movq (%rax,%r13,8), %rdx
movq %r12, %rdi
callq 0x2409c
movq %rax, %rbp
addq %r12, %rbp
movq %r15, %rsi
subq %rbp, %rsi
movq %rbp, %rdi
leaq 0xaf3a(%rip), %rdx      # 0x2f275
xorl %eax, %eax
callq 0x2dfae
movq %rax, %r12
addq %rbp, %r12
incq %r13
cmpq 0x70(%r14), %r13
jb 0x2430f
jmp 0x24446
leaq 0x13a86(%rip), %rdx     # 0x37de3
jmp 0x24433
movl 0x4(%r14), %ecx
leaq 0x13a88(%rip), %rdx     # 0x37df5
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
jmp 0x24440
leaq 0x134e7(%rip), %rdx     # 0x3786d
jmp 0x24433
leaq 0x112b3(%rip), %rdx     # 0x35645
jmp 0x24433
leaq 0x13a38(%rip), %rdx     # 0x37dd6
jmp 0x24433
leaq 0x11e6e(%rip), %rdx     # 0x36218
jmp 0x24433
leaq 0xc299(%rip), %rdx      # 0x3064f
jmp 0x24433
leaq 0xb4c6(%rip), %rdx      # 0x2f885
jmp 0x24433
leaq 0xd92e(%rip), %rdx      # 0x31cf6
jmp 0x24433
leaq 0xc25f(%rip), %rdx      # 0x30630
jmp 0x24433
leaq 0xc2e4(%rip), %rdx      # 0x306be
jmp 0x24433
leaq 0x13a06(%rip), %rdx     # 0x37de9
jmp 0x24433
leaq 0xc706(%rip), %rdx      # 0x30af2
jmp 0x24433
leaq 0x139ed(%rip), %rdx     # 0x37de2
jmp 0x243fe
leaq 0x139da(%rip), %rdx     # 0x37dd8
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
leaq (%rbx,%rax), %r15
subq %rax, %r13
movq 0x68(%r14), %rax
movq (%rax), %rdx
movq %r15, %rdi
movq %r13, %rsi
callq 0x2409c
movq %rax, %r12
addq %r15, %r12
jmp 0x24446
leaq 0xc289(%rip), %rdx      # 0x306bc
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
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 0x24446
cmpq $0x0, 0x38(%r14)
je 0x24446
xorl %r13d, %r13d
movq %r15, %rsi
subq %r12, %rsi
movq 0x30(%r14), %rax
movq (%rax,%r13,8), %rdx
movq %r12, %rdi
callq 0x2409c
addq %rax, %r12
incq %r13
cmpq 0x38(%r14), %r13
jb 0x2446c
jmp 0x24446
leaq 0x1391f(%rip), %rdi     # 0x37db6
jmp 0x244a0
leaq 0x13923(%rip), %rdi     # 0x37dc3
xorl %eax, %eax
callq 0x13844