// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/lauxlib.c
// Function: luaL_loadfilex
LUALIB_API int luaL_loadfilex (lua_State *L, const char *filename,
                                             const char *mode) {
  LoadF lf;
  int status, readstatus;
  int c;
  int fnameindex = lua_gettop(L) + 1;  /* index of filename on the stack */
  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);
  }
  if (skipcomment(&lf, &c))  /* read initial portion */
    lf.buff[lf.n++] = '\n';  /* add line to correct line numbers */
  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);
    skipcomment(&lf, &c);  /* re-read initial portion */
  }
  if (c != EOF)
    lf.buff[lf.n++] = c;  /* 'c' is the first character of the stream */
  status = lua_load(L, getF, &lf, lua_tostring(L, -1), mode);
  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 %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
callq 0x5d3d
movl %eax, %ebp
incl %ebp
testq %r14, %r14
je 0x14b9a
leaq 0xd751(%rip), %rsi      # 0x222b9
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x64e8
leaq 0xc4b2(%rip), %rsi      # 0x2102e
movq %r14, %rdi
callq 0x52f0
movq %rax, 0x10(%rsp)
testq %rax, %rax
jne 0x14bb8
leaq 0xd72d(%rip), %rsi      # 0x222c2
jmp 0x14cb8
leaq 0xd711(%rip), %rsi      # 0x222b2
movq %rbx, %rdi
callq 0x645b
movq 0x1a420(%rip), %rax     # 0x2efd0
movq (%rax), %rax
movq %rax, 0x10(%rsp)
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x14d48
testl %eax, %eax
je 0x14bdc
movslq 0x8(%rsp), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x8(%rsp)
movb $0xa, 0x18(%rsp,%rax)
testq %r14, %r14
je 0x14c19
cmpl $0x1b, 0x4(%rsp)
jne 0x14c19
movq 0x10(%rsp), %rdx
leaq 0xd6c9(%rip), %rsi      # 0x222bd
movq %r14, %rdi
callq 0x5300
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x14cb1
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x14d48
movl 0x4(%rsp), %eax
cmpl $-0x1, %eax
je 0x14c32
movslq 0x8(%rsp), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x8(%rsp)
movb %al, 0x18(%rsp,%rcx)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x6249
leaq 0x196(%rip), %rsi       # 0x14dde
leaq 0x8(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %rcx
movq %r15, %r8
callq 0x6f8e
movl %eax, %r15d
movq 0x8(%r12), %r12
movq %r12, %rdi
callq 0x50d0
movl %eax, %r13d
testq %r14, %r14
je 0x14c7e
movq %r12, %rdi
callq 0x5140
movq %rbx, %rdi
testl %r13d, %r13d
je 0x14c96
movl %ebp, %esi
callq 0x5d51
leaq 0xd032(%rip), %rsi      # 0x21cc6
jmp 0x14cb8
movl %ebp, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5da2
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x5d51
jmp 0x14cc8
leaq 0xd608(%rip), %rsi      # 0x222c0
movq %rbx, %rdi
movl %ebp, %edx
callq 0x14cdd
movl $0x7, %r15d
movl %r15d, %eax
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq