// File: /workspace/github_c_makefile_star2_O1/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 0x39e74(%rip), %r13     # 0x61278
movq 0x90(%r13), %r12
movl $0x55, %esi
callq 0x2e1b2
movl $0x17, %esi
movq %rbx, %rdi
callq 0x2e1f0
movq 0x8(%r12), %rsi
movq %rbx, %rdi
testq %rsi, %rsi
jne 0x27431
xorl %esi, %esi
callq 0x2e249
cmpq $0x0, 0x18(%r13)
je 0x27471
xorl %r14d, %r14d
movq 0x10(%r13), %rax
movq (%rax,%r14,8), %r15
cmpl $0x0, 0x18(%r15)
jne 0x27468
movq %rbx, %rdi
movl $0x4c, %esi
callq 0x2e1b2
movq 0x20(%r15), %rsi
movq %rbx, %rdi
callq 0x2e249
incq %r14
cmpq 0x18(%r13), %r14
jb 0x27440
cmpq $0x0, 0x28(%r13)
je 0x274a1
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x4c, %esi
callq 0x2e1b2
movq 0x20(%r13), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x2e249
incq %r14
cmpq 0x28(%r13), %r14
jb 0x2747b
cmpq $0x0, 0x38(%r13)
je 0x274d1
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x58, %esi
callq 0x2e1b2
movq 0x30(%r13), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x2e249
incq %r14
cmpq 0x38(%r13), %r14
jb 0x274ab
movq %r12, 0x8(%rsp)
movq %rbx, %rdi
movl $0x46, %esi
callq 0x2e1b2
movq 0x8(%r13), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x2e249
leaq 0x3acef(%rip), %r14     # 0x621e8
cmpq $0x0, (%r14)
je 0x27553
xorl %r15d, %r15d
leaq 0x3accf(%rip), %r12     # 0x621d8
movq (%r12), %rax
movq (%rax,%r15,8), %rax
movl 0x10(%rax), %eax
decl %eax
cmpl $0x1, %eax
ja 0x2754b
movq %rbx, %rdi
movl $0x54, %esi
callq 0x2e1b2
movq (%r12), %rax
movq (%rax,%r15,8), %rax
movl 0x4(%rax), %esi
movq %rbx, %rdi
callq 0x2e1f0
movq (%r12), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x2781e
incq %r15
cmpq (%r14), %r15
jb 0x27509
leaq 0x3ac96(%rip), %r15     # 0x621f0
cmpq $0x0, (%r15)
je 0x27632
xorl %r12d, %r12d
leaq 0x3ac8a(%rip), %rax     # 0x621f8
movq (%rax), %rax
movq (%rax,%r12,8), %r14
cmpl $0x8, (%r14)
jl 0x27626
movl 0xc(%r14), %eax
decl %eax
cmpl $0x1, %eax
ja 0x27626
movq %rbx, %rdi
movl $0x52, %esi
callq 0x2e1b2
movslq (%r14), %rsi
movq %rbx, %rdi
callq 0x2e1f0
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x2e1f0
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x27c12
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x2781e
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x2e1f0
cmpq $0x0, 0x28(%r14)
je 0x275f8
xorl %ebp, %ebp
movq 0x20(%r14), %rax
movq (%rax,%rbp,8), %rsi
movq %rbx, %rdi
callq 0x28288
incq %rbp
cmpq 0x28(%r14), %rbp
jb 0x275df
movq 0x38(%r14), %rsi
movq %rbx, %rdi
callq 0x2e1f0
cmpq $0x0, 0x38(%r14)
je 0x27626
xorl %ebp, %ebp
movq 0x30(%r14), %rax
movq (%rax,%rbp,8), %rsi
movq %rbx, %rdi
callq 0x28045
incq %rbp
cmpq 0x38(%r14), %rbp
jb 0x2760d
incq %r12
cmpq (%r15), %r12
jb 0x27567
leaq 0x3abd7(%rip), %r14     # 0x62210
cmpq $0x0, (%r14)
je 0x27687
xorl %r12d, %r12d
leaq 0x3abbf(%rip), %rbp     # 0x62208
movq (%rbp), %rax
movq (%rax,%r12,8), %r15
cmpb $0x0, 0x5c(%r15)
jne 0x277e0
movl 0x58(%r15), %eax
decl %eax
cmpl $0x1, %eax
ja 0x2767f
movq %rbx, %rdi
movl $0x49, %esi
callq 0x2e1b2
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27c12
incq %r12
cmpq (%r14), %r12
jb 0x27649
movq 0x8(%rsp), %rbp
movq 0x18(%rbp), %rdi
leaq 0x10(%rsp), %r12
movq %r12, %rsi
callq 0x2dedf
movq %rax, %r15
cmpq $0x0, (%r12)
je 0x27715
xorl %r14d, %r14d
movq (%r15,%r14,8), %rsi
movq %rbp, %rdi
callq 0x2048b
testq %rax, %rax
je 0x277ff
movq %rax, %r12
movzbl 0x70(%rax), %eax
testl %eax, %eax
je 0x2770b
cmpl $0x3, %eax
je 0x2770b
cmpq $0x0, 0x40(%r12)
jne 0x2770b
cmpb $0x0, 0x7a(%r12)
jne 0x2770b
cmpb $0x0, 0x7b(%r12)
jne 0x2770b
xorl %eax, %eax
cmpb $0x0, 0x73(%r12)
setne %al
leal (%rax,%rax,2), %esi
addl $0x44, %esi
movq %rbx, %rdi
callq 0x2e1b2
movq %rbx, %rdi
movq %r12, %rsi
callq 0x28045
incq %r14
cmpq 0x10(%rsp), %r14
jb 0x276aa
cmpq $0x0, 0x58(%r13)
je 0x27745
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x53, %esi
callq 0x2e1b2
movq 0x50(%r13), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x27c12
incq %r14
cmpq 0x58(%r13), %r14
jb 0x2771f
cmpq $0x0, 0x80(%r13)
je 0x2776f
movq %rbx, %rdi
movl $0x53, %esi
callq 0x2e1b2
movq 0x80(%r13), %rax
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x27c12
cmpq $0x0, 0x68(%r13)
je 0x2779f
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x45, %esi
callq 0x2e1b2
movq 0x60(%r13), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x27c12
incq %r14
cmpq 0x68(%r13), %r14
jb 0x27779
cmpq $0x0, 0x88(%r13)
je 0x277c9
movq %rbx, %rdi
movl $0x45, %esi
callq 0x2e1b2
movq 0x88(%r13), %rax
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x27c12
movq %r15, %rdi
callq 0x4040
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1095b(%rip), %rdi     # 0x38142
leaq 0x10965(%rip), %rsi     # 0x38153
leaq 0x10964(%rip), %rcx     # 0x38159
movl $0x4ee, %edx            # imm = 0x4EE
callq 0x4180
leaq 0x10969(%rip), %rdi     # 0x3816f
leaq 0x10946(%rip), %rsi     # 0x38153
leaq 0x10945(%rip), %rcx     # 0x38159
movl $0x4f8, %edx            # imm = 0x4F8
callq 0x4180