// File: /workspace/github_cpp_makefile_star2_O1/emilisb[P]OOP-4/src/main.cpp
// Function: benchmarkResize(unsigned long)
void benchmarkResize(size_t size) {
    vector<int> vec;
    std::vector<int> stdvec;
    int totalRealloc = 0;
    Timer t;

    std::cout << "Benchmark: reallocations inserting " << size << " elements" << std::endl;

    t.start();

    for (int i = 0; i < size; i++) {
        vec.push_back(i);
        if (vec.size() == vec.capacity()) {
            totalRealloc++;
        }
    }

    std::cout << "My vector: << " << totalRealloc << std::endl;

    totalRealloc = 0;
    t.start();

    for (int i = 0; i < size; i++) {
        stdvec.push_back(i);
        if (stdvec.size() == stdvec.capacity()) {
            totalRealloc++;
        }
    }

    std::cout << "STD vector: << " << totalRealloc << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x2130
movq %rax, 0x40(%rsp)
movq %r14, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq %r14, 0x28(%rsp)
movq 0x39eb(%rip), %rdi      # 0x5fc8
leaq 0x1aaf(%rip), %rsi      # 0x4093
movl $0x23, %edx
callq 0x2150
movq 0x39d3(%rip), %rdi      # 0x5fc8
movq %rbx, %rsi
callq 0x20b0
movq %rax, %r14
leaq 0x1a5f(%rip), %rsi      # 0x4066
movl $0x9, %edx
movq %rax, %rdi
callq 0x2150
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
leaq 0x28(%rsp), %rdi
callq 0x30dc
movl $0x0, 0xc(%rsp)
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x268b
leaq 0x30(%rsp), %r14
leaq 0xc(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x29da
movq 0x30(%rsp), %rax
xorl %ecx, %ecx
cmpq 0x38(%rsp), %rax
sete %cl
addl %ecx, %ebp
movslq 0xc(%rsp), %rax
incq %rax
movl %eax, 0xc(%rsp)
cmpq %rbx, %rax
jb 0x265e
movq 0x3936(%rip), %rdi      # 0x5fc8
leaq 0x19d7(%rip), %rsi      # 0x4070
movl $0xe, %edx
callq 0x2150
movq 0x391e(%rip), %rdi      # 0x5fc8
movl %ebp, %esi
callq 0x2190
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
leaq 0x28(%rsp), %rdi
callq 0x30dc
movl $0x0, 0xc(%rsp)
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x2746
leaq 0x10(%rsp), %r14
leaq 0xc(%rsp), %r15
xorl %eax, %eax
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x2719
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x2724
movq %r14, %rdi
movq %r15, %rdx
callq 0x2e24
movq 0x18(%rsp), %rax
xorl %ecx, %ecx
cmpq 0x20(%rsp), %rax
sete %cl
addl %ecx, %ebp
movslq 0xc(%rsp), %rax
incq %rax
movl %eax, 0xc(%rsp)
cmpq %rbx, %rax
jb 0x2700
movq 0x387b(%rip), %rdi      # 0x5fc8
leaq 0x192f(%rip), %rsi      # 0x4083
movl $0xf, %edx
callq 0x2150
movq 0x3863(%rip), %rdi      # 0x5fc8
movl %ebp, %esi
callq 0x2190
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x27ad
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2140
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x27ce
movq 0x38(%rsp), %rsi
shlq $0x2, %rsi
callq 0x2140
movq $0x0, 0x40(%rsp)
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x27dd
jmp 0x27dd
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x27f7
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2140
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x2818
movq 0x38(%rsp), %rsi
shlq $0x2, %rsi
callq 0x2140
movq $0x0, 0x40(%rsp)
movq %rbx, %rdi
callq 0x21a0