// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/ltable.c
// Function: luaH_resize
void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize) {
  int i;
  int oldasize = t->sizearray;
  int oldhsize = t->lsizenode;
  Node *nold = t->node;  /* save old hash ... */
  if (nasize > oldasize)  /* array part must grow? */
    setarrayvector(L, t, nasize);
  /* create new hash part with appropriate size */
  setnodevector(L, t, nhsize);
  if (nasize < oldasize) {  /* array part must shrink? */
    t->sizearray = nasize;
    /* re-insert elements from vanishing slice */
    for (i=nasize; i<oldasize; i++) {
      if (!ttisnil(&t->array[i]))
        luaH_setint(L, t, i + 1, &t->array[i]);
    }
    /* shrink array */
    luaM_reallocvector(L, t->array, oldasize, nasize, TValue);
  }
  /* re-insert elements from hash part */
  for (i = twoto(oldhsize) - 1; i >= 0; i--) {
    Node *old = nold+i;
    if (!ttisnil(gval(old))) {
      /* doesn't need barrier/invalidate cache, as entry was
         already present in the table */
      setobjt2t(L, luaH_set(L, t, gkey(old)), gval(old));
    }
  }
  if (!isdummy(nold))
    luaM_freearray(L, nold, cast(size_t, twoto(oldhsize))); /* free old array */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %r14d
movl %edx, %r13d
movq %rsi, %r15
movq %rdi, %rbx
movslq 0x38(%rsi), %r12
movzbl 0xb(%rsi), %ebp
movq 0x20(%rsi), %rax
movq %rax, 0x20(%rsp)
cmpl %edx, %r12d
movq %r12, 0x10(%rsp)
jge 0x16d0e
cmpl $-0x2, %r13d
jle 0x16e3a
movq 0x18(%r15), %rsi
movq %r12, %rdx
shlq $0x4, %rdx
movslq %r13d, %r12
movq %r12, %rcx
shlq $0x4, %rcx
movq %rbx, %rdi
callq 0xfa40
movq %rax, 0x18(%r15)
movslq 0x38(%r15), %rdx
cmpl %r13d, %edx
jge 0x16d05
subq %rdx, %r12
leaq 0x3(%r12), %rcx
andq $-0x4, %rcx
decq %r12
movq %r12, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shlq $0x4, %rdx
addq %rdx, %rax
addq $0x38, %rax
xorl %edx, %edx
movdqa 0x9c31(%rip), %xmm1     # 0x20860
movdqa 0x9c39(%rip), %xmm2     # 0x20870
movdqa 0x9c41(%rip), %xmm3     # 0x20880
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movq %rdx, %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, %esi
notl %esi
testb $0x1, %sil
je 0x16c91
movl $0x0, -0x30(%rax)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0x16ca7
movl $0x0, -0x20(%rax)
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, %esi
testb $0x1, %sil
je 0x16ce3
movl $0x0, -0x10(%rax)
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x16cf4
movl $0x0, (%rax)
addq $0x4, %rdx
addq $0x40, %rax
cmpq %rdx, %rcx
jne 0x16c47
movl %r13d, 0x38(%r15)
movq 0x10(%rsp), %r12
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x16e42
cmpl %r13d, %r12d
jle 0x16d9d
movl %ebp, 0xc(%rsp)
movl %r13d, 0x38(%r15)
movslq %r13d, %r14
leal 0x1(%r13), %ebp
movq %r14, 0x18(%rsp)
shlq $0x4, %r14
negl %r12d
movq 0x18(%r15), %rcx
cmpl $0x0, 0x8(%rcx,%r14)
je 0x16d58
addq %r14, %rcx
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x16efb
addq $0x10, %r14
leal (%r12,%rbp), %eax
incl %eax
movl %ebp, %ecx
incl %ecx
movl %ecx, %ebp
cmpl $0x1, %eax
jne 0x16d3c
cmpl $-0x2, %r13d
jle 0x16e3a
movq 0x18(%r15), %rsi
movq 0x10(%rsp), %rdx
shlq $0x4, %rdx
movq 0x18(%rsp), %rcx
shlq $0x4, %rcx
movq %rbx, %rdi
callq 0xfa40
movq %rax, 0x18(%r15)
movl 0xc(%rsp), %ebp
movl $0x1, %r12d
movl %ebp, %ecx
shll %cl, %r12d
cmpl $0x1f, %ebp
movq 0x20(%rsp), %r13
je 0x16df9
leal 0x1(%r12), %ebp
leal -0x1(%r12), %eax
leaq (%rax,%rax,4), %rax
leaq 0x10(,%rax,8), %r14
addq %r13, %r14
cmpl $0x0, -0x8(%r14)
je 0x16dee
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x16f5c
movq -0x10(%r14), %rcx
movq %rcx, (%rax)
movl -0x8(%r14), %ecx
movl %ecx, 0x8(%rax)
decl %ebp
addq $-0x28, %r14
cmpl $0x1, %ebp
jg 0x16dcb
leaq 0xad00(%rip), %rax      # 0x21b00
cmpq %rax, %r13
je 0x16e2b
movslq %r12d, %rax
shlq $0x3, %rax
leaq (%rax,%rax,4), %rdx
movq %rbx, %rdi
movq %r13, %rsi
xorl %ecx, %ecx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xfa40
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0xfa31