// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x20(%rdi), %rbx
movzbl 0x21(%rbx), %eax
cmpq $0x4, %rax
ja 0x8f4f
movq %rdi, %r14
leaq 0x10975(%rip), %rcx     # 0x195c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
callq 0x8fe2
jmp 0x8f4f
cmpq $0x0, 0x50(%rbx)
je 0x8d84
movq %r14, %rdi
callq 0x8937
movq 0x80(%rbx), %rcx
pushq $0x64
popq %rax
cmpq $0x65, %rcx
jb 0x8f51
addq $-0x64, %rcx
movq %rcx, 0x80(%rbx)
jmp 0x8f51
movq 0x78(%rbx), %r15
movslq 0x24(%rbx), %rsi
leal 0x1(%rsi), %eax
movl %eax, 0x24(%rbx)
shlq $0x3, %rsi
addq (%rbx), %rsi
pushq $-0x3
popq %rdx
movq %r14, %rdi
callq 0x8a65
movl 0x24(%rbx), %eax
cmpl 0xc(%rbx), %eax
jl 0x8ccc
movb $0x3, 0x21(%rbx)
movq 0x78(%rbx), %rax
subq %r15, %rax
addq %rax, 0x80(%rbx)
pushq $0xa
popq %rax
jmp 0x8f51
movq 0x30(%rbx), %rsi
movq 0x78(%rbx), %r12
pushq $0x28
popq %rdx
movq %r14, %rdi
callq 0x8a65
movq %rax, 0x30(%rbx)
cmpq $0x0, (%rax)
jne 0x8d4f
movq 0x20(%r14), %r13
movl 0xc(%r13), %esi
pushq $0x4
popq %rcx
movl %esi, %eax
cltd
idivl %ecx
cmpl $0x41, %esi
jl 0x8d24
cmpl %eax, 0x8(%r13)
jae 0x8d24
shrl %esi
movq %r14, %rdi
callq 0xc3a8
movq 0x68(%r13), %rdx
cmpq $0x41, %rdx
jb 0x8d4b
movq %rdx, %r15
shrq %r15
movq 0x58(%r13), %rsi
movq %r14, %rdi
movq %r15, %rcx
callq 0x97a6
movq %rax, 0x58(%r13)
movq %r15, 0x68(%r13)
movb $0x4, 0x21(%rbx)
movq 0x78(%rbx), %rax
subq %r12, %rax
addq %rax, 0x80(%rbx)
movl $0x190, %eax            # imm = 0x190
jmp 0x8f51
cmpq $0x0, 0x38(%rbx)
je 0x8d95
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x91b9
movb $0x0, 0x21(%rbx)
andq $0x0, 0x88(%rbx)
jmp 0x8f4f
leaq 0xb8(%rbx), %r15
leaq 0xd8(%rbx), %r12
movq (%r12), %r12
cmpq %r15, %r12
je 0x8dd6
testb $0x7, 0x9(%r12)
jne 0x8dd0
movq 0x10(%r12), %rax
cmpl $0x4, 0x8(%rax)
jl 0x8dd0
movq (%rax), %rsi
testb $0x3, 0x9(%rsi)
je 0x8dd0
movq %rbx, %rdi
callq 0x9086
addq $0x20, %r12
jmp 0x8da3
movq %rbx, %rdi
callq 0x9686
movq 0x48(%rbx), %rax
movq %rax, 0x38(%rbx)
andq $0x0, 0x48(%rbx)
testb $0x3, 0x9(%r14)
je 0x8dfd
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9086
movq %rbx, %rdi
callq 0x96ae
movq %rbx, %rdi
callq 0x9686
movq 0x40(%rbx), %rax
movq %rax, 0x38(%rbx)
andq $0x0, 0x40(%rbx)
movq %rbx, %rdi
callq 0x9686
movq %r14, %rdi
xorl %esi, %esi
callq 0x884c
movq %rax, 0x10(%rsp)
movq 0x50(%rbx), %r15
testq %r15, %r15
je 0x8e60
movq (%r15), %r15
movb 0x9(%r15), %al
andb $-0x8, %al
movb 0x20(%rbx), %cl
andb $0x3, %cl
orb %al, %cl
movb %cl, 0x9(%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9086
cmpq 0x50(%rbx), %r15
jne 0x8e3a
leaq 0x48(%rbx), %r12
movq %rbx, %rdi
callq 0x9686
movq %rax, 0x8(%rsp)
pushq $0x1
popq %rbp
movq (%r12), %r12
testq %r12, %r12
je 0x8f23
testb $0x10, 0x9(%r12)
jne 0x8ef1
movb 0xb(%r12), %cl
movl %ebp, %eax
shll %cl, %eax
movslq %eax, %r13
imulq $0x28, %r13, %r14
addq $-0x28, %r14
subq $0x1, %r13
jb 0x8eeb
movq 0x20(%r12), %r15
cmpl $0x0, 0x8(%r15,%r14)
je 0x8e99
leaq (%r15,%r14), %rdi
addq $0x10, %rdi
movl %ebp, %esi
callq 0x96e3
testl %eax, %eax
jne 0x8ed2
leaq (%r15,%r14), %rdi
xorl %esi, %esi
callq 0x96e3
testl %eax, %eax
je 0x8e99
andl $0x0, 0x8(%r15,%r14)
cmpl $0x4, 0x18(%r15,%r14)
jl 0x8e99
movl $0xb, 0x18(%r15,%r14)
jmp 0x8e99
addq $0x30, %r12
jmp 0x8e74
movslq 0x38(%r12), %r14
movq %r14, %r13
shlq $0x4, %r13
addq $-0x10, %r13
subq $0x1, %r14
jb 0x8e89
movq 0x18(%r12), %r15
leaq (%r15,%r13), %rdi
xorl %esi, %esi
callq 0x96e3
testl %eax, %eax
je 0x8efd
andl $0x0, 0x8(%r15,%r13)
jmp 0x8efd
xorb $0x3, 0x20(%rbx)
andl $0x0, 0x24(%rbx)
leaq 0x28(%rbx), %rax
movq %rax, 0x30(%rbx)
movb $0x2, 0x21(%rbx)
movq 0x78(%rbx), %rax
movq 0x8(%rsp), %rcx
addq 0x10(%rsp), %rcx
subq %rcx, %rax
movq %rax, 0x80(%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq