// File: /workspace/github_cpp_makefile_star2_O3/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 0x39fd(%rip), %rdi      # 0x5fc8
leaq 0x1ac1(%rip), %rsi      # 0x4093
movl $0x23, %edx
callq 0x2150
movq 0x39e5(%rip), %rdi      # 0x5fc8
movq %rbx, %rsi
callq 0x20b0
movq %rax, %r14
leaq 0x1a71(%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 0x30c8
movl $0x0, 0xc(%rsp)
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x2679
leaq 0x30(%rsp), %r14
leaq 0xc(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x29bc
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 0x264c
movq 0x3948(%rip), %rdi      # 0x5fc8
leaq 0x19e9(%rip), %rsi      # 0x4070
movl $0xe, %edx
callq 0x2150
movq 0x3930(%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 0x30c8
movl $0x0, 0xc(%rsp)
testq %rbx, %rbx
je 0x2736
xorl %eax, %eax
leaq 0x10(%rsp), %r14
leaq 0xc(%rsp), %r15
xorl %esi, %esi
xorl %ebp, %ebp
xorl %ecx, %ecx
cmpq %rax, %rsi
je 0x2704
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x2719
movq %r14, %rdi
movq %r15, %rdx
callq 0x2e0a
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rax
xorl %ecx, %ecx
cmpq %rax, %rsi
sete %cl
addl %ecx, %ebp
movslq 0xc(%rsp), %rcx
incq %rcx
movl %ecx, 0xc(%rsp)
cmpq %rbx, %rcx
jb 0x26f2
jmp 0x2738
xorl %ebp, %ebp
movq 0x3889(%rip), %rdi      # 0x5fc8
leaq 0x193d(%rip), %rsi      # 0x4083
movl $0xf, %edx
callq 0x2150
movq 0x3871(%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 0x279f
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2140
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x27b7
movq 0x38(%rsp), %rsi
shlq $0x2, %rsi
callq 0x2140
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x27c6
jmp 0x27c6
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x27e0
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2140
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x27f8
movq 0x38(%rsp), %rsi
shlq $0x2, %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x21a0