// File: /workspace/github_cpp_makefile_star2_O1/night-shift[P]Srl/include/Srl/Hash.hpp
// Function: Srl::Lib::HTable<Srl::String, Srl::String, Srl::Lib::HashSrl<Srl::String, void>>::redistribute()
void HTable<K, V, H>::redistribute()
    {
        if(this->limit == 0) {
            /* initial allocation */
            this->set_capacity(this->cap);
            this->table = this->alloc_table(this->cap);

            return;
        }

        auto old_dim = this->cap;
        this->set_capacity(this->cap * 2);

        auto* ntable = alloc_table(this->cap);

        for(auto i = 0U; i < old_dim; i++) {
            auto* entry = table[i];
            while(entry) {
                auto bucket = get_bucket(entry->hash);
                auto* slot = ntable[bucket];

                if(!slot) {
                    ntable[bucket] = entry;

                } else while(true) {
                    if(!slot->next) {
                        slot->next = entry;
                        break;
                    }
                    slot = slot->next;
                }

                auto* tmp = entry;
                entry = entry->next;
                tmp->next = nullptr;
            }
        }

        this->heap.put_mem((uint8_t*)this->table, old_dim * sizeof(nullptr));
        this->table = ntable;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x10(%rdi)
movq 0x8(%rdi), %r14
je 0xf447
leaq (%r14,%r14), %rsi
cmpq $0x1, %rsi
movq %rsi, %xmm0
adcq $0x0, %rsi
movq %rsi, 0x8(%rbx)
movq 0x18(%rbx), %rax
punpckldq 0xfcb5(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xfcbd(%rip), %xmm0     # 0x1f010
addq $0xa, %rax
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd (%rbx), %xmm1
cvttsd2si %xmm1, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
subsd 0xfca5(%rip), %xmm1     # 0x1f020
cvttsd2si %xmm1, %rdi
andq %rdx, %rdi
orq %rcx, %rdi
cmpq %rdi, %rax
cmovaq %rax, %rdi
movq %rdi, 0x10(%rbx)
leaq 0x48(%rbx), %r15
movq %r15, %rdi
callq 0xb340
movq %rax, %r12
movq 0x8(%rbx), %rdx
shlq $0x3, %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0xb420
testq %r14, %r14
je 0xf42b
movq 0x8(%rbx), %rcx
xorl %esi, %esi
movq %rcx, %rdi
shrq $0x20, %rdi
xorl %r8d, %r8d
movq 0x20(%rbx), %rax
movq (%rax,%r8,8), %r9
testq %r9, %r9
je 0xf423
movq (%r9), %rdx
movq %rdx, %rax
shrq $0x20, %rax
testq %rdi, %rdi
cmovneq %rsi, %rax
xorq %rdx, %rax
xorl %edx, %edx
divq %rcx
movq (%r12,%rdx,8), %r10
testq %r10, %r10
je 0xf408
movq %r10, %rax
movq 0x8(%r10), %r10
testq %r10, %r10
jne 0xf3f6
addq $0x8, %rax
jmp 0xf40c
leaq (%r12,%rdx,8), %rax
movq %r9, (%rax)
movq 0x8(%r9), %rax
movq $0x0, 0x8(%r9)
movq %rax, %r9
testq %rax, %rax
jne 0xf3d4
incl %r8d
cmpq %r8, %r14
ja 0xf3c7
movq 0x20(%rbx), %rsi
shlq $0x3, %r14
movq %r15, %rdi
movq %r14, %rdx
callq 0xb3c0
movq %r12, 0x20(%rbx)
jmp 0xf4cf
cmpq $0x1, %r14
movq %r14, %xmm0
adcq $0x0, %r14
movq %r14, 0x8(%rbx)
movq 0x18(%rbx), %rax
punpckldq 0xfb9c(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xfba4(%rip), %xmm0     # 0x1f010
addq $0xa, %rax
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd (%rbx), %xmm1
cvttsd2si %xmm1, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
subsd 0xfb8c(%rip), %xmm1     # 0x1f020
cvttsd2si %xmm1, %rsi
andq %rdx, %rsi
orq %rcx, %rsi
cmpq %rsi, %rax
cmovaq %rax, %rsi
movq %rsi, 0x10(%rbx)
leaq 0x48(%rbx), %rdi
movq %r14, %rsi
callq 0xb340
movq %rax, %r14
movq 0x8(%rbx), %rdx
shlq $0x3, %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0xb420
movq %r14, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop