// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movl %edx, 0x34(%rsp)
movl %ecx, 0x30(%rsp)
movq 0x38(%rsp), %rax
movl 0x38(%rax), %eax
movl %eax, 0x28(%rsp)
movq 0x38(%rsp), %rax
movzbl 0xb(%rax), %eax
movl %eax, 0x24(%rsp)
movq 0x38(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x18(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x28(%rsp), %eax
jle 0x2440a
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl 0x34(%rsp), %edx
callq 0x245c0
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl 0x30(%rsp), %edx
callq 0x24680
movl 0x34(%rsp), %eax
cmpl 0x28(%rsp), %eax
jge 0x244f3
movl 0x34(%rsp), %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x38(%rax)
movl 0x34(%rsp), %eax
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
cmpl 0x28(%rsp), %eax
jge 0x2449e
movq 0x38(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x2c(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpl $0x0, 0x8(%rax)
je 0x2448f
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl 0x2c(%rsp), %edx
addl $0x1, %edx
movq 0x38(%rsp), %rax
movq 0x18(%rax), %rcx
movslq 0x2c(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rcx
callq 0x247d0
jmp 0x24491
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x2443f
movl 0x34(%rsp), %eax
addl $0x1, %eax
cltq
movabsq $0xfffffffffffffff, %rcx # imm = 0xFFFFFFFFFFFFFFF
cmpq %rcx, %rax
jbe 0x244c0
movq 0x40(%rsp), %rdi
callq 0x18150
jmp 0x244c2
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rax
movq 0x18(%rax), %rsi
movslq 0x28(%rsp), %rdx
shlq $0x4, %rdx
movslq 0x34(%rsp), %rcx
shlq $0x4, %rcx
callq 0x18170
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x18(%rax)
movl 0x24(%rsp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x2c(%rsp)
jl 0x24580
movq 0x18(%rsp), %rax
movslq 0x2c(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpl $0x0, 0x8(%rax)
je 0x24571
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq $0x10, %rdx
callq 0x24890
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)
jmp 0x24573
movl 0x2c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x24505
leaq 0x12881(%rip), %rax     # 0x36e08
cmpq %rax, 0x18(%rsp)
je 0x245b2
movq 0x40(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl 0x24(%rsp), %ecx
movl $0x1, %eax
shll %cl, %eax
cltq
imulq $0x28, %rax, %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x18170
addq $0x48, %rsp
retq
nopw (%rax,%rax)