// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/deps/lua/src/lcode.c
// Function: addk
static int addk (FuncState *fs, TValue *k, TValue *v) {
  lua_State *L = fs->L;
  TValue *idx = luaH_set(L, fs->h, k);
  Proto *f = fs->f;
  int oldsize = f->sizek;
  if (ttisnumber(idx)) {
    lua_assert(luaO_rawequalObj(&fs->f->k[cast_int(nvalue(idx))], v));
    return cast_int(nvalue(idx));
  }
  else {  /* constant not found; create a new entry */
    setnvalue(idx, cast_num(fs->nk));
    luaM_growvector(L, f->k, fs->nk, f->sizek, TValue,
                    MAXARG_Bx, "constant table overflow");
    while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]);
    setobj(L, &f->k[fs->nk], v);
    luaC_barrier(L, f, v);
    return fs->nk++;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %rdx
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
movq 0x20(%rdi), %r14
movq %r14, %rdi
callq 0xdc86
cmpl $0x3, 0x8(%rax)
jne 0x11c16
cvttsd2si (%rax), %eax
jmp 0x11db9
movq (%rbx), %r12
leaq 0x4c(%r12), %rdx
movslq 0x4c(%r12), %r13
cvtsi2sdl 0x40(%rbx), %xmm0
movsd %xmm0, (%rax)
movl $0x3, 0x8(%rax)
movl (%rdx), %ecx
cmpl %ecx, 0x40(%rbx)
jl 0x11c63
movq 0x10(%r12), %rsi
leaq 0x9e5a(%rip), %r9       # 0x1baa0
movl $0x10, %ecx
movq %r14, %rdi
movl $0x3ffff, %r8d          # imm = 0x3FFFF
callq 0xa150
movq %rax, 0x10(%r12)
movl 0x4c(%r12), %ecx
movq 0x10(%r12), %rax
cmpl %ecx, %r13d
jge 0x11d78
movslq %ecx, %rdx
subq %r13, %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, %r13
leaq (%rax,%r13), %rdx
addq $0x38, %rdx
xorl %esi, %esi
movdqa 0x95ce(%rip), %xmm1     # 0x1b270
movdqa 0x95d6(%rip), %xmm2     # 0x1b280
movdqa 0x95de(%rip), %xmm3     # 0x1b290
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 0x11d04
movl $0x0, -0x30(%rdx)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x11d1a
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 0x11d56
movl $0x0, -0x10(%rdx)
pextrw $0x4, %xmm5, %edi
testb $0x1, %dil
je 0x11d67
movl $0x0, (%rdx)
addq $0x4, %rsi
addq $0x40, %rdx
cmpq %rsi, %rcx
jne 0x11cba
movslq 0x40(%rbx), %rcx
shlq $0x4, %rcx
movq (%r15), %rdx
movq %rdx, (%rax,%rcx)
movl 0x8(%r15), %edx
movl %edx, 0x8(%rax,%rcx)
cmpl $0x4, %edx
jl 0x11db0
movq (%r15), %rdx
testb $0x3, 0x9(%rdx)
je 0x11db0
testb $0x4, 0x9(%r12)
je 0x11db0
movq %r14, %rdi
movq %r12, %rsi
callq 0x998e
movl 0x40(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x40(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq