// File: 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
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, 0x80(%rax)
je 0x5cb7
jmp 0x5cd6
leaq 0x3e2c(%rip), %rdi      # 0x9aea
leaq 0x3a15(%rip), %rsi      # 0x96da
movl $0x2a5, %edx            # imm = 0x2A5
leaq 0x3e2f(%rip), %rcx      # 0x9b00
callq 0x20a0
movq -0x40(%rbp), %rax
movq 0x80(%rax), %rax
movq %rax, -0x48(%rbp)
callq 0x20e0
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
jne 0x5cf8
jmp 0x5d17
leaq 0x3ffa(%rip), %rdi      # 0x9cf9
leaq 0x39d4(%rip), %rsi      # 0x96da
movl $0x2a6, %edx            # imm = 0x2A6
leaq 0x3dee(%rip), %rcx      # 0x9b00
callq 0x20a0
xorl %eax, %eax
cmpq $0x0, -0x10(%rbp)
movb %al, -0x49(%rbp)
je 0x5d36
movq -0x10(%rbp), %rdi
callq 0x6300
cmpq $0x0, %rax
sete %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x5d3f
jmp 0x5d41
jmp 0x5d60
leaq 0x3e32(%rip), %rdi      # 0x9b7a
leaq 0x398b(%rip), %rsi      # 0x96da
movl $0x2aa, %edx            # imm = 0x2AA
leaq 0x3da5(%rip), %rcx      # 0x9b00
callq 0x20a0
movq -0x10(%rbp), %rsi
leaq -0x18(%rbp), %rdi
callq 0x6320
leaq -0x18(%rbp), %rdi
callq 0x53c0
movq -0x40(%rbp), %rcx
cmpq %rcx, %rax
jne 0x5d81
jmp 0x5da0
leaq 0x3e33(%rip), %rdi      # 0x9bbb
leaq 0x394b(%rip), %rsi      # 0x96da
movl $0x2ab, %edx            # imm = 0x2AB
leaq 0x3d65(%rip), %rcx      # 0x9b00
callq 0x20a0
leaq -0x18(%rbp), %rdi
callq 0x4300
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0x5dd8
movq -0x58(%rbp), %rdi
leaq 0x8d0e(%rip), %rsi      # 0xead0
leaq 0x8d17(%rip), %rdx      # 0xeae0
xorl %eax, %eax
movl %eax, %ecx
callq 0x2110
movq %rax, -0x60(%rbp)
jmp 0x5de0
xorl %eax, %eax
movq %rax, -0x60(%rbp)
jmp 0x5de0
movq -0x60(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x5df1
jmp 0x5e10
leaq 0x3df9(%rip), %rdi      # 0x9bf1
leaq 0x38db(%rip), %rsi      # 0x96da
movl $0x2ae, %edx            # imm = 0x2AE
leaq 0x3cf5(%rip), %rcx      # 0x9b00
callq 0x20a0
movq -0x40(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x64(%rbp)
testl %eax, %eax
je 0x5e34
jmp 0x5e20
movl -0x64(%rbp), %eax
subl $0x1, %eax
je 0x5e36
jmp 0x5e2a
movl -0x64(%rbp), %eax
subl $0x2, %eax
je 0x5e42
jmp 0x5e53
jmp 0x5e53
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x5e53
movq -0x40(%rbp), %rdi
addq $0x10, %rdi
movq -0x20(%rbp), %rsi
callq 0x6350
movq -0x40(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb $0x1, %al
jne 0x5ea7
movq -0x40(%rbp), %rcx
movb $0x1, %al
cmpq $0x0, 0x50(%rcx)
movb %al, -0x65(%rbp)
jne 0x5e7b
movq -0x40(%rbp), %rax
movb 0x58(%rax), %al
movb %al, -0x65(%rbp)
movb -0x65(%rbp), %al
testb $0x1, %al
jne 0x5e84
jmp 0x5e86
jmp 0x5ea5
leaq 0x3d75(%rip), %rdi      # 0x9c02
leaq 0x3846(%rip), %rsi      # 0x96da
movl $0x2c7, %edx            # imm = 0x2C7
leaq 0x3c60(%rip), %rcx      # 0x9b00
callq 0x20a0
jmp 0x5ea7
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rdi
movq 0x50(%rax), %rsi
callq 0x6390
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x50(%rax)
movq 0x60(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x60(%rax)
cmpq $0x0, 0x68(%rax)
jbe 0x5ed9
jmp 0x5ef8
leaq 0x3d55(%rip), %rdi      # 0x9c35
leaq 0x37f3(%rip), %rsi      # 0x96da
movl $0x2cf, %edx            # imm = 0x2CF
leaq 0x3c0d(%rip), %rcx      # 0x9b00
callq 0x20a0
movq -0x40(%rbp), %rax
movq 0x68(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x68(%rax)
movq -0x10(%rbp), %rdi
callq 0x51e0
movq -0x40(%rbp), %rax
testb $0x1, 0x78(%rax)
je 0x5f6a
movq -0x20(%rbp), %rax
movq %rax, -0x78(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
movq %rdi, -0x70(%rbp)
movl $0x1, %edx
callq 0x43b0
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x63b0
jmp 0x5f48
leaq -0x28(%rbp), %rdi
callq 0x4300
jmp 0x5f6a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4300
jmp 0x5f73
addq $0x80, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x2190
nopl (%rax)