// File: /workspace/github_c_makefile_star2_O2/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, %r12d
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movslq 0x38(%rsi), %r13
movzbl 0xb(%rsi), %ebp
movq 0x20(%rsi), %rax
movq %rax, 0x20(%rsp)
cmpl %edx, %r13d
movq %r14, 0x8(%rsp)
jge 0x157b4
cmpl $-0x2, %r14d
jle 0x158cd
movq 0x18(%r15), %rsi
movq %r13, %rdx
shlq $0x4, %rdx
movslq %r14d, %r14
movq %r14, %rcx
shlq $0x4, %rcx
movq %rbx, %rdi
callq 0xed73
movq %rax, 0x18(%r15)
movslq 0x38(%r15), %rcx
movq %rcx, %rdx
shlq $0x4, %rdx
addq %rdx, %rax
addq $0x8, %rax
cmpq %r14, %rcx
jge 0x157ab
andl $0x0, (%rax)
incq %rcx
addq $0x10, %rax
jmp 0x1579a
movq 0x8(%rsp), %r14
movl %r14d, 0x38(%r15)
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %edx
callq 0x158d5
cmpl %r14d, %r13d
jle 0x15840
movq %rbp, 0x18(%rsp)
movslq %r14d, %rbp
movl %r14d, 0x38(%r15)
incl %r14d
movq %rbp, %r12
shlq $0x4, %r12
movq %rbp, 0x10(%rsp)
cmpq %r13, %rbp
jge 0x15810
movq 0x18(%r15), %rcx
cmpl $0x0, 0x8(%rcx,%r12)
je 0x15804
addq %r12, %rcx
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x15983
incl %r14d
addq $0x10, %r12
incq %rbp
jmp 0x157e2
cmpl $-0x2, 0x8(%rsp)
jle 0x158cd
movq 0x18(%r15), %rsi
shlq $0x4, %r13
movq 0x10(%rsp), %rcx
shlq $0x4, %rcx
movq %rbx, %rdi
movq %r13, %rdx
callq 0xed73
movq %rax, 0x18(%r15)
movq 0x18(%rsp), %rbp
pushq $0x1
popq %r14
movl %ebp, %ecx
shlq %cl, %r14
imulq $0x28, %r14, %rax
movq 0x20(%rsp), %r13
leaq (%rax,%r13), %r12
addq $-0x28, %r12
movl %r14d, %ebp
testl %ebp, %ebp
jle 0x15890
cmpl $0x0, 0x8(%r12)
je 0x15888
leaq 0x10(%r12), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x159e4
movq (%r12), %rcx
movq %rcx, (%rax)
movl 0x8(%r12), %ecx
movl %ecx, 0x8(%rax)
decl %ebp
addq $-0x28, %r12
jmp 0x1585d
leaq 0xa249(%rip), %rax      # 0x1fae0
cmpq %rax, %r13
je 0x158be
movslq %r14d, %rax
imulq $0x28, %rax, %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 0xed73
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0xed64