// File: ericprud[P]sean-parent-concept-based-polymorphism/doc-user.cpp
// Function: main
int main ()
{
    history_t h;

    h.current().add(string("Hello"));
    h.current().add(0);
    h.current().add(my_class_t());

    draw(h, cout, 0);
    cout << "--------------------------" << endl;

    h.commit();

    h.current()[1] = string("World!");
    h.current().add(h);

    draw(h, cout, 0);
    cout << "--------------------------" << endl;

    h.undo();

    draw(h, cout, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
leaq -0x18(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
movl $0x1, %esi
callq 0x27c0
movq -0xf8(%rbp), %rdi
callq 0x2830
movq %rax, -0xf0(%rbp)
jmp 0x23e5
leaq -0x59(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x2240
movq -0x100(%rbp), %rdx
leaq 0x7c01(%rip), %rsi      # 0xa004
leaq -0x58(%rbp), %rdi
callq 0x28a0
jmp 0x240e
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x2950
jmp 0x241d
movq -0xf0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2880
jmp 0x242f
leaq -0x38(%rbp), %rdi
callq 0x2990
leaq -0x58(%rbp), %rdi
callq 0x20b0
leaq -0x59(%rbp), %rdi
callq 0x2190
leaq -0x18(%rbp), %rdi
callq 0x2830
movq %rax, -0x108(%rbp)
jmp 0x245c
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
callq 0x29b0
jmp 0x2469
movq -0x108(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2880
jmp 0x247b
leaq -0x70(%rbp), %rdi
callq 0x2990
leaq -0x18(%rbp), %rdi
callq 0x2830
movq %rax, -0x110(%rbp)
jmp 0x2496
leaq -0x80(%rbp), %rdi
callq 0x29f0
jmp 0x24a1
movq -0x110(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x2880
jmp 0x24b3
leaq -0x80(%rbp), %rdi
callq 0x2990
movq 0xeb15(%rip), %rsi      # 0x10fd8
xorl %eax, %eax
movl %eax, %edx
leaq -0x18(%rbp), %rdi
callq 0x2a30
jmp 0x24d2
movq 0xeaff(%rip), %rdi      # 0x10fd8
leaq 0x7b2a(%rip), %rsi      # 0xa00a
callq 0x2140
movq %rax, -0x118(%rbp)
jmp 0x24ee
movq -0x118(%rbp), %rdi
movq 0xeac4(%rip), %rsi      # 0x10fc0
callq 0x2170
jmp 0x2503
leaq -0x18(%rbp), %rdi
callq 0x2c70
jmp 0x250e
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x2240
movq -0x120(%rbp), %rdx
leaq 0x7af6(%rip), %rsi      # 0xa025
leaq -0xb8(%rbp), %rdi
callq 0x28a0
jmp 0x253d
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x2950
jmp 0x2552
leaq -0x18(%rbp), %rdi
callq 0x2830
movq %rax, -0x128(%rbp)
jmp 0x2564
movq -0x128(%rbp), %rdi
movl $0x1, %esi
callq 0x2cd0
movq %rax, -0x130(%rbp)
jmp 0x257e
movq -0x130(%rbp), %rdi
leaq -0x98(%rbp), %rsi
movq %rsi, -0x140(%rbp)
callq 0x2d00
movq -0x140(%rbp), %rdi
callq 0x2990
leaq -0xb8(%rbp), %rdi
callq 0x20b0
leaq -0xb9(%rbp), %rdi
callq 0x2190
leaq -0x18(%rbp), %rdi
callq 0x2830
movq %rax, -0x138(%rbp)
jmp 0x25ce
leaq -0xe8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x2d30
jmp 0x25e0
leaq -0xd0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x2d60
jmp 0x25f5
movq -0x138(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x2880
jmp 0x260a
leaq -0xd0(%rbp), %rdi
callq 0x2990
leaq -0xe8(%rbp), %rdi
callq 0x2da0
movq 0xe9af(%rip), %rsi      # 0x10fd8
xorl %eax, %eax
movl %eax, %edx
leaq -0x18(%rbp), %rdi
callq 0x2a30
jmp 0x2638
movq 0xe999(%rip), %rdi      # 0x10fd8
leaq 0x79c4(%rip), %rsi      # 0xa00a
callq 0x2140
movq %rax, -0x148(%rbp)
jmp 0x2654
movq -0x148(%rbp), %rdi
movq 0xe95e(%rip), %rsi      # 0x10fc0
callq 0x2170
jmp 0x2669
leaq -0x18(%rbp), %rdi
callq 0x2dc0
jmp 0x2674
movq 0xe95d(%rip), %rsi      # 0x10fd8
xorl %eax, %eax
movl %eax, %edx
leaq -0x18(%rbp), %rdi
callq 0x2a30
jmp 0x268a
leaq -0x18(%rbp), %rdi
callq 0x2da0
xorl %eax, %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x27ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x26e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x26e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x2990
leaq -0x58(%rbp), %rdi
callq 0x20b0
leaq -0x59(%rbp), %rdi
callq 0x2190
jmp 0x27ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x2990
jmp 0x27ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x2990
jmp 0x27ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x276b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x275f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x2990
leaq -0xb8(%rbp), %rdi
callq 0x20b0
leaq -0xb9(%rbp), %rdi
callq 0x2190
jmp 0x27ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x279f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x2990
leaq -0xe8(%rbp), %rdi
callq 0x2da0
leaq -0x18(%rbp), %rdi
callq 0x2da0
movq -0x20(%rbp), %rdi
callq 0x2230
nopl (%rax)