// File: /workspace/github_cpp_makefile_star2_O2/f18m[P]boost-intrusive-pool/include/boost_intrusive_pool.hpp
// Function: memorypool::boost_intrusive_pool<DummyClass>::impl::recycle(memorypool::boost_intrusive_pool_item*)
virtual void recycle(boost_intrusive_pool_item* pitem_base) override
        {
#if BOOST_INTRUSIVE_POOL_DEBUG_THREAD_ACCESS
            assert(m_allowed_thread != 0);
            assert(m_allowed_thread == pthread_self());
#endif
            assert(pitem_base
                && pitem_base->_refcounted_item_get_next()
                    == nullptr); // Recycling an item that has been already recycled?
            assert(pitem_base->_refcounted_item_get_pool().get() == this);

            Item* pitem = dynamic_cast<Item*>(pitem_base); // downcast (base class -> derived class)
            assert(pitem != nullptr); // we always allocate all items of the same type,
                                      // so the dynamic cast cannot fail
            switch (m_recycle_method) {
            case RECYCLE_METHOD_NONE:
                break;

            case RECYCLE_METHOD_DESTROY_FUNCTION:
                pitem->destroy();
                break;

            case RECYCLE_METHOD_CUSTOM_FUNCTION:
                m_recycle_fn(*pitem);
                break;

                // the big problem with using the class destructor is that the virtual table of the item will
                // be destroyed; attempting to dynamic_cast<> the item later will fail (NULL returned).
                // so this recycling option is disabled for now
                // case RECYCLE_METHOD_DTOR:
                // Destroy the object using its dtor:
                // pitem->Item::~Item();
                // break;
            }

            // sanity check:
            if (!is_bounded()) {
                assert(m_first_free_item != nullptr || m_memory_exhausted);
            }

            // Add the item at the beginning of the free list.
            pitem_base->_refcounted_item_set_next(m_first_free_item);
            m_first_free_item = pitem_base;
            m_free_count++;

            assert(m_inuse_count > 0);
            m_inuse_count--;

#if BOOST_INTRUSIVE_POOL_DEBUG_CHECKS
            pitem_base->check();
#endif

            // test for self-destruction:
            // is this an orphan pool (i.e. a pool without any boost_intrusive_pool<> associated to it anymore)?
            if (m_trigger_self_destruction) {
                // in such case break the link between the items being recycled and this pool:
                // in this way the very last memory-pooled item returning to this pool will lower the refcount
                // to this pool to zero, and impl::~impl() will get called, freeing all arenas!
                pitem->_refcounted_item_set_pool(nullptr);
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq 0x80(%rdi), %r15
testq %r15, %r15
je 0x3be1
movq %rsi, %r14
movq %rdi, %rbx
callq 0x20e0
cmpq %rax, %r15
jne 0x3c00
testq %r14, %r14
je 0x3bc2
cmpq $0x0, 0x10(%r14)
jne 0x3bc2
movq 0x18(%r14), %rax
movq %rax, -0x28(%rbp)
testq %rax, %rax
je 0x3af1
incl 0x8(%rax)
cmpq %rbx, %rax
jne 0x3c1f
leaq -0x28(%rbp), %rdi
callq 0x32a2
leaq 0x6036(%rip), %rsi      # 0x9b40
leaq 0x603f(%rip), %rdx      # 0x9b50
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x2100
testq %rax, %rax
je 0x3c3e
movq %rax, %r15
movl 0xc(%rbx), %eax
cmpl $0x2, %eax
je 0x3b3f
cmpl $0x1, %eax
jne 0x3b4b
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
jmp 0x3b4b
leaq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x3d9e
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq 0x50(%rbx), %rcx
testq %rcx, %rcx
setne %dl
orb %al, %dl
jne 0x3b6c
cmpb $0x0, 0x58(%rbx)
je 0x3c7c
movq %rcx, 0x10(%r14)
movq %r14, 0x50(%rbx)
incq 0x60(%rbx)
movq 0x68(%rbx), %rax
testq %rax, %rax
je 0x3c5d
decq %rax
movq %rax, 0x68(%rbx)
movq %r14, %rdi
callq 0x3584
cmpb $0x1, 0x78(%rbx)
jne 0x3bb7
leaq -0x20(%rbp), %rsi
andq $0x0, (%rsi)
addq $0x18, %r15
movq %r15, %rdi
callq 0x3db4
leaq -0x20(%rbp), %rdi
callq 0x32a2
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f7a(%rip), %rdi      # 0x5b43
leaq 0x1ad3(%rip), %rsi      # 0x56a3
leaq 0x1ef2(%rip), %rcx      # 0x5ac9
movl $0x2aa, %edx            # imm = 0x2AA
callq 0x2090
leaq 0x1ecb(%rip), %rdi      # 0x5ab3
leaq 0x1ab4(%rip), %rsi      # 0x56a3
leaq 0x1ed3(%rip), %rcx      # 0x5ac9
movl $0x2a5, %edx            # imm = 0x2A5
callq 0x2090
leaq 0x20bb(%rip), %rdi      # 0x5cc2
leaq 0x1a95(%rip), %rsi      # 0x56a3
leaq 0x1eb4(%rip), %rcx      # 0x5ac9
movl $0x2a6, %edx            # imm = 0x2A6
callq 0x2090
leaq 0x1f5e(%rip), %rdi      # 0x5b84
leaq 0x1a76(%rip), %rsi      # 0x56a3
leaq 0x1e95(%rip), %rcx      # 0x5ac9
movl $0x2ab, %edx            # imm = 0x2AB
callq 0x2090
leaq 0x1f75(%rip), %rdi      # 0x5bba
leaq 0x1a57(%rip), %rsi      # 0x56a3
leaq 0x1e76(%rip), %rcx      # 0x5ac9
movl $0x2ae, %edx            # imm = 0x2AE
callq 0x2090
leaq 0x1f9a(%rip), %rdi      # 0x5bfe
leaq 0x1a38(%rip), %rsi      # 0x56a3
leaq 0x1e57(%rip), %rcx      # 0x5ac9
movl $0x2cf, %edx            # imm = 0x2CF
callq 0x2090
leaq 0x1f48(%rip), %rdi      # 0x5bcb
leaq 0x1a19(%rip), %rsi      # 0x56a3
leaq 0x1e38(%rip), %rcx      # 0x5ac9
movl $0x2c7, %edx            # imm = 0x2C7
callq 0x2090
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
callq 0x32a2
movq %rbx, %rdi
callq 0x2190
nop