// File: sgalkina[P]data_structures/src/main.cpp
// Function: vector_removal_operations()
void vector_removal_operations() {
  gtl::vector<memcheck> vect;
  size_t n = 3;
  for (size_t i = 1; i <= n; ++i) {
    memcheck el;
    vect.push_back(el);
  }
  assert(memcheck::get_counter() == n);
  for (size_t i = 1; i <= n; ++i) {
    vect.pop_back();
  }
  assert(memcheck::get_counter() == 0);

  gtl::vector<int> vect_int;
  int el = 100;
  vect_int.push_back(el);
  int int_from_vect = vect_int.pop_back();
  assert(int_from_vect == el);

  vect_int.push_back(1);
  vect_int.push_back(2);
  vect_int.swap_remove(0);
  assert(vect_int.size() == 1);
  assert(vect_int[0] == 2);
}

// Assembly:
subq $0xa8, %rsp
leaq 0x90(%rsp), %rdi
callq 0x2fa0
movq $0x3, 0x88(%rsp)
movq $0x1, 0x80(%rsp)
movq 0x80(%rsp), %rax
cmpq 0x88(%rsp), %rax
ja 0x284e
leaq 0x7c(%rsp), %rdi
callq 0xd180
jmp 0x27ea
leaq 0x90(%rsp), %rdi
leaq 0x7c(%rsp), %rsi
callq 0x3200
jmp 0x27fe
leaq 0x7c(%rsp), %rdi
callq 0xd1b0
movq 0x80(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x80(%rsp)
jmp 0x27cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0x2a6b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
leaq 0x7c(%rsp), %rdi
callq 0xd1b0
jmp 0x2a6b
callq 0xd340
movq %rax, 0x28(%rsp)
jmp 0x285a
movq 0x28(%rsp), %rax
cmpq 0x88(%rsp), %rax
jne 0x286b
jmp 0x288a
leaq 0xb84c(%rip), %rdi      # 0xe0be
leaq 0xb7ac(%rip), %rsi      # 0xe025
movl $0x34, %edx
leaq 0xb856(%rip), %rcx      # 0xe0db
callq 0x2080
movq $0x1, 0x60(%rsp)
movq 0x60(%rsp), %rax
cmpq 0x88(%rsp), %rax
ja 0x28d0
leaq 0x5c(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x3510
jmp 0x28b6
leaq 0x5c(%rsp), %rdi
callq 0xd1b0
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
jmp 0x2893
callq 0xd340
movq %rax, 0x20(%rsp)
jmp 0x28dc
movq 0x20(%rsp), %rax
cmpq $0x0, %rax
jne 0x28e9
jmp 0x2908
leaq 0xb718(%rip), %rdi      # 0xe008
leaq 0xb72e(%rip), %rsi      # 0xe025
movl $0x38, %edx
leaq 0xb7d8(%rip), %rcx      # 0xe0db
callq 0x2080
leaq 0x40(%rsp), %rdi
callq 0x35e0
jmp 0x2914
movl $0x64, 0x3c(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x3c(%rsp), %rsi
callq 0x3610
jmp 0x292d
leaq 0x40(%rsp), %rdi
callq 0x3660
movl %eax, 0x1c(%rsp)
jmp 0x293d
movl 0x1c(%rsp), %eax
movl %eax, 0x38(%rsp)
movl 0x38(%rsp), %eax
cmpl 0x3c(%rsp), %eax
jne 0x2951
jmp 0x298d
leaq 0xb7a4(%rip), %rdi      # 0xe0fc
leaq 0xb6c6(%rip), %rsi      # 0xe025
movl $0x3e, %edx
leaq 0xb770(%rip), %rcx      # 0xe0db
callq 0x2080
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x38a0
jmp 0x2a6b
movl $0x1, 0x34(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x34(%rsp), %rsi
callq 0x36e0
jmp 0x29a6
movl $0x2, 0x30(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x36e0
jmp 0x29bf
xorl %eax, %eax
movl %eax, %esi
leaq 0x40(%rsp), %rdi
callq 0x3730
jmp 0x29cf
leaq 0x40(%rsp), %rdi
callq 0x3810
movq %rax, 0x10(%rsp)
jmp 0x29e0
movq 0x10(%rsp), %rax
cmpq $0x1, %rax
jne 0x29ed
jmp 0x2a0c
leaq 0xb71c(%rip), %rdi      # 0xe110
leaq 0xb62a(%rip), %rsi      # 0xe025
movl $0x43, %edx
leaq 0xb6d4(%rip), %rcx      # 0xe0db
callq 0x2080
xorl %eax, %eax
movl %eax, %esi
leaq 0x40(%rsp), %rdi
callq 0x3820
movq %rax, 0x8(%rsp)
jmp 0x2a21
movq 0x8(%rsp), %rax
cmpl $0x2, (%rax)
jne 0x2a2d
jmp 0x2a4c
leaq 0xb6f1(%rip), %rdi      # 0xe125
leaq 0xb5ea(%rip), %rsi      # 0xe025
movl $0x44, %edx
leaq 0xb694(%rip), %rcx      # 0xe0db
callq 0x2080
leaq 0x40(%rsp), %rdi
callq 0x38a0
leaq 0x90(%rsp), %rdi
callq 0x2f20
addq $0xa8, %rsp
retq
leaq 0x90(%rsp), %rdi
callq 0x2f20
movq 0x70(%rsp), %rdi
callq 0x21a0
nopw %cs:(%rax,%rax)