// File: /workspace/github_c_makefile_star2_O3/tylerneylon[P]APIsWithLua/lua/lcode.c
// Function: addk
static int addk (FuncState *fs, TValue *key, TValue *v) {
  lua_State *L = fs->ls->L;
  Proto *f = fs->f;
  TValue *idx = luaH_set(L, fs->ls->h, key);  /* index scanner table */
  int k, oldsize;
  if (ttisinteger(idx)) {  /* is there an index there? */
    k = cast_int(ivalue(idx));
    /* correct value? (warning: must distinguish floats from integers!) */
    if (k < fs->nk && ttype(&f->k[k]) == ttype(v) &&
                      luaV_rawequalobj(&f->k[k], v))
      return k;  /* reuse index */
  }
  /* constant not found; create a new entry */
  oldsize = f->sizek;
  k = fs->nk;
  /* numerical value does not need GC barrier;
     table has no metatable, so it does not need to invalidate cache */
  setivalue(idx, k);
  luaM_growvector(L, f->k, k, f->sizek, TValue, MAXARG_Ax, "constants");
  while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]);
  setobj(L, &f->k[k], v);
  fs->nk++;
  luaC_barrier(L, f, v);
  return k;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %rdx
movq %rdi, %r13
movq (%rdi), %rbx
movq 0x10(%rdi), %rax
movq 0x38(%rax), %rdi
movq 0x50(%rax), %rsi
movq %rdi, 0x8(%rsp)
callq 0x1005a
movq %rax, %rbp
cmpl $0x13, 0x8(%rax)
jne 0x16598
movq (%rbp), %r14
cmpl %r14d, 0x2c(%r13)
jle 0x16598
movq 0x30(%rbx), %rsi
movslq %r14d, %rax
shlq $0x4, %rax
movl 0x8(%r15), %ecx
xorl 0x8(%rsi,%rax), %ecx
testb $0x3f, %cl
je 0x16733
movq %r15, 0x10(%rsp)
movslq 0x14(%rbx), %r12
movl 0x2c(%r13), %r14d
movslq %r14d, %r15
movq %r15, (%rbp)
movl $0x13, 0x8(%rbp)
movl 0x14(%rbx), %ecx
cmpl %ecx, %r15d
jl 0x165e6
leaq 0x14(%rbx), %rdx
movq 0x30(%rbx), %rsi
leaq 0xd0b1(%rip), %r9       # 0x2367b
movl $0x10, %ecx
movq 0x8(%rsp), %rdi
movl $0x3ffffff, %r8d        # imm = 0x3FFFFFF
callq 0xb838
movq %rax, 0x30(%rbx)
movl 0x14(%rbx), %ecx
movq 0x30(%rbx), %rax
cmpl %ecx, %r12d
jge 0x166fa
movslq %ecx, %rdx
subq %r12, %rdx
leaq 0x3(%rdx), %rcx
andq $-0x4, %rcx
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shlq $0x4, %r12
leaq (%r12,%rax), %rdx
addq $0x38, %rdx
xorl %esi, %esi
movdqa 0xbabc(%rip), %xmm1     # 0x220e0
movdqa 0xbac4(%rip), %xmm2     # 0x220f0
movdqa 0xbacc(%rip), %xmm3     # 0x22100
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movq %rsi, %xmm5
pshufd $0x44, %xmm5, %xmm5     # xmm5 = xmm5[0,1,0,1]
movdqa %xmm5, %xmm6
por %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %edi
notl %edi
testb $0x1, %dil
je 0x16686
movl $0x0, -0x30(%rdx)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x1669c
movl $0x0, -0x20(%rdx)
por %xmm1, %xmm5
pxor %xmm3, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
pxor %xmm4, %xmm5
pextrw $0x0, %xmm5, %edi
testb $0x1, %dil
je 0x166d8
movl $0x0, -0x10(%rdx)
pextrw $0x4, %xmm5, %edi
testb $0x1, %dil
je 0x166e9
movl $0x0, (%rdx)
addq $0x4, %rsi
addq $0x40, %rdx
cmpq %rsi, %rcx
jne 0x1663c
shlq $0x4, %r15
movq 0x10(%rsp), %rcx
movups (%rcx), %xmm0
movups %xmm0, (%rax,%r15)
incl 0x2c(%r13)
testb $0x40, 0x8(%rcx)
je 0x16748
testb $0x4, 0x9(%rbx)
je 0x16748
movq (%rcx), %rdx
testb $0x3, 0x9(%rdx)
je 0x16748
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0xa140
jmp 0x16748
addq %rax, %rsi
xorl %edi, %edi
movq %r15, %rdx
callq 0x11deb
testl %eax, %eax
je 0x16598
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq