// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/deps/lua/src/ltable.c
// Function: newkey
static TValue *newkey (lua_State *L, Table *t, const TValue *key) {
  Node *mp = mainposition(t, key);
  if (!ttisnil(gval(mp)) || mp == dummynode) {
    Node *othern;
    Node *n = getfreepos(t);  /* get a free place */
    if (n == NULL) {  /* cannot find a free place? */
      rehash(L, t, key);  /* grow table */
      return luaH_set(L, t, key);  /* re-insert key into grown table */
    }
    lua_assert(n != dummynode);
    othern = mainposition(t, key2tval(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;
    }
  }
  gkey(mp)->value = key->value; gkey(mp)->tt = key->tt;
  luaC_barriert(L, t, key);
  lua_assert(ttisnil(gval(mp)));
  return gval(mp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdi
movq %rdx, %rsi
callq 0xcc4e
movq %rax, %r12
leaq 0xce88(%rip), %rax      # 0x19bd8
cmpq %rax, %r12
je 0xcd61
cmpl $0x0, 0x8(%r12)
je 0xcf56
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
leaq -0x28(%rcx), %r14
movq %r14, 0x28(%rbx)
cmpq %rax, %rcx
jbe 0xcdd3
cmpl $0x0, -0x10(%rcx)
movq %r14, %rcx
jne 0xcd69
leaq 0x10(%r12), %rsi
movq %rbx, %rdi
callq 0xcc4e
cmpq %r12, %rax
je 0xcf45
movq %rax, %rcx
movq 0x20(%rax), %rax
cmpq %r12, %rax
jne 0xcd95
movq %r14, 0x20(%rcx)
movq 0x20(%r12), %rax
movq %rax, 0x20(%r14)
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
andq $0x0, 0x20(%r12)
andl $0x0, 0x8(%r12)
jmp 0xcf56
xorl %eax, %eax
cmpq $0x1b, %rax
je 0xcde5
andl $0x0, 0x20(%rsp,%rax,4)
incq %rax
jmp 0xcdd5
xorl %eax, %eax
pushq $0x1
popq %rcx
xorl %ebp, %ebp
movl %ecx, %edx
cmpq $0x1b, %rax
je 0xce4c
movl 0x38(%rbx), %esi
movl %ecx, %edi
cmpl %esi, %ecx
jle 0xce03
movl %esi, %edi
cmpl %esi, %edx
jg 0xce4c
movslq %edx, %rsi
movslq %edi, %rdx
incq %rdx
cmpq %rsi, %rdx
cmovleq %rsi, %rdx
movq %rdx, %rdi
subq %rsi, %rdi
shlq $0x4, %rsi
addq $-0x8, %rsi
xorl %r8d, %r8d
subq $0x1, %rdi
jb 0xce3d
movq 0x18(%rbx), %r9
cmpl $0x1, (%r9,%rsi)
sbbl $-0x1, %r8d
addq $0x10, %rsi
jmp 0xce24
addl %r8d, 0x20(%rsp,%rax,4)
addl %r8d, %ebp
incq %rax
addl %ecx, %ecx
jmp 0xcdee
movq %r13, 0x10(%rsp)
movq %r15, 0x18(%rsp)
movb 0xb(%rbx), %cl
pushq $0x1
popq %r14
movl %r14d, %eax
shll %cl, %eax
movslq %eax, %r15
xorl %r13d, %r13d
leaq 0x20(%rsp), %r12
movl $0x0, 0xc(%rsp)
imulq $0x28, %r15, %rax
negq %r15
addq $0x10, %rax
incq %r15
cmpq $0x1, %r15
je 0xceb2
leaq -0x28(%rax), %rcx
movq 0x20(%rbx), %rdi
cmpl $0x0, -0x30(%rdi,%rax)
movq %rcx, %rax
je 0xce80
addq %rcx, %rdi
movq %r12, %rsi
callq 0xd136
addl %eax, %r13d
incl 0xc(%rsp)
negq %r15
jmp 0xce75
addl %ebp, %r13d
movq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0xd136
addl %r13d, %eax
movq %r15, %r13
xorl %esi, %esi
xorl %ecx, %ecx
xorl %edx, %edx
movq 0x18(%rsp), %r15
movl %r14d, %edi
shrl %edi
cmpl %eax, %edi
jae 0xcf11
movl (%r12), %r8d
leal (%r8,%rsi), %r9d
cmpl %edi, %r9d
setg %dil
testl %r8d, %r8d
cmovgl %r9d, %esi
setg %r8b
testb %dil, %r8b
cmovnel %r9d, %ecx
cmovnel %r14d, %edx
cmpl %eax, %esi
je 0xcf11
addl %r14d, %r14d
addq $0x4, %r12
jmp 0xced6
addl 0xc(%rsp), %ebp
subl %ecx, %ebp
incl %ebp
movq %r15, %rdi
movq %rbx, %rsi
movl %ebp, %ecx
callq 0xc791
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xccb1
movq 0x20(%r12), %rax
movq %rax, 0x20(%r14)
movq %r14, 0x20(%r12)
movq %r14, %r12
movq (%r13), %rax
movq %rax, 0x10(%r12)
movl 0x8(%r13), %eax
movl %eax, 0x18(%r12)
cmpl $0x4, %eax
jl 0xcf88
movq (%r13), %rax
testb $0x3, 0x9(%rax)
je 0xcf88
testb $0x4, 0x9(%rbx)
je 0xcf88
movq %r15, %rdi
movq %rbx, %rsi
callq 0x9143
movq %r12, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq