// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x76e0(%rip), %rdi      # 0x19480
callq 0x20f0
testl %eax, %eax
jne 0x120da
callq 0x10d9b
cmpl $0x3, %ebp
jl 0x11dd0
movq 0x8(%rbx), %rax
cmpb $0x2d, (%rax)
jne 0x11dd0
cmpb $0x69, 0x1(%rax)
jne 0x11dd0
cmpb $0x0, 0x2(%rax)
je 0x11e5e
leaq 0x22ee(%rip), %r14      # 0x140c5
movq %r14, %rdi
callq 0xc168
movl $0x1, %r15d
movl %r15d, %ecx
cmpl $-0x1, %eax
je 0x11e93
movq %r14, %rdi
callq 0xd27f
testq %rax, %rax
jne 0x120b8
movl 0x7b47(%rip), %r12d     # 0x19950
movq %r14, %rdi
callq 0x2080
movl %eax, %esi
movq %r14, %rdi
callq 0x27b0
movl 0x7323(%rip), %esi      # 0x19144
cmpl $-0x1, %esi
je 0x11e59
movq 0x7513(%rip), %rcx      # 0x19340
movq 0x7514(%rip), %rdx      # 0x19348
movslq %esi, %rdi
movslq (%rcx,%rdi,4), %rsi
cmpl %r12d, (%rcx,%rsi,4)
je 0x11e4d
movl (%rdx,%rdi,4), %edi
movl %edi, %esi
cmpl $-0x1, %edi
jne 0x11e34
jmp 0x11e59
cmpl $-0x1, %esi
je 0x11e59
movslq (%rdx,%rsi,4), %rdx
movl %eax, (%rcx,%rdx,4)
movl %r15d, %r14d
jmp 0x11eb6
movq 0x10(%rbx), %r14
movq %r14, %rdi
callq 0xc168
movl $0x3, %r15d
cmpl $-0x1, %eax
jne 0x11df1
cmpb $0x2d, (%r14)
jne 0x120f0
movl $0x3, %ecx
cmpb $0x0, 0x1(%r14)
jne 0x120f0
movl %ecx, %r14d
leaq 0x75e3(%rip), %rdi      # 0x19480
callq 0x20f0
testl %eax, %eax
jne 0x120c0
leaq 0x2250(%rip), %rdi      # 0x14101
callq 0xccbf
leaq 0x75c3(%rip), %rdi      # 0x19480
callq 0x20f0
testl %eax, %eax
jne 0x120da
cmpl %ebp, %r14d
jge 0x11f87
movl %r14d, %r15d
movslq %r15d, %rax
movq (%rbx,%rax,8), %rdi
cmpb $0x2d, (%rdi)
jne 0x120a7
cmpb $0x2d, 0x1(%rdi)
je 0x120ad
callq 0x2080
cmpl $0x2, %eax
jl 0x11f71
movl %eax, %r14d
movl $0x1, %esi
movl %r15d, %edx
movslq %edx, %rcx
movq (%rbx,%rcx,8), %rax
movslq %esi, %rdi
movzbl (%rax,%rdi), %eax
cmpl $0x6b, %eax
jle 0x11fe0
cmpl $0x6c, %eax
je 0x11f36
cmpl $0x71, %eax
jne 0x120cc
movl $0x1, 0x7a2c(%rip)      # 0x19960
jmp 0x11f63
movq 0x8(%rbx,%rcx,8), %rdi
testq %rdi, %rdi
je 0x120d5
movl %ecx, %eax
leal 0x1(%rax), %r15d
movq %rcx, %r12
incq %r12
callq 0xccbf
movq (%rbx,%r12,8), %rdi
callq 0x2080
movl %eax, %esi
movl %r15d, %edx
movl %esi, %eax
incl %eax
movl %edx, %r15d
movl %eax, %esi
cmpl %r14d, %eax
jl 0x11f05
movl %r15d, %eax
incl %eax
movl %eax, %r15d
cmpl %ebp, %eax
jl 0x11ed6
xorl %ecx, %ecx
movl %ecx, %ebp
jmp 0x11f8e
xorl %eax, %eax
movl %eax, %ebp
movl %r14d, %eax
movl 0x79cc(%rip), %ecx      # 0x19960
xorl %edx, %edx
testl %ecx, %ecx
sete %sil
movl 0x71a1(%rip), %r9d      # 0x19144
cmpl $-0x1, %r9d
je 0x1200f
movl 0x79b8(%rip), %r8d      # 0x19968
movb %sil, %dl
orl $-0x2, %edx
movq 0x7383(%rip), %rsi      # 0x19340
movq 0x7384(%rip), %rdi      # 0x19348
movslq %r9d, %r10
movslq (%rsi,%r10,4), %r9
cmpl %r8d, (%rsi,%r9,4)
je 0x11ffc
movl (%rdi,%r10,4), %r10d
movl %r10d, %r9d
cmpl $-0x1, %r10d
jne 0x11fc4
jmp 0x1200f
cmpl $0x3f, %eax
je 0x11ff7
cmpl $0x4c, %eax
je 0x120a2
cmpl $0x68, %eax
jne 0x120d5
callq 0x11c1e
cmpl $-0x1, %r9d
je 0x1200f
movslq (%rdi,%r9,4), %rcx
movl %edx, (%rsi,%rcx,4)
movl 0x7951(%rip), %ecx      # 0x19960
movslq %eax, %r14
testl %ecx, %ecx
jne 0x12050
cmpq $0x0, (%rbx,%r14,8)
jne 0x12050
leaq 0x21e6(%rip), %rdi      # 0x1420a
movl $0x6, %esi
callq 0x29c1
leaq 0x1b72(%rip), %rdi      # 0x13ba7
movl $0x8, %esi
callq 0x29c1
leaq 0x21c2(%rip), %rdi      # 0x14208
movl $0x1, %esi
callq 0x29c1
leaq (%rbx,%r14,8), %rbx
cmpq $0x0, (%rbx)
je 0x12065
leaq 0x8(%rbx), %rdi
callq 0x11ce3
jmp 0x1206a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x7164(%rip)      # 0x191d4
callq 0x11b53
leaq 0x7404(%rip), %rdi      # 0x19480
callq 0x20f0
testl %eax, %eax
jne 0x120da
testb %bpl, %bpl
jne 0x12092
movq (%rbx), %rdi
testq %rdi, %rdi
jne 0x120e4
callq 0x10b8d
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x11c7f
xorl %eax, %eax
movl %eax, %ebp
jmp 0x120b0
movb $0x1, %bpl
movl %r15d, %eax
jmp 0x11f8e
movq %rax, %rdi
callq 0x2867
leaq 0x2250(%rip), %rdi      # 0x14317
callq 0x2867
cmpl $0x76, %eax
je 0x11ff7
callq 0x11bfa
movl $0x1, %edi
callq 0x21f0
callq 0xccbf
xorl %edi, %edi
callq 0x21f0
leaq 0x2209(%rip), %rdi      # 0x14300
callq 0x2867