// File: /workspace/github_c_makefile_star2_O1/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 0x1b33b
callq 0x2d63c
movq %rax, %r12
movq %r15, %rdi
movq %rax, %rsi
callq 0x1a4ae
movq 0x80(%rbx), %r13
testq %r13, %r13
jne 0x1b35a
callq 0x2d63c
movq %rax, %r13
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1a4ae
movq %r12, %rdi
movq %r13, %rsi
callq 0x2dad2
testl %eax, %eax
je 0x1b3b0
cmpq $0x0, 0x80(%r15)
jne 0x1b37b
movq %r12, %rdi
callq 0x2d664
cmpq $0x0, 0x80(%rbx)
je 0x1b397
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 0x2d664
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 0x2d753
testl %eax, %eax
je 0x1b475
leaq 0x16a53(%rip), %r15     # 0x31e3a
xorl %ebx, %ebx
movq 0x10(%rsp), %rax
movq (%r13), %rcx
shlq $0x6, %rcx
cmpq %rax, %rcx
jbe 0x1b410
movq 0x8(%r13), %rcx
movq %rax, %rdx
shrq $0x6, %rdx
movq (%rcx,%rdx,8), %rcx
btq %rax, %rcx
jb 0x1b45b
leaq (%rsp,%rbx), %r14
addq $0x70, %r14
movl $0x40, %ebp
subq %rbx, %rbp
leaq 0x46dd1(%rip), %rcx     # 0x621f8
movq (%rcx), %rcx
movq (%rcx,%rax,8), %rax
movq 0x10(%rax), %rdi
callq 0x1e73b
movq %r14, %rdi
movq %rbp, %rsi
leaq 0x166ef(%rip), %rdx     # 0x31b33
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x2e42e
addq %rax, %rbx
leaq 0x1d91d(%rip), %r15     # 0x38d78
incq 0x10(%rsp)
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x2d753
testl %eax, %eax
jne 0x1b3e9
leaq 0x130(%rsp), %rdi
movl $0x40, %esi
movq 0x18(%rsp), %rdx
callq 0x237ca
leaq 0x30(%rsp), %rdi
movl $0x40, %esi
movq 0x20(%rsp), %rbx
movq %rbx, %rdx
callq 0x237ca
movb $0x0, 0xb0(%rsp)
movl 0x4(%rbx), %eax
cmpq %rax, 0x4642b(%rip)     # 0x618e0
jbe 0x1b501
movq 0x4642a(%rip), %rcx     # 0x618e8
cmpl $0x0, (%rcx,%rax,8)
jle 0x1b501
movq (%rcx,%rax,8), %r14
movq %r14, %rdi
callq 0x1d56c
movq %rax, %r12
movq %r14, %rdi
callq 0x1d580
leaq 0x1ac7d(%rip), %rdx     # 0x3615f
leaq 0xb0(%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 0x19a6f
movq %rax, %r14
movq 0x18(%rsp), %rdi
callq 0x1b662
movq %rax, %r15
movq 0x20(%rsp), %rdi
callq 0x1b662
movq %rax, (%rsp)
leaq 0x1ac3c(%rip), %rsi     # 0x3616f
leaq 0x30(%rsp), %rdx
leaq 0x70(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %r8
movq %r15, %r9
xorl %eax, %eax
callq 0x13aa3