// File: /workspace/github_c_makefile_star2_O2/oridb[P]mc/muse/muse.c
// Function: main
int
main(int argc, char **argv)
{
	Optctx ctx;
	size_t i;
	FILE *f;

	localincpath = ".";
	optinit(&ctx, "sd:hmo:p:l:", argv, argc);
	while (!optdone(&ctx)) {
		switch (optnext(&ctx)) {
		case 'h':
			usage(argv[0]);
			exit(0);
			break;
		case 'p':
			pkgname = ctx.optarg;
			break;
		case 'o':
			outfile = ctx.optarg;
			break;
		case 'd':
			while (ctx.optarg && *ctx.optarg)
				debugopt[*ctx.optarg++ & 0x7f] = 1;
			break;
		case 'l':
			lappend(&extralibs, &nextralibs, ctx.optarg);
			break;
		default:
			usage(argv[0]);
			exit(0);
			break;
		}
	}

	if (!outfile && !show) {
		fprintf(stderr, "output file needed when merging usefiles.\n");
		exit(1);
	}
	if (!pkgname) {
		fprintf(stderr, "package needed when merging usefiles.\n");
		exit(1);
	}

	/* read and parse the file */
	initfile(&file, outfile);
	updatens(file.globls, pkgname);
	for (i = 0; i < ctx.nargs; i++)
		mergeuse(ctx.args[i]);
	loaduses();
	infer();
	tagexports(1);
	addextlibs(extralibs, nextralibs);

	/* generate the usefile */
	f = fopen(outfile, "w");
	writeuse(f);
	fclose(f);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
leaq 0x13f7b(%rip), %rax     # 0x162bf
movq %rax, 0x1b8c5(%rip)     # 0x1dc10
movslq %edi, %rcx
leaq 0x11cd3(%rip), %rsi     # 0x14028
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x1391a
leaq 0x1b8c6(%rip), %r13     # 0x1dc30
leaq 0x11c93(%rip), %rbp     # 0x14004
leaq 0x1b938(%rip), %r15     # 0x1dcb0
leaq 0x1b939(%rip), %r12     # 0x1dcb8
movq %r14, %rdi
callq 0x13a6e
testl %eax, %eax
jne 0x23ff
movq %r14, %rdi
callq 0x13998
leal -0x68(%rax), %ecx
cmpl $0x8, %ecx
ja 0x23b6
movslq (%rbp,%rcx,4), %rax
addq %rbp, %rax
jmpq *%rax
movq (%rsp), %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x126c1
jmp 0x237f
cmpl $0x64, %eax
jne 0x2518
movq (%rsp), %rax
testq %rax, %rax
je 0x237f
cmpb $0x0, (%rax)
je 0x237f
leaq 0x1(%rax), %rcx
movq %rcx, (%rsp)
movzbl (%rax), %eax
andl $0x7f, %eax
movb $0x1, (%rax,%r13)
movq %rcx, %rax
jmp 0x23c3
movq (%rsp), %rax
movq %rax, 0x1b828(%rip)     # 0x1dc18
jmp 0x237f
movq (%rsp), %rax
movq %rax, 0x1b823(%rip)     # 0x1dc20
jmp 0x237f
movq 0x1b81a(%rip), %rsi     # 0x1dc20
testq %rsi, %rsi
jne 0x2418
cmpl $0x0, 0x1b8ae(%rip)     # 0x1dcc0
je 0x2527
cmpq $0x0, 0x1b7f8(%rip)     # 0x1dc18
je 0x253c
leaq 0x1b89b(%rip), %rdi     # 0x1dcc8
callq 0x8ad0
movq 0x1b91f(%rip), %rdi     # 0x1dd58
movq 0x1b7d8(%rip), %rsi     # 0x1dc18
callq 0xb012
xorl %r13d, %r13d
leaq 0x130fa(%rip), %rbx     # 0x15549
pushq $0x1
popq %rbp
cmpq 0x10(%rsp), %r13
jae 0x2499
movq 0x8(%rsp), %rax
movq (%rax,%r13,8), %r14
movq 0x1b8ef(%rip), %r15     # 0x1dd58
movq %r14, %rdi
movq %rbx, %rsi
callq 0x21d0
testq %rax, %rax
je 0x24f5
movq %rax, %r12
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0xf44f
movq %r12, %rdi
callq 0x20a0
incq %r13
jmp 0x2452
callq 0x10270
callq 0x330f
pushq $0x1
popq %rdi
callq 0x2695
movq 0x1b7fe(%rip), %rdi     # 0x1dcb0
movq 0x1b7ff(%rip), %rsi     # 0x1dcb8
callq 0xe900
movq 0x1b75b(%rip), %rdi     # 0x1dc20
leaq 0x11bba(%rip), %rsi     # 0x14086
callq 0x21d0
movq %rax, %rbx
movq %rax, %rdi
callq 0x102a6
movq %rbx, %rdi
callq 0x20a0
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1aafc(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
leaq 0x11bb5(%rip), %rsi     # 0x140bb
movq %r14, %rdx
xorl %eax, %eax
callq 0x2160
pushq $0x1
popq %rdi
callq 0x21f0
movq (%rbx), %rdi
callq 0x255a
xorl %edi, %edi
callq 0x21f0
movq 0x1aaca(%rip), %rax     # 0x1cff8
movq (%rax), %rcx
leaq 0x11afc(%rip), %rdi     # 0x14034
pushq $0x2a
jmp 0x254f
movq 0x1aab5(%rip), %rax     # 0x1cff8
movq (%rax), %rcx
leaq 0x11b12(%rip), %rdi     # 0x1405f
pushq $0x26
popq %rsi
pushq $0x1
popq %rdx
callq 0x2200
jmp 0x2510