// File: /workspace/github_c_makefile_star2_O2/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 0x3a25a(%rip), %r13     # 0x5e278
movq 0x90(%r13), %r14
pushq $0x55
popq %rsi
callq 0x2a7ef
pushq $0x17
popq %rsi
movq %rbx, %rdi
callq 0x2a82d
movq 0x8(%r14), %rsi
testq %rsi, %rsi
movq %r14, 0x8(%rsp)
movq %rbx, %rdi
jne 0x2404b
xorl %esi, %esi
callq 0x2a882
movq 0x18(%r13), %rax
xorl %r14d, %r14d
pushq $0x4c
popq %rbp
cmpq %rax, %r14
jae 0x2408d
movq 0x10(%r13), %rcx
movq (%rcx,%r14,8), %r15
cmpl $0x0, 0x18(%r15)
jne 0x24088
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2a7ef
movq 0x20(%r15), %rsi
movq %rbx, %rdi
callq 0x2a882
movq 0x18(%r13), %rax
incq %r14
jmp 0x2405a
xorl %r14d, %r14d
pushq $0x4c
popq %rbp
cmpq 0x28(%r13), %r14
jae 0x240b8
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2a7ef
movq 0x20(%r13), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x2a882
incq %r14
jmp 0x24093
xorl %r14d, %r14d
pushq $0x58
popq %rbp
cmpq 0x38(%r13), %r14
jae 0x240e3
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2a7ef
movq 0x30(%r13), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x2a882
incq %r14
jmp 0x240be
pushq $0x46
popq %rsi
movq %rbx, %rdi
callq 0x2a7ef
movq 0x8(%r13), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x2a882
leaq 0x3b0e4(%rip), %r14     # 0x5f1e8
movq (%r14), %rax
xorl %r15d, %r15d
leaq 0x3b0c7(%rip), %r12     # 0x5f1d8
pushq $0x54
popq %rbp
cmpq %rax, %r15
jae 0x24160
movq (%r12), %rcx
movq (%rcx,%r15,8), %rcx
movl 0x10(%rcx), %ecx
decl %ecx
cmpl $0x1, %ecx
ja 0x2415b
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2a7ef
movq (%r12), %rax
movq (%rax,%r15,8), %rax
movl 0x4(%rax), %esi
movq %rbx, %rdi
callq 0x2a82d
movq (%r12), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x2440d
movq (%r14), %rax
incq %r15
jmp 0x24114
xorl %r15d, %r15d
leaq 0x3b086(%rip), %r12     # 0x5f1f0
cmpq (%r12), %r15
jae 0x2422f
leaq 0x3b07d(%rip), %rax     # 0x5f1f8
movq (%rax), %rax
movq (%rax,%r15,8), %r14
cmpl $0x8, (%r14)
jl 0x24227
movl 0xc(%r14), %eax
decl %eax
cmpl $0x1, %eax
ja 0x24227
movq %rbx, %rdi
pushq $0x52
popq %rsi
callq 0x2a7ef
movslq (%r14), %rsi
movq %rbx, %rdi
callq 0x2a82d
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x2a82d
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x2475a
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x2440d
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x2a82d
xorl %ebp, %ebp
cmpq 0x28(%r14), %rbp
jae 0x241fe
movq 0x20(%r14), %rax
movq (%rax,%rbp,8), %rsi
movq %rbx, %rdi
callq 0x24da7
incq %rbp
jmp 0x241e3
movq 0x38(%r14), %rsi
movq %rbx, %rdi
callq 0x2a82d
xorl %ebp, %ebp
cmpq 0x38(%r14), %rbp
jae 0x24227
movq 0x30(%r14), %rax
movq (%rax,%rbp,8), %rsi
movq %rbx, %rdi
callq 0x24b6b
incq %rbp
jmp 0x2420c
incq %r15
jmp 0x2416a
leaq 0x3afda(%rip), %rax     # 0x5f210
movq (%rax), %rax
xorl %r12d, %r12d
leaq 0x3afc5(%rip), %r14     # 0x5f208
pushq $0x49
popq %rbp
cmpq %rax, %r12
jae 0x2428c
movq (%r14), %rcx
movq (%rcx,%r12,8), %r15
cmpb $0x0, 0x5c(%r15)
jne 0x243cf
movl 0x58(%r15), %ecx
decl %ecx
cmpl $0x1, %ecx
ja 0x24287
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2a7ef
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2475a
leaq 0x3af8c(%rip), %rax     # 0x5f210
movq (%rax), %rax
incq %r12
jmp 0x24246
movq 0x8(%rsp), %rbp
movq 0x18(%rbp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2a529
movq %rax, %r15
xorl %r14d, %r14d
cmpq 0x10(%rsp), %r14
jae 0x24312
movq (%r15,%r14,8), %rsi
movq %rbp, %rdi
callq 0x1dc67
testq %rax, %rax
je 0x243ee
movq %rax, %r12
movzbl 0x70(%rax), %eax
testl %eax, %eax
je 0x2430d
cmpl $0x3, %eax
je 0x2430d
cmpq $0x0, 0x40(%r12)
jne 0x2430d
cmpb $0x0, 0x7a(%r12)
jne 0x2430d
cmpb $0x0, 0x7b(%r12)
jne 0x2430d
xorl %eax, %eax
cmpb $0x0, 0x73(%r12)
setne %al
leal (%rax,%rax,2), %esi
addl $0x44, %esi
movq %rbx, %rdi
callq 0x2a7ef
movq %rbx, %rdi
movq %r12, %rsi
callq 0x24b6b
incq %r14
jmp 0x242a5
xorl %r14d, %r14d
pushq $0x53
popq %rbp
cmpq 0x58(%r13), %r14
jae 0x2433d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2a7ef
movq 0x50(%r13), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x2475a
incq %r14
jmp 0x24318
cmpq $0x0, 0x80(%r13)
je 0x24365
pushq $0x53
popq %rsi
movq %rbx, %rdi
callq 0x2a7ef
movq 0x80(%r13), %rax
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x2475a
xorl %r14d, %r14d
pushq $0x45
popq %rbp
cmpq 0x68(%r13), %r14
jae 0x24390
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2a7ef
movq 0x60(%r13), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x2475a
incq %r14
jmp 0x2436b
cmpq $0x0, 0x88(%r13)
je 0x243b8
pushq $0x45
popq %rsi
movq %rbx, %rdi
callq 0x2a7ef
movq 0x88(%r13), %rax
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x2475a
movq %r15, %rdi
callq 0x4040
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xfd4c(%rip), %rdi      # 0x34122
leaq 0xfd56(%rip), %rsi      # 0x34133
leaq 0xfd55(%rip), %rcx      # 0x34139
movl $0x4ee, %edx            # imm = 0x4EE
callq 0x4180
leaq 0xfd5a(%rip), %rdi      # 0x3414f
leaq 0xfd37(%rip), %rsi      # 0x34133
leaq 0xfd36(%rip), %rcx      # 0x34139
movl $0x4f8, %edx            # imm = 0x4F8
callq 0x4180