// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/lua/src/lgc.c
// Function: singlestep
static l_mem singlestep (lua_State *L) {
  global_State *g = G(L);
  /*lua_checkmemory(L);*/
  switch (g->gcstate) {
    case GCSpause: {
      markroot(L);  /* start a new collection */
      return 0;
    }
    case GCSpropagate: {
      if (g->gray)
        return propagatemark(g);
      else {  /* no more `gray' objects */
        atomic(L);  /* finish mark phase */
        return 0;
      }
    }
    case GCSsweepstring: {
      lu_mem old = g->totalbytes;
      sweepwholelist(L, &g->strt.hash[g->sweepstrgc++]);
      if (g->sweepstrgc >= g->strt.size)  /* nothing more to sweep? */
        g->gcstate = GCSsweep;  /* end sweep-string phase */
      lua_assert(old >= g->totalbytes);
      g->estimate -= old - g->totalbytes;
      return GCSWEEPCOST;
    }
    case GCSsweep: {
      lu_mem old = g->totalbytes;
      g->sweepgc = sweeplist(L, g->sweepgc, GCSWEEPMAX);
      if (*g->sweepgc == NULL) {  /* nothing more to sweep? */
        checkSizes(L);
        g->gcstate = GCSfinalize;  /* end sweep phase */
      }
      lua_assert(old >= g->totalbytes);
      g->estimate -= old - g->totalbytes;
      return GCSWEEPMAX*GCSWEEPCOST;
    }
    case GCSfinalize: {
      if (g->tmudata) {
        GCTM(L);
        if (g->estimate > GCFINALIZECOST)
          g->estimate -= GCFINALIZECOST;
        return GCFINALIZECOST;
      }
      else {
        g->gcstate = GCSpause;  /* end collection */
        g->gcdept = 0;
        return 0;
      }
    }
    default: lua_assert(0); return 0;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x21(%rax), %eax
movq %rax, -0x30(%rbp)
subq $0x4, %rax
ja 0xdc86
movq -0x30(%rbp), %rax
leaq 0x1db8b(%rip), %rcx     # 0x2b664
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
callq 0xdd80
movq $0x0, -0x8(%rbp)
jmp 0xdc8e
movq -0x18(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0xdb15
movq -0x18(%rbp), %rdi
callq 0xe350
movq %rax, -0x8(%rbp)
jmp 0xdc8e
movq -0x10(%rbp), %rdi
callq 0xe5a0
movq $0x0, -0x8(%rbp)
jmp 0xdc8e
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x18(%rbp), %rcx
movl 0x24(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x24(%rcx)
cltq
shlq $0x3, %rax
addq %rax, %rsi
movq $-0x3, %rdx
callq 0xd850
movq -0x18(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jl 0xdb7e
movq -0x18(%rbp), %rax
movb $0x3, 0x21(%rax)
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
subq 0x78(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x80(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x80(%rax)
movq $0xa, -0x8(%rbp)
jmp 0xdc8e
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rsi
movl $0x28, %edx
callq 0xd850
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
cmpq $0x0, (%rax)
jne 0xdbf8
movq -0x10(%rbp), %rdi
callq 0xe6d0
movq -0x18(%rbp), %rax
movb $0x4, 0x21(%rax)
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rax
subq 0x78(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x80(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x80(%rax)
movq $0x190, -0x8(%rbp)      # imm = 0x190
jmp 0xdc8e
movq -0x18(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0xdc65
movq -0x10(%rbp), %rdi
callq 0xd5e0
movq -0x18(%rbp), %rax
cmpq $0x64, 0x80(%rax)
jbe 0xdc5b
movq -0x18(%rbp), %rax
movq 0x80(%rax), %rcx
subq $0x64, %rcx
movq %rcx, 0x80(%rax)
movq $0x64, -0x8(%rbp)
jmp 0xdc8e
movq -0x18(%rbp), %rax
movb $0x0, 0x21(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x88(%rax)
movq $0x0, -0x8(%rbp)
jmp 0xdc8e
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)