// File: /workspace/github_c_makefile_star2_O0/tylerneylon[P]APIsWithLua/lua/lgc.c
// Function: atomic
static l_mem atomic (lua_State *L) {
  global_State *g = G(L);
  l_mem work;
  GCObject *origweak, *origall;
  GCObject *grayagain = g->grayagain;  /* save original list */
  lua_assert(g->ephemeron == NULL && g->weak == NULL);
  lua_assert(!iswhite(g->mainthread));
  g->gcstate = GCSinsideatomic;
  g->GCmemtrav = 0;  /* start counting work */
  markobject(g, L);  /* mark running thread */
  /* registry and global metatables may be changed by API */
  markvalue(g, &g->l_registry);
  markmt(g);  /* mark global metatables */
  /* remark occasional upvalues of (maybe) dead threads */
  remarkupvals(g);
  propagateall(g);  /* propagate changes */
  work = g->GCmemtrav;  /* stop counting (do not recount 'grayagain') */
  g->gray = grayagain;
  propagateall(g);  /* traverse 'grayagain' list */
  g->GCmemtrav = 0;  /* restart counting */
  convergeephemerons(g);
  /* at this point, all strongly accessible objects are marked. */
  /* Clear values from weak tables, before checking finalizers */
  clearvalues(g, g->weak, NULL);
  clearvalues(g, g->allweak, NULL);
  origweak = g->weak; origall = g->allweak;
  work += g->GCmemtrav;  /* stop counting (objects being finalized) */
  separatetobefnz(g, 0);  /* separate objects to be finalized */
  g->gcfinnum = 1;  /* there may be objects to be finalized */
  markbeingfnz(g);  /* mark objects that will be finalized */
  propagateall(g);  /* remark, to propagate 'resurrection' */
  g->GCmemtrav = 0;  /* restart counting */
  convergeephemerons(g);
  /* at this point, all resurrected objects are marked. */
  /* remove dead objects from weak tables */
  clearkeys(g, g->ephemeron, NULL);  /* clear keys from all ephemeron tables */
  clearkeys(g, g->allweak, NULL);  /* clear keys from all 'allweak' tables */
  /* clear values from resurrected weak tables */
  clearvalues(g, g->weak, origweak);
  clearvalues(g, g->allweak, origall);
  luaS_clearcache(g);
  g->currentwhite = cast_byte(otherwhite(g));  /* flip current white */
  work += g->GCmemtrav;  /* complete counting */
  return work;  /* estimate of memory marked by 'atomic' */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movb $0x8, 0x55(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x8(%rbp), %rax
movzbl 0x9(%rax), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0xebf5
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xd610
movq -0x10(%rbp), %rax
movl 0x48(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0xec29
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movzbl 0x9(%rax), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0xec29
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0xd610
movq -0x10(%rbp), %rdi
callq 0xeef0
movq -0x10(%rbp), %rdi
callq 0xfd00
movq -0x10(%rbp), %rdi
callq 0xeb70
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x10(%rbp), %rdi
callq 0xeb70
movq -0x10(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x10(%rbp), %rdi
callq 0xfe00
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xfe80
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x90(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xfe80
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x90(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0xdc70
movq -0x10(%rbp), %rax
movl $0x1, 0xb0(%rax)
movq -0x10(%rbp), %rdi
callq 0xef70
movq -0x10(%rbp), %rdi
callq 0xeb70
movq -0x10(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x10(%rbp), %rdi
callq 0xfe00
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xffa0
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x90(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xffa0
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0xfe80
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x90(%rax), %rsi
movq -0x28(%rbp), %rdx
callq 0xfe80
movq -0x10(%rbp), %rdi
callq 0x16740
movq -0x10(%rbp), %rax
movzbl 0x54(%rax), %eax
xorl $0x3, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x54(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop