// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lstring.c
// Function: luaS_resize
void luaS_resize (lua_State *L, int newsize) {
  int i;
  stringtable *tb = &G(L)->strt;
  /* cannot resize while GC is traversing strings */
  luaC_runtilstate(L, ~bitmask(GCSsweepstring));
  if (newsize > tb->size) {
    luaM_reallocvector(L, tb->hash, tb->size, newsize, GCObject *);
    for (i = tb->size; i < newsize; i++) tb->hash[i] = NULL;
  }
  /* rehash */
  for (i=0; i<tb->size; i++) {
    GCObject *p = tb->hash[i];
    tb->hash[i] = NULL;
    while (p) {  /* for each node in the list */
      GCObject *next = gch(p)->next;  /* save next */
      unsigned int h = lmod(gco2ts(p)->hash, newsize);  /* new position */
      gch(p)->next = tb->hash[h];  /* chain it */
      tb->hash[h] = p;
      resetoldbit(p);  /* see MOVE OLD rule */
      p = next;
    }
  }
  if (newsize < tb->size) {
    /* shrinking slice must be empty */
    lua_assert(tb->hash[newsize] == NULL && tb->hash[tb->size - 1] == NULL);
    luaM_reallocvector(L, tb->hash, tb->size, newsize, GCObject *);
  }
  tb->size = newsize;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq 0x30(%rsp), %rax
movq 0x18(%rax), %rax
addq $0x30, %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rdi
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x132e0
movl 0x2c(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jle 0x20631
movl 0x2c(%rsp), %eax
addl $0x1, %eax
cltq
movabsq $0x1fffffffffffffff, %rcx # imm = 0x1FFFFFFFFFFFFFFF
cmpq %rcx, %rax
jbe 0x205c2
movq 0x30(%rsp), %rdi
callq 0x18150
jmp 0x205c4
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rax
movq (%rax), %rsi
movq 0x20(%rsp), %rax
movslq 0xc(%rax), %rdx
shlq $0x3, %rdx
movslq 0x2c(%rsp), %rcx
shlq $0x3, %rcx
callq 0x18170
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, 0x28(%rsp)
movl 0x28(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jge 0x2062f
movq 0x20(%rsp), %rax
movq (%rax), %rax
movslq 0x28(%rsp), %rcx
movq $0x0, (%rax,%rcx,8)
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x20603
jmp 0x20631
movl $0x0, 0x28(%rsp)
movl 0x28(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x206fd
movq 0x20(%rsp), %rax
movq (%rax), %rax
movslq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movslq 0x28(%rsp), %rcx
movq $0x0, (%rax,%rcx,8)
cmpq $0x0, 0x18(%rsp)
je 0x206eb
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movl 0xc(%rax), %eax
movl 0x2c(%rsp), %ecx
subl $0x1, %ecx
andl %ecx, %eax
movl %eax, 0xc(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl 0xc(%rsp), %ecx
movq (%rax,%rcx,8), %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl 0xc(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x18(%rsp), %rax
movzbl 0x9(%rax), %ecx
andl $0xbf, %ecx
movb %cl, 0x9(%rax)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x20676
jmp 0x206ed
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x20639
movl 0x2c(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x20762
movl 0x2c(%rsp), %eax
addl $0x1, %eax
cltq
movabsq $0x1fffffffffffffff, %rcx # imm = 0x1FFFFFFFFFFFFFFF
cmpq %rcx, %rax
jbe 0x2072d
movq 0x30(%rsp), %rdi
callq 0x18150
jmp 0x2072f
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rax
movq (%rax), %rsi
movq 0x20(%rsp), %rax
movslq 0xc(%rax), %rdx
shlq $0x3, %rdx
movslq 0x2c(%rsp), %rcx
shlq $0x3, %rcx
callq 0x18170
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movl 0x2c(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0xc(%rax)
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)