// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x20(%rdi), %rbx
movzbl 0x21(%rbx), %eax
cmpq $0x4, %rax
ja 0x9862
movq %rdi, %r14
leaq 0x12114(%rip), %rcx     # 0x1b5e8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
callq 0x9907
jmp 0x9862
cmpq $0x0, 0x50(%rbx)
je 0x960d
movq %r14, %rdi
callq 0x9189
movq 0x80(%rbx), %rcx
movl $0x64, %eax
cmpq $0x65, %rcx
jb 0x9864
addq $-0x64, %rcx
movq %rcx, 0x80(%rbx)
jmp 0x9864
movq 0x78(%rbx), %r15
movslq 0x24(%rbx), %rsi
leal 0x1(%rsi), %eax
movl %eax, 0x24(%rbx)
shlq $0x3, %rsi
addq (%rbx), %rsi
movq %r14, %rdi
movq $-0x3, %rdx
callq 0x92c6
movl 0x24(%rbx), %eax
cmpl 0xc(%rbx), %eax
jl 0x9553
movb $0x3, 0x21(%rbx)
movq 0x78(%rbx), %rax
subq %r15, %rax
addq %rax, 0x80(%rbx)
movl $0xa, %eax
jmp 0x9864
movq 0x30(%rbx), %rsi
movq 0x78(%rbx), %r12
movl $0x28, %edx
movq %r14, %rdi
callq 0x92c6
movq %rax, 0x30(%rbx)
cmpq $0x0, (%rax)
jne 0x95dd
movq 0x20(%r14), %r13
movl 0xc(%r13), %esi
leal 0x3(%rsi), %eax
testl %esi, %esi
cmovnsl %esi, %eax
cmpl $0x41, %esi
jl 0x95b2
sarl $0x2, %eax
cmpl %eax, 0x8(%r13)
jae 0x95b2
shrl %esi
movq %r14, %rdi
callq 0xd1b0
movq 0x68(%r13), %rdx
cmpq $0x41, %rdx
jb 0x95d9
movq %rdx, %r15
shrq %r15
movq 0x58(%r13), %rsi
movq %r14, %rdi
movq %r15, %rcx
callq 0xa1f6
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 0x9864
cmpq $0x0, 0x38(%rbx)
je 0x9621
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x9af7
movb $0x0, 0x21(%rbx)
movq $0x0, 0x88(%rbx)
jmp 0x9862
leaq 0xb8(%rbx), %r15
movq 0xd8(%rbx), %r12
cmpq %r15, %r12
je 0x9673
testb $0x7, 0x9(%r12)
jne 0x9658
movq 0x10(%r12), %rax
cmpl $0x4, 0x8(%rax)
jl 0x9658
movq (%rax), %rsi
testb $0x3, 0x9(%rsi)
je 0x9658
movq %rbx, %rdi
callq 0x99ae
movq 0x20(%r12), %r12
cmpq %r15, %r12
jne 0x9634
jmp 0x966c
movq %rbx, %rdi
callq 0x9af7
cmpq $0x0, 0x38(%rbx)
jne 0x9664
movq 0x48(%rbx), %rax
movq %rax, 0x38(%rbx)
movq $0x0, 0x48(%rbx)
testb $0x3, 0x9(%r14)
je 0x9695
movq %rbx, %rdi
movq %r14, %rsi
callq 0x99ae
movq %rbx, %rdi
callq 0xa11a
cmpq $0x0, 0x38(%rbx)
je 0x96ae
movq %rbx, %rdi
callq 0x9af7
jmp 0x969d
movq 0x40(%rbx), %rax
movq %rax, 0x38(%rbx)
movq $0x0, 0x40(%rbx)
testq %rax, %rax
je 0x96d2
movq %rbx, %rdi
callq 0x9af7
cmpq $0x0, 0x38(%rbx)
jne 0x96c3
movq %r14, %rdi
xorl %esi, %esi
callq 0x9088
movq %rax, %r14
movq 0x50(%rbx), %r15
testq %r15, %r15
je 0x970e
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 0x99ae
cmpq 0x50(%rbx), %r15
jne 0x96e8
cmpq $0x0, 0x38(%rbx)
je 0x972c
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x9af7
addq %rax, %r15
cmpq $0x0, 0x38(%rbx)
jne 0x9718
jmp 0x972f
xorl %r15d, %r15d
movq 0x48(%rbx), %rax
testq %rax, %rax
je 0x983a
testb $0x10, 0x9(%rax)
je 0x979e
movslq 0x38(%rax), %rcx
testq %rcx, %rcx
je 0x979e
movq %rcx, %rdx
shlq $0x4, %rdx
addq $-0x8, %rdx
movq 0x18(%rax), %rsi
movl (%rsi,%rdx), %r8d
cmpl $0x4, %r8d
jl 0x9792
movq -0x8(%rsi,%rdx), %r9
movzbl 0x9(%r9), %edi
jne 0x977a
andb $-0x4, %dil
movb %dil, 0x9(%r9)
jmp 0x9792
testb $0x3, %dil
jne 0x978b
cmpl $0x7, %r8d
jne 0x9792
andl $0x8, %edi
je 0x9792
movl $0x0, (%rsi,%rdx)
decq %rcx
addq $-0x10, %rdx
testq %rcx, %rcx
jne 0x9756
movb 0xb(%rax), %cl
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
shll %cl, %edx
notl %edx
leaq (%rdx,%rdx,4), %rcx
leaq 0x18(,%rcx,8), %rcx
movq 0x20(%rax), %rdx
movl -0x10(%rdx,%rcx), %esi
testl %esi, %esi
je 0x9827
cmpl $0x4, (%rdx,%rcx)
jl 0x97e7
movq -0x8(%rdx,%rcx), %r8
movb 0x9(%r8), %dil
jne 0x97e1
andb $-0x4, %dil
movb %dil, 0x9(%r8)
movl -0x10(%rdx,%rcx), %esi
jmp 0x97e7
testb $0x3, %dil
jne 0x9812
cmpl $0x4, %esi
jl 0x9827
movq -0x18(%rdx,%rcx), %r8
movzbl 0x9(%r8), %edi
jne 0x9802
andb $-0x4, %dil
movb %dil, 0x9(%r8)
jmp 0x9827
testb $0x3, %dil
jne 0x9812
cmpl $0x7, %esi
jne 0x9827
andl $0x8, %edi
je 0x9827
movl $0x0, -0x10(%rdx,%rcx)
cmpl $0x4, (%rdx,%rcx)
jl 0x9827
movl $0xb, (%rdx,%rcx)
addq $-0x28, %rcx
cmpq $-0x10, %rcx
jne 0x97b6
movq 0x30(%rax), %rax
jmp 0x9733
xorb $0x3, 0x20(%rbx)
movl $0x0, 0x24(%rbx)
leaq 0x28(%rbx), %rax
movq %rax, 0x30(%rbx)
movb $0x2, 0x21(%rbx)
movq 0x78(%rbx), %rax
addq %r14, %r15
subq %r15, %rax
movq %rax, 0x80(%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq