// File: /workspace/github_c_makefile_star2_O1/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 0x7584(%rip), %rdi      # 0x19480
callq 0x20f0
testl %eax, %eax
jne 0x121a3
callq 0x10ecc
leaq 0x2180(%rip), %r14      # 0x14095
movl $0x1, %r15d
movb $0x1, %r12b
cmpl $0x3, %ebp
jl 0x11f4d
movq 0x8(%rbx), %rdi
leaq 0x23a2(%rip), %rsi      # 0x142d0
callq 0x2100
movl %r12d, %ecx
movl %r15d, %r12d
testl %eax, %eax
jne 0x11f53
movq 0x10(%rbx), %r14
movl $0x3, %r12d
xorl %eax, %eax
movl %eax, %ecx
jmp 0x11f53
movl %r12d, %ecx
movl %r15d, %r12d
movl %ecx, %r15d
movq %r14, %rdi
callq 0xc05a
cmpl $-0x1, %eax
je 0x11f99
movq %r14, %rdi
callq 0xd225
testq %rax, %rax
jne 0x12185
movl 0x79d5(%rip), %r15d     # 0x19950
movq %r14, %rdi
callq 0x2080
movl %eax, %esi
movq %r14, %rdi
callq 0x27dc
movl %r15d, %edi
movl %eax, %esi
callq 0x2786
jmp 0x11fd5
testb %r15b, %r15b
jne 0x11fb5
leaq 0x18e1(%rip), %rsi      # 0x13886
movq %r14, %rdi
callq 0x2100
testl %eax, %eax
jne 0x121b9
leaq 0x74c4(%rip), %rdi      # 0x19480
callq 0x20f0
testl %eax, %eax
jne 0x1218d
leaq 0x2101(%rip), %rdi      # 0x140d1
callq 0xcc42
leaq 0x74a4(%rip), %rdi      # 0x19480
callq 0x20f0
testl %eax, %eax
jne 0x121a3
cmpl %ebp, %r12d
jge 0x120a2
movl %r12d, %r15d
movslq %r15d, %rax
movq (%rbx,%rax,8), %rdi
cmpb $0x2d, (%rdi)
jne 0x12174
cmpb $0x2d, 0x1(%rdi)
je 0x1217a
callq 0x2080
cmpl $0x2, %eax
jl 0x12090
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 0x1211e
cmpl $0x6c, %eax
je 0x12055
cmpl $0x71, %eax
jne 0x12199
movl $0x1, 0x790d(%rip)      # 0x19960
jmp 0x12082
movq 0x8(%rbx,%rcx,8), %rdi
testq %rdi, %rdi
je 0x1219e
movl %ecx, %eax
leal 0x1(%rax), %r15d
movq %rcx, %r12
incq %r12
callq 0xcc42
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 0x12024
movl %r15d, %r12d
incl %r12d
movl %r12d, %r15d
cmpl %ebp, %r12d
jl 0x11ff5
xorl %eax, %eax
movl %eax, %ebp
movl 0x78bc(%rip), %edi      # 0x19968
xorl %esi, %esi
cmpl $0x0, 0x78ab(%rip)      # 0x19960
sete %cl
movb %cl, %sil
orl $-0x2, %esi
callq 0x2786
cmpl $0x0, 0x7896(%rip)      # 0x19960
movslq %r12d, %r14
jne 0x12109
cmpq $0x0, (%rbx,%r14,8)
jne 0x12109
leaq 0x20fd(%rip), %rdi      # 0x141da
movl $0x6, %esi
callq 0x29f6
leaq 0x1a89(%rip), %rdi      # 0x13b77
movl $0x8, %esi
callq 0x29f6
leaq 0x20d9(%rip), %rdi      # 0x141d8
movl $0x1, %esi
callq 0x29f6
leaq (%rbx,%r14,8), %rbx
cmpq $0x0, (%rbx)
je 0x12132
leaq 0x8(%rbx), %rdi
callq 0x11e3f
jmp 0x12137
cmpl $0x3f, %eax
je 0x1212d
cmpl $0x4c, %eax
je 0x1216f
cmpl $0x68, %eax
jne 0x1219e
callq 0x11d7a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x7097(%rip)      # 0x191d4
callq 0x11c84
leaq 0x7337(%rip), %rdi      # 0x19480
callq 0x20f0
testl %eax, %eax
jne 0x121a3
testb %bpl, %bpl
jne 0x1215f
movq (%rbx), %rdi
testq %rdi, %rdi
jne 0x121ad
callq 0x10d29
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x11ddb
xorl %eax, %eax
movl %eax, %ebp
jmp 0x1217d
movb $0x1, %bpl
movl %r15d, %r12d
jmp 0x120a6
movq %rax, %rdi
callq 0x2893
leaq 0x2156(%rip), %rdi      # 0x142ea
callq 0x2893
cmpl $0x76, %eax
je 0x1212d
callq 0x11d56
movl $0x1, %edi
callq 0x21f0
callq 0xcc42
xorl %edi, %edi
callq 0x21f0
leaq 0x2113(%rip), %rdi      # 0x142d3
callq 0x2893