// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/parse/export.c
// Function: tagnode
static void
tagnode(Stab *st, Node *n, int ingeneric, int hidelocal)
{
	size_t i;
	Node *d;

	if (!n)
		return;
	switch (n->type) {
	case Nblock:
		for (i = 0; i < n->block.nstmts; i++)
			tagnode(st, n->block.stmts[i], ingeneric, hidelocal);
		break;
	case Nifstmt:
		tagnode(st, n->ifstmt.cond, ingeneric, hidelocal);
		tagnode(st, n->ifstmt.iftrue, ingeneric, hidelocal);
		tagnode(st, n->ifstmt.iffalse, ingeneric, hidelocal);
		break;
	case Nloopstmt:
		tagnode(st, n->loopstmt.init, ingeneric, hidelocal);
		tagnode(st, n->loopstmt.cond, ingeneric, hidelocal);
		tagnode(st, n->loopstmt.step, ingeneric, hidelocal);
		tagnode(st, n->loopstmt.body, ingeneric, hidelocal);
		break;
	case Niterstmt:
		tagnode(st, n->iterstmt.elt, ingeneric, hidelocal);
		tagnode(st, n->iterstmt.seq, ingeneric, hidelocal);
		tagnode(st, n->iterstmt.body, ingeneric, hidelocal);
		break;
	case Nmatchstmt:
		tagnode(st, n->matchstmt.val, ingeneric, hidelocal);
		for (i = 0; i < n->matchstmt.nmatches; i++)
			tagnode(st, n->matchstmt.matches[i], ingeneric, hidelocal);
		break;
	case Nmatch:
		tagnode(st, n->match.pat, ingeneric, hidelocal);
		tagnode(st, n->match.block, ingeneric, hidelocal);
		break;
	case Nexpr:
		tagnode(st, n->expr.idx, ingeneric, hidelocal);
		tagtype(st, n->expr.type, ingeneric, hidelocal);
		if (n->expr.param)
			tagtype(st, n->expr.param, ingeneric, hidelocal);
		for (i = 0; i < n->expr.nargs; i++)
			tagnode(st, n->expr.args[i], ingeneric, hidelocal);
		/* generics need to have the decls they refer to exported. */
		if (ingeneric && exprop(n) == Ovar) {
			d = decls[n->expr.did];
			if (d->decl.isglobl && d->decl.vis == Visintern) {
				d->decl.vis = Vishidden;
				tagnode(st, d, ingeneric, hidelocal);
			}
		}
		break;
	case Nlit:
		tagtype(st, n->lit.type, ingeneric, hidelocal);
		if (n->lit.littype == Lfunc)
			tagnode(st, n->lit.fnval, ingeneric, hidelocal);
		break;
	case Ndecl:
		tagtype(st, n->decl.type, ingeneric, hidelocal);
		if (hidelocal && n->decl.ispkglocal)
			n->decl.vis = Vishidden;
		n->decl.isexportval = isexportval(n);
		if (n->decl.isexportval || ingeneric)
			tagnode(st, n->decl.init, n->decl.isgeneric, hidelocal);
		break;
	case Nfunc:
		tagtype(st, n->func.type, ingeneric, hidelocal);
		for (i = 0; i < n->func.nargs; i++)
			tagnode(st, n->func.args[i], ingeneric, hidelocal);
		tagnode(st, n->func.body, ingeneric, hidelocal);
		break;
	case Nimpl:
		tagtype(st, n->impl.type, ingeneric, hidelocal);
		for (i = 0; i < n->impl.naux; i++)
			tagtype(st, n->impl.aux[i], ingeneric, hidelocal);
		for (i = 0; i < n->impl.ndecls; i++) {
			n->impl.decls[i]->decl.vis = Vishidden;
			tagnode(st, n->impl.decls[i], 0, hidelocal);
		}
		break;
	case Nuse:
	case Nname:
		break;
	case Nnone:
		die("Invalid node for type export\n");
		break;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x14067
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x1eef2(%rip), %r15     # 0x32d9c
leaq 0x4dab7(%rip), %r12     # 0x61968
movl 0x8(%r14), %eax
cmpq $0xd, %rax
ja 0x14067
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq 0x18(%r14), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x13e88
movq 0x20(%r14), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x13e88
movq 0x28(%r14), %r14
jmp 0x1405e
movq 0x18(%r14), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x13e88
movq 0x20(%r14), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x13e88
movq 0x28(%r14), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x13e88
jmp 0x1405a
movq 0x28(%r14), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x1414a
cmpq $0x0, 0x30(%r14)
je 0x13f48
xorl %r13d, %r13d
movq 0x38(%r14), %rax
movq (%rax,%r13,8), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x13e88
incq %r13
cmpq 0x30(%r14), %r13
jb 0x13f2e
movq 0x40(%r14), %r14
jmp 0x1405e
movq 0x18(%r14), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x13e88
movq 0x20(%r14), %r14
jmp 0x1405e
movq 0x48(%r14), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x13e88
movq 0x20(%r14), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x1414a
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x13f93
movl %ebp, %esi
movl %ebx, %edx
callq 0x1414a
cmpq $0x0, 0x40(%r14)
je 0x13fb7
xorl %r13d, %r13d
movq 0x50(%r14), %rax
movq (%rax,%r13,8), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x13e88
incq %r13
cmpq 0x40(%r14), %r13
jb 0x13f9d
testl %ebp, %ebp
je 0x14067
movq %r14, %rdi
callq 0x1d422
cmpl $0x33, %eax
jne 0x14067
movq (%r12), %rax
movq 0x38(%r14), %rcx
movq (%rax,%rcx,8), %r14
cmpb $0x0, 0x71(%r14)
je 0x14067
cmpb $0x0, 0x70(%r14)
jne 0x14067
movb $0x2, 0x70(%r14)
jmp 0x1405e
movq 0x28(%r14), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x1414a
testl %ebx, %ebx
je 0x14012
cmpb $0x0, 0x75(%r14)
je 0x14012
movb $0x2, 0x70(%r14)
cmpb $0x0, 0x73(%r14)
je 0x14020
cmpq $0x0, 0x40(%r14)
je 0x14048
movq 0x28(%r14), %rdi
callq 0x23017
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
jmp 0x1404d
movq 0x20(%r14), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x1414a
cmpl $0x5, 0x18(%r14)
je 0x1405a
jmp 0x14067
movl $0x1, %ecx
movb %cl, 0x79(%r14)
orl %ecx, %ebp
je 0x14067
movsbl 0x73(%r14), %ebp
movq 0x30(%r14), %r14
testq %r14, %r14
jne 0x13eb1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x20(%r14)
je 0x14067
xorl %r15d, %r15d
movq 0x28(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x13e88
incq %r15
cmpq 0x20(%r14), %r15
jb 0x14080
jmp 0x14067
movq 0x28(%r14), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x1414a
cmpq $0x0, 0x40(%r14)
je 0x140cd
xorl %r15d, %r15d
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x1414a
incq %r15
cmpq 0x40(%r14), %r15
jb 0x140b3
cmpq $0x0, 0x50(%r14)
je 0x14067
xorl %r15d, %r15d
movq 0x48(%r14), %rax
movq (%rax,%r15,8), %rax
movb $0x2, 0x70(%rax)
movq 0x48(%r14), %rax
movq (%rax,%r15,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x13e88
incq %r15
cmpq 0x50(%r14), %r15
jb 0x140d7
jmp 0x14067
movq 0x18(%r14), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x13e88
cmpq $0x0, 0x20(%r14)
je 0x14067
xorl %r15d, %r15d
movq 0x28(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x13e88
incq %r15
cmpq 0x20(%r14), %r15
jb 0x1411d
jmp 0x14067
leaq 0x1ecad(%rip), %rdi     # 0x32df0
xorl %eax, %eax
callq 0x13844