// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movzbl 0xb(%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0xf96f
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0xf962
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movzbl 0x9(%rax), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0xf962
movl $0x1, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0xd610
jmp 0xf964
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xf8f3
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0xfa39
movq -0x28(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0xf9a1
movq -0x28(%rbp), %rdi
callq 0xfc40
jmp 0xfa26
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x10, %rsi
callq 0xfc80
cmpl $0x0, %eax
je 0xf9e9
movl $0x1, -0x18(%rbp)
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0xf9e7
movq -0x28(%rbp), %rax
movq (%rax), %rax
movzbl 0x9(%rax), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0xf9e7
movl $0x1, -0x1c(%rbp)
jmp 0xfa24
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0xfa22
movq -0x28(%rbp), %rax
movq (%rax), %rax
movzbl 0x9(%rax), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0xfa22
movl $0x1, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
callq 0xd610
jmp 0xfa24
jmp 0xfa26
jmp 0xfa28
movq -0x28(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x28(%rbp)
jmp 0xf97b
movq -0x8(%rbp), %rax
movzbl 0x55(%rax), %eax
cmpl $0x0, %eax
jne 0xfa64
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x78(%rax)
jmp 0xfaba
cmpl $0x0, -0x1c(%rbp)
je 0xfa8e
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x88(%rax)
jmp 0xfab8
cmpl $0x0, -0x18(%rbp)
je 0xfab6
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x90(%rax)
jmp 0xfab8
jmp 0xfaba
movl -0x14(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)