// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/lua-5.1.5/src/lgc.c
// Function: sweeplist
static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) {
  GCObject *curr;
  global_State *g = G(L);
  int deadmask = otherwhite(g);
  while ((curr = *p) != NULL && count-- > 0) {
    if (curr->gch.tt == LUA_TTHREAD)  /* sweep open upvalues of each thread */
      sweepwholelist(L, &gco2th(curr)->openupval);
    if ((curr->gch.marked ^ WHITEBITS) & deadmask) {  /* not dead? */
      lua_assert(!isdead(g, curr) || testbit(curr->gch.marked, FIXEDBIT));
      makewhite(g, curr);  /* make it white (for next cycle) */
      p = &curr->gch.next;
    }
    else {  /* must erase `curr' */
      lua_assert(isdead(g, curr) || deadmask == bitmask(SFIXEDBIT));
      *p = curr->gch.next;
      if (curr == g->rootgc)  /* is the first element of the list? */
        g->rootgc = curr->gch.next;  /* adjust first */
      freeobj(L, curr);
    }
  }
  return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq (%rsi), %r12
testq %r12, %r12
je 0x66971
movq %rdx, %rbx
movq %rdi, %r15
movq 0x20(%rdi), %rbp
movb 0x20(%rbp), %r13b
xorb $0x3, %r13b
incq %rbx
movq %rbp, 0x10(%rsp)
movb %r13b, 0xf(%rsp)
decq %rbx
je 0x66971
cmpb $0x8, 0x8(%r12)
jne 0x666eb
leaq 0x98(%r12), %rsi
movq %r15, %rdi
movq $-0x3, %rdx
callq 0x66687
movb 0x9(%r12), %al
movl %eax, %ecx
xorb $0x3, %cl
testb %r13b, %cl
je 0x66719
andb $-0x8, %al
movb 0x20(%rbp), %cl
andb $0x3, %cl
orb %al, %cl
movb %cl, 0x9(%r12)
movq %r12, %r14
movq (%r14), %r12
testq %r12, %r12
jne 0x666c3
jmp 0x66971
movq (%r12), %rax
movq %rax, (%r14)
cmpq 0x28(%rbp), %r12
jne 0x6672e
movq (%r12), %rax
movq %rax, 0x28(%rbp)
movzbl 0x8(%r12), %eax
addl $-0x4, %eax
cmpl $0x6, %eax
ja 0x6670c
leaq 0x86e41(%rip), %rcx     # 0xed584
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x20(%r15), %rbp
decl 0x8(%rbp)
movq 0x10(%r12), %r13
addq $0x19, %r13
jmp 0x667c7
movq 0x40(%r12), %rsi
movq %r12, %rdi
callq 0x5accd
movq %r15, %rdi
movq %r12, %rsi
callq 0x66c18
movq 0x20(%r15), %r13
movq 0x18(%r13), %rdi
movl $0xb8, %edx
movq %r12, %rsi
xorl %ecx, %ecx
callq *0x10(%r13)
addq $-0xb8, 0x78(%r13)
jmp 0x66957
cmpb $0x1, 0xa(%r12)
movzbl 0xb(%r12), %r13d
movb $0x4, %cl
sbbb $0x0, %cl
shll %cl, %r13d
addl $0x28, %r13d
andl $0xfff8, %r13d          # imm = 0xFFF8
jmp 0x667c3
movq 0x20(%r12), %r13
addq $0x28, %r13
movq 0x20(%r15), %rbp
movq 0x18(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq *0x10(%rbp)
subq %r13, 0x78(%rbp)
movb 0xf(%rsp), %r13b
movq 0x10(%rsp), %rbp
jmp 0x6670c
movq 0x20(%r12), %rsi
leaq 0x86f53(%rip), %rax     # 0xed748
cmpq %rax, %rsi
je 0x66824
movb 0xb(%r12), %cl
movl $0x1, %eax
shll %cl, %eax
cltq
shlq $0x3, %rax
leaq (%rax,%rax,4), %r13
movq 0x20(%r15), %rbp
movq 0x18(%rbp), %rdi
movq %r13, %rdx
xorl %ecx, %ecx
callq *0x10(%rbp)
subq %r13, 0x78(%rbp)
movq 0x18(%r12), %rsi
movslq 0x38(%r12), %r13
shlq $0x4, %r13
movq 0x20(%r15), %rbp
movq 0x18(%rbp), %rdi
movq %r13, %rdx
xorl %ecx, %ecx
callq *0x10(%rbp)
subq %r13, 0x78(%rbp)
movq 0x20(%r15), %r13
movq 0x18(%r13), %rdi
movl $0x40, %edx
movq %r12, %rsi
xorl %ecx, %ecx
callq *0x10(%r13)
addq $-0x40, 0x78(%r13)
movq 0x10(%rsp), %rbp
jmp 0x66957
movq 0x18(%r12), %rsi
movslq 0x50(%r12), %r13
shlq $0x2, %r13
movq 0x20(%r15), %rbp
movq 0x18(%rbp), %rdi
movq %r13, %rdx
xorl %ecx, %ecx
callq *0x10(%rbp)
subq %r13, 0x78(%rbp)
movq 0x20(%r12), %rsi
movslq 0x58(%r12), %r13
shlq $0x3, %r13
movq 0x20(%r15), %rbp
movq 0x18(%rbp), %rdi
movq %r13, %rdx
xorl %ecx, %ecx
callq *0x10(%rbp)
subq %r13, 0x78(%rbp)
movq 0x10(%r12), %rsi
movslq 0x4c(%r12), %r13
shlq $0x4, %r13
movq 0x20(%r15), %rbp
movq 0x18(%rbp), %rdi
movq %r13, %rdx
xorl %ecx, %ecx
callq *0x10(%rbp)
subq %r13, 0x78(%rbp)
movq 0x28(%r12), %rsi
movslq 0x54(%r12), %r13
shlq $0x2, %r13
movq 0x20(%r15), %rbp
movq 0x18(%rbp), %rdi
movq %r13, %rdx
xorl %ecx, %ecx
callq *0x10(%rbp)
subq %r13, 0x78(%rbp)
movq 0x30(%r12), %rsi
movslq 0x5c(%r12), %r13
shlq $0x4, %r13
movq 0x20(%r15), %rbp
movq 0x18(%rbp), %rdi
movq %r13, %rdx
xorl %ecx, %ecx
callq *0x10(%rbp)
subq %r13, 0x78(%rbp)
movq 0x38(%r12), %rsi
movslq 0x48(%r12), %r13
shlq $0x3, %r13
movq 0x20(%r15), %rbp
movq 0x18(%rbp), %rdi
movq %r13, %rdx
xorl %ecx, %ecx
callq *0x10(%rbp)
subq %r13, 0x78(%rbp)
movq 0x10(%rsp), %rbp
movq 0x20(%r15), %r13
movq 0x18(%r13), %rdi
movl $0x78, %edx
movq %r12, %rsi
xorl %ecx, %ecx
callq *0x10(%r13)
addq $-0x78, 0x78(%r13)
movb 0xf(%rsp), %r13b
jmp 0x6670c
movq %r15, %rdi
movq %r12, %rsi
callq 0x66bdc
jmp 0x6670c
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq