// File: /workspace/github_cpp_makefile_star2_O1/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 0x25a5
movq 0x87ea(%rip), %rbx      # 0xafd0
leaq 0x3952(%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 0x38a6(%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 0x236c
movq %rax, %r14
movq %rax, %rdi
movl $0x3, %esi
callq 0x32c2
movq %r14, -0x30(%rbp)
movq 0x8(%r14), %rax
cmpq $0x3ff, %rax            # imm = 0x3FF
jae 0x2b3c
incq %rax
movq %rax, 0x8(%r14)
movq 0x8728(%rip), %rdi      # 0xafd0
leaq 0x38c2(%rip), %rsi      # 0x6171
movl $0x2b, %edx
callq 0x2100
movq 0x8710(%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 0x2919
movq 0x8(%rax), %rcx
cmpq $0x3ff, %rcx            # imm = 0x3FF
jae 0x2b3c
incq %rcx
movq %rcx, 0x8(%rax)
movq 0x86b0(%rip), %rdi      # 0xafd0
leaq 0x3876(%rip), %rsi      # 0x619d
movl $0x24, %edx
callq 0x2100
movq -0x18(%rbp), %rdi
testq %rdi, %rdi
je 0x2b1d
movq (%rdi), %rax
callq *0x18(%rax)
leaq -0x28(%rbp), %rsi
movb %al, (%rsi)
movq 0x867f(%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 0x8644(%rip), %rdi      # 0xafd0
leaq 0x382f(%rip), %rsi      # 0x61c2
movl $0x25, %edx
callq 0x2100
xorl %esi, %esi
cmpq $0x0, -0x18(%rbp)
setne %sil
movq 0x8621(%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), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x18(%rbp)
movq 0x85db(%rip), %rdi      # 0xafd0
leaq 0x37a1(%rip), %rsi      # 0x619d
movl $0x24, %edx
callq 0x2100
movq -0x28(%rbp), %rdi
testq %rdi, %rdi
je 0x2b1d
movq (%rdi), %rax
callq *0x18(%rax)
leaq -0x19(%rbp), %rsi
movb %al, (%rsi)
movq 0x85aa(%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 0x856f(%rip), %rdi      # 0xafd0
leaq 0x3780(%rip), %rsi      # 0x61e8
movl $0x24, %edx
callq 0x2100
xorl %esi, %esi
cmpq $0x0, -0x18(%rbp)
setne %sil
movq 0x854c(%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 0x3394
leaq -0x18(%rbp), %rdi
callq 0x3394
movq 0x8504(%rip), %rbx      # 0xafd0
leaq 0x373a(%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 0x84d2(%rip), %rdi      # 0xafd0
callq 0x2040
movq %rax, %rdi
callq 0x20a0
leaq -0x30(%rbp), %rdi
callq 0x3394
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x3d1b(%rip), %rdi      # 0x683f
leaq 0x3d1c(%rip), %rsi      # 0x6847
leaq 0x3dc5(%rip), %rcx      # 0x68f7
movl $0xc7, %edx
callq 0x2080
leaq 0x3b0f(%rip), %rdi      # 0x6652
leaq 0x3b59(%rip), %rsi      # 0x66a3
leaq 0x3b73(%rip), %rcx      # 0x66c4
movl $0xdc, %edx
callq 0x2080
movq %rax, %rbx
movq %r14, %rdi
callq 0x243d
jmp 0x2b90
movq %rax, %rbx
jmp 0x2b87
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x3394
jmp 0x2b7e
movq %rax, %rbx
leaq -0x18(%rbp), %rdi
callq 0x3394
leaq -0x30(%rbp), %rdi
callq 0x3394
movq %rbx, %rdi
callq 0x21a0