// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/ltable.c
// Function: luaH_newkey
TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key) {
  Node *mp;
  if (ttisnil(key)) luaG_runerror(L, "table index is nil");
  else if (ttisnumber(key) && luai_numisnan(L, nvalue(key)))
    luaG_runerror(L, "table index is NaN");
  mp = mainposition(t, key);
  if (!ttisnil(gval(mp)) || isdummy(mp)) {  /* main position is taken? */
    Node *othern;
    Node *n = getfreepos(t);  /* get a free place */
    if (n == NULL) {  /* cannot find a free place? */
      rehash(L, t, key);  /* grow table */
      /* whatever called 'newkey' take care of TM cache and GC barrier */
      return luaH_set(L, t, key);  /* insert key into grown table */
    }
    lua_assert(!isdummy(n));
    othern = mainposition(t, gkey(mp));
    if (othern != mp) {  /* is colliding node out of its main position? */
      /* yes; move colliding node into free position */
      while (gnext(othern) != mp) othern = gnext(othern);  /* find previous */
      gnext(othern) = n;  /* redo the chain with `n' in place of `mp' */
      *n = *mp;  /* copy colliding node into free pos. (mp->next also goes) */
      gnext(mp) = NULL;  /* now `mp' is free */
      setnilvalue(gval(mp));
    }
    else {  /* colliding node is in its own main position */
      /* new node will go into free position */
      gnext(n) = gnext(mp);  /* chain new position */
      gnext(mp) = n;
      mp = n;
    }
  }
  setobj2t(L, gkey(mp), key);
  luaC_barrierback(L, obj2gco(t), key);
  lua_assert(ttisnil(gval(mp)));
  return gval(mp);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x24ab1
movq 0x38(%rsp), %rdi
leaq 0x12386(%rip), %rsi     # 0x36e30
movb $0x0, %al
callq 0xf360
movq 0x28(%rsp), %rax
cmpl $0x3, 0x8(%rax)
jne 0x24ae7
movq 0x28(%rsp), %rax
movsd (%rax), %xmm0
movq 0x28(%rsp), %rax
ucomisd (%rax), %xmm0
jne 0x24ad4
jp 0x24ad4
jmp 0x24ae7
movq 0x38(%rsp), %rdi
leaq 0x12363(%rip), %rsi     # 0x36e43
movb $0x0, %al
callq 0xf360
jmp 0x24ae9
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x24ca0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x24b1a
leaq 0x122f9(%rip), %rax     # 0x36e08
cmpq %rax, 0x20(%rsp)
jne 0x24c12
movq 0x30(%rsp), %rdi
callq 0x24f00
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x24b63
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0x24f60
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0x24890
movq %rax, 0x40(%rsp)
jmp 0x24c95
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
addq $0x10, %rsi
callq 0x24ca0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x20(%rsp), %rax
je 0x24be6
jmp 0x24b89
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rax
cmpq 0x20(%rsp), %rax
je 0x24ba9
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x24b89
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x28, %edx
callq 0x7350
movq 0x20(%rsp), %rax
movq $0x0, 0x20(%rax)
movq 0x20(%rsp), %rax
movl $0x0, 0x8(%rax)
jmp 0x24c10
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x10(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x24c12
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
addq $0x10, %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
movl 0x8(%rax), %ecx
movq (%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x28(%rsp), %rax
movl 0x8(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x24c8b
movq 0x28(%rsp), %rax
movq (%rax), %rax
movzbl 0x9(%rax), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x24c8b
movq 0x30(%rsp), %rax
movzbl 0x9(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x24c8b
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x12d70
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nop