// File: /workspace/github_c_makefile_star2_O3/tylerneylon[P]APIsWithLua/lua/lgc.c
// Function: traverseephemeron
static int traverseephemeron (global_State *g, Table *h) {
  int marked = 0;  /* true if an object is marked in this traversal */
  int hasclears = 0;  /* true if table has white keys */
  int hasww = 0;  /* true if table has entry "white-key -> white-value" */
  Node *n, *limit = gnodelast(h);
  unsigned int i;
  /* traverse array part */
  for (i = 0; i < h->sizearray; i++) {
    if (valiswhite(&h->array[i])) {
      marked = 1;
      reallymarkobject(g, gcvalue(&h->array[i]));
    }
  }
  /* traverse hash part */
  for (n = gnode(h, 0); n < limit; n++) {
    checkdeadkey(n);
    if (ttisnil(gval(n)))  /* entry is empty? */
      removeentry(n);  /* remove it */
    else if (iscleared(g, gkey(n))) {  /* key is not marked (yet)? */
      hasclears = 1;  /* table must be cleared */
      if (valiswhite(gval(n)))  /* value not marked yet? */
        hasww = 1;  /* white-white entry */
    }
    else if (valiswhite(gval(n))) {  /* value not marked yet? */
      marked = 1;
      reallymarkobject(g, gcvalue(gval(n)));  /* mark it now */
    }
  }
  /* link table into proper list */
  if (g->gcstate == GCSpropagate)
    linkgclist(h, g->grayagain);  /* must retraverse it in atomic phase */
  else if (hasww)  /* table has white->white entries? */
    linkgclist(h, g->ephemeron);  /* have to propagate again */
  else if (hasclears)  /* table has white keys? */
    linkgclist(h, g->allweak);  /* may have to clean white keys */
  return marked;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rsi), %r12
movb 0xb(%rsi), %cl
movl $0x1, %eax
shll %cl, %eax
movslq %eax, %r15
shlq $0x5, %r15
addq %r12, %r15
movl 0xc(%rsi), %edx
testl %edx, %edx
je 0xb54f
xorl %r12d, %r12d
movl $0x8, %r13d
xorl %eax, %eax
movq 0x10(%rbx), %rcx
testb $0x40, (%rcx,%r13)
je 0xb53b
movq -0x8(%rcx,%r13), %rsi
testb $0x3, 0x9(%rsi)
je 0xb53b
movq %r14, %rdi
callq 0xa160
movl 0xc(%rbx), %edx
movl $0x1, %eax
incq %r12
movl %edx, %ecx
addq $0x10, %r13
cmpq %rcx, %r12
jb 0xb515
movq 0x18(%rbx), %r12
jmp 0xb551
xorl %eax, %eax
cmpq %r15, %r12
jae 0xb610
movl %eax, 0x4(%rsp)
xorl %r13d, %r13d
xorl %ebp, %ebp
cmpl $0x0, 0x8(%r12)
je 0xb599
leaq 0x10(%r12), %rsi
movq %r14, %rdi
callq 0xb637
movl 0x8(%r12), %ecx
testl %eax, %eax
je 0xb5b7
movl $0x1, %ebp
testb $0x40, %cl
je 0xb5d6
movq (%r12), %rax
testb $0x3, 0x9(%rax)
cmovnel %ebp, %r13d
jmp 0xb5d6
testb $0x40, 0x18(%r12)
je 0xb5d6
movq 0x10(%r12), %rax
testb $0x3, 0x9(%rax)
je 0xb5d6
movl $0xa, 0x18(%r12)
jmp 0xb5d6
testb $0x40, %cl
je 0xb5d6
movq (%r12), %rsi
testb $0x3, 0x9(%rsi)
je 0xb5d6
movq %r14, %rdi
callq 0xa160
movl $0x1, 0x4(%rsp)
addq $0x20, %r12
cmpq %r15, %r12
jb 0xb563
xorl %eax, %eax
testl %r13d, %r13d
sete %al
orl %r13d, %ebp
setne %cl
cmpb $0x0, 0x55(%r14)
sete %dl
leaq 0x88(,%rax,8), %rsi
movl $0x78, %edi
cmovneq %rsi, %rdi
orb %cl, %dl
movl 0x4(%rsp), %eax
jne 0xb61c
jmp 0xb628
cmpb $0x0, 0x55(%r14)
jne 0xb628
movl $0x78, %edi
movq (%r14,%rdi), %rcx
movq %rcx, 0x30(%rbx)
movq %rbx, (%r14,%rdi)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq