// File: cjc12[P]ezSTL/src/../include/unordered_map.h
// Function: ezSTL::unordered_map<int, int, ezSTL::hash<int>, ezSTL::equal_to<int>>::insert(ezSTL::pair<int, int> const&)
void unordered_map<Key, Value, Hash, KeyEqual>::insert(const pair<Key, Value>& p) {
		auto ite = find(p.first);
		// if key does not exists
		if (ite == end()) {
			size_type index = Hash()(p.first) % buckets.size();
			if (!buckets[index])
				buckets[index] = new list<pair<Key, Value>>();
			buckets[index]->push_front(p);
			++__size;
		}
		// else replace the value
		else *ite = p.second;
		// if load_factor > max_load_factor, then rehash
		if (static_cast<double>(size()) / bucket_size() > max_load_factor) {
			// get next bucket size by predetermined primes
			size_type new_size = next_prime(bucket_size());
			// if not changed, return directly
			if (new_size == bucket_size()) return;
			else {
				unordered_map<Key, Value, Hash, KeyEqual> temp = *this;
				clear();
				// resize buckets
				buckets.resize(new_size);
				end_iterator.bucket = new_size;
				// insert each pair from old unordered_map to new one
				for (auto ite = temp.begin(); ite != temp.end(); ++ite)
					insert(make_pair(ite.get_key(), *ite));
			}
		}
	}

// Assembly:
subq $0x138, %rsp            # imm = 0x138
movq %rdi, 0x130(%rsp)
movq %rsi, 0x128(%rsp)
movq 0x130(%rsp), %rsi
movq %rsi, 0x38(%rsp)
movq 0x128(%rsp), %rdx
leaq 0x108(%rsp), %rdi
callq 0xe350
movq 0x38(%rsp), %rsi
leaq 0xe8(%rsp), %rdi
callq 0xe4d0
leaq 0x108(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x14d60
testb $0x1, %al
jne 0xe0a9
jmp 0xe17f
movq 0x128(%rsp), %rsi
leaq 0xe3(%rsp), %rdi
callq 0x14e10
movq 0x38(%rsp), %rdi
movl %eax, 0x34(%rsp)
callq 0x144b0
movq 0x38(%rsp), %rdi
movl %eax, %ecx
movl 0x34(%rsp), %eax
xorl %edx, %edx
divl %ecx
movl %edx, 0xe4(%rsp)
movl 0xe4(%rsp), %esi
callq 0x14d30
cmpq $0x0, (%rax)
jne 0xe14e
movl $0x10, %edi
callq 0x2230
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x28(%rsp)
callq 0x14e40
jmp 0xe110
movq 0x38(%rsp), %rdi
movl 0xe4(%rsp), %esi
callq 0x14d30
movq 0x28(%rsp), %rcx
movq %rcx, (%rax)
jmp 0xe14e
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
callq 0x2200
jmp 0xe33e
movq 0x38(%rsp), %rdi
movl 0xe4(%rsp), %esi
callq 0x14d30
movq (%rax), %rdi
movq 0x128(%rsp), %rsi
callq 0x14ed0
movq 0x38(%rsp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
jmp 0xe1a1
movq 0x128(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x24(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x14990
movl 0x24(%rsp), %ecx
movl %ecx, (%rax)
movq 0x38(%rsp), %rdi
callq 0x14840
movq 0x38(%rsp), %rdi
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x18(%rsp)
callq 0x14850
movsd 0x18(%rsp), %xmm0
movl %eax, %eax
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movsd 0x17e35(%rip), %xmm1    # 0x26010
ucomisd %xmm1, %xmm0
jbe 0xe336
movq 0x38(%rsp), %rdi
callq 0x14850
movl %eax, %edi
callq 0x14f70
movq 0x38(%rsp), %rdi
movl %eax, 0xd0(%rsp)
movl 0xd0(%rsp), %eax
movl %eax, 0x14(%rsp)
callq 0x14850
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jne 0xe221
jmp 0xe336
movq 0x38(%rsp), %rsi
leaq 0x90(%rsp), %rdi
callq 0xe610
movq 0x38(%rsp), %rdi
callq 0xe9b0
jmp 0xe23f
movq 0x38(%rsp), %rdi
movl 0xd0(%rsp), %esi
callq 0x14fd0
jmp 0xe252
movq 0x38(%rsp), %rax
movl 0xd0(%rsp), %ecx
movl %ecx, 0x38(%rax)
leaq 0x70(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x14880
jmp 0xe275
jmp 0xe277
leaq 0x50(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0xe4d0
jmp 0xe28b
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xe4a0
movb %al, 0x13(%rsp)
jmp 0xe2a0
movb 0x13(%rsp), %al
testb $0x1, %al
jne 0xe2aa
jmp 0xe327
leaq 0x70(%rsp), %rdi
callq 0x14970
movl %eax, 0xc(%rsp)
jmp 0xe2ba
movl 0xc(%rsp), %eax
movl %eax, 0x44(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x14990
movq %rax, %rdx
leaq 0x48(%rsp), %rdi
leaq 0x44(%rsp), %rsi
callq 0xdc30
jmp 0xe2e0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0xe040
jmp 0xe2f1
jmp 0xe2f3
leaq 0x70(%rsp), %rdi
callq 0x149b0
jmp 0xe2ff
jmp 0xe277
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
leaq 0x90(%rsp), %rdi
callq 0xea60
jmp 0xe33e
leaq 0x90(%rsp), %rdi
callq 0xea60
jmp 0xe336
addq $0x138, %rsp            # imm = 0x138
retq
movq 0xd8(%rsp), %rdi
callq 0x2320
nopl (%rax,%rax)