// File: /workspace/github_c_makefile_star2_O1/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 0x188fd
cmpb $0x0, 0x10(%rbx)
je 0x1890c
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 0x188fd
movq %rdx, %r14
movq %rsi, %r13
leaq 0x1d08a(%rip), %rcx     # 0x359b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%rbx), %r15
callq 0x20037
movq %rax, %rcx
testq %rcx, %rcx
je 0x18f9c
movq (%rcx), %rcx
cmpq %r15, %rcx
jne 0x1893b
jmp 0x18e6d
callq 0x20037
movq 0x18(%rbx), %rsi
movq %rax, %rdi
callq 0x20669
testq %rax, %rax
je 0x19116
movq %rax, %r14
movq %rax, 0x20(%rbx)
movq 0x40(%rbx), %rax
cmpq 0x28(%r14), %rax
jne 0x19133
movq 0x10(%r14), %rax
movq 0x18(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rbx), %rdi
callq 0x196c0
movq %rax, 0x28(%rbx)
movq 0x38(%rbx), %rdi
callq 0x20159
cmpq $0x0, 0x40(%rbx)
je 0x189cb
xorl %r15d, %r15d
movq 0x30(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x196c0
movq 0x30(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq 0x40(%rbx), %r15
jb 0x189ad
cmpq $0x0, 0x50(%rbx)
je 0x18bec
xorl %r12d, %r12d
leaq 0x48898(%rip), %r15     # 0x61278
movq 0x48(%rbx), %rax
movq (%rax,%r12,8), %rbp
movq 0x90(%r15), %rax
cmpq $0x0, 0x8(%rax)
je 0x18a04
movq 0x20(%rbp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1df00
cmpq $0x0, 0x38(%r14)
movq %r12, 0x28(%rsp)
je 0x18a35
xorl %r15d, %r15d
movq 0x20(%rbp), %rdi
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rax
movq 0x20(%rax), %rsi
callq 0x1fed3
testl %eax, %eax
jne 0x18a3a
incq %r15
cmpq 0x38(%r14), %r15
jb 0x18a13
xorl %r12d, %r12d
jmp 0x18a42
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %r12
testq %r12, %r12
je 0x1907e
movq 0x38(%r12), %rdi
callq 0x20159
movq 0x18(%r14), %rsi
movq 0x28(%rbx), %rdx
movq %rbx, %rdi
callq 0x1b302
callq 0x1e994
movq %rax, %r15
movq 0x18(%r14), %rsi
movq 0x28(%rbx), %rdx
movq %rax, %rdi
callq 0x1e938
cmpq $0x0, 0x28(%r14)
je 0x18aa8
xorl %r13d, %r13d
movq 0x20(%r14), %rax
movq (%rax,%r13,8), %rsi
movq 0x30(%rbx), %rax
movq (%rax,%r13,8), %rdx
movq %r15, %rdi
callq 0x1e938
incq %r13
cmpq 0x28(%r14), %r13
jb 0x18a87
movq %r12, %rdi
callq 0x1b6e6
movq 0x48ce9(%rip), %rdx     # 0x617a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x1ea0e
movq %rax, %r13
movq %r15, %rdi
callq 0x1e9d5
movq 0x38(%r12), %rdi
callq 0x201a4
movq %r13, %rdi
callq 0x23690
movl %eax, 0x1c(%rsp)
testl %eax, %eax
je 0x18aed
incl 0x48e03(%rip)           # 0x618f0
movq %rbp, %rdi
callq 0x1bac7
movq %rbp, %rdi
callq 0x1b6e6
movq %rbx, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x1a59b
movq 0x28(%rbx), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x1f3fc
movq %r13, 0x8(%rsp)
movq %rax, %r13
leaq 0x4874f(%rip), %r15     # 0x61278
movq 0x90(%r15), %rdi
movq %rax, %rsi
callq 0x2048b
testq %rax, %rax
jne 0x190b8
movq %r13, 0x20(%rbp)
movq 0x90(%r15), %rdi
movq %rbp, %rsi
callq 0x2071e
movq %r12, %r13
movq 0x48(%r12), %rdi
movq 0x28(%rbx), %rsi
movq %rbp, %rdx
callq 0x2dbc2
movb $0x1, 0x72(%rbp)
movq 0x8(%rsp), %rax
cmpl $0x1d, (%rax)
je 0x18b84
movq 0x8(%rsp), %rdi
callq 0x23690
testl %eax, %eax
je 0x18bb0
movb $0x1, 0x73(%rbp)
movq %r13, %r12
leaq 0x50(%r13), %rdi
leaq 0x58(%r13), %rsi
movq %rbp, %rdx
callq 0x2d3ff
leaq 0x60(%r13), %rdi
addq $0x68, %r12
movq %r12, %rsi
movq 0x8(%rsp), %rdx
callq 0x2d3ff
movb 0xc(%r14), %al
movb %al, 0x70(%rbp)
leaq 0x48d7a(%rip), %rdi     # 0x61938
leaq 0x48d7b(%rip), %rsi     # 0x61940
movq %rbp, %rdx
callq 0x2d3ff
cmpl $0x0, 0x1c(%rsp)
je 0x18bda
decl 0x48d16(%rip)           # 0x618f0
movq 0x28(%rsp), %r12
incq %r12
cmpq 0x50(%rbx), %r12
jb 0x189e0
movq 0x38(%rbx), %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x201a4
movq 0x20(%rbx), %r14
callq 0x20037
movq %rax, %rcx
testq %rcx, %rcx
je 0x18eda
movq (%rcx), %rcx
cmpq %r14, %rcx
jne 0x18c0f
jmp 0x18e6d
cmpb $0x0, 0x73(%rbx)
je 0x18c31
incl 0x48cbf(%rip)           # 0x618f0
incl 0x48cbd(%rip)           # 0x618f4
movq 0x38(%rbx), %r14
callq 0x2013d
testq %r14, %r14
je 0x18c48
movq %rax, (%r14)
movq 0x38(%rbx), %rdi
callq 0x20159
movq %rbx, %rdi
callq 0x1bac7
movq %rbx, %rdi
callq 0x1b6e6
movq %rax, %rdi
callq 0x23690
testl %eax, %eax
je 0x18c7a
cmpl $0x0, 0x48c7c(%rip)     # 0x618f0
je 0x19105
movq 0x38(%rbx), %rdi
callq 0x201a4
decl 0x48c6b(%rip)           # 0x618f4
cmpb $0x0, 0x73(%rbx)
je 0x188fd
decl 0x48c57(%rip)           # 0x618f0
jmp 0x188fd
movq %r13, %rsi
movq %r14, %rdx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1bf13
xorl %eax, %eax
leaq 0x30(%rsp), %r12
movq %rax, (%r12)
movq %r13, %r15
leaq 0x10(%rsp), %r13
movq %rax, (%r13)
leaq 0x18(%rbx), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x1bc07
leaq 0x28(%rbx), %rbp
movq 0x28(%rbx), %rdi
movq (%r12), %rsi
movq (%r13), %rdx
callq 0x17800
leaq 0x20(%rbx), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x188e1
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x188e1
movq 0x18(%rbx), %rdi
callq 0x1b6e6
movq %rax, %r14
movq 0x20(%rbx), %rdi
callq 0x1b6e6
movq %rax, %r15
leaq 0x494cb(%rip), %rax     # 0x621f8
movq (%rax), %rax
movq 0x30(%rax), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1be6c
movq %r15, %rdi
callq 0x1b20a
testq %rax, %rax
je 0x18d56
cmpl $0x12, (%r15)
jne 0x19063
movq %r14, 0x28(%r15)
jmp 0x19071
leaq 0x18(%rbx), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x188e1
cmpq $0x0, 0x20(%rbx)
je 0x188fd
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x28(%rbx), %rdi
addq %rbp, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x188e1
movq 0x18(%rbx), %rdi
movq 0x28(%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
callq 0x1b6e6
movq %r14, %r12
movq %r13, %r14
movq %rax, %r13
movq 0x28(%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0x18(%rax), %rdi
callq 0x1b6e6
movq 0x8(%rsp), %rdi
movq %r13, %rsi
movq %r14, %r13
movq %r12, %r14
movq %rax, %rdx
callq 0x1a59b
incq %r15
addq $0x8, %rbp
cmpq 0x20(%rbx), %r15
jb 0x18d7d
jmp 0x188fd
leaq 0x18(%rbx), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x188e1
leaq 0x20(%rbx), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x188e1
leaq 0x28(%rbx), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x188e1
movq 0x18(%rbx), %rdi
callq 0x1b6e6
movq %rax, %r14
movq (%rbx), %rdi
movl $0x2, %esi
callq 0x22d38
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 0x1a59b
leaq 0x18(%rbx), %r12
movq 0x38(%rbx), %r15
callq 0x20037
movq %rax, %rcx
testq %rcx, %rcx
je 0x18fe3
movq (%rcx), %rcx
cmpq %r15, %rcx
jne 0x18e5c
leaq 0x1d583(%rip), %rdi     # 0x363f7
leaq 0x1d42d(%rip), %rsi     # 0x362a8
leaq 0x1d584(%rip), %rcx     # 0x36406
movl $0x162, %edx            # imm = 0x162
callq 0x4180
xorl %eax, %eax
leaq 0x30(%rsp), %r12
movq %rax, (%r12)
movq %r13, %r15
leaq 0x10(%rsp), %r13
movq %rax, (%r13)
leaq 0x18(%rbx), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x1bc07
movq 0x20(%rbx), %rdi
addq $0x20, %rbx
movq (%r12), %rsi
movq (%r13), %rdx
callq 0x17800
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x188e1
jmp 0x188fd
movq %rax, (%r14)
movq 0x20(%rbx), %rdi
callq 0x20070
movq 0x18(%rbx), %r14
callq 0x2013d
testq %r14, %r14
je 0x18ef7
movq %rax, (%r14)
movq 0x18(%rbx), %rdi
callq 0x20159
movq 0x20(%rbx), %rdi
callq 0x18779
movl $0x0, 0x10(%rsp)
cmpq $0x0, 0x30(%rbx)
je 0x18f3b
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x38(%rbx), %rdi
addq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x188e1
incq %r15
addq $0x8, %r14
cmpq 0x30(%rbx), %r15
jb 0x18f1e
leaq 0x40(%rbx), %rdi
movq 0x28(%rbx), %rax
movq 0x68(%rax), %rax
movq (%rax), %rsi
leaq 0x10(%rsp), %r14
movq %r14, %rdx
callq 0x188e1
cmpl $0x0, (%r14)
jne 0x18f89
movq %rbx, %rdi
callq 0x1b6e6
movq 0x68(%rax), %rax
movq (%rax), %r14
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0x1, %esi
callq 0x22d38
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1a59b
movq 0x18(%rbx), %rdi
callq 0x201a4
callq 0x200b6
jmp 0x188fd
movq %rax, (%r15)
movq 0x18(%rbx), %rdi
callq 0x20070
movq 0x18(%rbx), %rdi
callq 0x18779
cmpq $0x0, 0x20(%rbx)
je 0x19050
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x28(%rbx), %rdi
addq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x188e1
incq %r12
addq $0x8, %r15
cmpq 0x20(%rbx), %r12
jb 0x18fc2
jmp 0x19050
movq %rax, (%r15)
movq 0x38(%rbx), %rdi
callq 0x20070
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x188e1
leaq 0x20(%rbx), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x188e1
leaq 0x28(%rbx), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x188e1
leaq 0x30(%rbx), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x188e1
movq 0x20(%rbx), %rdi
callq 0x1b6e6
movq %rax, %r14
movq (%rbx), %rdi
movl $0x2, %esi
callq 0x22d38
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1a59b
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x200b6
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1a59b
movq %rbx, %rdi
callq 0x1becd
jmp 0x188fd
movq 0x20(%rbp), %rdi
callq 0x1e73b
movq %rax, %r15
movq 0x10(%r14), %rdi
callq 0x1e73b
movq %rax, %r14
movq %rbx, %rdi
callq 0x19a6f
leaq 0x1d6d5(%rip), %rsi     # 0x3677a
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x13aa3
movq 0x10(%r14), %rdi
movq %rax, %r12
callq 0x1e73b
movq %rax, %r14
movq 0x28(%rbx), %rdi
callq 0x23e44
movq %rax, %r15
movq (%r12), %rdi
callq 0x1d56c
movq %rax, %r13
movq (%r12), %rdi
callq 0x1d580
leaq 0x1d6b1(%rip), %rsi     # 0x367a0
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
movq %r13, %r8
movl %eax, %r9d
xorl %eax, %eax
callq 0x13aa3
movq %rbx, %rdi
callq 0x19a6f
leaq 0x1d239(%rip), %rsi     # 0x3634d
jmp 0x19126
movq 0x18(%rbx), %rdi
callq 0x1e73b
leaq 0x1d607(%rip), %rsi     # 0x3672d
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x13aa3
movq 0x18(%rbx), %rdi
callq 0x1e73b
movq 0x40(%rbx), %rcx
movq 0x28(%r14), %r8
leaq 0x1d5ef(%rip), %rsi     # 0x3673a
movq %rbx, %rdi
movq %rax, %rdx
jmp 0x190b1
leaq 0x1d214(%rip), %rdi     # 0x36371
xorl %eax, %eax
callq 0x13a00