// File: /workspace/github_c_makefile_star2_O1/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 0x54f1(%rip), %rsi      # 0x17044
callq 0x11ae9
cmpl $-0x1, %eax
je 0x11d20
movl %eax, %ebx
cltq
leaq 0xca94(%rip), %rcx      # 0x1e600
orb $-0x80, (%rax,%rcx)
movq %r14, %rdi
callq 0x30a0
movq %rax, %r15
incl %r15d
movq $-0x21, %rdi
movl %r15d, %esi
callq 0x417e
movq %rax, %r12
movq 0xca29(%rip), %rax      # 0x1e5c0
movq (%rax,%r12,8), %rdi
shlq $0x3, %rdi
addq 0xca42(%rip), %rdi      # 0x1e5e8
movslq %r15d, %rdx
movq %r14, %rsi
callq 0x3050
movq 0xc590(%rip), %rsi      # 0x1e148
movq %r12, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0xc57f(%rip)      # 0x1e148
movq 0xc538(%rip), %rdi      # 0x1e108
movq 0xc551(%rip), %rsi      # 0x1e128
xorl %edx, %edx
callq 0x36e8
movq %rax, 0xc543(%rip)      # 0x1e128
movq 0xc9d4(%rip), %rax      # 0x1e5c0
movq 0xc515(%rip), %rcx      # 0x1e108
movq (%rax,%rcx,8), %rcx
cmpq $-0x1, %rcx
je 0x11c06
movq %rcx, 0xc504(%rip)      # 0x1e108
jmp 0x11bf3
movq 0xc9bb(%rip), %rcx      # 0x1e5c8
movq (%rax,%rcx,8), %r14
movq $-0x2, (%rax,%rcx,8)
movl 0xca78(%rip), %r12d     # 0x1e698
movl 0xc9a9(%rip), %r15d     # 0x1e5d0
movl $0x1, 0xc99f(%rip)      # 0x1e5d0
movl %ebx, 0xca61(%rip)      # 0x1e698
movl 0xca92(%rip), %r13d     # 0x1e6d0
callq 0x9c07
movl %eax, 0xca87(%rip)      # 0x1e6d0
cmpl $0x0, 0xc964(%rip)      # 0x1e5b4
jne 0x11c90
movl %ebx, 0xca40(%rip)      # 0x1e698
cmpl $-0x65, 0xca71(%rip)    # 0x1e6d0
jne 0x11c6c
callq 0x9c07
movl %eax, 0xca64(%rip)      # 0x1e6d0
callq 0xba0b
movl %r12d, 0xca20(%rip)     # 0x1e698
cmpl $-0x4, %eax
je 0x11c90
cmpl $0x0, 0xc930(%rip)      # 0x1e5b4
jne 0x11c49
movslq %eax, %rdi
callq 0x11d3f
jmp 0x11c49
movl %r13d, 0xca39(%rip)     # 0x1e6d0
cmpl $0x1f, %ebx
ja 0x11cc6
movl %ebx, %ebx
leaq 0xc4db(%rip), %r12      # 0x1e180
movq (%r12,%rbx,8), %rdi
testq %rdi, %rdi
je 0x11cbb
callq 0x3090
movq $0x0, (%r12,%rbx,8)
leaq 0xc93e(%rip), %rax      # 0x1e600
movb $0x0, (%rbx,%rax)
movl %r15d, 0xc903(%rip)     # 0x1e5d0
movslq %r14d, %rax
movq 0xc8e9(%rip), %rcx      # 0x1e5c0
movq 0xc8ea(%rip), %rdx      # 0x1e5c8
movq %rax, (%rcx,%rdx,8)
movq 0xc45f(%rip), %rax      # 0x1e148
movq (%rcx,%rax,8), %rax
movq %rax, 0xc454(%rip)      # 0x1e148
movq 0xc475(%rip), %rax      # 0x1e170
movq 0xc406(%rip), %rcx      # 0x1e108
movq (%rax,%rcx,8), %rdi
callq 0xda64
movl $0x1, %edi
callq 0x3851
movq %rax, 0xc3ec(%rip)      # 0x1e108
xorl %eax, %eax
jmp 0x11d25
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq