// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lcode.c
// Function: addk
static int addk (FuncState *fs, TValue *key, TValue *v) {
  lua_State *L = fs->ls->L;
  TValue *idx = luaH_set(L, fs->h, key);
  Proto *f = fs->f;
  int k, oldsize;
  if (ttisnumber(idx)) {
    lua_Number n = nvalue(idx);
    lua_number2int(k, n);
    if (luaV_rawequalobj(&f->k[k], v))
      return k;
    /* else may be a collision (e.g., between 0.0 and "\0\0\0\0\0\0\0\0");
       go through and create a new entry for this value */
  }
  /* 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 */
  setnvalue(idx, cast_num(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:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
movq 0x58(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x38(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x50(%rsp), %rdx
callq 0x24890
movq %rax, 0x38(%rsp)
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rax
cmpl $0x3, 0x8(%rax)
jne 0x2ea62
movq 0x38(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x6913(%rip), %xmm0     # 0x35308
addsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movl 0x18(%rsp), %eax
movl %eax, 0x2c(%rsp)
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x2c(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq 0x48(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x2ea60
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rsi
movslq 0x2c(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rsi
movq 0x48(%rsp), %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x27e50
cmpl $0x0, %eax
je 0x2ea60
movl 0x2c(%rsp), %eax
movl %eax, 0x64(%rsp)
jmp 0x2ebc6
jmp 0x2ea62
movq 0x30(%rsp), %rax
movl 0x54(%rax), %eax
movl %eax, 0x28(%rsp)
movq 0x58(%rsp), %rax
movl 0x34(%rax), %eax
movl %eax, 0x2c(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
cvtsi2sdl 0x2c(%rsp), %xmm0
movq 0x10(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x10(%rsp), %rax
movl $0x3, 0x8(%rax)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movq 0x30(%rsp), %rcx
cmpl 0x54(%rcx), %eax
jle 0x2eaea
movq 0x40(%rsp), %rdi
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x30(%rsp), %rdx
addq $0x54, %rdx
movl $0x10, %ecx
movl $0x3ffffff, %r8d        # imm = 0x3FFFFFF
leaq 0x8bb6(%rip), %r9       # 0x3768f
callq 0x18040
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x2eaec
movl 0x28(%rsp), %eax
movq 0x30(%rsp), %rcx
cmpl 0x54(%rcx), %eax
jge 0x2eb23
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x28(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x28(%rsp)
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl $0x0, 0x8(%rax)
jmp 0x2eaec
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x2c(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %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 0x58(%rsp), %rax
movl 0x34(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x34(%rax)
movq 0x48(%rsp), %rax
movl 0x8(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x2ebbe
movq 0x48(%rsp), %rax
movq (%rax), %rax
movzbl 0x9(%rax), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x2ebbe
movq 0x30(%rsp), %rax
movzbl 0x9(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x2ebbe
movq 0x40(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x48(%rsp), %rax
movq (%rax), %rdx
callq 0x12aa0
movl 0x2c(%rsp), %eax
movl %eax, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nop