// File: /workspace/github_c_makefile_star2_O2/azhai[P]mlite/mlite.c
// Function: load
int load(char *file) {
	int	n;
	int	outer_lno;
	int	new_stream, old_stream;
	int	outer_loading;
	int	outer_tok;

	new_stream = open_stream(file, "r");
	if (new_stream == -1)
		return -1;
	Stream_flags[new_stream] |= LOCK_TAG;
	File_list = node(make_string(file, (int) strlen(file)), File_list);
	save(Environment);
	while (cdr(Environment) != NIL)
		Environment = cdr(Environment);
	outer_loading = box_value(S_loading);
	box_value(S_loading) = TRUE;
	old_stream = Instream;
	outer_lno = Line_no;
	Line_no = 1;
	Instream = new_stream;
	outer_tok = Token;
	Token = scan();
	while (!Error_flag) {
		Instream = new_stream;
		if (Token == TOK_SEMI)
			Token = scan();
		n = prog();
		Instream = old_stream;
		if (n == END_OF_FILE)
			break;
		if (!isfirst(Token) && Token != TOK_SEMI)
			error("syntax error at", Attr);
		if (!Error_flag)
			n = eval(n);
	}
	Token = outer_tok;
	close_stream(new_stream);
	Line_no = outer_lno;
	box_value(S_loading) = outer_loading;
	File_list = cdr(File_list);
	rehash(car(Environment));
	Environment = unsave(1);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x4f42(%rip), %rsi      # 0x15029
callq 0x1007f
cmpl $-0x1, %eax
je 0x1025b
movl %eax, %ebx
movl %eax, %eax
leaq 0xc500(%rip), %rcx      # 0x1c600
orb $-0x80, (%rax,%rcx)
movq %r14, %rdi
callq 0x30a0
movq %r14, %rdi
movl %eax, %esi
callq 0x729e
movq 0xc02b(%rip), %rsi      # 0x1c148
movq %rax, %rdi
xorl %edx, %edx
callq 0x3613
movq %rax, 0xc01a(%rip)      # 0x1c148
movq 0xbfd3(%rip), %rdi      # 0x1c108
movq 0xbfec(%rip), %rsi      # 0x1c128
xorl %edx, %edx
callq 0x3613
movq %rax, 0xbfde(%rip)      # 0x1c128
movq 0xc46f(%rip), %rax      # 0x1c5c0
movq 0xbfb0(%rip), %rcx      # 0x1c108
movq (%rax,%rcx,8), %rcx
cmpq $-0x1, %rcx
je 0x1016b
movq %rcx, 0xbf9f(%rip)      # 0x1c108
jmp 0x10158
movq 0xc456(%rip), %rcx      # 0x1c5c8
movq (%rax,%rcx,8), %r14
movq $-0x2, (%rax,%rcx,8)
movl 0xc513(%rip), %r12d     # 0x1c698
movl 0xc444(%rip), %r15d     # 0x1c5d0
movl $0x1, 0xc43a(%rip)      # 0x1c5d0
movl %ebx, 0xc4fc(%rip)      # 0x1c698
movl 0xc52d(%rip), %r13d     # 0x1c6d0
callq 0x8d74
movl %eax, 0xc522(%rip)      # 0x1c6d0
cmpl $0x0, 0xc3ff(%rip)      # 0x1c5b4
jne 0x101f5
movl %ebx, 0xc4db(%rip)      # 0x1c698
cmpl $-0x65, 0xc50c(%rip)    # 0x1c6d0
jne 0x101d1
callq 0x8d74
movl %eax, 0xc4ff(%rip)      # 0x1c6d0
callq 0xa9c2
movl %r12d, 0xc4bb(%rip)     # 0x1c698
cmpl $-0x4, %eax
je 0x101f5
cmpl $0x0, 0xc3cb(%rip)      # 0x1c5b4
jne 0x101ae
movslq %eax, %rdi
callq 0x10278
jmp 0x101ae
movl %r13d, 0xc4d4(%rip)     # 0x1c6d0
movl %ebx, %edi
callq 0xff1e
movl %r15d, 0xc3c6(%rip)     # 0x1c5d0
movslq %r14d, %rax
movq 0xc3ac(%rip), %rcx      # 0x1c5c0
movq 0xc3ad(%rip), %rdx      # 0x1c5c8
movq %rax, (%rcx,%rdx,8)
movq 0xbf22(%rip), %rax      # 0x1c148
movq (%rcx,%rax,8), %rax
movq %rax, 0xbf17(%rip)      # 0x1c148
movq 0xbf38(%rip), %rax      # 0x1c170
movq 0xbec9(%rip), %rcx      # 0x1c108
movq (%rax,%rcx,8), %rdi
callq 0xc7c6
pushq $0x1
popq %rdi
callq 0x3775
movq %rax, 0xbeb1(%rip)      # 0x1c108
xorl %eax, %eax
jmp 0x1025e
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq