// File: emilisb[P]OOP-4/src/main.cpp
// Function: main
int main(int argc, const char * argv[]) {
    for (size_t i = 10000; i <= 100000000; i *= 10) {
        benchmarkInsert(i);
        benchmarkResize(i);
    }

    vector<TestObject> numbers;
    
    TestObject object("hello");
    for (int i = 0; i < 10; i++) {
        numbers.push_back(object);
    }
    
    numbers.erase(numbers.begin(), numbers.begin() + 1);
    
    for (int i = 0; i < numbers.size(); i++) {
        std::cout << numbers.at(i)._value << std::endl;
    }

    std::cout << numbers.size() << std::endl;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x2710, -0x18(%rbp)    # imm = 0x2710
cmpq $0x5f5e100, -0x18(%rbp) # imm = 0x5F5E100
ja 0x28b8
movq -0x18(%rbp), %rdi
callq 0x23e0
movq -0x18(%rbp), %rdi
callq 0x2610
imulq $0xa, -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x2891
leaq -0x38(%rbp), %rdi
callq 0x2e80
leaq -0x79(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x2270
movq -0xa0(%rbp), %rdx
leaq 0x27c8(%rip), %rsi      # 0x50a7
leaq -0x78(%rbp), %rdi
callq 0x2f00
jmp 0x28ea
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x2fb0
jmp 0x28f9
leaq -0x78(%rbp), %rdi
callq 0x20e0
leaq -0x79(%rbp), %rdi
callq 0x21c0
movl $0x0, -0x90(%rbp)
cmpl $0xa, -0x90(%rbp)
jge 0x299d
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3020
jmp 0x292d
jmp 0x292f
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
jmp 0x2915
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x296f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x20e0
leaq -0x79(%rbp), %rdi
callq 0x21c0
jmp 0x2ae1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x32b0
jmp 0x2ae1
leaq -0x38(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x31c0
movq -0xb0(%rbp), %rdi
movq %rax, -0xa8(%rbp)
callq 0x31c0
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq %rax, %rdx
addq $0x20, %rdx
callq 0x30b0
jmp 0x29dc
movl $0x0, -0x94(%rbp)
movslq -0x94(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x31e0
movq %rax, -0xb8(%rbp)
jmp 0x2a06
movq -0xc0(%rbp), %rax
movq -0xb8(%rbp), %rcx
cmpq %rcx, %rax
jae 0x2a79
movslq -0x94(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x3200
movq %rax, -0xc8(%rbp)
jmp 0x2a32
movq -0xc8(%rbp), %rsi
movq 0x5588(%rip), %rdi      # 0x7fc8
callq 0x2160
movq %rax, -0xd0(%rbp)
jmp 0x2a4e
movq -0xd0(%rbp), %rdi
movq 0x555c(%rip), %rsi      # 0x7fb8
callq 0x21a0
jmp 0x2a63
jmp 0x2a65
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x29e6
leaq -0x38(%rbp), %rdi
callq 0x31e0
movq %rax, -0xd8(%rbp)
jmp 0x2a8b
movq -0xd8(%rbp), %rsi
movq 0x552f(%rip), %rdi      # 0x7fc8
callq 0x2060
movq %rax, -0xe0(%rbp)
jmp 0x2aa7
movq -0xe0(%rbp), %rdi
movq 0x5503(%rip), %rsi      # 0x7fb8
callq 0x21a0
jmp 0x2abc
movl $0x0, -0x4(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x32b0
leaq -0x38(%rbp), %rdi
callq 0x3310
movl -0x4(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x3310
movq -0x88(%rbp), %rdi
callq 0x2260
nopw %cs:(%rax,%rax)