// File: /workspace/github_cpp_makefile_star2_O2/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 0x23ed
movq 0x7ab7(%rip), %rbx      # 0x9fd0
leaq 0x2c1f(%rip), %rsi      # 0x513f
movq %rbx, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x2080
leaq 0x2b97(%rip), %rsi      # 0x50ce
movq %rbx, %rdi
callq 0x20f0
movl $0x420, %esi            # imm = 0x420
movq %rax, %rdi
callq 0x20a0
movq %rax, %rdi
callq 0x2080
movl $0x420, %edi            # imm = 0x420
callq 0x22dc
movq %rax, %r14
pushq $0x3
popq %rsi
movq %rax, %rdi
callq 0x2b1a
movq %r14, -0x28(%rbp)
movq %r14, %rdi
callq 0x34fd
movq 0x7a51(%rip), %rdi      # 0x9fd0
leaq 0x2beb(%rip), %rsi      # 0x5171
callq 0x20f0
pushq $0x8
popq %rsi
movq %rax, %rdi
callq 0x20a0
movq %rax, %rdi
callq 0x2080
leaq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x2bb2
movq 0x7a1e(%rip), %rdi      # 0x9fd0
leaq 0x2be4(%rip), %rsi      # 0x519d
callq 0x20f0
movq %rax, %rbx
leaq -0x18(%rbp), %rdi
callq 0x2bcc
movq (%rax), %rcx
movq %rax, %rdi
callq *0x18(%rcx)
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2110
movq %rax, %rdi
callq 0x2080
movq 0x79e3(%rip), %rdi      # 0x9fd0
leaq 0x2bce(%rip), %rsi      # 0x51c2
callq 0x20f0
xorl %esi, %esi
cmpq $0x0, -0x18(%rbp)
setne %sil
movq %rax, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x2080
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
andq $0x0, -0x18(%rbp)
movq 0x79a8(%rip), %rdi      # 0x9fd0
leaq 0x2b6e(%rip), %rsi      # 0x519d
callq 0x20f0
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
callq 0x2bcc
movq (%rax), %rcx
movq %rax, %rdi
callq *0x18(%rcx)
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2110
movq %rax, %rdi
callq 0x2080
movq 0x796d(%rip), %rdi      # 0x9fd0
leaq 0x2b7e(%rip), %rsi      # 0x51e8
callq 0x20f0
xorl %esi, %esi
cmpq $0x0, -0x18(%rbp)
setne %sil
movq %rax, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x2080
leaq -0x20(%rbp), %rdi
callq 0x2bf8
leaq -0x18(%rbp), %rdi
callq 0x2bf8
movq 0x792d(%rip), %rdi      # 0x9fd0
leaq 0x2b63(%rip), %rsi      # 0x520d
callq 0x20f0
movq %rax, %rdi
callq 0x2080
leaq -0x28(%rbp), %rdi
callq 0x2bf8
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x2345
jmp 0x26fe
movq %rax, %rbx
jmp 0x26f5
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
callq 0x2bf8
jmp 0x26ec
movq %rax, %rbx
leaq -0x18(%rbp), %rdi
callq 0x2bf8
leaq -0x28(%rbp), %rdi
callq 0x2bf8
movq %rbx, %rdi
callq 0x2190