// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x210b9(%rip), %rax     # 0x233e9
movq %rax, 0x278c9(%rip)     # 0x29c00
movq -0x10(%rbp), %rdx
movslq -0x8(%rbp), %rcx
leaq -0x58(%rbp), %rdi
leaq 0x1ecee(%rip), %rsi     # 0x21038
callq 0x20be0
leaq -0x58(%rbp), %rdi
callq 0x20f90
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x2369
jmp 0x2447
leaq -0x58(%rbp), %rdi
callq 0x20d50
addl $-0x64, %eax
movl %eax, %ecx
movq %rcx, -0x70(%rbp)
subl $0xc, %eax
ja 0x242f
movq -0x70(%rbp), %rax
leaq 0x1ec75(%rip), %rcx     # 0x21004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2560
xorl %edi, %edi
callq 0x21d0
movq -0x58(%rbp), %rax
movq %rax, 0x27852(%rip)     # 0x29c08
jmp 0x2442
movq -0x58(%rbp), %rax
movq %rax, 0x2784a(%rip)     # 0x29c10
jmp 0x2442
jmp 0x23ca
xorl %eax, %eax
cmpq $0x0, -0x58(%rbp)
movb %al, -0x71(%rbp)
je 0x23e6
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x23ef
jmp 0x2414
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x58(%rbp)
movsbl (%rax), %eax
andl $0x7f, %eax
movslq %eax, %rcx
leaq 0x27812(%rip), %rax     # 0x29c20
movb $0x1, (%rax,%rcx)
jmp 0x23ca
jmp 0x2442
movq -0x58(%rbp), %rdx
leaq 0x2787f(%rip), %rdi     # 0x29ca0
leaq 0x27880(%rip), %rsi     # 0x29ca8
callq 0x1e6c0
jmp 0x2442
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2560
xorl %edi, %edi
callq 0x21d0
jmp 0x234f
cmpq $0x0, 0x277c1(%rip)     # 0x29c10
jne 0x247c
cmpl $0x0, 0x27858(%rip)     # 0x29cb0
jne 0x247c
movq 0x26b97(%rip), %rax     # 0x28ff8
movq (%rax), %rdi
leaq 0x1ebd9(%rip), %rsi     # 0x21044
movb $0x0, %al
callq 0x2150
movl $0x1, %edi
callq 0x21d0
cmpq $0x0, 0x27784(%rip)     # 0x29c08
jne 0x24a8
movq 0x26b6b(%rip), %rax     # 0x28ff8
movq (%rax), %rdi
leaq 0x1ebd8(%rip), %rsi     # 0x2106f
movb $0x0, %al
callq 0x2150
movl $0x1, %edi
callq 0x21d0
movq 0x27761(%rip), %rsi     # 0x29c10
leaq 0x27802(%rip), %rdi     # 0x29cb8
callq 0xd340
movq 0x27886(%rip), %rdi     # 0x29d48
movq 0x2773f(%rip), %rsi     # 0x29c08
callq 0x11360
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x24ff
movq -0x50(%rbp), %rax
movq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x25d0
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x24d6
callq 0x1ab30
callq 0x3f30
movl $0x1, %edi
callq 0x2840
movq 0x27786(%rip), %rdi     # 0x29ca0
movq 0x27787(%rip), %rsi     # 0x29ca8
callq 0x184d0
movq 0x276e3(%rip), %rdi     # 0x29c10
leaq 0x1eb62(%rip), %rsi     # 0x21096
callq 0x21b0
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
callq 0x1ab90
movq -0x68(%rbp), %rdi
callq 0x2090
xorl %eax, %eax
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)