// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/parse/use.c
// Function: writeuse
void
writeuse(FILE *f)
{
	Stab *st;
	void **k;
	Trait *tr;
	Node *s, *u;
	size_t i, n;

	st = file.globls;

	/* usefile name */
	wrbyte(f, 'U');
	wrint(f, Abiversion); /* use version */
	if (st->name)
		wrstr(f, st->name);
	else
		wrstr(f, NULL);

	/* library deps */
	for (i = 0; i < file.nuses; i++) {
		u = file.uses[i];
		if (!u->use.islocal) {
			wrbyte(f, 'L');
			wrstr(f, u->use.name);
		}
	}
	for (i = 0; i < file.nlibdeps; i++) {
		wrbyte(f, 'L');
		wrstr(f, file.libdeps[i]);
	}
	for (i = 0; i < file.nextlibs; i++) {
		wrbyte(f, 'X');
		wrstr(f, file.extlibs[i]);
	}

	/* source file name */
	wrbyte(f, 'F');
	wrstr(f, file.files[0]);

	for (i = 0; i < ntypes; i++) {
		if (types[i]->vis == Visexport || types[i]->vis == Vishidden) {
			wrbyte(f, 'T');
			wrint(f, types[i]->tid);
			typickle(f, types[i]);
		}
	}

	for (i = 0; i < ntraittab; i++) {
		tr = traittab[i];
		if (tr->uid < Ntraits)
			continue;
		if (tr->vis == Visexport || tr->vis == Vishidden) {
			wrbyte(f, 'R');
			traitpickle(f, tr);
		}
	}

	for (i = 0; i < nimpltab; i++) {
		/* merging during inference should remove all protos */
		s = impltab[i];
		assert(!s->impl.isproto);
		if (s->impl.vis == Visexport || s->impl.vis == Vishidden) {
			wrbyte(f, 'I');
			pickle(f, s);
		}
	}

	k = htkeys(st->dcl, &n);
	for (i = 0; i < n; i++) {
		s = getdcl(st, k[i]);
		assert(s != NULL);
		if (s->decl.vis == Visintern || s->decl.vis == Visbuiltin)
			continue;
		/* trait functions get written out with their traits */
		if (s->decl.trait || s->decl.isinit || s->decl.isfini)
			continue;
		else if (s->decl.isgeneric)
			wrbyte(f, 'G');
		else
			wrbyte(f, 'D');
		wrsym(f, s);
	}
	for (i = 0; i < file.ninit; i++) {
		wrbyte(f, 'S');
		pickle(f, file.init[i]);
	}
	if (file.localinit) {
		wrbyte(f, 'S');
		pickle(f, file.localinit->decl.name);
	}
	for (i = 0; i < file.nfini; i++) {
		wrbyte(f, 'E');
		pickle(f, file.fini[i]);
	}
	if (file.localfini) {
		wrbyte(f, 'E');
		pickle(f, file.localfini->decl.name);
	}
	free(k);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x3a326(%rip), %r13     # 0x61278
movq 0x90(%r13), %r12
movl $0x55, %esi
callq 0x2dd32
movl $0x17, %esi
movq %rbx, %rdi
callq 0x2dd70
movq 0x8(%r12), %rsi
movq %rbx, %rdi
testq %rsi, %rsi
jne 0x26f7f
xorl %esi, %esi
callq 0x2ddc9
movq 0x18(%r13), %rax
testq %rax, %rax
je 0x26fc8
movq 0x10(%r13), %rcx
xorl %r14d, %r14d
movq (%rcx,%r14,8), %r15
cmpl $0x0, 0x18(%r15)
jne 0x26fc0
movq %rbx, %rdi
movl $0x4c, %esi
callq 0x2dd32
movq 0x20(%r15), %rsi
movq %rbx, %rdi
callq 0x2ddc9
movq 0x10(%r13), %rcx
movq 0x18(%r13), %rax
incq %r14
cmpq %rax, %r14
jb 0x26f94
cmpq $0x0, 0x28(%r13)
je 0x26ff8
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x4c, %esi
callq 0x2dd32
movq 0x20(%r13), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x2ddc9
incq %r14
cmpq 0x28(%r13), %r14
jb 0x26fd2
cmpq $0x0, 0x38(%r13)
je 0x27028
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x58, %esi
callq 0x2dd32
movq 0x30(%r13), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x2ddc9
incq %r14
cmpq 0x38(%r13), %r14
jb 0x27002
movq %r12, 0x8(%rsp)
movq %rbx, %rdi
movl $0x46, %esi
callq 0x2dd32
movq 0x8(%r13), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x2ddc9
leaq 0x3b198(%rip), %r14     # 0x621e8
movq (%r14), %rax
testq %rax, %rax
je 0x270af
leaq 0x3b179(%rip), %r15     # 0x621d8
movq (%r15), %rcx
xorl %r12d, %r12d
movq (%rcx,%r12,8), %rdx
movl 0x10(%rdx), %edx
decl %edx
cmpl $0x1, %edx
ja 0x270a7
movq %rbx, %rdi
movl $0x54, %esi
callq 0x2dd32
movq (%r15), %rax
movq (%rax,%r12,8), %rax
movl 0x4(%rax), %esi
movq %rbx, %rdi
callq 0x2dd70
movq (%r15), %rax
movq (%rax,%r12,8), %rsi
movq %rbx, %rdi
callq 0x27382
movq (%r15), %rcx
movq (%r14), %rax
incq %r12
cmpq %rax, %r12
jb 0x27065
leaq 0x3b13a(%rip), %r15     # 0x621f0
cmpq $0x0, (%r15)
je 0x2718e
xorl %r12d, %r12d
leaq 0x3b12e(%rip), %rax     # 0x621f8
movq (%rax), %rax
movq (%rax,%r12,8), %r14
cmpl $0x8, (%r14)
jl 0x27182
movl 0xc(%r14), %eax
decl %eax
cmpl $0x1, %eax
ja 0x27182
movq %rbx, %rdi
movl $0x52, %esi
callq 0x2dd32
movslq (%r14), %rsi
movq %rbx, %rdi
callq 0x2dd70
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x2dd70
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x27717
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x27382
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x2dd70
cmpq $0x0, 0x28(%r14)
je 0x27154
xorl %ebp, %ebp
movq 0x20(%r14), %rax
movq (%rax,%rbp,8), %rsi
movq %rbx, %rdi
callq 0x27d89
incq %rbp
cmpq 0x28(%r14), %rbp
jb 0x2713b
movq 0x38(%r14), %rsi
movq %rbx, %rdi
callq 0x2dd70
cmpq $0x0, 0x38(%r14)
je 0x27182
xorl %ebp, %ebp
movq 0x30(%r14), %rax
movq (%rax,%rbp,8), %rsi
movq %rbx, %rdi
callq 0x27b49
incq %rbp
cmpq 0x38(%r14), %rbp
jb 0x27169
incq %r12
cmpq (%r15), %r12
jb 0x270c3
leaq 0x3b07b(%rip), %r14     # 0x62210
movq (%r14), %rax
testq %rax, %rax
je 0x271eb
leaq 0x3b064(%rip), %r12     # 0x62208
movq (%r12), %rcx
xorl %ebp, %ebp
movq (%rcx,%rbp,8), %r15
cmpb $0x0, 0x5c(%r15)
jne 0x27344
movl 0x58(%r15), %edx
decl %edx
cmpl $0x1, %edx
ja 0x271e3
movq %rbx, %rdi
movl $0x49, %esi
callq 0x2dd32
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27717
movq (%r12), %rcx
movq (%r14), %rax
incq %rbp
cmpq %rax, %rbp
jb 0x271aa
movq 0x8(%rsp), %rbp
movq 0x18(%rbp), %rdi
leaq 0x10(%rsp), %r12
movq %r12, %rsi
callq 0x2da36
movq %rax, %r15
cmpq $0x0, (%r12)
je 0x27279
xorl %r14d, %r14d
movq (%r15,%r14,8), %rsi
movq %rbp, %rdi
callq 0x20250
testq %rax, %rax
je 0x27363
movq %rax, %r12
movzbl 0x70(%rax), %eax
testl %eax, %eax
je 0x2726f
cmpl $0x3, %eax
je 0x2726f
cmpq $0x0, 0x40(%r12)
jne 0x2726f
cmpb $0x0, 0x7a(%r12)
jne 0x2726f
cmpb $0x0, 0x7b(%r12)
jne 0x2726f
xorl %eax, %eax
cmpb $0x0, 0x73(%r12)
setne %al
leal (%rax,%rax,2), %esi
addl $0x44, %esi
movq %rbx, %rdi
callq 0x2dd32
movq %rbx, %rdi
movq %r12, %rsi
callq 0x27b49
incq %r14
cmpq 0x10(%rsp), %r14
jb 0x2720e
cmpq $0x0, 0x58(%r13)
je 0x272a9
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x53, %esi
callq 0x2dd32
movq 0x50(%r13), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x27717
incq %r14
cmpq 0x58(%r13), %r14
jb 0x27283
cmpq $0x0, 0x80(%r13)
je 0x272d3
movq %rbx, %rdi
movl $0x53, %esi
callq 0x2dd32
movq 0x80(%r13), %rax
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x27717
cmpq $0x0, 0x68(%r13)
je 0x27303
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x45, %esi
callq 0x2dd32
movq 0x60(%r13), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x27717
incq %r14
cmpq 0x68(%r13), %r14
jb 0x272dd
cmpq $0x0, 0x88(%r13)
je 0x2732d
movq %rbx, %rdi
movl $0x45, %esi
callq 0x2dd32
movq 0x88(%r13), %rax
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x27717
movq %r15, %rdi
callq 0x4040
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10dc7(%rip), %rdi     # 0x38112
leaq 0x10dd1(%rip), %rsi     # 0x38123
leaq 0x10dd0(%rip), %rcx     # 0x38129
movl $0x4ee, %edx            # imm = 0x4EE
callq 0x4180
leaq 0x10dd5(%rip), %rdi     # 0x3813f
leaq 0x10db2(%rip), %rsi     # 0x38123
leaq 0x10db1(%rip), %rcx     # 0x38129
movl $0x4f8, %edx            # imm = 0x4F8
callq 0x4180