// File: /workspace/github_c_makefile_star2_O1/oridb[P]mc/parse/export.c
// Function: tagexports
void
tagexports(int hidelocal)
{
	size_t i, j, n;
	Trait *tr;
	Stab *st;
	void **k;
	Node *s;
	Type *t;

	st = file.globls;

	/* tag the initializers */
	for (i = 0; i < file.ninit; i++)
		tagnode(st, file.init[i], 0, hidelocal);
	for (i = 0; i < file.nfini; i++)
		tagnode(st, file.fini[i], 0, hidelocal);
	if (file.localinit)
		tagnode(st, file.localinit, 0, hidelocal);
	if (file.localfini)
		tagnode(st, file.localfini, 0, hidelocal);

	/* tag the exported nodes */
	k = htkeys(st->dcl, &n);
	for (i = 0; i < n; i++) {
		s = getdcl(st, k[i]);
		if (s->decl.vis == Visexport)
			tagnode(st, s, 0, hidelocal);
	}
	free(k);

	/* get the explicitly exported types */
	k = htkeys(st->ty, &n);
	for (i = 0; i < n; i++) {
		t = gettype(st, k[i]);
		if (!t->isreflect && t->vis != Visexport)
			continue;
		if (hidelocal && t->ispkglocal)
			t->vis = Vishidden;
		tagtype(st, t, 0, hidelocal);
		for (j = 0; j < t->nsub; j++)
			tagtype(st, t->sub[j], 0, hidelocal);
		if (t->type == Tyname) {
			tagreflect(t);
			for (j = 0; j < t->narg; j++)
				tagtype(st, t->arg[j], 0, hidelocal);
		} else if (t->type == Tygeneric) {
			for (j = 0; j < t->ngparam; j++)
				tagtype(st, t->gparam[j], 0, hidelocal);
		}
	}
	free(k);

	/* tag the traits */
	for (i = 0; i < ntraittab; i++) {
		tr = traittab[i];
		if (tr->vis != Visexport)
			continue;
		if (hidelocal && tr->ishidden)
			tr->vis = Vishidden;
		tagtype(st, tr->param, 0, hidelocal);
		tr->param->vis = tr->vis;
		for (j = 0; j < tr->naux; j++) {
			tagtype(st, tr->aux[j], 0, hidelocal);
			tr->aux[j]->vis = tr->vis;
		}
		for (j = 0; j < tr->nproto; j++) {
			tr->proto[j]->decl.vis = tr->vis;
			tagnode(st, tr->proto[j], 0, hidelocal);
		}
	}

	/* tag the impls */
	for (i = 0; i < nimpltab; i++) {
		s = impltab[i];
		if (s->impl.vis != Visexport)
			continue;
		tagnode(st, s, 0, hidelocal);
                tr = s->impl.trait;
		tagtrait(st, tr, 0, hidelocal);
		for (j = 0; j < tr->naux; j++)
			tr->aux[j]->vis = tr->vis;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x4d54d(%rip), %r15     # 0x61278
movq 0x90(%r15), %r14
cmpq $0x0, 0x58(%r15)
je 0x13d56
xorl %r12d, %r12d
movq 0x50(%r15), %rax
movq (%rax,%r12,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x1403a
incq %r12
cmpq 0x58(%r15), %r12
jb 0x13d3c
cmpq $0x0, 0x68(%r15)
je 0x13d7a
xorl %r12d, %r12d
movq 0x60(%r15), %rax
movq (%rax,%r12,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x1403a
incq %r12
cmpq 0x68(%r15), %r12
jb 0x13d60
movq 0x80(%r15), %rdi
testq %rdi, %rdi
je 0x13d8f
xorl %esi, %esi
movl %ebx, %edx
callq 0x1403a
movq 0x88(%r15), %rdi
testq %rdi, %rdi
je 0x13da4
xorl %esi, %esi
movl %ebx, %edx
callq 0x1403a
movq 0x18(%r14), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0x2dedf
movq %rax, %r15
cmpq $0x0, (%r12)
je 0x13de7
xorl %r12d, %r12d
movq (%r15,%r12,8), %rsi
movq %r14, %rdi
callq 0x2048b
cmpb $0x1, 0x70(%rax)
jne 0x13dde
movq %rax, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x1403a
incq %r12
cmpq (%rsp), %r12
jb 0x13dc0
movq %r15, %rdi
callq 0x4040
movq 0x28(%r14), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0x2dedf
movq %rax, %r15
cmpq $0x0, (%r12)
je 0x13eee
xorl %r13d, %r13d
movq (%r15,%r13,8), %rsi
movq %r14, %rdi
callq 0x205d4
movq %rax, %r12
cmpb $0x0, 0x95(%rax)
jne 0x13e33
cmpl $0x1, 0x10(%r12)
jne 0x13ee1
testl %ebx, %ebx
je 0x13e4b
cmpb $0x0, 0x93(%r12)
je 0x13e4b
movl $0x2, 0x10(%r12)
movq %r12, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x142fe
cmpq $0x0, 0x70(%r12)
je 0x13e7d
xorl %ebp, %ebp
movq 0x68(%r12), %rax
movq (%rax,%rbp,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x142fe
incq %rbp
cmpq 0x70(%r12), %rbp
jb 0x13e61
movl (%r12), %eax
cmpl $0x1c, %eax
je 0x13eb3
cmpl $0x1d, %eax
jne 0x13ee1
cmpq $0x0, 0x38(%r12)
je 0x13ee1
xorl %ebp, %ebp
movq 0x30(%r12), %rax
movq (%rax,%rbp,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x142fe
incq %rbp
cmpq 0x38(%r12), %rbp
jb 0x13e95
jmp 0x13ee1
movq %r12, %rdi
callq 0x13c0c
cmpq $0x0, 0x48(%r12)
je 0x13ee1
xorl %ebp, %ebp
movq 0x40(%r12), %rax
movq (%rax,%rbp,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x142fe
incq %rbp
cmpq 0x48(%r12), %rbp
jb 0x13ec5
incq %r13
cmpq (%rsp), %r13
jb 0x13e0f
movq %r15, %rdi
callq 0x4040
leaq 0x4e2f3(%rip), %r14     # 0x621f0
cmpq $0x0, (%r14)
je 0x13fbf
xorl %r15d, %r15d
leaq 0x4e2e7(%rip), %r12     # 0x621f8
movq (%r12), %rax
movq (%rax,%r15,8), %r13
cmpl $0x1, 0xc(%r13)
jne 0x13fb3
testl %ebx, %ebx
je 0x13f37
cmpb $0x0, 0x49(%r13)
je 0x13f37
movl $0x2, 0xc(%r13)
movq 0x18(%r13), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x142fe
movl 0xc(%r13), %eax
movq 0x18(%r13), %rcx
movl %eax, 0x10(%rcx)
cmpq $0x0, 0x28(%r13)
je 0x13f81
xorl %ebp, %ebp
movq 0x20(%r13), %rax
movq (%rax,%rbp,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x142fe
movl 0xc(%r13), %eax
movq 0x20(%r13), %rcx
movq (%rcx,%rbp,8), %rcx
movl %eax, 0x10(%rcx)
incq %rbp
cmpq 0x28(%r13), %rbp
jb 0x13f58
cmpq $0x0, 0x38(%r13)
je 0x13fb3
xorl %ebp, %ebp
movb 0xc(%r13), %al
movq 0x30(%r13), %rcx
movq (%rcx,%rbp,8), %rcx
movb %al, 0x70(%rcx)
movq 0x30(%r13), %rax
movq (%rax,%rbp,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x1403a
incq %rbp
cmpq 0x38(%r13), %rbp
jb 0x13f8a
incq %r15
cmpq (%r14), %r15
jb 0x13f11
leaq 0x4e24a(%rip), %r15     # 0x62210
cmpq $0x0, (%r15)
je 0x1402b
xorl %r12d, %r12d
leaq 0x4e232(%rip), %r13     # 0x62208
movq (%r13), %rax
movq (%rax,%r12,8), %r14
cmpl $0x1, 0x58(%r14)
jne 0x14023
movq %r14, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x1403a
movq 0x20(%r14), %r14
movq %r14, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x145ad
movq 0x28(%r14), %rax
testq %rax, %rax
je 0x14023
movl 0xc(%r14), %ecx
movq 0x20(%r14), %rdx
xorl %esi, %esi
movq (%rdx,%rsi,8), %rdi
movl %ecx, 0x10(%rdi)
incq %rsi
cmpq %rsi, %rax
jne 0x14014
incq %r12
cmpq (%r15), %r12
jb 0x13fd6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq