// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x2050, %rsp           # imm = 0x2050
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5d90
addl $0x1, %eax
movl %eax, -0x2040(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x20cd3
movq -0x10(%rbp), %rdi
leaq 0x14a43(%rip), %rsi     # 0x356fe
callq 0x6ce0
movq 0x22309(%rip), %rax     # 0x42fd0
movq (%rax), %rax
movq %rax, -0x2028(%rbp)
jmp 0x20d2a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x14a23(%rip), %rsi     # 0x35705
movb $0x0, %al
callq 0x6de0
movq -0x18(%rbp), %rdi
leaq 0x13342(%rip), %rsi     # 0x34036
callq 0x52d0
movq %rax, -0x2028(%rbp)
cmpq $0x0, -0x2028(%rbp)
jne 0x20d28
movq -0x10(%rbp), %rdi
movl -0x2040(%rbp), %edx
leaq 0x149f3(%rip), %rsi     # 0x3570e
callq 0x20ed0
movl %eax, -0x4(%rbp)
jmp 0x20ec0
jmp 0x20d2a
leaq -0x2030(%rbp), %rdi
leaq -0x203c(%rbp), %rsi
callq 0x20f60
cmpl $0x0, %eax
je 0x20d5d
movl -0x2030(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x2030(%rbp)
cltq
movb $0xa, -0x2020(%rbp,%rax)
movl -0x203c(%rbp), %eax
movsbl 0x138d1(%rip), %ecx     # 0x3463b
cmpl %ecx, %eax
jne 0x20dce
cmpq $0x0, -0x18(%rbp)
je 0x20dce
movq -0x18(%rbp), %rdi
movq -0x2028(%rbp), %rdx
leaq 0x14982(%rip), %rsi     # 0x35709
callq 0x52e0
movq %rax, -0x2028(%rbp)
cmpq $0x0, -0x2028(%rbp)
jne 0x20dbb
movq -0x10(%rbp), %rdi
movl -0x2040(%rbp), %edx
leaq 0x1495e(%rip), %rsi     # 0x3570c
callq 0x20ed0
movl %eax, -0x4(%rbp)
jmp 0x20ec0
leaq -0x2030(%rbp), %rdi
leaq -0x203c(%rbp), %rsi
callq 0x20f60
cmpl $-0x1, -0x203c(%rbp)
je 0x20df9
movl -0x203c(%rbp), %eax
movb %al, %cl
movl -0x2030(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x2030(%rbp)
cltq
movb %cl, -0x2020(%rbp,%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x2048(%rbp)
movq -0x10(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x67d0
movq -0x2048(%rbp), %rdi
movq %rax, %rcx
movq -0x20(%rbp), %r8
leaq 0x1c5(%rip), %rsi       # 0x20ff0
leaq -0x2030(%rbp), %rdx
callq 0x8410
movl %eax, -0x2034(%rbp)
movq -0x2028(%rbp), %rdi
callq 0x50d0
movl %eax, -0x2038(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x20e62
movq -0x2028(%rbp), %rdi
callq 0x5140
cmpl $0x0, -0x2038(%rbp)
je 0x20e95
movq -0x10(%rbp), %rdi
movl -0x2040(%rbp), %esi
callq 0x5dc0
movq -0x10(%rbp), %rdi
movl -0x2040(%rbp), %edx
leaq 0x142b3(%rip), %rsi     # 0x3513e
callq 0x20ed0
movl %eax, -0x4(%rbp)
jmp 0x20ec0
movq -0x10(%rbp), %rdi
movl -0x2040(%rbp), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5e60
movq -0x10(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x5dc0
movl -0x2034(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x2050, %rsp           # imm = 0x2050
popq %rbp
retq
nopl (%rax)