// File: moya-lang[P]Allocator/Measure.cpp
// Function: main
int main()
{
    typedef size_t DataType;
    typedef Moya::Allocator<DataType, growSize> MemoryPoolAllocator;
    typedef Moya::Allocator<std::map<DataType, DataType>::value_type, growSize> MapMemoryPoolAllocator;

    std::cout << "Allocator performance measurement example" << std::endl;
    std::cout << "Version: 1.0" << std::endl << std::endl;

    PushFrontTest<std::forward_list<DataType>> pushFrontForwardListTestStl;
    PushFrontTest<std::forward_list<DataType, MemoryPoolAllocator>> pushFrontForwardListTestFast;
    printTestStatus("ForwardList PushFront", pushFrontForwardListTestStl, pushFrontForwardListTestFast);

    PushFrontTest<std::list<DataType>> pushFrontListTestStl;
    PushFrontTest<std::list<DataType, MemoryPoolAllocator>> pushFrontListTestFast;
    printTestStatus("List PushFront", pushFrontListTestStl, pushFrontListTestFast);

    PushBackTest<std::list<DataType>> pushBackListTestStl;
    PushBackTest<std::list<DataType, MemoryPoolAllocator>> pushBackListTestFast;
    printTestStatus("List PushBack", pushBackListTestStl, pushBackListTestFast);

    MapTest<std::map<DataType, DataType, std::less<DataType>>> mapTestStl;
    MapTest<std::map<DataType, DataType, std::less<DataType>, MapMemoryPoolAllocator>> mapTestFast;
    printTestStatus("Map", mapTestStl, mapTestFast);

    SetTest<std::set<DataType, std::less<DataType>>> setTestStl;
    SetTest<std::set<DataType, std::less<DataType>, MemoryPoolAllocator>> setTestFast;
    printTestStatus("Set", setTestStl, setTestFast);

    return 0;
}

// Assembly:
subq $0x318, %rsp            # imm = 0x318
movl $0x0, 0x314(%rsp)
movq 0xecd7(%rip), %rdi      # 0x10fd0
movq %rdi, 0x8(%rsp)
leaq 0x8d0b(%rip), %rsi      # 0xb010
callq 0x20f0
movq %rax, %rdi
movq 0xec94(%rip), %rsi      # 0x10fa8
movq %rsi, 0x10(%rsp)
callq 0x2130
movq 0x8(%rsp), %rdi
leaq 0x8d10(%rip), %rsi      # 0xb03a
callq 0x20f0
movq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x2130
movq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x2130
leaq 0x2e8(%rsp), %rdi
callq 0x2680
leaq 0x2a8(%rsp), %rdi
callq 0x26b0
jmp 0x2365
leaq 0x8cdb(%rip), %rdi      # 0xb047
leaq 0x2e8(%rsp), %rsi
leaq 0x2a8(%rsp), %rdx
callq 0x26e0
jmp 0x2383
leaq 0x260(%rsp), %rdi
callq 0x2830
jmp 0x2392
leaq 0x210(%rsp), %rdi
callq 0x2860
jmp 0x23a1
leaq 0x8ca6(%rip), %rdi      # 0xb04e
leaq 0x260(%rsp), %rsi
leaq 0x210(%rsp), %rdx
callq 0x2890
jmp 0x23bf
leaq 0x1d8(%rsp), %rdi
callq 0x29e0
jmp 0x23ce
leaq 0x188(%rsp), %rdi
callq 0x2a10
jmp 0x23dd
leaq 0x8c79(%rip), %rdi      # 0xb05d
leaq 0x1d8(%rsp), %rsi
leaq 0x188(%rsp), %rdx
callq 0x2a40
jmp 0x23fb
leaq 0x138(%rsp), %rdi
callq 0x2b90
jmp 0x240a
leaq 0xd0(%rsp), %rdi
callq 0x2bc0
jmp 0x2419
leaq 0x8c4b(%rip), %rdi      # 0xb06b
leaq 0x138(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x2bf0
jmp 0x2437
leaq 0x80(%rsp), %rdi
callq 0x2d40
jmp 0x2446
leaq 0x18(%rsp), %rdi
callq 0x2d70
jmp 0x2452
leaq 0x8c16(%rip), %rdi      # 0xb06f
leaq 0x80(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x2da0
jmp 0x246d
movl $0x0, 0x314(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x2ef0
leaq 0x80(%rsp), %rdi
callq 0x2f00
leaq 0xd0(%rsp), %rdi
callq 0x2f10
leaq 0x138(%rsp), %rdi
callq 0x2f20
leaq 0x188(%rsp), %rdi
callq 0x2f30
leaq 0x1d8(%rsp), %rdi
callq 0x2f40
leaq 0x210(%rsp), %rdi
callq 0x2f50
leaq 0x260(%rsp), %rdi
callq 0x2f60
leaq 0x2a8(%rsp), %rdi
callq 0x2f70
leaq 0x2e8(%rsp), %rdi
callq 0x2f80
movl 0x314(%rsp), %eax
addq $0x318, %rsp            # imm = 0x318
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x2664
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x2657
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x264a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x263d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x2630
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x2623
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x2616
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x2609
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x25fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x2ef0
leaq 0x80(%rsp), %rdi
callq 0x2f00
leaq 0xd0(%rsp), %rdi
callq 0x2f10
leaq 0x138(%rsp), %rdi
callq 0x2f20
leaq 0x188(%rsp), %rdi
callq 0x2f30
leaq 0x1d8(%rsp), %rdi
callq 0x2f40
leaq 0x210(%rsp), %rdi
callq 0x2f50
leaq 0x260(%rsp), %rdi
callq 0x2f60
leaq 0x2a8(%rsp), %rdi
callq 0x2f70
leaq 0x2e8(%rsp), %rdi
callq 0x2f80
movq 0x2a0(%rsp), %rdi
callq 0x2180
nop