// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/parse/infer.c
// Function: addtraittab
static void
addtraittab(Traitmap *m, Trait *tr, Type *ty)
{
	Bitset *bs;
	Traitmap *mm;
	size_t i;

	if (!m->sub[ty->type])
		m->sub[ty->type] = mktraitmap();
	mm = m->sub[ty->type];
	switch (ty->type) {
	case Tygeneric:
	case Typaram:
		for (i = 0; i < Ntypes; i++) {
			if (i == Typaram)
				continue;
			if (!m->sub[i])
				m->sub[i] = mktraitmap();
			mm = m->sub[i];
			lappend(&mm->filter, &mm->nfilter, ty);
			lappend(&mm->filtertr, &mm->nfiltertr, tr);
		}
		break;
	case Tyname:
		if (ty->ngparam == 0) {
			bs = htget(mm->name, ty->name);
			if (!bs) {
				bs = mkbs();
				htput(mm->name, ty->name, bs);
			}
			bsput(bs, tr->uid);
		} else {
			lappend(&mm->filter, &m->nfilter, ty);
			lappend(&mm->filtertr, &m->nfiltertr, tr);
		}
		break;
	case Typtr:
	case Tyarray:
		addtraittab(mm, tr, ty->sub[0]);
		break;
	default:
		if (istyprimitive(ty)) {
			bsput(mm->traits, tr->uid);
		} else {
			lappend(&mm->filter, &mm->nfilter, ty);
			lappend(&mm->filtertr, &mm->nfiltertr, tr);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movl (%rcx), %ecx
cmpq $0x0, 0x8(%rax,%rcx,8)
jne 0x2797d
callq 0x27b90
movq %rax, %rdx
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movl (%rcx), %ecx
movq %rdx, 0x8(%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movl (%rcx), %ecx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
addl $-0x12, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0xb, %eax
ja 0x27b27
movq -0x38(%rbp), %rax
leaq 0x29f2d(%rip), %rcx     # 0x518e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq $0x0, -0x30(%rbp)
cmpq $0x1f, -0x30(%rbp)
jae 0x27a5d
cmpq $0x1a, -0x30(%rbp)
jne 0x279d8
jmp 0x27a4c
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq $0x0, 0x8(%rax,%rcx,8)
jne 0x279fd
callq 0x27b90
movq %rax, %rdx
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rdx, 0x8(%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
addq $0x108, %rdi            # imm = 0x108
movq -0x28(%rbp), %rsi
addq $0x110, %rsi            # imm = 0x110
movq -0x18(%rbp), %rdx
callq 0x48290
movq -0x28(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
movq -0x28(%rbp), %rsi
addq $0x120, %rsi            # imm = 0x120
movq -0x10(%rbp), %rdx
callq 0x48290
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x279c4
jmp 0x27b8a
movq -0x18(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x27acd
movq -0x28(%rbp), %rax
movq 0x100(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rsi
callq 0x49490
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x27abb
callq 0x48650
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
movq 0x100(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x49100
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq (%rax), %rsi
callq 0x48a50
jmp 0x27b0b
movq -0x28(%rbp), %rdi
addq $0x108, %rdi            # imm = 0x108
movq -0x8(%rbp), %rsi
addq $0x110, %rsi            # imm = 0x110
movq -0x18(%rbp), %rdx
callq 0x48290
movq -0x28(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
movq -0x8(%rbp), %rsi
addq $0x120, %rsi            # imm = 0x120
movq -0x10(%rbp), %rdx
callq 0x48290
jmp 0x27b8a
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rdx
callq 0x27940
jmp 0x27b8a
movq -0x18(%rbp), %rdi
callq 0x37980
cmpl $0x0, %eax
je 0x27b4a
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movslq (%rax), %rsi
callq 0x48a50
jmp 0x27b88
movq -0x28(%rbp), %rdi
addq $0x108, %rdi            # imm = 0x108
movq -0x28(%rbp), %rsi
addq $0x110, %rsi            # imm = 0x110
movq -0x18(%rbp), %rdx
callq 0x48290
movq -0x28(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
movq -0x28(%rbp), %rsi
addq $0x120, %rsi            # imm = 0x120
movq -0x10(%rbp), %rdx
callq 0x48290
jmp 0x27b8a
addq $0x40, %rsp
popq %rbp
retq