// File: /workspace/github_c_makefile_star2_O2/blakemcbride[P]LISP9/ls9.c
// Function: main
int main(int argc, char **argv) {
	int	i, j, k, usrimg, doload;
	char	*s;
	char	*imgfile;

	imgfile = IMAGEFILE;
	usrimg = 0;
	doload = 1;
	if (setjmp(Restart) != 0) exit(EXIT_FAILURE);
	init();
	i = 1;
	if (argc > 2 && strcmp(argv[1], "-i") == 0) {
		imgfile = argv[2];
		i = 3;
		usrimg = 1;
	}
	if (existsp(imgfile) != NIL) {
		s = loadimg(imgfile);
		if (s != NULL) fatal(s);
		bindset(S_imagefile,
			mkstr(imgfile, strlen(imgfile)));
	}
	else if (usrimg && strcmp(imgfile, "-") != 0) {
		fatal("cannot open image file");
	}
	else {
		if (setjmp(Restart) != 0)
			fatal("could not load library");
		loadfile(IMAGESRC);
	}
	if (setjmp(Restart) != 0) exit(EXIT_FAILURE);
	for (; i<argc; i++) {
		if (argv[i][0] != '-') break;
		if ('-' == argv[i][1]) {
			doload = 0;
			break;
		}
		k = strlen(argv[i]);
		for (j=1; j<k; j++) {
			switch (argv[i][j]) {
			case '?':
			case 'h':
			case 'v':
				longusage();
				break;
			case 'L':
				terms();
				break;
			case 'l':
				i++;
				loadfile(cmdarg(argv[i]));
				j = strlen(argv[i]);
				break;
			case 'q':
				Quiet = 1;
				break;
			default:
				usage();
				exit(EXIT_FAILURE);
			}
		}
	}
	bindset(S_quiet, Quiet? TRUE: NIL);
	if (!Quiet && NULL == argv[i]) {
		prints("LISP9 "); prints(VERSION); nl();
	}
	Argv = NULL == argv[i]? NIL: argvec(&argv[i+1]);
	start();
	if (setjmp(Restart) != 0) exit(EXIT_FAILURE);
	if (doload && argv[i] != NULL) {
		loadfile(argv[i]);
		exit(EXIT_SUCCESS);
	}
	repl();
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x7dd8(%rip), %rdi      # 0x17480
callq 0x20f0
testl %eax, %eax
jne 0xf8f3
pushq $0x1
popq %r14
callq 0xe7fa
leaq 0x19c0(%rip), %rax      # 0x11085
movb $0x1, %cl
cmpl $0x3, %ebp
jl 0xf6f5
movq 0x8(%rbx), %rdx
cmpb $0x2d, (%rdx)
jne 0xf6f5
cmpb $0x69, 0x1(%rdx)
jne 0xf6f5
cmpb $0x0, 0x2(%rdx)
movl %r14d, %r12d
movq %rax, %r14
jne 0xf6fb
movq 0x10(%rbx), %r14
pushq $0x3
popq %r12
xorl %eax, %eax
movl %eax, %ecx
jmp 0xf6fb
movl %r14d, %r12d
movq %rax, %r14
movl %ecx, %r15d
movq %r14, %rdi
callq 0xa4a8
cmpl $-0x1, %eax
je 0xf741
movq %r14, %rdi
callq 0xb3a8
testq %rax, %rax
jne 0xf8fb
movl 0x822d(%rip), %r15d     # 0x17950
movq %r14, %rdi
callq 0x2080
movl %eax, %esi
movq %r14, %rdi
callq 0x2698
movl %r15d, %edi
movl %eax, %esi
callq 0x266c
jmp 0xf77b
testb %r15b, %r15b
jne 0xf75b
cmpb $0x2d, (%r14)
jne 0xf90f
cmpb $0x0, 0x1(%r14)
jne 0xf90f
leaq 0x7d1e(%rip), %rdi      # 0x17480
callq 0x20f0
testl %eax, %eax
jne 0xf91b
leaq 0x194b(%rip), %rdi      # 0x110c1
callq 0xae65
leaq 0x7cfe(%rip), %rdi      # 0x17480
callq 0x20f0
testl %eax, %eax
jne 0xf8f3
movl %r12d, %r13d
movslq %r13d, %r14
cmpl %ebp, %r13d
jge 0xf820
movq (%rbx,%r14,8), %rdi
cmpb $0x2d, (%rdi)
jne 0xf820
cmpb $0x2d, 0x1(%rdi)
je 0xf826
callq 0x2080
movl %eax, %r12d
pushq $0x1
popq %rdx
movl %r13d, %eax
cmpl %r12d, %edx
jge 0xf816
movslq %eax, %r13
movq (%rbx,%r13,8), %rcx
movslq %edx, %rsi
movzbl (%rcx,%rsi), %ecx
cmpl $0x6c, %ecx
je 0xf7e8
cmpl $0x71, %ecx
jne 0xf8d0
movl $0x1, 0x817a(%rip)      # 0x17960
jmp 0xf812
movl %eax, %r15d
incl %r15d
movq 0x8(%rbx,%r13,8), %r14
movq %r14, %rdi
callq 0xf5c9
movq %r14, %rdi
callq 0xae65
movq 0x8(%rbx,%r13,8), %rdi
callq 0x2080
movl %eax, %edx
movl %r15d, %eax
incl %edx
jmp 0xf7bb
incl %eax
movl %eax, %r13d
jmp 0xf792
xorl %eax, %eax
movl %eax, %ebp
jmp 0xf829
movb $0x1, %bpl
movl 0x8139(%rip), %edi      # 0x17968
xorl %esi, %esi
cmpl $0x0, 0x8128(%rip)      # 0x17960
sete %cl
movb %cl, %sil
orl $-0x2, %esi
callq 0x266c
cmpl $0x0, 0x8113(%rip)      # 0x17960
jne 0xf87a
cmpq $0x0, (%rbx,%r14,8)
jne 0xf87a
leaq 0x196d(%rip), %rdi      # 0x111ca
callq 0x2514
leaq 0x12fe(%rip), %rdi      # 0x10b67
callq 0x2514
leaq 0x1953(%rip), %rdi      # 0x111c8
callq 0x2514
leaq (%rbx,%r14,8), %rbx
cmpq $0x0, (%rbx)
je 0xf88f
leaq 0x8(%rbx), %rdi
callq 0xf5e0
jmp 0xf892
pushq $-0x1
popq %rax
movl %eax, 0x793c(%rip)      # 0x171d4
callq 0xf479
leaq 0x7bdc(%rip), %rdi      # 0x17480
callq 0x20f0
testl %eax, %eax
jne 0xf8f3
testb %bpl, %bpl
jne 0xf8ba
movq (%rbx), %rdi
testq %rdi, %rdi
jne 0xf903
callq 0xe6fe
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3f, %ecx
je 0xf8e4
cmpl $0x4c, %ecx
je 0xf8e9
cmpl $0x76, %ecx
je 0xf8e4
cmpl $0x68, %ecx
jne 0xf8ee
callq 0xf51d
callq 0xf57e
callq 0xf503
pushq $0x1
popq %rdi
callq 0x21f0
movq %rax, %rdi
callq 0x274d
callq 0xae65
xorl %edi, %edi
callq 0x21f0
leaq 0x19aa(%rip), %rdi      # 0x112c0
callq 0x274d
leaq 0x19b5(%rip), %rdi      # 0x112d7
callq 0x274d