// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/parse/infer.c
// Function: infernode
static void
infernode(Node **np, Type *ret, int *sawret)
{
	size_t i, nbound;
	Node **bound, *n, *pat;
	Type *t, *b, *e;

	n = *np;
	if (!n)
		return;
	if (n->inferred)
		return;
	n->inferred = 1;
	switch (n->type) {
	case Ndecl:
		if (n->decl.isgeneric)
			ingeneric++;
		indentdepth++;
		setsuperenv(n->decl.env, curenv());
		pushenv(n->decl.env);
		inferdecl(n);
		if (hasparams(type(n)) && !ingeneric)
			fatal(n, "generic type in non-generic near %s", ctxstr(n));
		popenv(n->decl.env);
		indentdepth--;
		if (n->decl.isgeneric)
			ingeneric--;
		break;
	case Nblock:
		setsuper(n->block.scope, curstab());
		pushstab(n->block.scope);
		inferstab(n->block.scope);
		for (i = 0; i < n->block.nstmts; i++)
			infernode(&n->block.stmts[i], ret, sawret);
		popstab();
		break;
	case Nifstmt:
		infernode(&n->ifstmt.cond, NULL, sawret);
		infernode(&n->ifstmt.iftrue, ret, sawret);
		infernode(&n->ifstmt.iffalse, ret, sawret);
		unify(n, type(n->ifstmt.cond), mktype(n->loc, Tybool));
		break;
	case Nloopstmt:
		setsuper(n->loopstmt.scope, curstab());
		pushstab(n->loopstmt.scope);
		infernode(&n->loopstmt.init, ret, sawret);
		infernode(&n->loopstmt.cond, NULL, sawret);
		infernode(&n->loopstmt.step, ret, sawret);
		infernode(&n->loopstmt.body, ret, sawret);
		unify(n, type(n->loopstmt.cond), mktype(n->loc, Tybool));
		popstab();
		break;
	case Niterstmt:
		bound = NULL;
		nbound = 0;

		inferpat(&n->iterstmt.elt, NULL, &bound, &nbound);
		addbindings(n->iterstmt.body, bound, nbound);

		infernode(&n->iterstmt.seq, NULL, sawret);
		infernode(&n->iterstmt.body, ret, sawret);

		e = type(n->iterstmt.elt);
		t = type(n->iterstmt.seq);
		constrain(n, t, traittab[Tciter]);
		b = basetype(t);
		if (b && t->type != Typtr)
			unify(n, e, b);
		else
			t->seqaux = e;
		delayedcheck(n);
		break;
	case Nmatchstmt:
		infernode(&n->matchstmt.val, NULL, sawret);
		for (i = 0; i < n->matchstmt.nmatches; i++) {
			infernode(&n->matchstmt.matches[i], ret, sawret);
			pat = n->matchstmt.matches[i]->match.pat;
			unify(pat, type(n->matchstmt.val),
					type(n->matchstmt.matches[i]->match.pat));
		}
		break;
	case Nmatch:
		bound = NULL;
		nbound = 0;
		inferpat(&n->match.pat, NULL, &bound, &nbound);
		addbindings(n->match.block, bound, nbound);
		infernode(&n->match.block, ret, sawret);
		break;
	case Nexpr:
		inferexpr(np, ret, sawret);
		break;
	case Nfunc:
		setsuper(n->func.scope, curstab());
		pushstab(n->func.scope);
		setsuperenv(n->func.env, curenv());
		pushenv(n->func.env);
		inferstab(n->func.scope);
		inferfunc(n);
		popenv(n->func.env);
		popstab();
		break;
	case Nimpl:
		specializeimpl(n);
		break;
	case Nlit:
	case Nname:
	case Nuse:
		break;
	case Nnone:
		die("Nnone should not be seen as node type!");
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x260de
jmp 0x266c2
movq -0x38(%rbp), %rax
cmpb $0x0, 0x10(%rax)
je 0x260ed
jmp 0x266c2
movq -0x38(%rbp), %rax
movb $0x1, 0x10(%rax)
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movq %rax, -0x60(%rbp)
subq $0xd, %rax
ja 0x266c2
movq -0x60(%rbp), %rax
leaq 0x2b75b(%rip), %rcx     # 0x51870
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x38(%rbp), %rax
cmpb $0x0, 0x73(%rax)
je 0x26137
movl 0x572e2(%rip), %eax     # 0x7d410
addl $0x1, %eax
movl %eax, 0x572d9(%rip)     # 0x7d410
movl 0x572d7(%rip), %eax     # 0x7d414
addl $0x1, %eax
movl %eax, 0x572ce(%rip)     # 0x7d414
movq -0x38(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x68(%rbp)
callq 0x32f30
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0x2b1e0
movq -0x38(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x32f70
movq -0x38(%rbp), %rdi
callq 0x2b200
movq -0x38(%rbp), %rdi
callq 0x2a8f0
movq %rax, %rdi
callq 0x37ce0
cmpl $0x0, %eax
je 0x261be
cmpl $0x0, 0x5727a(%rip)     # 0x7d410
jne 0x261be
movq -0x38(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x38(%rbp), %rdi
callq 0x27be0
movq -0x70(%rbp), %rdi
movq %rax, %rdx
leaq 0x2c135(%rip), %rsi     # 0x522ec
movb $0x0, %al
callq 0x1dfe0
movq -0x38(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x32fe0
movl 0x57243(%rip), %eax     # 0x7d414
addl $-0x1, %eax
movl %eax, 0x5723a(%rip)     # 0x7d414
movq -0x38(%rbp), %rax
cmpb $0x0, 0x73(%rax)
je 0x261f3
movl 0x57226(%rip), %eax     # 0x7d410
addl $-0x1, %eax
movl %eax, 0x5721d(%rip)     # 0x7d410
jmp 0x266c2
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x78(%rbp)
callq 0x32d60
movq -0x78(%rbp), %rdi
movq %rax, %rsi
callq 0x2b320
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x32db0
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x25ec0
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x26273
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x20(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x260b0
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x26237
callq 0x32e20
jmp 0x266c2
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x260b0
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x260b0
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x260b0
movq -0x38(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2a8f0
movq %rax, -0x80(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movl $0x2, %esi
callq 0x36c10
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq %rax, %rdx
callq 0x28c00
jmp 0x266c2
movq -0x38(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0xa0(%rbp)
callq 0x32d60
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x2b320
movq -0x38(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x32db0
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x260b0
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
addq $0x8, %rdi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x260b0
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x260b0
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x260b0
movq -0x38(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2a8f0
movq %rax, -0x90(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movl $0x2, %esi
callq 0x36c10
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq %rax, %rdx
callq 0x28c00
callq 0x32e20
jmp 0x266c2
movq $0x0, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x2b390
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x25c30
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
addq $0x8, %rdi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x260b0
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x260b0
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2a8f0
movq %rax, -0x58(%rbp)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2a8f0
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq 0x57886(%rip), %rax     # 0x7dd10
movq (%rax), %rax
movq 0x30(%rax), %rdx
callq 0x2b720
movq -0x48(%rbp), %rdi
callq 0x297f0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x264c6
movq -0x48(%rbp), %rax
cmpl $0x12, (%rax)
je 0x264c6
movq -0x38(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0x28c00
jmp 0x264d2
movq -0x58(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x38(%rbp), %rdi
callq 0x2b7a0
jmp 0x266c2
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x260b0
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x265a6
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x20(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x260b0
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2a8f0
movq %rax, -0xa8(%rbp)
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rdi
callq 0x2a8f0
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq %rax, %rdx
callq 0x28c00
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x264fd
jmp 0x266c2
movq $0x0, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x2b390
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x25c30
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x260b0
jmp 0x266c2
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x2b810
jmp 0x266c2
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0xc0(%rbp)
callq 0x32d60
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x2b320
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x32db0
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xb8(%rbp)
callq 0x32f30
movq -0xb8(%rbp), %rdi
movq %rax, %rsi
callq 0x2b1e0
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x32f70
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x25ec0
movq -0x38(%rbp), %rdi
callq 0x2c780
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x32fe0
callq 0x32e20
jmp 0x266c2
movq -0x38(%rbp), %rdi
callq 0x2c850
jmp 0x266c2
jmp 0x266c2
leaq 0x2bc55(%rip), %rdi     # 0x52310
movb $0x0, %al
callq 0x1df20
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax,%rax)