// File: /workspace/github_cpp_makefile_star2_O1/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 $0xe8, %rsp
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x10f0
movl %eax, %edi
callq 0x1110
movq %rbx, 0x10(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movq %rbx, 0x50(%rsp)
movapd %xmm0, 0x40(%rsp)
movq %rbx, 0x30(%rsp)
movapd %xmm0, 0x20(%rsp)
movq 0x3c80(%rip), %rdi      # 0x4fd8
leaq 0x1cd1(%rip), %rsi      # 0x3030
movl $0x6, %edx
callq 0x1140
movq 0x3c68(%rip), %rdi      # 0x4fd8
leaq 0x1cc0(%rip), %rsi      # 0x3037
movl $0x7, %edx
callq 0x1140
movq 0x3c50(%rip), %rdi      # 0x4fd8
leaq 0x1cb0(%rip), %rsi      # 0x303f
movl $0xa, %edx
callq 0x1140
movl $0x2, %ebx
movq %rsp, %r14
leaq 0x60(%rsp), %r15
movq %rbx, %r12
callq 0x1040
cltq
imulq $0x51eb851f, %rax, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
imull $0x64, %ecx, %ecx
subl %ecx, %eax
movl %eax, 0x60(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x13e6
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x13f1
movq %r14, %rdi
movq %r15, %rdx
callq 0x20a4
decq %r12
jne 0x13a9
callq 0x1080
movq 0x8(%rsp), %rsi
subq (%rsp), %rsi
sarq $0x2, %rsi
movq 0x3bc9(%rip), %rdi      # 0x4fd8
callq 0x1090
movl $0x2, %edx
movq %rax, %rdi
leaq 0x1c11(%rip), %rsi      # 0x3034
callq 0x1140
callq 0x1080
movq %rax, %r12
movl $0xa, %edx
movq 0x3b9c(%rip), %rdi      # 0x4fd8
leaq 0x1c07(%rip), %rsi      # 0x304a
callq 0x1140
leaq 0xd0(%rsp), %rdi
movq %r14, %rsi
callq 0x1cda
leaq 0xd0(%rsp), %rdi
callq 0x1c2a
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x1477
callq 0x1100
movq 0x3b5a(%rip), %rcx      # 0x4fd8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x1120
movsbl %al, %esi
movq 0x3b3c(%rip), %rdi      # 0x4fd8
callq 0x1030
movq %rax, %rdi
callq 0x10a0
leaq 0xb8(%rsp), %rdi
movq %r14, %rsi
callq 0x1cda
leaq 0x90(%rsp), %rax
movq %rax, 0x80(%rsp)
leaq 0x80(%rsp), %r13
movq %r13, %rdi
leaq 0x1b7a(%rip), %rsi      # 0x3055
leaq 0x1b78(%rip), %rdx      # 0x305a
callq 0x234c
movq %r15, %rdi
leaq 0xb8(%rsp), %rsi
movq %r13, %rdx
callq 0x1d5a
movq 0x20(%rsp), %rdi
movaps 0x60(%rsp), %xmm0
movq 0x70(%rsp), %rax
movq %rdi, 0x60(%rsp)
movups 0x28(%rsp), %xmm1
movaps %xmm0, 0x20(%rsp)
movq %rax, 0x30(%rsp)
movups %xmm1, 0x68(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movq $0x0, 0x70(%rsp)
testq %rdi, %rdi
je 0x153d
callq 0x1100
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x154c
callq 0x1100
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x1566
callq 0x1100
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x1578
callq 0x1100
callq 0x1080
subq %r12, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x1a78(%rip), %xmm0     # 0x3008
divsd 0x1a78(%rip), %xmm0     # 0x3010
movq 0x3a39(%rip), %rdi      # 0x4fd8
callq 0x1170
movl $0x4, %edx
movq %rax, %rdi
leaq 0x1aa8(%rip), %rsi      # 0x305b
callq 0x1140
movl $0x19, %edx
movq 0x3a14(%rip), %rdi      # 0x4fd8
leaq 0x1a95(%rip), %rsi      # 0x3060
callq 0x1140
leaq 0xa0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x1cda
leaq 0xa0(%rsp), %rdi
callq 0x1c2a
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x1601
callq 0x1100
movq 0x20(%rsp), %rax
cmpq %rax, 0x28(%rsp)
je 0x1612
movq %rax, 0x28(%rsp)
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x1de0
callq 0x1080
movq %rax, %r12
movq 0x40(%rsp), %r13
movq 0x48(%rsp), %rbp
cmpq %rbp, %r13
je 0x1663
movq %rbp, %rax
subq %r13, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r13, %rdi
movq %rbp, %rsi
callq 0x23dc
movq %r13, %rdi
movq %rbp, %rsi
callq 0x24bf
callq 0x1080
subq %r12, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x198d(%rip), %xmm0     # 0x3008
divsd 0x198d(%rip), %xmm0     # 0x3010
movq 0x394e(%rip), %rdi      # 0x4fd8
callq 0x1170
movq %rax, %r12
movl $0x3, %edx
movq %rax, %rdi
leaq 0x19d9(%rip), %rsi      # 0x307a
callq 0x1140
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x1120
movsbl %al, %esi
movq %r12, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10a0
movq 0x40(%rsp), %rax
cmpq %rax, 0x48(%rsp)
je 0x16df
movq %rax, 0x48(%rsp)
movq (%rsp), %rax
cmpq %rax, 0x8(%rsp)
je 0x16ef
movq %rax, 0x8(%rsp)
leaq (%rbx,%rbx), %rax
cmpq $0xbebc200, %rbx        # imm = 0xBEBC200
movq %rax, %rbx
jb 0x13a6
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1712
callq 0x1100
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1721
callq 0x1100
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x172f
callq 0x1100
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1797
jmp 0x1797
movq %rax, %rbx
jmp 0x1767
movq %rax, %rbx
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x1767
callq 0x1100
movq 0xb8(%rsp), %rdi
jmp 0x1789
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
jmp 0x1789
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x179a
callq 0x1100
jmp 0x179a
jmp 0x1797
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x17a9
callq 0x1100
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x17b8
callq 0x1100
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x17c6
callq 0x1100
movq %rbx, %rdi
callq 0x11a0