// File: sgalkina[P]data_structures/src/test_map.h
// Function: gtl::map_comparison_test<gtl::vector_map<int, int>, gtl::vector_map<int, int>>::compare_random_queries()
void map_comparison_test<T, U>::compare_random_queries() {
  T map1;
  U map2;
  int MAX = 1000;
  for (size_t i = 0; i < MAX*MAX; ++i) {
    int element = rand() % MAX;
    assert(map1.add(element, element) == map2.add(element, element));
    assert(map1.add(element, element*2) == map2.add(element, element*2));
  }
  for (size_t i = 0; i < MAX/2; ++i) {
    int element = rand() % MAX;
    assert(map1.remove(element) == map2.remove(element));
  }
  for (size_t i = 0; i < MAX*2; ++i) {
    int element = rand() % MAX;
    if (bool(map1.lookup(element))) {
      assert(*map1.lookup(element) == *map2.lookup(element));
    } else {
      assert(map1.lookup(element) == map2.lookup(element));
    }
    assert(map1.contains_key(element) == map2.contains_key(element));
  }
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, 0xd0(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0x67f0
leaq 0xa0(%rsp), %rdi
callq 0x67f0
jmp 0x48db
movl $0x3e8, 0x90(%rsp) # imm = 0x3E8
movq $0x0, 0x88(%rsp)
movq 0x88(%rsp), %rax
movl 0x90(%rsp), %ecx
imull 0x90(%rsp), %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jae 0x4a93
callq 0x2050
movl 0x90(%rsp), %ecx
cltd
idivl %ecx
movl %edx, 0x84(%rsp)
movl 0x84(%rsp), %edx
leaq 0xb8(%rsp), %rdi
leaq 0x84(%rsp), %rsi
callq 0x6860
movb %al, 0x63(%rsp)
jmp 0x494d
movb 0x63(%rsp), %al
movzbl %al, %eax
andl $0x1, %eax
movl %eax, 0x5c(%rsp)
movl 0x84(%rsp), %edx
leaq 0xa0(%rsp), %rdi
leaq 0x84(%rsp), %rsi
callq 0x6860
movb %al, 0x62(%rsp)
jmp 0x497d
movl 0x5c(%rsp), %eax
movb 0x62(%rsp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x4991
jmp 0x49ef
leaq 0xa3ef(%rip), %rdi      # 0xed87
leaq 0x9965(%rip), %rsi      # 0xe304
movl $0x69, %edx
leaq 0xa415(%rip), %rcx      # 0xedc0
callq 0x2080
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x4d34
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x6b20
jmp 0x4d34
movl 0x84(%rsp), %edx
addl %edx, %edx
leaq 0xb8(%rsp), %rdi
leaq 0x84(%rsp), %rsi
callq 0x6860
movb %al, 0x5b(%rsp)
jmp 0x4a13
movb 0x5b(%rsp), %al
movzbl %al, %eax
andl $0x1, %eax
movl %eax, 0x54(%rsp)
movl 0x84(%rsp), %edx
addl %edx, %edx
leaq 0xa0(%rsp), %rdi
leaq 0x84(%rsp), %rsi
callq 0x6860
movb %al, 0x5a(%rsp)
jmp 0x4a45
movl 0x54(%rsp), %eax
movb 0x5a(%rsp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x4a59
jmp 0x4a78
leaq 0xa40d(%rip), %rdi      # 0xee6d
leaq 0x989d(%rip), %rsi      # 0xe304
movl $0x6a, %edx
leaq 0xa34d(%rip), %rcx      # 0xedc0
callq 0x2080
jmp 0x4a7a
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
jmp 0x48f2
movq $0x0, 0x78(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x48(%rsp)
movl 0x90(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq 0x48(%rsp), %rax
movslq %ecx, %rcx
cmpq %rcx, %rax
jae 0x4b61
callq 0x2050
movl 0x90(%rsp), %ecx
cltd
idivl %ecx
movl %edx, 0x74(%rsp)
leaq 0xb8(%rsp), %rdi
leaq 0x74(%rsp), %rsi
callq 0x6910
movb %al, 0x47(%rsp)
jmp 0x4af3
movb 0x47(%rsp), %al
movzbl %al, %eax
andl $0x1, %eax
movl %eax, 0x40(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x74(%rsp), %rsi
callq 0x6910
movb %al, 0x46(%rsp)
jmp 0x4b19
movl 0x40(%rsp), %eax
movb 0x46(%rsp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x4b2d
jmp 0x4b4c
leaq 0xa376(%rip), %rdi      # 0xeeaa
leaq 0x97c9(%rip), %rsi      # 0xe304
movl $0x6e, %edx
leaq 0xa279(%rip), %rcx      # 0xedc0
callq 0x2080
jmp 0x4b4e
movq 0x78(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x78(%rsp)
jmp 0x4a9c
movq $0x0, 0x68(%rsp)
movq 0x68(%rsp), %rax
movl 0x90(%rsp), %ecx
shll %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jae 0x4d12
callq 0x2050
movl 0x90(%rsp), %ecx
cltd
idivl %ecx
movl %edx, 0x64(%rsp)
leaq 0xb8(%rsp), %rdi
leaq 0x64(%rsp), %rsi
callq 0x68e0
movq %rax, 0x38(%rsp)
jmp 0x4bb0
movq 0x38(%rsp), %rax
cmpq $0x0, %rax
je 0x4c28
leaq 0xb8(%rsp), %rdi
leaq 0x64(%rsp), %rsi
callq 0x68e0
movq %rax, 0x30(%rsp)
jmp 0x4bd4
movq 0x30(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x24(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x64(%rsp), %rsi
callq 0x68e0
movq %rax, 0x28(%rsp)
jmp 0x4bf8
movl 0x24(%rsp), %eax
movq 0x28(%rsp), %rcx
cmpl (%rcx), %eax
jne 0x4c07
jmp 0x4c26
leaq 0xa2c9(%rip), %rdi      # 0xeed7
leaq 0x96ef(%rip), %rsi      # 0xe304
movl $0x73, %edx
leaq 0xa19f(%rip), %rcx      # 0xedc0
callq 0x2080
jmp 0x4c8c
leaq 0xb8(%rsp), %rdi
leaq 0x64(%rsp), %rsi
callq 0x68e0
movq %rax, 0x18(%rsp)
jmp 0x4c41
leaq 0xa0(%rsp), %rdi
leaq 0x64(%rsp), %rsi
callq 0x68e0
movq %rax, 0x10(%rsp)
jmp 0x4c5a
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq %rcx, %rax
jne 0x4c6b
jmp 0x4c8a
leaq 0xa294(%rip), %rdi      # 0xef06
leaq 0x968b(%rip), %rsi      # 0xe304
movl $0x75, %edx
leaq 0xa13b(%rip), %rcx      # 0xedc0
callq 0x2080
jmp 0x4c8c
leaq 0xb8(%rsp), %rdi
leaq 0x64(%rsp), %rsi
callq 0x6810
movb %al, 0xf(%rsp)
jmp 0x4ca4
movb 0xf(%rsp), %al
movzbl %al, %eax
andl $0x1, %eax
movl %eax, 0x8(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x64(%rsp), %rsi
callq 0x6810
movb %al, 0xe(%rsp)
jmp 0x4cca
movl 0x8(%rsp), %eax
movb 0xe(%rsp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x4cde
jmp 0x4cfd
leaq 0xa24e(%rip), %rdi      # 0xef33
leaq 0x9618(%rip), %rsi      # 0xe304
movl $0x77, %edx
leaq 0xa0c8(%rip), %rcx      # 0xedc0
callq 0x2080
jmp 0x4cff
movq 0x68(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x68(%rsp)
jmp 0x4b6a
leaq 0xa0(%rsp), %rdi
callq 0x6b20
leaq 0xb8(%rsp), %rdi
callq 0x6b20
addq $0xd8, %rsp
retq
leaq 0xb8(%rsp), %rdi
callq 0x6b20
movq 0x98(%rsp), %rdi
callq 0x21a0
nop