// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/lua-5.1.5/src/lauxlib.c
// Function: luaL_loadfile
LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) {
  LoadF lf;
  int status, readstatus;
  int c;
  int fnameindex = lua_gettop(L) + 1;  /* index of filename on the stack */
  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 == '#') {  /* Unix exec. file? */
    lf.extraline = 1;
    while ((c = getc(lf.f)) != EOF && c != '\n') ;  /* skip first line */
    if (c == '\n') c = getc(lf.f);
  }
  if (c == LUA_SIGNATURE[0] && filename) {  /* binary file? */
    lf.f = freopen(filename, "rb", lf.f);  /* reopen in binary mode */
    if (lf.f == NULL) return errfile(L, "reopen", fnameindex);
    /* skip eventual `#!...' */
   while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[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);  /* close file (even in case of errors) */
  if (readstatus) {
    lua_settop(L, fnameindex);  /* ignore results from `lua_load' */
    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 0x5bd1c
leaq 0x91f50(%rip), %rsi     # 0xedc3a
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x58880
leaq 0x931aa(%rip), %rsi     # 0xeeea8
movq %r14, %rdi
callq 0xb720
movq %rax, 0x10(%rsp)
testq %rax, %rax
jne 0x5bd3f
leaq 0x95278(%rip), %rsi     # 0xf0f8f
jmp 0x5be88
leaq 0x91f10(%rip), %rsi     # 0xedc33
movl $0x6, %edx
movq %rbx, %rdi
callq 0x58391
movq 0xf5259(%rip), %rax     # 0x150f90
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0xb190
cmpl $0x23, %eax
jne 0x5bd74
movl $0x1, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0xb190
cmpl $-0x1, %eax
je 0x5bd74
cmpl $0xa, %eax
jne 0x5bd56
movq 0x10(%rsp), %rdi
callq 0xb190
testq %r14, %r14
je 0x5bdbc
cmpl $0x1b, %eax
jne 0x5bdbc
movq 0x10(%rsp), %rdx
leaq 0x91eb4(%rip), %rsi     # 0xedc3e
movq %r14, %rdi
callq 0xb640
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x5be81
movq 0x10(%rsp), %rdi
callq 0xb190
cmpl $0x1b, %eax
je 0x5bdb4
cmpl $-0x1, %eax
jne 0x5bda0
movl $0x0, 0x8(%rsp)
movl %r15d, 0x4(%rsp)
leaq 0x8(%rsp), %r12
movq 0x8(%r12), %rsi
movl %eax, %edi
callq 0xb0d0
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x58042
leaq 0x121(%rip), %rsi       # 0x5bf09
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %rcx
callq 0x59744
movl %eax, %r15d
movq 0x8(%r12), %r12
movq %r12, %rdi
callq 0xbc30
movl %eax, %r13d
testq %r14, %r14
je 0x5be16
movq %r12, %rdi
callq 0xb690
testl %r13d, %r13d
je 0x5be4d
cmpl $-0x1, %ebp
jl 0x5be5b
movl 0x4(%rsp), %edx
movl %edx, %eax
shlq $0x4, %rax
addq 0x18(%rbx), %rax
movq 0x10(%rbx), %rcx
cmpq %rax, %rcx
jae 0x5be71
movl $0x0, 0x8(%rcx)
addq $0x10, %rcx
cmpq %rax, %rcx
jb 0x5be37
movq %rcx, 0x10(%rbx)
jmp 0x5be71
movq %rbx, %rdi
movl 0x4(%rsp), %esi
callq 0x57916
jmp 0x5be99
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 0xab1fc(%rip), %rsi     # 0x107078
movq %rbx, %rdi
jmp 0x5be8e
leaq 0x91db9(%rip), %rsi     # 0xedc41
movq %rbx, %rdi
movl %r15d, %edx
callq 0x5beae
movl $0x6, %r15d
movl %r15d, %eax
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq