// File: /workspace/github_c_makefile_star2_O2/oridb[P]mc/parse/infer.c
// Function: verifytraits
static void
verifytraits(Node *ctx, Type *a, Type *b)
{
	char traitbuf[64], abuf[64], bbuf[64];
	char asrc[128], bsrc[128];
	Bitset *abs, *bbs;
	size_t i, n;
	Srcloc l;
	char *sep;

	abs = a->trneed;
	if (!abs) {
		abs = mkbs();
		traitsfor(a, abs);
	}
	bbs = b->trneed;
	if (!bbs) {
		bbs = mkbs();
		traitsfor(b, bbs);
	}
	if (!bsissubset(abs, bbs)) {
		sep = "";
		n = 0;
		*traitbuf = 0;
		for (i = 0; bsiter(abs, &i); i++) {
			if (!bshas(bbs, i)) {
				n += bprintf(traitbuf + n, sizeof(traitbuf) - n, "%s%s", sep,
					     namestr(traittab[i]->name));
				sep = ",";
			}
		}
		tyfmt(abuf, sizeof abuf, a);
		tyfmt(bbuf, sizeof bbuf, b);
		bsrc[0] = 0;
		if (nunifysrc > b->tid && unifysrc[b->tid].line > 0) {
			l = unifysrc[b->tid];
			snprintf(bsrc, sizeof asrc, "\n\t%s from %s:%d", bbuf, fname(l), lnum(l));
		}
		fatal(ctx, "%s needs trait %s near %s%s%s",
			bbuf, traitbuf, ctxstr(ctx), srcstr(a), srcstr(b));
	}
	if (!a->trneed)
		bsfree(abs);
	if (!b->trneed)
		bsfree(bbs);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x80(%rsi), %r12
testq %r12, %r12
jne 0x1977c
callq 0x29d3c
movq %rax, %r12
movq %r15, %rdi
movq %rax, %rsi
callq 0x1897c
movq 0x80(%rbx), %r13
testq %r13, %r13
jne 0x1979b
callq 0x29d3c
movq %rax, %r13
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1897c
movq %r12, %rdi
movq %r13, %rsi
callq 0x2a145
testl %eax, %eax
je 0x197f1
cmpq $0x0, 0x80(%r15)
jne 0x197bc
movq %r12, %rdi
callq 0x29d60
cmpq $0x0, 0x80(%rbx)
je 0x197d8
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x29d60
movq %r15, 0x10(%rsp)
movq %r14, 0x28(%rsp)
movq %rbx, 0x18(%rsp)
movb $0x0, 0x70(%rsp)
leaq 0x1463e(%rip), %rax     # 0x2de4a
movq %rax, 0x20(%rsp)
leaq 0x8(%rsp), %rbx
xorl %ebp, %ebp
xorl %r14d, %r14d
movq %rbp, 0x8(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x29e1a
testl %eax, %eax
je 0x198a5
movq 0x8(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x17d72
testl %eax, %eax
jne 0x1989d
leaq (%rsp,%r14), %r15
addq $0x70, %r15
pushq $0x40
popq %rbx
subq %r14, %rbx
leaq 0x459a0(%rip), %rax     # 0x5f1f8
movq (%rax), %rax
movq (%rax,%rbp,8), %rax
movq 0x10(%rax), %rdi
callq 0x1c0c8
movq %r15, %rdi
movq %rbx, %rsi
leaq 0x8(%rsp), %rbx
leaq 0x142c9(%rip), %rdx     # 0x2db43
movq 0x20(%rsp), %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x2a9bf
addq %rax, %r14
movq 0x8(%rsp), %rbp
leaq 0x1b4d4(%rip), %rax     # 0x34d6c
movq %rax, 0x20(%rsp)
incq %rbp
jmp 0x1981b
leaq 0xb0(%rsp), %rdi
pushq $0x40
popq %rbx
movq %rbx, %rsi
movq 0x10(%rsp), %rdx
callq 0x20783
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
movq 0x18(%rsp), %rbx
movq %rbx, %rdx
callq 0x20783
movl 0x4(%rbx), %eax
cmpq %rax, 0x45004(%rip)     # 0x5e8e0
jbe 0x19928
movq 0x45003(%rip), %rcx     # 0x5e8e8
cmpl $0x0, (%rcx,%rax,8)
jle 0x19928
movq (%rcx,%rax,8), %rbx
movq %rbx, %rdi
callq 0x1b4f4
movq %rax, %r14
movq %rbx, %rdi
callq 0x1b508
leaq 0x18836(%rip), %rdx     # 0x3213f
leaq 0xf0(%rsp), %rdi
leaq 0x30(%rsp), %rcx
movl $0x80, %esi
movq %r14, %r8
movl %eax, %r9d
xorl %eax, %eax
callq 0x4150
movq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x17f9e
movq %rax, %rbx
movq 0x10(%rsp), %rdi
callq 0x19a61
movq %rax, %r14
movq 0x18(%rsp), %rdi
callq 0x19a61
movq %rax, (%rsp)
leaq 0x187f5(%rip), %rsi     # 0x3214f
leaq 0x30(%rsp), %rdx
leaq 0x70(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0x120fd