// File: /workspace/github_cpp_makefile_star2_O2/kkloberdanz[P]Sort/main.cpp
// Function: timeAnalysis()
void timeAnalysis() {

    srand(time(0));
    std::vector<int> V;
    std::vector<int> Vcopy;
    std::vector<int> sortedVector;

    const uint64_t MAX_LOOPS = 400000000;

    std::cout << "Size, ";
    //std::cout << "Insertion, ";
    std::cout << "Quick, ";
    std::cout << "std::sort\n";

    for (uint64_t j = 2; j < MAX_LOOPS; j = j * 2) {
        for (uint64_t i = 0; i < j; i++) {
            V.push_back(rand() % 100);
        }

        clock_t startTime = clock();
        std::cout << V.size() << ", ";
        /*
        sortedVector = kgk::sort(V, "insertion");
        std::cout << 
            1000*(double)(clock() - startTime)/CLOCKS_PER_SEC 
            << "ms, ";
        sortedVector.clear();
        //V.clear();
        */

        startTime = clock();
        std::cout << "Unsorted: ";
        printVector(V);
        std::cout << std::endl;
        sortedVector = kgk::sort(V, "quick");
        std::cout << 
            1000*(double)(clock() - startTime)/CLOCKS_PER_SEC
            << "ms, ";
        std::cout << "kgk::sort Sorted vector: ";
        printVector(sortedVector);
        sortedVector.clear();
        //V.clear();

        Vcopy = V;
        startTime = clock();
        std::sort(Vcopy.begin(), Vcopy.end());
        std::cout << 
            1000*(double)(clock() - startTime)/CLOCKS_PER_SEC
            << "ms " << std::endl;
        Vcopy.clear();
        V.clear();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
xorl %edi, %edi
callq 0x10f0
movl %eax, %edi
callq 0x1110
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
movapd %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
movapd %xmm0, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
movq 0x4cae(%rip), %rdi      # 0x5fd8
leaq 0x1ce7(%rip), %rsi      # 0x3018
callq 0x1120
movq 0x4c9b(%rip), %rdi      # 0x5fd8
leaq 0x1cdb(%rip), %rsi      # 0x301f
callq 0x1120
movq 0x4c88(%rip), %rdi      # 0x5fd8
leaq 0x1cd0(%rip), %rsi      # 0x3027
callq 0x1120
pushq $0x2
popq %rax
leaq 0x30(%rsp), %r13
leaq 0xc0(%rsp), %r14
pushq $0x64
popq %r12
movq %rax, %rbp
movq %rax, 0x70(%rsp)
cmpq $0x17d783ff, %rax       # imm = 0x17D783FF
ja 0x159e
subq $0x1, %rbp
jb 0x13a7
callq 0x1030
cltd
idivl %r12d
movl %edx, 0xc0(%rsp)
movq %r13, %rdi
movq %r14, %rsi
callq 0x1d58
jmp 0x1384
callq 0x10a0
movq 0x38(%rsp), %rsi
subq 0x30(%rsp), %rsi
sarq $0x2, %rsi
movq 0x4c17(%rip), %rdi      # 0x5fd8
callq 0x10b0
movq %rax, %rdi
leaq 0x1c4c(%rip), %rsi      # 0x301c
callq 0x1120
callq 0x10a0
movq %rax, %rbp
movq 0x4bf4(%rip), %rdi      # 0x5fd8
leaq 0x1c47(%rip), %rsi      # 0x3032
callq 0x1120
leaq 0xa8(%rsp), %rdi
movq %r13, %rsi
callq 0x1a2e
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
callq 0x19cc
movq %rbx, %rdi
callq 0x1d4a
movq 0x4bb9(%rip), %rdi      # 0x5fd8
callq 0x1080
leaq 0x90(%rsp), %rdi
movq %r13, %rsi
callq 0x1a2e
leaq 0xd8(%rsp), %r15
movq %r15, %rdi
leaq 0x1bf7(%rip), %rsi      # 0x303d
leaq 0xf(%rsp), %rdx
callq 0x1060
movq %r14, %rdi
leaq 0x90(%rsp), %rbx
movq %rbx, %rsi
movq %r15, %rdx
callq 0x1a7b
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
callq 0x2032
movq %r14, %rdi
callq 0x1d4a
movq %r15, %rdi
callq 0x1070
movq %rbx, %rdi
callq 0x1d4a
callq 0x10a0
subq %rbp, %rax
cvtsi2sd %rax, %xmm0
mulsd 0x1b68(%rip), %xmm0     # 0x3008
divsd 0x1b68(%rip), %xmm0     # 0x3010
movq 0x4b29(%rip), %rdi      # 0x5fd8
callq 0x1170
movq %rax, %rdi
leaq 0x1b85(%rip), %rsi      # 0x3043
callq 0x1120
movq 0x4b0e(%rip), %rdi      # 0x5fd8
leaq 0x1b77(%rip), %rsi      # 0x3048
callq 0x1120
leaq 0x78(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x1a2e
leaq 0x78(%rsp), %rbx
movq %rbx, %rdi
callq 0x19cc
movq %rbx, %rdi
callq 0x1d4a
movq 0x50(%rsp), %rax
cmpq %rax, 0x58(%rsp)
je 0x150b
movq %rax, 0x58(%rsp)
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x1afc
callq 0x10a0
movq %rax, %rbp
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x20b5
callq 0x10a0
subq %rbp, %rax
cvtsi2sd %rax, %xmm0
mulsd 0x1ac4(%rip), %xmm0     # 0x3008
divsd 0x1ac4(%rip), %xmm0     # 0x3010
movq 0x4a85(%rip), %rdi      # 0x5fd8
callq 0x1170
movq %rax, %rdi
leaq 0x1b00(%rip), %rsi      # 0x3062
callq 0x1120
movq %rax, %rdi
callq 0x1080
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0x1580
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x1591
movq %rax, 0x38(%rsp)
movq 0x70(%rsp), %rax
addq %rax, %rax
jmp 0x1370
leaq 0x50(%rsp), %rdi
callq 0x1d4a
leaq 0x10(%rsp), %rdi
callq 0x1d4a
leaq 0x30(%rsp), %rdi
callq 0x1d4a
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x160f
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
jmp 0x1604
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x1070
jmp 0x15f2
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
jmp 0x1604
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x1d4a
jmp 0x1612
jmp 0x160f
jmp 0x160f
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x1d4a
leaq 0x10(%rsp), %rdi
callq 0x1d4a
leaq 0x30(%rsp), %rdi
callq 0x1d4a
movq %rbx, %rdi
callq 0x11a0