// File: yasz24[P]eau2/src/network/./../application/../store/../utils/map.h
// Function: Map::add(Object*, Object*)
void add(Object* key, Object* value) {
      //std::cout << "Map put: " << "key: " << key->serialize() << " val: " << value->serialize() << "\n";
      size_t key_hash = key->hash();
      //std::cout << "put hash" << key_hash << "\n";
      KeyVal *key_val = new KeyVal(key, value);
      size_t index = key_hash % this->numBuckets_;
      //std::cout << "map put queue index: " << index << "\n";
      Queue *queue_at_index = dynamic_cast<Queue*>(this->buckets_->get(index));
      if (queue_at_index->size() == 0) {
        this->bucketsUsed_ += 1;
        if (((float) this->bucketsUsed_ / (float) this->numBuckets_) > 0.75) {
          this->rehash_();
        }
      } 
      if (queue_at_index->get(key_val) == nullptr) {
        queue_at_index->add(key_val);
      } else {
        Object* removed = this->pop_item(key);
        //String *before  = dynamic_cast<String*>(key_val->getVal());
        queue_at_index->add(key_val);
        //String *after  = dynamic_cast<String*>(this->get(key));
      }
      this->items_ += 1;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, -0x20(%rbp)
movl $0x20, %edi
callq 0x8290
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xee50
jmp 0xf2b3
movq -0x60(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
xorl %edx, %edx
divq 0x10(%rcx)
movq -0x60(%rbp), %rax
movq %rdx, -0x40(%rbp)
movq 0x28(%rax), %rdi
movq -0x40(%rbp), %rsi
movq (%rdi), %rax
callq *0x40(%rax)
movq %rax, -0x68(%rbp)
cmpq $0x0, %rax
je 0xf324
movq -0x68(%rbp), %rdi
leaq 0x2adcc(%rip), %rsi     # 0x3a0c0
leaq 0x2b56d(%rip), %rdx     # 0x3a868
xorl %eax, %eax
movl %eax, %ecx
callq 0x82f0
movq %rax, -0x70(%rbp)
jmp 0xf32c
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x8260
jmp 0xf473
xorl %eax, %eax
movq %rax, -0x70(%rbp)
jmp 0xf32c
movq -0x70(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0xea20
cmpq $0x0, %rax
jne 0xf41a
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rcx
incq %rcx
movq %rcx, 0x18(%rax)
movq 0x10(%rax), %rcx
movq %rcx, -0x80(%rbp)
movq 0x18(%rax), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x78(%rbp)
testq %rax, %rax
movss %xmm0, -0x74(%rbp)
js 0xf397
movss -0x78(%rbp), %xmm0
movss %xmm0, -0x74(%rbp)
movq -0x80(%rbp), %rax
movss -0x74(%rbp), %xmm0
movss %xmm0, -0x8c(%rbp)
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x88(%rbp)
testq %rax, %rax
movss %xmm0, -0x84(%rbp)
js 0xf3e9
movss -0x88(%rbp), %xmm0
movss %xmm0, -0x84(%rbp)
movss -0x8c(%rbp), %xmm0
movss -0x84(%rbp), %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x1ccb7(%rip), %xmm1    # 0x2c0c0
ucomisd %xmm1, %xmm0
jbe 0xf418
movq -0x60(%rbp), %rdi
callq 0xf480
jmp 0xf41a
movq -0x48(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xeea0
cmpq $0x0, %rax
jne 0xf43c
movq -0x48(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xf670
jmp 0xf45a
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xf740
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xf670
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
addq $0x90, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x8400
nopl (%rax)