// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/lua-5.1.5/src/ltable.c
// Function: resize
static void 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])))
        setobjt2t(L, luaH_setnum(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))))
      setobjt2t(L, luaH_set(L, t, key2tval(old)), gval(old));
  }
  if (nold != dummynode)
    luaM_freearray(L, nold, twoto(oldhsize), Node);  /* free old array */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %r13d
movq %rsi, %r15
movq %rdi, %rbx
movslq 0x38(%rsi), %r12
movzbl 0xb(%rsi), %r14d
movq 0x20(%rsi), %rbp
cmpl %edx, %r12d
jge 0x5f5a2
movq %rbx, %rdi
movq %r15, %rsi
movl %r13d, %edx
movl %ecx, (%rsp)
callq 0x5f700
movl (%rsp), %ecx
movq %rbx, %rdi
movq %r15, %rsi
movl %ecx, %edx
callq 0x5f859
cmpl %r13d, %r12d
jle 0x5f656
movl %r14d, 0xc(%rsp)
movq %rbp, 0x20(%rsp)
movl %r13d, 0x38(%r15)
movslq %r13d, %rax
movq %r13, (%rsp)
leal 0x1(%r13), %ebp
shlq $0x4, %rax
movq %rax, 0x10(%rsp)
leaq 0x8(%rax), %r14
movq %r12, 0x18(%rsp)
negl %r12d
movq 0x18(%r15), %r13
cmpl $0x0, (%r13,%r14)
je 0x5f60f
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x592ee
movq -0x8(%r13,%r14), %rcx
movq %rcx, (%rax)
movl (%r13,%r14), %ecx
movl %ecx, 0x8(%rax)
addq $0x10, %r14
leal (%r12,%rbp), %eax
incl %eax
movl %ebp, %ecx
incl %ecx
movl %ecx, %ebp
cmpl $0x1, %eax
jne 0x5f5e6
cmpl $-0x1, (%rsp)
jl 0x5f6ef
movq 0x18(%r15), %rsi
movq 0x18(%rsp), %rdx
shlq $0x4, %rdx
movq %rbx, %rdi
movq 0x10(%rsp), %rcx
callq 0x5d2f2
movq %rax, 0x18(%r15)
movq 0x20(%rsp), %rbp
movl 0xc(%rsp), %r14d
movl $0x1, %r12d
movl %r14d, %ecx
shll %cl, %r12d
cmpl $0x1f, %r14d
movq %rbp, %r13
je 0x5f6b2
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 0x5f6a7
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x59204
movq -0x10(%r14), %rcx
movq %rcx, (%rax)
movl -0x8(%r14), %ecx
movl %ecx, 0x8(%rax)
decl %ebp
addq $-0x28, %r14
cmpl $0x1, %ebp
jg 0x5f684
leaq 0x8e08f(%rip), %rax     # 0xed748
cmpq %rax, %r13
je 0x5f6e0
movslq %r12d, %rax
shlq $0x3, %rax
leaq (%rax,%rax,4), %r14
movq 0x20(%rbx), %rbx
movq 0x18(%rbx), %rdi
movq %r13, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq *0x10(%rbx)
subq %r14, 0x78(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8e6d8(%rip), %rsi     # 0xeddce
movq %rbx, %rdi
xorl %eax, %eax
callq 0x57b1c