// File: /workspace/github_c_makefile_star2_O1/oridb[P]mc/parse/infer.c
// Function: initvar
static Type *
initvar(Node *n, Node *s)
{
	Type *t, *u, *param;
	Tysubst *subst;

	if (s->decl.ishidden && !allowhidden)
		fatal(n, "attempting to refer to hidden decl %s", ctxstr(n));

	param = n->expr.param;
	if (param)
		tyresolve(param);
	if (s->decl.isgeneric) {
		subst = mksubst();
		if (param)
			substput(subst, s->decl.trait->param, param);
		pushenv(s->decl.env);
		t = tysubstmap(subst, tf(s->decl.type), s->decl.type);
		if (s->decl.trait && !param) {
			u = tf(s->decl.trait->param);
			param = substget(subst, u);
			if (!param)
				fatal(n, "ambiguous trait decl %s", ctxstr(s));
		}
		popenv(s->decl.env);
		substfree(subst);
	} else {
		t = s->decl.type;
	}
	n->expr.did = s->decl.did;
	n->expr.isconst = s->decl.isconst;
	if (param) {
		n->expr.param = param;
		delayedcheck(n);
	}
	if (s->decl.isgeneric && !ingeneric) {
		t = tyfreshen(NULL, t);
		addspecialization(n, curstab());
		if (t->type == Tyvar) {
			settype(n, mktyvar(n->loc));
			delayedcheck(n);
		} else {
			settype(n, t);
		}
	} else {
		settype(n, t);
	}
	return t;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x0, 0x76(%rsi)
je 0x1cbd2
cmpl $0x0, 0x44bdc(%rip)     # 0x617a8
je 0x1cd6e
movq 0x28(%rbx), %r15
testq %r15, %r15
je 0x1cbe3
movq %r15, %rdi
callq 0x1ae68
cmpb $0x0, 0x73(%r14)
je 0x1cc7b
callq 0x1e994
movq %rax, %r13
testq %r15, %r15
je 0x1cc0e
movq 0x40(%r14), %rax
movq 0x18(%rax), %rsi
movq %r13, %rdi
movq %r15, %rdx
callq 0x1e938
testq %r15, %r15
setne %bpl
movq 0x38(%r14), %rdi
callq 0x20159
movq 0x28(%r14), %rdi
callq 0x196c0
movq 0x28(%r14), %rdx
movq %r13, %rdi
movq %rax, %rsi
callq 0x1b84a
movq %rax, %r12
movq 0x40(%r14), %rax
testq %rax, %rax
sete %cl
orb %bpl, %cl
jne 0x1cc68
movq 0x18(%rax), %rdi
callq 0x196c0
movq %r13, %rdi
movq %rax, %rsi
callq 0x1e949
movq %rax, %r15
testq %rax, %rax
je 0x1cd7f
movq 0x38(%r14), %rdi
callq 0x201a4
movq %r13, %rdi
callq 0x1e9d5
jmp 0x1cc7f
movq 0x28(%r14), %r12
movq 0x18(%r14), %rax
movq %rax, 0x38(%rbx)
movsbl 0x72(%r14), %eax
movl %eax, 0x30(%rbx)
testq %r15, %r15
je 0x1cca0
movq %r15, 0x28(%rbx)
movq %rbx, %rdi
callq 0x1becd
cmpb $0x0, 0x73(%r14)
je 0x1cd4d
cmpl $0x0, 0x44c3e(%rip)     # 0x618f0
jne 0x1cd4d
xorl %edi, %edi
movq %r12, %rsi
callq 0x1b8a3
movq %rax, %r14
callq 0x20037
leaq 0x44c97(%rip), %rcx     # 0x61968
movq (%rcx), %rcx
movq 0x38(%rbx), %rdx
movq (%rcx,%rdx,8), %r15
leaq 0x44c15(%rip), %rdi     # 0x618f8
leaq 0x44c16(%rip), %rsi     # 0x61900
movq %rax, %rdx
callq 0x2d3ff
leaq 0x44c0f(%rip), %rdi     # 0x61908
leaq 0x44c10(%rip), %rsi     # 0x61910
movq %rbx, %rdx
callq 0x2d3ff
leaq 0x44c09(%rip), %rdi     # 0x61918
leaq 0x44c0a(%rip), %rsi     # 0x61920
movq %r15, %rdx
callq 0x2d3ff
cmpl $0x19, (%r14)
jne 0x1cd55
movq (%rbx), %rdi
callq 0x22fd7
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1c85b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1becd
movq %rbx, %rdi
movq %r12, %rsi
jmp 0x1cd5b
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1c85b
movq %rbx, %rdi
callq 0x19a6f
leaq 0x19730(%rip), %rsi     # 0x364ad
jmp 0x1cd8e
movq %r14, %rdi
callq 0x19a6f
leaq 0x19745(%rip), %rsi     # 0x364d3
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x13aa3