// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/ltable.c
// Function: luaH_resize
void luaH_resize (lua_State *L, Table *t, unsigned int nasize,
                                          unsigned int nhsize) {
  unsigned int i;
  int j;
  unsigned 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 (j = twoto(oldhsize) - 1; j >= 0; j--) {
    Node *old = nold + j;
    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 hash */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movl 0xc(%rsi), %r13d
movzbl 0xb(%rsi), %eax
movl %eax, 0x4(%rsp)
movq 0x18(%rsi), %rax
movq %rax, 0x8(%rsp)
movl %edx, %r12d
cmpl %edx, %r13d
jae 0xf80c
movq 0x10(%r15), %rsi
movq %r13, %rdx
shlq $0x4, %rdx
movq %r12, %rcx
shlq $0x4, %rcx
movq %rbx, %rdi
callq 0xb3eb
movq %rax, 0x10(%r15)
movl 0xc(%r15), %edx
cmpl %r14d, %edx
jae 0xf808
movq %r12, %rcx
subq %rdx, %rcx
shlq $0x4, %rdx
addq %rdx, %rax
addq $0x8, %rax
movl $0x0, (%rax)
addq $0x10, %rax
decq %rcx
jne 0xf7f9
movl %r14d, 0xc(%r15)
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0xf921
cmpl %r14d, %r13d
jbe 0xf889
movl %r14d, 0xc(%r15)
leaq 0x1(%r12), %r14
movq %r12, 0x10(%rsp)
movq %r12, %rbp
shlq $0x4, %rbp
movq %r13, %r12
negq %r12
movq 0x10(%r15), %rcx
cmpl $0x0, 0x8(%rcx,%rbp)
je 0xf855
addq %rbp, %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xf9cb
addq $0x10, %rbp
leaq (%r12,%r14), %rax
incq %rax
incq %r14
cmpq $0x1, %rax
jne 0xf839
movq 0x10(%r15), %rsi
shlq $0x4, %r13
movq 0x10(%rsp), %rcx
shlq $0x4, %rcx
movq %rbx, %rdi
movq %r13, %rdx
callq 0xb3eb
movq %rax, 0x10(%r15)
movl $0x1, %r12d
movl 0x4(%rsp), %ecx
shll %cl, %r12d
cmpl $0x1f, %ecx
je 0xf8e2
leal 0x1(%r12), %ebp
leal -0x1(%r12), %eax
shlq $0x5, %rax
movq 0x8(%rsp), %rcx
leaq (%rax,%rcx), %r14
addq $0x10, %r14
cmpl $0x0, -0x8(%r14)
je 0xf8d7
leaq -0x10(%r14), %r13
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xfa25
movups (%r13), %xmm0
movups %xmm0, (%rax)
decl %ebp
addq $-0x20, %r14
cmpl $0x1, %ebp
jg 0xf8b6
leaq 0x1235f(%rip), %rax     # 0x21c48
movq 0x8(%rsp), %rsi
cmpq %rax, %rsi
je 0xf912
movslq %r12d, %rdx
shlq $0x5, %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb3eb
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq