// File: /workspace/github_c_makefile_star2_O2/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 0x4bf1b(%rip), %r15     # 0x5e278
movq 0x90(%r15), %r14
xorl %r12d, %r12d
cmpq 0x58(%r15), %r12
jae 0x12383
movq 0x50(%r15), %rax
movq (%rax,%r12,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x1262d
incq %r12
jmp 0x12367
xorl %r12d, %r12d
cmpq 0x68(%r15), %r12
jae 0x123a2
movq 0x60(%r15), %rax
movq (%rax,%r12,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x1262d
incq %r12
jmp 0x12386
movq 0x80(%r15), %rdi
testq %rdi, %rdi
je 0x123b7
xorl %esi, %esi
movl %ebx, %edx
callq 0x1262d
movq 0x88(%r15), %rdi
testq %rdi, %rdi
je 0x123cc
xorl %esi, %esi
movl %ebx, %edx
callq 0x1262d
movq 0x18(%r14), %rdi
movq %rsp, %rsi
callq 0x2a529
movq %rax, %r15
xorl %r12d, %r12d
cmpq (%rsp), %r12
jae 0x12407
movq (%r15,%r12,8), %rsi
movq %r14, %rdi
callq 0x1dc67
cmpb $0x1, 0x70(%rax)
jne 0x12402
movq %rax, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x1262d
incq %r12
jmp 0x123de
movq %r15, %rdi
callq 0x4040
movq 0x28(%r14), %rdi
movq %rsp, %rsi
callq 0x2a529
movq %rax, %r15
xorl %r13d, %r13d
cmpq (%rsp), %r13
jae 0x124f1
movq (%r15,%r13,8), %rsi
movq %r14, %rdi
callq 0x1dda3
movq %rax, %r12
cmpb $0x0, 0x95(%rax)
jne 0x1244f
cmpl $0x1, 0x10(%r12)
jne 0x124e9
testl %ebx, %ebx
je 0x12467
cmpb $0x0, 0x93(%r12)
je 0x12467
movl $0x2, 0x10(%r12)
movq %r12, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x128b0
xorl %ebp, %ebp
cmpq 0x70(%r12), %rbp
jae 0x12493
movq 0x68(%r12), %rax
movq (%rax,%rbp,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x128b0
incq %rbp
jmp 0x12475
movl (%r12), %eax
cmpl $0x1c, %eax
je 0x124c1
cmpl $0x1d, %eax
jne 0x124e9
xorl %ebp, %ebp
cmpq 0x38(%r12), %rbp
jae 0x124e9
movq 0x30(%r12), %rax
movq (%rax,%rbp,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x128b0
incq %rbp
jmp 0x124a3
movq %r12, %rdi
callq 0x12260
xorl %ebp, %ebp
cmpq 0x48(%r12), %rbp
jae 0x124e9
movq 0x40(%r12), %rax
movq (%rax,%rbp,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x128b0
incq %rbp
jmp 0x124cb
incq %r13
jmp 0x12421
movq %r15, %rdi
callq 0x4040
xorl %r14d, %r14d
leaq 0x4cced(%rip), %r15     # 0x5f1f0
leaq 0x4ccee(%rip), %r12     # 0x5f1f8
cmpq (%r15), %r14
jae 0x125b3
movq (%r12), %rax
movq (%rax,%r14,8), %r13
cmpl $0x1, 0xc(%r13)
jne 0x125ab
testl %ebx, %ebx
je 0x12539
cmpb $0x0, 0x49(%r13)
je 0x12539
movl $0x2, 0xc(%r13)
movq 0x18(%r13), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x128b0
movl 0xc(%r13), %eax
movq 0x18(%r13), %rcx
movl %eax, 0x10(%rcx)
xorl %ebp, %ebp
cmpq 0x28(%r13), %rbp
jae 0x1257e
movq 0x20(%r13), %rax
movq (%rax,%rbp,8), %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x128b0
movl 0xc(%r13), %eax
movq 0x20(%r13), %rcx
movq (%rcx,%rbp,8), %rcx
movl %eax, 0x10(%rcx)
incq %rbp
jmp 0x12553
xorl %ebp, %ebp
cmpq 0x38(%r13), %rbp
jae 0x125ab
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 0x1262d
incq %rbp
jmp 0x12580
incq %r14
jmp 0x1250a
leaq 0x4cc56(%rip), %r15     # 0x5f210
movq (%r15), %rax
xorl %r12d, %r12d
leaq 0x4cc41(%rip), %r13     # 0x5f208
cmpq %rax, %r12
jae 0x1261e
movq (%r13), %rcx
movq (%rcx,%r12,8), %r14
cmpl $0x1, 0x58(%r14)
jne 0x12619
movq %r14, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x1262d
movq 0x20(%r14), %r14
movq %r14, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x12a95
movq 0x28(%r14), %rcx
movq (%r15), %rax
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x12619
movl 0xc(%r14), %esi
movq 0x20(%r14), %rdi
movq (%rdi,%rdx,8), %rdi
movl %esi, 0x10(%rdi)
incq %rdx
jmp 0x12600
incq %r12
jmp 0x125c7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq