// File: /workspace/github_cpp_makefile_star2_O1/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, 0x4(%rsp)
movq %rdi, 0x18(%rsp)
movq (%rsi), %r14
movq %rsi, 0x28(%rsp)
movq 0x8(%rsi), %r15
cmpq %r15, %r14
je 0x3fb6
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq 0x80(%rsp), %r12
leaq 0x70(%rsp), %rbx
movq (%r14), %rsi
movq (%rsi), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movl 0x78(%rsp), %r13d
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x3f9c
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x31c0
cmpl %r13d, %ebp
cmovlel %r13d, %ebp
addq $0x8, %r14
cmpq %r15, %r14
jne 0x3f71
movslq %ebp, %rax
movq %rax, 0x20(%rsp)
jmp 0x3fbf
movq $-0x1, 0x20(%rsp)
movq 0x18(%rsp), %rax
movl 0x8(%rax), %ebp
cmpl 0xc(%rax), %ebp
jg 0x4361
cvtsi2sdl 0x4(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
movq 0x6ff5(%rip), %r13      # 0xafd8
movl $0xf0, %edx
leaq 0x70(%rsp), %rdi
xorl %esi, %esi
callq 0x30d0
movl $0x6, %edx
movq %r13, %rdi
leaq 0x3183(%rip), %rsi      # 0x7186
callq 0x31e0
movq %r13, %rdi
movl %ebp, %esi
callq 0x3280
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x30f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x30f0
cmpl $0x0, 0x4(%rsp)
jle 0x421c
movl %ebp, %eax
movq %rax, 0x60(%rsp)
xorl %eax, %eax
movl %ebp, 0xc(%rsp)
movl %eax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movl %ebp, %esi
callq *(%rax)
movq %rax, 0x30(%rsp)
movq %rax, %rdi
movl %ebp, %esi
callq 0x6cb5
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %r13
movq 0x8(%rax), %rax
movq %rax, 0x68(%rsp)
cmpq %rax, %r13
je 0x414e
xorl %ebx, %ebx
movq (%r13), %r15
callq 0x30e0
movq %rax, %rbp
movq (%r15), %rax
movq %r15, %rdi
movq 0x10(%rsp), %r12
movq %r12, %rsi
movl 0xc(%rsp), %r14d
movl %r14d, %edx
callq *(%rax)
callq 0x30e0
subl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x58(%rsp), %xmm0
divsd 0x2f07(%rip), %xmm0     # 0x7008
mulsd 0x2f07(%rip), %xmm0     # 0x7010
addsd 0x70(%rsp,%rbx,8), %xmm0
movsd %xmm0, 0x70(%rsp,%rbx,8)
movq 0x60(%rsp), %rbp
movq 0x30(%rsp), %r15
testl %r14d, %r14d
jle 0x413c
movq %r12, %rdi
movq %r15, %rsi
callq 0x30c0
addq $0x20, %r12
addq $0x20, %r15
decq %rbp
jne 0x4124
incq %rbx
addq $0x8, %r13
cmpq 0x68(%rsp), %r13
jne 0x40c1
movq 0x30(%rsp), %r14
testq %r14, %r14
movl 0xc(%rsp), %ebp
movq 0x6e77(%rip), %r13      # 0xafd8
je 0x41ad
movq -0x8(%r14), %r15
testq %r15, %r15
je 0x4196
leaq -0x10(%r14), %rbx
movq %r15, %r12
shlq $0x5, %r12
leaq (%rbx,%r12), %rax
movq -0x10(%rbx,%r12), %rdi
cmpq %rdi, %rax
je 0x4190
movq (%rax), %rsi
incq %rsi
callq 0x31c0
addq $-0x20, %r12
jne 0x4177
addq $-0x8, %r14
shlq $0x5, %r15
orq $0x8, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x32d0
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
movl 0x8(%rsp), %eax
je 0x4210
movq -0x8(%rcx), %rbx
testq %rbx, %rbx
je 0x41f3
movq 0x10(%rsp), %rax
leaq -0x10(%rax), %r15
movq %rbx, %r12
shlq $0x5, %r12
leaq (%r15,%r12), %rax
movq -0x10(%r15,%r12), %rdi
cmpq %rdi, %rax
je 0x41ed
movq (%rax), %rsi
incq %rsi
callq 0x31c0
addq $-0x20, %r12
jne 0x41d4
movq 0x10(%rsp), %rdi
addq $-0x8, %rdi
shlq $0x5, %rbx
orq $0x8, %rbx
movq %rbx, %rsi
callq 0x32d0
movl 0x8(%rsp), %eax
incl %eax
cmpl 0x4(%rsp), %eax
jne 0x407e
movq 0x28(%rsp), %rax
movq (%rax), %r14
movq 0x8(%rax), %r15
cmpq %r15, %r14
je 0x4329
xorl %r12d, %r12d
movq (%r14,%r12), %rsi
movq (%r13), %rax
movq -0x18(%rax), %rcx
movq 0x20(%rsp), %rdx
movq %rdx, 0x10(%r13,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r13,%rax)
movq (%rsi), %rax
leaq 0x38(%rsp), %rdi
callq *0x8(%rax)
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %r13, %rdi
callq 0x31e0
movq %rax, %rbx
movl $0x2, %edx
movq %rax, %rdi
leaq 0x2ef9(%rip), %rsi      # 0x718a
callq 0x31e0
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movq $0xa, 0x10(%rbx,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x80, %ecx
movl %ecx, 0x18(%rbx,%rax)
movsd 0x70(%rsp,%r12), %xmm0
movq %rbx, %rdi
callq 0x3250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x30f0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x4314
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x31c0
leaq (%r14,%r12), %rax
addq $0x8, %rax
addq $0x8, %r12
cmpq %r15, %rax
jne 0x4234
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x31a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x30f0
addl %ebp, %ebp
movq 0x18(%rsp), %rax
cmpl 0xc(%rax), %ebp
jle 0x3fe3
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x4392
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x31c0
movq %rbx, %rdi
callq 0x32a0