// File: /workspace/github_cpp_makefile_star2_O3/f18m[P]boost-intrusive-pool/tests/tutorial.cpp
// Function: showcase_boost_intrusive_pointers()
void showcase_boost_intrusive_pointers()
{
    print_header();
    std::cout << "Running some examples for boost::intrusive_ptr<>:" << std::endl;

    {
        std::cout << "  Now allocating dummy class of size: " << sizeof(DummyClass) << std::endl;

        boost::intrusive_ptr<DummyClass> hdummy(new DummyClass(3));
        // you will see a memory malloc traced when running this line

        std::cout << "  Size of a simple boost::intrusive_ptr<>: " << sizeof(hdummy) << std::endl;

        {
            // of course copying pointers around does not trigger any memory allocation:
            boost::intrusive_ptr<DummyClass> hdummy2 = hdummy;
            std::cout << "  Value from allocated dummy class: " << hdummy2->dummy() << std::endl;

            // of course you can move Boost intrusive pointers as well:
            std::cout << "  Before std::move hdummy2 is valid: " << (bool)hdummy2 << std::endl;
            boost::intrusive_ptr<DummyClass> hdummy3(std::move(hdummy2));
            std::cout << "  Value from allocated dummy class: " << hdummy3->dummy() << std::endl;
            std::cout << "  After std::move hdummy2 is valid: " << (bool)hdummy2 << std::endl;

        } // the DummyClass instance survives this block since its reference is stored in hdummy

        std::cout << "  Going to release all references to the boost::intrusive_ptr<> created so far" << std::endl;
    } // you will see a memory free traced when running this line
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
callq 0x2595
movq 0x8838(%rip), %rbx      # 0xafd0
leaq 0x39a0(%rip), %rsi      # 0x613f
movl $0x31, %edx
movq %rbx, %rdi
callq 0x2100
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20a0
leaq 0x38f4(%rip), %rsi      # 0x60ce
movl $0x26, %edx
movq %rbx, %rdi
callq 0x2100
movl $0x420, %esi            # imm = 0x420
movq %rbx, %rdi
callq 0x2090
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20a0
movl $0x420, %edi            # imm = 0x420
callq 0x235c
movq %rax, %r14
movq %rax, %rdi
movl $0x3, %esi
callq 0x3272
movq %r14, -0x30(%rbp)
movq 0x8(%r14), %rax
cmpq $0x3ff, %rax            # imm = 0x3FF
jae 0x2aed
incq %rax
movq %rax, 0x8(%r14)
movq 0x8776(%rip), %rdi      # 0xafd0
leaq 0x3910(%rip), %rsi      # 0x6171
movl $0x2b, %edx
callq 0x2100
movq 0x875e(%rip), %rdi      # 0xafd0
movl $0x8, %esi
callq 0x2090
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20a0
movq -0x30(%rbp), %rax
movq %rax, -0x18(%rbp)
testq %rax, %rax
je 0x28cb
movq 0x8(%rax), %rcx
cmpq $0x3ff, %rcx            # imm = 0x3FF
jae 0x2aed
incq %rcx
movq %rcx, 0x8(%rax)
movq 0x86fe(%rip), %rdi      # 0xafd0
leaq 0x38c4(%rip), %rsi      # 0x619d
movl $0x24, %edx
callq 0x2100
movq -0x18(%rbp), %rdi
testq %rdi, %rdi
je 0x2ace
movq (%rdi), %rax
callq *0x18(%rax)
leaq -0x28(%rbp), %rsi
movb %al, (%rsi)
movq 0x86cd(%rip), %rdi      # 0xafd0
movl $0x1, %edx
callq 0x2100
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20a0
movq 0x8692(%rip), %rdi      # 0xafd0
leaq 0x387d(%rip), %rsi      # 0x61c2
movl $0x25, %edx
callq 0x2100
xorl %esi, %esi
cmpq $0x0, -0x18(%rbp)
setne %sil
movq 0x866f(%rip), %rdi      # 0xafd0
callq 0x2190
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20a0
movq -0x18(%rbp), %rbx
movq %rbx, -0x28(%rbp)
movq $0x0, -0x18(%rbp)
movq 0x8629(%rip), %rdi      # 0xafd0
leaq 0x37ef(%rip), %rsi      # 0x619d
movl $0x24, %edx
callq 0x2100
testq %rbx, %rbx
je 0x2ace
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
leaq -0x19(%rbp), %rsi
movb %al, (%rsi)
movq 0x85f9(%rip), %rdi      # 0xafd0
movl $0x1, %edx
callq 0x2100
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20a0
movq 0x85be(%rip), %rdi      # 0xafd0
leaq 0x37cf(%rip), %rsi      # 0x61e8
movl $0x24, %edx
callq 0x2100
xorl %esi, %esi
cmpq $0x0, -0x18(%rbp)
setne %sil
movq 0x859b(%rip), %rdi      # 0xafd0
callq 0x2190
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20a0
leaq -0x28(%rbp), %rdi
callq 0x3344
leaq -0x18(%rbp), %rdi
callq 0x3344
movq 0x8553(%rip), %rbx      # 0xafd0
leaq 0x3789(%rip), %rsi      # 0x620d
movl $0x4e, %edx
movq %rbx, %rdi
callq 0x2100
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x20e0
movsbl %al, %esi
movq 0x8521(%rip), %rdi      # 0xafd0
callq 0x2040
movq %rax, %rdi
callq 0x20a0
leaq -0x30(%rbp), %rdi
callq 0x3344
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x3d6a(%rip), %rdi      # 0x683f
leaq 0x3d6b(%rip), %rsi      # 0x6847
leaq 0x3e14(%rip), %rcx      # 0x68f7
movl $0xc7, %edx
callq 0x2080
leaq 0x3b5e(%rip), %rdi      # 0x6652
leaq 0x3ba8(%rip), %rsi      # 0x66a3
leaq 0x3bc2(%rip), %rcx      # 0x66c4
movl $0xdc, %edx
callq 0x2080
movq %rax, %rbx
movq %r14, %rdi
callq 0x242d
jmp 0x2b41
movq %rax, %rbx
jmp 0x2b38
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x3344
jmp 0x2b2f
movq %rax, %rbx
leaq -0x18(%rbp), %rdi
callq 0x3344
leaq -0x30(%rbp), %rdi
callq 0x3344
movq %rbx, %rdi
callq 0x21a0