// File: /workspace/github_c_makefile_star2_O2/oridb[P]mc/parse/type.c
// Function: tybfmt
static int
tybfmt(char *buf, size_t len, Bitset *visited, Type *t)
{
	size_t i;
	char *p;
	char *end;
	char *sep;

	if (t)
		t = tysearch(t);

	sep = "";
	p = buf;
	end = p + len;

	if (!t) {
		p += bprintf(p, end - p, "tynil");
		return len - (end - p);
	}

	if (bshas(visited, t->tid)) {
		p += bprintf(buf, len, "<...>");
		return len - (end - p);
	}
        bsput(visited, t->tid);
	switch (t->type) {
	case Tybad:	p += bprintf(p, end - p, "BAD");	break;
	case Tyvoid:	p += bprintf(p, end - p, "void");	break;
	case Tybool:	p += bprintf(p, end - p, "bool");	break;
	case Tychar:	p += bprintf(p, end - p, "char");	break;
	case Tyint8:	p += bprintf(p, end - p, "int8");	break;
	case Tyint16:	p += bprintf(p, end - p, "int16");	break;
	case Tyint:	p += bprintf(p, end - p, "int");	break;
	case Tyint32:	p += bprintf(p, end - p, "int32");	break;
	case Tyint64:	p += bprintf(p, end - p, "int64");	break;
	case Tybyte:	p += bprintf(p, end - p, "byte");	break;
	case Tyuint8:	p += bprintf(p, end - p, "uint8");	break;
	case Tyuint16:	p += bprintf(p, end - p, "uint16");	break;
	case Tyuint:	p += bprintf(p, end - p, "uint");	break;
	case Tyuint32:	p += bprintf(p, end - p, "uint32");	break;
	case Tyuint64:	p += bprintf(p, end - p, "uint64");	break;
	case Tyflt32:	p += bprintf(p, end - p, "flt32");	break;
	case Tyflt64:	p += bprintf(p, end - p, "flt64");	break;
	case Tyvalist:	p += bprintf(p, end - p, "...");	break;
	case Tyvar:     p += bprintf(p, end - p, "$%d", t->tid);        break;

	case Typtr:
		p += tybfmt(p, end - p, visited, t->sub[0]);
		p += bprintf(p, end - p, "#");
		break;
	case Tyslice:
		p += tybfmt(p, end - p, visited, t->sub[0]);
		p += bprintf(p, end - p, "[:]");
		break;
	case Tyarray:
		p += tybfmt(p, end - p, visited, t->sub[0]);
		if (t->asize) {
			i = t->asize->expr.args[0]->lit.intval;
			p += bprintf(p, end - p, "[%zd]", i);
		} else {
			p += bprintf(p, end - p, "[]");
		}
		break;
	case Tycode:
	case Tyfunc:
		p += bprintf(p, end - p, "(");
		for (i = 1; i < t->nsub; i++) {
			p += bprintf(p, end - p, "%s", sep);
			p += tybfmt(p, end - p, visited, t->sub[i]);
			sep = ", ";
		}
		p += bprintf(p, end - p, " -> ");
		p += tybfmt(p, end - p, visited, t->sub[0]);
		p += bprintf(p, end - p, ")");
		break;
	case Tytuple:
		p += bprintf(p, end - p, "(");
		for (i = 0; i < t->nsub; i++) {
			p += bprintf(p, end - p, "%s", sep);
			p += tybfmt(p, end - p, visited, t->sub[i]);
			sep = ",";
		}
		p += bprintf(p, end - p, ")");
		break;
	case Typaram:	p += bprintf(p, end - p, "@%s", t->pname);	break;
	case Tyunres:
		p += namefmt(p, end - p, t->name);
		if (t->narg)
			p += fmtlist(p, end - p, visited, t->arg, t->narg);
		break;
	case Tyname:
		if (t->name->name.ns)
			p += bprintf(p, end - p, "%s.", t->name->name.ns);
		p += bprintf(p, end - p, "%s", namestr(t->name));
		if (t->narg)
			p += fmtlist(p, end - p, visited, t->arg, t->narg);
		break;
	case Tygeneric:
		if (t->name->name.ns)
			p += bprintf(p, end - p, "%s.", t->name->name.ns);
		p += bprintf(p, end - p, "%s", namestr(t->name));
		if (t->ngparam)
			p += fmtlist(p, end - p, visited, t->gparam, t->ngparam);
		break;
	case Tystruct:	p += fmtstruct(p, end - p, visited, t);	break;
	case Tyunion:	p += fmtunion(p, end - p, visited, t);	break;
	case Ntypes:	die("Ntypes is not a type");	break;
	}

	/* we only show constraints on non-builtin typaram */
	if (t->type == Tyvar || t->type == Typaram)
		p += traitfmt(p, end - p, t);

        bsdel(visited, t->tid);
	return p - buf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rsi, %r13
movq %rdi, %rbx
testq %rcx, %rcx
je 0x20816
movq %rdx, %r12
movq %rcx, %rdi
callq 0x1589c
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x20816
movq 0x10(%rsp), %rax
movl 0x4(%rax), %r14d
movq %r12, %rdi
movq %r14, %rsi
callq 0x20633
testl %eax, %eax
je 0x20841
leaq 0x1367f(%rip), %rdx     # 0x33e93
jmp 0x2081d
leaq 0x13670(%rip), %rdx     # 0x33e8d
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %rbp
movl %ebp, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq (%rbx,%r13), %rax
movq %rax, 0x20(%rsp)
movq %r12, 0x18(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x29ed5
movq 0x10(%rsp), %rax
movl (%rax), %eax
movq %rbx, %rbp
cmpq $0x1f, %rax
ja 0x20c7e
leaq 0x13387(%rip), %rcx     # 0x33bfc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10b45(%rip), %rdx     # 0x313ca
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r13
movq %rbx, 0x28(%rsp)
addq %rbx, %r13
leaq 0xd5a6(%rip), %rcx      # 0x2de4a
pushq $0x1
popq %rbx
leaq 0x116da(%rip), %r12     # 0x31f88
movq 0x20(%rsp), %rbp
movq %rbp, %rsi
subq %r13, %rsi
movq 0x10(%rsp), %rax
cmpq 0x70(%rax), %rbx
jae 0x20909
movq %r13, %rdi
leaq 0x121cf(%rip), %rdx     # 0x32a9d
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r14
addq %r13, %r14
movq %rbp, %rsi
subq %r14, %rsi
movq 0x10(%rsp), %rax
movq 0x68(%rax), %rax
movq (%rax,%rbx,8), %rcx
movq %r14, %rdi
movq 0x18(%rsp), %rdx
callq 0x207c4
movslq %eax, %r13
addq %r14, %r13
incq %rbx
movq %r12, %rcx
jmp 0x208b3
leaq 0x1359a(%rip), %rdx     # 0x33eaa
movq %r13, %rdi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r14
addq %r13, %r14
movq %rbp, %rsi
subq %r14, %rsi
movq 0x10(%rsp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rcx
movq %r14, %rdi
movq 0x18(%rsp), %rdx
callq 0x207c4
movslq %eax, %r12
addq %r14, %r12
subq %r12, %rbp
leaq 0x12a74(%rip), %rdx     # 0x333c3
movq %r12, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %rbp
addq %r12, %rbp
jmp 0x20e4d
movq 0x10(%rsp), %rax
movq 0x88(%rax), %rcx
leaq 0x13535(%rip), %rdx     # 0x33eaf
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2a9bf
jmp 0x20c78
leaq 0x124b0(%rip), %rdx     # 0x32e43
jmp 0x20c6b
leaq 0x12497(%rip), %rdx     # 0x32e36
jmp 0x20c6b
leaq 0x12478(%rip), %rdx     # 0x32e23
jmp 0x20c6b
leaq 0x12467(%rip), %rdx     # 0x32e1e
jmp 0x20c6b
leaq 0x12467(%rip), %rdx     # 0x32e2a
jmp 0x20c6b
leaq 0x1350d(%rip), %rdx     # 0x33edc
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r13
movq %rbx, 0x28(%rsp)
addq %rbx, %r13
xorl %ebx, %ebx
movq 0x10(%rsp), %rax
cmpq 0x78(%rax), %rbx
jae 0x20a92
movq 0x10(%rsp), %rax
movq 0x88(%rax), %rax
movq (%rax,%rbx,8), %rax
movq 0x18(%rax), %rdx
movq 0x28(%rax), %rcx
movq 0x18(%rdx), %rbp
testq %rbp, %rbp
leaq 0x1347d(%rip), %r12     # 0x33e9b
leaq 0xd425(%rip), %rax      # 0x2de4a
cmoveq %rax, %r12
movq 0x20(%rdx), %r15
cmoveq %rax, %rbp
testq %rcx, %rcx
je 0x20a65
movl $0x200, %esi            # imm = 0x200
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq 0x18(%rsp), %rdx
callq 0x207c4
movq 0x20(%rsp), %rsi
subq %r13, %rsi
movq %r14, (%rsp)
movq %r13, %rdi
leaq 0x13480(%rip), %rdx     # 0x33ee3
jmp 0x20a77
movq 0x20(%rsp), %rsi
subq %r13, %rsi
movq %r13, %rdi
leaq 0x13479(%rip), %rdx     # 0x33ef0
movq %rbp, %rcx
movq %r12, %r8
movq %r15, %r9
xorl %eax, %eax
callq 0x2a9bf
addq %rax, %r13
incq %rbx
jmp 0x209e9
movq 0x20(%rsp), %rsi
subq %r13, %rsi
leaq 0x13438(%rip), %rdx     # 0x33ed9
movq %r13, %rdi
xorl %eax, %eax
callq 0x2a9bf
addl %eax, %r13d
movq 0x28(%rsp), %rbx
subl %ebx, %r13d
movslq %r13d, %rbp
jmp 0x20c7b
leaq 0x13403(%rip), %rdx     # 0x33ec8
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r13
movq %rbx, %r12
addq %rbx, %r13
leaq 0x30(%rsp), %rbp
xorl %ebx, %ebx
movq 0x10(%rsp), %r15
movq 0x10(%rsp), %rax
cmpq 0x78(%rax), %rbx
jae 0x20b51
movq 0x88(%r15), %rax
movq (%rax,%rbx,8), %rdi
callq 0x1befe
movq %rax, %r14
movq 0x88(%r15), %rax
movq (%rax,%rbx,8), %rdi
callq 0x1bf2d
movl $0x200, %esi            # imm = 0x200
movq %rbp, %rdi
movq 0x18(%rsp), %rdx
movq %rax, %rcx
callq 0x207c4
movq 0x20(%rsp), %rsi
subq %r13, %rsi
movq %r13, %rdi
leaq 0x13394(%rip), %rdx     # 0x33ed0
movq %r14, %rcx
movq %rbp, %r8
xorl %eax, %eax
callq 0x2a9bf
addq %rax, %r13
incq %rbx
jmp 0x20ae7
movq 0x20(%rsp), %rsi
subq %r13, %rsi
leaq 0x13379(%rip), %rdx     # 0x33ed9
movq %r13, %rdi
xorl %eax, %eax
callq 0x2a9bf
addl %eax, %r13d
movq %r12, %rbx
subl %ebx, %r13d
movslq %r13d, %rbp
addq %r12, %rbp
jmp 0x20c7e
leaq 0x12293(%rip), %rdx     # 0x32e18
jmp 0x20c6b
leaq 0x12267(%rip), %rdx     # 0x32df8
jmp 0x20c6b
leaq 0x122a0(%rip), %rdx     # 0x32e3d
jmp 0x20c6b
leaq 0x1226a(%rip), %rdx     # 0x32e13
jmp 0x20c6b
leaq 0x1227b(%rip), %rdx     # 0x32e30
jmp 0x20c6b
leaq 0x12159(%rip), %rdx     # 0x32d1a
jmp 0x20c6b
leaq 0x12241(%rip), %rdx     # 0x32e0e
jmp 0x20c6b
leaq 0x132c0(%rip), %rdx     # 0x33e99
jmp 0x20c6b
movq 0x10(%rsp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rcx
movq %rbx, %rdi
movq %r13, %rsi
movq 0x18(%rsp), %rdx
callq 0x207c4
cltq
leaq (%rbx,%rax), %r14
subq %rax, %r13
leaq 0x13293(%rip), %rdx     # 0x33e9d
jmp 0x20fb7
leaq 0x1220e(%rip), %rdx     # 0x32e24
jmp 0x20c6b
leaq 0x12210(%rip), %rdx     # 0x32e2f
jmp 0x20c6b
leaq 0x12082(%rip), %rdx     # 0x32caa
jmp 0x20c6b
movq 0x10(%rsp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rcx
movq %rbx, %rdi
movq %r13, %rsi
movq 0x18(%rsp), %rdx
callq 0x207c4
cltq
leaq (%rbx,%rax), %r14
subq %rax, %r13
leaq 0x120dc(%rip), %rdx     # 0x32d32
jmp 0x20fb7
leaq 0x121bb(%rip), %rdx     # 0x32e1d
jmp 0x20c6b
leaq 0x121cc(%rip), %rdx     # 0x32e37
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %rbp
addq %rbx, %rbp
movq 0x10(%rsp), %rax
movl (%rax), %eax
addl $-0x19, %eax
cmpl $0x1, %eax
ja 0x20ca7
movq 0x20(%rsp), %rsi
subq %rbp, %rsi
movq %rbp, %rdi
movq 0x10(%rsp), %rdx
callq 0x2069e
cltq
addq %rax, %rbp
movq 0x10(%rsp), %rax
movl 0x4(%rax), %esi
movq 0x18(%rsp), %rdi
callq 0x29f3e
subq %rbx, %rbp
jmp 0x2082d
movq 0x10(%rsp), %rax
movq 0x88(%rax), %rdi
movq 0x18(%rdi), %rcx
movq %rbx, %r14
testq %rcx, %rcx
je 0x20cff
leaq 0xde98(%rip), %rdx      # 0x2eb78
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r14
addq %rbx, %r14
movq 0x10(%rsp), %rax
movq 0x88(%rax), %rdi
movq 0x20(%rsp), %r13
movq %r13, %r12
subq %r14, %r12
callq 0x1c0c8
leaq 0x11d87(%rip), %rdx     # 0x32a9d
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rcx
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %rbp
addq %r14, %rbp
movq 0x10(%rsp), %rax
movq 0x38(%rax), %r8
testq %r8, %r8
je 0x20c7e
movq %r13, %rsi
subq %rbp, %rsi
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rcx
jmp 0x20f75
movq 0x10(%rsp), %r15
movq 0x68(%r15), %rax
movq (%rax), %rcx
movq %rbx, %rdi
movq %r13, %rsi
movq 0x18(%rsp), %rdx
callq 0x207c4
cltq
leaq (%rbx,%rax), %r14
movq 0x88(%r15), %rcx
testq %rcx, %rcx
je 0x20fad
movq 0x50(%rcx), %rcx
movq (%rcx), %rcx
movq 0x30(%rcx), %rcx
subq %rax, %r13
leaq 0x13108(%rip), %rdx     # 0x33ea1
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2a9bf
jmp 0x20fc4
leaq 0x10618(%rip), %rdx     # 0x313ca
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r13
movq %rbx, 0x28(%rsp)
addq %rbx, %r13
leaq 0xd079(%rip), %rcx      # 0x2de4a
leaq 0x13f94(%rip), %rbx     # 0x34d6c
xorl %r12d, %r12d
movq 0x20(%rsp), %rbp
movq %rbp, %rsi
subq %r13, %rsi
movq 0x10(%rsp), %rax
cmpq 0x70(%rax), %r12
jae 0x20e36
movq %r13, %rdi
leaq 0x11ca2(%rip), %rdx     # 0x32a9d
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r14
addq %r13, %r14
movq %rbp, %rsi
subq %r14, %rsi
movq 0x10(%rsp), %rax
movq 0x68(%rax), %rax
movq (%rax,%r12,8), %rcx
movq %r14, %rdi
movq 0x18(%rsp), %rdx
callq 0x207c4
movslq %eax, %r13
addq %r14, %r13
incq %r12
movq %rbx, %rcx
jmp 0x20de0
leaq 0x12586(%rip), %rdx     # 0x333c3
movq %r13, %rdi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %rbp
addq %r13, %rbp
movq 0x28(%rsp), %rbx
jmp 0x20c7e
movq %rbx, %r12
movq 0x10(%rsp), %rax
movq 0x88(%rax), %rbx
movq 0x18(%rbx), %rcx
movq %r12, %r14
testq %rcx, %rcx
je 0x20e8c
leaq 0xdcff(%rip), %rdx      # 0x2eb78
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r14
addq %r12, %r14
movq 0x20(%rsp), %rbp
movq %rbp, %rsi
subq %r14, %rsi
movq 0x20(%rbx), %rcx
leaq 0x11bfb(%rip), %rdx     # 0x32a9d
movq %r14, %rdi
xorl %eax, %eax
callq 0x2a9bf
movl %r13d, %ecx
subl %ebp, %ecx
addl %r14d, %ecx
addl %eax, %ecx
movslq %ecx, %rax
leaq (%r12,%rax), %rbp
movq 0x10(%rsp), %rcx
movq 0x48(%rcx), %r8
testq %r8, %r8
movq %r12, %rbx
je 0x20c7e
subq %rax, %r13
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rcx
movq %rbp, %rdi
movq %r13, %rsi
jmp 0x20f78
movq 0x10(%rsp), %rax
movq 0x88(%rax), %rdi
movq 0x18(%rdi), %rcx
movq %rbx, %r14
testq %rcx, %rcx
je 0x20f27
leaq 0xdc70(%rip), %rdx      # 0x2eb78
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %r14
addq %rbx, %r14
movq 0x10(%rsp), %rax
movq 0x88(%rax), %rdi
movq 0x20(%rsp), %r13
movq %r13, %r12
subq %r14, %r12
callq 0x1c0c8
leaq 0x11b5f(%rip), %rdx     # 0x32a9d
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rcx
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %rbp
addq %r14, %rbp
movq 0x10(%rsp), %rax
movq 0x48(%rax), %r8
testq %r8, %r8
je 0x20c7e
movq %r13, %rsi
subq %rbp, %rsi
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rcx
movq %rbp, %rdi
movq 0x18(%rsp), %rdx
callq 0x225a1
cltq
addq %rax, %rbp
jmp 0x20c7e
movq 0x10(%rsp), %rax
movl 0x4(%rax), %ecx
leaq 0xa313(%rip), %rdx      # 0x2b2ae
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2a9bf
jmp 0x20c78
subq %rax, %r13
leaq 0x12ef0(%rip), %rdx     # 0x33ea7
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2a9bf
movq %rax, %rbp
addq %r14, %rbp
jmp 0x20c7e
leaq 0x12edd(%rip), %rdi     # 0x33eb3
xorl %eax, %eax
callq 0x1205c