// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/lua/src/lapi.c
// Function: lua_gc
LUA_API int lua_gc (lua_State *L, int what, int data) {
  int res = 0;
  global_State *g;
  lua_lock(L);
  g = G(L);
  switch (what) {
    case LUA_GCSTOP: {
      g->GCthreshold = MAX_LUMEM;
      break;
    }
    case LUA_GCRESTART: {
      g->GCthreshold = g->totalbytes;
      break;
    }
    case LUA_GCCOLLECT: {
      luaC_fullgc(L);
      break;
    }
    case LUA_GCCOUNT: {
      /* GC values are expressed in Kbytes: #bytes/2^10 */
      res = cast_int(g->totalbytes >> 10);
      break;
    }
    case LUA_GCCOUNTB: {
      res = cast_int(g->totalbytes & 0x3ff);
      break;
    }
    case LUA_GCSTEP: {
      lu_mem a = (cast(lu_mem, data) << 10);
      if (a <= g->totalbytes)
        g->GCthreshold = g->totalbytes - a;
      else
        g->GCthreshold = 0;
      while (g->GCthreshold <= g->totalbytes) {
        luaC_step(L);
        if (g->gcstate == GCSpause) {  /* end of cycle? */
          res = 1;  /* signal it */
          break;
        }
      }
      break;
    }
    case LUA_GCSETPAUSE: {
      res = g->gcpause;
      g->gcpause = data;
      break;
    }
    case LUA_GCSETSTEPMUL: {
      res = g->gcstepmul;
      g->gcstepmul = data;
      break;
    }
    default: res = -1;  /* invalid option */
  }
  lua_unlock(L);
  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movl -0xc(%rbp), %eax
movq %rax, -0x30(%rbp)
subq $0x7, %rax
ja 0x8b93
movq -0x30(%rbp), %rax
leaq 0x2281f(%rip), %rcx     # 0x2b2a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
movq $-0x3, 0x70(%rax)
jmp 0x8b9a
movq -0x20(%rbp), %rax
movq 0x78(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x70(%rax)
jmp 0x8b9a
movq -0x8(%rbp), %rdi
callq 0xdca0
jmp 0x8b9a
movq -0x20(%rbp), %rax
movq 0x78(%rax), %rax
shrq $0xa, %rax
movl %eax, -0x14(%rbp)
jmp 0x8b9a
movq -0x20(%rbp), %rax
movq 0x78(%rax), %rax
andq $0x3ff, %rax            # imm = 0x3FF
movl %eax, -0x14(%rbp)
jmp 0x8b9a
movslq -0x10(%rbp), %rax
shlq $0xa, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x78(%rcx), %rax
ja 0x8b18
movq -0x20(%rbp), %rax
movq 0x78(%rax), %rcx
subq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x70(%rax)
jmp 0x8b24
movq -0x20(%rbp), %rax
movq $0x0, 0x70(%rax)
jmp 0x8b26
movq -0x20(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x78(%rcx), %rax
ja 0x8b59
movq -0x8(%rbp), %rdi
callq 0xd970
movq -0x20(%rbp), %rax
movzbl 0x21(%rax), %eax
cmpl $0x0, %eax
jne 0x8b57
movl $0x1, -0x14(%rbp)
jmp 0x8b59
jmp 0x8b26
jmp 0x8b9a
movq -0x20(%rbp), %rax
movl 0x90(%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x10(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x90(%rax)
jmp 0x8b9a
movq -0x20(%rbp), %rax
movl 0x94(%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x10(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x94(%rax)
jmp 0x8b9a
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movl -0x14(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)