// File: /workspace/github_c_makefile_star2_O1/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: luaL_loadfile
static int luaL_loadfile(lua_State*L,const char*filename){
LoadF lf;
int status,readstatus;
int c;
int fnameindex=lua_gettop(L)+1;
lf.extraline=0;
if(filename==NULL){
lua_pushliteral(L,"=stdin");
lf.f=stdin;
}
else{
lua_pushfstring(L,"@%s",filename);
lf.f=fopen(filename,"r");
if(lf.f==NULL)return errfile(L,"open",fnameindex);
}
c=getc(lf.f);
if(c=='#'){
lf.extraline=1;
while((c=getc(lf.f))!=EOF&&c!='\n');
if(c=='\n')c=getc(lf.f);
}
if(c=="\033Lua"[0]&&filename){
lf.f=freopen(filename,"rb",lf.f);
if(lf.f==NULL)return errfile(L,"reopen",fnameindex);
while((c=getc(lf.f))!=EOF&&c!="\033Lua"[0]);
lf.extraline=0;
}
ungetc(c,lf.f);
status=lua_load(L,getF,&lf,lua_tostring(L,-1));
readstatus=ferror(lf.f);
if(filename)fclose(lf.f);
if(readstatus){
lua_settop(L,fnameindex);
return errfile(L,"read",fnameindex);
}
lua_remove(L,fnameindex);
return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2018, %rsp           # imm = 0x2018
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %rbp
subq 0x18(%rdi), %rbp
shrq $0x4, %rbp
leal 0x1(%rbp), %r15d
movl $0x0, 0x8(%rsp)
testq %rsi, %rsi
je 0x3a74
leaq 0x11893(%rip), %rsi     # 0x152d5
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xa5f8
leaq 0x117b1(%rip), %rsi     # 0x15207
movq %r14, %rdi
callq 0x3250
movq %rax, 0x10(%rsp)
testq %rax, %rax
jne 0x3a97
leaq 0x1186f(%rip), %rsi     # 0x152de
jmp 0x3be0
leaq 0x11853(%rip), %rsi     # 0x152ce
movl $0x6, %edx
movq %rbx, %rdi
callq 0x90a1
movq 0x17549(%rip), %rax     # 0x1afd8
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x32d0
cmpl $0x23, %eax
jne 0x3acc
movl $0x1, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0x32d0
cmpl $-0x1, %eax
je 0x3acc
cmpl $0xa, %eax
jne 0x3aae
movq 0x10(%rsp), %rdi
callq 0x32d0
testq %r14, %r14
je 0x3b14
cmpl $0x1b, %eax
jne 0x3b14
movq 0x10(%rsp), %rdx
leaq 0x117f7(%rip), %rsi     # 0x152d9
movq %r14, %rdi
callq 0x3110
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x3bd9
movq 0x10(%rsp), %rdi
callq 0x32d0
cmpl $0x1b, %eax
je 0x3b0c
cmpl $-0x1, %eax
jne 0x3af8
movl $0x0, 0x8(%rsp)
movl %r15d, 0x4(%rsp)
leaq 0x8(%rsp), %r12
movq 0x8(%r12), %rsi
movl %eax, %edi
callq 0x31f0
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x3c5a
leaq 0xfd7f(%rip), %rsi      # 0x138bf
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %rcx
callq 0xa84c
movl %eax, %r15d
movq 0x8(%r12), %r12
movq %r12, %rdi
callq 0x3090
movl %eax, %r13d
testq %r14, %r14
je 0x3b6e
movq %r12, %rdi
callq 0x30d0
testl %r13d, %r13d
je 0x3ba5
cmpl $-0x1, %ebp
jl 0x3bb3
movl 0x4(%rsp), %edx
movl %edx, %eax
shlq $0x4, %rax
addq 0x18(%rbx), %rax
movq 0x10(%rbx), %rcx
cmpq %rax, %rcx
jae 0x3bc9
movl $0x0, 0x8(%rcx)
addq $0x10, %rcx
cmpq %rax, %rcx
jb 0x3b8f
movq %rcx, 0x10(%rbx)
jmp 0x3bc9
movq %rbx, %rdi
movl 0x4(%rsp), %esi
callq 0xf9ff
jmp 0x3bf1
movq 0x10(%rbx), %rax
movl 0x4(%rsp), %edx
movslq %edx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
addq $0x10, %rax
movq %rax, 0x10(%rbx)
leaq 0x10af0(%rip), %rsi     # 0x146c4
movq %rbx, %rdi
jmp 0x3be6
leaq 0x116fc(%rip), %rsi     # 0x152dc
movq %rbx, %rdi
movl %r15d, %edx
callq 0x13864
movl $0x6, %r15d
movl %r15d, %eax
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq