// File: /workspace/github_c_makefile_star2_O3/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 0x1b16b
callq 0x2d13c
movq %rax, %r12
movq %r15, %rdi
movq %rax, %rsi
callq 0x1a29f
movq 0x80(%rbx), %r13
testq %r13, %r13
jne 0x1b18a
callq 0x2d13c
movq %rax, %r13
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1a29f
movq %r12, %rdi
movq %r13, %rsi
callq 0x2d62f
testl %eax, %eax
je 0x1b1e0
cmpq $0x0, 0x80(%r15)
jne 0x1b1ab
movq %r12, %rdi
callq 0x2d164
cmpq $0x0, 0x80(%rbx)
je 0x1b1c7
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 0x2d164
movq %r15, 0x18(%rsp)
movq %r14, 0x28(%rsp)
movq %rbx, 0x20(%rsp)
movb $0x0, 0x70(%rsp)
leaq 0x10(%rsp), %rsi
movq $0x0, (%rsi)
movq %r12, %rdi
callq 0x2d2a6
testl %eax, %eax
je 0x1b2ae
leaq 0x16c33(%rip), %rbx     # 0x31e4a
xorl %r15d, %r15d
movq 0x10(%rsp), %rax
movq (%r13), %rcx
shlq $0x6, %rcx
cmpq %rax, %rcx
jbe 0x1b241
movq 0x8(%r13), %rcx
movq %rax, %rdx
shrq $0x6, %rdx
movq (%rcx,%rdx,8), %rcx
btq %rax, %rcx
jb 0x1b291
leaq (%rsp,%r15), %r14
addq $0x70, %r14
movl $0x40, %ebp
subq %r15, %rbp
leaq 0x46fa0(%rip), %rcx     # 0x621f8
movq (%rcx), %rcx
movq (%rcx,%rax,8), %rax
movq 0x10(%rax), %rdi
callq 0x1e4eb
movq %r14, %rdi
movq %rbp, %rsi
leaq 0x168ce(%rip), %rdx     # 0x31b43
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x2dfae
addq %rax, %r15
movq 0x10(%rsp), %rax
leaq 0x1dab7(%rip), %rbx     # 0x38d48
incq %rax
movq %rax, 0x10(%rsp)
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x2d2a6
testl %eax, %eax
jne 0x1b21a
leaq 0xb0(%rsp), %rdi
movl $0x40, %esi
movq 0x18(%rsp), %rdx
callq 0x23321
leaq 0x30(%rsp), %rdi
movl $0x40, %esi
movq 0x20(%rsp), %rbx
movq %rbx, %rdx
callq 0x23321
movl 0x4(%rbx), %eax
cmpq %rax, 0x465fa(%rip)     # 0x618e0
jbe 0x1b332
movq 0x465f9(%rip), %rcx     # 0x618e8
cmpl $0x0, (%rcx,%rax,8)
jle 0x1b332
movq (%rcx,%rax,8), %r14
movq %r14, %rdi
callq 0x1d31c
movq %rax, %r12
movq %r14, %rdi
callq 0x1d330
leaq 0x1ae5c(%rip), %rdx     # 0x3616f
leaq 0xf0(%rsp), %rdi
leaq 0x30(%rsp), %rcx
movl $0x80, %esi
movq %r12, %r8
movl %eax, %r9d
xorl %eax, %eax
callq 0x4150
movq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x19858
movq %rax, %r14
movq 0x18(%rsp), %rdi
callq 0x1b49b
movq %rax, %r15
movq 0x20(%rsp), %rdi
callq 0x1b49b
movq %rax, (%rsp)
leaq 0x1ae1b(%rip), %rsi     # 0x3617f
leaq 0x30(%rsp), %rdx
leaq 0x70(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %r8
movq %r15, %r9
xorl %eax, %eax
callq 0x138e7