// File: yangwanyuan[P]HLKVDS/./src/include/LRUMap.h
// Function: dslab::LRUMap<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Put(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, bool)
bool LRUMap<K,D>::Put(K key , D data, K& update_key, D& update_data, bool same){
    update_key = K();
    update_data = D();
    Node<K,D> *node = cached_map[key];
    bool poped;
    if(node){//key exist
        detach(node);
	if(!same){
	        node->data = data;
	}
        attach(node);
	poped = false;//no data poped out
    }
    else{
        if(free_entries.empty()){
            node = tail->prev;
	    update_key = node->key;
	    update_data = node->data;
            detach(node);
            cached_map.erase(node->key);
	    poped = true;//data poped out
        }
        else{
            node = free_entries.back();
            free_entries.pop_back();
	    poped = false;//no data poped out
        }
        node->key = key;
        node->data = data;
        cached_map[key] = node;
        attach(node);
    }
    return poped;
}

// Assembly:
subq $0xa8, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, 0x20(%rsp)
movb %r9b, %al
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movq %rcx, 0x88(%rsp)
movq %r8, 0x80(%rsp)
andb $0x1, %al
movb %al, 0x7f(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x86a0
movq 0x88(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x85d0
leaq 0x58(%rsp), %rdi
callq 0x8928
leaq 0x38(%rsp), %rdi
callq 0x86a0
movq 0x80(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x85d0
leaq 0x38(%rsp), %rdi
callq 0x8928
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
addq $0x8, %rdi
callq 0x3b4b0
movq (%rax), %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
je 0x3a210
movq 0x18(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x3b4e0
testb $0x1, 0x7f(%rsp)
jne 0x3a1f7
movq 0x10(%rsp), %rsi
movq 0x30(%rsp), %rdi
addq $0x20, %rdi
callq 0x8060
movq 0x18(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x3b520
movb $0x0, 0x2f(%rsp)
jmp 0x3a306
movq 0x18(%rsp), %rdi
addq $0x40, %rdi
callq 0x3b570
testb $0x1, %al
jne 0x3a224
jmp 0x3a287
movq 0x18(%rsp), %rax
movq 0x60(%rax), %rax
movq 0x40(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rsi
movq 0x88(%rsp), %rdi
callq 0x8060
movq 0x30(%rsp), %rsi
addq $0x20, %rsi
movq 0x80(%rsp), %rdi
callq 0x8060
movq 0x18(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x3b4e0
movq 0x18(%rsp), %rdi
addq $0x8, %rdi
movq 0x30(%rsp), %rsi
callq 0x3b5c0
movb $0x1, 0x2f(%rsp)
jmp 0x3a2b0
movq 0x18(%rsp), %rdi
addq $0x40, %rdi
callq 0x3b5f0
movq 0x18(%rsp), %rdi
movq (%rax), %rax
movq %rax, 0x30(%rsp)
addq $0x40, %rdi
callq 0x3b630
movb $0x0, 0x2f(%rsp)
movq 0x20(%rsp), %rsi
movq 0x30(%rsp), %rdi
callq 0x8060
movq 0x10(%rsp), %rsi
movq 0x30(%rsp), %rdi
addq $0x20, %rdi
callq 0x8060
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdi
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x8, %rdi
callq 0x3b4b0
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rdi
movq %rcx, (%rax)
movq 0x30(%rsp), %rsi
callq 0x3b520
movb 0x2f(%rsp), %al
andb $0x1, %al
addq $0xa8, %rsp
retq
nopw %cs:(%rax,%rax)
nop