// File: /workspace/github_cpp_makefile_star2_O2/f18m[P]boost-intrusive-pool/tests/unit_tests.cpp
// Function: test_api()
void test_api()
{
    {
        uint32_t recycled = 0;
        boost_intrusive_pool<dummy_one> pool;

        BOOST_REQUIRE(pool.init());

        auto recycle_fn = [&recycled](dummy_one& object) {
            BOOST_REQUIRE(object.m_count > 0);
            object.m_count--;
            ++recycled;
        };

        pool.set_recycle_method(RECYCLE_METHOD_CUSTOM_FUNCTION, recycle_fn);

        BOOST_REQUIRE_EQUAL(pool.unused_count(), BOOST_INTRUSIVE_POOL_DEFAULT_POOL_SIZE);

        {
            auto d1 = pool.allocate();
            BOOST_REQUIRE_EQUAL(pool.unused_count(), BOOST_INTRUSIVE_POOL_DEFAULT_POOL_SIZE - 1);
        }

        BOOST_REQUIRE_EQUAL(pool.unused_count(), BOOST_INTRUSIVE_POOL_DEFAULT_POOL_SIZE);

        auto d2 = pool.allocate();

        BOOST_REQUIRE_EQUAL(pool.unused_count(), BOOST_INTRUSIVE_POOL_DEFAULT_POOL_SIZE - 1);

        auto d3 = pool.allocate();

        BOOST_REQUIRE_EQUAL(pool.unused_count(), BOOST_INTRUSIVE_POOL_DEFAULT_POOL_SIZE - 2);

        // the dummy_one::m_count counter is off by 1 because above we called an allocate() and
        // then destroyed the "d1" pointer: that resulted in the item being recycled and dummy_one::~dummy_one
        // being called
        BOOST_REQUIRE_EQUAL(dummy_one::m_count, BOOST_INTRUSIVE_POOL_DEFAULT_POOL_SIZE - 1);

        {
            auto d4 = pool.allocate();
            BOOST_REQUIRE_EQUAL(pool.unused_count(), BOOST_INTRUSIVE_POOL_DEFAULT_POOL_SIZE - 3);
        }

        BOOST_REQUIRE_EQUAL(pool.unused_count(), BOOST_INTRUSIVE_POOL_DEFAULT_POOL_SIZE - 2);

        // FIXME FIXME THIS DOES NOT WORK CURRENTLY SINCE ALL SMART POINTER DTORS
        // ARE STILL ALIVE AT THIS POINT
        pool.clear();
        BOOST_REQUIRE_EQUAL(pool.unused_count(), 0U);
    }

    // BOOST_REQUIRE(dummy_one::m_count, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
andl $0x0, -0x7c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x32bfc
leaq 0x2b588(%rip), %r14     # 0x5282d
leaq -0x2c0(%rbp), %rsi
movq %r14, (%rsi)
leaq 0x2b58b(%rip), %r15     # 0x52841
movq %r15, 0x8(%rsi)
leaq 0x33957(%rip), %r12     # 0x5ac18
leaq -0x2b0(%rbp), %rcx
movq %r12, (%rcx)
movq %r12, 0x8(%rcx)
movl $0x150, %edx            # imm = 0x150
callq 0x1c49e
xorps %xmm0, %xmm0
leaq -0x140(%rbp), %r9
movaps %xmm0, (%r9)
movaps %xmm0, 0x10(%r9)
leaq -0x60(%rbp), %rdi
pushq $0x40
popq %rdx
movq %rdx, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x32c40
leaq -0x98(%rbp), %rdi
movb %al, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
leaq 0x2b7db(%rip), %rax     # 0x52af2
leaq -0x78(%rbp), %rbx
movq %rax, (%rbx)
leaq 0x2b7d8(%rip), %rax     # 0x52afd
movq %rax, 0x8(%rbx)
leaq -0x48(%rbp), %rsi
movb $0x0, 0x8(%rsi)
leaq 0x576d8(%rip), %rax     # 0x7ea10
addq $0x10, %rax
movq %rax, (%rsi)
leaq 0x5869a(%rip), %rax     # 0x7f9e0
movq %rax, 0x10(%rsi)
movq %rbx, 0x18(%rsi)
leaq -0x2a0(%rbp), %rdx
movq %r14, (%rdx)
movq %r15, 0x8(%rdx)
subq $0x10, %rsp
andq $0x0, (%rsp)
pushq $0x2
popq %r8
movl $0x150, %ecx            # imm = 0x150
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x18e5c
popq %rcx
popq %rdx
leaq -0x88(%rbp), %rdi
callq 0x35d22
leaq -0x140(%rbp), %rdi
callq 0x332be
leaq -0x160(%rbp), %rdx
andq $0x0, 0x8(%rdx)
leaq -0x7c(%rbp), %rax
movq %rax, (%rdx)
leaq 0x453c(%rip), %rax      # 0x2b8e8
movq %rax, 0x18(%rdx)
leaq 0x462d(%rip), %rax      # 0x2b9e4
movq %rax, 0x10(%rdx)
leaq -0x60(%rbp), %rdi
pushq $0x2
popq %rsi
callq 0x32d8c
leaq -0x160(%rbp), %rdi
callq 0x332be
leaq -0x290(%rbp), %rsi
movq %r14, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0x280(%rbp), %rcx
movq %r12, (%rcx)
movq %r12, 0x8(%rcx)
movl $0x15a, %edx            # imm = 0x15A
callq 0x1c49e
movb $0x0, -0x40(%rbp)
leaq 0x5764c(%rip), %r13     # 0x7ea50
addq $0x10, %r13
movq %r13, -0x48(%rbp)
leaq 0x585cd(%rip), %rax     # 0x7f9e0
movq %rax, -0x38(%rbp)
leaq 0x2aa7b(%rip), %rax     # 0x51e99
movq %rax, -0x30(%rbp)
movq %r14, -0x120(%rbp)
movq %r15, -0x118(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x32e1e
leaq -0x98(%rbp), %r9
movq %rax, (%r9)
movl $0x40, -0x78(%rbp)
subq $0x8, %rsp
leaq 0x2b6bd(%rip), %r10     # 0x52b12
leaq 0x2b6a2(%rip), %rax     # 0x52afe
leaq -0x48(%rbp), %rdi
leaq -0x120(%rbp), %rsi
pushq $0x2
popq %rcx
movl $0x15a, %edx            # imm = 0x15A
movl %ecx, %r8d
pushq %r10
pushq %rbx
pushq %rax
callq 0x3286b
addq $0x20, %rsp
leaq -0x98(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x32e3c
leaq -0x270(%rbp), %rsi
movq %r14, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0x260(%rbp), %rcx
movq %r12, (%rcx)
movq %r12, 0x8(%rcx)
movl $0x15e, %edx            # imm = 0x15E
callq 0x1c49e
movb $0x0, -0x40(%rbp)
movq %r13, -0x48(%rbp)
leaq 0x5851c(%rip), %rax     # 0x7f9e0
movq %rax, -0x38(%rbp)
leaq 0x2a9ca(%rip), %rax     # 0x51e99
movq %rax, -0x30(%rbp)
movq %r14, -0x110(%rbp)
movq %r15, -0x108(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x32e1e
movq %rax, (%rbx)
leaq -0x50(%rbp), %r10
movl $0x3f, (%r10)
subq $0x8, %rsp
leaq 0x2b614(%rip), %rax     # 0x52b17
leaq -0x48(%rbp), %rdi
leaq -0x110(%rbp), %rsi
pushq $0x2
popq %rcx
movl $0x15e, %edx            # imm = 0x15E
movl %ecx, %r8d
movq %rbx, %r9
pushq %rax
pushq %r10
leaq 0x2b5d8(%rip), %rax     # 0x52afe
pushq %rax
callq 0x3286b
addq $0x20, %rsp
leaq -0x98(%rbp), %rdi
callq 0x32ec2
leaq -0x250(%rbp), %rsi
movq %r14, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0x240(%rbp), %rcx
movq %r12, (%rcx)
movq %r12, 0x8(%rcx)
movl $0x161, %edx            # imm = 0x161
callq 0x1c49e
movb $0x0, -0x40(%rbp)
movq %r13, -0x48(%rbp)
leaq 0x5846f(%rip), %rax     # 0x7f9e0
movq %rax, -0x38(%rbp)
leaq 0x2a91d(%rip), %rax     # 0x51e99
movq %rax, -0x30(%rbp)
movq %r14, -0x100(%rbp)
movq %r15, -0xf8(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x32e1e
leaq -0x98(%rbp), %r9
movq %rax, (%r9)
movl $0x40, -0x78(%rbp)
subq $0x8, %rsp
leaq -0x48(%rbp), %rdi
leaq -0x100(%rbp), %rsi
pushq $0x2
popq %rcx
movl $0x161, %edx            # imm = 0x161
movl %ecx, %r8d
leaq 0x2b549(%rip), %rax     # 0x52b12
pushq %rax
pushq %rbx
leaq 0x2b52c(%rip), %rax     # 0x52afe
pushq %rax
callq 0x3286b
addq $0x20, %rsp
leaq -0x98(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x32e3c
leaq -0x230(%rbp), %rsi
movq %r14, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0x220(%rbp), %rcx
movq %r12, (%rcx)
movq %r12, 0x8(%rcx)
movl $0x165, %edx            # imm = 0x165
callq 0x1c49e
movb $0x0, -0x40(%rbp)
movq %r13, -0x48(%rbp)
leaq 0x583bf(%rip), %rax     # 0x7f9e0
movq %rax, -0x38(%rbp)
leaq 0x2a86d(%rip), %rax     # 0x51e99
movq %rax, -0x30(%rbp)
movq %r14, -0xf0(%rbp)
movq %r15, -0xe8(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x32e1e
leaq -0x78(%rbp), %r9
movq %rax, (%r9)
movl $0x3f, -0x50(%rbp)
subq $0x8, %rsp
leaq -0x48(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
pushq $0x2
popq %rcx
movl $0x165, %edx            # imm = 0x165
movl %ecx, %r8d
leaq 0x2b4a1(%rip), %rax     # 0x52b17
pushq %rax
leaq -0x50(%rbp), %rax
pushq %rax
leaq 0x2b47b(%rip), %rax     # 0x52afe
pushq %rax
callq 0x3286b
addq $0x20, %rsp
leaq -0x78(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x32e3c
leaq -0x210(%rbp), %rsi
movq %r14, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0x200(%rbp), %rcx
movq %r12, (%rcx)
movq %r12, 0x8(%rcx)
movl $0x169, %edx            # imm = 0x169
callq 0x1c49e
movb $0x0, -0x40(%rbp)
movq %r13, -0x48(%rbp)
leaq 0x58311(%rip), %rax     # 0x7f9e0
movq %rax, -0x38(%rbp)
leaq 0x2a7bf(%rip), %rax     # 0x51e99
movq %rax, -0x30(%rbp)
movq %r14, -0xe0(%rbp)
movq %r15, -0xd8(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x32e1e
leaq -0x50(%rbp), %rbx
movq %rax, (%rbx)
leaq -0x68(%rbp), %rax
movl $0x3e, (%rax)
subq $0x8, %rsp
leaq 0x2b40f(%rip), %r10     # 0x52b20
leaq -0x48(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
pushq $0x2
popq %rcx
movl $0x169, %edx            # imm = 0x169
movl %ecx, %r8d
movq %rbx, %r9
pushq %r10
pushq %rax
leaq 0x2b3ca(%rip), %rax     # 0x52afe
pushq %rax
callq 0x3286b
addq $0x20, %rsp
leaq -0x1f0(%rbp), %rsi
movq %r14, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0x1e0(%rbp), %rcx
movq %r12, (%rcx)
movq %r12, 0x8(%rcx)
movl $0x16e, %edx            # imm = 0x16E
callq 0x1c49e
leaq -0x48(%rbp), %rdi
movb $0x0, 0x8(%rdi)
movq %r13, (%rdi)
leaq 0x5826a(%rip), %rax     # 0x7f9e0
movq %rax, 0x10(%rdi)
leaq 0x2a718(%rip), %rax     # 0x51e99
movq %rax, 0x18(%rdi)
leaq -0x1d0(%rbp), %rsi
movq %r14, (%rsi)
movq %r15, 0x8(%rsi)
movl $0x3f, -0x50(%rbp)
subq $0x8, %rsp
leaq 0x2b384(%rip), %rax     # 0x52b29
leaq 0x585cc(%rip), %r9      # 0x7fd78
pushq $0x2
popq %rcx
movl $0x16e, %edx            # imm = 0x16E
movl %ecx, %r8d
leaq 0x2b359(%rip), %r10     # 0x52b17
pushq %r10
pushq %rbx
pushq %rax
callq 0x32edd
addq $0x20, %rsp
leaq -0x50(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x32e3c
leaq -0x1c0(%rbp), %rsi
movq %r14, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0x1b0(%rbp), %rcx
movq %r12, (%rcx)
movq %r12, 0x8(%rcx)
movl $0x172, %edx            # imm = 0x172
callq 0x1c49e
movb $0x0, -0x40(%rbp)
movq %r13, -0x48(%rbp)
leaq 0x581d3(%rip), %rax     # 0x7f9e0
movq %rax, -0x38(%rbp)
leaq 0x2a681(%rip), %rax     # 0x51e99
movq %rax, -0x30(%rbp)
movq %r14, -0xd0(%rbp)
movq %r15, -0xc8(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x32e1e
leaq -0x68(%rbp), %rbx
movq %rax, (%rbx)
leaq -0x9c(%rbp), %rax
movl $0x3d, (%rax)
subq $0x8, %rsp
leaq 0x2b2ea(%rip), %r10     # 0x52b3c
leaq -0x48(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
pushq $0x2
popq %rcx
movl $0x172, %edx            # imm = 0x172
movl %ecx, %r8d
movq %rbx, %r9
pushq %r10
pushq %rax
leaq 0x2b289(%rip), %rax     # 0x52afe
pushq %rax
callq 0x3286b
addq $0x20, %rsp
leaq -0x50(%rbp), %rdi
callq 0x32ec2
leaq -0x1a0(%rbp), %rsi
movq %r14, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0x190(%rbp), %rcx
movq %r12, (%rcx)
movq %r12, 0x8(%rcx)
movl $0x175, %edx            # imm = 0x175
callq 0x1c49e
movb $0x0, -0x40(%rbp)
movq %r13, -0x48(%rbp)
leaq 0x58123(%rip), %rax     # 0x7f9e0
movq %rax, -0x38(%rbp)
leaq 0x2a5d1(%rip), %rax     # 0x51e99
movq %rax, -0x30(%rbp)
movq %r14, -0xc0(%rbp)
movq %r15, -0xb8(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x32e1e
leaq -0x50(%rbp), %r9
movq %rax, (%r9)
movl $0x3e, -0x68(%rbp)
subq $0x8, %rsp
leaq -0x48(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
pushq $0x2
popq %rcx
movl $0x175, %edx            # imm = 0x175
movl %ecx, %r8d
leaq 0x2b20e(%rip), %rax     # 0x52b20
pushq %rax
pushq %rbx
leaq 0x2b1e3(%rip), %rax     # 0x52afe
pushq %rax
callq 0x3286b
addq $0x20, %rsp
leaq -0x60(%rbp), %rdi
callq 0x32fca
leaq -0x180(%rbp), %rsi
movq %r14, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0x170(%rbp), %rcx
movq %r12, (%rcx)
movq %r12, 0x8(%rcx)
movl $0x17a, %edx            # imm = 0x17A
callq 0x1c49e
movb $0x0, -0x40(%rbp)
movq %r13, -0x48(%rbp)
leaq 0x5807d(%rip), %rax     # 0x7f9e0
movq %rax, -0x38(%rbp)
leaq 0x2a52b(%rip), %rax     # 0x51e99
movq %rax, -0x30(%rbp)
movq %r14, -0xb0(%rbp)
movq %r15, -0xa8(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x32e1e
leaq -0x50(%rbp), %r9
movq %rax, (%r9)
andl $0x0, -0x68(%rbp)
subq $0x8, %rsp
leaq 0x2b1a6(%rip), %rax     # 0x52b45
leaq -0x48(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
pushq $0x2
popq %rcx
movl $0x17a, %edx            # imm = 0x17A
movl %ecx, %r8d
pushq %rax
pushq %rbx
leaq 0x2b140(%rip), %rax     # 0x52afe
pushq %rax
callq 0x32a71
addq $0x20, %rsp
leaq -0x78(%rbp), %rdi
callq 0x32ec2
leaq -0x98(%rbp), %rdi
callq 0x32ec2
leaq -0x60(%rbp), %rdi
callq 0x330e8
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x27a6f
jmp 0x27a6f
jmp 0x27a6f
jmp 0x27a6f
jmp 0x27a04
jmp 0x27a04
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x32ec2
jmp 0x27a72
jmp 0x27a6f
jmp 0x27a6f
jmp 0x27a6f
jmp 0x27a6f
jmp 0x27a20
jmp 0x27a20
jmp 0x27a20
movq %rax, %rbx
jmp 0x27a7b
jmp 0x27a6a
jmp 0x27a6a
jmp 0x27a6a
jmp 0x27a2f
jmp 0x27a2f
movq %rax, %rbx
jmp 0x27a7b
jmp 0x27a6a
jmp 0x27a6a
jmp 0x27a6a
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
jmp 0x27a61
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x35d22
jmp 0x27a5a
movq %rax, %rbx
leaq -0x140(%rbp), %rdi
callq 0x332be
jmp 0x27a87
jmp 0x27a6a
movq %rax, %rbx
jmp 0x27a87
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x32ec2
leaq -0x98(%rbp), %rdi
callq 0x32ec2
leaq -0x60(%rbp), %rdi
callq 0x330e8
movq %rbx, %rdi
callq 0xf8a0