// File: /workspace/github_c_makefile_star2_O3/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 %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movl 0xc(%rsi), %ebp
movzbl 0xb(%rsi), %r13d
movq 0x18(%rsi), %rax
movq %rax, 0x8(%rsp)
movl %edx, %r12d
cmpl %edx, %ebp
jae 0xfe32
movl %ecx, 0x4(%rsp)
movq 0x10(%r15), %rsi
movq %rbp, %rdx
shlq $0x4, %rdx
movq %r12, %rcx
shlq $0x4, %rcx
movq %rbx, %rdi
callq 0xb897
movq %rax, 0x10(%r15)
movl 0xc(%r15), %edx
cmpl %r14d, %edx
jae 0xfe2a
movq %r12, %rsi
subq %rdx, %rsi
leaq 0x3(%rsi), %rcx
andq $-0x4, %rcx
decq %rsi
movq %rsi, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shlq $0x4, %rdx
addq %rdx, %rax
addq $0x38, %rax
xorl %edx, %edx
movdqa 0x1238c(%rip), %xmm1    # 0x220e0
movdqa 0x12394(%rip), %xmm2    # 0x220f0
movdqa 0x1239c(%rip), %xmm3    # 0x22100
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 0xfdb6
movl $0x0, -0x30(%rax)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0xfdcc
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 0xfe08
movl $0x0, -0x10(%rax)
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0xfe19
movl $0x0, (%rax)
addq $0x4, %rdx
addq $0x40, %rax
cmpq %rdx, %rcx
jne 0xfd6c
movl %r14d, 0xc(%r15)
movl 0x4(%rsp), %ecx
movq %rbx, %rdi
movq %r15, %rsi
movl %ecx, %edx
callq 0xff53
cmpl %r14d, %ebp
jbe 0xfeb9
movl %r13d, 0x4(%rsp)
movl %r14d, 0xc(%r15)
movq %r12, %r13
movq %rbp, %r12
negq %r12
leaq 0x1(%r13), %r14
movq %r13, 0x10(%rsp)
shlq $0x4, %r13
movq 0x10(%r15), %rcx
cmpl $0x0, 0x8(%rcx,%r13)
je 0xfe80
addq %r13, %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x10000
leaq (%r12,%r14), %rax
incq %rax
incq %r14
addq $0x10, %r13
cmpq $0x1, %rax
jne 0xfe63
movq 0x10(%r15), %rsi
shlq $0x4, %rbp
movq 0x10(%rsp), %rcx
shlq $0x4, %rcx
movq %rbx, %rdi
movq %rbp, %rdx
callq 0xb897
movq %rax, 0x10(%r15)
movl 0x4(%rsp), %r13d
movl $0x1, %r12d
movl %r13d, %ecx
shll %cl, %r12d
cmpl $0x1f, %r13d
je 0xff14
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 0xff09
leaq -0x10(%r14), %r13
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1005a
movdqu (%r13), %xmm0
movdqu %xmm0, (%rax)
decl %ebp
addq $-0x20, %r14
cmpl $0x1, %ebp
jg 0xfee6
leaq 0x12d9d(%rip), %rax     # 0x22cb8
movq 0x8(%rsp), %rsi
cmpq %rax, %rsi
je 0xff44
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 0xb897
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq