// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/lua/src/lua.c
// Function: pmain
static int pmain (lua_State *L) {
  struct Smain *s = (struct Smain *)lua_touserdata(L, 1);
  char **argv = s->argv;
  int script;
  int has_i = 0, has_v = 0, has_e = 0;
  globalL = L;
  if (argv[0] && argv[0][0]) progname = argv[0];
  lua_gc(L, LUA_GCSTOP, 0);  /* stop collector during initialization */
  luaL_openlibs(L);  /* open libraries */
  lua_gc(L, LUA_GCRESTART, 0);
  s->status = handle_luainit(L);
  if (s->status != 0) return 0;
  script = collectargs(argv, &has_i, &has_v, &has_e);
  if (script < 0) {  /* invalid args? */
    print_usage();
    s->status = 1;
    return 0;
  }
  if (has_v) print_version();
  s->status = runargs(L, argv, (script > 0) ? script : s->argc);
  if (s->status != 0) return 0;
  if (script)
    s->status = handle_script(L, argv, script);
  if (s->status != 0) return 0;
  if (has_i)
    dotty(L);
  else if (script == 0 && !has_e && !has_v) {
    if (lua_stdin_is_tty()) {
      print_version();
      dotty(L);
    }
    else dofile(L, NULL);  /* executes stdin as a file */
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x76a0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, 0x31af6(%rip)     # 0x372e0
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
je 0x5811
movq -0x20(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x5811
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, 0x31abf(%rip)     # 0x372d0
movq -0x10(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x8a40
movq -0x10(%rbp), %rdi
callq 0x1c010
movq -0x10(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x8a40
movq -0x10(%rbp), %rdi
callq 0x59f0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x585f
movl $0x0, -0x4(%rbp)
jmp 0x5963
movq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0x5a60
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0x5899
callq 0x5c30
movq -0x18(%rbp), %rax
movl $0x1, 0x10(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x5963
cmpl $0x0, -0x2c(%rbp)
je 0x58a4
callq 0x5c70
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, -0x24(%rbp)
jle 0x58c2
movl -0x24(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x58cb
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdi
movl -0x44(%rbp), %edx
callq 0x5c90
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x58f7
movl $0x0, -0x4(%rbp)
jmp 0x5963
cmpl $0x0, -0x24(%rbp)
je 0x5916
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
callq 0x5dd0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x5929
movl $0x0, -0x4(%rbp)
jmp 0x5963
cmpl $0x0, -0x28(%rbp)
je 0x593a
movq -0x10(%rbp), %rdi
callq 0x5ec0
jmp 0x595c
cmpl $0x0, -0x24(%rbp)
jne 0x595a
cmpl $0x0, -0x30(%rbp)
jne 0x595a
cmpl $0x0, -0x2c(%rbp)
jne 0x595a
callq 0x5c70
movq -0x10(%rbp), %rdi
callq 0x5ec0
jmp 0x595c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)