// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %rax
movq 0x80(%rdi), %r15
testq %r15, %r15
je 0x42b8
movq %rsi, %r14
movq %rdi, %rbx
callq 0x20d0
cmpq %rax, %r15
jne 0x42d7
testq %r14, %r14
je 0x427a
cmpq $0x0, 0x10(%r14)
jne 0x427a
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x4299
movl 0x8(%rdi), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x8(%rdi)
cmpq %rbx, %rdi
jne 0x4299
movl %eax, 0x8(%rdi)
testl %eax, %eax
jne 0x41a4
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x699d(%rip), %rsi      # 0xab48
leaq 0x69a6(%rip), %rdx      # 0xab58
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x20f0
testq %rax, %rax
je 0x42f6
movq %rax, %r15
movl 0xc(%rbx), %eax
cmpl $0x2, %eax
je 0x41e0
cmpl $0x1, %eax
jne 0x41f5
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
jmp 0x41f5
cmpq $0x0, 0x20(%rbx)
je 0x4353
leaq 0x10(%rbx), %rdi
movq %r15, %rsi
callq *0x28(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq 0x50(%rbx), %rcx
testq %rcx, %rcx
setne %dl
orb %al, %dl
jne 0x4216
cmpb $0x0, 0x58(%rbx)
je 0x4334
movq %rcx, 0x10(%r14)
movq %r14, 0x50(%rbx)
incq 0x60(%rbx)
movq 0x68(%rbx), %rax
testq %rax, %rax
je 0x4315
decq %rax
movq %rax, 0x68(%rbx)
movq %r14, %rdi
callq 0x3c00
cmpb $0x1, 0x78(%rbx)
jne 0x426f
leaq -0x20(%rbp), %rsi
movq $0x0, (%rsi)
addq $0x18, %r15
movq %r15, %rdi
callq 0x4466
movq -0x20(%rbp), %rdi
testq %rdi, %rdi
je 0x426f
decl 0x8(%rdi)
jne 0x426f
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28c2(%rip), %rdi      # 0x6b43
leaq 0x241b(%rip), %rsi      # 0x66a3
leaq 0x283a(%rip), %rcx      # 0x6ac9
movl $0x2aa, %edx            # imm = 0x2AA
callq 0x2080
leaq 0x28e4(%rip), %rdi      # 0x6b84
leaq 0x23fc(%rip), %rsi      # 0x66a3
leaq 0x281b(%rip), %rcx      # 0x6ac9
movl $0x2ab, %edx            # imm = 0x2AB
callq 0x2080
leaq 0x27f4(%rip), %rdi      # 0x6ab3
leaq 0x23dd(%rip), %rsi      # 0x66a3
leaq 0x27fc(%rip), %rcx      # 0x6ac9
movl $0x2a5, %edx            # imm = 0x2A5
callq 0x2080
leaq 0x29e4(%rip), %rdi      # 0x6cc2
leaq 0x23be(%rip), %rsi      # 0x66a3
leaq 0x27dd(%rip), %rcx      # 0x6ac9
movl $0x2a6, %edx            # imm = 0x2A6
callq 0x2080
leaq 0x28bd(%rip), %rdi      # 0x6bba
leaq 0x239f(%rip), %rsi      # 0x66a3
leaq 0x27be(%rip), %rcx      # 0x6ac9
movl $0x2ae, %edx            # imm = 0x2AE
callq 0x2080
leaq 0x28e2(%rip), %rdi      # 0x6bfe
leaq 0x2380(%rip), %rsi      # 0x66a3
leaq 0x279f(%rip), %rcx      # 0x6ac9
movl $0x2cf, %edx            # imm = 0x2CF
callq 0x2080
leaq 0x2890(%rip), %rdi      # 0x6bcb
leaq 0x2361(%rip), %rsi      # 0x66a3
leaq 0x2780(%rip), %rcx      # 0x6ac9
movl $0x2c7, %edx            # imm = 0x2C7
callq 0x2080
callq 0x2060
movq %rax, %rbx
movq -0x20(%rbp), %rdi
testq %rdi, %rdi
je 0x4369
callq 0x21e4
movq %rbx, %rdi
callq 0x21a0
nop