// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/parse/infer.c
// Function: infercompn
static void
infercompn(Node *n, Postcheck ***post, size_t *npost)
{
	Node *aggr, *memb, **nl;
	int found, ismemb;
	Postcheck *pc;
	uvlong idx;
	size_t i;
	Type *t;

	aggr = n->expr.args[0];
	memb = n->expr.args[1];
	ismemb = n->expr.op == Omemb;

	found = 0;
	t = tybase(tf(type(aggr)));
	/* all array-like types have a fake "len" member that we emulate */
	if (ismemb && (t->type == Tyslice || t->type == Tyarray)) {
		if (!strcmp(namestr(memb), "len")) {
			constrain(n, type(n), traittab[Tcnum]);
			constrain(n, type(n), traittab[Tcint]);
			found = 1;
		}
	} else if (ismemb && t->type == Tyunion) {
		if (!strcmp(namestr(memb), "tag")) {
			constrain(n, type(n), traittab[Tcnum]);
			constrain(n, type(n), traittab[Tcint]);
			found = 1;
		}
	} else {
		if (tybase(t)->type == Typtr)
			t = tybase(tf(t->sub[0]));
		if (tybase(t)->type == Tyvar) {
			pc = xalloc(sizeof(Postcheck));
			pc->node = n;
			pc->stab = curstab();
			pc->env = curenv();
			lappend(post, npost, pc);
			return;
		}
		if (ismemb) {
			/*
			 * aggregate types for the member, and unify the expression with the
			 * member type; ie:
			 *
			 *	 x: aggrtype	y : memb in aggrtype
			 *	 ---------------------------------------
			 *			   x.y : membtype
			 */
			if (tybase(t)->type != Tystruct)
				fatal(n, "type %s does not support member operators near %s",
						tystr(t), ctxstr(n));
			nl = t->sdecls;
			for (i = 0; i < t->nmemb; i++) {
				if (!strcmp(namestr(memb), declname(nl[i]))) {
					unify(n, type(n), decltype(nl[i]));
					found = 1;
					break;
				}
			}
		} else {
			/* tuple access; similar to the logic for member accesses */
			if (tybase(t)->type != Tytuple)
				fatal(n, "type %s does not support tuple access operators near %s",
						tystr(t), ctxstr(n));
			assert(memb->type == Nlit);
			idx = memb->lit.intval;
			if (idx >= t->nsub)
				fatal(n, "cannot access element %llu of a tuple of type %s near %s",
						idx, tystr(t), ctxstr(n));
			unify(n, type(n), t->sub[idx]);
			found = 1;
		}
	}
	if (!found)
		fatal(aggr, "type %s has no member \"%s\" near %s", tystr(type(aggr)),
				ctxstr(memb), ctxstr(aggr));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x2a, 0x18(%rax)
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x38(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2a8f0
movq %rax, %rdi
callq 0x277c0
movq %rax, %rdi
callq 0x36a30
movq %rax, -0x58(%rbp)
cmpl $0x0, -0x38(%rbp)
je 0x2e107
movq -0x58(%rbp), %rax
cmpl $0x14, (%rax)
je 0x2e089
movq -0x58(%rbp), %rax
cmpl $0x15, (%rax)
jne 0x2e107
movq -0x28(%rbp), %rdi
callq 0x30600
movq %rax, %rdi
leaq 0x26edc(%rip), %rsi     # 0x54f78
callq 0x6220
cmpl $0x0, %eax
jne 0x2e102
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2a8f0
movq -0x68(%rbp), %rdi
movq %rax, %rsi
leaq 0x4fc4b(%rip), %rax     # 0x7dd10
movq (%rax), %rax
movq (%rax), %rdx
callq 0x2b720
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2a8f0
movq -0x60(%rbp), %rdi
movq %rax, %rsi
leaq 0x4fc21(%rip), %rax     # 0x7dd10
movq (%rax), %rax
movq 0x8(%rax), %rdx
callq 0x2b720
movl $0x1, -0x34(%rbp)
jmp 0x2e45e
cmpl $0x0, -0x38(%rbp)
je 0x2e198
movq -0x58(%rbp), %rax
cmpl $0x18, (%rax)
jne 0x2e198
movq -0x28(%rbp), %rdi
callq 0x30600
movq %rax, %rdi
leaq 0x24b36(%rip), %rsi     # 0x52c63
callq 0x6220
cmpl $0x0, %eax
jne 0x2e193
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2a8f0
movq -0x78(%rbp), %rdi
movq %rax, %rsi
leaq 0x4fbba(%rip), %rax     # 0x7dd10
movq (%rax), %rax
movq (%rax), %rdx
callq 0x2b720
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2a8f0
movq -0x70(%rbp), %rdi
movq %rax, %rsi
leaq 0x4fb90(%rip), %rax     # 0x7dd10
movq (%rax), %rax
movq 0x8(%rax), %rdx
callq 0x2b720
movl $0x1, -0x34(%rbp)
jmp 0x2e45c
movq -0x58(%rbp), %rdi
callq 0x36a30
cmpl $0x12, (%rax)
jne 0x2e1c2
movq -0x58(%rbp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rdi
callq 0x277c0
movq %rax, %rdi
callq 0x36a30
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x36a30
cmpl $0x19, (%rax)
jne 0x2e21f
movl $0x18, %edi
callq 0x481b0
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
callq 0x32d60
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
callq 0x32f30
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x48290
jmp 0x2e4c6
cmpl $0x0, -0x38(%rbp)
je 0x2e335
movq -0x58(%rbp), %rdi
callq 0x36a30
cmpl $0x17, (%rax)
je 0x2e274
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x58(%rbp), %rdi
callq 0x38a10
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rdi
callq 0x27be0
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rdx
movq %rax, %rcx
leaq 0x24520(%rip), %rsi     # 0x5278d
movb $0x0, %al
callq 0x1dfe0
movq -0x58(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq -0x58(%rbp), %rcx
cmpq 0x78(%rcx), %rax
jae 0x2e330
movq -0x28(%rbp), %rdi
callq 0x30600
movq %rax, -0x90(%rbp)
movq -0x30(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x30200
movq -0x90(%rbp), %rdi
movq %rax, %rsi
callq 0x6220
cmpl $0x0, %eax
jne 0x2e31d
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2a8f0
movq %rax, -0x98(%rbp)
movq -0x30(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x30260
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq %rax, %rdx
callq 0x28c00
movl $0x1, -0x34(%rbp)
jmp 0x2e330
jmp 0x2e31f
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x2e28b
jmp 0x2e45a
movq -0x58(%rbp), %rdi
callq 0x36a30
cmpl $0x16, (%rax)
je 0x2e386
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x58(%rbp), %rdi
callq 0x38a10
movq %rax, -0xa8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x27be0
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rdx
movq %rax, %rcx
leaq 0x24440(%rip), %rsi     # 0x527bf
movb $0x0, %al
callq 0x1dfe0
movq -0x28(%rbp), %rax
cmpl $0x9, 0x8(%rax)
jne 0x2e392
jmp 0x2e3b1
leaq 0x2445e(%rip), %rdi     # 0x527f7
leaq 0x23e90(%rip), %rsi     # 0x52230
movl $0x93a, %edx            # imm = 0x93A
leaq 0x2445e(%rip), %rcx     # 0x5280a
callq 0x6160
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x58(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jb 0x2e420
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x58(%rbp), %rdi
callq 0x38a10
movq %rax, -0xb8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x27be0
movq -0xc8(%rbp), %rdi
movq -0xc0(%rbp), %rdx
movq -0xb8(%rbp), %rcx
movq %rax, %r8
leaq 0x24422(%rip), %rsi     # 0x5283b
movb $0x0, %al
callq 0x1dfe0
movq -0x8(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2a8f0
movq -0xd0(%rbp), %rdi
movq %rax, %rsi
movq -0x58(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0x28c00
movl $0x1, -0x34(%rbp)
jmp 0x2e45c
jmp 0x2e45e
cmpl $0x0, -0x34(%rbp)
jne 0x2e4c6
movq -0x20(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2a8f0
movq %rax, %rdi
callq 0x38a10
movq %rax, -0xe0(%rbp)
movq -0x28(%rbp), %rdi
callq 0x27be0
movq %rax, -0xd8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x27be0
movq -0xe8(%rbp), %rdi
movq -0xe0(%rbp), %rdx
movq -0xd8(%rbp), %rcx
movq %rax, %r8
leaq 0x243b5(%rip), %rsi     # 0x52874
movb $0x0, %al
callq 0x1dfe0
addq $0xf0, %rsp
popq %rbp
retq
nop