// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/sparsepp/./sparsepp/spp.h
// Function: spp::sparsetable<std::pair<unsigned int const, unsigned int>, spp::libc_allocator<std::pair<unsigned int const, unsigned int>>>::resize(unsigned long)
void resize(size_type new_size)
    {
        group_size_type sz = num_groups(new_size);
        group_size_type old_sz = (group_size_type)(_last_group - _first_group);

        if (sz != old_sz)
        {
            // resize group array
            // ------------------
            group_type *first = 0, *last = 0;
            if (sz)
            {
                _alloc_group_array(sz, first, last);
                memcpy(first, _first_group, sizeof(*first) * (std::min)(sz, old_sz));
            }

            if (sz < old_sz)
            {
                for (group_type *g = _first_group + sz; g != _last_group; ++g)
                    g->destruct(_alloc);
            }
            else
                std::uninitialized_fill(first + old_sz, last, group_type());

            _free_group_array(_first_group, _last_group);
            _first_group = first;
            _last_group  = last;
        }
#if 0
        // used only in test program
        // todo: fix if sparsetable to be used directly
        // --------------------------------------------
        if (new_size < _table_size)
        {
            // lower num_buckets, clear last group
            if (pos_in_group(new_size) > 0)     // need to clear inside last group
                groups.back().erase(_alloc, groups.back().begin() + pos_in_group(new_size),
                                    groups.back().end());
            _num_buckets = 0;                   // refigure # of used buckets
            for (const group_type *group = _first_group; group != _last_group; ++group)
                _num_buckets += group->num_nonempty();
        }
#endif
        _table_size = new_size;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x1(%rsi), %r12
shrq $0x5, %r12
incq %r12
xorl %ebp, %ebp
cmpq $0x1, %rsi
cmovaeq %r12, %rbp
movq 0x8(%rdi), %r15
subq (%rdi), %r15
pushq $0x18
popq %rcx
movq %r15, %rax
cqto
idivq %rcx
cmpq %rax, %rbp
je 0x20b9
movq %rax, %r13
andq $0x0, (%rsp)
andq $0x0, 0x8(%rsp)
testq %rbx, %rbx
je 0x2045
movq %rsp, %rdx
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
movq %r12, %rsi
callq 0x1958
movq %rsp, %rax
movq (%rax), %rdi
movq (%r14), %rsi
cmpq %r12, %r13
cmovbq %r13, %r12
imulq $0x18, %r12, %rdx
callq 0x10b0
leaq 0x8(%r14), %r12
cmpq %r13, %rbp
jae 0x2070
imulq $0x18, %rbp, %r15
addq (%r14), %r15
leaq 0x21(%r14), %r13
cmpq (%r12), %r15
je 0x209b
movq %r15, %rdi
movq %r13, %rsi
callq 0x1682
addq $0x18, %r15
jmp 0x2059
addq (%rsp), %r15
movq 0x8(%rsp), %rsi
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
andw $0x0, 0x10(%rdx)
movq %r15, %rdi
callq 0x19b2
leaq 0x10(%rsp), %rdi
callq 0x198a
movq %r14, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x168c
movq (%rsp), %rax
movq %rax, (%r14)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%r14)
movq %rbx, 0x10(%r14)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x198a
movq %rbx, %rdi
callq 0x1150
nop