// File: attractivechaos[P]udb2/sparsepp/./sparsepp/spp.h
// Function: spp::sparse_hashtable<std::pair<unsigned int const, unsigned int>, unsigned int, Hash32, spp::sparse_hash_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, spp::libc_allocator<std::pair<unsigned int const, unsigned int>>>::SelectKey, spp::sparse_hash_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, spp::libc_allocator<std::pair<unsigned int const, unsigned int>>>::SetKey, std::equal_to<unsigned int>, spp::libc_allocator<std::pair<unsigned int const, unsigned int>>>::_maybe_shrink()
bool _maybe_shrink()
    {
        assert((bucket_count() & (bucket_count()-1)) == 0); // is a power of two
        assert(bucket_count() >= HT_MIN_BUCKETS);
        bool retval = false;

        // If you construct a hashtable with < HT_DEFAULT_STARTING_BUCKETS,
        // we'll never shrink until you get relatively big, and we'll never
        // shrink below HT_DEFAULT_STARTING_BUCKETS.  Otherwise, something
        // like "dense_hash_set<int> x; x.insert(4); x.erase(4);" will
        // shrink us down to HT_MIN_BUCKETS buckets, which is too small.
        // ---------------------------------------------------------------
        const size_type num_remain = table.num_nonempty();
        const size_type shrink_threshold = settings.shrink_threshold();
        if (shrink_threshold > 0 && num_remain < shrink_threshold &&
            bucket_count() > HT_DEFAULT_STARTING_BUCKETS)
        {
            const float shrink_factor = settings.shrink_factor();
            size_type sz = (size_type)(bucket_count() / 2);    // find how much we should shrink
            while (sz > HT_DEFAULT_STARTING_BUCKETS &&
                   num_remain < static_cast<size_type>(sz * shrink_factor))
            {
                sz /= 2;                            // stay a power of 2
            }
            sparse_hashtable tmp(MoveDontCopy, *this, sz);
            swap(tmp);                            // now we are tmp
            retval = true;
        }
        settings.set_consider_shrink(false);   // because we just considered it
        return retval;
    }

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xc0(%rsp)
movq 0xc0(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x1fa0
movq 0x20(%rsp), %rdi
movq %rax, 0x28(%rsp)
callq 0x1fa0
movq %rax, %rcx
movq 0x28(%rsp), %rax
subq $0x1, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
jne 0x2cb7
jmp 0x2cd6
leaq 0x3646(%rip), %rdi      # 0x6304
leaq 0x33fa(%rip), %rsi      # 0x60bf
movl $0xa61, %edx            # imm = 0xA61
leaq 0x365e(%rip), %rcx      # 0x632f
callq 0x10c0
movq 0x20(%rsp), %rdi
callq 0x1fa0
cmpq $0x4, %rax
jb 0x2ce8
jmp 0x2d07
leaq 0x3900(%rip), %rdi      # 0x65ef
leaq 0x33c9(%rip), %rsi      # 0x60bf
movl $0xa62, %edx            # imm = 0xA62
leaq 0x362d(%rip), %rcx      # 0x632f
callq 0x10c0
movq 0x20(%rsp), %rdi
movb $0x0, 0xbf(%rsp)
addq $0x30, %rdi
callq 0x2ef0
movq 0x20(%rsp), %rdi
movq %rax, 0xb0(%rsp)
callq 0x30c0
movq %rax, 0xa8(%rsp)
cmpq $0x0, 0xa8(%rsp)
jbe 0x2ec0
movq 0xb0(%rsp), %rax
cmpq 0xa8(%rsp), %rax
jae 0x2ec0
movq 0x20(%rsp), %rdi
callq 0x1fa0
cmpq $0x20, %rax
jbe 0x2ec0
movq 0x20(%rsp), %rdi
callq 0x30d0
movq 0x20(%rsp), %rdi
movss %xmm0, 0xa4(%rsp)
callq 0x1fa0
shrq %rax
movq %rax, 0x98(%rsp)
xorl %eax, %eax
cmpq $0x20, 0x98(%rsp)
movb %al, 0x1f(%rsp)
jbe 0x2e43
movq 0xb0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x98(%rsp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x14(%rsp)
testq %rax, %rax
movss %xmm0, 0x18(%rsp)
js 0x2dfb
movss 0x14(%rsp), %xmm0
movss %xmm0, 0x18(%rsp)
movq 0x8(%rsp), %rax
movss 0x18(%rsp), %xmm0
movss 0xa4(%rsp), %xmm1
mulss %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttss2si %xmm1, %rcx
movq %rcx, %rsi
sarq $0x3f, %rsi
movss 0x31fe(%rip), %xmm1     # 0x6028
subss %xmm1, %xmm0
cvttss2si %xmm0, %rdx
andq %rsi, %rdx
orq %rdx, %rcx
cmpq %rcx, %rax
setb %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x2e4d
jmp 0x2e65
movq 0x98(%rsp), %rax
shrq %rax
movq %rax, 0x98(%rsp)
jmp 0x2d98
movq 0x20(%rsp), %rdx
movq 0x98(%rsp), %rcx
leaq 0x40(%rsp), %rdi
movq %rdi, (%rsp)
xorl %esi, %esi
callq 0x2f20
movq 0x20(%rsp), %rdi
movq (%rsp), %rsi
callq 0x3010
jmp 0x2e92
movb $0x1, 0xbf(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x1960
jmp 0x2ec0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x1960
jmp 0x2edd
movq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x2750
movb 0xbf(%rsp), %al
andb $0x1, %al
addq $0xc8, %rsp
retq
movq 0x38(%rsp), %rdi
callq 0x11a0
nopw (%rax,%rax)