// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x1f20(%rip), %rax      # 0x1c13d
movq %rax, -0x38(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
leaq 0x624a(%rip), %rdi      # 0x20480
callq 0x2100
cmpl $0x0, %eax
je 0x1a24a
movl $0x1, %edi
callq 0x2200
callq 0x191a0
movl $0x1, -0x14(%rbp)
cmpl $0x2, -0x8(%rbp)
jle 0x1a28f
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x210d(%rip), %rsi      # 0x1c378
callq 0x2110
cmpl $0x0, %eax
jne 0x1a28f
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movl $0x3, -0x14(%rbp)
movl $0x1, -0x20(%rbp)
movq -0x38(%rbp), %rdi
callq 0x10810
cmpl $-0x1, %eax
je 0x1a2eb
movq -0x38(%rbp), %rdi
callq 0x120c0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x1a2ba
movq -0x30(%rbp), %rdi
callq 0x29a0
movl 0x6690(%rip), %eax      # 0x20950
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
callq 0x2090
movq -0x48(%rbp), %rdi
movl %eax, %esi
callq 0x2880
movl -0x3c(%rbp), %edi
movl %eax, %esi
callq 0x2830
jmp 0x1a33f
cmpl $0x0, -0x20(%rbp)
je 0x1a314
movq -0x38(%rbp), %rdi
leaq 0x162a(%rip), %rsi      # 0x1b926
callq 0x2110
cmpl $0x0, %eax
je 0x1a314
leaq 0x206e(%rip), %rdi      # 0x1c37b
callq 0x29a0
jmp 0x1a33d
leaq 0x6165(%rip), %rdi      # 0x20480
callq 0x2100
cmpl $0x0, %eax
je 0x1a331
leaq 0x2066(%rip), %rdi      # 0x1c392
callq 0x29a0
leaq 0x1e41(%rip), %rdi      # 0x1c179
callq 0x11920
jmp 0x1a33f
leaq 0x613a(%rip), %rdi      # 0x20480
callq 0x2100
cmpl $0x0, %eax
je 0x1a35a
movl $0x1, %edi
callq 0x2200
jmp 0x1a35c
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x1a484
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x1a381
jmp 0x1a484
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %ecx
movl $0x2d, %eax
cmpl %ecx, %eax
jne 0x1a3a6
movl $0x0, -0x24(%rbp)
jmp 0x1a484
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2090
movl %eax, -0x1c(%rbp)
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x1a474
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $-0x3f, %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x37, %eax
ja 0x1a455
movq -0x50(%rbp), %rax
leaq 0xeb6(%rip), %rcx       # 0x1b2b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x19fe0
jmp 0x1a464
callq 0x1a050
jmp 0x1a464
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1a0b0
movq %rax, %rdi
callq 0x11920
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2090
movl %eax, -0x18(%rbp)
jmp 0x1a464
movl $0x1, 0x650d(%rip)      # 0x20960
jmp 0x1a464
callq 0x19fc0
movl $0x1, %edi
callq 0x2200
jmp 0x1a466
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1a3c1
jmp 0x1a476
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1a35c
movl 0x64de(%rip), %edi      # 0x20968
movl 0x64d0(%rip), %ecx      # 0x20960
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpl $0x0, %ecx
cmovnel %eax, %esi
callq 0x2830
cmpl $0x0, 0x64b4(%rip)      # 0x20960
jne 0x1a4e2
movq -0x10(%rbp), %rcx
movslq -0x14(%rbp), %rdx
xorl %eax, %eax
cmpq (%rcx,%rdx,8), %rax
jne 0x1a4e2
leaq 0x1dbd(%rip), %rdi      # 0x1c282
callq 0x25a0
leaq 0x174e(%rip), %rdi      # 0x1bc1f
callq 0x25a0
leaq 0x1da3(%rip), %rdi      # 0x1c280
callq 0x25a0
movq -0x10(%rbp), %rcx
movslq -0x14(%rbp), %rdx
xorl %eax, %eax
cmpq (%rcx,%rdx,8), %rax
jne 0x1a4fc
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x54(%rbp)
jmp 0x1a517
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
addl $0x1, %eax
cltq
shlq $0x3, %rax
addq %rax, %rdi
callq 0x1a0e0
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
movl %eax, 0x5cb4(%rip)      # 0x201d4
callq 0x19e90
leaq 0x5f54(%rip), %rdi      # 0x20480
callq 0x2100
cmpl $0x0, %eax
je 0x1a540
movl $0x1, %edi
callq 0x2200
cmpl $0x0, -0x24(%rbp)
je 0x1a56d
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x1a56d
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x11920
xorl %edi, %edi
callq 0x2200
callq 0x19090
xorl %eax, %eax
addq $0x60, %rsp
popq %rbp
retq