// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x16e29
cmpb $0x0, 0x10(%rbx)
je 0x16e38
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, 0x10(%rbx)
movl 0x8(%rbx), %eax
cmpq $0xd, %rax
ja 0x16e29
movq %rdx, %r14
movq %rsi, %r13
leaq 0x1ab6e(%rip), %rcx     # 0x319c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%rbx), %r12
callq 0x1d859
movq %r12, %rdi
movq %rax, %rsi
callq 0x19fb2
movq 0x18(%rbx), %rdi
callq 0x1d890
movq 0x18(%rbx), %rdi
callq 0x16cc6
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpq 0x20(%rbx), %r12
jae 0x1728c
movq 0x28(%rbx), %rdi
addq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x16e0d
incq %r12
addq $0x8, %r15
jmp 0x16e87
callq 0x1d859
movq 0x18(%rbx), %rsi
movq %rax, %rdi
callq 0x1de33
testq %rax, %rax
je 0x175d3
movq %rax, %r14
movq %rax, 0x20(%rbx)
movq 0x40(%rbx), %rax
cmpq 0x28(%r14), %rax
jne 0x175f0
movq 0x10(%r14), %rax
movq 0x18(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rbx), %rdi
callq 0x17d99
movq %rax, 0x28(%rbx)
movq 0x38(%rbx), %rdi
callq 0x1d970
xorl %r15d, %r15d
cmpq 0x40(%rbx), %r15
jae 0x172ed
movq 0x30(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x17d99
movq 0x30(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
jmp 0x16f01
movq 0x20(%rbx), %r14
callq 0x1d859
movq %r14, %rdi
movq %rax, %rsi
callq 0x19fb2
movq 0x20(%rbx), %rdi
callq 0x1d890
movq 0x18(%rbx), %r14
callq 0x1d954
testq %r14, %r14
je 0x16f53
movq %rax, (%r14)
movq 0x18(%rbx), %rdi
callq 0x1d970
movq 0x20(%rbx), %rdi
callq 0x16cc6
andl $0x0, 0x10(%rsp)
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq 0x30(%rbx), %r15
jae 0x16f8f
movq 0x38(%rbx), %rdi
addq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x16e0d
incq %r15
addq $0x8, %r14
jmp 0x16f70
leaq 0x40(%rbx), %rdi
movq 0x28(%rbx), %rax
movq 0x68(%rax), %rax
movq (%rax), %rsi
leaq 0x10(%rsp), %r14
movq %r14, %rdx
callq 0x16e0d
cmpl $0x0, (%r14)
jne 0x16fdb
movq %rbx, %rdi
callq 0x19ae5
movq 0x68(%rax), %rax
movq (%rax), %r14
pushq $0x1
popq %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1fdc2
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x18a60
movq 0x18(%rbx), %rdi
callq 0x1d9bb
callq 0x1d8d4
jmp 0x16e29
cmpb $0x0, 0x73(%rbx)
je 0x16ffa
incl 0x478f6(%rip)           # 0x5e8f0
incl 0x478f4(%rip)           # 0x5e8f4
movq 0x38(%rbx), %r14
callq 0x1d954
testq %r14, %r14
je 0x17011
movq %rax, (%r14)
movq 0x38(%rbx), %rdi
callq 0x1d970
movq %rbx, %rdi
callq 0x19e74
movq %rbx, %rdi
callq 0x19ae5
movq %rax, %rdi
callq 0x2065a
testl %eax, %eax
je 0x17043
cmpl $0x0, 0x478b3(%rip)     # 0x5e8f0
je 0x175c2
movq 0x38(%rbx), %rdi
callq 0x1d9bb
decl 0x478a2(%rip)           # 0x5e8f4
cmpb $0x0, 0x73(%rbx)
je 0x16e29
decl 0x4788e(%rip)           # 0x5e8f0
jmp 0x16e29
movq %r13, %rsi
movq %r14, %rdx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1a2da
leaq 0x30(%rsp), %r12
andq $0x0, (%r12)
movq %r13, %r15
leaq 0x10(%rsp), %r13
andq $0x0, (%r13)
leaq 0x18(%rbx), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x19fe7
leaq 0x28(%rbx), %rbp
movq 0x28(%rbx), %rdi
movq (%r12), %rsi
movq (%r13), %rdx
callq 0x15cf6
leaq 0x20(%rbx), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x16e0d
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x16e0d
movq 0x18(%rbx), %rdi
callq 0x19ae5
movq %rax, %r14
movq 0x20(%rbx), %rdi
callq 0x19ae5
movq %rax, %r15
leaq 0x48102(%rip), %rax     # 0x5f1f8
movq (%rax), %rax
movq 0x30(%rax), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1a237
movq %r15, %rdi
callq 0x19656
testq %rax, %rax
je 0x1711f
cmpl $0x12, (%r15)
jne 0x1751d
movq %r14, 0x28(%r15)
jmp 0x1752b
leaq 0x18(%rbx), %rdi
xorl %ebp, %ebp
xorl %esi, %esi
movq %r14, %rdx
callq 0x16e0d
xorl %eax, %eax
cmpq 0x20(%rbx), %rax
jae 0x16e29
movq 0x28(%rbx), %rdi
addq %rbp, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %rax, (%rsp)
callq 0x16e0d
movq 0x18(%rbx), %rdi
movq 0x28(%rbx), %rax
movq (%rax,%rbp), %rax
movq 0x18(%rax), %r12
callq 0x19ae5
movq %r14, %r15
movq %r13, %r14
movq %rax, %r13
movq 0x28(%rbx), %rax
movq (%rax,%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x19ae5
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %r13
movq %r15, %r14
movq %rax, %rdx
callq 0x18a60
movq (%rsp), %rax
incq %rax
addq $0x8, %rbp
jmp 0x1713a
leaq 0x18(%rbx), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x16e0d
leaq 0x20(%rbx), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x16e0d
leaq 0x28(%rbx), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x16e0d
movq 0x18(%rbx), %rdi
callq 0x19ae5
movq %rax, %r14
movq (%rbx), %rdi
pushq $0x2
popq %rsi
callq 0x1fdc2
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x18a60
leaq 0x18(%rbx), %r12
movq %r13, %r15
movq 0x38(%rbx), %r13
callq 0x1d859
movq %r13, %rdi
movq %rax, %rsi
callq 0x19fb2
movq 0x38(%rbx), %rdi
callq 0x1d890
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x16e0d
leaq 0x20(%rbx), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x16e0d
leaq 0x28(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x16e0d
leaq 0x30(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x16e0d
movq 0x20(%rbx), %rdi
callq 0x19ae5
movq %rax, %r14
movq (%rbx), %rdi
pushq $0x2
popq %rsi
callq 0x1fdc2
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x18a60
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1d8d4
leaq 0x30(%rsp), %r12
andq $0x0, (%r12)
movq %r13, %r15
leaq 0x10(%rsp), %r13
andq $0x0, (%r13)
leaq 0x18(%rbx), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x19fe7
movq 0x20(%rbx), %rdi
addq $0x20, %rbx
movq (%r12), %rsi
movq (%r13), %rdx
callq 0x15cf6
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x16e0d
jmp 0x16e29
xorl %r13d, %r13d
leaq 0x46f81(%rip), %r15     # 0x5e278
movq %rbx, 0x8(%rsp)
cmpq 0x50(%rbx), %r13
jae 0x17506
movq 0x48(%rbx), %rax
movq (%rax,%r13,8), %rbp
movq 0x90(%r15), %rax
cmpq $0x0, 0x8(%rax)
je 0x1732a
movq 0x20(%rbp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1bb2f
xorl %r15d, %r15d
cmpq 0x38(%r14), %r15
jae 0x17538
movq 0x20(%rbp), %rdi
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rax
movq 0x20(%rax), %rsi
callq 0x1d6ff
testl %eax, %eax
jne 0x17355
incq %r15
jmp 0x1732d
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %r12
testq %r12, %r12
je 0x17538
movq %r13, (%rsp)
movq 0x38(%r12), %rdi
callq 0x1d970
movq 0x18(%r14), %rsi
movq 0x28(%rbx), %rdx
movq %rbx, %rdi
callq 0x19743
callq 0x1c2cd
movq %rax, %r15
movq 0x18(%r14), %rsi
movq 0x28(%rbx), %rdx
movq %rax, %rdi
callq 0x1c27c
xorl %r13d, %r13d
cmpq 0x28(%r14), %r13
jae 0x173c2
movq 0x20(%r14), %rax
movq (%rax,%r13,8), %rsi
movq 0x30(%rbx), %rax
movq (%rax,%r13,8), %rdx
movq %r15, %rdi
callq 0x1c27c
incq %r13
jmp 0x1739f
movq %r12, %rdi
callq 0x19ae5
movq 0x473cf(%rip), %rdx     # 0x5e7a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x1c34e
movq %rax, %r13
movq %r15, %rdi
callq 0x1c319
movq 0x38(%r12), %rdi
callq 0x1d9bb
movq %r13, %rdi
callq 0x2065a
movl %eax, 0x1c(%rsp)
testl %eax, %eax
je 0x17407
incl 0x474e9(%rip)           # 0x5e8f0
movq %rbp, %rdi
callq 0x19e74
movq %rbp, %rdi
callq 0x19ae5
movq %rbx, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x18a60
movq 0x28(%rbx), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x1cc74
movq %r13, %rbx
movq %rax, %r13
leaq 0x46e37(%rip), %r15     # 0x5e278
movq 0x90(%r15), %rdi
movq %rax, %rsi
callq 0x1dc67
testq %rax, %rax
jne 0x17572
movq %r13, 0x20(%rbp)
movq 0x90(%r15), %rdi
movq %rbp, %rsi
callq 0x1deda
movq %r12, 0x28(%rsp)
movq 0x48(%r12), %rdi
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rsi
movq %rbp, %rdx
callq 0x2a22a
movb $0x1, 0x72(%rbp)
cmpl $0x1d, (%rbx)
je 0x1749c
movq %rbx, %rdi
callq 0x2065a
testl %eax, %eax
je 0x174cb
movb $0x1, 0x73(%rbp)
movq 0x28(%rsp), %r12
leaq 0x50(%r12), %rdi
leaq 0x58(%r12), %rsi
movq %rbp, %rdx
callq 0x29b2d
leaq 0x60(%r12), %rdi
addq $0x68, %r12
movq %r12, %rsi
movq %rbx, %rdx
callq 0x29b2d
movb 0xc(%r14), %al
movb %al, 0x70(%rbp)
leaq 0x4745f(%rip), %rdi     # 0x5e938
leaq 0x47460(%rip), %rsi     # 0x5e940
movq %rbp, %rdx
callq 0x29b2d
cmpl $0x0, 0x1c(%rsp)
movq (%rsp), %r13
je 0x174f9
decl 0x473f7(%rip)           # 0x5e8f0
incq %r13
movq 0x8(%rsp), %rbx
jmp 0x172fc
movq 0x38(%rbx), %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1d9bb
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x18a60
movq %rbx, %rdi
callq 0x1a296
jmp 0x16e29
movq 0x20(%rbp), %rdi
callq 0x1c0c8
movq %rax, %r15
movq 0x10(%r14), %rdi
callq 0x1c0c8
movq %rax, %r14
movq %rbx, %rdi
callq 0x17f9e
leaq 0x1b1fb(%rip), %rsi     # 0x3275a
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x120fd
movq 0x10(%r14), %rdi
movq %rax, %r15
callq 0x1c0c8
movq %rax, %r14
movq 0x8(%rsp), %rbx
movq 0x28(%rbx), %rdi
callq 0x21009
movq %rax, %r12
movq (%r15), %rdi
callq 0x1b4f4
movq %rax, %r13
movq (%r15), %rdi
callq 0x1b508
leaq 0x1b1d4(%rip), %rsi     # 0x32780
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
movq %r13, %r8
movl %eax, %r9d
xorl %eax, %eax
callq 0x120fd
movq %rbx, %rdi
callq 0x17f9e
leaq 0x1ad5c(%rip), %rsi     # 0x3232d
jmp 0x175e3
movq 0x18(%rbx), %rdi
callq 0x1c0c8
leaq 0x1b12a(%rip), %rsi     # 0x3270d
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x120fd
movq 0x18(%rbx), %rdi
callq 0x1c0c8
movq 0x40(%rbx), %rcx
movq 0x28(%r14), %r8
leaq 0x1b112(%rip), %rsi     # 0x3271a
movq %rbx, %rdi
movq %rax, %rdx
jmp 0x1756b
leaq 0x1ad37(%rip), %rdi     # 0x32351
xorl %eax, %eax
callq 0x1205c