// File: /workspace/github_c_makefile_star2_O3/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 0x4d704(%rip), %r15     # 0x61278
movq 0x90(%r15), %r14
cmpq $0x0, 0x58(%r15)
je 0x13b9f
xorl %r12d, %r12d
movq 0x50(%r15), %rax
movq (%rax,%r12,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x13e88
incq %r12
cmpq 0x58(%r15), %r12
jb 0x13b85
cmpq $0x0, 0x68(%r15)
je 0x13bc3
xorl %r12d, %r12d
movq 0x60(%r15), %rax
movq (%rax,%r12,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x13e88
incq %r12
cmpq 0x68(%r15), %r12
jb 0x13ba9
movq 0x80(%r15), %rdi
testq %rdi, %rdi
je 0x13bd8
xorl %esi, %esi
movl %ebx, %edx
callq 0x13e88
movq 0x88(%r15), %rdi
testq %rdi, %rdi
je 0x13bed
xorl %esi, %esi
movl %ebx, %edx
callq 0x13e88
movq 0x18(%r14), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0x2da36
movq %rax, %r15
cmpq $0x0, (%r12)
je 0x13c30
xorl %r12d, %r12d
movq (%r15,%r12,8), %rsi
movq %r14, %rdi
callq 0x20250
cmpb $0x1, 0x70(%rax)
jne 0x13c27
movq %rax, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x13e88
incq %r12
cmpq (%rsp), %r12
jb 0x13c09
movq %r15, %rdi
callq 0x4040
movq 0x28(%r14), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0x2da36
movq %rax, %r15
cmpq $0x0, (%r12)
je 0x13d37
xorl %r13d, %r13d
movq (%r15,%r13,8), %rsi
movq %r14, %rdi
callq 0x20396
movq %rax, %r12
cmpb $0x0, 0x95(%rax)
jne 0x13c7c
cmpl $0x1, 0x10(%r12)
jne 0x13d2a
testl %ebx, %ebx
je 0x13c94
cmpb $0x0, 0x93(%r12)
je 0x13c94
movl $0x2, 0x10(%r12)
movq %r12, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x1414a
cmpq $0x0, 0x70(%r12)
je 0x13cc6
xorl %ebp, %ebp
movq 0x68(%r12), %rax
movq (%rax,%rbp,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x1414a
incq %rbp
cmpq 0x70(%r12), %rbp
jb 0x13caa
movl (%r12), %eax
cmpl $0x1c, %eax
je 0x13cfc
cmpl $0x1d, %eax
jne 0x13d2a
cmpq $0x0, 0x38(%r12)
je 0x13d2a
xorl %ebp, %ebp
movq 0x30(%r12), %rax
movq (%rax,%rbp,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x1414a
incq %rbp
cmpq 0x38(%r12), %rbp
jb 0x13cde
jmp 0x13d2a
movq %r12, %rdi
callq 0x13a50
cmpq $0x0, 0x48(%r12)
je 0x13d2a
xorl %ebp, %ebp
movq 0x40(%r12), %rax
movq (%rax,%rbp,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x1414a
incq %rbp
cmpq 0x48(%r12), %rbp
jb 0x13d0e
incq %r13
cmpq (%rsp), %r13
jb 0x13c58
movq %r15, %rdi
callq 0x4040
leaq 0x4e4aa(%rip), %r14     # 0x621f0
cmpq $0x0, (%r14)
je 0x13e08
xorl %r15d, %r15d
leaq 0x4e49e(%rip), %r12     # 0x621f8
movq (%r12), %rax
movq (%rax,%r15,8), %r13
cmpl $0x1, 0xc(%r13)
jne 0x13dfc
testl %ebx, %ebx
je 0x13d80
cmpb $0x0, 0x49(%r13)
je 0x13d80
movl $0x2, 0xc(%r13)
movq 0x18(%r13), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x1414a
movl 0xc(%r13), %eax
movq 0x18(%r13), %rcx
movl %eax, 0x10(%rcx)
cmpq $0x0, 0x28(%r13)
je 0x13dca
movq 0x20(%r13), %rax
xorl %ebp, %ebp
movq (%rax,%rbp,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x1414a
movl 0xc(%r13), %ecx
movq 0x20(%r13), %rax
movq (%rax,%rbp,8), %rdx
movl %ecx, 0x10(%rdx)
incq %rbp
cmpq 0x28(%r13), %rbp
jb 0x13da5
cmpq $0x0, 0x38(%r13)
je 0x13dfc
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 0x13e88
incq %rbp
cmpq 0x38(%r13), %rbp
jb 0x13dd3
incq %r15
cmpq (%r14), %r15
jb 0x13d5a
leaq 0x4e401(%rip), %r15     # 0x62210
cmpq $0x0, (%r15)
je 0x13e79
leaq 0x4e3ec(%rip), %r12     # 0x62208
movq (%r12), %rax
xorl %r13d, %r13d
movq (%rax,%r13,8), %r14
cmpl $0x1, 0x58(%r14)
jne 0x13e71
movq %r14, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x13e88
movq 0x20(%r14), %r14
movq %r14, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x14386
movq 0x28(%r14), %rcx
movq (%r12), %rax
testq %rcx, %rcx
je 0x13e71
movl 0xc(%r14), %edx
movq 0x20(%r14), %rsi
xorl %edi, %edi
movq (%rsi,%rdi,8), %r8
movl %edx, 0x10(%r8)
incq %rdi
cmpq %rdi, %rcx
jne 0x13e61
incq %r13
cmpq (%r15), %r13
jb 0x13e23
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq