// File: /workspace/github_cpp_makefile_star2_O2/ostafen[P]Fast-Insertion-Sort/src/bench.cpp
// Function: BenchmarkExecutor<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::run(std::vector<SortAlgorithm<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>*, std::allocator<SortAlgorithm<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>*>>*, int)
void run(std::vector<SortAlgorithm<T> *> *algos, int n)
    {
        int maxNameLength = -1;
        for (SortAlgorithm<T> *algo : *algos)
        {
            int length = algo->name().length();
            if (length > maxNameLength)
                maxNameLength = length;
        }

        for (int size = minSize; size <= maxSize; size *= 2)
        {
            double time[30];
            for (int i = 0; i < 30; i++)
                time[i] = 0;

            cout << "Size: " << size << endl
                 << endl;

            for (int z = 0; z < n; z++)
            {
                T *A = gen->random(size);
                T *B = arrayCopy<T>(A, size);

                int c = 0;
                for (SortAlgorithm<T> *algo : *algos)
                {
                    int start = clock();
                    algo->sort(B, size);
                    int elapsedTime = clock() - start;
                    time[c++] += (((double)elapsedTime / (double)n) / CLOCKS_PER_SEC) * 1000;

                    for (int i = 0; i < size; i++)
                    {
                        B[i] = A[i];
                    }
                }

                delete[] A;
                delete[] B;
            }

            int c = 0;
            for (SortAlgorithm<T> *algo : *algos)
            {
                cout << setw(maxNameLength) << left
                     << algo->name() << ": " << setw(10) << right << time[c++] << endl;
            }

            cout << endl;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movl %edx, %r13d
movq %rdi, 0x18(%rsp)
movq (%rsi), %r14
movq %rsi, 0x28(%rsp)
movq 0x8(%rsi), %r15
pushq $-0x1
popq %rbp
leaq 0x70(%rsp), %rbx
cmpq %r15, %r14
je 0x3c5e
movq (%r14), %rsi
movq (%rsi), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movl 0x78(%rsp), %r12d
movq %rbx, %rdi
callq 0x30b0
cmpl %r12d, %ebp
cmovlel %r12d, %ebp
addq $0x8, %r14
jmp 0x3c33
movq 0x18(%rsp), %rax
movl 0x8(%rax), %r12d
cvtsi2sd %r13d, %xmm0
movsd %xmm0, 0x38(%rsp)
xorl %eax, %eax
testl %r13d, %r13d
cmovlel %eax, %r13d
movl %r13d, 0x20(%rsp)
movslq %ebp, %rax
movq %rax, 0x30(%rsp)
movl $0xffffff4f, %ebp       # imm = 0xFFFFFF4F
movq 0x18(%rsp), %rax
cmpl 0xc(%rax), %r12d
jg 0x3f45
xorl %eax, %eax
cmpq $0x1e, %rax
je 0x3caf
andq $0x0, 0x70(%rsp,%rax,8)
incq %rax
jmp 0x3c9e
movq 0x7322(%rip), %rdi      # 0xafd8
leaq 0x34c9(%rip), %rsi      # 0x7186
callq 0x31c0
movq %rax, %rdi
movl %r12d, %esi
callq 0x32a0
movq %rax, %rdi
callq 0x30c0
movq %rax, %rdi
callq 0x30c0
xorl %eax, %eax
testl %r12d, %r12d
movl $0x0, %ecx
cmovgl %r12d, %ecx
movq %rcx, 0x40(%rsp)
movl %r12d, 0x14(%rsp)
cmpl 0x20(%rsp), %eax
je 0x3e67
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movl %r12d, %esi
callq *(%rax)
movq %rax, 0x8(%rsp)
movq %rax, %rdi
movl %r12d, %esi
callq 0x6355
movq %rax, %r14
movq 0x28(%rsp), %rax
movq (%rax), %rbp
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
xorl %r15d, %r15d
cmpq 0x48(%rsp), %rbp
je 0x3dc8
movq (%rbp), %rbx
callq 0x3100
movq %rax, %r13
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
movl %r12d, %edx
callq *(%rax)
callq 0x3100
subl %r13d, %eax
cvtsi2sd %eax, %xmm0
divsd 0x38(%rsp), %xmm0
divsd 0x328f(%rip), %xmm0     # 0x7008
mulsd 0x328f(%rip), %xmm0     # 0x7010
addsd 0x70(%rsp,%r15,8), %xmm0
movsd %xmm0, 0x70(%rsp,%r15,8)
movq 0x8(%rsp), %r13
movq %r14, %rbx
movq 0x40(%rsp), %r12
subq $0x1, %r12
jb 0x3db7
movq %rbx, %rdi
movq %r13, %rsi
callq 0x30f0
addq $0x20, %rbx
addq $0x20, %r13
jmp 0x3d9c
incq %r15
addq $0x8, %rbp
movl 0x14(%rsp), %r12d
jmp 0x3d3a
movq 0x8(%rsp), %rax
testq %rax, %rax
movl $0xffffff4f, %ebp       # imm = 0xFFFFFF4F
je 0x3e18
movq -0x8(%rax), %r13
testq %r13, %r13
je 0x3dff
movq 0x8(%rsp), %rax
leaq -0x20(%rax), %rbx
movq %r13, %r15
shlq $0x5, %r15
leaq (%rbx,%r15), %rdi
callq 0x30b0
addq $-0x20, %r15
jne 0x3df0
movq 0x8(%rsp), %rdi
addq $-0x8, %rdi
shlq $0x5, %r13
orq $0x8, %r13
movq %r13, %rsi
callq 0x32f0
testq %r14, %r14
je 0x3e5c
movq -0x8(%r14), %r15
testq %r15, %r15
je 0x3e40
leaq -0x20(%r14), %rbx
movq %r15, %r12
shlq $0x5, %r12
leaq (%rbx,%r12), %rdi
callq 0x30b0
addq $-0x20, %r12
jne 0x3e31
addq $-0x8, %r14
shlq $0x5, %r15
orq $0x8, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x32f0
movl 0x14(%rsp), %r12d
movl 0x24(%rsp), %eax
incl %eax
jmp 0x3cf5
movq 0x28(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x8(%rax), %r14
xorl %r15d, %r15d
movq 0x8(%rsp), %rax
addq %r15, %rax
cmpq %r14, %rax
je 0x3f31
movq (%rax), %rsi
movq 0x7142(%rip), %r13      # 0xafd8
movq (%r13), %rax
movq -0x18(%rax), %rcx
movq 0x30(%rsp), %rdx
movq %rdx, 0x10(%r13,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
andl %ebp, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r13,%rax)
movq (%rsi), %rax
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq *0x8(%rax)
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3180
movq %rax, %rdi
leaq 0x32ac(%rip), %rsi      # 0x718a
callq 0x31c0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0xa, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl %ebp, %edx
orl $0x80, %edx
movl %edx, 0x18(%rax,%rcx)
movsd 0x70(%rsp,%r15), %xmm0
movq %rax, %rdi
callq 0x3270
movq %rax, %rdi
callq 0x30c0
leaq 0x50(%rsp), %rdi
callq 0x30b0
addq $0x8, %r15
jmp 0x3e7b
movq 0x70a0(%rip), %rdi      # 0xafd8
callq 0x30c0
addl %r12d, %r12d
jmp 0x3c8d
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x30b0
movq %rbx, %rdi
callq 0x32c0