// File: f18m[P]boost-intrusive-pool/tests/unit_tests.cpp
// Function: test_allocate_methods()
void test_allocate_methods()
{
    {
        boost_intrusive_pool<dummy_two> pool;

        BOOST_REQUIRE(pool.init());

        auto o1 = pool.allocate();
        auto o2 = pool.allocate();

        // the pool constructs BOOST_INTRUSIVE_POOL_DEFAULT_POOL_SIZE items
        // and then we did not call any ctor (using allocate() nothing gets called inside
        // the dummy_two class):
        BOOST_REQUIRE_EQUAL(dummy_two::m_count, BOOST_INTRUSIVE_POOL_DEFAULT_POOL_SIZE);
    }

    // now all BOOST_INTRUSIVE_POOL_DEFAULT_POOL_SIZE items have been destroyed through
    // their dtor so the count returns to zero:
    BOOST_REQUIRE_EQUAL(dummy_two::m_count, 0);

    {
        boost_intrusive_pool<dummy_two> pool;

        BOOST_REQUIRE(pool.init());

        auto o1 = pool.allocate_through_init(3U);
        auto o2 = pool.allocate_through_init(3U);

        // the pool constructs BOOST_INTRUSIVE_POOL_DEFAULT_POOL_SIZE items
        BOOST_REQUIRE_EQUAL(dummy_two::m_count, BOOST_INTRUSIVE_POOL_DEFAULT_POOL_SIZE);
    }

    // now all BOOST_INTRUSIVE_POOL_DEFAULT_POOL_SIZE items have been destroyed through
    // their dtor so it just remains an offset = 2 in the static instance count:
    BOOST_REQUIRE_EQUAL(dummy_two::m_count, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x420, %rsp            # imm = 0x420
leaq -0x10(%rbp), %rdi
callq 0x5f470
movq 0xe9a8d(%rip), %rax     # 0x11f9e8
movq %rax, -0x318(%rbp)
leaq 0x8e978(%rip), %rsi     # 0xc48e1
leaq -0x20(%rbp), %rdi
movl $0x14, %edx
callq 0x4cbe0
jmp 0x35f79
leaq -0x40(%rbp), %rdi
callq 0x4ecc0
jmp 0x35f84
movq -0x318(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0x185, %edx            # imm = 0x185
leaq -0x40(%rbp), %rcx
callq 0x294a0
jmp 0x35f9f
xorl %eax, %eax
movl %eax, -0x32c(%rbp)
movl %eax, %esi
movq %rsi, -0x338(%rbp)
leaq -0x78(%rbp), %rdi
movq %rdi, -0x328(%rbp)
callq 0x5f6c0
movq -0x338(%rbp), %rcx
movl -0x32c(%rbp), %r8d
movq -0x328(%rbp), %r9
leaq -0x10(%rbp), %rdi
movl $0x40, %edx
movq %rdx, %rsi
callq 0x5f4d0
movb %al, -0x319(%rbp)
jmp 0x35fee
movb -0x319(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x58(%rbp), %rdi
callq 0x56ea0
jmp 0x36005
callq 0x50f60
movq %rax, -0x340(%rbp)
jmp 0x36013
leaq 0x8eb8c(%rip), %rsi     # 0xc4ba6
leaq -0xa8(%rbp), %rdi
movl $0xb, %edx
callq 0x4cbe0
jmp 0x3602d
movq -0x340(%rbp), %rsi
leaq -0x98(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0x5d730
jmp 0x36049
leaq 0x8e891(%rip), %rsi     # 0xc48e1
leaq -0xb8(%rbp), %rdi
movl $0x14, %edx
callq 0x4cbe0
jmp 0x36063
movq %rsp, %rax
movq $0x0, (%rax)
xorl %r9d, %r9d
movb %r9b, %al
leaq -0x58(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
movl $0x185, %ecx            # imm = 0x185
movl $0x2, %r8d
callq 0x22f50
jmp 0x36097
leaq -0x98(%rbp), %rdi
callq 0x5d770
leaq -0x58(%rbp), %rdi
callq 0x56fc0
leaq -0x78(%rbp), %rdi
callq 0x5f700
callq 0x5d790
movb %al, -0x341(%rbp)
jmp 0x360c2
movb -0x341(%rbp), %al
testb $0x1, %al
jne 0x35f54
jmp 0x360d2
leaq -0xc0(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x5f720
jmp 0x360e4
leaq -0xc8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x5f720
jmp 0x360f6
jmp 0x360f8
movq 0xe98e9(%rip), %rax     # 0x11f9e8
movq %rax, -0x350(%rbp)
leaq 0x8e7d4(%rip), %rsi     # 0xc48e1
leaq -0xd8(%rbp), %rdi
movl $0x14, %edx
callq 0x4cbe0
jmp 0x36120
leaq -0xe8(%rbp), %rdi
callq 0x4ecc0
jmp 0x3612e
movq -0x350(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
movl $0x18d, %edx            # imm = 0x18D
leaq -0xe8(%rbp), %rcx
callq 0x294a0
jmp 0x3614f
callq 0x50f60
movq %rax, -0x358(%rbp)
jmp 0x3615d
movq -0x358(%rbp), %rsi
leaq 0x8dde2(%rip), %rdx     # 0xc3f4d
leaq -0x110(%rbp), %rdi
callq 0x5dee0
jmp 0x36179
leaq 0x8e761(%rip), %rsi     # 0xc48e1
leaq -0x120(%rbp), %rdi
movl $0x14, %edx
callq 0x4cbe0
jmp 0x36193
movl $0x40, -0x124(%rbp)
leaq 0x8ea22(%rip), %rcx     # 0xc4bc6
movq %rsp, %rax
movq %rcx, 0x10(%rax)
leaq -0x124(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x8ea3f(%rip), %rcx     # 0xc4bfc
movq %rcx, (%rax)
leaq 0xe9d75(%rip), %r9      # 0x11ff3c
leaq -0x110(%rbp), %rdi
leaq -0x120(%rbp), %rsi
movl $0x18d, %edx            # imm = 0x18D
movl $0x2, %r8d
movl %r8d, %ecx
callq 0x5eff0
jmp 0x361ea
leaq -0x110(%rbp), %rdi
callq 0x5e010
callq 0x5d790
movb %al, -0x359(%rbp)
jmp 0x36203
movb -0x359(%rbp), %al
testb $0x1, %al
jne 0x360f8
jmp 0x36213
leaq -0xc8(%rbp), %rdi
callq 0x5f820
leaq -0xc0(%rbp), %rdi
callq 0x5f820
leaq -0x10(%rbp), %rdi
callq 0x5f860
movq 0xe97ad(%rip), %rax     # 0x11f9e8
movq %rax, -0x388(%rbp)
leaq 0x8e698(%rip), %rsi     # 0xc48e1
movq %rsi, -0x370(%rbp)
leaq -0x138(%rbp), %rdi
movq %rdi, -0x380(%rbp)
movl $0x14, %edx
movq %rdx, -0x368(%rbp)
callq 0x4cbe0
leaq -0x148(%rbp), %rdi
movq %rdi, -0x378(%rbp)
callq 0x4ecc0
movq -0x388(%rbp), %rdi
movq -0x380(%rbp), %rsi
movq -0x378(%rbp), %rcx
movl $0x192, %edx            # imm = 0x192
callq 0x294a0
callq 0x50f60
movq %rax, %rsi
leaq 0x8dc9d(%rip), %rdx     # 0xc3f4d
leaq -0x170(%rbp), %rdi
callq 0x5dee0
movq -0x370(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x180(%rbp), %rdi
callq 0x4cbe0
jmp 0x362d8
movl $0x0, -0x184(%rbp)
leaq 0x934f9(%rip), %rcx     # 0xc97e2
movq %rsp, %rax
movq %rcx, 0x10(%rax)
leaq -0x184(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x8e8fa(%rip), %rcx     # 0xc4bfc
movq %rcx, (%rax)
leaq 0xe9c30(%rip), %r9      # 0x11ff3c
leaq -0x170(%rbp), %rdi
leaq -0x180(%rbp), %rsi
movl $0x192, %edx            # imm = 0x192
movl $0x2, %r8d
movl %r8d, %ecx
callq 0x5eff0
jmp 0x3632f
leaq -0x170(%rbp), %rdi
callq 0x5e010
callq 0x5d790
testb $0x1, %al
jne 0x36234
leaq -0x198(%rbp), %rdi
callq 0x5f470
movq 0xe968d(%rip), %rax     # 0x11f9e8
movq %rax, -0x390(%rbp)
leaq 0x8e578(%rip), %rsi     # 0xc48e1
leaq -0x1a8(%rbp), %rdi
movl $0x14, %edx
callq 0x4cbe0
jmp 0x3637c
leaq -0x1b8(%rbp), %rdi
callq 0x4ecc0
jmp 0x3638a
movq -0x390(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
movl $0x197, %edx            # imm = 0x197
leaq -0x1b8(%rbp), %rcx
callq 0x294a0
jmp 0x363ab
xorl %eax, %eax
movl %eax, -0x3a4(%rbp)
movl %eax, %esi
movq %rsi, -0x3b0(%rbp)
leaq -0x1f0(%rbp), %rdi
movq %rdi, -0x3a0(%rbp)
callq 0x5f6c0
movq -0x3b0(%rbp), %rcx
movl -0x3a4(%rbp), %r8d
movq -0x3a0(%rbp), %r9
leaq -0x198(%rbp), %rdi
movl $0x40, %edx
movq %rdx, %rsi
callq 0x5f4d0
movb %al, -0x391(%rbp)
jmp 0x36400
movb -0x391(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x1d0(%rbp), %rdi
callq 0x56ea0
jmp 0x3641a
callq 0x50f60
movq %rax, -0x3b8(%rbp)
jmp 0x36428
leaq 0x8e777(%rip), %rsi     # 0xc4ba6
leaq -0x220(%rbp), %rdi
movl $0xb, %edx
callq 0x4cbe0
jmp 0x36442
movq -0x3b8(%rbp), %rsi
leaq -0x210(%rbp), %rdi
leaq -0x220(%rbp), %rdx
callq 0x5d730
jmp 0x3645e
leaq 0x8e47c(%rip), %rsi     # 0xc48e1
leaq -0x230(%rbp), %rdi
movl $0x14, %edx
callq 0x4cbe0
jmp 0x36478
movq %rsp, %rax
movq $0x0, (%rax)
xorl %r9d, %r9d
movb %r9b, %al
leaq -0x1d0(%rbp), %rdi
leaq -0x210(%rbp), %rsi
leaq -0x230(%rbp), %rdx
movl $0x197, %ecx            # imm = 0x197
movl $0x2, %r8d
callq 0x22f50
jmp 0x364af
leaq -0x210(%rbp), %rdi
callq 0x5d770
leaq -0x1d0(%rbp), %rdi
callq 0x56fc0
leaq -0x1f0(%rbp), %rdi
callq 0x5f700
callq 0x5d790
movb %al, -0x3b9(%rbp)
jmp 0x364e0
movb -0x3b9(%rbp), %al
testb $0x1, %al
jne 0x36354
jmp 0x364f0
movl $0x3, -0x23c(%rbp)
leaq -0x238(%rbp), %rdi
leaq -0x198(%rbp), %rsi
leaq -0x23c(%rbp), %rdx
callq 0x5f8d0
jmp 0x36516
movl $0x3, -0x24c(%rbp)
leaq -0x248(%rbp), %rdi
leaq -0x198(%rbp), %rsi
leaq -0x24c(%rbp), %rdx
callq 0x5f8d0
jmp 0x3653c
jmp 0x3653e
movq 0xe94a3(%rip), %rax     # 0x11f9e8
movq %rax, -0x3c8(%rbp)
leaq 0x8e38e(%rip), %rsi     # 0xc48e1
leaq -0x260(%rbp), %rdi
movl $0x14, %edx
callq 0x4cbe0
jmp 0x36566
leaq -0x270(%rbp), %rdi
callq 0x4ecc0
jmp 0x36574
movq -0x3c8(%rbp), %rdi
leaq -0x260(%rbp), %rsi
movl $0x19d, %edx            # imm = 0x19D
leaq -0x270(%rbp), %rcx
callq 0x294a0
jmp 0x36595
callq 0x50f60
movq %rax, -0x3d0(%rbp)
jmp 0x365a3
movq -0x3d0(%rbp), %rsi
leaq 0x8d99c(%rip), %rdx     # 0xc3f4d
leaq -0x298(%rbp), %rdi
callq 0x5dee0
jmp 0x365bf
leaq 0x8e31b(%rip), %rsi     # 0xc48e1
leaq -0x2a8(%rbp), %rdi
movl $0x14, %edx
callq 0x4cbe0
jmp 0x365d9
movl $0x40, -0x2ac(%rbp)
leaq 0x8e5dc(%rip), %rcx     # 0xc4bc6
movq %rsp, %rax
movq %rcx, 0x10(%rax)
leaq -0x2ac(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x8e5f9(%rip), %rcx     # 0xc4bfc
movq %rcx, (%rax)
leaq 0xe992f(%rip), %r9      # 0x11ff3c
leaq -0x298(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
movl $0x19d, %edx            # imm = 0x19D
movl $0x2, %r8d
movl %r8d, %ecx
callq 0x5eff0
jmp 0x36630
leaq -0x298(%rbp), %rdi
callq 0x5e010
callq 0x5d790
movb %al, -0x3d1(%rbp)
jmp 0x36649
movb -0x3d1(%rbp), %al
testb $0x1, %al
jne 0x3653e
jmp 0x36659
leaq -0x248(%rbp), %rdi
callq 0x5f820
leaq -0x238(%rbp), %rdi
callq 0x5f820
leaq -0x198(%rbp), %rdi
callq 0x5f860
movq 0xe9364(%rip), %rax     # 0x11f9e8
movq %rax, -0x400(%rbp)
leaq 0x8e24f(%rip), %rsi     # 0xc48e1
movq %rsi, -0x3e8(%rbp)
leaq -0x2c0(%rbp), %rdi
movq %rdi, -0x3f8(%rbp)
movl $0x14, %edx
movq %rdx, -0x3e0(%rbp)
callq 0x4cbe0
leaq -0x2d0(%rbp), %rdi
movq %rdi, -0x3f0(%rbp)
callq 0x4ecc0
movq -0x400(%rbp), %rdi
movq -0x3f8(%rbp), %rsi
movq -0x3f0(%rbp), %rcx
movl $0x1a2, %edx            # imm = 0x1A2
callq 0x294a0
callq 0x50f60
movq %rax, %rsi
leaq 0x8d854(%rip), %rdx     # 0xc3f4d
leaq -0x2f8(%rbp), %rdi
callq 0x5dee0
movq -0x3e8(%rbp), %rsi
movq -0x3e0(%rbp), %rdx
leaq -0x308(%rbp), %rdi
callq 0x4cbe0
jmp 0x36721
movl $0x0, -0x30c(%rbp)
leaq 0x930b0(%rip), %rcx     # 0xc97e2
movq %rsp, %rax
movq %rcx, 0x10(%rax)
leaq -0x30c(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x8e4b1(%rip), %rcx     # 0xc4bfc
movq %rcx, (%rax)
leaq 0xe97e7(%rip), %r9      # 0x11ff3c
leaq -0x2f8(%rbp), %rdi
leaq -0x308(%rbp), %rsi
movl $0x1a2, %edx            # imm = 0x1A2
movl $0x2, %r8d
movl %r8d, %ecx
callq 0x5eff0
jmp 0x36778
leaq -0x2f8(%rbp), %rdi
callq 0x5e010
callq 0x5d790
testb $0x1, %al
jne 0x3667d
addq $0x420, %rsp            # imm = 0x420
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x3683f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x367e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x367df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x5d770
leaq -0x58(%rbp), %rdi
callq 0x56fc0
leaq -0x78(%rbp), %rdi
callq 0x5f700
jmp 0x3683f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x36833
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x36827
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x5e010
leaq -0xc8(%rbp), %rdi
callq 0x5f820
leaq -0xc0(%rbp), %rdi
callq 0x5f820
leaq -0x10(%rbp), %rdi
callq 0x5f860
jmp 0x3693b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x5e010
jmp 0x3693b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x36915
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x368bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x368af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x5d770
leaq -0x1d0(%rbp), %rdi
callq 0x56fc0
leaq -0x1f0(%rbp), %rdi
callq 0x5f700
jmp 0x36915
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x36909
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x368fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x5e010
leaq -0x248(%rbp), %rdi
callq 0x5f820
leaq -0x238(%rbp), %rdi
callq 0x5f820
leaq -0x198(%rbp), %rdi
callq 0x5f860
jmp 0x3693b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x2f8(%rbp), %rdi
callq 0x5e010
movq -0x28(%rbp), %rdi
callq 0x10aa0
nopw %cs:(%rax,%rax)