// File: dlbeer[P]summary_map/test_perf.cpp
// Function: void run_test<summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>>(char const*, std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int>>>&, summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>&)
static void run_test(const char *label, test_vector& vec, Map& m)
{
    clock_t c;

    std::cout << label << '\n';

    shuffle(vec, 9);

    c = clock();
    m.insert(vec.begin(), vec.end());
    test_end("random insert", c);

    shuffle(vec, 10);

    c = clock();
    for (unsigned int i = 0; i < vec.size(); i++)
	m.find(vec[i].first);
    test_end("find", c);

    shuffle(vec, 11);

    c = clock();
    for (unsigned int i = 0; i < vec.size(); i++)
	m.erase(vec[i].first);
    test_end("random erase", c);

    std::sort(vec.begin(), vec.end());

    c = clock();
    m.insert(vec.begin(), vec.end());
    test_end("seq insert", c);

    c = clock();
    m.erase(m.begin(), m.end());
    test_end("seq erase", c);

    std::cout << '\n';
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movq %rdx, 0xa0(%rsp)
movq 0xb0(%rsp), %rsi
movq 0xa9da(%rip), %rdi      # 0xcfd8
callq 0x2160
movq %rax, %rdi
movl $0xa, %esi
callq 0x21b0
movq 0xa8(%rsp), %rdi
movl $0x9, %esi
callq 0x7b20
callq 0x2110
movq %rax, 0x98(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x3780
movq %rax, 0x90(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x37b0
movq 0x38(%rsp), %rdi
movq %rax, 0x88(%rsp)
movq 0x90(%rsp), %rsi
movq 0x88(%rsp), %rdx
callq 0x36a0
movq 0x98(%rsp), %rsi
leaq 0x6a03(%rip), %rdi      # 0x9092
callq 0x2c50
movq 0xa8(%rsp), %rdi
movl $0xa, %esi
callq 0x7b20
callq 0x2110
movq %rax, 0x98(%rsp)
movl $0x0, 0x84(%rsp)
movl 0x84(%rsp), %eax
movq %rax, 0x30(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x2d70
movq %rax, %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
jae 0x272c
movq 0xa0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xa8(%rsp), %rdi
movl 0x84(%rsp), %eax
movl %eax, %esi
callq 0x3820
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x37e0
movq %rax, 0x78(%rsp)
movl 0x84(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x84(%rsp)
jmp 0x26be
movq 0x98(%rsp), %rsi
leaq 0x6965(%rip), %rdi      # 0x90a0
callq 0x2c50
movq 0xa8(%rsp), %rdi
movl $0xb, %esi
callq 0x7b20
callq 0x2110
movq %rax, 0x98(%rsp)
movl $0x0, 0x74(%rsp)
movl 0x74(%rsp), %eax
movq %rax, 0x20(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x2d70
movq %rax, %rcx
movq 0x20(%rsp), %rax
cmpq %rcx, %rax
jae 0x27c4
movq 0xa0(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xa8(%rsp), %rdi
movl 0x74(%rsp), %eax
movl %eax, %esi
callq 0x3820
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x3840
movl 0x74(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x74(%rsp)
jmp 0x2767
movq 0x98(%rsp), %rsi
leaq 0x68d2(%rip), %rdi      # 0x90a5
callq 0x2c50
movq 0xa8(%rsp), %rdi
callq 0x3780
movq %rax, 0x68(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x37b0
movq %rax, 0x60(%rsp)
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x38c0
callq 0x2110
movq %rax, 0x98(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x3780
movq %rax, 0x58(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x37b0
movq 0x8(%rsp), %rdi
movq %rax, 0x50(%rsp)
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq 0x36a0
movq 0x98(%rsp), %rsi
leaq 0x6846(%rip), %rdi      # 0x90b2
callq 0x2c50
callq 0x2110
movq %rax, 0x98(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x3960
movq %rax, 0x48(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x3990
movq 0x10(%rsp), %rdi
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0x3900
movq 0x98(%rsp), %rsi
leaq 0x67eb(%rip), %rdi      # 0x90bd
callq 0x2c50
movq 0xa6fa(%rip), %rdi      # 0xcfd8
movl $0xa, %esi
callq 0x21b0
addq $0xb8, %rsp
retq