// File: /workspace/github_c_makefile_star2_O3/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 $0x18, %rsp
movq %rsi, %r13
movq %rdi, %rbx
testq %rcx, %rcx
je 0x233b9
movq %rdx, %r14
movq %rcx, %rdi
callq 0x17094
testq %rax, %rax
je 0x233b9
movq %rax, %r15
movl 0x4(%rax), %esi
movq (%r14), %rax
shlq $0x6, %rax
cmpq %rsi, %rax
jbe 0x233d5
movq 0x8(%r14), %rax
movl %esi, %ecx
shrl $0x6, %ecx
movq (%rax,%rcx,8), %rax
btq %rsi, %rax
jae 0x233d5
leaq 0x14acc(%rip), %rdx     # 0x37e83
jmp 0x233c0
leaq 0x14abd(%rip), %rdx     # 0x37e7d
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
movq %rax, %rbp
jmp 0x236b1
leaq (%rbx,%r13), %rax
movq %rax, 0x8(%rsp)
movq %r14, %rdi
callq 0x2d369
movl (%r15), %eax
movq %rbx, %rbp
cmpq $0x1f, %rax
ja 0x2367f
leaq 0x147ef(%rip), %rcx     # 0x37bec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %r12
leaq 0x11fea(%rip), %rdx     # 0x353fa
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
movq %rax, %r13
movq %rbx, 0x10(%rsp)
addq %rbx, %r13
cmpq $0x2, 0x70(%r15)
jb 0x23580
movl $0x1, %ebp
leaq 0xea0b(%rip), %rcx      # 0x31e4a
movq 0x8(%rsp), %r14
movq %r12, %rbx
movq %r14, %rsi
subq %r13, %rsi
movq %r13, %rdi
leaq 0x13676(%rip), %rdx     # 0x36acd
xorl %eax, %eax
callq 0x2dfae
movq %rax, %r12
addq %r13, %r12
movq %r14, %rsi
subq %r12, %rsi
movq 0x68(%r15), %rax
movq (%rax,%rbp,8), %rcx
movq %r12, %rdi
movq %rbx, %rdx
callq 0x23362
movslq %eax, %r13
addq %r12, %r13
incq %rbp
leaq 0x12b2b(%rip), %rcx     # 0x35fb8
cmpq 0x70(%r15), %rbp
jb 0x23447
jmp 0x23588
movq 0x88(%r15), %rcx
leaq 0x149f9(%rip), %rdx     # 0x37e9f
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
jmp 0x23679
leaq 0x139b4(%rip), %rdx     # 0x36e73
jmp 0x2366c
leaq 0x1399b(%rip), %rdx     # 0x36e66
jmp 0x2366c
leaq 0x1397c(%rip), %rdx     # 0x36e53
jmp 0x2366c
leaq 0x1396b(%rip), %rdx     # 0x36e4e
jmp 0x2366c
leaq 0x1396b(%rip), %rdx     # 0x36e5a
jmp 0x2366c
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x25395
jmp 0x23518
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x252b7
movslq %eax, %rbp
jmp 0x2367c
leaq 0x13921(%rip), %rdx     # 0x36e48
jmp 0x2366c
leaq 0x138f5(%rip), %rdx     # 0x36e28
jmp 0x2366c
leaq 0x1392e(%rip), %rdx     # 0x36e6d
jmp 0x2366c
leaq 0x138f8(%rip), %rdx     # 0x36e43
jmp 0x2366c
leaq 0x13909(%rip), %rdx     # 0x36e60
jmp 0x2366c
leaq 0x137e7(%rip), %rdx     # 0x36d4a
jmp 0x2366c
leaq 0x138cf(%rip), %rdx     # 0x36e3e
jmp 0x2366c
leaq 0x1490e(%rip), %rdx     # 0x37e89
jmp 0x2366c
movq 0x8(%rsp), %r14
movq %r12, %rbx
movq %r14, %rsi
subq %r13, %rsi
leaq 0x14905(%rip), %rdx     # 0x37e9a
movq %r13, %rdi
xorl %eax, %eax
callq 0x2dfae
movq %rax, %r12
addq %r13, %r12
movq %r14, %rsi
subq %r12, %rsi
movq 0x68(%r15), %rax
movq (%rax), %rcx
movq %r12, %rdi
movq %rbx, %rdx
callq 0x23362
movslq %eax, %r13
addq %r12, %r13
subq %r13, %r14
leaq 0x13e26(%rip), %rdx     # 0x373f3
movq %r13, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2dfae
movq %rax, %rbp
addq %r13, %rbp
movq %rbx, %r14
movq 0x10(%rsp), %rbx
jmp 0x2367f
movq 0x68(%r15), %rax
movq (%rax), %rcx
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x23362
cltq
leaq (%rbx,%rax), %r12
subq %rax, %r13
leaq 0x1487b(%rip), %rdx     # 0x37e8d
jmp 0x23911
leaq 0x13836(%rip), %rdx     # 0x36e54
jmp 0x2366c
leaq 0x13838(%rip), %rdx     # 0x36e5f
jmp 0x2366c
leaq 0x136aa(%rip), %rdx     # 0x36cda
jmp 0x2366c
movq 0x68(%r15), %rax
movq (%rax), %rcx
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x23362
cltq
leaq (%rbx,%rax), %r12
subq %rax, %r13
leaq 0x1370b(%rip), %rdx     # 0x36d62
jmp 0x23911
leaq 0x137ea(%rip), %rdx     # 0x36e4d
jmp 0x2366c
leaq 0x137fb(%rip), %rdx     # 0x36e67
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
movq %rax, %rbp
addq %rbx, %rbp
movl (%r15), %eax
addl $-0x19, %eax
cmpl $0x1, %eax
ja 0x236a2
movq 0x8(%rsp), %rsi
subq %rbp, %rsi
movq %rbp, %rdi
movq %r15, %rdx
callq 0x2322d
cltq
addq %rax, %rbp
movl 0x4(%r15), %esi
movq %r14, %rdi
callq 0x2d3d4
subq %rbx, %rbp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, (%rsp)
movq 0x88(%r15), %rdi
movq 0x18(%rdi), %rcx
movq %rbx, %rax
testq %rcx, %rcx
je 0x236f7
leaq 0xf4c8(%rip), %rdx      # 0x32ba8
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
addq %rbx, %rax
movq 0x88(%r15), %rdi
movq 0x8(%rsp), %r14
movq %r14, %r12
subq %rax, %r12
movq %rax, %r13
callq 0x1e4eb
leaq 0x133bc(%rip), %rdx     # 0x36acd
movq %r13, %rdi
movq %r12, %rsi
movq %rax, %rcx
xorl %eax, %eax
callq 0x2dfae
movq %rax, %rbp
addq %r13, %rbp
movq 0x38(%r15), %r8
testq %r8, %r8
je 0x2394b
movq %r14, %rsi
subq %rbp, %rsi
movq 0x30(%r15), %rcx
jmp 0x238d1
movq 0x68(%r15), %rax
movq (%rax), %rcx
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x23362
cltq
leaq (%rbx,%rax), %r12
movq 0x88(%r15), %rcx
testq %rcx, %rcx
je 0x23907
movq 0x50(%rcx), %rcx
movq (%rcx), %rcx
movq 0x30(%rcx), %rcx
subq %rax, %r13
leaq 0x1470e(%rip), %rdx     # 0x37e91
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
jmp 0x2391e
leaq 0x11c5e(%rip), %rdx     # 0x353fa
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
movq %rax, %r13
addq %rbx, %r13
cmpq $0x0, 0x70(%r15)
movq %r14, (%rsp)
je 0x23929
leaq 0xe685(%rip), %rcx      # 0x31e4a
xorl %ebp, %ebp
movq 0x8(%rsp), %r14
movq %r14, %rsi
subq %r13, %rsi
movq %r13, %rdi
leaq 0x132f1(%rip), %rdx     # 0x36acd
xorl %eax, %eax
callq 0x2dfae
movq %rax, %r12
addq %r13, %r12
movq %r14, %rsi
subq %r12, %rsi
movq 0x68(%r15), %rax
movq (%rax,%rbp,8), %rcx
movq %r12, %rdi
movq (%rsp), %rdx
callq 0x23362
movslq %eax, %r13
addq %r12, %r13
incq %rbp
leaq 0x15535(%rip), %rcx     # 0x38d48
cmpq 0x70(%r15), %rbp
jb 0x237cc
jmp 0x2392e
movq 0x88(%r15), %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2518a
cltq
leaq (%rbx,%rax), %rbp
movq 0x48(%r15), %r8
testq %r8, %r8
je 0x2367f
subq %rax, %r13
movq 0x40(%r15), %rcx
movq %rbp, %rdi
movq %r13, %rsi
jmp 0x238d8
movq %r14, (%rsp)
movq 0x88(%r15), %rdi
movq 0x18(%rdi), %rcx
movq %rbx, %rax
testq %rcx, %rcx
je 0x2388a
leaq 0xf335(%rip), %rdx      # 0x32ba8
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
addq %rbx, %rax
movq 0x88(%r15), %rdi
movq 0x8(%rsp), %r14
movq %r14, %r12
subq %rax, %r12
movq %rax, %r13
callq 0x1e4eb
leaq 0x13229(%rip), %rdx     # 0x36acd
movq %r13, %rdi
movq %r12, %rsi
movq %rax, %rcx
xorl %eax, %eax
callq 0x2dfae
movq %rax, %rbp
addq %r13, %rbp
movq 0x48(%r15), %r8
testq %r8, %r8
je 0x2394b
movq %r14, %rsi
subq %rbp, %rsi
movq 0x40(%r15), %rcx
movq %rbp, %rdi
movq (%rsp), %r14
movq %r14, %rdx
callq 0x251f4
cltq
addq %rax, %rbp
jmp 0x2367f
movl 0x4(%r15), %ecx
leaq 0xb9b9(%rip), %rdx      # 0x2f2ae
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
jmp 0x23679
subq %rax, %r13
leaq 0x14586(%rip), %rdx     # 0x37e97
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2dfae
movq %rax, %rbp
addq %r12, %rbp
jmp 0x2367f
movq 0x8(%rsp), %r14
movq %r14, %rsi
subq %r13, %rsi
leaq 0x13ab8(%rip), %rdx     # 0x373f3
movq %r13, %rdi
xorl %eax, %eax
callq 0x2dfae
movq %rax, %rbp
addq %r13, %rbp
movq (%rsp), %r14
jmp 0x2367f
leaq 0x14548(%rip), %rdi     # 0x37ea3
xorl %eax, %eax
callq 0x13844